policyengine-household-wizard 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -5
- package/dist/WizardReviewList-DhLx8Bla.cjs +1 -0
- package/dist/WizardReviewList-oY1HqmLw.js +354 -0
- package/dist/index-B_OXaS4a.cjs +1 -0
- package/dist/index-CIL8FXNR.cjs +1 -0
- package/dist/index-DWM0giHt.js +220 -0
- package/dist/index-fgLnXugs.js +225 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -28
- package/dist/primitives/WizardReviewList.d.ts +3 -2
- package/dist/primitives/WizardReviewList.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +12 -10
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/types.d.ts +18 -0
- package/dist/primitives/types.d.ts.map +1 -1
- package/dist/primitives/useWizardStepFocus.d.ts +13 -0
- package/dist/primitives/useWizardStepFocus.d.ts.map +1 -0
- package/dist/primitives/useWizardSteps.d.ts +2 -2
- package/dist/primitives/useWizardSteps.d.ts.map +1 -1
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +5 -4
- package/dist/uk-household/adapters/householdImpactRequest.d.ts +91 -0
- package/dist/uk-household/adapters/householdImpactRequest.d.ts.map +1 -0
- package/dist/uk-household/adapters/index.d.ts +2 -0
- package/dist/uk-household/adapters/index.d.ts.map +1 -0
- package/dist/uk-household/children.d.ts +18 -0
- package/dist/uk-household/children.d.ts.map +1 -0
- package/dist/uk-household/codes.d.ts +22 -0
- package/dist/uk-household/codes.d.ts.map +1 -0
- package/dist/uk-household/defaults.d.ts +56 -0
- package/dist/uk-household/defaults.d.ts.map +1 -0
- package/dist/uk-household/draft.d.ts +37 -0
- package/dist/uk-household/draft.d.ts.map +1 -0
- package/dist/uk-household/index.d.ts +10 -0
- package/dist/uk-household/index.d.ts.map +1 -0
- package/dist/uk-household/serialize.d.ts +4 -0
- package/dist/uk-household/serialize.d.ts.map +1 -0
- package/dist/uk-household/statePension.d.ts +42 -0
- package/dist/uk-household/statePension.d.ts.map +1 -0
- package/dist/uk-household/types.d.ts +134 -0
- package/dist/uk-household/types.d.ts.map +1 -0
- package/dist/uk-household/validate.d.ts +59 -0
- package/dist/uk-household/validate.d.ts.map +1 -0
- package/dist/uk-household-adapters.cjs +1 -0
- package/dist/uk-household-adapters.d.ts +1 -0
- package/dist/uk-household-adapters.js +5 -0
- package/dist/uk-household.cjs +1 -0
- package/dist/uk-household.d.ts +1 -0
- package/dist/uk-household.js +220 -0
- package/dist/us-household/adapters/index.d.ts +1 -1
- package/dist/us-household/adapters/v1Payload.d.ts +119 -3
- package/dist/us-household/adapters/v1Payload.d.ts.map +1 -1
- package/dist/us-household/amount.d.ts +8 -0
- package/dist/us-household/amount.d.ts.map +1 -0
- package/dist/us-household/draft.d.ts +1 -1
- package/dist/us-household/index.d.ts +9 -8
- package/dist/us-household/index.d.ts.map +1 -1
- package/dist/us-household/normalize.d.ts +1 -1
- package/dist/us-household/normalize.d.ts.map +1 -1
- package/dist/us-household/serialize.d.ts +1 -1
- package/dist/us-household/serialize.d.ts.map +1 -1
- package/dist/us-household/tippedOccupations.d.ts +40 -0
- package/dist/us-household/tippedOccupations.d.ts.map +1 -0
- package/dist/us-household/types.d.ts +138 -18
- package/dist/us-household/types.d.ts.map +1 -1
- package/dist/us-household/validate.d.ts +1 -1
- package/dist/us-household/validate.d.ts.map +1 -1
- package/dist/us-household-adapters.cjs +1 -1
- package/dist/us-household-adapters.d.ts +1 -1
- package/dist/us-household-adapters.js +3 -90
- package/dist/us-household.cjs +1 -1
- package/dist/us-household.d.ts +1 -1
- package/dist/us-household.js +346 -246
- package/dist/validation.d.ts +16 -0
- package/dist/validation.d.ts.map +1 -0
- package/package.json +16 -2
- package/src/primitives/WizardReviewList.tsx +35 -18
- package/src/primitives/index.ts +3 -0
- package/src/primitives/types.ts +20 -0
- package/src/primitives/useWizardStepFocus.ts +42 -0
- package/src/primitives/useWizardSteps.ts +181 -84
- package/src/styles.css +9 -0
- package/src/uk-household/adapters/householdImpactRequest.ts +164 -0
- package/src/uk-household/adapters/index.ts +9 -0
- package/src/uk-household/children.ts +23 -0
- package/src/uk-household/codes.ts +67 -0
- package/src/uk-household/defaults.ts +101 -0
- package/src/uk-household/draft.ts +138 -0
- package/src/uk-household/index.ts +75 -0
- package/src/uk-household/serialize.ts +189 -0
- package/src/uk-household/statePension.ts +69 -0
- package/src/uk-household/types.ts +159 -0
- package/src/uk-household/validate.ts +190 -0
- package/src/us-household/adapters/v1Payload.ts +211 -18
- package/src/us-household/amount.ts +10 -0
- package/src/us-household/index.ts +11 -0
- package/src/us-household/normalize.ts +79 -4
- package/src/us-household/serialize.ts +5 -1
- package/src/us-household/tippedOccupations.ts +145 -0
- package/src/us-household/types.ts +144 -15
- package/src/us-household/validate.ts +101 -4
- package/src/validation.ts +12 -0
- package/dist/WizardReviewList-De9RTK_4.js +0 -245
- package/dist/WizardReviewList-tfP9LcqU.cjs +0 -1
|
@@ -1,33 +1,166 @@
|
|
|
1
1
|
export type USMaritalStatus = 'single' | 'married';
|
|
2
|
+
/**
|
|
3
|
+
* `'dependent'` means claimed as a tax dependent by someone in the household;
|
|
4
|
+
* `'adult'` means not claimed. Choose it from the user's answer, not from age.
|
|
5
|
+
* The V1 adapter sends it for every person as `is_tax_unit_dependent`. It puts
|
|
6
|
+
* everyone in one tax unit, where PolicyEngine US makes the two oldest adults
|
|
7
|
+
* head and spouse. Any other adult is then neither head, spouse nor
|
|
8
|
+
* dependent, and their income counts in the unit's gross income.
|
|
9
|
+
*/
|
|
2
10
|
export type USPersonKind = 'adult' | 'dependent';
|
|
3
11
|
/**
|
|
4
12
|
* Person-level fields that the wizard surfaces uniformly across apps. Apps that
|
|
5
|
-
* do not collect a flag should leave it `undefined
|
|
6
|
-
* `
|
|
13
|
+
* do not collect a flag should leave it `undefined`. The V1 adapter sends only
|
|
14
|
+
* `true` and `false`; for these flags `false` and `undefined` give the same
|
|
15
|
+
* model results, and the difference matters to review screens and links.
|
|
7
16
|
*/
|
|
8
17
|
export interface USPersonFlags {
|
|
9
18
|
isDisabled?: boolean;
|
|
10
19
|
isBlind?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Full-time student at any level. PolicyEngine US counts everyone aged 5 to
|
|
22
|
+
* 17 as a K-12 student by age, so the V1 adapter sends this only from age 18,
|
|
23
|
+
* as full-time college enrollment ("is_full_time_college_student"). Rules
|
|
24
|
+
* for college students (for example SNAP's student rule and New Jersey's
|
|
25
|
+
* exemption for dependents attending college) then count that person.
|
|
26
|
+
*/
|
|
11
27
|
isFullTimeStudent?: boolean;
|
|
12
28
|
isPregnant?: boolean;
|
|
13
29
|
needsCare?: boolean;
|
|
14
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Annual amounts in dollars. Fields are additive, so an amount belongs in
|
|
33
|
+
* exactly one field. Each field sets its own PolicyEngine US variable, except
|
|
34
|
+
* that `pensionIncome` and `privatePensionIncome` share one and are summed,
|
|
35
|
+
* and `tipIncome` is also added to wages.
|
|
36
|
+
*/
|
|
15
37
|
export interface USPersonIncomes {
|
|
16
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Wages and salaries, not counting tips entered in `tipIncome`;
|
|
40
|
+
* "employment_income" in PolicyEngine US.
|
|
41
|
+
*/
|
|
17
42
|
employmentIncome?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Tips received as an employee; "tip_income" in PolicyEngine US.
|
|
45
|
+
* PolicyEngine US counts tips as part of wages (`employment_income` is
|
|
46
|
+
* wages "including tips and commissions"), and income and payroll taxes
|
|
47
|
+
* read `employment_income`. A few rules read `tip_income` on its own, such
|
|
48
|
+
* as the federal deduction for qualified tips (2025-2028) and Georgia's cash
|
|
49
|
+
* tip exclusion. So the V1 adapter sends these tips both as `tip_income` and
|
|
50
|
+
* added to `employment_income`. Tips can count for the deduction only with a
|
|
51
|
+
* listed `tippedOccupationCode`. A self-employed worker's tips belong in
|
|
52
|
+
* `selfEmploymentIncome`, which the adapter does not send as `tip_income`.
|
|
53
|
+
*/
|
|
54
|
+
tipIncome?: number;
|
|
55
|
+
/** "self_employment_income" in PolicyEngine US. */
|
|
18
56
|
selfEmploymentIncome?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Social Security retirement benefits; "social_security_retirement" in
|
|
59
|
+
* PolicyEngine US. Put SSDI in `ssdiAmount`, not here: the model adds the two
|
|
60
|
+
* to get total Social Security. Survivors or dependents benefits entered here
|
|
61
|
+
* count as retirement benefits.
|
|
62
|
+
*/
|
|
19
63
|
socialSecurityIncome?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Reported Supplemental Security Income; "ssi" in PolicyEngine US. It
|
|
66
|
+
* replaces the model's own SSI calculation, and that works for a whole
|
|
67
|
+
* household only: an `ssi` input for one person would stop the model from
|
|
68
|
+
* computing everyone else's. So the V1 adapter sends amounts only when every
|
|
69
|
+
* person has one, and `validate()` asks for the missing ones. Enter 0 for a
|
|
70
|
+
* person who receives none; a 0 is always sent, as
|
|
71
|
+
* "takes_up_ssi_if_eligible" false. Leave it blank to let the model compute
|
|
72
|
+
* a person's SSI.
|
|
73
|
+
*/
|
|
20
74
|
ssiAmount?: number;
|
|
75
|
+
/** Social Security Disability Insurance; "social_security_disability" in PolicyEngine US. */
|
|
21
76
|
ssdiAmount?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Taxable pension income whose source the user did not give. The V1 adapter
|
|
79
|
+
* adds it to `privatePensionIncome`. Some states' rules in PolicyEngine US
|
|
80
|
+
* apply only to government pensions (for example, Arizona's public pension
|
|
81
|
+
* exclusion and Minnesota's public pension subtraction), so ask for
|
|
82
|
+
* `publicPensionIncome` when the app can. The adapter never sets the
|
|
83
|
+
* `taxable_pension_income` total: that would leave both components at zero,
|
|
84
|
+
* so rules that read either component would see nothing.
|
|
85
|
+
*/
|
|
22
86
|
pensionIncome?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Taxable pension income from a government employer;
|
|
89
|
+
* "taxable_public_pension_income" in PolicyEngine US. PolicyEngine US also
|
|
90
|
+
* has a separate `taxable_federal_pension_income` input, read by West
|
|
91
|
+
* Virginia's public pension subtraction and (from 2.6.14) Indiana's civil
|
|
92
|
+
* service annuity deduction; the adapter does not set it.
|
|
93
|
+
*/
|
|
94
|
+
publicPensionIncome?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Taxable pension income from a non-government employer;
|
|
97
|
+
* "taxable_private_pension_income" in PolicyEngine US.
|
|
98
|
+
*/
|
|
99
|
+
privatePensionIncome?: number;
|
|
100
|
+
/** Qualified dividends; "qualified_dividend_income" in PolicyEngine US. */
|
|
23
101
|
dividendIncome?: number;
|
|
102
|
+
/**
|
|
103
|
+
* Ordinary dividends that are not qualified;
|
|
104
|
+
* "non_qualified_dividend_income" in PolicyEngine US. Form 1099-DIV's
|
|
105
|
+
* ordinary dividends (box 1a) are the sum of this and `dividendIncome`
|
|
106
|
+
* (box 1b).
|
|
107
|
+
*/
|
|
108
|
+
nonQualifiedDividendIncome?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Net gains on assets held one year or less, negative for a net loss;
|
|
111
|
+
* "short_term_capital_gains" in PolicyEngine US.
|
|
112
|
+
*/
|
|
113
|
+
shortTermCapitalGains?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Net gains on assets held more than one year, negative for a net loss;
|
|
116
|
+
* "long_term_capital_gains" in PolicyEngine US. That variable is computed as
|
|
117
|
+
* gains before behavioral responses plus the response, and PolicyEngine US's
|
|
118
|
+
* Simulation moves an input on it onto
|
|
119
|
+
* `long_term_capital_gains_before_response`, as it does for wages.
|
|
120
|
+
*/
|
|
121
|
+
longTermCapitalGains?: number;
|
|
24
122
|
taxableInterestIncome?: number;
|
|
25
123
|
rentalIncome?: number;
|
|
26
124
|
unemploymentCompensation?: number;
|
|
27
125
|
childSupportReceived?: number;
|
|
28
126
|
miscellaneousIncome?: number;
|
|
29
127
|
}
|
|
30
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Annual amounts paid, in dollars, that PolicyEngine US deducts or credits.
|
|
130
|
+
* Each field sets one PolicyEngine US input variable. Federal deductions sum
|
|
131
|
+
* the tax unit's amounts, so an app that asks about a shared expense once can
|
|
132
|
+
* put it on one adult, ideally the one who pays it or owns the home. Some
|
|
133
|
+
* state rules read a person's own amount: Montana caps real estate taxes per
|
|
134
|
+
* person, and homestead or elderly property tax reductions in Kentucky, Ohio,
|
|
135
|
+
* South Carolina, Mississippi and Tennessee read the owner's (Kentucky) or the
|
|
136
|
+
* head's or spouse's real estate taxes.
|
|
137
|
+
*/
|
|
138
|
+
export interface USPersonExpenses {
|
|
139
|
+
/** Gifts of cash to charity; "charitable_cash_donations" in PolicyEngine US. */
|
|
140
|
+
charitableCashDonations?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Interest paid on a home mortgage; "home_mortgage_interest" in PolicyEngine
|
|
143
|
+
* US. Not "mortgage_interest": that is a computed total of deductible and
|
|
144
|
+
* non-deductible interest, and the federal interest deduction ignores an
|
|
145
|
+
* input on it.
|
|
146
|
+
*/
|
|
147
|
+
mortgageInterest?: number;
|
|
148
|
+
/** Real estate (property) taxes paid; "real_estate_taxes" in PolicyEngine US. */
|
|
149
|
+
realEstateTaxes?: number;
|
|
150
|
+
}
|
|
151
|
+
/** Work details that rules read alongside income. */
|
|
152
|
+
export interface USPersonOccupation {
|
|
153
|
+
/**
|
|
154
|
+
* Treasury Tipped Occupation Code for the occupation in which the person
|
|
155
|
+
* received `tipIncome` (see `TIPPED_OCCUPATIONS`), or 0 if it is not a
|
|
156
|
+
* listed occupation; "treasury_tipped_occupation_code" in PolicyEngine US.
|
|
157
|
+
* Only tips from a listed occupation qualify for the federal deduction for
|
|
158
|
+
* qualified tips. Leave it unset if the user was not asked: PolicyEngine US
|
|
159
|
+
* then reads 0, so tips get no deduction.
|
|
160
|
+
*/
|
|
161
|
+
tippedOccupationCode?: number;
|
|
162
|
+
}
|
|
163
|
+
export interface USPersonDraft extends USPersonFlags, USPersonIncomes, USPersonExpenses, USPersonOccupation {
|
|
31
164
|
/** Stable identifier — used as the person key in the API payload. */
|
|
32
165
|
id: string;
|
|
33
166
|
kind: USPersonKind;
|
|
@@ -63,18 +196,5 @@ export interface USHouseholdDraft {
|
|
|
63
196
|
/** App-controlled household-level fields ignored by the shared adapters. */
|
|
64
197
|
extras?: Record<string, unknown>;
|
|
65
198
|
}
|
|
66
|
-
export
|
|
67
|
-
/** Stable identifier for the rule (e.g. "state.required"). */
|
|
68
|
-
code: string;
|
|
69
|
-
/** Path into the draft (dotted), e.g. "state" or "people[1].age". */
|
|
70
|
-
path: string;
|
|
71
|
-
message: string;
|
|
72
|
-
}
|
|
73
|
-
export type ValidationResult = {
|
|
74
|
-
ok: true;
|
|
75
|
-
issues: never[];
|
|
76
|
-
} | {
|
|
77
|
-
ok: false;
|
|
78
|
-
issues: ValidationIssue[];
|
|
79
|
-
};
|
|
199
|
+
export type { ValidationIssue, ValidationResult } from '../validation.js';
|
|
80
200
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/us-household/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/us-household/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/us-household/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/us-household/validate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAIhB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAsBjB,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAgLlB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAE1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-B_OXaS4a.cjs");exports.toV1HouseholdPayload=o.toV1HouseholdPayload;exports.toV1HouseholdSituation=o.toV1HouseholdSituation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './us-household/adapters/index';
|
|
1
|
+
export * from './us-household/adapters/index.js';
|
|
@@ -1,92 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
household: "household",
|
|
3
|
-
family: "family",
|
|
4
|
-
taxUnit: "tax_unit",
|
|
5
|
-
spmUnit: "spm_unit",
|
|
6
|
-
maritalUnit: "marital_unit"
|
|
7
|
-
}, I = {
|
|
8
|
-
household: "your household",
|
|
9
|
-
family: "your family",
|
|
10
|
-
taxUnit: "your tax unit",
|
|
11
|
-
spmUnit: "your household",
|
|
12
|
-
// app-v2 uses the same label for SPM unit
|
|
13
|
-
maritalUnit: "your marital unit"
|
|
14
|
-
}, U = {
|
|
15
|
-
isDisabled: "is_disabled",
|
|
16
|
-
isBlind: "is_blind",
|
|
17
|
-
isFullTimeStudent: "is_full_time_student",
|
|
18
|
-
isPregnant: "is_pregnant",
|
|
19
|
-
needsCare: "is_incapable_of_self_care"
|
|
20
|
-
}, v = {
|
|
21
|
-
employmentIncome: "employment_income",
|
|
22
|
-
selfEmploymentIncome: "self_employment_income",
|
|
23
|
-
socialSecurityIncome: "social_security",
|
|
24
|
-
ssiAmount: "ssi",
|
|
25
|
-
ssdiAmount: "social_security_disability",
|
|
26
|
-
pensionIncome: "taxable_pension_income",
|
|
27
|
-
dividendIncome: "qualified_dividend_income",
|
|
28
|
-
taxableInterestIncome: "taxable_interest_income",
|
|
29
|
-
rentalIncome: "rental_income",
|
|
30
|
-
unemploymentCompensation: "unemployment_compensation",
|
|
31
|
-
childSupportReceived: "child_support_received",
|
|
32
|
-
miscellaneousIncome: "miscellaneous_income"
|
|
33
|
-
};
|
|
34
|
-
function s(e, n) {
|
|
35
|
-
return { [e]: n };
|
|
36
|
-
}
|
|
37
|
-
function x(e, n) {
|
|
38
|
-
const i = {};
|
|
39
|
-
e.age !== null && e.age !== void 0 && (i.age = s(n, e.age)), e.kind === "dependent" && (i.is_tax_unit_dependent = s(n, !0));
|
|
40
|
-
for (const [l, a] of Object.entries(U)) {
|
|
41
|
-
const t = e[l];
|
|
42
|
-
t !== void 0 && (i[a] = s(n, t));
|
|
43
|
-
}
|
|
44
|
-
for (const [l, a] of Object.entries(v)) {
|
|
45
|
-
const t = e[l];
|
|
46
|
-
t != null && (i[a] = s(n, t));
|
|
47
|
-
}
|
|
48
|
-
return i;
|
|
49
|
-
}
|
|
50
|
-
function S(e, n = {}) {
|
|
51
|
-
const { groupKeyStyle: i = "short", includeMaritalUnit: l = !1, label: a = null } = n, t = i === "verbose" ? I : h, c = String(e.year), m = e.people.map((o) => o.id), d = {};
|
|
52
|
-
for (const o of e.people)
|
|
53
|
-
d[o.id] = x(o, c);
|
|
54
|
-
const u = {
|
|
55
|
-
members: [...m]
|
|
56
|
-
};
|
|
57
|
-
e.state && (u.state_name = s(c, e.state)), e.county && (u.county = s(c, e.county));
|
|
58
|
-
const p = {
|
|
59
|
-
[t.family]: { members: [...m] }
|
|
60
|
-
}, y = {
|
|
61
|
-
[t.taxUnit]: { members: [...m] }
|
|
62
|
-
}, f = {
|
|
63
|
-
[t.spmUnit]: { members: [...m] }
|
|
64
|
-
}, b = {
|
|
65
|
-
[t.household]: u
|
|
66
|
-
}, _ = {};
|
|
67
|
-
if (l) {
|
|
68
|
-
const o = e.people.filter((r) => r.kind === "adult");
|
|
69
|
-
_[t.maritalUnit] = {
|
|
70
|
-
members: o.slice(0, 2).map((r) => r.id)
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
country_id: "us",
|
|
75
|
-
label: a,
|
|
76
|
-
data: {
|
|
77
|
-
people: d,
|
|
78
|
-
families: p,
|
|
79
|
-
marital_units: _,
|
|
80
|
-
tax_units: y,
|
|
81
|
-
spm_units: f,
|
|
82
|
-
households: b
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function g(e, n = {}) {
|
|
87
|
-
return S(e, n).data;
|
|
88
|
-
}
|
|
1
|
+
import { b as t, c as s } from "./index-DWM0giHt.js";
|
|
89
2
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
3
|
+
t as toV1HouseholdPayload,
|
|
4
|
+
s as toV1HouseholdSituation
|
|
92
5
|
};
|