1.25.8 • Published 6 years ago
er-notifications-api v1.25.8
NOTIFICATIONS API
The EverReal Notifications API.
# Prerequesities
docker run -d --name goaws -p 4100:4100 pafortin/goaws
# Tasks for the API
yarn install
yarn dev
yarn test
# Publishing the npm client
cd ./client
yarn install
yarn build
yarn publish
How to add a new notification
- add notification controller method in
/src/controllers/notification/notificationController.ts
- add interfaces for the new email notification payloads in
@types/notifications.d.ts
- add swagger route definition in
/src/controllers/notification/notification.yml
- add swagger route path in
/src/er-notifications-api/src/swagger/index.yml
- optional: add model in
src/swagger/models/notifications
and use it as$ref
- optional: add model in
- add route test in
/src/controllers/notification/__tests__/notificationController.test.ts
- let it fail and then fix it- add test helper route and mock
- add a new notification function in the notificationService
/src/er-notifications-api/src/services/notification/notificationService.ts
- add email config in
/services/email/config
- add a new email function in the emailService
/src/er-notifications-api/src/services/email/emailService.ts
- add other notification types (sms, inapp, etc -- not defined at this point)
- add email config in
- copy the interface from
notifications.d.ts
to the client interfaces.ts file/src/er-notifications-api/client/src/interfaces.ts
(and export them) - add a function call to the client library that calls the service
/src/er-notifications-api/client/src/index.ts