Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollout multiple updates from develop to main #120

Merged
merged 15 commits into from
Jan 5, 2024
Merged

Rollout multiple updates from develop to main #120

merged 15 commits into from
Jan 5, 2024

Conversation

JustSamuel
Copy link
Contributor

Changelog

  • Migration to express-jsdoc-swagger #114: Migration to express-jsdoc-swagger

    • Transitioned to express-jsdoc-swagger for API documentation. Involved migrating controllers, responses, requests, and some entities. Included fixes for test cases, CI/CD bugs, and logging enhancements.
  • Fix/user openapi docs #101: Fix/user openapi docs

    • Improved OpenAPI documentation for event-related endpoints. Updated UserRequest to UpdateUserRequest in user-controller.ts.
  • Voucher auto ToS accept & restrict users who can go into debt #79: Voucher auto ToS accept & restrict users who can go into debt

    • Implemented automatic Terms of Service acceptance for voucher users. Added functionality to control which users can go into debt, with GEWIS members allowed by default.
  • Feature/Events & planning #48: Feature/Events & planning

    • Developed event and planning features, including BorrelSchema entities, event controllers, and endpoints for event management. Enhanced test coverage and fixed documentation.
  • Parallelize test suite runner #64: Parallelize test suite runner

    • Optimized the test suite by parallelizing the test runner. Adjusted CI configurations to prevent timeouts and improved coverage command for CI efficiency.

Yoronex and others added 6 commits January 2, 2024 17:26
* Parallelize test suite runner

* Remove unnecessary mocha options

* Add max number of jobs to prevent timeouts

* Add separate coverage command to limit workers for ci runner
* Created initial BorrelSchema entities + seeder

* Created borrel-schema controller, service, response and request, update borrel-schema entities

* Created basic GET in controller

* Rename borrel schema and its related entities to events

* Add tests for getEvents function

* Fix and test event update and create functions

* Add getShifts and (soft) delete shift functions

* Add test for create and update shift endpoints

* Add event shift answer update function and tests

* Add first endpoints for events to new controller

* Add PATCH event endpoint

* Add event shift endpoints & fix swagger docs

* Add endpoints to change shift availability and assignment & add type

* Add endpoint to sync event answers and function to send reminder emails

* Register controllers and timed events in production

* Revert package-lock.json

* Add explicit reference to shifts in event entity

* Fix test suite

* Increase EventService & EventController test coverage

* Add endpoint to get number of times users were selected for shifts

* @Yoronex fix ur lint

* Reduce number of workers to prevent timeouts on CI runner

---------

Co-authored-by: Sjoerd <[email protected]>
Co-authored-by: Job van de Ven <[email protected]>
Co-authored-by: Samuel Oosterholt <[email protected]>
* Fix voucher users being required to accept ToS

* Refactor and rename borrelkaart to voucher

* Add attribute to user entity whether user can go into debt

* Change that GEWIS members can go into debt by default

* Add check when making transaction whether user can go into debt

* Lint fix

* Fix endpoint documentation
* Fix OpenAPI docs for some event-related endpoints

* Changed UserRequest to UpdateUserRequest in user-controller.ts

---------

Co-authored-by: Roy Kakkenberg <[email protected]>
Co-authored-by: Samuel <[email protected]>
* Changed the swagger.ts to use the new express-jsdoc-swagger. Changing all the files will be a gigantic hassle, but running swagger:validate will show if the generated swagger is valid.

It does not show if the swagger contains everything you expect it to.

* Migrated:
banner-response.ts
base-response.ts
pagination.ts
root-controller.ts

* Migrated:
authentication-controller.ts
authentication-response.ts
all authentication requests
user-response.ts

* Migrated:
authentication-secure-controller.ts

* Migrated:
all responses,
balance-controller.ts
and some entities

* Migrated:
all requests

* Migrated:
banner-controller.ts

* Migrated:
container-controller.ts

* Migrated:
debtor-controller.ts

* Migrated:
event-controller.ts

* Migrated:
event-shift-controller.ts

* Migrated all controllers

* Small remaining changes and mistakes

* Rebased on dev

* Added logging

* Started working on fixing the test files / finding out whats going wrong.

* TODO Fix code to use specification.component.schemas instead of specification.definitions

* Fixed test cases and some of the spec errors that came up.

* Small test to fix CI

* Small test to fix CI

* Update build.yml

* Added swagger-cli as devtool

* Continued CI/CD testsuite bug fixing.

* Continued CI/CD testsuite bug fixing.

* Cleaned swagger.ts and removed old dep.

* Missed a dangling endpoint

* Small changes to try and fix runner

* Fixed the stupid mistake

* Function signature changed.

* Small fix in test model

* Small fix in test model path

* Small typo

* Small error fix

* Changed generateSpecification params to include file patterns.

* Removed all entity swagger doc to only leave Responses

* Undid all the changes to the entities swaggerdoc since these are unused.

* Applied requested pull changes.

* Applied requested pull changes.
@JustSamuel JustSamuel requested a review from Yoronex January 2, 2024 17:06
@rinkp
Copy link
Member

rinkp commented Jan 2, 2024

Note: this shall be fast forward merged only

Copy link

github-actions bot commented Jan 2, 2024

SudoSOS Coverage Report

Commit: df8e450
Base: main@c7c7a2b

Type Base This PR
Total Statements Coverage ?  89.23% (?)
Total Branches Coverage ?  85.07% (?)
Total Functions Coverage ?  90.55% (?)
Total Lines Coverage ?  89.08% (?)
Details (changed files)
FileStatementsBranchesFunctionsLines
Details (all files)
FileStatementsBranchesFunctionsLines
/src/index.ts 78.88% 50% 28.57% 79.24%
/src/authentication/token-handler.ts 100% 100% 100% 100%
/src/controller/authentication-controller.ts 88.82% 100% 96% 88.69%
/src/controller/authentication-secure-controller.ts 88.88% 100% 100% 88.88%
/src/controller/balance-controller.ts 78.04% 14.28% 100% 78.04%
/src/controller/banner-controller.ts 82.52% 95.45% 100% 82.52%
/src/controller/base-controller.ts 100% 100% 100% 100%
/src/controller/container-controller.ts 86.27% 90.9% 100% 85.71%
/src/controller/debtor-controller.ts 79.59% 63.63% 100% 84.61%
/src/controller/event-controller.ts 82.66% 94.44% 100% 82.66%
/src/controller/event-shift-controller.ts 75.82% 89.47% 100% 75.82%
/src/controller/invoice-controller.ts 80.72% 77.27% 100% 80.48%
/src/controller/payout-request-controller.ts 81.33% 92.85% 100% 81.33%
/src/controller/point-of-sale-controller.ts 82.53% 86.66% 100% 81.96%
/src/controller/product-category-controller.ts 82.45% 100% 100% 82.45%
/src/controller/product-controller.ts 86.48% 92.5% 100% 86.91%
/src/controller/rbac-controller.ts 88.23% 100% 100% 88.23%
/src/controller/root-controller.ts 85.71% 100% 100% 85.71%
/src/controller/simple-file-controller.ts 11.62% 0% 0% 11.62%
/src/controller/stripe-controller.ts 52.63% 100% 50% 52.63%
/src/controller/stripe-webhook-controller.ts 50% 100% 50% 50%
/src/controller/test-controller.ts 33.33% 100% 0% 33.33%
/src/controller/transaction-controller.ts 85% 96.96% 100% 84.53%
/src/controller/transfer-controller.ts 83.92% 94.73% 100% 83.33%
/src/controller/user-controller.ts 82.99% 92.45% 100% 83.05%
/src/controller/vat-group-controller.ts 87.8% 100% 100% 87.8%
/src/controller/voucher-group-controller.ts 79.41% 83.33% 100% 79.41%
/src/controller/request/file-request.ts 0% 0% 0% 0%
/src/controller/request/validators/container-request-spec.ts 100% 100% 100% 100%
/src/controller/request/validators/duration-spec.ts 66.66% 50% 50% 64.28%
/src/controller/request/validators/general-validators.ts 88% 75% 75% 84.21%
/src/controller/request/validators/invoice-request-spec.ts 92.72% 81.81% 100% 97.72%
/src/controller/request/validators/point-of-sale-request-spec.ts 95% 75% 100% 94.11%
/src/controller/request/validators/product-request-spec.ts 90.32% 72.72% 100% 90%
/src/controller/request/validators/string-spec.ts 100% 100% 100% 100%
/src/controller/request/validators/update-local-request-spec.ts 100% 100% 100% 100%
/src/controller/request/validators/update-nfc-request-spec.ts 100% 100% 100% 100%
/src/controller/request/validators/update-pin-request-spec.ts 100% 100% 100% 100%
/src/controller/request/validators/user-request-spec.ts 86.95% 66.66% 85.71% 88.88%
/src/controller/request/validators/validation-errors.ts 88.05% 100% 63.63% 100%
/src/controller/response/dinero.ts 0% 0% 0% 0%
/src/database/database.ts 96.29% 50% 33.33% 98.11%
/src/entity/banner.ts 100% 100% 100% 100%
/src/entity/base-entity-without-id.ts 100% 100% 100% 100%
/src/entity/base-entity.ts 100% 100% 100% 100%
/src/entity/vat-group.ts 100% 100% 100% 100%
/src/entity/authenticator/authentication-method.ts 100% 100% 100% 100%
/src/entity/authenticator/ean-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/hash-based-authentication-method.ts 100% 100% 100% 100%
/src/entity/authenticator/key-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/ldap-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/local-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/member-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/nfc-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/pin-authenticator.ts 100% 100% 100% 100%
/src/entity/authenticator/reset-token.ts 100% 100% 100% 100%
/src/entity/container/container-revision.ts 95% 100% 80% 92.85%
/src/entity/container/container.ts 100% 100% 100% 100%
/src/entity/deposit/stripe-deposit-status.ts 100% 100% 100% 100%
/src/entity/deposit/stripe-deposit.ts 100% 100% 100% 100%
/src/entity/event/event-shift-answer.ts 100% 100% 100% 100%
/src/entity/event/event-shift.ts 100% 100% 100% 100%
/src/entity/event/event.ts 100% 100% 100% 100%
/src/entity/file/banner-image.ts 100% 100% 100% 100%
/src/entity/file/base-file.ts 100% 100% 100% 100%
/src/entity/file/product-image.ts 100% 100% 100% 100%
/src/entity/fine/fine.ts 100% 100% 100% 100%
/src/entity/fine/fineHandoutEvent.ts 100% 100% 100% 100%
/src/entity/fine/userFineGroup.ts 100% 100% 100% 100%
/src/entity/invoices/invoice-entry.ts 100% 100% 100% 100%
/src/entity/invoices/invoice-status.ts 100% 100% 100% 100%
/src/entity/invoices/invoice.ts 100% 100% 100% 100%
/src/entity/point-of-sale/point-of-sale-revision.ts 94.44% 100% 75% 92.3%
/src/entity/point-of-sale/point-of-sale.ts 100% 100% 100% 100%
/src/entity/point-of-sale/product-ordering.ts 100% 100% 100% 100%
/src/entity/product/product-category.ts 100% 100% 100% 100%
/src/entity/product/product-revision.ts 95.45% 100% 75% 94.11%
/src/entity/product/product.ts 100% 100% 100% 100%
/src/entity/roles/assigned-role.ts 100% 100% 100% 100%
/src/entity/transactions/balance.ts 100% 100% 100% 100%
/src/entity/transactions/flagged-transaction.ts 100% 100% 100% 100%
/src/entity/transactions/payout-request-status.ts 100% 100% 100% 100%
/src/entity/transactions/payout-request.ts 100% 100% 100% 100%
/src/entity/transactions/sub-transaction-row.ts 100% 100% 100% 100%
/src/entity/transactions/sub-transaction.ts 100% 100% 100% 100%
/src/entity/transactions/transaction.ts 100% 100% 100% 100%
/src/entity/transactions/transfer.ts 100% 100% 100% 100%
/src/entity/transformer/dinero-transformer.ts 100% 83.33% 100% 100%
/src/entity/user/invoice-user.ts 100% 100% 100% 100%
/src/entity/user/local-user.ts 100% 100% 100% 100%
/src/entity/user/user-voucher-group.ts 100% 100% 100% 100%
/src/entity/user/user.ts 97.72% 75% 100% 100%
/src/entity/user/voucher-group.ts 100% 100% 100% 100%
/src/files/initialize.ts 100% 50% 100% 100%
/src/files/response.ts 28.57% 100% 0% 28.57%
/src/files/storage/disk-storage.ts 82.14% 83.33% 60% 82.14%
/src/files/storage/file-storage.ts 100% 100% 100% 100%
/src/files/storage/index.ts 100% 100% 50% 100%
/src/files/storage/locations.ts 100% 100% 100% 100%
/src/gewis/gewis.ts 72.13% 44.44% 38.09% 75.86%
/src/gewis/controller/gewis-authentication-controller.ts 87.03% 70% 100% 87.03%
/src/gewis/database/seed.ts 100% 100% 100% 100%
/src/gewis/entity/gewis-user.ts 100% 100% 100% 100%
/src/helpers/ad.ts 90.9% 100% 100% 90.9%
/src/helpers/bindings.ts 100% 100% 100% 100%
/src/helpers/database.ts 100% 100% 100% 100%
/src/helpers/ordering.ts 90.9% 83.33% 100% 90%
/src/helpers/pagination.ts 100% 85.71% 100% 100%
/src/helpers/query-filter.ts 100% 100% 100% 100%
/src/helpers/raw-body.ts 50% 100% 0% 50%
/src/helpers/revision-to-response.ts 94.73% 66.66% 100% 100%
/src/helpers/specification-validation.ts 97.29% 100% 88.88% 96.87%
/src/helpers/timestamps.ts 70% 33.33% 60% 70%
/src/helpers/token-helper.ts 100% 100% 100% 100%
/src/helpers/transaction-mapper.ts 95.89% 100% 88% 95.58%
/src/helpers/validators.ts 94% 90.27% 100% 97.4%
/src/mailer/index.ts 100% 100% 100% 100%
/src/mailer/mailer.ts 100% 100% 100% 100%
/src/mailer/transporter.ts 100% 100% 100% 100%
/src/mailer/templates/forgot-event-planning.ts 76.92% 100% 57.14% 76.92%
/src/mailer/templates/hello-world.ts 100% 100% 100% 100%
/src/mailer/templates/index.ts 100% 100% 100% 100%
/src/mailer/templates/mail-content.ts 100% 100% 100% 100%
/src/mailer/templates/mail-template.ts 100% 100% 100% 100%
/src/mailer/templates/password-reset.ts 78.94% 50% 57.14% 78.94%
/src/mailer/templates/signature.ts 100% 100% 100% 100%
/src/mailer/templates/user-debt-notification.ts 82.35% 50% 57.14% 82.35%
/src/mailer/templates/user-got-fined.ts 78.57% 100% 57.14% 78.57%
/src/mailer/templates/user-will-get-fined.ts 71.42% 50% 60% 71.42%
/src/mailer/templates/welcome-to-sudosos.ts 82.35% 50% 57.14% 82.35%
/src/mailer/templates/welcome-with-reset.ts 82.35% 50% 57.14% 82.35%
/src/middleware/policy-middleware.ts 81.81% 100% 100% 81.81%
/src/middleware/request-validator-middleware.ts 92.3% 80% 100% 100%
/src/middleware/restriction-middleware.ts 93.75% 92.85% 75% 100%
/src/middleware/token-middleware.ts 100% 100% 100% 100%
/src/rbac/role-manager.ts 95% 87.5% 100% 98.03%
/src/service/ad-service.ts 85.86% 52.94% 90% 89.04%
/src/service/authentication-service.ts 93.1% 83.78% 100% 92.66%
/src/service/balance-service.ts 98.11% 91.04% 100% 97.89%
/src/service/banner-service.ts 95.23% 86.95% 100% 95.12%
/src/service/container-service.ts 99.03% 89.74% 100% 100%
/src/service/debtor-service.ts 97.95% 85.71% 100% 100%
/src/service/event-service.ts 100% 99.06% 100% 100%
/src/service/file-service.ts 98.21% 81.81% 100% 98.18%
/src/service/invoice-service.ts 98.18% 91.66% 100% 99.35%
/src/service/payout-request-service.ts 100% 96.15% 100% 100%
/src/service/point-of-sale-service.ts 95% 76.19% 92.85% 98.18%
/src/service/product-category-service.ts 100% 100% 100% 100%
/src/service/product-service.ts 94.18% 65.11% 95% 95%
/src/service/rbac-service.ts 100% 100% 100% 100%
/src/service/stripe-service.ts 35.71% 10% 57.14% 35.84%
/src/service/transaction-service.ts 96.96% 86.53% 100% 96.68%
/src/service/transfer-service.ts 100% 96.15% 100% 100%
/src/service/user-service.ts 95.45% 74.46% 90% 97.5%
/src/service/vat-group-service.ts 100% 80.95% 100% 100%
/src/service/voucher-group-service.ts 100% 93.1% 100% 100%
/src/start/swagger.ts 82.5% 58.82% 66.66% 82.05%
/src/subscriber/index.ts 100% 100% 100% 100%
/src/subscriber/transaction-subscriber.ts 89.65% 87.5% 66.66% 87.5%
/src/subscriber/transfer-subscriber.ts 100% 100% 100% 100%

@JustSamuel JustSamuel merged commit df8e450 into main Jan 5, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants