Skip to content

Commit 3deea27

Browse files
committed
Rename from productID to app ID
1 parent 939311e commit 3deea27

5 files changed

Lines changed: 24 additions & 24 deletions

File tree

SAMtemplates/functions/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Resources:
137137
SQS_SALT: !Ref SQSSaltSecret
138138
# Remove this once we've confirmed that product ID based filtering is working as expected and we
139139
# no longer need the ability to switch back to the old filtering method
140-
USE_PRODUCT_ID_FOR_NOTIFICATIONS_FILTERING: false
140+
USE_APP_ID_FOR_NOTIFICATIONS_FILTERING: false
141141
ENABLED_SYSTEMS_PARAM: !Ref EnabledSystemsParam
142142
#
143143
ENABLED_PRODUCT_IDS_PARAM: !Ref EnabledSupplierApplicationIDsParam

packages/updatePrescriptionStatus/src/validation/notificationSiteAndSystemFilters.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {PSUDataItemWithPrevious} from "@psu-common/commonTypes"
22
import {initiatedSSMProvider} from "@psu-common/utilities"
33
import {Logger} from "@aws-lambda-powertools/logger"
44

5-
const USE_PRODUCT_ID_FOR_NOTIFICATIONS_FILTERING =
6-
(process.env.USE_PRODUCT_ID_FOR_NOTIFICATIONS_FILTERING || "false")
5+
const USE_APP_ID_FOR_NOTIFICATIONS_FILTERING =
6+
(process.env.USE_APP_ID_FOR_NOTIFICATIONS_FILTERING || "false")
77
.toLowerCase() === "true"
88

99
function str2set(value: string | undefined): Set<string> {
@@ -31,7 +31,7 @@ async function loadConfig(): Promise<{
3131

3232
const enabledSiteODSCodes = str2set(all[process.env.ENABLED_SITE_ODS_CODES_PARAM!] as string)
3333
const enabledSystemAppNames = str2set(all[process.env.ENABLED_SYSTEMS_PARAM!] as string)
34-
const enabledSystemAppIds = str2set(all[process.env.ENABLED_PRODUCT_IDS_PARAM!] as string)
34+
const enabledSystemAppIds = str2set(all[process.env.ENABLED_SYSTEM_APP_IDS_PARAM!] as string)
3535
const blockedSiteODSCodes = str2set(all[process.env.BLOCKED_SITE_ODS_CODES_PARAM!] as string)
3636

3737
return {
@@ -66,17 +66,17 @@ export async function checkSiteOrSystemIsNotifyEnabled(
6666

6767
logger?.info(
6868
"Product ID, application name, and ODS code",
69-
{ApplicationID: appId, applicationName: appName, odsCode, enabledSystemAppIds}
69+
{ApplicationID: appId, applicationName: appName, odsCode}
7070
)
7171

7272
// Is this item supplier enabled?
73-
if (USE_PRODUCT_ID_FOR_NOTIFICATIONS_FILTERING) {
74-
const isEnabledProduct = enabledSiteODSCodes.has(odsCode) || enabledSystemAppIds.has(appId)
75-
if (!isEnabledProduct) {
73+
if (USE_APP_ID_FOR_NOTIFICATIONS_FILTERING) {
74+
const isEnabledApplication = enabledSiteODSCodes.has(odsCode) || enabledSystemAppIds.has(appId)
75+
if (!isEnabledApplication) {
7676
return false
7777
}
7878
} else {
79-
const isEnabledSystem = enabledSiteODSCodes.has(odsCode) || enabledSystemAppNames.has(appId)
79+
const isEnabledSystem = enabledSiteODSCodes.has(odsCode) || enabledSystemAppNames.has(appName)
8080
if (!isEnabledSystem) {
8181
return false
8282
}

packages/updatePrescriptionStatus/tests/testDatabaseClient.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("Unit test persistDataItems", () => {
3535
TaskID: "TaskID_1",
3636
TerminalStatus: "TerminalStatus_1",
3737
ApplicationName: "name",
38-
ApplicationID: "id",
38+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
3939
ExpiryTime: 10
4040
},
4141
{
@@ -49,7 +49,7 @@ describe("Unit test persistDataItems", () => {
4949
TaskID: "TaskID_1",
5050
TerminalStatus: "TerminalStatus_2",
5151
ApplicationName: "name",
52-
ApplicationID: "id",
52+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
5353
ExpiryTime: 10
5454
}
5555
]
@@ -89,7 +89,7 @@ describe("Unit test persistDataItems", () => {
8989
TaskID: "TaskID_1",
9090
TerminalStatus: "TerminalStatus_1",
9191
ApplicationName: "name",
92-
ApplicationID: "id",
92+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
9393
ExpiryTime: 10
9494
},
9595
{
@@ -103,7 +103,7 @@ describe("Unit test persistDataItems", () => {
103103
TaskID: "TaskID_1",
104104
TerminalStatus: "TerminalStatus_2",
105105
ApplicationName: "name",
106-
ApplicationID: "id",
106+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
107107
ExpiryTime: 10
108108
}
109109
]
@@ -127,7 +127,7 @@ describe("Unit test persistDataItems", () => {
127127
TaskID: "TaskID_1",
128128
TerminalStatus: "TerminalStatus_1",
129129
ApplicationName: "name",
130-
ApplicationID: "id",
130+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
131131
ExpiryTime: 10
132132
}
133133
const dataItems = Array(150).fill(dataItem)
@@ -153,7 +153,7 @@ describe("Unit test persistDataItems", () => {
153153
TaskID: "TaskID_1",
154154
TerminalStatus: "TerminalStatus_1",
155155
ApplicationName: "name",
156-
ApplicationID: "id",
156+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
157157
ExpiryTime: 10
158158
},
159159
{
@@ -167,7 +167,7 @@ describe("Unit test persistDataItems", () => {
167167
TaskID: "TaskID_1",
168168
TerminalStatus: "TerminalStatus_2",
169169
ApplicationName: "name",
170-
ApplicationID: "id",
170+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
171171
ExpiryTime: 10
172172
}
173173
]
@@ -201,7 +201,7 @@ describe("Unit test getPreviousItem", () => {
201201
TaskID: "previous-task-id",
202202
TerminalStatus: "ready to collect",
203203
ApplicationName: "Jim's Pills",
204-
ApplicationID: "id",
204+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
205205
ExpiryTime: 123
206206
}
207207
const previousItem = {
@@ -215,7 +215,7 @@ describe("Unit test getPreviousItem", () => {
215215
TaskID: "previous-task-id",
216216
TerminalStatus: "ready to collect",
217217
ApplicationName: "Jim's Pills",
218-
ApplicationID: "id",
218+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
219219
ExpiryTime: 123
220220
}
221221
const currentItem = {
@@ -229,7 +229,7 @@ describe("Unit test getPreviousItem", () => {
229229
TaskID: "current-task-id",
230230
TerminalStatus: "ready to collect",
231231
ApplicationName: "Jim's Pills",
232-
ApplicationID: "id",
232+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
233233
ExpiryTime: 123
234234
}
235235

@@ -344,7 +344,7 @@ describe("Unit test rollbackDataItems", () => {
344344
TaskID: "TaskID_1",
345345
TerminalStatus: "TerminalStatus_1",
346346
ApplicationName: "name",
347-
ApplicationID: "id",
347+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
348348
ExpiryTime: 10,
349349
...overrides
350350
})

packages/updatePrescriptionStatus/tests/testSqsClient.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ describe("Unit tests for checkSiteOrSystemIsNotifyEnabled", () => {
488488
const item2 = createMockDataItem({
489489
PharmacyODSCode: "zzz999",
490490
ApplicationName: "internal test SYSTEM",
491-
ApplicationID: "internal test SYSTEM"
491+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000"
492492
})
493493
const result = await checkSiteOrSystemIsNotifyEnabled([
494494
{
@@ -531,13 +531,13 @@ describe("Unit tests for checkSiteOrSystemIsNotifyEnabled", () => {
531531
const previous = createMockDataItem({
532532
PharmacyODSCode: "NOTINLIST",
533533
ApplicationName: "Some Other System",
534-
ApplicationID: "Some Other System",
534+
ApplicationID: "550e8400-e29b-41d4-a716-446655441234",
535535
Status: "previous"
536536
})
537537
const current = createMockDataItem({
538538
PharmacyODSCode: "NOTINLIST",
539539
ApplicationName: "Some Other System",
540-
ApplicationID: "Some Other System"
540+
ApplicationID: "550e8400-e29b-41d4-a716-446655441234"
541541
})
542542
const result = await checkSiteOrSystemIsNotifyEnabled([{previous, current}], logger)
543543
expect(result).toEqual([])

packages/updatePrescriptionStatus/tests/utils/testUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export function createMockDataItem(overrides: Partial<PSUDataItem>): PSUDataItem
209209
TaskID: "mnopqr-ghijkl-abcdef",
210210
TerminalStatus: "ready to collect",
211211
ApplicationName: "Internal Test System",
212-
ApplicationID: "Internal Test System",
212+
ApplicationID: "550e8400-e29b-41d4-a716-446655440000",
213213
ExpiryTime: 123,
214214
...overrides
215215
}

0 commit comments

Comments
 (0)