Repairs API
GitHub RepositoryFrameworks used​
Written in .Net
Blog Storage​
Azure Blob storage is Microsoft's object storage solution for the cloud.
Photos uploaded as part of the description.base64img
in save repair request body are uploaded to a container that can be configured via environment variables.
Cosmos DB​
Azure Cosmos DB is a fully managed NoSQL database service for modern app development.
Submitted repair requests are saved in a container that is configured via environment variables and requests are saved in the following structure:
{
"id": "20B2459F",
"Postcode": "M3 0W",
"SOR": "N373049",
"Address": {
"Display": "123 Cute Street, LN1 3AT",
"LocationId": "53660030 "
},
"Location": {
"Value": "kitchen",
"Display": "Kitchen"
},
"Problem": {
"Value": "cupboards",
"Display": "Cupboards, including damaged cupboard doors"
},
"Issue": {
"Value": "doorHangingOff",
"Display": "Hanging door"
},
"ContactPersonNumber": "01234567890",
"Description": {
"PhotoUrl": "https://housingrepairsonline.blob.core.windows.net/housing-repairs-online/eb5adfb6-ed53-4f3b-90c4-7a54cc36c56a.png",
"Text": "Excepturi quod aute "
},
"ContactDetails": {
"Type": "email",
"Value": "luna@email.com"
},
"Time": {
"Value": "27th January 2022 12:00pm to 4:00pm",
"Display": "27th January 2022 between 12:00pm to 4:00pm"
},
"_rid": "rKg5ANy0vjoVAAAAAAAAAA==",
"_self": "dbs/rKg5AA==/colls/rKg5ANy0vjo=/docs/rKg5ANy0vjoVAAAAAAAAAA==/",
"_etag": "\"0f00dbde-0000-1100-0000-61e5367b0000\"",
"_attachments": "attachments/",
"_ts": 1642411643
}
Gov Notify​
GOV.UK Notify lets you send emails, text messages and letters to your users.
Once a repair request is saved into Cosmos DB, two notifications are sent - one to the user and one to the email that's configured via environment variables
User notifications​
Email notification template ID is configured via environment variables.
Suggested email template
To: ((
email
from contactDetails.value
)) Subject: Repair details ((
repair_ref
generated when saving into Cosmos DB)) Your repair has been successfully booked.
Your booking details are:
Booking reference: ((repair_ref
))
Appointment: ((appointment_time
from time.display
))
You will receive a reminder the day before your appointment
SMS notification template ID is configured via environment variables.
Suggested SMS template
contactDetails.value
)) Lincoln Repairs Online: Your repair has been successfully booked. Your booking reference is ((repair_ref
)) and your selected appointment date is ((appointment_time
fromtime.display
)).
Internal notification email​
Email notification template ID is configured via environment variables.
Suggested email template
To: ((
email
from INTERNAL_EMAIL
)) Subject: Repair details ((
repair_ref
generated when saving into Cosmos DB)) A new online repair has been logged. Please add the repair to universal.
The repair details are:
Repair reference: ((repair_ref
))
Property Reference: ((uprn
from address.locationId
))
Address: ((uprn
from address.display
))
SoR: ((sor
generated when saving into Cosmos DB ))
Description: ((repair_desc
from description.text
))
Contact number: ((contact_no
from contactPersonNumber
))
Photos uploaded: ((image_1
))
Environment variables​
Name | Description |
---|---|
AUTHENTICATION_IDENTIFIER | A unique identifier used to validate access.* |
JWT_SECRET | A hash secret used for encryption.* |
ADDRESSES_API_URL | Address API URL |
SCHEDULING_API_URL | Scheduling API URL |
COSMOS_ENDPOINT_URL | Cosmos endpoint URL |
COSMOS_AUTHORIZATION_KEY | Cosmos authorization key |
COSMOS_DATABASE_ID | Cosmos database name, e.g.: housing-repairs-online |
COSMOS_CONTAINER_ID | Cosmos table name, e.g.: repairs-requests |
AZURE_STORAGE_CONNECTION_STRING | Blob storage connection string |
STORAGE_CONTAINER_NAME | Blob storage container name, e.g.: housing-repairs-online |
GOV_NOTIFY_KEY | Gov notification key |
CONFIRMATION_SMS_NOTIFY_TEMPLATE_ID | Id of the SMS template that will be sent to customers |
CONFIRMATION_EMAIL_NOTIFY_TEMPLATE_ID | Id of the email template that will be sent to customers |
INTERNAL_EMAIL_NOTIFY_TEMPLATE_ID | Id of the template that will be sent to staff |
INTERNAL_EMAIL | Email to which internal staff emails will be sent to |
DAYS_UNTIL_IMAGE_EXPIRY | Number of days attached images can be accessible for |
SENTRY_DSN | Sentry Data Source Name |
* See Authentication for more details.
Health Checks​
See Health Checks for details.
The API is determined to be health if:
- Each Housing Repairs API it depends upon is healthy
- It can connect to the configured Azure Cosmos DB
- It can connect to the configured Azure Blob storage