{"id":23067002,"url":"https://github.com/dvsa/ftts-notification-api","last_synced_at":"2025-04-03T09:13:51.374Z","repository":{"id":44051604,"uuid":"347041925","full_name":"dvsa/ftts-notification-api","owner":"dvsa","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-24T10:10:12.000Z","size":719,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-08T22:28:34.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-12T11:24:58.000Z","updated_at":"2024-01-03T09:20:13.000Z","dependencies_parsed_at":"2023-01-22T04:02:03.979Z","dependency_job_id":null,"html_url":"https://github.com/dvsa/ftts-notification-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fftts-notification-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fftts-notification-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fftts-notification-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvsa%2Fftts-notification-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvsa","download_url":"https://codeload.github.com/dvsa/ftts-notification-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246970323,"owners_count":20862509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T05:15:54.049Z","updated_at":"2025-04-03T09:13:51.352Z","avatar_url":"https://github.com/dvsa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notification API\n\nNotification API wrapping GOV.UK Notify for sending email and letter notifications\n\nAzure Function app with six functions:\n- **email**: http trigger function for api post 'email' endpoint\n- **letter**: http trigger function for api post 'letter' endpoint\n- **sender**: queue trigger function for sending notifications picked up off the request queue\n- **status**: time trigger function for checking status of notifications picked up off the status queue\n- **request-dlq**: queue trigger function for handling 'dead letters' on the request queue\n- **status-dlq**: queue trigger function for handling 'dead letters' on the status queue\n\nEach has its own folder in the project root with a `function.json` config\n\n## Build\n\nInstall node modules:\n```\nnpm install\n```\n\nCompile the ts source:\n```\nnpm run build\n```\n\n## Run Locally\n\n1. Run `npm i`\n2. Run `npm run copy-config` to create a local.settings.json file\n3. Complete missing config\n4. Run `npm start`\n\n#### Schemas\n\nRecompile the json validation schemas if necessary - see `scripts/compileRequestSchemas.sh`\n\n## Deploy\n\nDeploy via VSCode with the Azure Functions extension\n\n## Tests\n\nAll tests are housed under `tests/` directory in root\n\nRun all the tests:\n```\nnpm run test\n```\n\nWatch the tests:\n```\nnpm run test:watch\n```\n\nRun test coverage:\n```\nnpm run test:coverage\n```\nSee the generated `coverage` directory for the results\n\n## Queues\n\n### Request queue record structure\n| Field name | mandatory/optional | Description | Example |\n| ---------- | ------------------ | ----------- | ------- |\n|message_content|y|content of message (email/letter) to be delivered|\"Dear Sir, Lorem ipsum. Regards DVSA\"|\n|message_type|y|email/letter/message|email/letter/sms|\n|target|y|is it for recipient from GB or NI|NI/GB|\n|email|y for email|look below||\n|letter|y for letter|look below||\n|no_of_request_retries|y|default 0, incremented with each retry on the request queue in case of notify send error, is reset once pushed to status queue|0|\n|no_of_retries|y|default 0, incremented with each retry on the status queue|0|\n|reference|n|external system reference number - eg. booking reference number|1234567890|\n|context_id|n|external system context_id for request tracking purpose|1234-5678-azq1-5tgb|\n|trace_id|y|internal id for tracking purpose|1234-5678-azq1-5tgb|\n\n### Status queue record structure\nSame as request queue record but with additional fields:\n| Field name | mandatory/optional | Description | Example |\n| ---------- | ------------------ | ----------- | ------- |\n|id|y|id for the notification as returned from gov.notify|1234-5678-azq1-5tgb|\n|date|y|date/time that the notification was sent|Mon Mar 09 2020 13:54:11|\n|status|y|status of the notification from querying gov.notify|sending|\n\nemail field will contain:\n* message_subject\n* email_address\n\nletter field will contain\n* name\n* address_line_1\n* address_line_2\n* address_line_3\n* address_line_4\n* address_line_5\n* address_line_6\n* postcode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvsa%2Fftts-notification-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvsa%2Fftts-notification-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvsa%2Fftts-notification-api/lists"}