Skip to content

Commit c3c5086

Browse files
repo logging
1 parent a0377b6 commit c3c5086

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

infrastructure/terraform/components/api/ddb_table_supplier_configuration.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ resource "aws_dynamodb_table" "supplier-configuration" {
2929
name = "volumeGroup"
3030
type = "S"
3131
}
32+
3233
// The type-index GSI allows us to query for all supplier configurations of a given type (e.g. all letter supplier configurations)
3334
global_secondary_index {
3435
name = "EntityTypeIndex"

internal/datastore/src/supplier-config-repository.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ export class SupplierConfigRepository {
5353
async getSupplierAllocationsForVolumeGroup(
5454
groupId: string,
5555
): Promise<SupplierAllocation[]> {
56+
this.log.info({
57+
description:
58+
"Fetching supplier allocations for volume group from database",
59+
groupId,
60+
});
5661
const result = await this.ddbClient.send(
5762
new QueryCommand({
5863
TableName: this.config.supplierConfigTableName,
@@ -64,6 +69,12 @@ export class SupplierConfigRepository {
6469
},
6570
}),
6671
);
72+
this.log.info({
73+
description:
74+
"Fetched supplier allocations for volume group from database",
75+
groupId,
76+
count: result.Items?.length ?? 0,
77+
});
6778
if (!result.Items) {
6879
throw new Error(
6980
`No supplier allocations found for volume group id ${groupId}`,

0 commit comments

Comments
 (0)