Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
raftmsohani committed Oct 30, 2023
1 parent a093aa0 commit 8ea36c6
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 67 deletions.
136 changes: 113 additions & 23 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,30 +136,120 @@
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="6C", name='NUM_DENIED', friendly_name='total number of denied applications', type='number', startIndex=71, endIndex=79,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="7C", name='ASSISTANCE', friendly_name='total amount of assistance', type='number', startIndex=103, endIndex=115,
Field(
item="7C",
name='ASSISTANCE',
friendly_name='total amount of assistance', type='number', startIndex=103, endIndex=115,
required=True, validators=[validators.isInLimits(0, 999999999999)]),
Field(item="8C", name='NUM_FAMILIES', friendly_name='total number of families', type='number', startIndex=131, endIndex=139,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="9C", name='NUM_2_PARENTS', friendly_name='total number of two parents families', type='number', startIndex=155, endIndex=163,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="10C", name='NUM_1_PARENTS', friendly_name='total number of one parent families', type='number', startIndex=179, endIndex=187,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="11C", name='NUM_NO_PARENTS', friendly_name='total number of no parent families', type='number', startIndex=203, endIndex=211,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="12C", name='NUM_RECIPIENTS', friendly_name='total number of recipients', type='number', startIndex=227, endIndex=235,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="13C", name='NUM_ADULT_RECIPIENTS', friendly_name='total number of adult recipients', type='number', startIndex=251, endIndex=259,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="14C", name='NUM_CHILD_RECIPIENTS', friendly_name='total number of child recipients', type='number', startIndex=275, endIndex=283,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="15C", name='NUM_NONCUSTODIALS', friendly_name='total number of noncustodial parents', type='number', startIndex=299, endIndex=307,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="16C", name='NUM_BIRTHS', friendly_name='total number of births', type='number', startIndex=323, endIndex=331,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="17C", name='NUM_OUTWEDLOCK_BIRTHS', friendly_name='total number of outwedlock births', type='number', startIndex=347, endIndex=355,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(item="18C", name='NUM_CLOSED_CASES', friendly_name='total number of closed cases', type='number', startIndex=371, endIndex=379,
required=True, validators=[validators.isInLimits(0, 99999999)]),
Field(
item="8C",
name='NUM_FAMILIES',
friendly_name='total number of families',
type='number',
startIndex=131,
endIndex=139,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="9C",
name='NUM_2_PARENTS',
friendly_name='total number of two parents families',
type='number',
startIndex=155,
endIndex=163,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="10C",
name='NUM_1_PARENTS',
friendly_name='total number of one parent families',
type='number',
startIndex=179,
endIndex=187,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="11C",
name='NUM_NO_PARENTS',
friendly_name='total number of no parent families',
type='number',
startIndex=203,
endIndex=211,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="12C",
name='NUM_RECIPIENTS',
friendly_name='total number of recipients',
type='number',
startIndex=227,
endIndex=235,
required=True,validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="13C",
name='NUM_ADULT_RECIPIENTS',
friendly_name='total number of adult recipients',
type='number',
startIndex=251,
endIndex=259,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="14C",
name='NUM_CHILD_RECIPIENTS',
friendly_name='total number of child recipients',
type='number',
startIndex=275,
endIndex=283,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="15C",
name='NUM_NONCUSTODIALS',
friendly_name='total number of noncustodial parents',
type='number',
startIndex=299,
endIndex=307,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="16C",
name='NUM_BIRTHS',
friendly_name='total number of births',
type='number',
startIndex=323,
endIndex=331,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="17C",
name='NUM_OUTWEDLOCK_BIRTHS',
friendly_name='total number of outwedlock births',
type='number',
startIndex=347,
endIndex=355,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
Field(
item="18C",
name='NUM_CLOSED_CASES',
friendly_name='total number of closed cases',
type='number',
startIndex=371,
endIndex=379,
required=True,
validators=[validators.isInLimits(0, 99999999)]
),
],
)

Expand Down
63 changes: 51 additions & 12 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,26 @@
],
postparsing_validators=[],
fields=[
Field(item="0", name="RecordType", friendly_name='record type', type='string', startIndex=0, endIndex=2,
required=True, validators=[]),
Field(item="3", name='CALENDAR_QUARTER', friendly_name='calendar quarter', type='number', startIndex=2, endIndex=7,
required=True, validators=[validators.dateYearIsLargerThan(1998),
validators.quarterIsValid()]),
Field(
item="0",
name="RecordType",
friendly_name='record type',
type='string',
startIndex=0,
endIndex=2,
required=True,
validators=[]
),
Field(
item="3",
name='CALENDAR_QUARTER',
friendly_name='calendar quarter',
type='number',
startIndex=2,
endIndex=7,
required=True,
validators=[validators.dateYearIsLargerThan(1998), validators.quarterIsValid()]
),
TransformField(
transform_func=calendar_quarter_to_rpt_month_year(month_index),
item="3A",
Expand All @@ -46,13 +61,37 @@
validators.dateYearIsLargerThan(1998),
validators.dateMonthIsValid()
]
),
Field(item="4", name='TDRS_SECTION_IND', friendly_name='tdrs section indicator', type='string', startIndex=section_ind_index,
endIndex=section_ind_index + 1, required=True, validators=[validators.oneOf(['1', '2'])]),
Field(item="5", name='STRATUM', friendly_name='stratum', type='string', startIndex=stratum_index,
endIndex=stratum_index + 2, required=True, validators=[validators.isInStringRange(1, 99)]),
Field(item=families_value_item_number, name='FAMILIES_MONTH', friendly_name='total number of families for each month', type='number', startIndex=families_index,
endIndex=families_index + 7, required=True, validators=[validators.isInLimits(0, 9999999)]),
),
Field(
item="4",
name='TDRS_SECTION_IND',
friendly_name='tdrs section indicator',
type='string',
startIndex=section_ind_index,
endIndex=section_ind_index + 1,
required=True,
validators=[validators.oneOf(['1', '2'])]
),
Field(
item="5",
name='STRATUM',
friendly_name='stratum',
type='string',
startIndex=stratum_index,
endIndex=stratum_index + 2,
required=True,
validators=[validators.isInStringRange(1, 99)]
),
Field(
item=families_value_item_number,
name='FAMILIES_MONTH',
friendly_name='total number of families for each month',
type='number',
startIndex=families_index,
endIndex=families_index + 7,
required=True,
validators=[validators.isInLimits(0, 9999999)]
),
]
)
)
Expand Down
45 changes: 36 additions & 9 deletions tdrs-backend/tdpservice/parsers/schema_defs/trailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,41 @@
],
postparsing_validators=[],
fields=[
Field(item="1", name='title', friendly_name='title', type='string', startIndex=0, endIndex=7, required=True, validators=[
validators.matches('TRAILER')
]),
Field(item="2", name='record_count', friendly_name='record count', type='number', startIndex=7, endIndex=14, required=True, validators=[
validators.between(0, 9999999)
]),
Field(item="-1", name='blank', friendly_name='blank', type='string', startIndex=14, endIndex=23, required=False, validators=[
validators.matches(' ')
]),
Field(
item="1",
name='title',
friendly_name='title',
type='string',
startIndex=0,
endIndex=7,
required=True,
validators=[
validators.matches('TRAILER')
]
),
Field(
item="2",
name='record_count',
friendly_name='record count',
type='number',
startIndex=7,
endIndex=14,
required=True,
validators=[
validators.between(0, 9999999)
]
),
Field(
item="-1",
name='blank',
friendly_name='blank',
type='string',
startIndex=14,
endIndex=23,
required=False,
validators=[
validators.matches(' ')
]
),
],
)
Loading

0 comments on commit 8ea36c6

Please sign in to comment.