diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index 3e561d63e..9738c43ee 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -117,12 +117,12 @@ Field( item="10", name="update", - friendly_name="update", + friendly_name="update indicator", type="string", startIndex=22, endIndex=23, required=True, - validators=[validators.oneOf(["N", "D", "U"])], + validators=[validators.matches("D")], ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS06 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS06 index bb3a1bcca..7c5def7d5 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS06 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS06 @@ -1,4 +1,4 @@ -HEADER20204A06 TAN1EN +HEADER20204A06 TAN1ED T12020101111111111223003403361110213120000300000000000008730010000000000000000000000000000000000222222000000002229012 T2202010111111111121219740114WTTTTTY@W2221222222221012212110014722011400000000000000000000000000000000000000000000000000000000000000000000000000000000000291 T320201011111111112120190127WTTTT90W022212222204398100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 index c5de5c6a7..8b2d498b2 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 @@ -1,4 +1,4 @@ -HEADER20214A00142TAN1EU +HEADER20214A00142TAN1ED T120211011111111119255 140245112 23322 03 0 0 0 502 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 T2202110111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 T320211011111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS06 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS06 index 84171bde8..f57b64f96 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS06 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS06 @@ -1,4 +1,4 @@ -HEADER20204C06 TAN1EN +HEADER20204C06 TAN1ED T42020101111111115825301400141123113 T520201011111111158119970123WTTTTTP@Y2222212222221011212100946200000000 T520201011111111158120160206WTTTT90TY2222212 2 2 0422981 00000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS142.txt b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS142.txt index f60db47d9..7ef4b46b0 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS142.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP2.TS142.txt @@ -1,4 +1,4 @@ -HEADER20194C00142TAN1EU +HEADER20194C00142TAN1ED T420191011111111762255 0402451153123 T520191011111111762120160102WTTTTT@YB2122222222221 822981 0 03 0 0 T520191011111111762120170526WTTTTTZPW2122221222221 822981 0 03 0 0 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS06 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS06 index 8e88b1fb0..319160325 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS06 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS06 @@ -1,3 +1,3 @@ -HEADER20204G06 TAN1 N +HEADER20204G06 TAN1 D T620204000127470001104500011146000043010000397700003924000084460000706800007222000055042849000055141378000056643253000755810007592100075542000009810000097000000968000392980003934900038972000353020003560200035602001684470016904700168107000464480004649800046203001219990012254900121904000001630000014900000151000003440000033100000276000002580000024100000187000054530000388100003884 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS142 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS142 index 6e5798b8a..83dd4d3e9 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS142 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP3.TS142 @@ -1,3 +1,3 @@ -HEADER20194G00142TAN1EU +HEADER20194G00142TAN1ED T620194 5 1 1 5 1 1 0 0 0 21097 22915 21441 40 41 40 5 6 4 8 9 11 27 26 25 85 89 85 18 21 19 67 68 66 0 0 0 0 0 0 0 0 0 3 3 0 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP4.TS06 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP4.TS06 index 5c344cf42..f221f53be 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP4.TS06 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP4.TS06 @@ -1,3 +1,3 @@ -HEADER20204S06 TAN1 N +HEADER20204S06 TAN1 D T720204101006853700680540068454103000312400037850003180104000347400036460003583106000044600004360000325299000506200036070003385202000039100002740000499 TRAILER0000001 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.rollback.txt b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.rollback.txt index e3703414b..b46c46b77 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.rollback.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.rollback.txt @@ -1,4 +1,4 @@ -HEADER20231A53000TAN1EN +HEADER20231A53000TAN1ED T12023011111111115424200409731120233120000300000000000004170990000000000000000000000000000000000222222000000002229022 T2202301111111111543219680723WT@BT#ZZZ2222211222222012212110421811069929000000000000000000000000000000000000000000000000000000000000999900000000000000000000 T320230111111111154120060507WT@9YZ9@@21222222206310100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.txt b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.txt index dc3b095e1..4f26f9935 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM1.TS53_fake.txt @@ -1,4 +1,4 @@ -HEADER20231A53000TAN1EN +HEADER20231A53000TAN1ED T12023011111111115424200409731120233120000300000000000004170990000000000000000000000000000000000222222000000002229022 T2202301111111111543219680723WT@BT#ZZZ2222211222222012212110421811069929000000000000000000000000000000000000000000000000000000000000999900000000000000000000 T320230111111111154120060507WT@9YZ9@@21222222206310100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM2.MS24 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM2.MS24 index 54051bd5d..537afa580 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM2.MS24 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM2.MS24 @@ -1,4 +1,4 @@ -HEADER20184C24 SSP1EU +HEADER20184C24 SSP1ED M42018101111111116120000406911161113 M520181011111111161119791106WTTTY0ZB922212222222210112111112970000 M520181011111111161120150623WTTTYT#0W222122222222 0422981 0000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM3.MS24 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM3.MS24 index bbe8ee4f0..d1c6d971e 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM3.MS24 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM3.MS24 @@ -1,3 +1,3 @@ -HEADER20184G24 SSP1 N +HEADER20184G24 SSP1 D M620184000158690001600800015956000008610000085100000845000149050001505500015013000001030000010200000098000513550005169600051348000157070001581400015766000356480003588200035582000000000000000000000000000000000000000000000000000000000000000012020000118900001229 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM4.MS24 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM4.MS24 index 1393729b8..233112f37 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM4.MS24 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.NDM4.MS24 @@ -1,3 +1,3 @@ -HEADER20184S24 SSP1 N +HEADER20184S24 SSP1 D M720184101000176900013100001111102000074800007670000768103001335200139310014077200000120200011890001229 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S1.txt b/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S1.txt index e834d82ff..55fa9eee3 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S1.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S1.txt @@ -1,4 +1,4 @@ -HEADER20214A25 TAN1EU +HEADER20214A25 TAN1ED T12021101111111112320303404701120213110305300000000011602530020000000000000000000000000000000000222222000000002229012 T2202110111111111231219810321WTTTBZ9B02212212222221012212110012412011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000 T320211011111111123520190908WTTTP00TW22222122104398109080000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S2.txt b/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S2.txt index 8c2a1d9bb..c8b1f791d 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S2.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/bad_TANF_S2.txt @@ -1,3 +1,3 @@ -HEADER20214A25 TANF1EU +HEADER20214A25 TANF1ED T12021101111111112320303404701120213110305300000000011602530020000000000000000000000000000000000222222000000002229012 TRAILER0003698 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/bad_tanf_section_4.txt b/tdrs-backend/tdpservice/parsers/test/data/bad_tanf_section_4.txt index 0dd9066d1..66ae34562 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/bad_tanf_section_4.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/bad_tanf_section_4.txt @@ -1,3 +1,3 @@ -HEADER20204S06 TAN1 N +HEADER20204S06 TAN1 D T720204101006853700680540068454103000312400037850003180104000347400036460003583106000044600004360000325299000506200036070003385202000039100002740000499 TRAILER0000001 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_1.txt b/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_1.txt index 270eb5f20..a36837a5f 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_1.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_1.txt @@ -1,3 +1,3 @@ -HEADER20204A06 TAN1 N +HEADER20204A06 TAN1 D T1trash TRAILERoops \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_2.txt b/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_2.txt index 8e3265f77..9060606ce 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_2.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/bad_trailer_2.txt @@ -1,3 +1,3 @@ -HEADER20204A06 TAN1 N +HEADER20204A06 TAN1 D T12020101111111111223003403361110213120000300000000000008730010000000000000000000000000000000000222222000000002229012 T1trash \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/bad_two_headers.txt b/tdrs-backend/tdpservice/parsers/test/data/bad_two_headers.txt index 4f0c429ac..809863cfc 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/bad_two_headers.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/bad_two_headers.txt @@ -1,4 +1,4 @@ -HEADER20234A25 TAN1EU +HEADER20234A25 TAN1ED T12026101111111111223003403361110213120000300000000000008730010000000000000000000000000000000000222222000000002229012 T2202010111111111121219740114WTTTTTY@W2221222222221012212110014722011400000000000000000000000000000000000000000000000000000000000000000000000000000000000291 T320201011111111112120190127WTTTT90W022212222204398100000000 @@ -6,7 +6,7 @@ T1202313111111111232030340470112021311030530000000001160253002000000000000000000 T2202313111111111231219810321WTTTBZ9B02212212222221012212110012412011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000 T320231311111111123520190908WTTTP00TW22222122104398109080000 TRAILER0003467 -HEADER20223A25 TAN1EU +HEADER20223A25 TAN1ED T42024121111111111321101400701110213110700300000000000005890060000000000000000000000000000000000222222000000002229012 T12025101111111114721801401711120212110374300000000000003820060000000000000000000000000000000000222222000000002229012 T2202510111111111471219800223WTTTT@TTW2222212222221012212110065423010700000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/no_records.txt b/tdrs-backend/tdpservice/parsers/test/data/no_records.txt index 3a6f0c492..0093fb2e0 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/no_records.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/no_records.txt @@ -1,2 +1,2 @@ -HEADER20204A06 TAN1 N +HEADER20204A06 TAN1 D TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_bad_ssp_s1.txt b/tdrs-backend/tdpservice/parsers/test/data/small_bad_ssp_s1.txt index ee8c3c12f..77ea0aa40 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_bad_ssp_s1.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_bad_ssp_s1.txt @@ -1,4 +1,4 @@ -HEADER20184A24 SSP1EU +HEADER20184A24 SSP1ED M1 111111114312120140429105233110741300000000000000010010000000000000000000000000000000000222222000000002229 M2 111111114311219870621WTTTYPYZ@2222211222221101211112011400000000000000000000000000000000000000000000000000000000000000000000000000000000000000 M3 11111111431120140515WTTTPY@YW22222112204398100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_bad_tanf_s1.txt b/tdrs-backend/tdpservice/parsers/test/data/small_bad_tanf_s1.txt index c7e5c38ea..db468cdee 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_bad_tanf_s1.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_bad_tanf_s1.txt @@ -1,4 +1,4 @@ -HEADER20204A06 TAN1EN +HEADER20204A06 TAN1ED T1 1111111114721801401711120212110374300000000000003820060000000000000000000000000000000000222222000000002229012 T2 111111111471219800223WTTTT@TTW2222212222221012212110065423010700000000000000000000000000000000000000000000000000000000000000000000000000000000000000 T3 11111111147120201101WTTTTTZWY22222112204398100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_correct_file.txt b/tdrs-backend/tdpservice/parsers/test/data/small_correct_file.txt index 8441bca58..7c3b70a47 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_correct_file.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_correct_file.txt @@ -1,3 +1,3 @@ -HEADER20204A06 TAN1 N +HEADER20204A06 TAN1 D T12020101111111111223003403361110212120000300000000000008730010000000000000000000000000000000000222222000000002229012 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_incorrect_file_cross_validator.txt b/tdrs-backend/tdpservice/parsers/test/data/small_incorrect_file_cross_validator.txt index f01ab84d1..59133f9a9 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_incorrect_file_cross_validator.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_incorrect_file_cross_validator.txt @@ -1,3 +1,3 @@ -HEADER20204A06 TAN1 N +HEADER20204A06 TAN1 D T12020101111111111223003403361110213120000300000000000008730000000000000000000000000000000000000222222000000002229012 TRAILER0000001 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_ssp_section1.txt b/tdrs-backend/tdpservice/parsers/test/data/small_ssp_section1.txt index 2b63873a7..8b86a6db2 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_ssp_section1.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_ssp_section1.txt @@ -1,4 +1,4 @@ -HEADER20234A24 SSP1EU +HEADER20234A24 SSP1ED M1202310111111111272140140035102133110027300000000000000010540000000000000000000000000000000000222222000000002229 M2202310111111111271219811103WTTT#PW@W2221222222225012211111011935000000000000000000000000000000000000000000000000000000000000225300000000000000000000 M320231011111111127120110615WTTTP99B#22212222204301100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section1.txt b/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section1.txt index 0b4ac9740..17b71da92 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section1.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section1.txt @@ -1,4 +1,4 @@ -HEADER20204A06 TAN1EN +HEADER20204A06 TAN1ED T12020101111111111223003403361110212120000300000000000008730010000000000000000000000000000000000222222000000002229012 T2202010111111111121219740114WTTTTTY@W2221222222221012212110014722011500000000000000000000000000000000000000000000000000000000000000000000000000000000000291 T320201011111111112120190127WTTTT90W022212222204398100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section2.txt b/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section2.txt index 7d5613f31..7e25591e0 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section2.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/small_tanf_section2.txt @@ -1,4 +1,4 @@ -HEADER20204C06 TAN1EN +HEADER20204C06 TAN1ED T42020101111111115825301400141123113 T520201011111111158119970123WTTTTTP@Y2222212222221011212100946200000000 TRAILER0000828 diff --git a/tdrs-backend/tdpservice/parsers/test/data/ssp_section1_datafile.txt b/tdrs-backend/tdpservice/parsers/test/data/ssp_section1_datafile.txt index 4227ae606..6048bf5f4 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ssp_section1_datafile.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/ssp_section1_datafile.txt @@ -1,4 +1,4 @@ -HEADER20184A24 SSP1EU +HEADER20184A24 SSP1ED M1201810111111111272140140035102133110027300000000000000010540000000000000000000000000000000000222222000000002229 M2201810111111111271219811103WTTT#PW@W2221222222225012211111011935000000000000000000000000000000000000000000000000000000000000225300000000000000000000 M320181011111111127120110615WTTTP99B#22212222204301100000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/tanf_s1_bad_update_indicator.txt b/tdrs-backend/tdpservice/parsers/test/data/tanf_s1_bad_update_indicator.txt new file mode 100644 index 000000000..ed055c8ec --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/test/data/tanf_s1_bad_update_indicator.txt @@ -0,0 +1,3 @@ +HEADER20204A06 TAN1 U +T12020101111111111223003403361110213120000300000000000008730010000000000000000000000000000000000222222000000002229012 +TRAILER0000001 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_blanks.txt b/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_blanks.txt index 477171cb4..81c37dde8 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_blanks.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_blanks.txt @@ -1,4 +1,4 @@ -HEADER20204A06 TAN1EN +HEADER20204A06 TAN1ED T120201011111111112230 4033611102121 0000 00000000000008730010000000000000000 00002 222200000000222901 T2202010111111111121219740114WTTTTTY@W 2221 1 01 0199 0000 0000000000000291 T320201011111111112120190127WTTTT90W0 222 98 00000000 diff --git a/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_header_test.txt b/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_header_test.txt index 8441bca58..7c3b70a47 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_header_test.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/tanf_section1_header_test.txt @@ -1,3 +1,3 @@ -HEADER20204A06 TAN1 N +HEADER20204A06 TAN1 D T12020101111111111223003403361110212120000300000000000008730010000000000000000000000000000000000222222000000002229012 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/tanf_section4_with_errors.txt b/tdrs-backend/tdpservice/parsers/test/data/tanf_section4_with_errors.txt index 53590eccf..fbfc37fe8 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/tanf_section4_with_errors.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/tanf_section4_with_errors.txt @@ -1,3 +1,3 @@ -HEADER20204S06 TAN1 N +HEADER20204S06 TAN1 D T720204700006853700680540068454103000312400000000003180104000347400036460003583106000044600004360000325299000506200036070003385202000039100002740000499 TRAILER0000001 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/data/tribal_section_1_inconsistency.txt b/tdrs-backend/tdpservice/parsers/test/data/tribal_section_1_inconsistency.txt index c50875aa1..0b219728c 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/tribal_section_1_inconsistency.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/tribal_section_1_inconsistency.txt @@ -1,3 +1,3 @@ -HEADER20194A01142TAN1EU +HEADER20194A01142TAN1ED T120191011111111119255 140245112 23322 03 0 0 0 502 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 TRAILER0000001 diff --git a/tdrs-backend/tdpservice/parsers/test/data/tribal_section_4_fake.txt b/tdrs-backend/tdpservice/parsers/test/data/tribal_section_4_fake.txt index 9ec1943d3..25fd7baf7 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/tribal_section_4_fake.txt +++ b/tdrs-backend/tdpservice/parsers/test/data/tribal_section_4_fake.txt @@ -1,3 +1,3 @@ -HEADER20204S00142TAN1EU +HEADER20204S00142TAN1ED T720204101006853700680540068454103000312400037850003180104000347400036460003583106000044600004360000325299000506200036070003385202000039100002740000499 TRAILER0000001 \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 62cbfab88..012813335 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -50,7 +50,7 @@ def t2_invalid_dob_file(): quarter='Q1', file__name='t2_invalid_dob_file.txt', file__section='Active Case Data', - file__data=(b'HEADER20204A25 TAN1EU\n' + file__data=(b'HEADER20204A25 TAN1ED\n' b'T22020101111111111212Q897$9 3WTTTTTY@W222122222222101221211001472201140000000000000000000000000' b'0000000000000000000000000000000000000000000000000000000000291\n' b'TRAILER0000001 ') @@ -1676,3 +1676,25 @@ def test_parse_no_records_file(no_records_file, dfs): assert error.error_type == ParserErrorCategoryChoices.PRE_CHECK assert error.content_type is None assert error.object_id is None + + +@pytest.fixture +def tanf_section_1_file_with_bad_update_indicator(stt_user, stt): + """Fixture for tanf_section_1_file_with_bad_update_indicator.""" + return util.create_test_datafile('tanf_s1_bad_update_indicator.txt', stt_user, stt, "Active Case Data") + +@pytest.mark.django_db() +def test_parse_tanf_section_1_file_with_bad_update_indicator(tanf_section_1_file_with_bad_update_indicator, dfs): + """Test parsing TANF Section 1 submission update indicator.""" + dfs.datafile = tanf_section_1_file_with_bad_update_indicator + + parse.parse_datafile(tanf_section_1_file_with_bad_update_indicator, dfs) + + parser_errors = ParserError.objects.filter(file=tanf_section_1_file_with_bad_update_indicator) + + assert parser_errors.count() == 1 + + error = parser_errors.first() + + assert error.error_type == ParserErrorCategoryChoices.FIELD_VALUE + assert error.error_message == "HEADER update indicator: U does not match D." diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index 050e840bf..ed762bc15 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -44,7 +44,8 @@ def test_or_validators(): assert validator(value, RowSchema(), "friendly_name", "item_no") == (True, None) assert validator("3", RowSchema(), "friendly_name", "item_no") == (True, None) assert validator("5", RowSchema(), "friendly_name", "item_no") == (False, - "T1: 5 does not match 2. or T1: 5 does not " + "T1 friendly_name: 5 does not match 2. or " + "T1 friendly_name: 5 does not " "match 3.") validator = validators.or_validators(validators.matches(("2")), validators.matches(("3")), @@ -59,13 +60,15 @@ def test_or_validators(): value = "5" assert validator(value, RowSchema(), "friendly_name", "item_no") == (False, - "T1: 5 does not match 2. or T1: 5 does not " - "match 3. or T1: 5 does not match 4.") + 'T1 friendly_name: 5 does not match 2. or ' + 'T1 friendly_name: 5 does not match 3. or ' + 'T1 friendly_name: 5 does not match 4.') validator = validators.or_validators(validators.matches((2)), validators.matches((3)), validators.isLargerThan(4)) assert validator(5, RowSchema(), "friendly_name", "item_no") == (True, None) assert validator(1, RowSchema(), "friendly_name", "item_no") == (False, - "T1: 1 does not match 2. or T1: 1 does not " + "T1 friendly_name: 1 does not match 2. " + "or T1 friendly_name: 1 does not " "match 3. or T1: 1 is not larger than 4.") def test_if_validators(): @@ -82,7 +85,8 @@ def test_if_validators(): result_field_name="Field2", result_function=validators.matches('1'), ) result = validator(value, RowSchema()) - assert result == (False, 'if Field1 :1 validator1 passed then Field2 T1: 2 does not match 1.', ['Field1', 'Field2']) + assert result == (False, 'if Field1 :1 validator1 passed then Field2 T1 Field2: 2 does not match 1.', + ['Field1', 'Field2']) def test_and_validators(): @@ -183,7 +187,7 @@ def test_matches_returns_invalid(): is_valid, error = validator(value, RowSchema(), "friendly_name", "item_no") assert is_valid is False - assert error == 'T1: TEST does not match test.' + assert error == 'T1 friendly_name: TEST does not match test.' def test_oneOf_returns_valid(): diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index 7fa36c581..0ebdbe1b8 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -226,7 +226,7 @@ def matches(option, error_func=None): lambda value: value == option, lambda value, row_schema, friendly_name, item_num: error_func(option) if error_func - else f"{row_schema.record_type}: {value} does not match {option}.", + else f"{row_schema.record_type} {friendly_name}: {value} does not match {option}.", )