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

Fixed and cleaned the swagger spec. [@JustSamuel] #5

Merged
merged 28 commits into from
Jul 31, 2023

Conversation

GEWISabc
Copy link
Contributor

@GEWISabc GEWISabc commented Mar 1, 2023

Signed-off-by: justsamuel <[email protected]>
Signed-off-by: justsamuel <[email protected]>
JorisParee and others added 8 commits March 13, 2023 18:17
* adding nfc authenticator

* fix module not exist error

* nfc update and login working

* remove unnecessary duplicate statement

* Updating casing to be consistent with project

* added authentication test case

* added user-controller update nfc tests

* test added for notexisting nfcCode

* Revert "Merge branch 'feature/nfc' into develop"

This reverts commit a11f85ad28d5ab617fa2d99b254c6eccd8b02ea4.

* Revert "Revert "Merge branch 'feature/nfc' into develop""

This reverts commit 086f0298e1a3f614e2c526fbd0915777c07d86c6.

* adding rule that nfcCode may not be empty to the update request spec

and lintfix

* added restriction to nfc code to be unique

* added test for updating nfc

* added delete function for nfc

* creating tests for delete

* improved test coverage

* Do not log nfc code but only length on attempt
* Update dependencies

* Bump node version from 16 to 18

* GitHub action to node18

node:18 is pulled on github01 and github02 runners already

Co-authored-by: Roy Kakkenberg <[email protected]>

---------

Co-authored-by: rinkp <[email protected]>
* create borrelkaartgroup with users

* Update BorrelkaartGroup

* Finish BorrelkaartGroup, initial tests

* Add await check to esLint

* Fix some tests

* Fix incorrect merge

* Correctly await everything, fix test cases

* BorrelkaartGroups update

* Fixed

Signed-off-by: justsamuel <[email protected]>

* Fix borrelkaartgroup get

* Fix invoice problems

* fix build error

* Test cases

* remove console debug

* Fix some test cases & performed lint fix on async/await

* Fix borrelkaartgroup test suite failing

* Fix failing test cases

* Fix naming (primarily saldo -> balance)

* Fix refactor error

---------

Signed-off-by: justsamuel <[email protected]>
Co-authored-by: Bram Wieringa <[email protected]>
Co-authored-by: justsamuel <[email protected]>
* Add more query parameters to getBalances function

* Add endpoint query options to GET all balances

* Add pagination to balance response
…. (#34)

As the strict type definitions do not allow booleans for the 'pool'
property, we cannot parse a boolean value from env. Should never hurt to
enable it.

Co-authored-by: samuel <[email protected]>
* first step

* add key to authentication-controller

* implement key to user controller

* return the propper response and no key logging

* add userId field to key login

* make key deletion

* adding unit test for correct response status

* randomly generate keys

* Typo's

* fix merge request comments

* fix two merge requests

also removed a id leak for the pin login
also update test for it

* adding tests for validation for returned object

---------

Co-authored-by: JorisParee <[email protected]>
# Conflicts:
#	src/controller/borrelkaart-group-controller.ts
#	src/controller/response/balance-response.ts
#	src/controller/response/borrelkaart-group-response.ts
#	src/controller/root-controller.ts
#	src/entity/authenticator/nfc-authenticator.ts
JustSamuel and others added 6 commits July 22, 2023 13:51
* Fixed Transaction Mapping and Sellers bugs (#38)

Fixed two bugs:  
- Bug where credit invoice entries contained products from SubTransactions with different sellers  
- Bug where transaction report reported products being sold from subTransactions from different sellers.

* Merged develop into main (#37)

* Feature/nfc (#28)

* adding nfc authenticator

* fix module not exist error

* nfc update and login working

* remove unnecessary duplicate statement

* Updating casing to be consistent with project

* added authentication test case

* added user-controller update nfc tests

* test added for notexisting nfcCode

* Revert "Merge branch 'feature/nfc' into develop"

This reverts commit a11f85ad28d5ab617fa2d99b254c6eccd8b02ea4.

* Revert "Revert "Merge branch 'feature/nfc' into develop""

This reverts commit 086f0298e1a3f614e2c526fbd0915777c07d86c6.

* adding rule that nfcCode may not be empty to the update request spec

and lintfix

* added restriction to nfc code to be unique

* added test for updating nfc

* added delete function for nfc

* creating tests for delete

* improved test coverage

* Do not log nfc code but only length on attempt

* Feature/update dependencies (#29)

* Update dependencies

* Bump node version from 16 to 18

* GitHub action to node18

node:18 is pulled on github01 and github02 runners already

Co-authored-by: Roy Kakkenberg <[email protected]>

---------

Co-authored-by: rinkp <[email protected]>

* Feature/create borrelkaartgroup with users (#31)

* create borrelkaartgroup with users

* Update BorrelkaartGroup

* Finish BorrelkaartGroup, initial tests

* Add await check to esLint

* Fix some tests

* Fix incorrect merge

* Correctly await everything, fix test cases

* BorrelkaartGroups update

* Fixed

Signed-off-by: justsamuel <[email protected]>

* Fix borrelkaartgroup get

* Fix invoice problems

* fix build error

* Test cases

* remove console debug

* Fix some test cases & performed lint fix on async/await

* Fix borrelkaartgroup test suite failing

* Fix failing test cases

* Fix naming (primarily saldo -> balance)

* Fix refactor error

---------

Signed-off-by: justsamuel <[email protected]>
Co-authored-by: Bram Wieringa <[email protected]>
Co-authored-by: justsamuel <[email protected]>

* Feature/balance improvements (#33)

* Add more query parameters to getBalances function

* Add endpoint query options to GET all balances

* Add pagination to balance response

* Improve readme and .env-example (#30)

* Add searching on user name (#35)

* Enable pooling by default and read max connections from env variables. (#34)

As the strict type definitions do not allow booleans for the 'pool'
property, we cannot parse a boolean value from env. Should never hurt to
enable it.

Co-authored-by: samuel <[email protected]>

* Apikey authenticate (#36)

* first step

* add key to authentication-controller

* implement key to user controller

* return the propper response and no key logging

* add userId field to key login

* make key deletion

* adding unit test for correct response status

* randomly generate keys

* Typo's

* fix merge request comments

* fix two merge requests

also removed a id leak for the pin login
also update test for it

* adding tests for validation for returned object

---------

Co-authored-by: JorisParee <[email protected]>

---------

Signed-off-by: justsamuel <[email protected]>
Co-authored-by: JorisParee <[email protected]>
Co-authored-by: Roy Kakkenberg <[email protected]>
Co-authored-by: rinkp <[email protected]>
Co-authored-by: Bram Wieringa <[email protected]>
Co-authored-by: Kevin Jilissen <[email protected]>
Co-authored-by: JorisParee <[email protected]>

---------

Signed-off-by: justsamuel <[email protected]>
Co-authored-by: JorisParee <[email protected]>
Co-authored-by: Roy Kakkenberg <[email protected]>
Co-authored-by: rinkp <[email protected]>
Co-authored-by: Bram Wieringa <[email protected]>
Co-authored-by: Kevin Jilissen <[email protected]>
Co-authored-by: JorisParee <[email protected]>
# Conflicts:
#	package-lock.json
#	src/controller/authentication-controller.ts
#	src/controller/balance-controller.ts
#	src/controller/response/balance-response.ts
#	src/controller/user-controller.ts
#	test/unit/controller/user-controller.ts
#	test/unit/service/invoice-service.ts
@github-actions
Copy link

github-actions bot commented Jul 25, 2023

SudoSOS Coverage Report

Commit: d82abcf
Base: develop@51ad82c

Type Base This PR
Total Statements Coverage ?  88.28% (?)
Total Branches Coverage ?  83.54% (?)
Total Functions Coverage ?  89.86% (?)
Total Lines Coverage ?  88.05% (?)
Details (changed files)
FileStatementsBranchesFunctionsLines
Details (all files)
FileStatementsBranchesFunctionsLines
/src/index.ts 82.51% 50% 46.66% 82.26%
/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/borrelkaart-group-controller.ts 79.41% 83.33% 100% 79.41%
/src/controller/container-controller.ts 85.13% 93.33% 100% 84.72%
/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 69.87% 76.31% 83.33% 69.13%
/src/controller/product-category-controller.ts 82.45% 100% 100% 82.45%
/src/controller/product-controller.ts 84% 91.3% 100% 84.93%
/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.14% 96.96% 100% 84.69%
/src/controller/transfer-controller.ts 83.92% 94.73% 100% 83.33%
/src/controller/user-controller.ts 79.41% 90.19% 96.72% 79.49%
/src/controller/vat-group-controller.ts 87.8% 100% 100% 87.8%
/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% 100% 33.33% 97.95%
/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/base-container.ts 100% 100% 100% 100%
/src/entity/container/container-revision.ts 94.73% 100% 80% 92.3%
/src/entity/container/container.ts 100% 100% 100% 100%
/src/entity/container/updated-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/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/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/base-point-of-sale.ts 100% 100% 100% 100%
/src/entity/point-of-sale/point-of-sale-revision.ts 93.75% 100% 75% 90.9%
/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/point-of-sale/updated-point-of-sale.ts 100% 100% 100% 100%
/src/entity/product/base-product.ts 100% 100% 100% 100%
/src/entity/product/product-category.ts 100% 100% 100% 100%
/src/entity/product/product-revision.ts 91.66% 100% 50% 88.88%
/src/entity/product/product.ts 100% 100% 100% 100%
/src/entity/product/updated-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/borrelkaart-group.ts 100% 100% 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-borrelkaart-group.ts 100% 100% 100% 100%
/src/entity/user/user.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.88% 44.44% 40% 76.78%
/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 60% 50% 40% 60%
/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.44% 90% 100% 93.18%
/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/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/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 100% 100% 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 89.65% 81.08% 86.95% 91.74%
/src/service/balance-service.ts 97.75% 91.11% 100% 97.59%
/src/service/banner-service.ts 95.23% 86.95% 100% 95.12%
/src/service/borrelkaart-group-service.ts 100% 93.1% 100% 100%
/src/service/container-service.ts 98.7% 88.52% 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 92.23% 68.18% 91.66% 93.81%
/src/service/product-category-service.ts 100% 100% 100% 100%
/src/service/product-service.ts 89.6% 73.61% 85.18% 90.43%
/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.95% 86.53% 100% 96.66%
/src/service/transfer-service.ts 100% 95% 100% 100%
/src/service/user-service.ts 92.04% 71.11% 85% 93.75%
/src/service/vat-group-service.ts 98.64% 76.19% 92.85% 98.43%
/src/start/swagger.ts 86.66% 80% 66.66% 86.2%

@JustSamuel
Copy link
Contributor

fixes #40

Copy link
Contributor

@CodeNamedRobin CodeNamedRobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you fix the typo I will approve :)

src/controller/borrelkaart-group-controller.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@CodeNamedRobin CodeNamedRobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CodeNamedRobin CodeNamedRobin merged commit 3e5b6ac into develop Jul 31, 2023
4 checks passed
@CodeNamedRobin CodeNamedRobin deleted the bugfix/swagger-spec branch July 31, 2023 13:36
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.

6 participants