Skip to content

Commit

Permalink
Merge branch '2883-kibana-dashboard' of https://github.com/raft-tech/…
Browse files Browse the repository at this point in the history
…TANF-app into 2883-kibana-dashboard
  • Loading branch information
elipe17 committed May 30, 2024
2 parents 5f51ce5 + aa11679 commit e195916
Show file tree
Hide file tree
Showing 23 changed files with 291 additions and 81 deletions.
13 changes: 7 additions & 6 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Schema for SSP M1 record type."""


from tdpservice.parsers.fields import Field
from tdpservice.parsers.transforms import zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.ssp import SSP_M1DataSubmissionDocument
Expand Down Expand Up @@ -133,15 +133,16 @@
required=True,
validators=[validators.notEmpty()]
),
Field(
TransformField(
zero_pad(3),
item="2",
name='COUNTY_FIPS_CODE',
name="COUNTY_FIPS_CODE",
friendly_name="county fips code",
type='string',
type="string",
startIndex=19,
endIndex=22,
required=True,
validators=[validators.isNumber(),]
validators=[validators.isNumber()],
),
Field(
item="4",
Expand Down
10 changes: 5 additions & 5 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,14 @@
item="37",
name='EDUCATION_LEVEL',
friendly_name="education level",
type='number',
type='string',
startIndex=55,
endIndex=57,
required=False,
validators=[
validators.or_validators(
validators.isInLimits(0, 16), validators.isInLimits(98, 99)
)
validators.isInStringRange(1, 16), validators.isInStringRange(98, 99)
),
]
),
Field(
Expand All @@ -388,7 +388,7 @@
startIndex=57,
endIndex=58,
required=False,
validators=[validators.oneOf([0, 1, 2, 3, 9])]
validators=[validators.oneOf([1, 2, 3, 9])]
),
Field(
item="39",
Expand All @@ -398,7 +398,7 @@
startIndex=58,
endIndex=59,
required=False,
validators=[validators.oneOf([0, 1, 2, 9])]
validators=[validators.oneOf([1, 2, 9])]
),
Field(
item="40",
Expand Down
14 changes: 7 additions & 7 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,15 @@
item="68",
name='EDUCATION_LEVEL',
friendly_name="education level",
type='number',
type='string',
startIndex=49,
endIndex=51,
required=True,
validators=[
validators.or_validators(
validators.isInStringRange(0, 16),
validators.isInStringRange(1, 16),
validators.isInStringRange(98, 99)
)
),
]
),
Field(
Expand All @@ -298,7 +298,7 @@
startIndex=51,
endIndex=52,
required=False,
validators=[validators.oneOf([0, 1, 2, 3, 9])]
validators=[validators.oneOf([1, 2, 3, 9])]
),
Field(
item="70A",
Expand Down Expand Up @@ -593,13 +593,13 @@
item="68",
name='EDUCATION_LEVEL',
friendly_name="education level",
type='number',
type='string',
startIndex=90,
endIndex=92,
required=True,
validators=[
validators.or_validators(
validators.isInStringRange(0, 16),
validators.isInStringRange(1, 16),
validators.isInStringRange(98, 99)
)
]
Expand All @@ -612,7 +612,7 @@
startIndex=92,
endIndex=93,
required=False,
validators=[validators.oneOf([0, 1, 2, 3, 9])]
validators=[validators.oneOf([1, 2, 3, 9])]
),
Field(
item="70A",
Expand Down
9 changes: 5 additions & 4 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Schema for SSP M1 record type."""


from tdpservice.parsers.fields import Field
from tdpservice.parsers.transforms import zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.ssp import SSP_M4DataSubmissionDocument
Expand Down Expand Up @@ -54,15 +54,16 @@
required=True,
validators=[validators.notEmpty()],
),
Field(
TransformField(
zero_pad(3),
item="2",
name="COUNTY_FIPS_CODE",
friendly_name="county fips code",
type="string",
startIndex=19,
endIndex=22,
required=True,
validators=[validators.isInStringRange(0, 999)],
validators=[validators.isNumber()],
),
Field(
item="4",
Expand Down
8 changes: 3 additions & 5 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@
validators.or_validators(
validators.isInStringRange(0, 16),
validators.isInStringRange(98, 99),
)
),
validators.notMatches("00")
],
),
Field(
Expand All @@ -359,10 +360,7 @@
endIndex=57,
required=False,
validators=[
validators.or_validators(
validators.isInLimits(0, 3),
validators.matches(9)
)
validators.oneOf([1, 2, 3, 9]),
],
),
Field(
Expand Down
8 changes: 4 additions & 4 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Schema for HEADER row of all submission types."""


from ...transforms import calendar_quarter_to_rpt_month_year
from ...fields import Field, TransformField
from ...row_schema import RowSchema, SchemaManager
from ... import validators
from tdpservice.parsers.transforms import calendar_quarter_to_rpt_month_year
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.ssp import SSP_M6DataSubmissionDocument

s1 = RowSchema(
Expand Down
8 changes: 4 additions & 4 deletions tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Schema for TANF T7 Row."""

from ...fields import Field, TransformField
from ...row_schema import RowSchema, SchemaManager
from ...transforms import calendar_quarter_to_rpt_month_year
from ... import validators
from tdpservice.parsers.transforms import calendar_quarter_to_rpt_month_year
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.ssp import SSP_M7DataSubmissionDocument

schemas = []
Expand Down
10 changes: 5 additions & 5 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Schema for t1 record types."""

from tdpservice.parsers.fields import Field
from tdpservice.parsers.transforms import zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tanf import TANF_T1DataSubmissionDocument
Expand Down Expand Up @@ -155,17 +156,16 @@
required=True,
validators=[validators.notEmpty()],
),
Field(
TransformField(
zero_pad(3),
item="2",
name="COUNTY_FIPS_CODE",
friendly_name="county fips code",
type="string",
startIndex=19,
endIndex=22,
required=True,
validators=[
validators.isNumber(),
],
validators=[validators.isNumber()],
),
Field(
item="5",
Expand Down
4 changes: 2 additions & 2 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
startIndex=51,
endIndex=52,
required=False,
validators=[validators.oneOf([0, 1, 2, 9])],
validators=[validators.oneOf([1, 2, 9])],
),
Field(
item="77A",
Expand Down Expand Up @@ -608,7 +608,7 @@
startIndex=92,
endIndex=93,
required=False,
validators=[validators.oneOf([0, 1, 2, 9])],
validators=[validators.oneOf([1, 2, 9])],
),
Field(
item="77A",
Expand Down
9 changes: 5 additions & 4 deletions tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Schema for HEADER row of all submission types."""


from tdpservice.parsers.fields import Field
from tdpservice.parsers.transforms import zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tanf import TANF_T4DataSubmissionDocument
Expand Down Expand Up @@ -55,15 +55,16 @@
required=True,
validators=[validators.notEmpty()],
),
Field(
TransformField(
zero_pad(3),
item="2",
name="COUNTY_FIPS_CODE",
friendly_name="county fips code",
type="string",
startIndex=19,
endIndex=22,
required=True,
validators=[validators.isInStringRange(1, 999)],
validators=[validators.isNumber()],
),
Field(
item="5",
Expand Down
14 changes: 7 additions & 7 deletions tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Schema for Tribal TANF T1 record types."""

from ...fields import Field
from ...row_schema import RowSchema, SchemaManager
from ... import validators
from tdpservice.parsers.transforms import zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tribal import Tribal_TANF_T1DataSubmissionDocument

t1 = SchemaManager(
Expand Down Expand Up @@ -156,17 +157,16 @@
required=True,
validators=[validators.notEmpty()],
),
Field(
TransformField(
zero_pad(3),
item="2",
name="COUNTY_FIPS_CODE",
friendly_name="county fips code",
type="string",
startIndex=19,
endIndex=22,
required=False,
validators=[
validators.isNumber(),
],
validators=[validators.isNumber()],
),
Field(
item="5",
Expand Down
11 changes: 6 additions & 5 deletions tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Schema for Tribal TANF T2 row of all submission types."""


from ...transforms import tanf_ssn_decryption_func
from ...fields import TransformField, Field
from ...row_schema import RowSchema, SchemaManager
from ... import validators
from tdpservice.parsers.transforms import tanf_ssn_decryption_func, zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tribal import Tribal_TANF_T2DataSubmissionDocument


Expand Down Expand Up @@ -622,7 +622,8 @@
validators.isInStringRange(0, 99),
],
),
Field(
TransformField(
zero_pad(2),
item="61",
name="ADD_WORK_ACTIVITIES",
friendly_name="additional work activities",
Expand Down
8 changes: 4 additions & 4 deletions tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Schema for Tribal TANF T3 row of all submission types."""


from ...transforms import tanf_ssn_decryption_func
from ...fields import TransformField, Field
from ...row_schema import RowSchema, SchemaManager
from ... import validators
from tdpservice.parsers.transforms import tanf_ssn_decryption_func
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tribal import Tribal_TANF_T3DataSubmissionDocument

FIRST_CHILD = 1
Expand Down
12 changes: 7 additions & 5 deletions tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t4.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Schema for Tribal TANF T4 record types."""

from ...fields import Field
from ...row_schema import RowSchema, SchemaManager
from ... import validators
from tdpservice.parsers.transforms import zero_pad
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tribal import Tribal_TANF_T4DataSubmissionDocument


Expand Down Expand Up @@ -54,15 +55,16 @@
required=True,
validators=[validators.notEmpty()],
),
Field(
TransformField(
zero_pad(3),
item="2",
name="COUNTY_FIPS_CODE",
friendly_name="county fips code",
type="string",
startIndex=19,
endIndex=22,
required=False,
validators=[validators.matches("000")],
validators=[validators.isNumber()],
),
Field(
item="5",
Expand Down
8 changes: 4 additions & 4 deletions tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t5.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Schema for Tribal TANF T5 row of all submission types."""


from ...transforms import tanf_ssn_decryption_func
from ...fields import TransformField, Field
from ...row_schema import RowSchema, SchemaManager
from ... import validators
from tdpservice.parsers.transforms import tanf_ssn_decryption_func
from tdpservice.parsers.fields import Field, TransformField
from tdpservice.parsers.row_schema import RowSchema, SchemaManager
from tdpservice.parsers import validators
from tdpservice.search_indexes.documents.tribal import Tribal_TANF_T5DataSubmissionDocument


Expand Down
Loading

0 comments on commit e195916

Please sign in to comment.