Skip to content

Commit e38f005

Browse files
committed
rm update to status
1 parent af817c3 commit e38f005

File tree

13 files changed

+58
-49
lines changed

13 files changed

+58
-49
lines changed

infrastructure/terraform/modules/backend-api/module_sqs_quarantine_scan_enrichment.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "sqs_quarantine_scan_enrichment" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v1.0.14"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v2.0.1"
33

44
aws_account_id = var.aws_account_id
55
component = var.component

infrastructure/terraform/modules/backend-api/module_sqs_sftp_upload_queue.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "sftp_upload_queue" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v1.0.14"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v2.0.1"
33

44
aws_account_id = var.aws_account_id
55
component = var.component
@@ -10,7 +10,7 @@ module "sftp_upload_queue" {
1010

1111
sqs_kms_key_arn = var.kms_key_arn
1212

13-
visibility_timeout = 60
13+
visibility_timeout_seconds = 60
1414

1515
create_dlq = true
1616
}

infrastructure/terraform/modules/backend-api/module_sqs_virus_scan_failed_delete_object_dlq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "sqs_virus_scan_failed_delete_object_dlq" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v1.0.14"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v2.0.1"
33

44
aws_account_id = var.aws_account_id
55
component = var.component

infrastructure/terraform/modules/backend-api/module_sqs_virus_scan_passed_copy_object_dlq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "sqs_virus_scan_passed_copy_object_dlq" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v1.0.14"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v2.0.1"
33

44
aws_account_id = var.aws_account_id
55
component = var.component

infrastructure/terraform/modules/backend-api/module_sqs_virus_scan_set_file_status_dlq.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "sqs_virus_scan_set_file_status_dlq" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v1.0.14"
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs?ref=v2.0.1"
33

44
aws_account_id = var.aws_account_id
55
component = var.component
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Personalisation field,Short length data example,Medium length data example,Long length data example
2-
appointment_date,Monday 1 May 2025,Saturday 10 April 2025,Wednesday 10 September 2025
3-
appointment_time,1:56pm,11:56am,12:56pm
4-
appointment_location,"The Epping Breast Screening Unit, St Margaret's Hospital, The Plain, Epping, Essex, CM16 6TN","The Royal Shrewsbury Hospital, Breast Screening Office, Treatment Centre, Mytton Oak Road, Shrewsbury, SY3 8XQ","City, Sandwell & Walsall BSS, The Rosewood Centre, Sandwell & West Birmingham Hospitals NHS Trust, The Birmingham Treatment Centre, City Hospital, Dudley Road, Birmingham, B18 7QH"
5-
contact_telephone_number,020 3299 9010,020 3299 9010,020 3299 9010
1+
Personalisation field,Short length data example,Medium length data example,Long length data example
2+
appointment_date,Monday 1 May 2025,Saturday 10 April 2025,Wednesday 10 September 2025
3+
appointment_time,1:56pm,11:56am,12:56pm
4+
appointment_location,"The Epping Breast Screening Unit, St Margaret's Hospital, The Plain, Epping, Essex, CM16 6TN","The Royal Shrewsbury Hospital, Breast Screening Office, Treatment Centre, Mytton Oak Road, Shrewsbury, SY3 8XQ","City, Sandwell & Walsall BSS, The Rosewood Centre, Sandwell & West Birmingham Hospitals NHS Trust, The Birmingham Treatment Centre, City Hospital, Dudley Road, Birmingham, B18 7QH"
5+
contact_telephone_number,020 3299 9010,020 3299 9010,020 3299 9010

lambdas/sftp-letters/src/__tests__/infra/template-repository.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,22 @@ describe('TemplateRepository', () => {
3838
expect(mocks.client).toHaveReceivedCommandWith(UpdateCommand, {
3939
ExpressionAttributeNames: {
4040
'#updatedAt': 'updatedAt',
41-
'#lockTime': 'lockTime',
41+
'#sftpSendLockTime': 'sftpSendLockTime',
4242
},
4343
ExpressionAttributeValues: {
4444
':updatedAt': expect.stringMatching(isoDateRegExp),
45-
':condition_2_lockTime': mockDate.getTime() + sendLockTtlMs,
46-
':lockTime': mockDate.getTime(),
45+
':condition_2_sftpSendLockTime': mockDate.getTime() + sendLockTtlMs,
46+
':sftpSendLockTime': mockDate.getTime(),
4747
},
4848
ConditionExpression:
49-
'attribute_not_exists (#lockTime) OR #lockTime > :condition_2_lockTime',
49+
'attribute_not_exists (#sftpSendLockTime) OR #sftpSendLockTime > :condition_2_sftpSendLockTime',
5050
Key: {
5151
id: templateId,
5252
owner,
5353
},
5454
TableName: templatesTableName,
55-
UpdateExpression: 'SET #lockTime = :lockTime, #updatedAt = :updatedAt',
55+
UpdateExpression:
56+
'SET #sftpSendLockTime = :sftpSendLockTime, #updatedAt = :updatedAt',
5657
});
5758
});
5859

@@ -91,7 +92,7 @@ describe('TemplateRepository', () => {
9192
await templateRepository.clearLock(owner, templateId);
9293
expect(mocks.client).toHaveReceivedCommandWith(UpdateCommand, {
9394
ExpressionAttributeNames: {
94-
'#lockTime': 'lockTime',
95+
'#sftpSendLockTime': 'sftpSendLockTime',
9596
'#updatedAt': 'updatedAt',
9697
},
9798
ExpressionAttributeValues: {
@@ -102,7 +103,8 @@ describe('TemplateRepository', () => {
102103
owner,
103104
},
104105
TableName: templatesTableName,
105-
UpdateExpression: 'SET #updatedAt = :updatedAt REMOVE #lockTime',
106+
UpdateExpression:
107+
'SET #updatedAt = :updatedAt REMOVE #sftpSendLockTime',
106108
});
107109
});
108110
});

lambdas/sftp-letters/src/infra/template-repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class TemplateRepository {
1414
const time = this.getDate().getTime();
1515

1616
const update = new TemplateUpdateBuilder(this.templatesTableName, owner, id)
17-
.setLockTime(time, time + this.lockTtl)
17+
.setLockTime('sftpSendLockTime', time, time + this.lockTtl)
1818
.build();
1919

2020
try {
@@ -31,7 +31,7 @@ export class TemplateRepository {
3131

3232
async clearLock(owner: string, id: string) {
3333
const update = new TemplateUpdateBuilder(this.templatesTableName, owner, id)
34-
.removeLockTime()
34+
.removeLockTime('sftpSendLockTime')
3535
.build();
3636

3737
return await this.client.send(new UpdateCommand(update));
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Personalisation field,Short length data example,Medium length data example,Long length data example
2-
appointment_date,Monday 1 May 2025,Saturday 10 April 2025,Wednesday 10 September 2025
3-
appointment_time,1:56pm,11:56am,12:56pm
4-
appointment_location,"The Epping Breast Screening Unit, St Margaret's Hospital, The Plain, Epping, Essex, CM16 6TN","The Royal Shrewsbury Hospital, Breast Screening Office, Treatment Centre, Mytton Oak Road, Shrewsbury, SY3 8XQ","City, Sandwell & Walsall BSS, The Rosewood Centre, Sandwell & West Birmingham Hospitals NHS Trust, The Birmingham Treatment Centre, City Hospital, Dudley Road, Birmingham, B18 7QH"
5-
contact_telephone_number,020 3299 9010,020 3299 9010,020 3299 9010
1+
Personalisation field,Short length data example,Medium length data example,Long length data example
2+
appointment_date,Monday 1 May 2025,Saturday 10 April 2025,Wednesday 10 September 2025
3+
appointment_time,1:56pm,11:56am,12:56pm
4+
appointment_location,"The Epping Breast Screening Unit, St Margaret's Hospital, The Plain, Epping, Essex, CM16 6TN","The Royal Shrewsbury Hospital, Breast Screening Office, Treatment Centre, Mytton Oak Road, Shrewsbury, SY3 8XQ","City, Sandwell & Walsall BSS, The Rosewood Centre, Sandwell & West Birmingham Hospitals NHS Trust, The Birmingham Treatment Centre, City Hospital, Dudley Road, Birmingham, B18 7QH"
5+
contact_telephone_number,020 3299 9010,020 3299 9010,020 3299 9010

tests/test-team/template-mgmt-e2e-tests/template-mgmt-sftp-send-proof.e2e.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ test.describe('SFTP proof send', () => {
7777
// The status PENDING_PROOF_REQUEST doesn't exist yet
7878
// the template's 'personalisationFields' has no effect on the test
7979
// the sender lambda does not read the template
80-
templateStatus: 'PENDING_PROOF_REQUEST',
80+
templateStatus: 'PENDING_PROOF',
8181
personalisationFields,
8282
};
8383

@@ -117,8 +117,8 @@ test.describe('SFTP proof send', () => {
117117
const updatedTemplate = await templateStorageHelper.getTemplate(key);
118118
const debugUpdated = JSON.stringify(updatedTemplate);
119119

120-
expect(updatedTemplate.templateStatus, debugUpdated).toBe(
121-
'NOT_YET_SUBMITTED'
120+
expect(updatedTemplate.updatedAt, debugUpdated).not.toBe(
121+
template.updatedAt
122122
);
123123
}).toPass({ timeout: 5000 });
124124

0 commit comments

Comments
 (0)