Skip to content

Commit

Permalink
PI-2851 Update default date to previous day (#22)
Browse files Browse the repository at this point in the history
Reminders will now be sent at 6pm, so for most of the day there would be no data
  • Loading branch information
marcus-bcl authored Feb 18, 2025
1 parent d6e5309 commit 7234643
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function routes({ auditService, hmppsAuthClient }: Services): Rou
const filters: Filters = {
date: req.query.date
? LocalDate.parse(req.query.date as string, DateTimeFormatter.ofPattern('d/M/yyyy'))
: LocalDate.now(),
: LocalDate.now().minusDays(1),
keywords: req.query.keywords as string,
status: asArray(req.query.status),
template: asArray(req.query.template),
Expand Down
24 changes: 12 additions & 12 deletions wiremock/mappings/notifications-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
},
"notifications": [
{
"body": "Reminder: Dear Test. This is an automated reminder of your UPW appointment on {{ now offset='+2 days' format='dd/MM/yyyy' }}. Please bring lunch and wear appropriate clothing.",
"completed_at": "{{ now }}",
"body": "Reminder: Dear Test. This is an automated reminder of your UPW appointment on {{ now offset='+1 days' format='dd/MM/yyyy' }}. Please bring lunch and wear appropriate clothing.",
"completed_at": "{{ now offset='-1 days' }}",
"cost_details": {
"billable_sms_fragments": 1,
"international_rate_multiplier": 1.0,
"sms_rate": 0.0227
},
"cost_in_pounds": 0.0227,
"created_at": "{{ now }}",
"created_at": "{{ now offset='-1 days' }}",
"id": "00000000-0000-0000-0000-000000000001",
"phone_number": "07700900000",
"reference": "A000001",
"sent_at": "{{ now }}",
"sent_at": "{{ now offset='-1 days' }}",
"status": "delivered",
"subject": null,
"template": {
Expand All @@ -36,19 +36,19 @@
"type": "sms"
},
{
"body": "Reminder: Dear Test2. This is an automated reminder of your UPW appointment on {{ now offset='+2 days' format='dd/MM/yyyy' }}. Please bring lunch and wear appropriate clothing.",
"completed_at": "{{ now }}",
"body": "Reminder: Dear Test2. This is an automated reminder of your UPW appointment on {{ now offset='+1 days' format='dd/MM/yyyy' }}. Please bring lunch and wear appropriate clothing.",
"completed_at": "{{ now offset='-1 days' }}",
"cost_details": {
"billable_sms_fragments": 1,
"international_rate_multiplier": 1.0,
"sms_rate": 0.0227
},
"cost_in_pounds": 0.0227,
"created_at": "{{ now }}",
"created_at": "{{ now offset='-1 days' }}",
"id": "00000000-0000-0000-0000-000000000002",
"phone_number": "07700900111",
"reference": "A000002",
"sent_at": "{{ now }}",
"sent_at": "{{ now offset='-1 days' }}",
"status": "sending",
"subject": null,
"template": {
Expand All @@ -74,19 +74,19 @@
"response": {
"status": 200,
"jsonBody": {
"body": "Reminder: Dear Test. This is an automated reminder of your UPW appointment on {{ now offset='+2 days' format='dd/MM/yyyy' }}. Please bring lunch and wear appropriate clothing.",
"completed_at": "{{ now }}",
"body": "Reminder: Dear Test. This is an automated reminder of your UPW appointment on {{ now offset='+1 days' format='dd/MM/yyyy' }}. Please bring lunch and wear appropriate clothing.",
"completed_at": "{{ now offset='-1 days' }}",
"cost_details": {
"billable_sms_fragments": 1,
"international_rate_multiplier": 1.0,
"sms_rate": 0.0227
},
"cost_in_pounds": 0.0227,
"created_at": "{{ now }}",
"created_at": "{{ now offset='-1 days' }}",
"id": "00000000-0000-0000-0000-000000000001",
"phone_number": "07700900000",
"reference": "A000001",
"sent_at": "{{ now }}",
"sent_at": "{{ now offset='-1 days' }}",
"status": "delivered",
"subject": null,
"template": {
Expand Down

0 comments on commit 7234643

Please sign in to comment.