Skip to content

Commit bf96c40

Browse files
committed
CCM-11602: Add groupId
1 parent e12856b commit bf96c40

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

internal/datastore/src/__test__/letter-repository.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,19 @@ describe('LetterRepository', () => {
238238
{
239239
id: "letter1",
240240
specificationId: "specification1",
241+
groupId: 'group1',
241242
status: "PENDING",
242243
},
243244
{
244245
id: "letter2",
245246
specificationId: "specification1",
247+
groupId: 'group1',
246248
status: "PENDING",
247249
},
248250
{
249251
id: "letter3",
250252
specificationId: "specification1",
253+
groupId: 'group1',
251254
status: "PENDING",
252255
},
253256
]);

internal/datastore/src/letter-repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class LetterRepository {
145145
ExpressionAttributeValues: {
146146
':supplierStatus': supplierStatus
147147
},
148-
ProjectionExpression: 'id, #status, specificationId, reasonCode, reasonText'
148+
ProjectionExpression: 'id, #status, specificationId, groupId, reasonCode, reasonText'
149149
}));
150150
return z.array(LetterSchemaBase).parse(result.Items ?? []);
151151
}

internal/datastore/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ export const LetterSchemaBase = z.object({
2121
id: z.string(),
2222
status: LetterStatus,
2323
specificationId: z.string(),
24+
groupId: z.string(),
2425
reasonCode: z.number().optional(),
2526
reasonText: z.string().optional()
2627
});
2728

2829
export const LetterSchema = LetterSchemaBase.extend({
2930
supplierId: z.string(),
30-
groupId: z.string(),
3131
url: z.url(),
3232
createdAt: z.string(),
3333
updatedAt: z.string(),

lambdas/api-handler/src/handlers/__tests__/get-letters.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ describe('API Lambda handler', () => {
1919
{
2020
id: "l1",
2121
specificationId: "s1",
22+
groupId: 'g1',
2223
status: "PENDING",
2324
},
2425
{
2526
id: "l2",
2627
specificationId: "s1",
28+
groupId: 'g1',
2729
status: "PENDING",
2830
},
2931
{
3032
id: "l3",
3133
specificationId: "s1",
34+
groupId: 'g1',
3235
status: "PENDING",
3336
},
3437
]);
@@ -43,17 +46,17 @@ describe('API Lambda handler', () => {
4346
{
4447
id: "l1",
4548
type: "Letter",
46-
attributes: { specificationId: "s1", status: "PENDING" },
49+
attributes: { specificationId: "s1", groupId: 'g1', status: "PENDING" },
4750
},
4851
{
4952
id: "l2",
5053
type: "Letter",
51-
attributes: { specificationId: "s1", status: "PENDING" },
54+
attributes: { specificationId: "s1", groupId: 'g1', status: "PENDING" },
5255
},
5356
{
5457
id: "l3",
5558
type: "Letter",
56-
attributes: { specificationId: "s1", status: "PENDING" },
59+
attributes: { specificationId: "s1", groupId: 'g1', status: "PENDING" },
5760
},
5861
],
5962
};

lambdas/api-handler/src/handlers/get-letters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ interface GetLettersResponse {
9494
id: string;
9595
attributes: {
9696
specificationId: string;
97+
groupId: string;
9798
status: string;
9899
reasonCode?: number;
99100
reasonText?: string;
@@ -108,6 +109,7 @@ function createGetLettersResponse(letters: LetterBase[]): GetLettersResponse {
108109
type: "Letter",
109110
attributes: {
110111
specificationId: letter.specificationId,
112+
groupId: letter.groupId,
111113
status: letter.status,
112114
reasonCode: letter.reasonCode,
113115
reasonText: letter.reasonText,

0 commit comments

Comments
 (0)