Skip to content

Commit 3761647

Browse files
committed
Sync example screener checks with library 0.10.0
1 parent 0c49c17 commit 3761647

7 files changed

Lines changed: 50 additions & 29 deletions

File tree

‎builder-api/src/main/resources/seed-data/example-screener/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Philadelphia example screener
22

33
This seed is built from scratch for new accounts. The three tax benefits use
4-
check configurations derived from the library API 0.9.0 OpenAPI benefit
4+
check configurations derived from the library API 0.10.0 OpenAPI benefit
55
compositions. Each enrollment check binds `personId` to the form's `client` ID.
66
Philly Cash is fictional and has three checks: Philadelphia residence, wanting
77
extra cash, and a household income limit. Residence reuses the library check.
@@ -20,6 +20,10 @@ Markdown guidance. Descriptions explain aliases, parameters, version pinning,
2020
editing, previewing, and publishing. Publishing remains a user action so each
2121
new account can explore and edit its own working copy first.
2222

23+
When the library version changes, review the example's library checks and update
24+
their `sourceCheckId` and `checkVersion` together. The example transfer E2E test
25+
checks these references against the running library's version and endpoints.
26+
2327
Try these scenarios in Preview:
2428

2529
- Explore all four: residence Yes, wants cash Yes, income 30000, owner-occupant

‎builder-api/src/main/resources/seed-data/example-screener/firestore/workingScreener/eCI03lKZqnNtPRgGbag1/customBenefit/a3bbed8c-e300-4a6f-bd7b-28670db9d8ec.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"aliasGenerated" : false,
44
"aliasName" : "NotAlreadyOnHomestead",
55
"checkModule" : "enrollment",
6-
"checkVersion" : "0.9.0",
6+
"checkVersion" : "0.10.0",
77
"inputDefinition" : {
88
"type" : "object",
99
"properties" : {
@@ -34,7 +34,7 @@
3434
"key" : "benefit",
3535
"required" : false
3636
} ],
37-
"sourceCheckId" : "L-enrollment-person-not-enrolled-in-benefit-0.9.0",
37+
"sourceCheckId" : "L-enrollment-person-not-enrolled-in-benefit-0.10.0",
3838
"checkName" : "person-not-enrolled-in-benefit",
3939
"evaluationUrl" : "/api/v1/checks/enrollment/person-not-enrolled-in-benefit",
4040
"checkId" : "d2962c1a-79ba-4fe6-a83c-c9f334591ae9",
@@ -46,7 +46,7 @@
4646
"aliasGenerated" : false,
4747
"aliasName" : "NoTenYearTaxAbatement",
4848
"checkModule" : "residence",
49-
"checkVersion" : "0.9.0",
49+
"checkVersion" : "0.10.0",
5050
"inputDefinition" : {
5151
"type" : "object",
5252
"properties" : {
@@ -61,7 +61,7 @@
6161
}
6262
},
6363
"parameterDefinitions" : [ ],
64-
"sourceCheckId" : "L-residence-no-ten-year-tax-abatement-0.9.0",
64+
"sourceCheckId" : "L-residence-no-ten-year-tax-abatement-0.10.0",
6565
"checkName" : "no-ten-year-tax-abatement",
6666
"evaluationUrl" : "/api/v1/checks/residence/no-ten-year-tax-abatement",
6767
"checkId" : "dd0faed3-23de-4c77-ae9b-eaf06363ef54",
@@ -70,7 +70,7 @@
7070
"aliasGenerated" : false,
7171
"aliasName" : "OwnerOccupant",
7272
"checkModule" : "residence",
73-
"checkVersion" : "0.9.0",
73+
"checkVersion" : "0.10.0",
7474
"inputDefinition" : {
7575
"type" : "object",
7676
"properties" : {
@@ -85,7 +85,7 @@
8585
}
8686
},
8787
"parameterDefinitions" : [ ],
88-
"sourceCheckId" : "L-residence-owner-occupant-0.9.0",
88+
"sourceCheckId" : "L-residence-owner-occupant-0.10.0",
8989
"checkName" : "owner-occupant",
9090
"evaluationUrl" : "/api/v1/checks/residence/owner-occupant",
9191
"checkId" : "d32c63c3-cd30-4e5d-91d4-0b5b5e88c209",
@@ -94,7 +94,7 @@
9494
"aliasGenerated" : false,
9595
"aliasName" : "LivesInPhiladelphiaPa",
9696
"checkModule" : "residence",
97-
"checkVersion" : "0.9.0",
97+
"checkVersion" : "0.10.0",
9898
"inputDefinition" : {
9999
"type" : "object",
100100
"properties" : {
@@ -109,7 +109,7 @@
109109
}
110110
},
111111
"parameterDefinitions" : [ ],
112-
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.9.0",
112+
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.10.0",
113113
"checkName" : "lives-in-philadelphia-pa",
114114
"evaluationUrl" : "/api/v1/checks/residence/lives-in-philadelphia-pa",
115115
"checkId" : "dd321297-2188-4836-82c5-c657b26a18fd",

‎builder-api/src/main/resources/seed-data/example-screener/firestore/workingScreener/eCI03lKZqnNtPRgGbag1/customBenefit/aca7b919-3005-47b7-9ad8-8734a013e07e.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"aliasGenerated" : false,
44
"aliasName" : "Lives in Philadelphia",
55
"checkModule" : "residence",
6-
"checkVersion" : "0.9.0",
6+
"checkVersion" : "0.10.0",
77
"inputDefinition" : {
88
"type" : "object",
99
"properties" : {
@@ -18,7 +18,7 @@
1818
}
1919
},
2020
"parameterDefinitions" : [ ],
21-
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.9.0",
21+
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.10.0",
2222
"checkName" : "lives-in-philadelphia-pa",
2323
"evaluationUrl" : "/api/v1/checks/residence/lives-in-philadelphia-pa",
2424
"checkId" : "3746307e-45a5-4e86-afe3-5bbaa6cc7225",

‎builder-api/src/main/resources/seed-data/example-screener/firestore/workingScreener/eCI03lKZqnNtPRgGbag1/customBenefit/ca00617a-4c9b-4710-9601-57880efde0c0.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"aliasGenerated" : false,
44
"aliasName" : "NotAlreadyOnSeniorCitizenTaxFreeze",
55
"checkModule" : "enrollment",
6-
"checkVersion" : "0.9.0",
6+
"checkVersion" : "0.10.0",
77
"inputDefinition" : {
88
"type" : "object",
99
"properties" : {
@@ -34,7 +34,7 @@
3434
"key" : "benefit",
3535
"required" : false
3636
} ],
37-
"sourceCheckId" : "L-enrollment-person-not-enrolled-in-benefit-0.9.0",
37+
"sourceCheckId" : "L-enrollment-person-not-enrolled-in-benefit-0.10.0",
3838
"checkName" : "person-not-enrolled-in-benefit",
3939
"evaluationUrl" : "/api/v1/checks/enrollment/person-not-enrolled-in-benefit",
4040
"checkId" : "40c3c72c-18c8-423d-9923-bf8013181eb3",
@@ -46,7 +46,7 @@
4646
"aliasGenerated" : false,
4747
"aliasName" : "OwnerOccupant",
4848
"checkModule" : "residence",
49-
"checkVersion" : "0.9.0",
49+
"checkVersion" : "0.10.0",
5050
"inputDefinition" : {
5151
"type" : "object",
5252
"properties" : {
@@ -61,7 +61,7 @@
6161
}
6262
},
6363
"parameterDefinitions" : [ ],
64-
"sourceCheckId" : "L-residence-owner-occupant-0.9.0",
64+
"sourceCheckId" : "L-residence-owner-occupant-0.10.0",
6565
"checkName" : "owner-occupant",
6666
"evaluationUrl" : "/api/v1/checks/residence/owner-occupant",
6767
"checkId" : "383d5d42-4a8d-4bb4-a92e-29f0a63e6746",
@@ -70,7 +70,7 @@
7070
"aliasGenerated" : false,
7171
"aliasName" : "LivesInPhiladelphiaPa",
7272
"checkModule" : "residence",
73-
"checkVersion" : "0.9.0",
73+
"checkVersion" : "0.10.0",
7474
"inputDefinition" : {
7575
"type" : "object",
7676
"properties" : {
@@ -85,7 +85,7 @@
8585
}
8686
},
8787
"parameterDefinitions" : [ ],
88-
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.9.0",
88+
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.10.0",
8989
"checkName" : "lives-in-philadelphia-pa",
9090
"evaluationUrl" : "/api/v1/checks/residence/lives-in-philadelphia-pa",
9191
"checkId" : "eb5ca136-1cd3-44c2-aea2-2b941918d84c",
@@ -94,7 +94,7 @@
9494
"aliasGenerated" : false,
9595
"aliasName" : "MeetsAgeRequirement",
9696
"checkModule" : "internal",
97-
"checkVersion" : "0.9.0",
97+
"checkVersion" : "0.10.0",
9898
"inputDefinition" : {
9999
"type" : "object",
100100
"properties" : {
@@ -145,7 +145,7 @@
145145
}
146146
},
147147
"parameterDefinitions" : [ ],
148-
"sourceCheckId" : "L-internal-sctf-age-requirement-0.9.0",
148+
"sourceCheckId" : "L-internal-sctf-age-requirement-0.10.0",
149149
"checkName" : "sctf-age-requirement",
150150
"evaluationUrl" : "/api/v1/checks/internal/sctf-age-requirement",
151151
"checkId" : "dddfa96b-e60d-4835-904f-b34a803d3753",

‎builder-api/src/main/resources/seed-data/example-screener/firestore/workingScreener/eCI03lKZqnNtPRgGbag1/customBenefit/fd13baff-cf75-488a-afee-c6785acd6c7b.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"aliasGenerated" : false,
44
"aliasName" : "NotAlreadyOnOwnerOccupiedPaymentAgreement",
55
"checkModule" : "enrollment",
6-
"checkVersion" : "0.9.0",
6+
"checkVersion" : "0.10.0",
77
"inputDefinition" : {
88
"type" : "object",
99
"properties" : {
@@ -34,7 +34,7 @@
3434
"key" : "benefit",
3535
"required" : false
3636
} ],
37-
"sourceCheckId" : "L-enrollment-person-not-enrolled-in-benefit-0.9.0",
37+
"sourceCheckId" : "L-enrollment-person-not-enrolled-in-benefit-0.10.0",
3838
"checkName" : "person-not-enrolled-in-benefit",
3939
"evaluationUrl" : "/api/v1/checks/enrollment/person-not-enrolled-in-benefit",
4040
"checkId" : "bb9526f7-20cd-4f75-93b4-322acb459c38",
@@ -46,7 +46,7 @@
4646
"aliasGenerated" : false,
4747
"aliasName" : "LivesInPhiladelphiaPa",
4848
"checkModule" : "residence",
49-
"checkVersion" : "0.9.0",
49+
"checkVersion" : "0.10.0",
5050
"inputDefinition" : {
5151
"type" : "object",
5252
"properties" : {
@@ -61,7 +61,7 @@
6161
}
6262
},
6363
"parameterDefinitions" : [ ],
64-
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.9.0",
64+
"sourceCheckId" : "L-residence-lives-in-philadelphia-pa-0.10.0",
6565
"checkName" : "lives-in-philadelphia-pa",
6666
"evaluationUrl" : "/api/v1/checks/residence/lives-in-philadelphia-pa",
6767
"checkId" : "ad02887f-cb2b-413b-90b9-65dc76d28085",
@@ -70,7 +70,7 @@
7070
"aliasGenerated" : false,
7171
"aliasName" : "OwnerOccupant",
7272
"checkModule" : "residence",
73-
"checkVersion" : "0.9.0",
73+
"checkVersion" : "0.10.0",
7474
"inputDefinition" : {
7575
"type" : "object",
7676
"properties" : {
@@ -85,7 +85,7 @@
8585
}
8686
},
8787
"parameterDefinitions" : [ ],
88-
"sourceCheckId" : "L-residence-owner-occupant-0.9.0",
88+
"sourceCheckId" : "L-residence-owner-occupant-0.10.0",
8989
"checkName" : "owner-occupant",
9090
"evaluationUrl" : "/api/v1/checks/residence/owner-occupant",
9191
"checkId" : "7d3e74f8-da71-485f-975e-007f7723b63f",
@@ -94,7 +94,7 @@
9494
"aliasGenerated" : false,
9595
"aliasName" : "TaxDelinquent",
9696
"checkModule" : "residence",
97-
"checkVersion" : "0.9.0",
97+
"checkVersion" : "0.10.0",
9898
"inputDefinition" : {
9999
"type" : "object",
100100
"properties" : {
@@ -109,7 +109,7 @@
109109
}
110110
},
111111
"parameterDefinitions" : [ ],
112-
"sourceCheckId" : "L-residence-tax-delinquent-0.9.0",
112+
"sourceCheckId" : "L-residence-tax-delinquent-0.10.0",
113113
"checkName" : "tax-delinquent",
114114
"evaluationUrl" : "/api/v1/checks/residence/tax-delinquent",
115115
"checkId" : "885a4068-ca22-4c1a-99ba-901bb516e79e",

‎builder-api/src/test/java/org/codeforphilly/bdt/builder/service/ScreenerTransferServiceTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ void bundledExampleCanBeExportedAndImportedWithItsInternalLibraryCheck() throws
590590
}
591591
LibraryApiService actualLibrary = new LibraryApiService();
592592
actualLibrary.loadBenefitsMetadata(mapper.writeValueAsString(exampleBenefits));
593-
String internalId = "L-internal-sctf-age-requirement-0.9.0";
593+
String internalId = "L-internal-sctf-age-requirement-0.10.0";
594594
assertTrue(actualLibrary.getById(internalId).isEmpty());
595595
ScreenerTransferService transferService = new ScreenerTransferService(screeners, checks, storage, actualLibrary, dmn);
596596
var exported = transferService.exportScreener("sender", example.getId());

‎e2e/tests/exampleScreenerTransfer.spec.ts‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,28 @@ test("the bundled example can be chosen, exported, and imported with its interna
4747
for await (const chunk of stream!) chunks.push(Buffer.from(chunk));
4848
const buffer = Buffer.concat(chunks);
4949
const exported = JSON.parse(buffer.toString());
50+
const libraryResponse = await request.get(
51+
"http://localhost:8083/q/openapi.json",
52+
);
53+
expect(libraryResponse.ok()).toBe(true);
54+
const library = await libraryResponse.json();
55+
// The bundled example must stay in sync when the library release changes.
56+
for (const check of exported.benefits.flatMap((benefit: any) => benefit.checks)) {
57+
if (!check.sourceCheckId.startsWith("L-")) continue;
58+
expect(check.checkVersion, check.sourceCheckId).toBe(library.info.version);
59+
expect(check.sourceCheckId).toBe(
60+
`L-${check.checkModule}-${check.checkName}-${library.info.version}`,
61+
);
62+
expect(
63+
library.paths[check.evaluationUrl]?.post,
64+
check.sourceCheckId,
65+
).toBeDefined();
66+
}
5067
expect(exported.benefits).toHaveLength(4);
5168
expect(exported.benefits.flatMap((benefit: any) => benefit.checks)).toEqual(
5269
expect.arrayContaining([
5370
expect.objectContaining({
54-
sourceCheckId: "L-internal-sctf-age-requirement-0.9.0",
71+
sourceCheckId: `L-internal-sctf-age-requirement-${library.info.version}`,
5572
}),
5673
]),
5774
);

0 commit comments

Comments
 (0)