1.25.8 • Published 6 years ago

er-notifications-api v1.25.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

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
  1. add notification controller method in /src/controllers/notification/notificationController.ts
  2. add interfaces for the new email notification payloads in @types/notifications.d.ts
  3. add swagger route definition in /src/controllers/notification/notification.yml
  4. 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
  5. add route test in /src/controllers/notification/__tests__/notificationController.test.ts - let it fail and then fix it
    • add test helper route and mock
  6. 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)
  7. copy the interface from notifications.d.ts to the client interfaces.ts file /src/er-notifications-api/client/src/interfaces.ts (and export them)
  8. add a function call to the client library that calls the service /src/er-notifications-api/client/src/index.ts