Skip to main content

Repairs API

GitHub Repository

Frameworks 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
From: Lincoln Repairs Online
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
To: ((phone numer from 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
From: Lincoln Repairs Online
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​

NameDescription
AUTHENTICATION_IDENTIFIERA unique identifier used to validate access.*
JWT_SECRETA hash secret used for encryption.*
ADDRESSES_API_URLAddress API URL
SCHEDULING_API_URLScheduling API URL
COSMOS_ENDPOINT_URLCosmos endpoint URL
COSMOS_AUTHORIZATION_KEYCosmos authorization key
COSMOS_DATABASE_IDCosmos database name, e.g.: housing-repairs-online
COSMOS_CONTAINER_IDCosmos table name, e.g.: repairs-requests
AZURE_STORAGE_CONNECTION_STRINGBlob storage connection string
STORAGE_CONTAINER_NAMEBlob storage container name, e.g.: housing-repairs-online
GOV_NOTIFY_KEYGov notification key
CONFIRMATION_SMS_NOTIFY_TEMPLATE_IDId of the SMS template that will be sent to customers
CONFIRMATION_EMAIL_NOTIFY_TEMPLATE_IDId of the email template that will be sent to customers
INTERNAL_EMAIL_NOTIFY_TEMPLATE_IDId of the template that will be sent to staff
INTERNAL_EMAILEmail to which internal staff emails will be sent to
DAYS_UNTIL_IMAGE_EXPIRYNumber of days attached images can be accessible for
SENTRY_DSNSentry 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