Skip to content

Commit cfc25f6

Browse files
authored
Merge pull request #391 from CodeForPhilly/388-complete-library-checks-for-phloopa
Add Philly OOPA benefit to library
2 parents c97ec1c + 7baac4a commit cfc25f6

11 files changed

Lines changed: 1203 additions & 0 deletions

File tree

.claude/commands/new-dmn-benefit.md

Lines changed: 540 additions & 0 deletions
Large diffs are not rendered by default.

library-api/src/main/resources/BDT.dmn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@
9595
<dmn:itemComponent id="_9B8E011F-DFED-4C8C-853A-4DDD715C807A" name="livesInPhiladelphiaPa" isCollection="false">
9696
<dmn:typeRef>boolean</dmn:typeRef>
9797
</dmn:itemComponent>
98+
<dmn:itemComponent id="_587DCE99-9448-4BE2-BBAC-8E1946049A23" name="taxDelinquent" isCollection="false">
99+
<dmn:typeRef>boolean</dmn:typeRef>
100+
</dmn:itemComponent>
98101
</dmn:itemDefinition>
99102
<dmn:businessKnowledgeModel id="_04036CBE-BE0E-44C8-9A49-01D01F005E6F" name="age as of date">
100103
<dmn:extensionElements/>

library-api/src/main/resources/benefits/pa/phl/owner-occupied-payment-agreement.dmn

Lines changed: 360 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<dmn:definitions
3+
xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/"
4+
xmlns="https://kie.apache.org/dmn/_F26CE0F4-1FF7-404A-9EF3-788224C69FE5"
5+
xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/"
6+
xmlns:kie="http://www.drools.org/kie/dmn/1.2"
7+
xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/"
8+
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
9+
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
10+
xmlns:included1="https://kie.apache.org/dmn/_1B91A885-130A-4E0B-A762-E12AA6DD5C79"
11+
xmlns:included2="https://kie.apache.org/dmn/_C9F91EE8-9F17-4867-9638-912AC7DB68F1"
12+
id="_5FA6D636-B06D-466E-A580-73F9D11999D7"
13+
name="TaxDelinquent"
14+
typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/"
15+
namespace="https://kie.apache.org/dmn/_F26CE0F4-1FF7-404A-9EF3-788224C69FE5">
16+
<dmn:description>Checks whether the property owner has delinquent taxes.</dmn:description>
17+
<dmn:extensionElements/>
18+
<dmn:import id="_5CC41E8A-DDE8-4102-8E2E-D1E988CA4EB5" name="BDT"
19+
namespace="https://kie.apache.org/dmn/_1B91A885-130A-4E0B-A762-E12AA6DD5C79"
20+
locationURI="../BDT.dmn"
21+
importType="http://www.omg.org/spec/DMN/20180521/MODEL/"/>
22+
<dmn:import id="_F834A1B5-5186-4122-8DB1-0A21699EE86B" name="Residence"
23+
namespace="https://kie.apache.org/dmn/_C9F91EE8-9F17-4867-9638-912AC7DB68F1"
24+
locationURI="Residence.dmn"
25+
importType="http://www.omg.org/spec/DMN/20180521/MODEL/"/>
26+
<dmn:itemDefinition id="_49FCA0D5-0B51-4390-9CB6-6DC5E35A4761" name="tSimpleChecks" isCollection="false">
27+
<dmn:itemComponent id="_7A1A8CC7-2108-490A-95A1-1AA19C7E937D" name="taxDelinquent" isCollection="false">
28+
<dmn:typeRef>boolean</dmn:typeRef>
29+
</dmn:itemComponent>
30+
</dmn:itemDefinition>
31+
<dmn:itemDefinition id="_9427B5B5-0BE5-4617-9D6B-07D59240433B" name="tSituation" isCollection="false">
32+
<dmn:itemComponent id="_1A2CC650-C64F-40AC-82DC-50994805CE53" name="simpleChecks" isCollection="false">
33+
<dmn:typeRef>tSimpleChecks</dmn:typeRef>
34+
</dmn:itemComponent>
35+
</dmn:itemDefinition>
36+
<dmn:decisionService id="_C41C2468-7290-4E8E-895F-8D0F648C6E26" name="TaxDelinquentService">
37+
<dmn:extensionElements/>
38+
<dmn:variable id="_5B39FF18-4AA5-42FD-8928-B6FAB73FD206" name="TaxDelinquentService" typeRef="BDT.tCheckResponse"/>
39+
<dmn:outputDecision href="#_76277271-E005-4934-8D0F-5C4433255927"/>
40+
<dmn:inputData href="#_828BBBD1-BA7A-488F-A5A6-C00779022AFA"/>
41+
</dmn:decisionService>
42+
<dmn:decision id="_76277271-E005-4934-8D0F-5C4433255927" name="checkResult">
43+
<dmn:extensionElements/>
44+
<dmn:variable id="_2F37315B-D351-4659-AE85-285F44535669" name="checkResult" typeRef="boolean"/>
45+
<dmn:informationRequirement id="_07BEBD90-1E94-4896-BD69-9777D3F2A582">
46+
<dmn:requiredInput href="#_828BBBD1-BA7A-488F-A5A6-C00779022AFA"/>
47+
</dmn:informationRequirement>
48+
<dmn:literalExpression id="_28B95B89-9C86-4487-86E1-D33FA6BD82DA">
49+
<dmn:text>if situation.simpleChecks != null and situation.simpleChecks.taxDelinquent != null then
50+
situation.simpleChecks.taxDelinquent = true
51+
else
52+
null</dmn:text>
53+
</dmn:literalExpression>
54+
</dmn:decision>
55+
<dmn:inputData id="_828BBBD1-BA7A-488F-A5A6-C00779022AFA" name="situation">
56+
<dmn:extensionElements/>
57+
<dmn:variable id="_0C7450FD-92FB-4B23-AE1E-8561C0E0CD4F" name="situation" typeRef="tSituation"/>
58+
</dmn:inputData>
59+
<dmndi:DMNDI>
60+
<dmndi:DMNDiagram id="_78DD76C8-4DE4-4BEA-8B95-3ED0760FF2F6" name="DRG">
61+
<di:extension>
62+
<kie:ComponentsWidthsExtension>
63+
<kie:ComponentWidths dmnElementRef="_28B95B89-9C86-4487-86E1-D33FA6BD82DA">
64+
<kie:width>917</kie:width>
65+
</kie:ComponentWidths>
66+
</kie:ComponentsWidthsExtension>
67+
</di:extension>
68+
<dmndi:DMNShape id="dmnshape-drg-_C41C2468-7290-4E8E-895F-8D0F648C6E26" dmnElementRef="_C41C2468-7290-4E8E-895F-8D0F648C6E26" isCollapsed="false">
69+
<dmndi:DMNStyle>
70+
<dmndi:FillColor red="255" green="255" blue="255"/>
71+
<dmndi:StrokeColor red="0" green="0" blue="0"/>
72+
<dmndi:FontColor red="0" green="0" blue="0"/>
73+
</dmndi:DMNStyle>
74+
<dc:Bounds x="170" y="106" width="280" height="199"/>
75+
<dmndi:DMNLabel/>
76+
<dmndi:DMNDecisionServiceDividerLine>
77+
<di:waypoint x="170" y="206"/>
78+
<di:waypoint x="450" y="206"/>
79+
</dmndi:DMNDecisionServiceDividerLine>
80+
</dmndi:DMNShape>
81+
<dmndi:DMNShape id="dmnshape-drg-_76277271-E005-4934-8D0F-5C4433255927" dmnElementRef="_76277271-E005-4934-8D0F-5C4433255927" isCollapsed="false">
82+
<dmndi:DMNStyle>
83+
<dmndi:FillColor red="255" green="255" blue="255"/>
84+
<dmndi:StrokeColor red="0" green="0" blue="0"/>
85+
<dmndi:FontColor red="0" green="0" blue="0"/>
86+
</dmndi:DMNStyle>
87+
<dc:Bounds x="266" y="147" width="88" height="50"/>
88+
<dmndi:DMNLabel/>
89+
</dmndi:DMNShape>
90+
<dmndi:DMNShape id="dmnshape-drg-_828BBBD1-BA7A-488F-A5A6-C00779022AFA" dmnElementRef="_828BBBD1-BA7A-488F-A5A6-C00779022AFA" isCollapsed="false">
91+
<dmndi:DMNStyle>
92+
<dmndi:FillColor red="255" green="255" blue="255"/>
93+
<dmndi:StrokeColor red="0" green="0" blue="0"/>
94+
<dmndi:FontColor red="0" green="0" blue="0"/>
95+
</dmndi:DMNStyle>
96+
<dc:Bounds x="260" y="336" width="100" height="50"/>
97+
<dmndi:DMNLabel/>
98+
</dmndi:DMNShape>
99+
<dmndi:DMNEdge id="dmnedge-drg-_07BEBD90-1E94-4896-BD69-9777D3F2A582-AUTO-TARGET" dmnElementRef="_07BEBD90-1E94-4896-BD69-9777D3F2A582">
100+
<di:waypoint x="310" y="361"/>
101+
<di:waypoint x="310" y="197"/>
102+
</dmndi:DMNEdge>
103+
</dmndi:DMNDiagram>
104+
</dmndi:DMNDI>
105+
</dmn:definitions>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
meta {
2+
name: Eligible
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: {{host}}/benefits/pa/phl/owner-occupied-payment-agreement
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"situation": {
16+
"primaryPersonId": "p1",
17+
"enrollments": [
18+
{
19+
"personId": "p1",
20+
"benefit": "PhlHomesteadExemption"
21+
}
22+
],
23+
"simpleChecks": {
24+
"livesInPhiladelphiaPa": true,
25+
"ownerOccupant": true,
26+
"taxDelinquent": true
27+
}
28+
}
29+
}
30+
}
31+
32+
assert {
33+
res.body.isEligible: eq true
34+
}
35+
36+
settings {
37+
encodeUrl: true
38+
timeout: 0
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
meta {
2+
name: Ineligible
3+
type: http
4+
seq: 3
5+
}
6+
7+
post {
8+
url: {{host}}/benefits/pa/phl/owner-occupied-payment-agreement
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"situation": {
16+
"primaryPersonId": "p1",
17+
"enrollments": [
18+
{
19+
"personId": "p1",
20+
"benefit": "PhlOwnerOccupiedPaymentAgreement"
21+
}
22+
],
23+
"simpleChecks": {
24+
"livesInPhiladelphiaPa": true,
25+
"ownerOccupant": true,
26+
"taxDelinquent": true
27+
}
28+
}
29+
}
30+
}
31+
32+
assert {
33+
res.body.isEligible: eq false
34+
}
35+
36+
settings {
37+
encodeUrl: true
38+
timeout: 0
39+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
meta {
2+
name: Smoke Test
3+
type: http
4+
seq: 1
5+
}
6+
7+
post {
8+
url: {{host}}/benefits/pa/phl/owner-occupied-payment-agreement
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"situation": {
16+
"primaryPersonId": "p1",
17+
"simpleChecks": {
18+
"ownerOccupant": true
19+
}
20+
}
21+
}
22+
}
23+
24+
assert {
25+
res.body.isEligible: eq null
26+
}
27+
28+
settings {
29+
encodeUrl: true
30+
timeout: 0
31+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
meta {
2+
name: PhlOwnerOccupiedPaymentAgreement
3+
seq: 2
4+
}
5+
6+
auth {
7+
mode: inherit
8+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
meta {
2+
name: Fail
3+
type: http
4+
seq: 2
5+
}
6+
7+
post {
8+
url: {{host}}/checks/residence/tax-delinquent
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"situation": {
16+
"simpleChecks": {
17+
"taxDelinquent": false
18+
}
19+
}
20+
}
21+
}
22+
23+
assert {
24+
res.body.checkResult: eq false
25+
res.status: eq 200
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
meta {
2+
name: Null
3+
type: http
4+
seq: 3
5+
}
6+
7+
post {
8+
url: {{host}}/checks/residence/tax-delinquent
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"situation": {
16+
"simpleChecks": {
17+
"taxDelinquent": null
18+
}
19+
}
20+
}
21+
}
22+
23+
assert {
24+
res.body.checkResult: eq null
25+
res.status: eq 200
26+
}

0 commit comments

Comments
 (0)