-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sms-limiting): sms counts retrieval (#2276)
* feat(sms_count.server.model): adds new isOnboardedAcc key and scripts to add/delete the key * refactor(sms.types): adds property that checks if a sms is sent using formsg's credentials * refactor(sms_count.server.model): adds pre-save hook to automatically set property * feat(sms.types): updated typings of IVerificationsmscount * test(sms_count.server): fixed tests and added extra tests for isOnboardedAccount * feat(sms.service): adds new method to retrieve free sms counts of a user * test(sms.service): adds new unit tests for sms count retrieval * test(sms_count.server.model): updated test case for a client using default credentials * feat(sms.controller): added new sms controller iwth method to retrieve counts and msgsrvcid fix(sms.controller.ts): added mapRouteError for sms controller * feat(routes): exposes new route at sms/:userId/:formId * fix(sms.controller): removed sms count retrieval requiring the userId as it sohuld be for the admin * refactor(sms): count retrieval no longer required userId * test(sms.controller): added unit tests for controller method to retrieve counts * fix(sms.controller): changed to relative imports in spec to avoid e2e tests breaking * refactor(sms_count): sms service wraps model count documents call * test(sms.service): reworked tests to account for mocking of db * refactor(sms.controller): removed extra middleware from sms controller * test(sms.controller.spec): renamed sms controller's exposed method in tests * refactor(sms.routes): removed unused sms route * refactor(sms.controller): changed counts retrieval to be solely focused on counts * feat(admin-forms.form.routes): adds new route for retrieving free sms ocunts for admin of a form * refactor(sms_count): shifts default msgsrvcid to be from config, helper method defined in test * test(sms.controller.spec): updated tests to use mocks * test(sms_count.server.model.spec): updated db tests to use smsConfig * fix(v3.routes): removed extra import statement * refactor(types): renamed smscounts meta and shifted it to api renamed to smsCountsDto because it is used to transfer data b/w fe and be. against giving it a more specific name because this is a type signifying a transfer of sms count data. context for what this sms counts actually means should be given by the caller * test(sms_count.server.model.spec): updated test to use sms_config * docs(sms): updated docs for sms counts retrieval in controller and route * test(sms.service.spec): made tests more explicit * refactor(admin-form.controller): shifts over handler for count retrieval from sms to admin-form * test(admin-form.controller.spec): shifts over associated tests * refactor(sms_count.server.model.spec): changed tests structure * chore(sms.util): removed unneeded method * refactor(sms.types): added in docs for retrieveFreeSmsCounts * fix(admin-forms.form.routes): removed erroneous import * fix(sms.service): adds error logging
- Loading branch information
Showing
8 changed files
with
348 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.