forked from HHS/TANF-app
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/1119 ssp section 3 #2733
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ae7c3f8
ssp m6 boilerplate
jtimpe 5129fa1
update ssp m6 field names
jtimpe d4f855b
update tests
jtimpe b186ae5
rm logging
jtimpe 0ddd03d
rm logging
jtimpe dc99ebd
fix tests
jtimpe 0c65658
Merge branch 'develop' into feature/1119-ssp-section-3
jtimpe 8578d35
Merge branch 'develop' into feature/1119-ssp-section-3
ADPennington bf8bfba
Merge branch 'develop' into feature/1119-ssp-section-3
andrew-jameson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from .m1 import m1 | ||
from .m2 import m2 | ||
from .m3 import m3 | ||
from .m6 import m6 | ||
|
||
m1 = m1 | ||
m2 = m2 | ||
m3 = m3 | ||
m6 = m6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
"""Schema for HEADER row of all submission types.""" | ||
|
||
|
||
from ...util import SchemaManager | ||
from ...transforms import calendar_quarter_to_rpt_month_year | ||
from ...fields import Field, TransformField | ||
from ...row_schema import RowSchema | ||
from ... import validators | ||
from tdpservice.search_indexes.models.ssp import SSP_M6 | ||
|
||
s1 = RowSchema( | ||
model=SSP_M6, | ||
preparsing_validators=[ | ||
validators.hasLength(259), | ||
], | ||
postparsing_validators=[ | ||
validators.sumIsEqual( | ||
"SSPMOE_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), | ||
validators.sumIsEqual( | ||
"NUM_RECIPIENTS", ["ADULT_RECIPIENTS", "CHILD_RECIPIENTS"]), | ||
], | ||
fields=[ | ||
Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, | ||
required=True, validators=[]), | ||
Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, | ||
required=True, validators=[validators.dateYearIsLargerThan(1998), | ||
validators.quarterIsValid()]), | ||
TransformField(calendar_quarter_to_rpt_month_year(0), item="2B", name='RPT_MONTH_YEAR', type='number', | ||
startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), | ||
validators.dateMonthIsValid()]), | ||
Field(item="3A", name='SSPMOE_FAMILIES', type='number', startIndex=7, endIndex=15, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="4A", name='NUM_2_PARENTS', type='number', startIndex=31, endIndex=39, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="5A", name='NUM_1_PARENTS', type='number', startIndex=55, endIndex=63, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="6A", name='NUM_NO_PARENTS', type='number', startIndex=79, endIndex=87, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="7A", name='NUM_RECIPIENTS', type='number', startIndex=103, endIndex=111, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="8A", name='ADULT_RECIPIENTS', type='number', startIndex=127, endIndex=135, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="9A", name='CHILD_RECIPIENTS', type='number', startIndex=151, endIndex=159, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="10A", name='NONCUSTODIALS', type='number', startIndex=175, endIndex=183, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="11A", name='AMT_ASSISTANCE', type='number', startIndex=199, endIndex=211, | ||
required=True, validators=[validators.isInLimits(0, 999999999999)]), | ||
Field(item="12A", name='CLOSED_CASES', type='number', startIndex=235, endIndex=243, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
], | ||
) | ||
|
||
s2 = RowSchema( | ||
model=SSP_M6, | ||
preparsing_validators=[ | ||
validators.hasLength(259), | ||
], | ||
postparsing_validators=[ | ||
validators.sumIsEqual( | ||
"SSPMOE_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), | ||
validators.sumIsEqual( | ||
"NUM_RECIPIENTS", ["ADULT_RECIPIENTS", "CHILD_RECIPIENTS"]), | ||
], | ||
fields=[ | ||
Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, | ||
required=True, validators=[]), | ||
Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, | ||
required=True, validators=[validators.dateYearIsLargerThan(1998), | ||
validators.quarterIsValid()]), | ||
TransformField(calendar_quarter_to_rpt_month_year(1), item="2B", name='RPT_MONTH_YEAR', type='number', | ||
startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), | ||
validators.dateMonthIsValid()]), | ||
Field(item="3B", name='SSPMOE_FAMILIES', type='number', startIndex=15, endIndex=23, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="4B", name='NUM_2_PARENTS', type='number', startIndex=39, endIndex=47, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="5B", name='NUM_1_PARENTS', type='number', startIndex=63, endIndex=71, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="6B", name='NUM_NO_PARENTS', type='number', startIndex=87, endIndex=95, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="7B", name='NUM_RECIPIENTS', type='number', startIndex=111, endIndex=119, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="8B", name='ADULT_RECIPIENTS', type='number', startIndex=135, endIndex=143, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="9B", name='CHILD_RECIPIENTS', type='number', startIndex=159, endIndex=167, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="10B", name='NONCUSTODIALS', type='number', startIndex=183, endIndex=191, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="11B", name='AMT_ASSISTANCE', type='number', startIndex=211, endIndex=223, | ||
required=True, validators=[validators.isInLimits(0, 999999999999)]), | ||
Field(item="12B", name='CLOSED_CASES', type='number', startIndex=243, endIndex=251, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
], | ||
) | ||
|
||
s3 = RowSchema( | ||
model=SSP_M6, | ||
preparsing_validators=[ | ||
validators.hasLength(259), | ||
], | ||
postparsing_validators=[ | ||
validators.sumIsEqual( | ||
"SSPMOE_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), | ||
validators.sumIsEqual( | ||
"NUM_RECIPIENTS", ["ADULT_RECIPIENTS", "CHILD_RECIPIENTS"]), | ||
], | ||
fields=[ | ||
Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, | ||
required=True, validators=[]), | ||
Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, | ||
required=True, validators=[validators.dateYearIsLargerThan(1998), | ||
validators.quarterIsValid()]), | ||
TransformField(calendar_quarter_to_rpt_month_year(2), item="2B", name='RPT_MONTH_YEAR', type='number', | ||
startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), | ||
validators.dateMonthIsValid()]), | ||
Field(item="3C", name='SSPMOE_FAMILIES', type='number', startIndex=23, endIndex=31, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="4C", name='NUM_2_PARENTS', type='number', startIndex=47, endIndex=55, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="5C", name='NUM_1_PARENTS', type='number', startIndex=71, endIndex=79, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="6C", name='NUM_NO_PARENTS', type='number', startIndex=95, endIndex=103, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="7C", name='NUM_RECIPIENTS', type='number', startIndex=119, endIndex=127, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="8C", name='ADULT_RECIPIENTS', type='number', startIndex=143, endIndex=151, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="9C", name='CHILD_RECIPIENTS', type='number', startIndex=167, endIndex=175, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="10C", name='NONCUSTODIALS', type='number', startIndex=191, endIndex=199, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
Field(item="11C", name='AMT_ASSISTANCE', type='number', startIndex=223, endIndex=235, | ||
required=True, validators=[validators.isInLimits(0, 999999999999)]), | ||
Field(item="12C", name='CLOSED_CASES', type='number', startIndex=251, endIndex=259, | ||
required=True, validators=[validators.isInLimits(0, 99999999)]), | ||
], | ||
) | ||
|
||
|
||
m6 = SchemaManager( | ||
schemas=[ | ||
s1, | ||
s2, | ||
s3 | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
HEADER20184G24 SSP1 N | ||
M620184000158690001600800015956000008610000085100000845000149050001505500015013000001030000010200000098000513550005169600051348000157070001581400015766000356480003588200035582000000000000000000000000000000000000000000000000000000000000000012020000118900001229 | ||
TRAILER0000001 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to have a validator or did Alex make a mistake in the spreadsheet?