Skip to content

Commit 5f34443

Browse files
committed
Use SNS message, not event
1 parent f33c999 commit 5f34443

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lambdas/allocation/src/__tests__/allocator.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe("allocator", () => {
9292
expect.objectContaining({
9393
input: {
9494
QueueUrl: mockQueueUrl,
95-
MessageBody: JSON.stringify(snsEvent.Records[0]),
95+
MessageBody: JSON.stringify(snsEvent.Records[0].Sns),
9696
MessageGroupId: expect.any(String),
9797
},
9898
}),
@@ -120,7 +120,7 @@ describe("allocator", () => {
120120
expect.objectContaining({
121121
input: {
122122
QueueUrl: mockQueueUrl,
123-
MessageBody: JSON.stringify(snsEvent.Records[0]),
123+
MessageBody: JSON.stringify(snsEvent.Records[0].Sns),
124124
MessageGroupId: expect.any(String),
125125
},
126126
}),
@@ -130,7 +130,7 @@ describe("allocator", () => {
130130
expect.objectContaining({
131131
input: {
132132
QueueUrl: mockQueueUrl,
133-
MessageBody: JSON.stringify(snsEvent.Records[1]),
133+
MessageBody: JSON.stringify(snsEvent.Records[1].Sns),
134134
MessageGroupId: expect.any(String),
135135
},
136136
}),
@@ -140,7 +140,7 @@ describe("allocator", () => {
140140
expect.objectContaining({
141141
input: {
142142
QueueUrl: mockQueueUrl,
143-
MessageBody: JSON.stringify(snsEvent.Records[2]),
143+
MessageBody: JSON.stringify(snsEvent.Records[2].Sns),
144144
MessageGroupId: expect.any(String),
145145
},
146146
}),

lambdas/allocation/src/allocator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function createAllocator(deps: Deps): SNSHandler {
2525
function buildSendMessageCommand(snsRecord: SNSEventRecord, queueUrl: string) {
2626
return new SendMessageCommand({
2727
QueueUrl: queueUrl,
28-
MessageBody: JSON.stringify(snsRecord),
28+
MessageBody: JSON.stringify(snsRecord.Sns),
2929
// Using a random UUID here effectively means that the amendments queue is not FIFO for new pending
3030
// letters. Pragmatically this is OK because we shouldn't be getting updates from the supplier yet.
3131
MessageGroupId: randomUUID(),

0 commit comments

Comments
 (0)