From f8a4d5457416305a9f1cd7384a391c029cf79684 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 19 Oct 2023 14:02:52 -0400 Subject: [PATCH 01/88] Added formating for header and autofit columns --- tdrs-backend/Pipfile | 2 +- tdrs-backend/Pipfile.lock | 719 ++++++++++++----------- tdrs-backend/tdpservice/parsers/views.py | 8 +- 3 files changed, 395 insertions(+), 334 deletions(-) diff --git a/tdrs-backend/Pipfile b/tdrs-backend/Pipfile index b360c8e31..89f316b60 100644 --- a/tdrs-backend/Pipfile +++ b/tdrs-backend/Pipfile @@ -58,7 +58,7 @@ django-elasticsearch-dsl = "==7.3" django-elasticsearch-dsl-drf = "==0.22.5" requests-aws4auth = "==1.1.2" cerberus = "==1.3.4" -xlsxwriter = "==3.0.1" +xlsxwriter = "==3.1.9" sendgrid = "==6.10.0" [requires] diff --git a/tdrs-backend/Pipfile.lock b/tdrs-backend/Pipfile.lock index bc99d280f..258f9f234 100644 --- a/tdrs-backend/Pipfile.lock +++ b/tdrs-backend/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "0ef020105fbcbee223abce4021a7599bff6bea6bce8bd4285ba36d3a4fc7994d" + "sha256": "6e853152cf067206afe522c93538ef6922368a9a69928f16591fd275ede287c1" }, "pipfile-spec": 6, "requires": { @@ -34,10 +34,10 @@ }, "asttokens": { "hashes": [ - "sha256:4622110b2a6f30b77e1473affaa97e711bc2f07d3f10848420ff1898edbe94f3", - "sha256:6b0ac9e93fb0335014d382b8fa9b3afa7df546984258005da0b9e7095b3deb1c" + "sha256:2e0171b991b2c959acc6c49318049236844a5da1d65ba2672c4880c1c894834e", + "sha256:cf8fc9e61a86461aa9fb161a14a0841a03c405fa829ac6b202670b3495d2ce69" ], - "version": "==2.2.1" + "version": "==2.4.0" }, "backcall": { "hashes": [ @@ -86,6 +86,7 @@ "sha256:92c0631ab91b4c5aa0e18a90b4d12df361723c6df1ef7e346db71f2ad0803ab3" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.28.4" }, "botocore": { @@ -94,6 +95,7 @@ "sha256:f9738a23b03c55c2958ebdee65273afeda80deaeefebe595887fc3251e48293a" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.31.4" }, "celery": { @@ -102,6 +104,7 @@ "sha256:da31f8eae7607b1582e5ee2d3f2d6f58450585afd23379491e3d9229d08102d0" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==5.2.6" }, "cerberus": { @@ -109,84 +112,74 @@ "sha256:d1b21b3954b2498d9a79edf16b3170a3ac1021df88d197dc2ce5928ba519237c" ], "index": "pypi", + "markers": "python_version >= '2.7'", "version": "==1.3.4" }, "certifi": { "hashes": [ - "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7", - "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716" + "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082", + "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9" ], "markers": "python_version >= '3.6'", - "version": "==2023.5.7" + "version": "==2023.7.22" }, "cffi": { "hashes": [ - "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5", - "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef", - "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104", - "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426", - "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405", - "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375", - "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a", - "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e", - "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc", - "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf", - "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185", - "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497", - "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3", - "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35", - "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c", - "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83", - "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21", - "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca", - "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984", - "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac", - "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd", - "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee", - "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a", - "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2", - "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192", - "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7", - "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585", - "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f", - "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e", - "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27", - "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b", - "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e", - "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e", - "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d", - "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c", - "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415", - "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82", - "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02", - "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314", - "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325", - "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c", - "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3", - "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914", - "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045", - "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d", - "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9", - "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5", - "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2", - "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c", - "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3", - "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2", - "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8", - "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d", - "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d", - "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9", - "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162", - "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76", - "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4", - "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e", - "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9", - "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6", - "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b", - "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01", - "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0" - ], - "version": "==1.15.1" + "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc", + "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a", + "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417", + "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab", + "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520", + "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36", + "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743", + "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8", + "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed", + "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684", + "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56", + "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324", + "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d", + "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235", + "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e", + "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088", + "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000", + "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7", + "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e", + "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673", + "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c", + "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe", + "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2", + "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098", + "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8", + "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a", + "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0", + "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b", + "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896", + "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e", + "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9", + "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2", + "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b", + "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6", + "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404", + "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f", + "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0", + "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4", + "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc", + "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936", + "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba", + "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872", + "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb", + "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614", + "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1", + "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d", + "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969", + "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b", + "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4", + "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627", + "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956", + "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357" + ], + "markers": "python_version >= '3.8'", + "version": "==1.16.0" }, "charset-normalizer": { "hashes": [ @@ -198,11 +191,11 @@ }, "click": { "hashes": [ - "sha256:48ee849951919527a045bfe3bf7baa8a959c423134e1a5b98c05c20ba75a1cbd", - "sha256:fa244bb30b3b5ee2cae3da8f55c9e5e0c0e86093306301fb418eb9dc40fbded5" + "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" ], "markers": "python_version >= '3.7'", - "version": "==8.1.6" + "version": "==8.1.7" }, "click-didyoumean": { "hashes": [ @@ -259,6 +252,7 @@ "sha256:ee77aa129f481be46f8d92a1a7db57269a2f23052d5f2433b4621bb457081cc9" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.4.7" }, "decorator": { @@ -291,6 +285,7 @@ "sha256:f71934b1a822f14a86c9ac9634053689279cd04ae69cb6ade4a59471b886582b" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.2.15" }, "django-admin-508": { @@ -307,6 +302,7 @@ "sha256:aedb5df940d32c10423d65136343bc009727df8a5a49ed0196e65241d823a890" ], "index": "pypi", + "markers": "python_version >= '3.5'", "version": "==1.0.2" }, "django-celery-beat": { @@ -319,10 +315,10 @@ }, "django-colorfield": { "hashes": [ - "sha256:208e04dae669ed95f18c4aef02865e9c785873521ffbe5b46fb6ea7a1500c979", - "sha256:7df5486de759dce70e54a1854f69bafd0a1e1bf98b66b09661d4d84342f447fc" + "sha256:00ceb5ef55338a0af131c87a13eca3533a327a6206e02a6c2723c059bcd65ea5", + "sha256:1e862bef9e73308499f366ab61190554fba366aa54d5fb1eba378ed2a04bc93d" ], - "version": "==0.9.0" + "version": "==0.10.1" }, "django-configurations": { "hashes": [ @@ -338,6 +334,7 @@ "sha256:5f07e2ff8a95c887698e748588a4a0b2ad0ad1b5a292e2d33132f1253e2a97cb" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==3.12.0" }, "django-csp": { @@ -362,6 +359,7 @@ "sha256:fc0b3960e16f6c06de4f2ca4daf1134376fce4d496c1ddc218c23daddf6bcaa0" ], "index": "pypi", + "markers": "python_version >= '2.7'", "version": "==0.22.5" }, "django-extensions": { @@ -370,6 +368,7 @@ "sha256:5f0fea7bf131ca303090352577a9e7f8bfbf5489bd9d9c8aea9401db28db34a0" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.1.3" }, "django-filter": { @@ -378,6 +377,7 @@ "sha256:f4a6737a30104c98d2e2a5fb93043f36dd7978e0c7ddc92f5998e85433ea5063" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==21.1" }, "django-flat-responsive": { @@ -413,6 +413,7 @@ "sha256:a475edb2f0f04c4f7e548919a751ecd50117270833956ed5bd585c0575d2a5e7" ], "index": "pypi", + "markers": "python_version >= '3.5'", "version": "==1.12.3" }, "django-timezone-field": { @@ -437,6 +438,7 @@ "sha256:24c4bf58ed7e85d1fe4ba250ab2da926d263cd57d64b03e8dcef0ac683f8b1aa" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.13.1" }, "drf-yasg": { @@ -445,6 +447,7 @@ "sha256:d50f197c7f02545d0b736df88c6d5cf874f8fea2507ad85ad7de6ae5bf2d9e5a" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==1.20.0" }, "elasticsearch": { @@ -453,6 +456,7 @@ "sha256:5920df0ab2630778680376d86bea349dc99860977eec9b6d2bd0860f337313f2" ], "index": "pypi", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' and python_version < '4'", "version": "==7.13.4" }, "elasticsearch-dsl": { @@ -463,12 +467,20 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==7.4.1" }, + "exceptiongroup": { + "hashes": [ + "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9", + "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3" + ], + "markers": "python_version < '3.11'", + "version": "==1.1.3" + }, "executing": { "hashes": [ - "sha256:0314a69e37426e3608aada02473b4161d4caf5a4b244d1d0c48072b8fee7bacc", - "sha256:19da64c18d2d851112f09c287f8d3dbbdf725ab0e569077efb6cdcbd3497c107" + "sha256:06df6183df67389625f4e763921c6cf978944721abf3e714000200aab95b0657", + "sha256:0ff053696fdeef426cda5bd18eacd94f82c91f49823a2e9090124212ceea9b08" ], - "version": "==1.2.0" + "version": "==2.0.0" }, "flower": { "hashes": [ @@ -484,15 +496,16 @@ "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8" ], "index": "pypi", + "markers": "python_version >= '3.5'", "version": "==20.1.0" }, "humanize": { "hashes": [ - "sha256:7ca0e43e870981fa684acb5b062deb307218193bca1a01f2b2676479df849b3a", - "sha256:df7c429c2d27372b249d3f26eb53b07b166b661326e0325793e0a988082e3889" + "sha256:8bc9e2bb9315e61ec06bf690151ae35aeb65651ab091266941edf97c90836404", + "sha256:9783373bf1eec713a770ecaa7c2d7a7902c98398009dfa3d8a2df91eec9311e8" ], "markers": "python_version >= '3.8'", - "version": "==4.7.0" + "version": "==4.8.0" }, "idna": { "hashes": [ @@ -515,15 +528,16 @@ "sha256:951bd9a64731c444fd907a5ce268543020086a697f6be08f7cc2c9a752a278c5" ], "index": "pypi", + "markers": "python_version >= '2.7'", "version": "==0.13.9" }, "ipython": { "hashes": [ - "sha256:1d197b907b6ba441b692c48cf2a3a2de280dc0ac91a3405b39349a50272ca0a1", - "sha256:248aca623f5c99a6635bc3857677b7320b9b8039f99f070ee0d20a5ca5a8e6bf" + "sha256:0852469d4d579d9cd613c220af7bf0c9cc251813e12be647cb9d463939db9b1e", + "sha256:ad52f58fca8f9f848e256c629eff888efc0528c12fe0f8ec14f33205f23ef938" ], "markers": "python_version >= '3.7'", - "version": "==8.14.0" + "version": "==8.16.1" }, "itypes": { "hashes": [ @@ -534,11 +548,11 @@ }, "jedi": { "hashes": [ - "sha256:203c1fd9d969ab8f2119ec0a3342e0b49910045abe6af0a3ae83a5764d54639e", - "sha256:bae794c30d07f6d910d32a7048af09b5a39ed740918da923c6b780790ebac612" + "sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd", + "sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0" ], "markers": "python_version >= '3.6'", - "version": "==0.18.2" + "version": "==0.19.1" }, "jinja2": { "hashes": [ @@ -561,15 +575,16 @@ "sha256:54b551b115ffb4d12b1f1ee93b8ba2a71bb8556ba3d85d62f707549613da877c" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==1.3.1" }, "kombu": { "hashes": [ - "sha256:48ee589e8833126fd01ceaa08f8a2041334e9f5894e5763c8486a550454551e9", - "sha256:fbd7572d92c0bf71c112a6b45163153dea5a7b6a701ec16b568c27d0fd2370f2" + "sha256:0ba213f630a2cb2772728aef56ac6883dc3a2f13435e10048f6e97d48506dbbd", + "sha256:b753c9cfc9b1e976e637a7cbc1a65d446a22e45546cd996ea28f932082b7dc9e" ], "markers": "python_version >= '3.8'", - "version": "==5.3.1" + "version": "==5.3.2" }, "markdown": { "hashes": [ @@ -577,6 +592,7 @@ "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.3.7" }, "markupsafe": { @@ -585,8 +601,11 @@ "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e", "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431", "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686", + "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c", "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559", "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc", + "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb", + "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939", "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c", "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0", "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4", @@ -594,6 +613,7 @@ "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575", "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba", "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d", + "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd", "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3", "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00", "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155", @@ -602,6 +622,7 @@ "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f", "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8", "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b", + "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007", "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24", "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea", "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198", @@ -609,9 +630,12 @@ "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee", "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be", "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2", + "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1", "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707", "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6", + "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c", "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58", + "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823", "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779", "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636", "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c", @@ -630,7 +654,9 @@ "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9", "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57", "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc", - "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2" + "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc", + "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2", + "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11" ], "markers": "python_version >= '3.7'", "version": "==2.1.3" @@ -645,11 +671,11 @@ }, "packaging": { "hashes": [ - "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61", - "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f" + "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", + "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" ], "markers": "python_version >= '3.7'", - "version": "==23.1" + "version": "==23.2" }, "paramiko": { "hashes": [ @@ -684,65 +710,63 @@ }, "pillow": { "hashes": [ - "sha256:00e65f5e822decd501e374b0650146063fbb30a7264b4d2744bdd7b913e0cab5", - "sha256:040586f7d37b34547153fa383f7f9aed68b738992380ac911447bb78f2abe530", - "sha256:0b6eb5502f45a60a3f411c63187db83a3d3107887ad0d036c13ce836f8a36f1d", - "sha256:1ce91b6ec08d866b14413d3f0bbdea7e24dfdc8e59f562bb77bc3fe60b6144ca", - "sha256:1f62406a884ae75fb2f818694469519fb685cc7eaff05d3451a9ebe55c646891", - "sha256:22c10cc517668d44b211717fd9775799ccec4124b9a7f7b3635fc5386e584992", - "sha256:3400aae60685b06bb96f99a21e1ada7bc7a413d5f49bce739828ecd9391bb8f7", - "sha256:349930d6e9c685c089284b013478d6f76e3a534e36ddfa912cde493f235372f3", - "sha256:368ab3dfb5f49e312231b6f27b8820c823652b7cd29cfbd34090565a015e99ba", - "sha256:38250a349b6b390ee6047a62c086d3817ac69022c127f8a5dc058c31ccef17f3", - "sha256:3a684105f7c32488f7153905a4e3015a3b6c7182e106fe3c37fbb5ef3e6994c3", - "sha256:3a82c40d706d9aa9734289740ce26460a11aeec2d9c79b7af87bb35f0073c12f", - "sha256:3b08d4cc24f471b2c8ca24ec060abf4bebc6b144cb89cba638c720546b1cf538", - "sha256:3ed64f9ca2f0a95411e88a4efbd7a29e5ce2cea36072c53dd9d26d9c76f753b3", - "sha256:3f07ea8d2f827d7d2a49ecf1639ec02d75ffd1b88dcc5b3a61bbb37a8759ad8d", - "sha256:520f2a520dc040512699f20fa1c363eed506e94248d71f85412b625026f6142c", - "sha256:5c6e3df6bdd396749bafd45314871b3d0af81ff935b2d188385e970052091017", - "sha256:608bfdee0d57cf297d32bcbb3c728dc1da0907519d1784962c5f0c68bb93e5a3", - "sha256:685ac03cc4ed5ebc15ad5c23bc555d68a87777586d970c2c3e216619a5476223", - "sha256:76de421f9c326da8f43d690110f0e79fe3ad1e54be811545d7d91898b4c8493e", - "sha256:76edb0a1fa2b4745fb0c99fb9fb98f8b180a1bbceb8be49b087e0b21867e77d3", - "sha256:7be600823e4c8631b74e4a0d38384c73f680e6105a7d3c6824fcf226c178c7e6", - "sha256:81ff539a12457809666fef6624684c008e00ff6bf455b4b89fd00a140eecd640", - "sha256:88af2003543cc40c80f6fca01411892ec52b11021b3dc22ec3bc9d5afd1c5334", - "sha256:8c11160913e3dd06c8ffdb5f233a4f254cb449f4dfc0f8f4549eda9e542c93d1", - "sha256:8f8182b523b2289f7c415f589118228d30ac8c355baa2f3194ced084dac2dbba", - "sha256:9211e7ad69d7c9401cfc0e23d49b69ca65ddd898976d660a2fa5904e3d7a9baa", - "sha256:92be919bbc9f7d09f7ae343c38f5bb21c973d2576c1d45600fce4b74bafa7ac0", - "sha256:9c82b5b3e043c7af0d95792d0d20ccf68f61a1fec6b3530e718b688422727396", - "sha256:9f7c16705f44e0504a3a2a14197c1f0b32a95731d251777dcb060aa83022cb2d", - "sha256:9fb218c8a12e51d7ead2a7c9e101a04982237d4855716af2e9499306728fb485", - "sha256:a74ba0c356aaa3bb8e3eb79606a87669e7ec6444be352870623025d75a14a2bf", - "sha256:b4f69b3700201b80bb82c3a97d5e9254084f6dd5fb5b16fc1a7b974260f89f43", - "sha256:bc2ec7c7b5d66b8ec9ce9f720dbb5fa4bace0f545acd34870eff4a369b44bf37", - "sha256:c189af0545965fa8d3b9613cfdb0cd37f9d71349e0f7750e1fd704648d475ed2", - "sha256:c1fbe7621c167ecaa38ad29643d77a9ce7311583761abf7836e1510c580bf3dd", - "sha256:c7cf14a27b0d6adfaebb3ae4153f1e516df54e47e42dcc073d7b3d76111a8d86", - "sha256:c9f72a021fbb792ce98306ffb0c348b3c9cb967dce0f12a49aa4c3d3fdefa967", - "sha256:cd25d2a9d2b36fcb318882481367956d2cf91329f6892fe5d385c346c0649629", - "sha256:ce543ed15570eedbb85df19b0a1a7314a9c8141a36ce089c0a894adbfccb4568", - "sha256:ce7b031a6fc11365970e6a5686d7ba8c63e4c1cf1ea143811acbb524295eabed", - "sha256:d35e3c8d9b1268cbf5d3670285feb3528f6680420eafe35cccc686b73c1e330f", - "sha256:d50b6aec14bc737742ca96e85d6d0a5f9bfbded018264b3b70ff9d8c33485551", - "sha256:d5d0dae4cfd56969d23d94dc8e89fb6a217be461c69090768227beb8ed28c0a3", - "sha256:d5db32e2a6ccbb3d34d87c87b432959e0db29755727afb37290e10f6e8e62614", - "sha256:d72e2ecc68a942e8cf9739619b7f408cc7b272b279b56b2c83c6123fcfa5cdff", - "sha256:d737a602fbd82afd892ca746392401b634e278cb65d55c4b7a8f48e9ef8d008d", - "sha256:d80cf684b541685fccdd84c485b31ce73fc5c9b5d7523bf1394ce134a60c6883", - "sha256:db24668940f82321e746773a4bc617bfac06ec831e5c88b643f91f122a785684", - "sha256:dbc02381779d412145331789b40cc7b11fdf449e5d94f6bc0b080db0a56ea3f0", - "sha256:dffe31a7f47b603318c609f378ebcd57f1554a3a6a8effbc59c3c69f804296de", - "sha256:edf4392b77bdc81f36e92d3a07a5cd072f90253197f4a52a55a8cec48a12483b", - "sha256:efe8c0681042536e0d06c11f48cebe759707c9e9abf880ee213541c5b46c5bf3", - "sha256:f31f9fdbfecb042d046f9d91270a0ba28368a723302786c0009ee9b9f1f60199", - "sha256:f88a0b92277de8e3ca715a0d79d68dc82807457dae3ab8699c758f07c20b3c51", - "sha256:faaf07ea35355b01a35cb442dd950d8f1bb5b040a7787791a535de13db15ed90" + "sha256:00f438bb841382b15d7deb9a05cc946ee0f2c352653c7aa659e75e592f6fa17d", + "sha256:0248f86b3ea061e67817c47ecbe82c23f9dd5d5226200eb9090b3873d3ca32de", + "sha256:04f6f6149f266a100374ca3cc368b67fb27c4af9f1cc8cb6306d849dcdf12616", + "sha256:062a1610e3bc258bff2328ec43f34244fcec972ee0717200cb1425214fe5b839", + "sha256:0a026c188be3b443916179f5d04548092e253beb0c3e2ee0a4e2cdad72f66099", + "sha256:0f7c276c05a9767e877a0b4c5050c8bee6a6d960d7f0c11ebda6b99746068c2a", + "sha256:1a8413794b4ad9719346cd9306118450b7b00d9a15846451549314a58ac42219", + "sha256:1ab05f3db77e98f93964697c8efc49c7954b08dd61cff526b7f2531a22410106", + "sha256:1c3ac5423c8c1da5928aa12c6e258921956757d976405e9467c5f39d1d577a4b", + "sha256:1c41d960babf951e01a49c9746f92c5a7e0d939d1652d7ba30f6b3090f27e412", + "sha256:1fafabe50a6977ac70dfe829b2d5735fd54e190ab55259ec8aea4aaea412fa0b", + "sha256:1fb29c07478e6c06a46b867e43b0bcdb241b44cc52be9bc25ce5944eed4648e7", + "sha256:24fadc71218ad2b8ffe437b54876c9382b4a29e030a05a9879f615091f42ffc2", + "sha256:2cdc65a46e74514ce742c2013cd4a2d12e8553e3a2563c64879f7c7e4d28bce7", + "sha256:2ef6721c97894a7aa77723740a09547197533146fba8355e86d6d9a4a1056b14", + "sha256:3b834f4b16173e5b92ab6566f0473bfb09f939ba14b23b8da1f54fa63e4b623f", + "sha256:3d929a19f5469b3f4df33a3df2983db070ebb2088a1e145e18facbc28cae5b27", + "sha256:41f67248d92a5e0a2076d3517d8d4b1e41a97e2df10eb8f93106c89107f38b57", + "sha256:47e5bf85b80abc03be7455c95b6d6e4896a62f6541c1f2ce77a7d2bb832af262", + "sha256:4d0152565c6aa6ebbfb1e5d8624140a440f2b99bf7afaafbdbf6430426497f28", + "sha256:50d08cd0a2ecd2a8657bd3d82c71efd5a58edb04d9308185d66c3a5a5bed9610", + "sha256:61f1a9d247317fa08a308daaa8ee7b3f760ab1809ca2da14ecc88ae4257d6172", + "sha256:6932a7652464746fcb484f7fc3618e6503d2066d853f68a4bd97193a3996e273", + "sha256:7a7e3daa202beb61821c06d2517428e8e7c1aab08943e92ec9e5755c2fc9ba5e", + "sha256:7dbaa3c7de82ef37e7708521be41db5565004258ca76945ad74a8e998c30af8d", + "sha256:7df5608bc38bd37ef585ae9c38c9cd46d7c81498f086915b0f97255ea60c2818", + "sha256:806abdd8249ba3953c33742506fe414880bad78ac25cc9a9b1c6ae97bedd573f", + "sha256:883f216eac8712b83a63f41b76ddfb7b2afab1b74abbb413c5df6680f071a6b9", + "sha256:912e3812a1dbbc834da2b32299b124b5ddcb664ed354916fd1ed6f193f0e2d01", + "sha256:937bdc5a7f5343d1c97dc98149a0be7eb9704e937fe3dc7140e229ae4fc572a7", + "sha256:9882a7451c680c12f232a422730f986a1fcd808da0fd428f08b671237237d651", + "sha256:9a92109192b360634a4489c0c756364c0c3a2992906752165ecb50544c251312", + "sha256:9d7bc666bd8c5a4225e7ac71f2f9d12466ec555e89092728ea0f5c0c2422ea80", + "sha256:a5f63b5a68daedc54c7c3464508d8c12075e56dcfbd42f8c1bf40169061ae666", + "sha256:a646e48de237d860c36e0db37ecaecaa3619e6f3e9d5319e527ccbc8151df061", + "sha256:a89b8312d51715b510a4fe9fc13686283f376cfd5abca8cd1c65e4c76e21081b", + "sha256:a92386125e9ee90381c3369f57a2a50fa9e6aa8b1cf1d9c4b200d41a7dd8e992", + "sha256:ae88931f93214777c7a3aa0a8f92a683f83ecde27f65a45f95f22d289a69e593", + "sha256:afc8eef765d948543a4775f00b7b8c079b3321d6b675dde0d02afa2ee23000b4", + "sha256:b0eb01ca85b2361b09480784a7931fc648ed8b7836f01fb9241141b968feb1db", + "sha256:b1c25762197144e211efb5f4e8ad656f36c8d214d390585d1d21281f46d556ba", + "sha256:b4005fee46ed9be0b8fb42be0c20e79411533d1fd58edabebc0dd24626882cfd", + "sha256:b920e4d028f6442bea9a75b7491c063f0b9a3972520731ed26c83e254302eb1e", + "sha256:baada14941c83079bf84c037e2d8b7506ce201e92e3d2fa0d1303507a8538212", + "sha256:bb40c011447712d2e19cc261c82655f75f32cb724788df315ed992a4d65696bb", + "sha256:c0949b55eb607898e28eaccb525ab104b2d86542a85c74baf3a6dc24002edec2", + "sha256:c9aeea7b63edb7884b031a35305629a7593272b54f429a9869a4f63a1bf04c34", + "sha256:cfe96560c6ce2f4c07d6647af2d0f3c54cc33289894ebd88cfbb3bcd5391e256", + "sha256:d27b5997bdd2eb9fb199982bb7eb6164db0426904020dc38c10203187ae2ff2f", + "sha256:d921bc90b1defa55c9917ca6b6b71430e4286fc9e44c55ead78ca1a9f9eba5f2", + "sha256:e6bf8de6c36ed96c86ea3b6e1d5273c53f46ef518a062464cd7ef5dd2cf92e38", + "sha256:eaed6977fa73408b7b8a24e8b14e59e1668cfc0f4c40193ea7ced8e210adf996", + "sha256:fa1d323703cfdac2036af05191b969b910d8f115cf53093125e4058f62012c9a", + "sha256:fe1e26e1ffc38be097f0ba1d0d07fcade2bcfd1d023cda5b29935ae8052bd793" ], "markers": "python_version >= '3.8'", - "version": "==10.0.0" + "version": "==10.1.0" }, "prometheus-client": { "hashes": [ @@ -823,6 +847,7 @@ "sha256:ffb7a888a047696e7f8240d649b43fb3644f14f0ee229077e7f6b9f9081635bd" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==2.9.3" }, "ptyprocess": { @@ -848,11 +873,11 @@ }, "pygments": { "hashes": [ - "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c", - "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1" + "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692", + "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29" ], "markers": "python_version >= '3.7'", - "version": "==2.15.1" + "version": "==2.16.1" }, "pyjwt": { "hashes": [ @@ -860,6 +885,7 @@ "sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==2.4.0" }, "pynacl": { @@ -883,7 +909,6 @@ "sha256:b7ac34a23f63d77e27f67b6a81c9418243733f027eeb8a3061d965b2da7e5cab", "sha256:c5e8a37049866d4eabc711db9f1c09e1c02ab72ba290f5fd244939c9a188042f" ], - "index": "pypi", "version": "==1.3.0" }, "python-crontab": { @@ -916,7 +941,6 @@ ], "index": "pypi", "version": "==2022.1" - }, "redis": { "hashes": [ @@ -924,6 +948,7 @@ "sha256:f13eea4254e302485add677cadedaf1305c1b3a4e07535e23b7b239798ce9301" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==4.1.2" }, "requests": { @@ -932,6 +957,7 @@ "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d" ], "index": "pypi", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", "version": "==2.27.1" }, "requests-aws4auth": { @@ -952,63 +978,61 @@ }, "ruamel.yaml": { "hashes": [ - "sha256:23cd2ed620231677564646b0c6a89d138b6822a0d78656df7abda5879ec4f447", - "sha256:ec939063761914e14542972a5cba6d33c23b0859ab6342f61cf070cfc600efc2" + "sha256:8df81a51384f2e6af73d88bede63ec437df4854a5a74841f40e7622471298457", + "sha256:ee9a9178a231306d2b260e67ba497c136d4639d58b08775ab67f5fb0f21e73f0" ], "markers": "python_version >= '3'", - "version": "==0.17.32" + "version": "==0.17.39" }, "ruamel.yaml.clib": { "hashes": [ - "sha256:045e0626baf1c52e5527bd5db361bc83180faaba2ff586e763d3d5982a876a9e", - "sha256:15910ef4f3e537eea7fe45f8a5d19997479940d9196f357152a09031c5be59f3", - "sha256:184faeaec61dbaa3cace407cffc5819f7b977e75360e8d5ca19461cd851a5fc5", - "sha256:1a6391a7cabb7641c32517539ca42cf84b87b667bad38b78d4d42dd23e957c81", - "sha256:1f08fd5a2bea9c4180db71678e850b995d2a5f4537be0e94557668cf0f5f9497", - "sha256:2aa261c29a5545adfef9296b7e33941f46aa5bbd21164228e833412af4c9c75f", - "sha256:3110a99e0f94a4a3470ff67fc20d3f96c25b13d24c6980ff841e82bafe827cac", - "sha256:3243f48ecd450eddadc2d11b5feb08aca941b5cd98c9b1db14b2fd128be8c697", - "sha256:370445fd795706fd291ab00c9df38a0caed0f17a6fb46b0f607668ecb16ce763", - "sha256:40d030e2329ce5286d6b231b8726959ebbe0404c92f0a578c0e2482182e38282", - "sha256:41d0f1fa4c6830176eef5b276af04c89320ea616655d01327d5ce65e50575c94", - "sha256:4a4d8d417868d68b979076a9be6a38c676eca060785abaa6709c7b31593c35d1", - "sha256:4b3a93bb9bc662fc1f99c5c3ea8e623d8b23ad22f861eb6fce9377ac07ad6072", - "sha256:5bc0667c1eb8f83a3752b71b9c4ba55ef7c7058ae57022dd9b29065186a113d9", - "sha256:721bc4ba4525f53f6a611ec0967bdcee61b31df5a56801281027a3a6d1c2daf5", - "sha256:763d65baa3b952479c4e972669f679fe490eee058d5aa85da483ebae2009d231", - "sha256:7bdb4c06b063f6fd55e472e201317a3bb6cdeeee5d5a38512ea5c01e1acbdd93", - "sha256:8831a2cedcd0f0927f788c5bdf6567d9dc9cc235646a434986a852af1cb54b4b", - "sha256:91a789b4aa0097b78c93e3dc4b40040ba55bef518f84a40d4442f713b4094acb", - "sha256:92460ce908546ab69770b2e576e4f99fbb4ce6ab4b245345a3869a0a0410488f", - "sha256:99e77daab5d13a48a4054803d052ff40780278240a902b880dd37a51ba01a307", - "sha256:9c7617df90c1365638916b98cdd9be833d31d337dbcd722485597b43c4a215bf", - "sha256:a234a20ae07e8469da311e182e70ef6b199d0fbeb6c6cc2901204dd87fb867e8", - "sha256:a7b301ff08055d73223058b5c46c55638917f04d21577c95e00e0c4d79201a6b", - "sha256:be2a7ad8fd8f7442b24323d24ba0b56c51219513cfa45b9ada3b87b76c374d4b", - "sha256:bf9a6bc4a0221538b1a7de3ed7bca4c93c02346853f44e1cd764be0023cd3640", - "sha256:c3ca1fbba4ae962521e5eb66d72998b51f0f4d0f608d3c0347a48e1af262efa7", - "sha256:d000f258cf42fec2b1bbf2863c61d7b8918d31ffee905da62dede869254d3b8a", - "sha256:d5859983f26d8cd7bb5c287ef452e8aacc86501487634573d260968f753e1d71", - "sha256:d5e51e2901ec2366b79f16c2299a03e74ba4531ddcfacc1416639c557aef0ad8", - "sha256:da538167284de58a52109a9b89b8f6a53ff8437dd6dc26d33b57bf6699153122", - "sha256:debc87a9516b237d0466a711b18b6ebeb17ba9f391eb7f91c649c5c4ec5006c7", - "sha256:df5828871e6648db72d1c19b4bd24819b80a755c4541d3409f0f7acd0f335c80", - "sha256:ecdf1a604009bd35c674b9225a8fa609e0282d9b896c03dd441a91e5f53b534e", - "sha256:efa08d63ef03d079dcae1dfe334f6c8847ba8b645d08df286358b1f5293d24ab", - "sha256:f01da5790e95815eb5a8a138508c01c758e5f5bc0ce4286c4f7028b8dd7ac3d0", - "sha256:f34019dced51047d6f70cb9383b2ae2853b7fc4dce65129a5acd49f4f9256646", - "sha256:f6d3d39611ac2e4f62c3128a9eed45f19a6608670c5a2f4f07f24e8de3441d38" - ], - "markers": "python_version < '3.12' and platform_python_implementation == 'CPython'", - "version": "==0.2.7" + "sha256:03d1162b6d1df1caa3a4bd27aa51ce17c9afc2046c31b0ad60a0a96ec22f8001", + "sha256:07238db9cbdf8fc1e9de2489a4f68474e70dffcb32232db7c08fa61ca0c7c462", + "sha256:1b617618914cb00bf5c34d4357c37aa15183fa229b24767259657746c9077615", + "sha256:25ac8c08322002b06fa1d49d1646181f0b2c72f5cbc15a85e80b4c30a544bb15", + "sha256:25c515e350e5b739842fc3228d662413ef28f295791af5e5110b543cf0b57d9b", + "sha256:3f215c5daf6a9d7bbed4a0a4f760f3113b10e82ff4c5c44bec20a68c8014f675", + "sha256:3fcc54cb0c8b811ff66082de1680b4b14cf8a81dce0d4fbf665c2265a81e07a1", + "sha256:53a300ed9cea38cf5a2a9b069058137c2ca1ce658a874b79baceb8f892f915a7", + "sha256:56f4252222c067b4ce51ae12cbac231bce32aee1d33fbfc9d17e5b8d6966c312", + "sha256:665f58bfd29b167039f714c6998178d27ccd83984084c286110ef26b230f259f", + "sha256:700e4ebb569e59e16a976857c8798aee258dceac7c7d6b50cab63e080058df91", + "sha256:7048c338b6c86627afb27faecf418768acb6331fc24cfa56c93e8c9780f815fa", + "sha256:75e1ed13e1f9de23c5607fe6bd1aeaae21e523b32d83bb33918245361e9cc51b", + "sha256:7f67a1ee819dc4562d444bbafb135832b0b909f81cc90f7aa00260968c9ca1b3", + "sha256:84b554931e932c46f94ab306913ad7e11bba988104c5cff26d90d03f68258cd5", + "sha256:955eae71ac26c1ab35924203fda6220f84dce57d6d7884f189743e2abe3a9fbe", + "sha256:9eb5dee2772b0f704ca2e45b1713e4e5198c18f515b52743576d196348f374d3", + "sha256:a5aa27bad2bb83670b71683aae140a1f52b0857a2deff56ad3f6c13a017a26ed", + "sha256:a6a9ffd280b71ad062eae53ac1659ad86a17f59a0fdc7699fd9be40525153337", + "sha256:b16420e621d26fdfa949a8b4b47ade8810c56002f5389970db4ddda51dbff248", + "sha256:b42169467c42b692c19cf539c38d4602069d8c1505e97b86387fcf7afb766e1d", + "sha256:b5edda50e5e9e15e54a6a8a0070302b00c518a9d32accc2346ad6c984aacd279", + "sha256:bba64af9fa9cebe325a62fa398760f5c7206b215201b0ec825005f1b18b9bccf", + "sha256:beb2e0404003de9a4cab9753a8805a8fe9320ee6673136ed7f04255fe60bb512", + "sha256:bef08cd86169d9eafb3ccb0a39edb11d8e25f3dae2b28f5c52fd997521133069", + "sha256:c2a72e9109ea74e511e29032f3b670835f8a59bbdc9ce692c5b4ed91ccf1eedb", + "sha256:c58ecd827313af6864893e7af0a3bb85fd529f862b6adbefe14643947cfe2942", + "sha256:c69212f63169ec1cfc9bb44723bf2917cbbd8f6191a00ef3410f5a7fe300722d", + "sha256:cabddb8d8ead485e255fe80429f833172b4cadf99274db39abc080e068cbcc31", + "sha256:d176b57452ab5b7028ac47e7b3cf644bcfdc8cacfecf7e71759f7f51a59e5c92", + "sha256:d92f81886165cb14d7b067ef37e142256f1c6a90a65cd156b063a43da1708cfd", + "sha256:da09ad1c359a728e112d60116f626cc9f29730ff3e0e7db72b9a2dbc2e4beed5", + "sha256:ebc06178e8821efc9692ea7544aa5644217358490145629914d8020042c24aa1", + "sha256:edaef1c1200c4b4cb914583150dcaa3bc30e592e907c01117c08b13a07255ec2", + "sha256:f481f16baec5290e45aebdc2a5168ebc6d35189ae6fea7a58787613a25f6e875", + "sha256:fff3573c2db359f091e1589c3d7c5fc2f86f5bdb6f24252c2d8e539d4e45f412" + ], + "markers": "python_version < '3.13' and platform_python_implementation == 'CPython'", + "version": "==0.2.8" }, "s3transfer": { "hashes": [ - "sha256:3c0da2d074bf35d6870ef157158641178a4204a6e689e82546083e31e0311346", - "sha256:640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9" + "sha256:b014be3a8a2aab98cfe1abc7229cc5a9a0cf05eb9c1f2b86b230fd8df3f78084", + "sha256:cab66d3380cca3e70939ef2255d01cd8aece6a4907a9528740f668c4b0611861" ], "markers": "python_version >= '3.7'", - "version": "==0.6.1" + "version": "==0.6.2" }, "sendgrid": { "hashes": [ @@ -1016,15 +1040,16 @@ "sha256:9b15050c6f8826ee576f76a786efb15d956639f485478cbddd79ed69e8350ab8" ], "index": "pypi", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==6.10.0" }, "setuptools": { "hashes": [ - "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f", - "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235" + "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87", + "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a" ], - "markers": "python_version >= '3.7'", - "version": "==68.0.0" + "markers": "python_version >= '3.8'", + "version": "==68.2.2" }, "six": { "hashes": [ @@ -1044,10 +1069,10 @@ }, "stack-data": { "hashes": [ - "sha256:32d2dd0376772d01b6cb9fc996f3c8b57a357089dec328ed4b6553d037eaf815", - "sha256:cbb2a53eb64e5785878201a97ed7c7b94883f48b87bfb0bbe8b623c74679e4a8" + "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9", + "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695" ], - "version": "==0.6.2" + "version": "==0.6.3" }, "starkbank-ecdsa": { "hashes": [ @@ -1065,36 +1090,36 @@ }, "tornado": { "hashes": [ - "sha256:05615096845cf50a895026f749195bf0b10b8909f9be672f50b0fe69cba368e4", - "sha256:0c325e66c8123c606eea33084976c832aa4e766b7dff8aedd7587ea44a604cdf", - "sha256:29e71c847a35f6e10ca3b5c2990a52ce38b233019d8e858b755ea6ce4dcdd19d", - "sha256:4b927c4f19b71e627b13f3db2324e4ae660527143f9e1f2e2fb404f3a187e2ba", - "sha256:5b17b1cf5f8354efa3d37c6e28fdfd9c1c1e5122f2cb56dac121ac61baa47cbe", - "sha256:6a0848f1aea0d196a7c4f6772197cbe2abc4266f836b0aac76947872cd29b411", - "sha256:7efcbcc30b7c654eb6a8c9c9da787a851c18f8ccd4a5a3a95b05c7accfa068d2", - "sha256:834ae7540ad3a83199a8da8f9f2d383e3c3d5130a328889e4cc991acc81e87a0", - "sha256:b46a6ab20f5c7c1cb949c72c1994a4585d2eaa0be4853f50a03b5031e964fc7c", - "sha256:c2de14066c4a38b4ecbbcd55c5cc4b5340eb04f1c5e81da7451ef555859c833f", - "sha256:c367ab6c0393d71171123ca5515c61ff62fe09024fa6bf299cd1339dc9456829" + "sha256:1bd19ca6c16882e4d37368e0152f99c099bad93e0950ce55e71daed74045908f", + "sha256:22d3c2fa10b5793da13c807e6fc38ff49a4f6e1e3868b0a6f4164768bb8e20f5", + "sha256:502fba735c84450974fec147340016ad928d29f1e91f49be168c0a4c18181e1d", + "sha256:65ceca9500383fbdf33a98c0087cb975b2ef3bfb874cb35b8de8740cf7f41bd3", + "sha256:71a8db65160a3c55d61839b7302a9a400074c9c753040455494e2af74e2501f2", + "sha256:7ac51f42808cca9b3613f51ffe2a965c8525cb1b00b7b2d56828b8045354f76a", + "sha256:7d01abc57ea0dbb51ddfed477dfe22719d376119844e33c661d873bf9c0e4a16", + "sha256:805d507b1f588320c26f7f097108eb4023bbaa984d63176d1652e184ba24270a", + "sha256:9dc4444c0defcd3929d5c1eb5706cbe1b116e762ff3e0deca8b715d14bf6ec17", + "sha256:ceb917a50cd35882b57600709dd5421a418c29ddc852da8bcdab1f0db33406b0", + "sha256:e7d8db41c0181c80d76c982aacc442c0783a2c54d6400fe028954201a2e032fe" ], "markers": "python_version >= '3.8'", - "version": "==6.3.2" + "version": "==6.3.3" }, "traitlets": { "hashes": [ - "sha256:9e6ec080259b9a5940c797d58b613b5e31441c2257b87c2e795c5228ae80d2d8", - "sha256:f6cde21a9c68cf756af02035f72d5a723bf607e862e7be33ece505abf4a3bad9" + "sha256:7564b5bf8d38c40fa45498072bf4dc5e8346eb087bbf1e2ae2d8774f6a0f078e", + "sha256:98277f247f18b2c5cabaf4af369187754f4fb0e85911d473f72329db8a7f4fae" ], - "markers": "python_version >= '3.7'", - "version": "==5.9.0" + "markers": "python_version >= '3.8'", + "version": "==5.11.2" }, "typing-extensions": { "hashes": [ - "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36", - "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2" + "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", + "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" ], "markers": "python_version < '3.11'", - "version": "==4.7.1" + "version": "==4.8.0" }, "uritemplate": { "hashes": [ @@ -1106,11 +1131,11 @@ }, "urllib3": { "hashes": [ - "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f", - "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14" + "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07", + "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==1.26.16" + "version": "==1.26.18" }, "vine": { "hashes": [ @@ -1126,14 +1151,15 @@ "sha256:f219db8fd96819b026df1dc6d93fb380cf6d81f20450115200dd901dea4b0c8f" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==2.2.0" }, "wcwidth": { "hashes": [ - "sha256:795b138f6875577cd91bba52baf9e445cd5118fd32723b460e30a0af30ea230e", - "sha256:a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0" + "sha256:77f719e01648ed600dfa5402c347481c0992263b81a027344f3e1ba25493a704", + "sha256:8705c569999ffbb4f6a87c6d1b80f324bd6db952f5eb0b95bc07517f4c1813d4" ], - "version": "==0.2.6" + "version": "==0.2.8" }, "wrapt": { "hashes": [ @@ -1218,11 +1244,12 @@ }, "xlsxwriter": { "hashes": [ - "sha256:2f2af944d2b4b5f21cd3ac8e01b2417ec74c60e2ca11cae90b4f32ee172c99d6", - "sha256:3f39bf581c55f3ad1438bc170d7f4c4649cee8b6b7a80d21f79508118eeea52a" + "sha256:b61c1a0c786f82644936c0936ec96ee96cd3afb9440094232f7faef9b38689f0", + "sha256:de810bf328c6a4550f4ffd6b0b34972aeb7ffcf40f3d285a0413734f9b63a929" ], "index": "pypi", - "version": "==3.0.1" + "markers": "python_version >= '3.6'", + "version": "==3.1.9" } }, "develop": { @@ -1232,6 +1259,7 @@ "sha256:75371ea153548a5ce3a1e16c5036e87d631950e27df0e0dd734050c0ae00746b" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.29.4" }, "awscli-local": { @@ -1247,6 +1275,7 @@ "sha256:92c0631ab91b4c5aa0e18a90b4d12df361723c6df1ef7e346db71f2ad0803ab3" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.28.4" }, "botocore": { @@ -1255,15 +1284,16 @@ "sha256:f9738a23b03c55c2958ebdee65273afeda80deaeefebe595887fc3251e48293a" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.31.4" }, "click": { "hashes": [ - "sha256:48ee849951919527a045bfe3bf7baa8a959c423134e1a5b98c05c20ba75a1cbd", - "sha256:fa244bb30b3b5ee2cae3da8f55c9e5e0c0e86093306301fb418eb9dc40fbded5" + "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" ], "markers": "python_version >= '3.7'", - "version": "==8.1.6" + "version": "==8.1.7" }, "colorama": { "hashes": [ @@ -1278,69 +1308,61 @@ "toml" ], "hashes": [ - "sha256:06a9a2be0b5b576c3f18f1a241f0473575c4a26021b52b2a85263a00f034d51f", - "sha256:06fb182e69f33f6cd1d39a6c597294cff3143554b64b9825d1dc69d18cc2fff2", - "sha256:0a5f9e1dbd7fbe30196578ca36f3fba75376fb99888c395c5880b355e2875f8a", - "sha256:0e1f928eaf5469c11e886fe0885ad2bf1ec606434e79842a879277895a50942a", - "sha256:171717c7cb6b453aebac9a2ef603699da237f341b38eebfee9be75d27dc38e01", - "sha256:1e9d683426464e4a252bf70c3498756055016f99ddaec3774bf368e76bbe02b6", - "sha256:201e7389591af40950a6480bd9edfa8ed04346ff80002cec1a66cac4549c1ad7", - "sha256:245167dd26180ab4c91d5e1496a30be4cd721a5cf2abf52974f965f10f11419f", - "sha256:2aee274c46590717f38ae5e4650988d1af340fe06167546cc32fe2f58ed05b02", - "sha256:2e07b54284e381531c87f785f613b833569c14ecacdcb85d56b25c4622c16c3c", - "sha256:31563e97dae5598556600466ad9beea39fb04e0229e61c12eaa206e0aa202063", - "sha256:33d6d3ea29d5b3a1a632b3c4e4f4ecae24ef170b0b9ee493883f2df10039959a", - "sha256:3d376df58cc111dc8e21e3b6e24606b5bb5dee6024f46a5abca99124b2229ef5", - "sha256:419bfd2caae268623dd469eff96d510a920c90928b60f2073d79f8fe2bbc5959", - "sha256:48c19d2159d433ccc99e729ceae7d5293fbffa0bdb94952d3579983d1c8c9d97", - "sha256:49969a9f7ffa086d973d91cec8d2e31080436ef0fb4a359cae927e742abfaaa6", - "sha256:52edc1a60c0d34afa421c9c37078817b2e67a392cab17d97283b64c5833f427f", - "sha256:537891ae8ce59ef63d0123f7ac9e2ae0fc8b72c7ccbe5296fec45fd68967b6c9", - "sha256:54b896376ab563bd38453cecb813c295cf347cf5906e8b41d340b0321a5433e5", - "sha256:58c2ccc2f00ecb51253cbe5d8d7122a34590fac9646a960d1430d5b15321d95f", - "sha256:5b7540161790b2f28143191f5f8ec02fb132660ff175b7747b95dcb77ac26562", - "sha256:5baa06420f837184130752b7c5ea0808762083bf3487b5038d68b012e5937dbe", - "sha256:5e330fc79bd7207e46c7d7fd2bb4af2963f5f635703925543a70b99574b0fea9", - "sha256:61b9a528fb348373c433e8966535074b802c7a5d7f23c4f421e6c6e2f1697a6f", - "sha256:63426706118b7f5cf6bb6c895dc215d8a418d5952544042c8a2d9fe87fcf09cb", - "sha256:6d040ef7c9859bb11dfeb056ff5b3872436e3b5e401817d87a31e1750b9ae2fb", - "sha256:6f48351d66575f535669306aa7d6d6f71bc43372473b54a832222803eb956fd1", - "sha256:7ee7d9d4822c8acc74a5e26c50604dff824710bc8de424904c0982e25c39c6cb", - "sha256:81c13a1fc7468c40f13420732805a4c38a105d89848b7c10af65a90beff25250", - "sha256:8d13c64ee2d33eccf7437961b6ea7ad8673e2be040b4f7fd4fd4d4d28d9ccb1e", - "sha256:8de8bb0e5ad103888d65abef8bca41ab93721647590a3f740100cd65c3b00511", - "sha256:8fa03bce9bfbeeef9f3b160a8bed39a221d82308b4152b27d82d8daa7041fee5", - "sha256:924d94291ca674905fe9481f12294eb11f2d3d3fd1adb20314ba89e94f44ed59", - "sha256:975d70ab7e3c80a3fe86001d8751f6778905ec723f5b110aed1e450da9d4b7f2", - "sha256:976b9c42fb2a43ebf304fa7d4a310e5f16cc99992f33eced91ef6f908bd8f33d", - "sha256:9e31cb64d7de6b6f09702bb27c02d1904b3aebfca610c12772452c4e6c21a0d3", - "sha256:a342242fe22407f3c17f4b499276a02b01e80f861f1682ad1d95b04018e0c0d4", - "sha256:a3d33a6b3eae87ceaefa91ffdc130b5e8536182cd6dfdbfc1aa56b46ff8c86de", - "sha256:a895fcc7b15c3fc72beb43cdcbdf0ddb7d2ebc959edac9cef390b0d14f39f8a9", - "sha256:afb17f84d56068a7c29f5fa37bfd38d5aba69e3304af08ee94da8ed5b0865833", - "sha256:b1c546aca0ca4d028901d825015dc8e4d56aac4b541877690eb76490f1dc8ed0", - "sha256:b29019c76039dc3c0fd815c41392a044ce555d9bcdd38b0fb60fb4cd8e475ba9", - "sha256:b46517c02ccd08092f4fa99f24c3b83d8f92f739b4657b0f146246a0ca6a831d", - "sha256:b7aa5f8a41217360e600da646004f878250a0d6738bcdc11a0a39928d7dc2050", - "sha256:b7b4c971f05e6ae490fef852c218b0e79d4e52f79ef0c8475566584a8fb3e01d", - "sha256:ba90a9563ba44a72fda2e85302c3abc71c5589cea608ca16c22b9804262aaeb6", - "sha256:cb017fd1b2603ef59e374ba2063f593abe0fc45f2ad9abdde5b4d83bd922a353", - "sha256:d22656368f0e6189e24722214ed8d66b8022db19d182927b9a248a2a8a2f67eb", - "sha256:d2c2db7fd82e9b72937969bceac4d6ca89660db0a0967614ce2481e81a0b771e", - "sha256:d39b5b4f2a66ccae8b7263ac3c8170994b65266797fb96cbbfd3fb5b23921db8", - "sha256:d62a5c7dad11015c66fbb9d881bc4caa5b12f16292f857842d9d1871595f4495", - "sha256:e7d9405291c6928619403db1d10bd07888888ec1abcbd9748fdaa971d7d661b2", - "sha256:e84606b74eb7de6ff581a7915e2dab7a28a0517fbe1c9239eb227e1354064dcd", - "sha256:eb393e5ebc85245347950143969b241d08b52b88a3dc39479822e073a1a8eb27", - "sha256:ebba1cd308ef115925421d3e6a586e655ca5a77b5bf41e02eb0e4562a111f2d1", - "sha256:ee57190f24fba796e36bb6d3aa8a8783c643d8fa9760c89f7a98ab5455fbf818", - "sha256:f2f67fe12b22cd130d34d0ef79206061bfb5eda52feb6ce0dba0644e20a03cf4", - "sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e", - "sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850", - "sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3" + "sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1", + "sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63", + "sha256:149de1d2401ae4655c436a3dced6dd153f4c3309f599c3d4bd97ab172eaf02d9", + "sha256:1981f785239e4e39e6444c63a98da3a1db8e971cb9ceb50a945ba6296b43f312", + "sha256:2443cbda35df0d35dcfb9bf8f3c02c57c1d6111169e3c85fc1fcc05e0c9f39a3", + "sha256:289fe43bf45a575e3ab10b26d7b6f2ddb9ee2dba447499f5401cfb5ecb8196bb", + "sha256:2f11cc3c967a09d3695d2a6f03fb3e6236622b93be7a4b5dc09166a861be6d25", + "sha256:307adb8bd3abe389a471e649038a71b4eb13bfd6b7dd9a129fa856f5c695cf92", + "sha256:310b3bb9c91ea66d59c53fa4989f57d2436e08f18fb2f421a1b0b6b8cc7fffda", + "sha256:315a989e861031334d7bee1f9113c8770472db2ac484e5b8c3173428360a9148", + "sha256:3a4006916aa6fee7cd38db3bfc95aa9c54ebb4ffbfc47c677c8bba949ceba0a6", + "sha256:3c7bba973ebee5e56fe9251300c00f1579652587a9f4a5ed8404b15a0471f216", + "sha256:4175e10cc8dda0265653e8714b3174430b07c1dca8957f4966cbd6c2b1b8065a", + "sha256:43668cabd5ca8258f5954f27a3aaf78757e6acf13c17604d89648ecc0cc66640", + "sha256:4cbae1051ab791debecc4a5dcc4a1ff45fc27b91b9aee165c8a27514dd160836", + "sha256:5c913b556a116b8d5f6ef834038ba983834d887d82187c8f73dec21049abd65c", + "sha256:5f7363d3b6a1119ef05015959ca24a9afc0ea8a02c687fe7e2d557705375c01f", + "sha256:630b13e3036e13c7adc480ca42fa7afc2a5d938081d28e20903cf7fd687872e2", + "sha256:72c0cfa5250f483181e677ebc97133ea1ab3eb68645e494775deb6a7f6f83901", + "sha256:7dbc3ed60e8659bc59b6b304b43ff9c3ed858da2839c78b804973f613d3e92ed", + "sha256:88ed2c30a49ea81ea3b7f172e0269c182a44c236eb394718f976239892c0a27a", + "sha256:89a937174104339e3a3ffcf9f446c00e3a806c28b1841c63edb2b369310fd074", + "sha256:9028a3871280110d6e1aa2df1afd5ef003bab5fb1ef421d6dc748ae1c8ef2ebc", + "sha256:99b89d9f76070237975b315b3d5f4d6956ae354a4c92ac2388a5695516e47c84", + "sha256:9f805d62aec8eb92bab5b61c0f07329275b6f41c97d80e847b03eb894f38d083", + "sha256:a889ae02f43aa45032afe364c8ae84ad3c54828c2faa44f3bfcafecb5c96b02f", + "sha256:aa72dbaf2c2068404b9870d93436e6d23addd8bbe9295f49cbca83f6e278179c", + "sha256:ac8c802fa29843a72d32ec56d0ca792ad15a302b28ca6203389afe21f8fa062c", + "sha256:ae97af89f0fbf373400970c0a21eef5aa941ffeed90aee43650b81f7d7f47637", + "sha256:af3d828d2c1cbae52d34bdbb22fcd94d1ce715d95f1a012354a75e5913f1bda2", + "sha256:b4275802d16882cf9c8b3d057a0839acb07ee9379fa2749eca54efbce1535b82", + "sha256:b4767da59464bb593c07afceaddea61b154136300881844768037fd5e859353f", + "sha256:b631c92dfe601adf8f5ebc7fc13ced6bb6e9609b19d9a8cd59fa47c4186ad1ce", + "sha256:be32ad29341b0170e795ca590e1c07e81fc061cb5b10c74ce7203491484404ef", + "sha256:beaa5c1b4777f03fc63dfd2a6bd820f73f036bfb10e925fce067b00a340d0f3f", + "sha256:c0ba320de3fb8c6ec16e0be17ee1d3d69adcda99406c43c0409cb5c41788a611", + "sha256:c9eacf273e885b02a0273bb3a2170f30e2d53a6d53b72dbe02d6701b5296101c", + "sha256:cb536f0dcd14149425996821a168f6e269d7dcd2c273a8bff8201e79f5104e76", + "sha256:d1bc430677773397f64a5c88cb522ea43175ff16f8bfcc89d467d974cb2274f9", + "sha256:d1c88ec1a7ff4ebca0219f5b1ef863451d828cccf889c173e1253aa84b1e07ce", + "sha256:d3d9df4051c4a7d13036524b66ecf7a7537d14c18a384043f30a303b146164e9", + "sha256:d51ac2a26f71da1b57f2dc81d0e108b6ab177e7d30e774db90675467c847bbdf", + "sha256:d872145f3a3231a5f20fd48500274d7df222e291d90baa2026cc5152b7ce86bf", + "sha256:d8f17966e861ff97305e0801134e69db33b143bbfb36436efb9cfff6ec7b2fd9", + "sha256:dbc1b46b92186cc8074fee9d9fbb97a9dd06c6cbbef391c2f59d80eabdf0faa6", + "sha256:e10c39c0452bf6e694511c901426d6b5ac005acc0f78ff265dbe36bf81f808a2", + "sha256:e267e9e2b574a176ddb983399dec325a80dbe161f1a32715c780b5d14b5f583a", + "sha256:f47d39359e2c3779c5331fc740cf4bce6d9d680a7b4b4ead97056a0ae07cb49a", + "sha256:f6e9589bd04d0461a417562649522575d8752904d35c12907d8c9dfeba588faf", + "sha256:f94b734214ea6a36fe16e96a70d941af80ff3bfd716c141300d95ebc85339738", + "sha256:fa28e909776dc69efb6ed975a63691bc8172b64ff357e663a1bb06ff3c9b589a", + "sha256:fe494faa90ce6381770746077243231e0b83ff3f17069d748f645617cefe19d4" ], - "markers": "python_version >= '3.7'", - "version": "==7.2.7" + "markers": "python_version >= '3.8'", + "version": "==7.3.2" }, "docutils": { "hashes": [ @@ -1352,11 +1374,11 @@ }, "exceptiongroup": { "hashes": [ - "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5", - "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f" + "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9", + "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3" ], "markers": "python_version < '3.11'", - "version": "==1.1.2" + "version": "==1.1.3" }, "factory-boy": { "hashes": [ @@ -1364,15 +1386,16 @@ "sha256:eb02a7dd1b577ef606b75a253b9818e6f9eaf996d94449c9d5ebb124f90dc795" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.2.1" }, "faker": { "hashes": [ - "sha256:4b7d5cd0c898f0b64f88fbf0a35aac66762f2273446ba4a4e459985a2e5c8f8c", - "sha256:d1eb772faf4a7c458c90b19d3626c40ae3460bd665ad7f5fb7b089e31d1a6dcf" + "sha256:a62a3fd3bfa3122d4f57dfa26a1cc37d76751a76c8ddd63cf9d24078c57913a4", + "sha256:e28090068293c5a83e7f4d636417d45fae1031ca8a8136cc2415549ebc2111e2" ], "markers": "python_version >= '3.8'", - "version": "==19.1.0" + "version": "==19.11.0" }, "flake8": { "hashes": [ @@ -1380,6 +1403,7 @@ "sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181" ], "index": "pypi", + "markers": "python_full_version >= '3.8.1'", "version": "==6.0.0" }, "flake8-docstrings": { @@ -1388,6 +1412,7 @@ "sha256:51f2344026da083fc084166a9353f5082b01f72901df422f74b4d953ae88ac75" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.7.0" }, "ghp-import": { @@ -1419,6 +1444,7 @@ "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6" ], "index": "pypi", + "markers": "python_full_version >= '3.8.0'", "version": "==5.12.0" }, "jinja2": { @@ -1439,9 +1465,9 @@ }, "localstack-client": { "hashes": [ - "sha256:3af9ab57d7744f64deb1912c1145b453db0233d8caaf6f71bd97380b5c4e45bb" + "sha256:377ed05e7854eb476dc73b0ab992c433c683bd1026aa84755eaa29f7561757c1" ], - "version": "==2.2" + "version": "==2.3" }, "markdown": { "hashes": [ @@ -1449,6 +1475,7 @@ "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621" ], "index": "pypi", + "markers": "python_version >= '3.6'", "version": "==3.3.7" }, "markupsafe": { @@ -1457,8 +1484,11 @@ "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e", "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431", "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686", + "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c", "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559", "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc", + "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb", + "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939", "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c", "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0", "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4", @@ -1466,6 +1496,7 @@ "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575", "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba", "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d", + "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd", "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3", "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00", "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155", @@ -1474,6 +1505,7 @@ "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f", "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8", "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b", + "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007", "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24", "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea", "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198", @@ -1481,9 +1513,12 @@ "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee", "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be", "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2", + "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1", "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707", "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6", + "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c", "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58", + "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823", "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779", "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636", "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c", @@ -1502,7 +1537,9 @@ "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9", "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57", "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc", - "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2" + "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc", + "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2", + "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11" ], "markers": "python_version >= '3.7'", "version": "==2.1.3" @@ -1529,23 +1566,24 @@ "sha256:6ee46d309bda331aac915cd24aab882c179a933bd9e77b80ce7d2eaaa3f689dd" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.4.3" }, "packaging": { "hashes": [ - "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61", - "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f" + "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", + "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" ], "markers": "python_version >= '3.7'", - "version": "==23.1" + "version": "==23.2" }, "pluggy": { "hashes": [ - "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849", - "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3" + "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", + "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7" ], - "markers": "python_version >= '3.7'", - "version": "==1.2.0" + "markers": "python_version >= '3.8'", + "version": "==1.3.0" }, "pyasn1": { "hashes": [ @@ -1584,6 +1622,7 @@ "sha256:a97eb5ced266f45053ebb1f2c6c6d29091690503e3a5c14be7f908b37b06f2d4" ], "index": "pypi", + "markers": "python_version >= '3.8'", "version": "==1.11" }, "pyparsing": { @@ -1592,6 +1631,7 @@ "sha256:edb662d6fe322d6e990b1594b5feaeadf806803359e3d4d42f11e295e588f0ea" ], "index": "pypi", + "markers": "python_full_version >= '3.6.8'", "version": "==3.1.0" }, "pytest": { @@ -1600,6 +1640,7 @@ "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==7.4.0" }, "pytest-cov": { @@ -1608,6 +1649,7 @@ "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==4.1.0" }, "pytest-django": { @@ -1616,6 +1658,7 @@ "sha256:d9076f759bb7c36939dbdd5ae6633c18edfc2902d1a69fdbefd2426b970ce6c2" ], "index": "pypi", + "markers": "python_version >= '3.5'", "version": "==4.5.2" }, "pytest-factoryboy": { @@ -1624,6 +1667,7 @@ "sha256:7275a52299b20c0f58b63fdf7326b3fd2b7cbefbdaa90fdcfc776bbe92197484" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==2.5.1" }, "pytest-mock": { @@ -1632,6 +1676,7 @@ "sha256:9f732204aff799161cea6f818366bd254b41dbdfb6fd8fee4e04d332aba011d4" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==3.11.0" }, "python-dateutil": { @@ -1644,7 +1689,9 @@ }, "pyyaml": { "hashes": [ + "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc", + "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df", "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741", "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206", "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27", @@ -1652,7 +1699,10 @@ "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62", "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98", "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696", + "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290", + "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9", "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d", + "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6", "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867", "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47", "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486", @@ -1660,9 +1710,12 @@ "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3", "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007", "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938", + "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0", "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c", "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735", "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d", + "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28", + "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4", "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba", "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8", "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5", @@ -1677,7 +1730,9 @@ "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43", "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859", "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673", + "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54", "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a", + "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b", "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab", "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa", "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c", @@ -1706,11 +1761,11 @@ }, "s3transfer": { "hashes": [ - "sha256:3c0da2d074bf35d6870ef157158641178a4204a6e689e82546083e31e0311346", - "sha256:640bb492711f4c0c0905e1f62b6aaeb771881935ad27884852411f8e9cacbca9" + "sha256:b014be3a8a2aab98cfe1abc7229cc5a9a0cf05eb9c1f2b86b230fd8df3f78084", + "sha256:cab66d3380cca3e70939ef2255d01cd8aece6a4907a9528740f668c4b0611861" ], "markers": "python_version >= '3.7'", - "version": "==0.6.1" + "version": "==0.6.2" }, "six": { "hashes": [ @@ -1737,19 +1792,19 @@ }, "typing-extensions": { "hashes": [ - "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36", - "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2" + "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", + "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef" ], "markers": "python_version < '3.11'", - "version": "==4.7.1" + "version": "==4.8.0" }, "urllib3": { "hashes": [ - "sha256:8d36afa7616d8ab714608411b4a3b13e58f463aee519024578e062e141dce20f", - "sha256:8f135f6502756bde6b2a9b28989df5fbe87c9970cecaa69041edcce7f0589b14" + "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07", + "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==1.26.16" + "version": "==1.26.18" }, "watchdog": { "hashes": [ diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index 8e40b79e4..80873ad10 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -59,7 +59,8 @@ def _get_xls_serialized_file(self, data): "For now please refer to the reports you receive via email") row, col = 2, 0 # write csv header - [worksheet.write(row, col, key) for col, key in enumerate(report_columns)] + bold = workbook.add_format({'bold': True}) + [worksheet.write(row, col, key, bold) for col, key in enumerate(report_columns)] for i in data: row += 1 @@ -67,6 +68,11 @@ def _get_xls_serialized_file(self, data): for key in report_columns: worksheet.write(row, col, i[key]) # writes value by looking up data by key col += 1 + + # autofit all columns except for the first one + worksheet.autofit() + worksheet.set_column(0, 0, 20) + workbook.close() return {"data": data, "xls_report": base64.b64encode(output.getvalue()).decode("utf-8")} From 29fd04c3c23238d9839e05f9c991648181a50fe6 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 20 Oct 2023 06:28:05 -0400 Subject: [PATCH 02/88] Formatted the headers --- tdrs-backend/tdpservice/parsers/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index 80873ad10..a3921a1f3 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -60,7 +60,12 @@ def _get_xls_serialized_file(self, data): row, col = 2, 0 # write csv header bold = workbook.add_format({'bold': True}) - [worksheet.write(row, col, key, bold) for col, key in enumerate(report_columns)] + + def make_header(header_list: list): + """Make header.""" + return ' '.join([i.capitalize() for i in header_list.split('_')]) + + [worksheet.write(row, col, make_header(key), bold) for col, key in enumerate(report_columns)] for i in data: row += 1 From 699245cccaf8d91ca1c5b49916ffbb3ee1339879 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 20 Oct 2023 10:29:14 -0400 Subject: [PATCH 03/88] added year/month to the columns --- tdrs-backend/tdpservice/parsers/views.py | 40 +++++++++++++----------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index a3921a1f3..d9d32fa9f 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -43,14 +43,18 @@ def _get_xls_serialized_file(self, data): workbook = xlsxwriter.Workbook(output) worksheet = workbook.add_worksheet() - report_columns = ['case_number', - 'rpt_month_year', - 'error_type', - 'error_message', - 'item_number', - 'field_name', - 'row_number', - 'column_number'] + report_columns = [ + ('case_number' , lambda x: x['case_number']), + ('year', lambda x: x['rpt_month_year'].split('-')[0] if x['rpt_month_year'] else None), + ('month', lambda x: x['rpt_month_year'].split('-')[1] if x['rpt_month_year'] else None), + ('error_type', lambda x: x['error_type']), + ('error_message', lambda x: x['error_message']), + ('item_number', lambda x: x['item_number']), + ('field_name', lambda x: x['field_name']), + ('row_number', lambda x: x['row_number']), + ('column_number', lambda x: x['column_number']) +] + # write beta banner worksheet.write(row, col, @@ -60,19 +64,17 @@ def _get_xls_serialized_file(self, data): row, col = 2, 0 # write csv header bold = workbook.add_format({'bold': True}) - - def make_header(header_list: list): - """Make header.""" - return ' '.join([i.capitalize() for i in header_list.split('_')]) - [worksheet.write(row, col, make_header(key), bold) for col, key in enumerate(report_columns)] + def format_header(header_list: list): + """Format header.""" + return ' '.join([i.capitalize() for i in header_list.split('_')]) + + [worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)] - for i in data: - row += 1 - col = 0 - for key in report_columns: - worksheet.write(row, col, i[key]) # writes value by looking up data by key - col += 1 + [ + worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns) + for row, data_i in enumerate(data) + ] # autofit all columns except for the first one worksheet.autofit() From 5310946dc02d00433a080b5aa5ae37f33908e52a Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 23 Oct 2023 10:39:51 -0400 Subject: [PATCH 04/88] Added contants - translation column --- tdrs-backend/tdpservice/parsers/constants.py | 169 +++++++++++++++++++ tdrs-backend/tdpservice/parsers/views.py | 10 +- 2 files changed, 175 insertions(+), 4 deletions(-) create mode 100644 tdrs-backend/tdpservice/parsers/constants.py diff --git a/tdrs-backend/tdpservice/parsers/constants.py b/tdrs-backend/tdpservice/parsers/constants.py new file mode 100644 index 000000000..ecbfdc9f4 --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/constants.py @@ -0,0 +1,169 @@ +"""Define constants for the parsers module.""" + +TANF_ITEM_NAME = { + "AID_AGED_BLIND": "Aid to the Aged, Blind, and Disabled", + "AMOUNT_EARNED_INCOME": "Amount of Earned Income", + "AMOUNT_UNEARNED_INCOME": "Amount of Unearned Income", + "AMT_FOOD_STAMP": "Amount of Food Stamps", + "AMT_SUB_CC": "Amount of Subsidized Child Care", + "CC_NBR_MONTHS": "Number of Months of Subsidized Child Care", + "CHILD_SUPPORT_AMT": "Amount of Child Support", + "COMM_SERVICES_EA": "Community Service - excused absence", + "COMM_SERVICES_HOL": "Community Service - holiday", + "COMM_SERVICES_HOP": "Community Service - hours of participation", + "COOPERATION_CHILD_SUPPORT": "Cooperation with Child Support", + "COUNTABLE_MONTHS_STATE": "Countable Months of State Time", + "COUNTABLE_MONTH_FED": "Countable Months of Federal Time", + "COUNTY_FIPS_CODE": "County FIPS Code", + "CURRENT_MONTH_STATE": "Current Month of State Time", + "DATE_OF_BIRTH": "Date of Birth", + "DEEMED_HOURS_FOR": "Deemed Hours for", + "DISABLED_TITLE_XIVAPDT": "Disabled under title XIV-APDT", + "ED_NO_HIGH": "Education - No High School Diploma", + "FAILURE_TO_COMPLY": "Failure to Comply", + "FAMILY_CASH_RESOURCES": "Family Cash Resources", + "FAMILY_EXEMPT_TIME": "Family Exempt Time", + "FAMILY_NEW_CHILD": "Family with a New Child", + "FAMILY_SANC_ADULT": "Family Sanctioned for an Adult", + "FED_DISABILITY_STATUS": "Federal Disability Status", + "FED_OASDI_PROGRAM": "Federal OASDI Program", + "JOB_SEARCH_EA": "Job Search - EA", + "JOB_SEARCH_HOL": "Job Search - HOL", + "JOB_SEARCH_HOP": "Job Search - HOP", + "JOB_SKILLS_TRAINING": "Job Skills Training", + "MONTHS_FED_TIME": "Months of Federal Time", + "MONTHS_STATE_TIME": "Months of State Time", + "NBR_FAMILY_MEMBERS": "Number of Family Members", + "NEEDS_OF_PREGNANT": "", + "NEEDS_PREGNANT_WOMAN": "Needs", + "NON_COOPERATION_CSE": "Non-Cooperation with Child Support Enforcement", + "NUM_ADULT_RECIPIENTS": "Number of Adult Recipients", + "NUM_CHILD_RECIPIENTS": "Number of Child Recipients", + "NUM_CLOSED_CASES": "Number of Closed Cases", + "NUM_NO_PARENTS": "Number of Cases with No Parents", + "NUM_OUTWEDLOCK_BIRTHS": "Number of Out-of-Wedlock Births", + "OTHER_NBR_MONTHS": "Number of Months of Other Time", + "OTHER_NON_SANCTION": "Other Non-Sanction", + "OTHER_TOTAL_REDUCTIONS": "Other Total Reductions", + "OTHER_UNEARNED_INCOME": "Other Unearned Income", + "OTHER_WORK_ACTIVITIES": "Other Work Activities", + "PARENT_MINOR_CHILD": "Parent with a Minor Child", + "PARENT_WITH_MINOR": "Parent with a Minor Child", + "PROVIDE_CC_EA": "Provide Child Care - excused absence", + "PROVIDE_CC_HOL": "Provide Child Care - holiday", + "PROVIDE_CC_HOP": "Provide Child Care - hours of participation", + "RACE_AMER_INDIAN": "Race American Indian", + "RECEIVES_FOOD_STAMPS": "Receives Food Stamps", + "RECEIVES_MED_ASSISTANCE": "Receives Medical Assistance", + "RECEIVES_SUB_CC": "Receives Subsidized Child Care", + "RECEIVES_SUB_HOUSING": "Receives Subsidized Housing", + "RECEIVE_NONSSA_BENEFITS": "Receives Non-SSA Benefits", + "RECOUPMENT_PRIOR_OVRPMT": "Recoupment of Prior Overpayment", + "REC_AID_AGED": "Receives Aid to the Aged", + "REC_AID_TOTALLY": "Receives Aid to the Totally Disabled", + "REC_FEDERAL_DISABILITY": "Receives Federal Disability", + "REC_FOOD_STAMPS": "Receives Food Stamps", + "REC_MED_ASSIST": "Receives Medical Assistance", + "REC_OASDI_INSURANCE": "Receives OASDI Insurance", + "REC_SUB_CC": "Receives Subsidized Child Care", + "REC_SUB_HOUSING": "Receives Subsidized Housing", + "REDUCTIONS_ON_RECEIPTS": "Reductions on Receipts", + "RPT_MONTH_YEAR": "Report Month and Year", + "SANC_REDUCTION_AMT": "Sanction Reduction Amount", + "SANC_TEEN_PARENT": "Sanctioned Teen Parent", + "SCHOOL_ATTENDENCE_EA": "School Attendance - excused absence", + "SCHOOL_ATTENDENCE_HOL": "School Attendance - holiday", + "SCHOOL_ATTENDENCE_HOP": "School Attendance - hours of participation", + "SCHOOL_DIPL_EA": "School Diploma - excused absence", + "SCHOOL_DIPL_HOL": "School Diploma - holiday", + "SCHOOL_DIPL_HOP": "School Diploma - hours of participation", + "SUB_PRIVATE_EMPLOYMENT": "Subsidized Private Employment", + "SUB_PUBLIC_EMPLOYMENT": "Subsidized Public Employment", + "TDRS_SECTION_IND": "TDRS Section Indicator", + "TRANSITION_NBR_MONTHS": "Number of Months of Transition Services", + "TRANSITION_SERVICES_AMOUNT": "Transition Services Amount", + "TRANSP_NBR_MONTHS": "Number of Months of Transportation", + "UNEARNED_INCOME_TAX": "Unearned Income Tax", + "UNEARNED_SOCIAL_SECURITY": "Unearned Social Security", + "UNEARNED_WORKERS_COMP": "Unearned Workers Compensation", + "VOCATIONAL_ED_TRAINING": "Vocational Education Training", + "WAIVER_EVAL_CONTROL": "Waiver Evaluation Control", + "WORK_ELIGIBLE_INDICATOR": "Work Eligible Indicator", + "WORK_EXPERIENCE_EA": "Work Experience - excused absence", + "WORK_EXPERIENCE_HOL": "Work Experience - holiday", + "WORK_EXPERIENCE_HOP": "Work Experience - hours of participation", + "WORK_PART_STATUS": "Work Participation Status", + "WORK_REQ_SANCTION": "Work Requirement Sanction", +} + +SSP_ITEM_NAME = { + "AID_AGED_BLIND": "Aid to the Aged, Blind, and Disabled", + "AMT_FOOD_STAMP": "Amount of Food Stamps", + "AMT_SUB_CC": "Amount of Subsidized Child Care", + "CC_NBR_MONTHS": "Number of Months of Subsidized Child Care", + "CHILD_SUPPORT_AMT": "Amount of Child Support", + "COMM_SERVICES_EA": "Community Service - EA", + "COMM_SERVICES_HOL": "Community Service - HOL", + "COMM_SERVICES_HOP": "Community Service - HOP", + "COOPERATION_CHILD_SUPPORT": "Cooperation with Child Support", + "COUNTY_FIPS_CODE": "County FIPS Code", + "DATE_OF_BIRTH": "Date of Birth", + "DEEMED_HOURS_FOR": "Deemed Hours for", + "DISABLED_TITLE_XIVAPDT": "Disabled Title XIV-A PD/T", + "ED_NO_HIGH": "Education - No High School Diploma", + "FAILURE_TO_COMPLY": "Failure to Comply", + "FAMILY_CASH_RESOURCES": "Family Cash Resources", + "FAMILY_SANC_ADULT": "Family Sanctioned for an Adult", + "FED_DISABILITY_STATUS": "Federal Disability Status", + "FED_OASDI_PROGRAM": "Federal OASDI Program", + "JOB_SEARCH_EA": "Job Search - Excused Absence", + "JOB_SEARCH_HOL": "Job Search - Holiday", + "JOB_SEARCH_HOP": "Job Search - Hours of Participation", + "JOB_SKILLS_TRAINING": "Job Skills Training", + "NBR_FAMILY_MEMBERS": "Number of Family Members", + "NEEDS_PREGNANT_WOMAN": "Needs of a pregnant woman", + "NON_COOPERATION_CSE": "Non-Cooperation with Child Support Enforcement", + "OTHER_NBR_MONTHS": "Number of Months of Other Time", + "OTHER_NON_SANCTION": "Other Non-Sanction", + "OTHER_TOTAL_REDUCTIONS": "Other Total Reductions", + "OTHER_UNEARNED_INCOME": "Other Unearned Income", + "OTHER_WORK_ACTIVITIES": "Other Work Activities", + "PARENT_MINOR_CHILD": "Parent with a Minor Child", + "PROVIDE_CC_EA": "Provide Child Care - excused absence", + "PROVIDE_CC_HOL": "Provide Child Care - holiday", + "PROVIDE_CC_HOP": "Provide Child Care - hours of participation", + "RACE_AMER_INDIAN": "Race Americal Indian", + "RECEIVES_FOOD_STAMPS": "Receives Food Stamps", + "RECEIVES_MED_ASSISTANCE": "Receives Medical Assistance", + "RECEIVES_SUB_CC": "Receives Subsidized Child Care", + "RECEIVES_SUB_HOUSING": "Receives Subsidized Housing", + "RECEIVE_NONSSI_BENEFITS": "Receives Non-SSI Benefits", + "RECOUPMENT_PRIOR_OVRPMT": "Recoupment of Prior Overpayment", + "REDUCTIONS_ON_RECEIPTS": "Reductions on Receipts", + "RPT_MONTH_YEAR": "Report Month and Year", + "SANC_REDUCTION_AMT": "Sanction Reduction Amount", + "SANC_TEEN_PARENT": "Sanctioned Teen Parent", + "SCHOOL_ATTENDENCE_EA": "School Attendance - Excused Absence", + "SCHOOL_ATTENDENCE_HOL": "School Attendance - Holiday", + "SCHOOL_ATTENDENCE_HOP": "School Attendance - Hours of Participation", + "SCHOOL_DIPL_EA": "School Diploma - Excused Absence", + "SCHOOL_DIPL_HOL": "School Diploma - Holiday", + "SCHOOL_DIPL_HOP": "School Diploma - Hours of Participation", + "SUB_PRIVATE_EMPLOYMENT": "Subsidized Private Employment", + "SUB_PUBLIC_EMPLOYMENT": "Subsidized Public Employment", + "TANF_ASST_IN": "TANF Assistance In", + "TRANSITION_NBR_MONTHS": "Number of Months of Transition Services", + "TRANSITION_SERVICES_AMOUNT": "Transition Services Amount", + "TRANSP_NBR_MONTHS": "Number of Months of Transportation", + "UNEARNED_INCOME_TAX": "Unearned Income Tax", + "UNEARNED_SOCIAL_SECURITY": "Unearned Social Security", + "UNEARNED_WORKERS_COMP": "Unearned Workers Compensation", + "VOCATIONAL_ED_TRAINING": "Vocational Education Training", + "WAIVER_EVAL_CONTROL": "Waiver Evaluation Control", + "WORK_ELIGIBLE_INDICATOR": "Work Eligible Indicator", + "WORK_EXPERIENCE_EA": "Work Experience - Excused Absence", + "WORK_EXPERIENCE_HOL": "Work Experience - Holiday", + "WORK_EXPERIENCE_HOP": "Work Experience - Hours of Participation", + "WORK_PART_STATUS": "Work Participation Status", + "WORK_REQ_SANCTION": "Work Requirement Sanction", +} diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index d9d32fa9f..7a525a3b8 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -4,10 +4,12 @@ from rest_framework.response import Response from .serializers import ParsingErrorSerializer, DataFileSummarySerializer from .models import ParserError, DataFileSummary +from .constants import TANF_ITEM_NAME import logging import base64 from io import BytesIO import xlsxwriter +import calendar logger = logging.getLogger() @@ -42,15 +44,15 @@ def _get_xls_serialized_file(self, data): output = BytesIO() workbook = xlsxwriter.Workbook(output) worksheet = workbook.add_worksheet() - report_columns = [ ('case_number' , lambda x: x['case_number']), - ('year', lambda x: x['rpt_month_year'].split('-')[0] if x['rpt_month_year'] else None), - ('month', lambda x: x['rpt_month_year'].split('-')[1] if x['rpt_month_year'] else None), + ('year', lambda x: str(x['rpt_month_year'])[0:4] if x['rpt_month_year'] else None), + ('month', lambda x: calendar.month_name[int(str(x['rpt_month_year'])[4:])] if x['rpt_month_year'] else None), ('error_type', lambda x: x['error_type']), ('error_message', lambda x: x['error_message']), ('item_number', lambda x: x['item_number']), - ('field_name', lambda x: x['field_name']), + ('item_name', lambda x: TANF_ITEM_NAME.get(x['field_name'])), + ('internal_variable_name', lambda x: x['field_name']), ('row_number', lambda x: x['row_number']), ('column_number', lambda x: x['column_number']) ] From 0269728d64d83bf3bc67b22892729c06e418fe44 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 25 Oct 2023 14:32:22 -0400 Subject: [PATCH 05/88] added friendly names to T1 and T2 --- .../tdpservice/parsers/schema_defs/tanf/t1.py | 93 ++++++------ .../tdpservice/parsers/schema_defs/tanf/t2.py | 136 +++++++++--------- 2 files changed, 115 insertions(+), 114 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 546910386..5bd856a5a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -78,186 +78,187 @@ "TRANSP_AMOUNT", "TRANSITION_SERVICES_AMOUNT", "OTHER_AMOUNT"), 0) ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + # add fields inclding friendly_name (based on name), type, start_index, end_index, required, validators + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="4", name='RPT_MONTH_YEAR', friendly_name='reporting month year', type='number', startIndex=2, endIndex=8, required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, + Field(item="2", name='COUNTY_FIPS_CODE', friendly_name='county fips code', type='string', startIndex=19, endIndex=22, required=True, validators=[ validators.isNumber(), ]), - Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, + Field(item="5", name='STRATUM', friendly_name='stratum', type='string', startIndex=22, endIndex=24, required=True, validators=[ validators.isInStringRange(0, 99), ]), - Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, + Field(item="7", name='ZIP_CODE', friendly_name='zip code', type='string', startIndex=24, endIndex=29, required=True, validators=[ validators.isNumber(), ]), - Field(item="8", name='FUNDING_STREAM', type='number', startIndex=29, endIndex=30, + Field(item="8", name='FUNDING_STREAM', friendly_name='funding stream', type='number', startIndex=29, endIndex=30, required=True, validators=[ validators.isInLimits(1, 3), ]), - Field(item="9", name='DISPOSITION', type='number', startIndex=30, endIndex=31, + Field(item="9", name='DISPOSITION', friendly_name='disposition', type='number', startIndex=30, endIndex=31, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="10", name='NEW_APPLICANT', type='number', startIndex=31, endIndex=32, + Field(item="10", name='NEW_APPLICANT', friendly_name='new applicant', type='number', startIndex=31, endIndex=32, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="11", name='NBR_FAMILY_MEMBERS', type='number', startIndex=32, endIndex=34, + Field(item="11", name='NBR_FAMILY_MEMBERS', friendly_name='number of family members', type='number', startIndex=32, endIndex=34, required=True, validators=[ validators.isLargerThan(0), ]), - Field(item="12", name='FAMILY_TYPE', type='number', startIndex=34, endIndex=35, + Field(item="12", name='FAMILY_TYPE', friendly_name='family type', type='number', startIndex=34, endIndex=35, required=True, validators=[ validators.isInLimits(1, 3), ]), - Field(item="13", name='RECEIVES_SUB_HOUSING', type='number', startIndex=35, endIndex=36, + Field(item="13", name='RECEIVES_SUB_HOUSING', friendly_name='receives subsidized housing', type='number', startIndex=35, endIndex=36, required=True, validators=[ validators.isInLimits(1, 3), ]), - Field(item="14", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=36, endIndex=37, + Field(item="14", name='RECEIVES_MED_ASSISTANCE', friendly_name='receives medical assisstance', type='number', startIndex=36, endIndex=37, required=True, validators=[ validators.isInLimits(1, 2), ]), - Field(item="15", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=37, endIndex=38, + Field(item="15", name='RECEIVES_FOOD_STAMPS', friendly_name='receives food stamps', type='number', startIndex=37, endIndex=38, required=True, validators=[ validators.isInLimits(0, 2), ]), - Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=38, endIndex=42, + Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', friendly_name='amount of food stamp assisstance', type='number', startIndex=38, endIndex=42, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="17", name='RECEIVES_SUB_CC', type='number', startIndex=42, endIndex=43, + Field(item="17", name='RECEIVES_SUB_CC', friendly_name='receives subsidized child care', type='number', startIndex=42, endIndex=43, required=True, validators=[ validators.isInLimits(0, 3), ]), - Field(item="18", name='AMT_SUB_CC', type='number', startIndex=43, endIndex=47, + Field(item="18", name='AMT_SUB_CC', friendly_name='amount of subsidized child care', type='number', startIndex=43, endIndex=47, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="19", name='CHILD_SUPPORT_AMT', type='number', startIndex=47, endIndex=51, + Field(item="19", name='CHILD_SUPPORT_AMT', friendly_name='child support amount', type='number', startIndex=47, endIndex=51, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="20", name='FAMILY_CASH_RESOURCES', type='number', startIndex=51, endIndex=55, + Field(item="20", name='FAMILY_CASH_RESOURCES', friendly_name='family cash resources', type='number', startIndex=51, endIndex=55, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="21A", name='CASH_AMOUNT', type='number', startIndex=55, endIndex=59, + Field(item="21A", name='CASH_AMOUNT', friendly_name='cash amount', type='number', startIndex=55, endIndex=59, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="21B", name='NBR_MONTHS', type='number', startIndex=59, endIndex=62, + Field(item="21B", name='NBR_MONTHS', friendly_name='number of months', type='number', startIndex=59, endIndex=62, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="22A", name='CC_AMOUNT', type='number', startIndex=62, endIndex=66, + Field(item="22A", name='CC_AMOUNT', friendly_name='child care amount', type='number', startIndex=62, endIndex=66, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="22B", name='CHILDREN_COVERED', type='number', startIndex=66, endIndex=68, + Field(item="22B", name='CHILDREN_COVERED', friendly_name='children covered', type='number', startIndex=66, endIndex=68, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="22C", name='CC_NBR_MONTHS', type='number', startIndex=68, endIndex=71, + Field(item="22C", name='CC_NBR_MONTHS', friendly_name='child care number of months', type='number', startIndex=68, endIndex=71, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="23A", name='TRANSP_AMOUNT', type='number', startIndex=71, endIndex=75, + Field(item="23A", name='TRANSP_AMOUNT', friendly_name='transportation amount', type='number', startIndex=71, endIndex=75, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="23B", name='TRANSP_NBR_MONTHS', type='number', startIndex=75, endIndex=78, + Field(item="23B", name='TRANSP_NBR_MONTHS', friendly_name='transportation number of months', type='number', startIndex=75, endIndex=78, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=78, endIndex=82, + Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', friendly_name='transition service amount', type='number', startIndex=78, endIndex=82, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="24B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=82, endIndex=85, + Field(item="24B", name='TRANSITION_NBR_MONTHS', friendly_name='transition number of months', type='number', startIndex=82, endIndex=85, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="25A", name='OTHER_AMOUNT', type='number', startIndex=85, endIndex=89, + Field(item="25A", name='OTHER_AMOUNT', friendly_name='other amount', type='number', startIndex=85, endIndex=89, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="25B", name='OTHER_NBR_MONTHS', type='number', startIndex=89, endIndex=92, + Field(item="25B", name='OTHER_NBR_MONTHS', friendly_name='other number of months', type='number', startIndex=89, endIndex=92, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="26AI", name='SANC_REDUCTION_AMT', type='number', startIndex=92, endIndex=96, + Field(item="26AI", name='SANC_REDUCTION_AMT', friendly_name='sanction reduction amount', type='number', startIndex=92, endIndex=96, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="26AII", name='WORK_REQ_SANCTION', type='number', startIndex=96, endIndex=97, + Field(item="26AII", name='WORK_REQ_SANCTION', friendly_name='work requirement sanction', type='number', startIndex=96, endIndex=97, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=97, endIndex=98, + Field(item="26AIII", name='FAMILY_SANC_ADULT', friendly_name='family sanction adult', type='number', startIndex=97, endIndex=98, required=True, validators=[ validators.oneOf([0, 1, 2]), ]), - Field(item="26AIV", name='SANC_TEEN_PARENT', type='number', startIndex=98, endIndex=99, + Field(item="26AIV", name='SANC_TEEN_PARENT', friendly_name='sanction for teen parent not attending school', type='number', startIndex=98, endIndex=99, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26AV", name='NON_COOPERATION_CSE', type='number', startIndex=99, endIndex=100, + Field(item="26AV", name='NON_COOPERATION_CSE', friendly_name='non cooperation case', type='number', startIndex=99, endIndex=100, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=100, endIndex=101, + Field(item="26AVI", name='FAILURE_TO_COMPLY', friendly_name='failure to comply', type='number', startIndex=100, endIndex=101, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26AVII", name='OTHER_SANCTION', type='number', startIndex=101, endIndex=102, + Field(item="26AVII", name='OTHER_SANCTION', friendly_name='other sanction', type='number', startIndex=101, endIndex=102, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=102, endIndex=106, + Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', friendly_name='recoupment of prior overpayment', type='number', startIndex=102, endIndex=106, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=106, endIndex=110, + Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', friendly_name='other total reductions', type='number', startIndex=106, endIndex=110, required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="26CII", name='FAMILY_CAP', type='number', startIndex=110, endIndex=111, + Field(item="26CII", name='FAMILY_CAP', friendly_name='family cap', failure_type='number', startIndex=110, endIndex=111, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=111, endIndex=112, + Field(item="26CIII", name='REDUCTIONS_ON_RECEIPTS', friendly_name='reductions on receipts', type='number', startIndex=111, endIndex=112, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="26CIV", name='OTHER_NON_SANCTION', type='number', startIndex=112, endIndex=113, + Field(item="26CIV", name='OTHER_NON_SANCTION', friendly_name='other non sanction', type='number', startIndex=112, endIndex=113, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', type='string', startIndex=113, endIndex=114, + Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', friendly_name='waiver evaluation experimental and control groups', type='string', startIndex=113, endIndex=114, required=True, validators=[ validators.or_validators(validators.matches('9'), validators.isEmpty()), validators.isAlphaNumeric(), ]), - Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', type='number', startIndex=114, endIndex=116, + Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', friendly_name='is the TANF family exempt from the federal time-limit provisions', type='number', startIndex=114, endIndex=116, required=True, validators=[ validators.oneOf([1, 2, 3, 4, 6, 7, 8, 9]) ]), - Field(item="29", name='FAMILY_NEW_CHILD', type='number', startIndex=116, endIndex=117, + Field(item="29", name='FAMILY_NEW_CHILD', friendly_name='family new child', type='number', startIndex=116, endIndex=117, required=True, validators=[ validators.oneOf([1, 2]), ]), - Field(item="-1", name='BLANK', type='string', startIndex=117, endIndex=156, required=False, + Field(item="-1", name='BLANK', friendly_name='blank', type='string', startIndex=117, endIndex=156, required=False, validators=[]), ], )] diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 74f0b9d52..bda9c86ed 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -92,151 +92,151 @@ ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), - Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + Field(item="30", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, required=True, validators=[validators.oneOf([1, 2, 3, 5])]), - Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, + Field(item="31", name='NONCUSTODIAL_PARENT', friendly_name='noncustodial parent', type='number', startIndex=20, endIndex=21, required=True, validators=[validators.oneOf([1, 2])]), - Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, + Field(item="32", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=21, endIndex=29, required=True, validators=[validators.isLargerThan(0),]), TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, endIndex=38, required=True, validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=True, + Field(item="34A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=38, endIndex=39, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=True, + Field(item="34B", name='RACE_AMER_INDIAN', friendly_name='race americal indian', type='number', startIndex=39, endIndex=40, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=True, + Field(item="34C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=40, endIndex=41, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=True, + Field(item="34D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=41, endIndex=42, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=True, + Field(item="34E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=42, endIndex=43, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=True, + Field(item="34F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=43, endIndex=44, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, + Field(item="35", name='GENDER', friendly_name='gender', type='number', startIndex=44, endIndex=45, required=True, validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, + Field(item="36A", name='FED_OASDI_PROGRAM', friendly_name='fed qasdi program', type='number', startIndex=45, endIndex=46, required=True, validators=[validators.oneOf([1, 2])]), - Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, + Field(item="36B", name='FED_DISABILITY_STATUS', friendly_name='fed disability status', type='number', startIndex=46, endIndex=47, required=True, validators=[validators.oneOf([1, 2])]), - Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, + Field(item="36C", name='DISABLED_TITLE_XIVAPDT', friendly_name='disbaled title xivapdt', type='string', startIndex=47, endIndex=48, required=True, validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), - Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=True, + Field(item="36D", name='AID_AGED_BLIND', friendly_name='aid aged blind', type='number', startIndex=48, endIndex=49, required=True, validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, + Field(item="36E", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=49, endIndex=50, required=True, validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=True, + Field(item="37", name='MARITAL_STATUS', friendly_name='marital status', type='number', startIndex=50, endIndex=51, required=True, validators=[validators.isInLimits(0, 5),]), - Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, + Field(item="38", name='RELATIONSHIP_HOH', friendly_name='relationship to head of household', type='string', startIndex=51, endIndex=53, required=True, validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=True, + Field(item="39", name='PARENT_WITH_MINOR_CHILD', friendly_name='parent with minor child', type='number', startIndex=53, endIndex=54, required=True, validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=True, + Field(item="40", name='NEEDS_PREGNANT_WOMAN', friendly_name='needs of pregnant woman', type='number', startIndex=54, endIndex=55, required=True, validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=True, + Field(item="41", name='EDUCATION_LEVEL', friendly_name='education level', type='string', startIndex=55, endIndex=57, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 16), validators.isInStringRange(98, 99) )]), - Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=True, + Field(item="42", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=57, endIndex=58, required=True, validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, required=True, + Field(item="43", name='COOPERATION_CHILD_SUPPORT', friendly_name='coopeartion with child support', type='number', startIndex=58, endIndex=59, required=True, validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=True, + Field(item="44", name='MONTHS_FED_TIME_LIMIT', friendly_name='number of months countable toward federal time limit', type='string', startIndex=59, endIndex=62, required=True, validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=True, + Field(item="45", name='MONTHS_STATE_TIME_LIMIT', friendly_name='months of state time limit', type='string', startIndex=62, endIndex=64, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, + Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', friendly_name='is current month exempt from the state time limit', type='number', startIndex=64, endIndex=65, required=True, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=True, + Field(item="47", name='EMPLOYMENT_STATUS', friendly_name='employment status', type='number', startIndex=65, endIndex=66, required=True, validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', startIndex=66, endIndex=68, required=True, + Field(item="48", name='WORK_ELIGIBLE_INDICATOR', friendly_name='work-eligible indivdual indicator', type='string', startIndex=66, endIndex=68, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 9), validators.oneOf(('11', '12')) )]), - Field(item="49", name='WORK_PART_STATUS', type='string', startIndex=68, endIndex=70, required=True, + Field(item="49", name='WORK_PART_STATUS', friendly_name='work participation status', type='string', startIndex=68, endIndex=70, required=True, validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), - Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=True, + Field(item="50", name='UNSUB_EMPLOYMENT', friendly_name='employement status', type='string', startIndex=70, endIndex=72, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=True, + Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', friendly_name='subsidized private employment', type='string', startIndex=72, endIndex=74, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=74, endIndex=76, required=True, + Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', friendly_name='subsidized public employment', type='string', startIndex=74, endIndex=76, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', startIndex=76, endIndex=78, required=True, + Field(item="53A", name='WORK_EXPERIENCE_HOP', friendly_name='work experience - hours of participation', type='string', startIndex=76, endIndex=78, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', startIndex=78, endIndex=80, required=True, + Field(item="53B", name='WORK_EXPERIENCE_EA', friendly_name='work experience - excused absence', type='string', startIndex=78, endIndex=80, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', startIndex=80, endIndex=82, required=True, + Field(item="53C", name='WORK_EXPERIENCE_HOL', friendly_name='work experience - holiday', type='string', startIndex=80, endIndex=82, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=True, validators=[ + Field(item="54", name='OJT', friendly_name='on the job training', type='string', startIndex=82, endIndex=84, required=True, validators=[ validators.isInStringRange(0, 99), ]), - Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=True, + Field(item="55A", name='JOB_SEARCH_HOP', friendly_name='job search - hours of operation', type='string', startIndex=84, endIndex=86, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, required=True, + Field(item="55B", name='JOB_SEARCH_EA', friendly_name='job search - exceused absense', type='string', startIndex=86, endIndex=88, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, required=True, + Field(item="55C", name='JOB_SEARCH_HOL', friendly_name='job search - holiday', type='string', startIndex=88, endIndex=90, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, required=True, + Field(item="56A", name='COMM_SERVICES_HOP', friendly_name='community service - hours of operation', type='string', startIndex=90, endIndex=92, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, required=True, + Field(item="56B", name='COMM_SERVICES_EA', friendly_name='community service - excused absense', type='string', startIndex=92, endIndex=94, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, required=True, + Field(item="56C", name='COMM_SERVICES_HOL', friendly_name='community service - holiday', type='string', startIndex=94, endIndex=96, required=True, validators=[validators.isInStringRange(0, 99),]), - Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, + Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', friendly_name='vocational education training - hours of operation', type='string', startIndex=96, endIndex=98, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, + Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', friendly_name='vocational education - exceused absense', type='string', startIndex=98, endIndex=100, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, + Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', friendly_name='vocational education training - holiday', type='string', startIndex=100, endIndex=102, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, + Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', friendly_name='job skills training - hours of participation', type='string', startIndex=102, endIndex=104, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, + Field(item="58B", name='JOB_SKILLS_TRAINING_EA', friendly_name='job skills training - excused absense', type='string', startIndex=104, endIndex=106, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, + Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', friendly_name='job skills training holiday', type='string', startIndex=106, endIndex=108, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, + Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', friendly_name='education no high school diploma - hours of operation', type='string', startIndex=108, endIndex=110, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, + Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', friendly_name='education no high school diploma - excused absense', type='string', startIndex=110, endIndex=112, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, + Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', friendly_name='education no high school diploma - holiday', type='string', startIndex=112, endIndex=114, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, + Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', friendly_name='school attendance - hours of participation', type='string', startIndex=114, endIndex=116, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, + Field(item="60B", name='SCHOOL_ATTENDENCE_EA', friendly_name='school attendance - exceused absense', type='string', startIndex=116, endIndex=118, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, + Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', friendly_name='school attendance - holiday', type='string', startIndex=118, endIndex=120, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, + Field(item="61A", name='PROVIDE_CC_HOP', friendly_name='provide child care - hours of participation', type='string', startIndex=120, endIndex=122, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, + Field(item="61B", name='PROVIDE_CC_EA', friendly_name='provide child care - excused absense', type='string', startIndex=122, endIndex=124, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, + Field(item="61C", name='PROVIDE_CC_HOL', friendly_name='provide child care - holiday', type='string', startIndex=124, endIndex=126, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, + Field(item="62", name='OTHER_WORK_ACTIVITIES', friendly_name='other work activities', type='string', startIndex=126, endIndex=128, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, + Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', friendly_name='number of deemed core hours for overall rate', type='string', startIndex=128, endIndex=130, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, + Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', friendly_name='number of deemed core hours for two-parent rate', type='string', startIndex=130, endIndex=132, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, + Field(item="65", name='EARNED_INCOME', friendly_name='earned income', type='string', startIndex=132, endIndex=136, required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, + Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', friendly_name='unearned income tax credit', type='string', startIndex=136, endIndex=140, required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, + Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', friendly_name='unearned social security', type='string', startIndex=140, endIndex=144, required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=False, + Field(item="66C", name='UNEARNED_SSI', friendly_name='unearned SSI', type='string', startIndex=144, endIndex=148, required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=148, endIndex=152, required=False, + Field(item="66D", name='UNEARNED_WORKERS_COMP', friendly_name='unearned workers compensation', type='string', startIndex=148, endIndex=152, required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=152, endIndex=156, required=False, + Field(item="66E", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='string', startIndex=152, endIndex=156, required=False, validators=[validators.isInStringRange(0, 9999),]), ], )] From ac120a6bb3ca92eaeffed73c831b18c8d1b7f8f8 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 26 Oct 2023 10:24:35 -0400 Subject: [PATCH 06/88] added friendly name to m1 and m2 --- .../tdpservice/parsers/schema_defs/ssp/m1.py | 86 ++++++------ .../tdpservice/parsers/schema_defs/ssp/m2.py | 132 +++++++++--------- 2 files changed, 109 insertions(+), 109 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 7d907dfd4..77eba6458 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -16,91 +16,91 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="3", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, + Field(item="2", name='COUNTY_FIPS_CODE', friendly_name='county fips code', type='string', startIndex=19, endIndex=22, required=True, validators=[]), - Field(item="4", name='STRATUM', type='string', startIndex=22, endIndex=24, + Field(item="4", name='STRATUM', friendly_name='stratum', type='string', startIndex=22, endIndex=24, required=True, validators=[]), - Field(item="6", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, + Field(item="6", name='ZIP_CODE', friendly_name='zip code', type='string', startIndex=24, endIndex=29, required=True, validators=[]), - Field(item="7", name='DISPOSITION', type='number', startIndex=29, endIndex=30, + Field(item="7", name='DISPOSITION', friendly_name='disposition', type='number', startIndex=29, endIndex=30, required=True, validators=[]), - Field(item="8", name='NBR_FAMILY_MEMBERS', type='number', startIndex=30, endIndex=32, + Field(item="8", name='NBR_FAMILY_MEMBERS', friendly_name='number of family numbers', type='number', startIndex=30, endIndex=32, required=True, validators=[]), - Field(item="9", name='FAMILY_TYPE', type='number', startIndex=32, endIndex=33, + Field(item="9", name='FAMILY_TYPE', friendly_name='family type', type='number', startIndex=32, endIndex=33, required=True, validators=[]), - Field(item="10", name='TANF_ASST_IN_6MONTHS', type='number', startIndex=33, endIndex=34, + Field(item="10", name='TANF_ASST_IN_6MONTHS', friendly_name='tanf assitance in 6 months', type='number', startIndex=33, endIndex=34, required=True, validators=[]), - Field(item="11", name='RECEIVES_SUB_HOUSING', type='number', startIndex=34, endIndex=35, + Field(item="11", name='RECEIVES_SUB_HOUSING', friendly_name='receives subsidized housing', type='number', startIndex=34, endIndex=35, required=True, validators=[]), - Field(item="12", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=35, endIndex=36, + Field(item="12", name='RECEIVES_MED_ASSISTANCE', friendly_name='receives medical assisstance', type='number', startIndex=35, endIndex=36, required=True, validators=[]), - Field(item="13", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=36, endIndex=37, + Field(item="13", name='RECEIVES_FOOD_STAMPS', friendly_name='receives food assisstance', type='number', startIndex=36, endIndex=37, required=True, validators=[]), - Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=37, endIndex=41, + Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', friendly_name='aount of food stamp assisstance', type='number', startIndex=37, endIndex=41, required=True, validators=[]), - Field(item="15", name='RECEIVES_SUB_CC', type='number', startIndex=41, endIndex=42, + Field(item="15", name='RECEIVES_SUB_CC', friendly_name='receives subsidized child care', type='number', startIndex=41, endIndex=42, required=True, validators=[]), - Field(item="16", name='AMT_SUB_CC', type='number', startIndex=42, endIndex=46, + Field(item="16", name='AMT_SUB_CC', friendly_name='amount of subsidized child care', type='number', startIndex=42, endIndex=46, required=True, validators=[]), - Field(item="17", name='CHILD_SUPPORT_AMT', type='number', startIndex=46, endIndex=50, + Field(item="17", name='CHILD_SUPPORT_AMT', friendly_name='child support amount', type='number', startIndex=46, endIndex=50, required=True, validators=[]), - Field(item="18", name='FAMILY_CASH_RESOURCES', type='number', startIndex=50, endIndex=54, + Field(item="18", name='FAMILY_CASH_RESOURCES', friendly_name='family cash resources', type='number', startIndex=50, endIndex=54, required=True, validators=[]), - Field(item="19A", name='CASH_AMOUNT', type='number', startIndex=54, endIndex=58, + Field(item="19A", name='CASH_AMOUNT', friendly_name='cash amount', type='number', startIndex=54, endIndex=58, required=True, validators=[]), - Field(item="19B", name='NBR_MONTHS', type='number', startIndex=58, endIndex=61, + Field(item="19B", name='NBR_MONTHS', friendly_name='number of months', type='number', startIndex=58, endIndex=61, required=True, validators=[]), - Field(item="20A", name='CC_AMOUNT', type='number', startIndex=61, endIndex=65, + Field(item="20A", name='CC_AMOUNT', friendly_name='child care amount', type='number', startIndex=61, endIndex=65, required=True, validators=[]), - Field(item="20B", name='CHILDREN_COVERED', type='number', startIndex=65, endIndex=67, + Field(item="20B", name='CHILDREN_COVERED', friendly_name='children covered', type='number', startIndex=65, endIndex=67, required=True, validators=[]), - Field(item="20C", name='CC_NBR_MONTHS', type='number', startIndex=67, endIndex=70, + Field(item="20C", name='CC_NBR_MONTHS', friendly_name='child care - number of months', type='number', startIndex=67, endIndex=70, required=True, validators=[]), - Field(item="21A", name='TRANSP_AMOUNT', type='number', startIndex=70, endIndex=74, + Field(item="21A", name='TRANSP_AMOUNT', friendly_name='transportation amount', type='number', startIndex=70, endIndex=74, required=True, validators=[]), - Field(item="21B", name='TRANSP_NBR_MONTHS', type='number', startIndex=74, endIndex=77, + Field(item="21B", name='TRANSP_NBR_MONTHS', friendly_name='transmportation number of months', type='number', startIndex=74, endIndex=77, required=True, validators=[]), - Field(item="22A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=77, endIndex=81, + Field(item="22A", name='TRANSITION_SERVICES_AMOUNT', friendly_name='transition services amount', type='number', startIndex=77, endIndex=81, required=True, validators=[]), - Field(item="22B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=81, endIndex=84, + Field(item="22B", name='TRANSITION_NBR_MONTHS', friendly_name='transition number of months', type='number', startIndex=81, endIndex=84, required=True, validators=[]), - Field(item="23A", name='OTHER_AMOUNT', type='number', startIndex=84, endIndex=88, + Field(item="23A", name='OTHER_AMOUNT', friendly_name='other amount', type='number', startIndex=84, endIndex=88, required=True, validators=[]), - Field(item="23B", name='OTHER_NBR_MONTHS', type='number', startIndex=88, endIndex=91, + Field(item="23B", name='OTHER_NBR_MONTHS', friendly_name='other nuber of months', type='number', startIndex=88, endIndex=91, required=True, validators=[]), - Field(item="24AI", name='SANC_REDUCTION_AMT', type='number', startIndex=91, endIndex=95, + Field(item="24AI", name='SANC_REDUCTION_AMT', friendly_name='sanction reduction amount', type='number', startIndex=91, endIndex=95, required=True, validators=[]), - Field(item="24AII", name='WORK_REQ_SANCTION', type='number', startIndex=95, endIndex=96, + Field(item="24AII", name='WORK_REQ_SANCTION', friendly_name='work requirements sanction', type='number', startIndex=95, endIndex=96, required=True, validators=[]), - Field(item="24AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=96, endIndex=97, + Field(item="24AIII", name='FAMILY_SANC_ADULT', friendly_name='family sanction for adult', type='number', startIndex=96, endIndex=97, required=True, validators=[]), - Field(item="24AIV", name='SANC_TEEN_PARENT', type='number', startIndex=97, endIndex=98, + Field(item="24AIV", name='SANC_TEEN_PARENT', friendly_name='santion for teen parent', type='number', startIndex=97, endIndex=98, required=True, validators=[]), - Field(item="24AV", name='NON_COOPERATION_CSE', type='number', startIndex=98, endIndex=99, + Field(item="24AV", name='NON_COOPERATION_CSE', friendly_name='non coopeartion case', type='number', startIndex=98, endIndex=99, required=True, validators=[]), - Field(item="24AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=99, endIndex=100, + Field(item="24AVI", name='FAILURE_TO_COMPLY', friendly_name='failure to comply', type='number', startIndex=99, endIndex=100, required=True, validators=[]), - Field(item="24AVII", name='OTHER_SANCTION', type='number', startIndex=100, endIndex=101, + Field(item="24AVII", name='OTHER_SANCTION', friendly_name='other sanciton', type='number', startIndex=100, endIndex=101, required=True, validators=[]), - Field(item="24B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=101, endIndex=105, + Field(item="24B", name='RECOUPMENT_PRIOR_OVRPMT', friendly_name='recoupment prior overpayment', type='number', startIndex=101, endIndex=105, required=True, validators=[]), - Field(item="24CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=105, endIndex=109, + Field(item="24CI", name='OTHER_TOTAL_REDUCTIONS', friendly_name='other total reductions', type='number', startIndex=105, endIndex=109, required=True, validators=[]), - Field(item="24CII", name='FAMILY_CAP', type='number', startIndex=109, endIndex=110, + Field(item="24CII", name='FAMILY_CAP', friendly_name='family cap', type='number', startIndex=109, endIndex=110, required=True, validators=[]), - Field(item="24CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=110, endIndex=111, + Field(item="24CIII", name='REDUCTIONS_ON_RECEIPTS', friendly_name='reductions on receipts', type='number', startIndex=110, endIndex=111, required=True, validators=[]), - Field(item="24CIV", name='OTHER_NON_SANCTION', type='number', startIndex=111, endIndex=112, + Field(item="24CIV", name='OTHER_NON_SANCTION', friendly_name='other non santion', type='number', startIndex=111, endIndex=112, required=True, validators=[]), - Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', type='number', startIndex=112, endIndex=113, + Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', friendly_name='waiver evaluation xperimental and control groups', type='number', startIndex=112, endIndex=113, required=True, validators=[]), - Field(item="-1", name='BLANK', type='string', startIndex=113, endIndex=150, + Field(item="-1", name='BLANK', friendly_name='blank', type='string', startIndex=113, endIndex=150, required=False, validators=[]), ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index 0b1b06379..0a22675a8 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -18,137 +18,137 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="3", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[]), - Field(item="26", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + Field(item="26", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, required=True, validators=[]), - Field(item="27", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, + Field(item="27", name='NONCUSTODIAL_PARENT', friendly_name='noncustodial parent', type='number', startIndex=20, endIndex=21, required=True, validators=[]), - Field(item="28", name='DATE_OF_BIRTH', type='string', startIndex=21, endIndex=29, + Field(item="28", name='DATE_OF_BIRTH', friendly_name='date of birth', type='string', startIndex=21, endIndex=29, required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', type='string', + TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=29, endIndex=38, required=True, validators=[], is_encrypted=False), - Field(item="30A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=True, + Field(item="30A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=38, endIndex=39, required=True, validators=[]), - Field(item="30B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, + Field(item="30B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=39, endIndex=40, required=True, validators=[]), - Field(item="30C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, + Field(item="30C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=40, endIndex=41, required=True, validators=[]), - Field(item="30D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, + Field(item="30D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=41, endIndex=42, required=True, validators=[]), - Field(item="30E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, + Field(item="30E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=42, endIndex=43, required=True, validators=[]), - Field(item="30F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, + Field(item="30F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=43, endIndex=44, required=True, validators=[]), - Field(item="31", name='GENDER', type='number', startIndex=44, endIndex=45, + Field(item="31", name='GENDER', friendly_name='gender', type='number', startIndex=44, endIndex=45, required=True, validators=[]), - Field(item="32A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, + Field(item="32A", name='FED_OASDI_PROGRAM', friendly_name='federal qasdi program', type='number', startIndex=45, endIndex=46, required=True, validators=[]), - Field(item="32B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, + Field(item="32B", name='FED_DISABILITY_STATUS', friendly_name='federal disability status', type='number', startIndex=46, endIndex=47, required=True, validators=[]), - Field(item="32C", name='DISABLED_TITLE_XIVAPDT', type='number', startIndex=47, endIndex=48, + Field(item="32C", name='DISABLED_TITLE_XIVAPDT', friendly_name='disabled title xivapdt', type='number', startIndex=47, endIndex=48, required=True, validators=[]), - Field(item="32D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, + Field(item="32D", name='AID_AGED_BLIND', friendly_name='receives aid to the aid aged blind', type='number', startIndex=48, endIndex=49, required=True, validators=[]), - Field(item="32E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, + Field(item="32E", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=49, endIndex=50, required=True, validators=[]), - Field(item="33", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, + Field(item="33", name='MARITAL_STATUS', friendly_name='marital status', type='number', startIndex=50, endIndex=51, required=True, validators=[]), - Field(item="34", name='RELATIONSHIP_HOH', type='number', startIndex=51, endIndex=53, + Field(item="34", name='RELATIONSHIP_HOH', friendly_name='relationship to head of household', type='number', startIndex=51, endIndex=53, required=True, validators=[]), - Field(item="35", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, + Field(item="35", name='PARENT_MINOR_CHILD', friendly_name='parent of minor child', type='number', startIndex=53, endIndex=54, required=True, validators=[]), - Field(item="36", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, + Field(item="36", name='NEEDS_PREGNANT_WOMAN', friendly_name='needs of pregnant woman', type='number', startIndex=54, endIndex=55, required=True, validators=[]), - Field(item="37", name='EDUCATION_LEVEL', type='number', startIndex=55, endIndex=57, + Field(item="37", name='EDUCATION_LEVEL', friendly_name='education level', type='number', startIndex=55, endIndex=57, required=True, validators=[]), - Field(item="38", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, + Field(item="38", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=57, endIndex=58, required=True, validators=[]), - Field(item="39", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, + Field(item="39", name='COOPERATION_CHILD_SUPPORT', friendly_name='cooperation child support', type='number', startIndex=58, endIndex=59, required=True, validators=[]), - Field(item="40", name='EMPLOYMENT_STATUS', type='number', startIndex=59, endIndex=60, + Field(item="40", name='EMPLOYMENT_STATUS', frinedly_name='employment status', type='number', startIndex=59, endIndex=60, required=True, validators=[]), - Field(item="41", name='WORK_ELIGIBLE_INDICATOR', type='number', startIndex=60, endIndex=62, + Field(item="41", name='WORK_ELIGIBLE_INDICATOR', friendly_name='work eligible indicator', type='number', startIndex=60, endIndex=62, required=True, validators=[]), - Field(item="42", name='WORK_PART_STATUS', type='number', startIndex=62, endIndex=64, + Field(item="42", name='WORK_PART_STATUS', friendly_name='work part-time status', type='number', startIndex=62, endIndex=64, required=True, validators=[]), - Field(item="43", name='UNSUB_EMPLOYMENT', type='number', startIndex=64, endIndex=66, + Field(item="43", name='UNSUB_EMPLOYMENT', friendly_name='unsubsidized employment', type='number', startIndex=64, endIndex=66, required=True, validators=[]), - Field(item="44", name='SUB_PRIVATE_EMPLOYMENT', type='number', startIndex=66, endIndex=68, + Field(item="44", name='SUB_PRIVATE_EMPLOYMENT', friendly_name='subsidized private employment', type='number', startIndex=66, endIndex=68, required=True, validators=[]), - Field(item="45", name='SUB_PUBLIC_EMPLOYMENT', type='number', startIndex=68, endIndex=70, + Field(item="45", name='SUB_PUBLIC_EMPLOYMENT', friendly_name='subsidized public employment', type='number', startIndex=68, endIndex=70, required=True, validators=[]), - Field(item="46A", name='WORK_EXPERIENCE_HOP', type='number', startIndex=70, endIndex=72, + Field(item="46A", name='WORK_EXPERIENCE_HOP', friendly_name='work experience - hours of participation', type='number', startIndex=70, endIndex=72, required=True, validators=[]), - Field(item="46B", name='WORK_EXPERIENCE_EA', type='number', startIndex=72, endIndex=74, + Field(item="46B", name='WORK_EXPERIENCE_EA', friendly_name='work experience - excused absense', type='number', startIndex=72, endIndex=74, required=True, validators=[]), - Field(item="46C", name='WORK_EXPERIENCE_HOL', type='number', startIndex=74, endIndex=76, + Field(item="46C", name='WORK_EXPERIENCE_HOL', friendly_name='work experience holiday', type='number', startIndex=74, endIndex=76, required=True, validators=[]), - Field(item="47", name='OJT', type='number', startIndex=76, endIndex=78, + Field(item="47", name='OJT', friendly_name='OJT', type='number', startIndex=76, endIndex=78, required=True, validators=[]), - Field(item="48A", name='JOB_SEARCH_HOP', type='number', startIndex=78, endIndex=80, + Field(item="48A", name='JOB_SEARCH_HOP', friendly_name='job search - hours of participation', type='number', startIndex=78, endIndex=80, required=True, validators=[]), - Field(item="48B", name='JOB_SEARCH_EA', type='number', startIndex=80, endIndex=82, + Field(item="48B", name='JOB_SEARCH_EA', friendly_name='job search - excused absence', type='number', startIndex=80, endIndex=82, required=True, validators=[]), - Field(item="48C", name='JOB_SEARCH_HOL', type='number', startIndex=82, endIndex=84, + Field(item="48C", name='JOB_SEARCH_HOL', friendly_name='job search - holiday', type='number', startIndex=82, endIndex=84, required=True, validators=[]), - Field(item="49A", name='COMM_SERVICES_HOP', type='number', startIndex=84, endIndex=86, + Field(item="49A", name='COMM_SERVICES_HOP', friendly_name='community services - hours of participation', type='number', startIndex=84, endIndex=86, required=True, validators=[]), - Field(item="49B", name='COMM_SERVICES_EA', type='number', startIndex=86, endIndex=88, + Field(item="49B", name='COMM_SERVICES_EA', friendly_name='community services - excused absence', type='number', startIndex=86, endIndex=88, required=True, validators=[]), - Field(item="49C", name='COMM_SERVICES_HOL', type='number', startIndex=88, endIndex=90, + Field(item="49C", name='COMM_SERVICES_HOL', friendly_name='community services - holiday', type='number', startIndex=88, endIndex=90, required=True, validators=[]), - Field(item="50A", name='VOCATIONAL_ED_TRAINING_HOP', type='number', startIndex=90, endIndex=92, + Field(item="50A", name='VOCATIONAL_ED_TRAINING_HOP', friendly_name='vocational education training - hours of operation', type='number', startIndex=90, endIndex=92, required=True, validators=[]), - Field(item="50B", name='VOCATIONAL_ED_TRAINING_EA', type='number', startIndex=92, endIndex=94, + Field(item="50B", name='VOCATIONAL_ED_TRAINING_EA', friendly_name='vocational education training - excused absence', type='number', startIndex=92, endIndex=94, required=True, validators=[]), - Field(item="50C", name='VOCATIONAL_ED_TRAINING_HOL', type='number', startIndex=94, endIndex=96, + Field(item="50C", name='VOCATIONAL_ED_TRAINING_HOL', friendly_name='vocational education training - holiday', type='number', startIndex=94, endIndex=96, required=True, validators=[]), - Field(item="51A", name='JOB_SKILLS_TRAINING_HOP', type='number', startIndex=96, endIndex=98, + Field(item="51A", name='JOB_SKILLS_TRAINING_HOP', friendly_name='job skills training - hours of operation', type='number', startIndex=96, endIndex=98, required=True, validators=[]), - Field(item="51B", name='JOB_SKILLS_TRAINING_EA', type='number', startIndex=98, endIndex=100, + Field(item="51B", name='JOB_SKILLS_TRAINING_EA', friendly_name='job skills training - excused absence', type='number', startIndex=98, endIndex=100, required=True, validators=[]), - Field(item="51C", name='JOB_SKILLS_TRAINING_HOL', type='number', startIndex=100, endIndex=102, + Field(item="51C", name='JOB_SKILLS_TRAINING_HOL', friendly_name='job skills training - holiday', type='number', startIndex=100, endIndex=102, required=True, validators=[]), - Field(item="52A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='number', startIndex=102, endIndex=104, + Field(item="52A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', friendly_name='education no high school diploma - hours of participation', type='number', startIndex=102, endIndex=104, required=True, validators=[]), - Field(item="52B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='number', startIndex=104, endIndex=106, + Field(item="52B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', friendly_name='education no high school diploma - excused absence', type='number', startIndex=104, endIndex=106, required=True, validators=[]), - Field(item="52C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='number', startIndex=106, endIndex=108, + Field(item="52C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', friendly_name='education no high school diploma - holiday', type='number', startIndex=106, endIndex=108, required=True, validators=[]), - Field(item="53A", name='SCHOOL_ATTENDENCE_HOP', type='number', startIndex=108, endIndex=110, + Field(item="53A", name='SCHOOL_ATTENDENCE_HOP', friendly_name='school attendance - hours of participation', type='number', startIndex=108, endIndex=110, required=True, validators=[]), - Field(item="53B", name='SCHOOL_ATTENDENCE_EA', type='number', startIndex=110, endIndex=112, + Field(item="53B", name='SCHOOL_ATTENDENCE_EA', friendly_name='school attendance - excused absence', type='number', startIndex=110, endIndex=112, required=True, validators=[]), - Field(item="53C", name='SCHOOL_ATTENDENCE_HOL', type='number', startIndex=112, endIndex=114, + Field(item="53C", name='SCHOOL_ATTENDENCE_HOL', friendly_name='school attendance - holiday', type='number', startIndex=112, endIndex=114, required=True, validators=[]), - Field(item="54A", name='PROVIDE_CC_HOP', type='number', startIndex=114, endIndex=116, + Field(item="54A", name='PROVIDE_CC_HOP', friend_name='provide child care - hours of participation', type='number', startIndex=114, endIndex=116, required=True, validators=[]), - Field(item="54B", name='PROVIDE_CC_EA', type='number', startIndex=116, endIndex=118, + Field(item="54B", name='PROVIDE_CC_EA', friendly_name='provide child care - excused absence', type='number', startIndex=116, endIndex=118, required=True, validators=[]), - Field(item="54C", name='PROVIDE_CC_HOL', type='number', startIndex=118, endIndex=120, + Field(item="54C", name='PROVIDE_CC_HOL', friendly_name='provide child care - holiday', type='number', startIndex=118, endIndex=120, required=True, validators=[]), - Field(item="55", name='OTHER_WORK_ACTIVITIES', type='number', startIndex=120, endIndex=122, + Field(item="55", name='OTHER_WORK_ACTIVITIES', friendly_name='other work activities', type='number', startIndex=120, endIndex=122, required=True, validators=[]), - Field(item="56", name='DEEMED_HOURS_FOR_OVERALL', type='number', startIndex=122, endIndex=124, + Field(item="56", name='DEEMED_HOURS_FOR_OVERALL', friendly_name='deemed hours for overall', type='number', startIndex=122, endIndex=124, required=True, validators=[]), - Field(item="57", name='DEEMED_HOURS_FOR_TWO_PARENT', type='number', startIndex=124, endIndex=126, + Field(item="57", name='DEEMED_HOURS_FOR_TWO_PARENT', friendly_name='deemed hours for two parents', type='number', startIndex=124, endIndex=126, required=True, validators=[]), - Field(item="58", name='EARNED_INCOME', type='number', startIndex=126, endIndex=130, + Field(item="58", name='EARNED_INCOME', type='number', friendly_name='earned income', startIndex=126, endIndex=130, required=True, validators=[]), - Field(item="59A", name='UNEARNED_INCOME_TAX_CREDIT', type='number', startIndex=130, endIndex=134, + Field(item="59A", name='UNEARNED_INCOME_TAX_CREDIT', friendly_name='unearned income tax credit', type='number', startIndex=130, endIndex=134, required=True, validators=[]), - Field(item="59B", name='UNEARNED_SOCIAL_SECURITY', type='number', startIndex=134, endIndex=138, + Field(item="59B", name='UNEARNED_SOCIAL_SECURITY', friendly_name='unearned social security', type='number', startIndex=134, endIndex=138, required=True, validators=[]), - Field(item="59C", name='UNEARNED_SSI', type='number', startIndex=138, endIndex=142, + Field(item="59C", name='UNEARNED_SSI', friendly_name='unearned SSI benefit', type='number', startIndex=138, endIndex=142, required=True, validators=[]), - Field(item="59D", name='UNEARNED_WORKERS_COMP', type='number', startIndex=142, endIndex=146, + Field(item="59D", name='UNEARNED_WORKERS_COMP', friendly_name='unearned workers compensation', type='number', startIndex=142, endIndex=146, required=True, validators=[]), - Field(item="59E", name='OTHER_UNEARNED_INCOME', type='number', startIndex=146, endIndex=150, + Field(item="59E", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='number', startIndex=146, endIndex=150, required=True, validators=[]), ], ) From a7c12072ec56cf99b354f089ebce9ed1c64d3b32 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 26 Oct 2023 11:27:03 -0400 Subject: [PATCH 07/88] added friendly name to m3 --- .../tdpservice/parsers/schema_defs/ssp/m3.py | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index 301e1b03e..7811bb066 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -15,47 +15,47 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="3", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[]), - Field(item="60", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + Field(item="60", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, required=True, validators=[]), - Field(item="61", name='DATE_OF_BIRTH', type='string', startIndex=20, endIndex=28, + Field(item="61", name='DATE_OF_BIRTH', friendly_name='date of birth', type='string', startIndex=20, endIndex=28, required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=28, + TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=28, endIndex=37, required=True, validators=[], is_encrypted=False), - Field(item="63A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, + Field(item="63A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=37, endIndex=38, required=True, validators=[]), - Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, + Field(item="63B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=38, endIndex=39, required=True, validators=[]), - Field(item="63C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, + Field(item="63C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=39, endIndex=40, required=True, validators=[]), - Field(item="63D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, + Field(item="63D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=40, endIndex=41, required=True, validators=[]), - Field(item="63E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, + Field(item="63E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=41, endIndex=42, required=True, validators=[]), - Field(item="63F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, + Field(item="63F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=42, endIndex=43, required=True, validators=[]), - Field(item="64", name='GENDER', type='number', startIndex=43, endIndex=44, + Field(item="64", name='GENDER', friendly_name='gender', type='number', startIndex=43, endIndex=44, required=True, validators=[]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=44, endIndex=45, + Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', friendly_name='receive nonssi benefits', type='number', startIndex=44, endIndex=45, required=True, validators=[]), - Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, + Field(item="65B", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=45, endIndex=46, required=True, validators=[]), - Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=46, endIndex=48, + Field(item="66", name='RELATIONSHIP_HOH', friendly_name='relationship - ', type='number', startIndex=46, endIndex=48, required=True, validators=[]), - Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, + Field(item="67", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=48, endIndex=49, required=True, validators=[]), - Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=49, endIndex=51, + Field(item="68", name='EDUCATION_LEVEL', friendly_name='education level', type='number', startIndex=49, endIndex=51, required=True, validators=[]), - Field(item="69", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, + Field(item="69", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=51, endIndex=52, required=True, validators=[]), - Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=52, endIndex=56, + Field(item="70A", name='UNEARNED_SSI', friendly_name='unearned SSI', type='number', startIndex=52, endIndex=56, required=True, validators=[]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=56, endIndex=60, + Field(item="70B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='number', startIndex=56, endIndex=60, required=True, validators=[]) ] ) @@ -68,47 +68,47 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="3", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[]), - Field(item="60", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, + Field(item="60", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=60, endIndex=61, required=True, validators=[]), - Field(item="61", name='DATE_OF_BIRTH', type='string', startIndex=61, endIndex=69, + Field(item="61", name='DATE_OF_BIRTH', friendly_name='date of birth', type='string', startIndex=61, endIndex=69, required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=69, + TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=69, endIndex=78, required=True, validators=[], is_encrypted=False), - Field(item="63A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, + Field(item="63A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=78, endIndex=79, required=True, validators=[]), - Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, + Field(item="63B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=79, endIndex=80, required=True, validators=[]), - Field(item="63C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, + Field(item="63C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=80, endIndex=81, required=True, validators=[]), - Field(item="63D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, + Field(item="63D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=81, endIndex=82, required=True, validators=[]), - Field(item="63E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, + Field(item="63E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=82, endIndex=83, required=True, validators=[]), - Field(item="63F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, + Field(item="63F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=83, endIndex=84, required=True, validators=[]), - Field(item="64", name='GENDER', type='number', startIndex=84, endIndex=85, + Field(item="64", name='GENDER', friendly_name='gender', type='number', startIndex=84, endIndex=85, required=True, validators=[]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=85, endIndex=86, + Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', friendly_name='receive nonssi benefit', type='number', startIndex=85, endIndex=86, required=True, validators=[]), - Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, + Field(item="65B", name='RECEIVE_SSI', friendly_name='receives ssi', type='number', startIndex=86, endIndex=87, required=True, validators=[]), - Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=87, endIndex=89, + Field(item="66", name='RELATIONSHIP_HOH', friendly_name='realtionship head of household', type='number', startIndex=87, endIndex=89, required=True, validators=[]), - Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, + Field(item="67", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=89, endIndex=90, required=True, validators=[]), - Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=90, endIndex=92, + Field(item="68", name='EDUCATION_LEVEL', friendly_name='education level', type='number', startIndex=90, endIndex=92, required=True, validators=[]), - Field(item="69", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, + Field(item="69", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=92, endIndex=93, required=True, validators=[]), - Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=93, endIndex=97, + Field(item="70A", name='UNEARNED_SSI', friendly_name='unearned ssi', type='number', startIndex=93, endIndex=97, required=True, validators=[]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=97, endIndex=101, + Field(item="70B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='number', startIndex=97, endIndex=101, required=True, validators=[]) ] ) From d460fe2ba7204a83a05e018feef6794e3aafe362 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 27 Oct 2023 08:31:58 -0400 Subject: [PATCH 08/88] added friendly_name to t3 --- .../tdpservice/parsers/schema_defs/tanf/t3.py | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index d22d848df..c5f4df9b0 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -65,72 +65,72 @@ ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + Field(item="67", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, required=True, validators=[ validators.oneOf([1, 2, 4]) ]), - Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=20, endIndex=28, + Field(item="68", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=20, endIndex=28, required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=28, + TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', friendly_name='social security name - ssn', type='string', startIndex=28, endIndex=37, required=True, validators=[validators.validateSSN()], is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, + Field(item="70A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=37, endIndex=38, required=True, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, + Field(item="70B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=38, endIndex=39, required=True, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, + Field(item="70C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=39, endIndex=40, required=True, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, + Field(item="70D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=40, endIndex=41, required=True, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, + Field(item="70E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=41, endIndex=42, required=True, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, + Field(item="70F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=42, endIndex=43, required=True, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', type='number', startIndex=43, endIndex=44, + Field(item="71", name='GENDER', friendly_name='gender', type='number', startIndex=43, endIndex=44, required=True, validators=[ validators.isInLimits(0, 9) ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=44, endIndex=45, + Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', friendly_name='receives nonssa benefits', type='number', startIndex=44, endIndex=45, required=True, validators=[ validators.oneOf([1, 2]) ]), - Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, + Field(item="72B", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=45, endIndex=46, required=True, validators=[ validators.oneOf([1, 2]) ]), - Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=46, endIndex=48, + Field(item="73", name='RELATIONSHIP_HOH', friendly_name='relationship to head of household', type='string', startIndex=46, endIndex=48, required=True, validators=[ validators.isInStringRange(0, 10) ]), - Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, + Field(item="74", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=48, endIndex=49, required=True, validators=[ validators.oneOf([0, 2, 3]) ]), - Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=49, endIndex=51, + Field(item="75", name='EDUCATION_LEVEL', friendly_name='education level', type='string', startIndex=49, endIndex=51, required=True, validators=[ validators.or_validators( validators.isInStringRange(0, 16), validators.isInStringRange(98, 99) ) ]), - Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, + Field(item="76", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=51, endIndex=52, required=True, validators=[ validators.oneOf([0, 1, 2, 9]) ]), - Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=52, endIndex=56, + Field(item="77A", name='UNEARNED_SSI', friendly_name='unearned ssi', type='string', startIndex=52, endIndex=56, required=False, validators=[ validators.isInStringRange(0, 9999) ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=56, endIndex=60, + Field(item="77B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='string', startIndex=56, endIndex=60, required=False, validators=[ validators.isInStringRange(0, 9999) ]), @@ -194,72 +194,72 @@ ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, + Field(item="67", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=60, endIndex=61, required=True, validators=[ validators.oneOf([1, 2, 4]) ]), - Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=61, endIndex=69, + Field(item="68", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=61, endIndex=69, required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=69, + TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=69, endIndex=78, required=True, validators=[validators.validateSSN()], is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, + Field(item="70A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=78, endIndex=79, required=True, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, + Field(item="70B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=79, endIndex=80, required=True, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, + Field(item="70C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=80, endIndex=81, required=True, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, + Field(item="70D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=81, endIndex=82, required=True, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, + Field(item="70E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=82, endIndex=83, required=True, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, + Field(item="70F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=83, endIndex=84, required=True, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', type='number', startIndex=84, endIndex=85, + Field(item="71", name='GENDER', friendly_name='gender', type='number', startIndex=84, endIndex=85, required=True, validators=[ validators.isInLimits(0, 9) ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=85, endIndex=86, + Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', friendly_name='receive nonssa benefits', type='number', startIndex=85, endIndex=86, required=True, validators=[ validators.oneOf([1, 2]) ]), - Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, + Field(item="72B", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=86, endIndex=87, required=True, validators=[ validators.oneOf([1, 2]) ]), - Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=87, endIndex=89, + Field(item="73", name='RELATIONSHIP_HOH', friendly_name='relationship head of household', type='string', startIndex=87, endIndex=89, required=True, validators=[ validators.isInStringRange(0, 10) ]), - Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, + Field(item="74", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=89, endIndex=90, required=True, validators=[ validators.oneOf([0, 2, 3]) ]), - Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=90, endIndex=92, + Field(item="75", name='EDUCATION_LEVEL', friendly_name='education level', type='string', startIndex=90, endIndex=92, required=True, validators=[ validators.or_validators( validators.isInStringRange(0, 16), validators.oneOf(['98', '99']) ) ]), - Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, + Field(item="76", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=92, endIndex=93, required=True, validators=[ validators.oneOf([0, 1, 2, 9]) ]), - Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=93, endIndex=97, + Field(item="77A", name='UNEARNED_SSI', friendly_name='unearned ssi', type='string', startIndex=93, endIndex=97, required=False, validators=[ validators.isInStringRange(0, 9999) ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=97, endIndex=101, + Field(item="77B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='string', startIndex=97, endIndex=101, required=False, validators=[ validators.isInStringRange(0, 9999) ]), From 2bb6622d0fc30dd6a437328fe46c3b3cc3c30efb Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 27 Oct 2023 09:16:52 -0400 Subject: [PATCH 09/88] added friendly_name to t4 and t5 --- .../tdpservice/parsers/schema_defs/tanf/t4.py | 26 ++++---- .../tdpservice/parsers/schema_defs/tanf/t5.py | 60 ++++++++++--------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py index d09aaa0cd..2dbe02003 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py @@ -17,33 +17,33 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, + Field(item="2", name='COUNTY_FIPS_CODE', friendly_name='county fips code', type='string', startIndex=19, endIndex=22, required=True, validators=[validators.isInStringRange(1, 999)]), - Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, + Field(item="5", name='STRATUM', friendly_name='stratum', type='string', startIndex=22, endIndex=24, required=True, validators=[validators.isInStringRange(0, 99)]), - Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, + Field(item="7", name='ZIP_CODE', friendly_name='zip code', type='string', startIndex=24, endIndex=29, required=True, validators=[]), - Field(item="8", name='DISPOSITION', type='number', startIndex=29, endIndex=30, + Field(item="8", name='DISPOSITION', friendly_name='disposition', type='number', startIndex=29, endIndex=30, required=True, validators=[validators.oneOf([1, 2])]), - Field(item="9", name='CLOSURE_REASON', type='string', startIndex=30, endIndex=32, + Field(item="9", name='CLOSURE_REASON', friendly_name='closure reason', type='string', startIndex=30, endIndex=32, required=True, validators=[validators.or_validators(validators.isInStringRange(1, 19), validators.matches("99"))]), - Field(item="10", name='REC_SUB_HOUSING', type='number', startIndex=32, endIndex=33, + Field(item="10", name='REC_SUB_HOUSING', friendly_name='receives subsidized housing', type='number', startIndex=32, endIndex=33, required=True, validators=[validators.isInLimits(1, 3)]), - Field(item="11", name='REC_MED_ASSIST', type='number', startIndex=33, endIndex=34, + Field(item="11", name='REC_MED_ASSIST', friendly_name='receives medical assisstance', type='number', startIndex=33, endIndex=34, required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="12", name='REC_FOOD_STAMPS', type='number', startIndex=34, endIndex=35, + Field(item="12", name='REC_FOOD_STAMPS', friendly_name='receieves food stamps', type='number', startIndex=34, endIndex=35, required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="13", name='REC_SUB_CC', type='number', startIndex=35, endIndex=36, + Field(item="13", name='REC_SUB_CC', friendly_name='receieves subsidized child care', type='number', startIndex=35, endIndex=36, required=True, validators=[validators.isInLimits(1, 3)]), - Field(item="14", name='BLANK', type='string', startIndex=36, endIndex=71, required=False, validators=[]), + Field(item="14", name='BLANK', friendly_name='blank', type='string', startIndex=36, endIndex=71, required=False, validators=[]), ], ) ] diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 43c97225f..2aa8b1240 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -76,67 +76,69 @@ ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), - Field(item="14", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + Field(item="14", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, required=True, validators=[validators.isInLimits(1, 5)]), - Field(item="15", name='DATE_OF_BIRTH', type='number', startIndex=20, endIndex=28, + Field(item="15", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=20, endIndex=28, required=True, validators=[validators.isLargerThan(0)]), - TransformField(transform_func=tanf_ssn_decryption_func, item="16", name='SSN', type='string', + TransformField(transform_func=tanf_ssn_decryption_func, item="16", name='SSN', friendly_name='social security number SSN', type='string', startIndex=28, endIndex=37, required=True, validators=[validators.isNumber()], is_encrypted=False), - Field(item="17A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, + Field(item="17A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=37, endIndex=38, required=True, validators=[validators.validateRace()]), - Field(item="17B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, + Field(item="17B", name='RACE_AMER_INDIAN', friendly_name='race aerical indian', type='number', startIndex=38, endIndex=39, required=True, validators=[validators.validateRace()]), - Field(item="17C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, + Field(item="17C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=39, endIndex=40, required=True, validators=[validators.validateRace()]), - Field(item="17D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, + Field(item="17D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=40, endIndex=41, required=True, validators=[validators.validateRace()]), - Field(item="17E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, + Field(item="17E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=41, endIndex=42, required=True, validators=[validators.validateRace()]), - Field(item="17F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, + Field(item="17F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=42, endIndex=43, required=True, validators=[validators.validateRace()]), - Field(item="18", name='GENDER', type='number', startIndex=43, endIndex=44, + Field(item="18", name='GENDER', friendly_name='gender', type='number', startIndex=43, endIndex=44, required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="19A", name='REC_OASDI_INSURANCE', type='number', startIndex=44, endIndex=45, + Field(item="19A", name='REC_OASDI_INSURANCE', + friendly_name='receives federal disability insurance benefits under the social security OASDI program', + type='number', startIndex=44, endIndex=45, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19B", name='REC_FEDERAL_DISABILITY', type='number', startIndex=45, endIndex=46, + Field(item="19B", name='REC_FEDERAL_DISABILITY', friendly_name='receives federal disability', type='number', startIndex=45, endIndex=46, required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="19C", name='REC_AID_TOTALLY_DISABLED', type='number', startIndex=46, endIndex=47, + Field(item="19C", name='REC_AID_TOTALLY_DISABLED', friendly_name='receives aid totally disabled', type='number', startIndex=46, endIndex=47, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19D", name='REC_AID_AGED_BLIND', type='number', startIndex=47, endIndex=48, + Field(item="19D", name='REC_AID_AGED_BLIND', friendly_name='receives aid aged blind', type='number', startIndex=47, endIndex=48, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19E", name='REC_SSI', type='number', startIndex=48, endIndex=49, + Field(item="19E", name='REC_SSI', friendly_name='receives SSI', type='number', startIndex=48, endIndex=49, required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="20", name='MARITAL_STATUS', type='number', startIndex=49, endIndex=50, + Field(item="20", name='MARITAL_STATUS', friendly_name='marital status', type='number', startIndex=49, endIndex=50, required=True, validators=[validators.isInLimits(0, 5)]), - Field(item="21", name='RELATIONSHIP_HOH', type='string', startIndex=50, endIndex=52, + Field(item="21", name='RELATIONSHIP_HOH', friendly_name='relationship head of household', type='string', startIndex=50, endIndex=52, required=True, validators=[validators.isInStringRange(1, 10)]), - Field(item="22", name='PARENT_MINOR_CHILD', type='number', startIndex=52, endIndex=53, + Field(item="22", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=52, endIndex=53, required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="23", name='NEEDS_OF_PREGNANT_WOMAN', type='number', startIndex=53, endIndex=54, + Field(item="23", name='NEEDS_OF_PREGNANT_WOMAN', friendly_name='needs of pregnant woman', type='number', startIndex=53, endIndex=54, required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="24", name='EDUCATION_LEVEL', type='string', startIndex=54, endIndex=56, + Field(item="24", name='EDUCATION_LEVEL', friendly_name='educational level', type='string', startIndex=54, endIndex=56, required=True, validators=[validators.or_validators(validators.isInStringRange(0, 16), validators.isInStringRange(98, 99))]), - Field(item="25", name='CITIZENSHIP_STATUS', type='number', startIndex=56, endIndex=57, + Field(item="25", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=56, endIndex=57, required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), validators.matches(9))]), - Field(item="26", name='COUNTABLE_MONTH_FED_TIME', type='string', startIndex=57, endIndex=60, + Field(item="26", name='COUNTABLE_MONTH_FED_TIME', friendly_name='countable month federal time', type='string', startIndex=57, endIndex=60, required=True, validators=[validators.isInStringRange(0, 999)]), - Field(item="27", name='COUNTABLE_MONTHS_STATE_TRIBE', type='string', startIndex=60, endIndex=62, + Field(item="27", name='COUNTABLE_MONTHS_STATE_TRIBE', friendly_name='countable months state tribe', type='string', startIndex=60, endIndex=62, required=True, validators=[validators.isInStringRange(0, 99)]), - Field(item="28", name='EMPLOYMENT_STATUS', type='number', startIndex=62, endIndex=63, + Field(item="28", name='EMPLOYMENT_STATUS', friendly_name='employment status', type='number', startIndex=62, endIndex=63, required=True, validators=[validators.isInLimits(0, 3)]), - Field(item="29", name='AMOUNT_EARNED_INCOME', type='string', startIndex=63, endIndex=67, + Field(item="29", name='AMOUNT_EARNED_INCOME', friendly_name='amount earned income', type='string', startIndex=63, endIndex=67, required=True, validators=[validators.isInStringRange(0, 9999)]), - Field(item="30", name='AMOUNT_UNEARNED_INCOME', type='string', startIndex=67, endIndex=71, + Field(item="30", name='AMOUNT_UNEARNED_INCOME', friendly_name='amount of unearned income', type='string', startIndex=67, endIndex=71, required=True, validators=[validators.isInStringRange(0, 9999)]), ], ) From c90ce755047cc42d8ae4ccad502f670c9c9bdc1c Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 27 Oct 2023 10:12:50 -0400 Subject: [PATCH 10/88] added friendly_name to t7 --- .../tdpservice/parsers/schema_defs/tanf/t7.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py index 2fcb4e0fd..371d0109a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py @@ -28,15 +28,16 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name="RecordType", type='string', startIndex=0, endIndex=2, + Field(item="0", name="RecordType", friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, + 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", name='RPT_MONTH_YEAR', + friendly_name='report month and year', type='number', startIndex=2, endIndex=7, @@ -46,11 +47,11 @@ validators.dateMonthIsValid() ] ), - Field(item="4", name='TDRS_SECTION_IND', type='string', startIndex=section_ind_index, + 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', type='string', startIndex=stratum_index, + 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', type='number', startIndex=families_index, + 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)]), ] ) From 9dfd6f8f1fad0ea4903320f321e077dd80f06159 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 27 Oct 2023 11:56:53 -0400 Subject: [PATCH 11/88] correct missing friendly_name --- .../tdpservice/parsers/schema_defs/tanf/t1.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t2.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t6.py | 103 +++++++++--------- 3 files changed, 54 insertions(+), 53 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 5bd856a5a..02266e884 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -232,7 +232,7 @@ required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), - Field(item="26CII", name='FAMILY_CAP', friendly_name='family cap', failure_type='number', startIndex=110, endIndex=111, + Field(item="26CII", name='FAMILY_CAP', friendly_name='family cap', type='number', startIndex=110, endIndex=111, required=True, validators=[ validators.oneOf([1, 2]), ]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index bda9c86ed..5d2aeb3db 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -106,7 +106,7 @@ validators=[validators.oneOf([1, 2])]), Field(item="32", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=21, endIndex=29, required=True, validators=[validators.isLargerThan(0),]), - TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, + TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', friendly_name='social security number SSN', type='string', startIndex=29, endIndex=38, required=True, validators=[validators.validateSSN()], is_encrypted=False), Field(item="34A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=38, endIndex=39, required=True, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index 8140322c2..f8f687341 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -20,43 +20,43 @@ validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, + 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(calendar_quarter_to_rpt_month_year(0), item="4", name='RPT_MONTH_YEAR', type='number', + TransformField(calendar_quarter_to_rpt_month_year(0), item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), - Field(item="4A", name='NUM_APPLICATIONS', type='number', startIndex=7, endIndex=15, + Field(item="4A", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=7, endIndex=15, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5A", name='NUM_APPROVED', type='number', startIndex=31, endIndex=39, + Field(item="5A", name='NUM_APPROVED', friendly_name='total number of approved applications', type='number', startIndex=31, endIndex=39, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6A", name='NUM_DENIED', type='number', startIndex=55, endIndex=63, + Field(item="6A", name='NUM_DENIED', friendly_name='total number of denied applications', type='number', startIndex=55, endIndex=63, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7A", name='ASSISTANCE', type='number', startIndex=79, endIndex=91, + Field(item="7A", name='ASSISTANCE', friendly_name='total amount of assistance', type='number', startIndex=79, endIndex=91, required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8A", name='NUM_FAMILIES', type='number', startIndex=115, endIndex=123, + Field(item="8A", name='NUM_FAMILIES', friendly_name='number of families', type='number', startIndex=115, endIndex=123, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9A", name='NUM_2_PARENTS', type='number', startIndex=139, endIndex=147, + Field(item="9A", name='NUM_2_PARENTS', friendly_name='total number of two-parent families', type='number', startIndex=139, endIndex=147, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10A", name='NUM_1_PARENTS', type='number', startIndex=163, endIndex=171, + Field(item="10A", name='NUM_1_PARENTS', friendly_name='total number of one-parent families', type='number', startIndex=163, endIndex=171, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11A", name='NUM_NO_PARENTS', type='number', startIndex=187, endIndex=195, + Field(item="11A", name='NUM_NO_PARENTS', friendly_name='total number of no parent families', type='number', startIndex=187, endIndex=195, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12A", name='NUM_RECIPIENTS', type='number', startIndex=211, endIndex=219, + Field(item="12A", name='NUM_RECIPIENTS', friendly_name='total number of recipients', type='number', startIndex=211, endIndex=219, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13A", name='NUM_ADULT_RECIPIENTS', type='number', startIndex=235, endIndex=243, + Field(item="13A", name='NUM_ADULT_RECIPIENTS', friendly_name='total number of adult recipients', type='number', startIndex=235, endIndex=243, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14A", name='NUM_CHILD_RECIPIENTS', type='number', startIndex=259, endIndex=267, + Field(item="14A", name='NUM_CHILD_RECIPIENTS', friendly_name='total number of child recipients', type='number', startIndex=259, endIndex=267, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15A", name='NUM_NONCUSTODIALS', type='number', startIndex=283, endIndex=291, + Field(item="15A", name='NUM_NONCUSTODIALS', friendly_name='total number of noncustodial parents participating in work activities', type='number', startIndex=283, endIndex=291, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16A", name='NUM_BIRTHS', type='number', startIndex=307, endIndex=315, + Field(item="16A", name='NUM_BIRTHS', friendly_name='total number of births', type='number', startIndex=307, endIndex=315, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17A", name='NUM_OUTWEDLOCK_BIRTHS', type='number', startIndex=331, endIndex=339, + Field(item="17A", name='NUM_OUTWEDLOCK_BIRTHS', friendly_name='total number of out-of-wedlock births', type='number', startIndex=331, endIndex=339, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18A", name='NUM_CLOSED_CASES', type='number', startIndex=355, endIndex=363, + Field(item="18A", name='NUM_CLOSED_CASES', friendly_name='total number of closed cases', type='number', startIndex=355, endIndex=363, required=True, validators=[validators.isInLimits(0, 99999999)]), ], ) @@ -78,35 +78,35 @@ required=True, validators=[]), TransformField(calendar_quarter_to_rpt_month_year(1), item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=7, required=True, validators=[]), - Field(item="4B", name='NUM_APPLICATIONS', type='number', startIndex=15, endIndex=23, + Field(item="4B", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=15, endIndex=23, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5B", name='NUM_APPROVED', type='number', startIndex=39, endIndex=47, + Field(item="5B", name='NUM_APPROVED', friendly_name='total number of approved cases', type='number', startIndex=39, endIndex=47, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6B", name='NUM_DENIED', type='number', startIndex=63, endIndex=71, + Field(item="6B", name='NUM_DENIED', friendly_name='total number of denied', type='number', startIndex=63, endIndex=71, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7B", name='ASSISTANCE', type='number', startIndex=91, endIndex=103, + Field(item="7B", name='ASSISTANCE', friendly_name='assistance', type='number', startIndex=91, endIndex=103, required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8B", name='NUM_FAMILIES', type='number', startIndex=123, endIndex=131, + Field(item="8B", name='NUM_FAMILIES', friendly_name='total of number of families', type='number', startIndex=123, endIndex=131, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9B", name='NUM_2_PARENTS', type='number', startIndex=147, endIndex=155, + Field(item="9B", name='NUM_2_PARENTS', friendly_name='total number of two-parent families', type='number', startIndex=147, endIndex=155, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10B", name='NUM_1_PARENTS', type='number', startIndex=171, endIndex=179, + Field(item="10B", name='NUM_1_PARENTS', friendly_name='total number of one-parent families', type='number', startIndex=171, endIndex=179, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11B", name='NUM_NO_PARENTS', type='number', startIndex=195, endIndex=203, + Field(item="11B", name='NUM_NO_PARENTS', friendly_name='total number of noparent family', type='number', startIndex=195, endIndex=203, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12B", name='NUM_RECIPIENTS', type='number', startIndex=219, endIndex=227, + Field(item="12B", name='NUM_RECIPIENTS', friendly_name='total number of receipients', type='number', startIndex=219, endIndex=227, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13B", name='NUM_ADULT_RECIPIENTS', type='number', startIndex=243, endIndex=251, + Field(item="13B", name='NUM_ADULT_RECIPIENTS', friendly_name='total number of adult recipients', type='number', startIndex=243, endIndex=251, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14B", name='NUM_CHILD_RECIPIENTS', type='number', startIndex=267, endIndex=275, + Field(item="14B", name='NUM_CHILD_RECIPIENTS', friendly_name='total number of child recipients', type='number', startIndex=267, endIndex=275, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15B", name='NUM_NONCUSTODIALS', type='number', startIndex=291, endIndex=299, + Field(item="15B", name='NUM_NONCUSTODIALS', friendly_name='total number of noncustodial parents', type='number', startIndex=291, endIndex=299, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16B", name='NUM_BIRTHS', type='number', startIndex=315, endIndex=323, + Field(item="16B", name='NUM_BIRTHS', friendly_name='total number of births', type='number', startIndex=315, endIndex=323, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17B", name='NUM_OUTWEDLOCK_BIRTHS', type='number', startIndex=339, endIndex=347, + Field(item="17B", name='NUM_OUTWEDLOCK_BIRTHS', friendly_name='total number of outwedlock births', type='number', startIndex=339, endIndex=347, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18B", name='NUM_CLOSED_CASES', type='number', startIndex=363, endIndex=371, + Field(item="18B", name='NUM_CLOSED_CASES', friendly_name='total number of closed assets', type='number', startIndex=363, endIndex=371, required=True, validators=[validators.isInLimits(0, 99999999)]), ], ) @@ -122,41 +122,42 @@ validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, + Field(item="3", name='CALENDAR_QUARTER', friendly_name='calendar quarter', type='number', startIndex=2, endIndex=7, required=True, validators=[]), - TransformField(calendar_quarter_to_rpt_month_year(2), item="4", name='RPT_MONTH_YEAR', type='number', + TransformField(calendar_quarter_to_rpt_month_year(2), item="4", name='RPT_MONTH_YEAR', + friendly_name='report month year', type='number', startIndex=2, endIndex=7, required=True, validators=[]), - Field(item="4C", name='NUM_APPLICATIONS', type='number', startIndex=23, endIndex=31, + Field(item="4C", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=23, endIndex=31, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5C", name='NUM_APPROVED', type='number', startIndex=47, endIndex=55, + Field(item="5C", name='NUM_APPROVED', friendly_name='total number of approved applications', type='number', startIndex=47, endIndex=55, required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6C", name='NUM_DENIED', type='number', startIndex=71, endIndex=79, + 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', 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', type='number', startIndex=131, endIndex=139, + 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', type='number', startIndex=155, endIndex=163, + 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', type='number', startIndex=179, endIndex=187, + 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', type='number', startIndex=203, endIndex=211, + 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', type='number', startIndex=227, endIndex=235, + 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', type='number', startIndex=251, endIndex=259, + 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', type='number', startIndex=275, endIndex=283, + 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', type='number', startIndex=299, endIndex=307, + 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', type='number', startIndex=323, endIndex=331, + 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', type='number', startIndex=347, endIndex=355, + 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', type='number', startIndex=371, endIndex=379, + 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)]), ], ) From 90aea2f7387a1eaff010e35ecfcdfc62b88b46b1 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Fri, 27 Oct 2023 13:02:15 -0400 Subject: [PATCH 12/88] correction on failing tests --- tdrs-backend/tdpservice/parsers/fields.py | 7 ++- .../tdpservice/parsers/schema_defs/header.py | 20 +++---- .../tdpservice/parsers/schema_defs/ssp/m2.py | 4 +- .../tdpservice/parsers/schema_defs/tanf/t6.py | 7 ++- .../tdpservice/parsers/schema_defs/trailer.py | 6 +- .../tdpservice/parsers/test/test_util.py | 60 +++++++++---------- tdrs-backend/tdpservice/parsers/util.py | 6 +- 7 files changed, 56 insertions(+), 54 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/fields.py b/tdrs-backend/tdpservice/parsers/fields.py index fa4c73101..f620b934e 100644 --- a/tdrs-backend/tdpservice/parsers/fields.py +++ b/tdrs-backend/tdpservice/parsers/fields.py @@ -18,9 +18,10 @@ def value_is_empty(value, length): class Field: """Provides a mapping between a field name and its position.""" - def __init__(self, item, name, type, startIndex, endIndex, required=True, validators=[]): + def __init__(self, item, name, friendly_name, type, startIndex, endIndex, required=True, validators=[]): self.item = item self.name = name + self.friendly_name = friendly_name self.type = type self.startIndex = startIndex self.endIndex = endIndex @@ -60,8 +61,8 @@ def parse_value(self, line): class TransformField(Field): """Represents a field that requires some transformation before serializing.""" - def __init__(self, transform_func, item, name, type, startIndex, endIndex, required=True, validators=[], **kwargs): - super().__init__(item, name, type, startIndex, endIndex, required, validators) + def __init__(self, transform_func, item, name, friendly_name, type, startIndex, endIndex, required=True, validators=[], **kwargs): + super().__init__(item, name, friendly_name, type, startIndex, endIndex, required, validators) self.transform_func = transform_func self.kwargs = kwargs diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index 96ede4754..127508d96 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -17,37 +17,37 @@ ], postparsing_validators=[], fields=[ - Field(item="2", name='title', type='string', startIndex=0, endIndex=6, required=True, validators=[ + Field(item="2", name='title', friendly_name='title', type='string', startIndex=0, endIndex=6, required=True, validators=[ validators.matches('HEADER'), ]), - Field(item="4", name='year', type='number', startIndex=6, endIndex=10, required=True, validators=[ + Field(item="4", name='year', friendly_name='year', type='number', startIndex=6, endIndex=10, required=True, validators=[ validators.isInLimits(2000, 2099) ]), - Field(item="5", name='quarter', type='string', startIndex=10, endIndex=11, required=True, validators=[ + Field(item="5", name='quarter', friendly_name='quarter', type='string', startIndex=10, endIndex=11, required=True, validators=[ validators.oneOf(['1', '2', '3', '4']) ]), - Field(item="6", name='type', type='string', startIndex=11, endIndex=12, required=True, validators=[ + Field(item="6", name='type', friendly_name='type', type='string', startIndex=11, endIndex=12, required=True, validators=[ validators.oneOf(['A', 'C', 'G', 'S']) ]), - Field(item="1", name='state_fips', type='string', startIndex=12, endIndex=14, required=True, validators=[ + Field(item="1", name='state_fips', friendly_name='state fips', type='string', startIndex=12, endIndex=14, required=True, validators=[ validators.oneOf(("01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "44", "45", "46", "47", "48", "49", "50", "51", "53", "54", "55", "56", "66", "72", "78")) ]), - Field(item="3", name='tribe_code', type='string', startIndex=14, endIndex=17, required=False, validators=[ + Field(item="3", name='tribe_code', friendly_name='tribe code', type='string', startIndex=14, endIndex=17, required=False, validators=[ validators.isInStringRange(0, 999) ]), - Field(item="7", name='program_type', type='string', startIndex=17, endIndex=20, required=True, validators=[ + Field(item="7", name='program_type', friendly_name='program type', type='string', startIndex=17, endIndex=20, required=True, validators=[ validators.oneOf(['TAN', 'SSP']) ]), - Field(item="8", name='edit', type='string', startIndex=20, endIndex=21, required=True, validators=[ + Field(item="8", name='edit', friendly_name='edit', type='string', startIndex=20, endIndex=21, required=True, validators=[ validators.oneOf(['1', '2']) ]), - Field(item="9", name='encryption', type='string', startIndex=21, endIndex=22, required=False, validators=[ + Field(item="9", name='encryption', friendly_name='encryption', type='string', startIndex=21, endIndex=22, required=False, validators=[ validators.oneOf([' ', 'E']) ]), - Field(item="10", name='update', type='string', startIndex=22, endIndex=23, required=True, validators=[ + Field(item="10", name='update', friendly_name='update', type='string', startIndex=22, endIndex=23, required=True, validators=[ validators.oneOf(['N', 'D', 'U']) ]), ], diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index 0a22675a8..a1a5a720b 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -70,7 +70,7 @@ required=True, validators=[]), Field(item="39", name='COOPERATION_CHILD_SUPPORT', friendly_name='cooperation child support', type='number', startIndex=58, endIndex=59, required=True, validators=[]), - Field(item="40", name='EMPLOYMENT_STATUS', frinedly_name='employment status', type='number', startIndex=59, endIndex=60, + Field(item="40", name='EMPLOYMENT_STATUS', friendly_name='employment status', type='number', startIndex=59, endIndex=60, required=True, validators=[]), Field(item="41", name='WORK_ELIGIBLE_INDICATOR', friendly_name='work eligible indicator', type='number', startIndex=60, endIndex=62, required=True, validators=[]), @@ -126,7 +126,7 @@ required=True, validators=[]), Field(item="53C", name='SCHOOL_ATTENDENCE_HOL', friendly_name='school attendance - holiday', type='number', startIndex=112, endIndex=114, required=True, validators=[]), - Field(item="54A", name='PROVIDE_CC_HOP', friend_name='provide child care - hours of participation', type='number', startIndex=114, endIndex=116, + Field(item="54A", name='PROVIDE_CC_HOP', friendly_name='provide child care - hours of participation', type='number', startIndex=114, endIndex=116, required=True, validators=[]), Field(item="54B", name='PROVIDE_CC_EA', friendly_name='provide child care - excused absence', type='number', startIndex=116, endIndex=118, required=True, validators=[]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index f8f687341..233858954 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -72,11 +72,12 @@ validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, required=True, validators=[]), - Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, + Field(item="3", name='CALENDAR_QUARTER', friendly_name='calendar quarter', type='number', startIndex=2, endIndex=7, required=True, validators=[]), - TransformField(calendar_quarter_to_rpt_month_year(1), item="4", name='RPT_MONTH_YEAR', type='number', + TransformField(calendar_quarter_to_rpt_month_year(1), item="4", name='RPT_MONTH_YEAR', + friendly_name='report month year', type='number', startIndex=2, endIndex=7, required=True, validators=[]), Field(item="4B", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=15, endIndex=23, required=True, validators=[validators.isInLimits(0, 99999999)]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py b/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py index 46a440508..ced15e4cf 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py @@ -17,13 +17,13 @@ ], postparsing_validators=[], fields=[ - Field(item="1", name='title', type='string', startIndex=0, endIndex=7, required=True, validators=[ + 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', type='number', startIndex=7, endIndex=14, required=True, validators=[ + 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', type='string', startIndex=14, endIndex=23, required=False, validators=[ + Field(item="-1", name='blank', friendly_name='blank', type='string', startIndex=14, endIndex=23, required=False, validators=[ validators.matches(' ') ]), ], diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index b2817174e..fdbe09a62 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -56,16 +56,16 @@ def test_parse_line_parses_line_from_schema_to_dict(): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3), - Field(item=2, name='second', type='string', startIndex=3, endIndex=4), - Field(item=3, name='third', type='string', startIndex=4, endIndex=5), - Field(item=4, name='fourth', type='number', startIndex=5, endIndex=7), - Field(item=5, name='fifth', type='number', startIndex=7, endIndex=8), + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3), + Field(item=2, name='second', friendly_name='second', type='string', startIndex=3, endIndex=4), + Field(item=3, name='third', friendly_name='third', type='string', startIndex=4, endIndex=5), + Field(item=4, name='fourth', friendly_name='fourth', type='number', startIndex=5, endIndex=7), + Field(item=5, name='fifth', friendly_name='fifth', type='number', startIndex=7, endIndex=8), ] ) record = schema.parse_line(line) - + assert record['first'] == '123' assert record['second'] == '4' assert record['third'] == '5' @@ -86,11 +86,11 @@ class TestModel: schema = RowSchema( model=TestModel, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3), - Field(item=2, name='second', type='string', startIndex=3, endIndex=4), - Field(item=3, name='third', type='string', startIndex=4, endIndex=5), - Field(item=4, name='fourth', type='number', startIndex=5, endIndex=7), - Field(item=5, name='fifth', type='number', startIndex=7, endIndex=8), + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3), + Field(item=2, name='second', friendly_name='second', type='string', startIndex=3, endIndex=4), + Field(item=3, name='third', friendly_name='third', type='string', startIndex=4, endIndex=5), + Field(item=4, name='fourth', friendly_name='fourth', type='number', startIndex=5, endIndex=7), + Field(item=5, name='fifth', friendly_name='fifth', type='number', startIndex=7, endIndex=8), ] ) @@ -113,13 +113,13 @@ def test_run_field_validators_returns_valid_with_dict(): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, validators=[ passing_validator() ]), - Field(item=2, name='second', type='string', startIndex=3, endIndex=4, validators=[ + Field(item=2, name='second', friendly_name='second', type='string', startIndex=3, endIndex=4, validators=[ passing_validator() ]), - Field(item=3, name='third', type='string', startIndex=4, endIndex=5, validators=[ + Field(item=3, name='third', friendly_name='third', type='string', startIndex=4, endIndex=5, validators=[ passing_validator() ]), ] @@ -145,13 +145,13 @@ class TestModel: schema = RowSchema( model=TestModel, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, validators=[ passing_validator() ]), - Field(item=2, name='second', type='string', startIndex=3, endIndex=4, validators=[ + Field(item=2, name='second', friendly_name='second', type='string', startIndex=3, endIndex=4, validators=[ passing_validator() ]), - Field(item=3, name='third', type='string', startIndex=4, endIndex=5, validators=[ + Field(item=3, name='third', friendly_name='third', type='string', startIndex=4, endIndex=5, validators=[ passing_validator() ]), ] @@ -172,14 +172,14 @@ def test_run_field_validators_returns_invalid_with_dict(): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, validators=[ passing_validator(), failing_validator() ]), - Field(item=2, name='second', type='string', startIndex=3, endIndex=4, validators=[ + Field(item=2, name='second', friendly_name='second', type='string', startIndex=3, endIndex=4, validators=[ passing_validator() ]), - Field(item=3, name='third', type='string', startIndex=4, endIndex=5, validators=[ + Field(item=3, name='third', friendly_name='third', type='string', startIndex=4, endIndex=5, validators=[ passing_validator() ]), ] @@ -205,14 +205,14 @@ class TestModel: schema = RowSchema( model=TestModel, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, validators=[ passing_validator(), failing_validator() ]), - Field(item=2, name='second', type='string', startIndex=3, endIndex=4, validators=[ + Field(item=2, name='second', friendly_name='second', type='string', startIndex=3, endIndex=4, validators=[ passing_validator() ]), - Field(item=3, name='third', type='string', startIndex=4, endIndex=5, validators=[ + Field(item=3, name='third', friendly_name='third', type='string', startIndex=4, endIndex=5, validators=[ passing_validator() ]), ] @@ -237,10 +237,10 @@ def test_field_validators_blank_and_required_returns_error(first, second): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=1, required=True, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=1, required=True, validators=[ passing_validator(), ]), - Field(item=2, name='second', type='string', startIndex=1, endIndex=3, required=True, validators=[ + Field(item=2, name='second', friendly_name='second', type='string', startIndex=1, endIndex=3, required=True, validators=[ passing_validator(), ]), ] @@ -267,7 +267,7 @@ def test_field_validators_blank_and_not_required_returns_valid(first): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3, required=False, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, required=False, validators=[ passing_validator(), failing_validator() ]), @@ -349,7 +349,7 @@ def test_multi_record_schema_parses_and_validates(): failing_validator() ], fields=[ - Field(item=1, name='first', type='string', startIndex=0, endIndex=3, validators=[ + Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, validators=[ passing_validator() ]), ] @@ -363,7 +363,7 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], fields=[ - Field(item=2, name='second', type='string', startIndex=2, endIndex=4, validators=[ + Field(item=2, name='second', friendly_name='first', type='string', startIndex=2, endIndex=4, validators=[ passing_validator() ]), ] @@ -377,7 +377,7 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], fields=[ - Field(item=3, name='third', type='string', startIndex=4, endIndex=5, validators=[ + Field(item=3, name='third', friendly_name='first', type='string', startIndex=4, endIndex=5, validators=[ passing_validator() ]), ] @@ -391,7 +391,7 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], fields=[ - Field(item=4, name='fourth', type='string', startIndex=4, endIndex=5, validators=[ + Field(item=4, name='fourth', friendly_name='first', type='string', startIndex=4, endIndex=5, validators=[ failing_validator() ]), ] diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 6ed48e44e..2c77a6482 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -44,13 +44,13 @@ def generate_parser_error(datafile, line_number, schema, error_category, error_m model=schema.model if schema else None ) if record and not isinstance(record, dict) else None, object_id=getattr(record, 'id', None) if record and not isinstance(record, dict) else None, - fields_json=None + fields_json={"friendly_name": getattr(field, 'friendly_name', None) if hasattr(field, 'friendly_name') else None} ) def make_generate_parser_error(datafile, line_number): """Configure generate_parser_error with a datafile and line number.""" - def generate(schema, error_category, error_message, record=None, field=None): + def generate(schema, error_category, error_message, record=None, field=None, field_json=None): return generate_parser_error( datafile=datafile, line_number=line_number, @@ -58,7 +58,7 @@ def generate(schema, error_category, error_message, record=None, field=None): error_category=error_category, error_message=error_message, record=record, - field=field + field=field, ) return generate From 8f210cd587a82e9114f3314fb85a637e4d7df67f Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 30 Oct 2023 09:21:23 -0400 Subject: [PATCH 13/88] addedfriendly name to excel report --- tdrs-backend/tdpservice/parsers/util.py | 2 +- tdrs-backend/tdpservice/parsers/views.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 2c77a6482..f53fd933d 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -50,7 +50,7 @@ def generate_parser_error(datafile, line_number, schema, error_category, error_m def make_generate_parser_error(datafile, line_number): """Configure generate_parser_error with a datafile and line number.""" - def generate(schema, error_category, error_message, record=None, field=None, field_json=None): + def generate(schema, error_category, error_message, record=None, field=None): return generate_parser_error( datafile=datafile, line_number=line_number, diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index 7a525a3b8..c1f8e3b33 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -49,15 +49,14 @@ def _get_xls_serialized_file(self, data): ('year', lambda x: str(x['rpt_month_year'])[0:4] if x['rpt_month_year'] else None), ('month', lambda x: calendar.month_name[int(str(x['rpt_month_year'])[4:])] if x['rpt_month_year'] else None), ('error_type', lambda x: x['error_type']), - ('error_message', lambda x: x['error_message']), + ('error_message', lambda x: x['error_message'].replace(x['field_name'],str(x['fields_json']['friendly_name']))), ('item_number', lambda x: x['item_number']), - ('item_name', lambda x: TANF_ITEM_NAME.get(x['field_name'])), + ('item_name', lambda x: x['fields_json']['friendly_name']), ('internal_variable_name', lambda x: x['field_name']), ('row_number', lambda x: x['row_number']), ('column_number', lambda x: x['column_number']) ] - # write beta banner worksheet.write(row, col, "Error reporting in TDP is still in development." + From a093aa04d191adece962a724b35cc89fb77bcf7a Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 30 Oct 2023 09:55:59 -0400 Subject: [PATCH 14/88] linting --- tdrs-backend/tdpservice/parsers/util.py | 4 ++- tdrs-backend/tdpservice/parsers/views.py | 31 +++++++++++++----------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index f53fd933d..a6208305f 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -44,7 +44,9 @@ def generate_parser_error(datafile, line_number, schema, error_category, error_m model=schema.model if schema else None ) if record and not isinstance(record, dict) else None, object_id=getattr(record, 'id', None) if record and not isinstance(record, dict) else None, - fields_json={"friendly_name": getattr(field, 'friendly_name', None) if hasattr(field, 'friendly_name') else None} + fields_json={ + "friendly_name": getattr(field, 'friendly_name', None) if hasattr(field, 'friendly_name') else None + } ) diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index c1f8e3b33..4ab8d8364 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -4,7 +4,6 @@ from rest_framework.response import Response from .serializers import ParsingErrorSerializer, DataFileSummarySerializer from .models import ParserError, DataFileSummary -from .constants import TANF_ITEM_NAME import logging import base64 from io import BytesIO @@ -45,17 +44,21 @@ def _get_xls_serialized_file(self, data): workbook = xlsxwriter.Workbook(output) worksheet = workbook.add_worksheet() report_columns = [ - ('case_number' , lambda x: x['case_number']), - ('year', lambda x: str(x['rpt_month_year'])[0:4] if x['rpt_month_year'] else None), - ('month', lambda x: calendar.month_name[int(str(x['rpt_month_year'])[4:])] if x['rpt_month_year'] else None), - ('error_type', lambda x: x['error_type']), - ('error_message', lambda x: x['error_message'].replace(x['field_name'],str(x['fields_json']['friendly_name']))), - ('item_number', lambda x: x['item_number']), - ('item_name', lambda x: x['fields_json']['friendly_name']), - ('internal_variable_name', lambda x: x['field_name']), - ('row_number', lambda x: x['row_number']), - ('column_number', lambda x: x['column_number']) -] + ('case_number', lambda x: x['case_number']), + ('year', lambda x: str(x['rpt_month_year'])[0:4] if x['rpt_month_year'] else None), + ('month', lambda x: calendar.month_name[ + int(str(x['rpt_month_year'])[4:]) + ] if x['rpt_month_year'] else None), + ('error_type', lambda x: x['error_type']), + ('error_message', lambda x: x['error_message'].replace( + x['field_name'], + str(x['fields_json']['friendly_name']))), + ('item_number', lambda x: x['item_number']), + ('item_name', lambda x: x['fields_json']['friendly_name']), + ('internal_variable_name', lambda x: x['field_name']), + ('row_number', lambda x: x['row_number']), + ('column_number', lambda x: x['column_number']) + ] # write beta banner worksheet.write(row, col, @@ -69,12 +72,12 @@ def _get_xls_serialized_file(self, data): def format_header(header_list: list): """Format header.""" return ' '.join([i.capitalize() for i in header_list.split('_')]) - + [worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)] [ worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns) - for row, data_i in enumerate(data) + for row, data_i in enumerate(data) ] # autofit all columns except for the first one From 8ea36c68a1127e830832b1f87f75ab5c4657d9e3 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 30 Oct 2023 10:28:42 -0400 Subject: [PATCH 15/88] linting --- .../tdpservice/parsers/schema_defs/tanf/t6.py | 136 +++++++++++++++--- .../tdpservice/parsers/schema_defs/tanf/t7.py | 63 ++++++-- .../tdpservice/parsers/schema_defs/trailer.py | 45 ++++-- .../tdpservice/parsers/test/test_util.py | 96 ++++++++++--- 4 files changed, 273 insertions(+), 67 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index 233858954..ed4c3748d 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -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)] + ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py index 371d0109a..b92e06436 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py @@ -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", @@ -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)] + ), ] ) ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py b/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py index ced15e4cf..5ff37722f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py @@ -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(' ') + ] + ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index fdbe09a62..e1e9dea9a 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -65,7 +65,7 @@ def test_parse_line_parses_line_from_schema_to_dict(): ) record = schema.parse_line(line) - + assert record['first'] == '123' assert record['second'] == '4' assert record['third'] == '5' @@ -237,12 +237,30 @@ def test_field_validators_blank_and_required_returns_error(first, second): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=1, required=True, validators=[ - passing_validator(), - ]), - Field(item=2, name='second', friendly_name='second', type='string', startIndex=1, endIndex=3, required=True, validators=[ - passing_validator(), - ]), + Field( + item=1, + name='first', + friendly_name='first', + type='string', + startIndex=0, + endIndex=1, + required=True, + validators=[ + passing_validator(), + ] + ), + Field( + item=2, + name='second', + friendly_name='second', + type='string', + startIndex=1, + endIndex=3, + required=True, + validators=[ + passing_validator(), + ] + ), ] ) @@ -267,10 +285,19 @@ def test_field_validators_blank_and_not_required_returns_valid(first): schema = RowSchema( model=dict, fields=[ - Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, required=False, validators=[ - passing_validator(), - failing_validator() - ]), + Field( + item=1, + name='first', + friendly_name='first', + type='string', + startIndex=0, + endIndex=3, + required=False, + validators=[ + passing_validator(), + failing_validator() + ] + ), ] ) @@ -349,9 +376,15 @@ def test_multi_record_schema_parses_and_validates(): failing_validator() ], fields=[ - Field(item=1, name='first', friendly_name='first', type='string', startIndex=0, endIndex=3, validators=[ - passing_validator() - ]), + Field( + item=1, + name='first', + friendly_name='first', + type='string', + startIndex=0, + endIndex=3, + validators=[passing_validator()] + ), ] ), RowSchema( @@ -363,9 +396,14 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], fields=[ - Field(item=2, name='second', friendly_name='first', type='string', startIndex=2, endIndex=4, validators=[ - passing_validator() - ]), + Field( + item=2, + name='second', + friendly_name='first', + type='string', + startIndex=2, + endIndex=4, + validators=[passing_validator()]), ] ), RowSchema( @@ -377,9 +415,15 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], fields=[ - Field(item=3, name='third', friendly_name='first', type='string', startIndex=4, endIndex=5, validators=[ - passing_validator() - ]), + Field( + item=3, + name='third', + friendly_name='first', + type='string', + startIndex=4, + endIndex=5, + validators=[passing_validator()] + ), ] ), RowSchema( @@ -391,9 +435,15 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], fields=[ - Field(item=4, name='fourth', friendly_name='first', type='string', startIndex=4, endIndex=5, validators=[ - failing_validator() - ]), + Field( + item=4, + name='fourth', + friendly_name='first', + type='string', + startIndex=4, + endIndex=5, + validators=[failing_validator()] + ), ] ) ] From 85da10b493fb8eb5e40c90f08fdd9556164e6a40 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 30 Oct 2023 10:41:38 -0400 Subject: [PATCH 16/88] linting --- .../tdpservice/parsers/schema_defs/header.py | 198 ++- .../tdpservice/parsers/schema_defs/ssp/m1.py | 536 ++++++-- .../tdpservice/parsers/schema_defs/ssp/m2.py | 814 +++++++++--- .../tdpservice/parsers/schema_defs/ssp/m3.py | 519 ++++++-- .../tdpservice/parsers/schema_defs/tanf/t1.py | 903 +++++++++---- .../tdpservice/parsers/schema_defs/tanf/t2.py | 1126 ++++++++++++++--- .../tdpservice/parsers/schema_defs/tanf/t3.py | 780 ++++++++---- .../tdpservice/parsers/schema_defs/tanf/t4.py | 184 ++- .../tdpservice/parsers/schema_defs/tanf/t5.py | 529 ++++++-- .../tdpservice/parsers/schema_defs/tanf/t6.py | 671 +++++++--- 10 files changed, 4896 insertions(+), 1364 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index 127508d96..f20e05541 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -11,44 +11,172 @@ preparsing_validators=[ validators.hasLength( 23, - lambda value, length: f'Header length is {len(value)} but must be {length} characters.' + lambda value, length: f"Header length is {len(value)} but must be {length} characters.", ), - validators.startsWith('HEADER'), + validators.startsWith("HEADER"), ], postparsing_validators=[], fields=[ - Field(item="2", name='title', friendly_name='title', type='string', startIndex=0, endIndex=6, required=True, validators=[ - validators.matches('HEADER'), - ]), - Field(item="4", name='year', friendly_name='year', type='number', startIndex=6, endIndex=10, required=True, validators=[ - validators.isInLimits(2000, 2099) - ]), - Field(item="5", name='quarter', friendly_name='quarter', type='string', startIndex=10, endIndex=11, required=True, validators=[ - validators.oneOf(['1', '2', '3', '4']) - ]), - Field(item="6", name='type', friendly_name='type', type='string', startIndex=11, endIndex=12, required=True, validators=[ - validators.oneOf(['A', 'C', 'G', 'S']) - ]), - Field(item="1", name='state_fips', friendly_name='state fips', type='string', startIndex=12, endIndex=14, required=True, validators=[ - validators.oneOf(("01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "15", "16", "17", "18", - "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", - "34", "35", "36", "37", "38", "39", "40", "41", "42", "44", "45", "46", "47", "48", "49", - "50", "51", "53", "54", "55", "56", "66", "72", "78")) - ]), - Field(item="3", name='tribe_code', friendly_name='tribe code', type='string', startIndex=14, endIndex=17, required=False, validators=[ - validators.isInStringRange(0, 999) - ]), - Field(item="7", name='program_type', friendly_name='program type', type='string', startIndex=17, endIndex=20, required=True, validators=[ - validators.oneOf(['TAN', 'SSP']) - ]), - Field(item="8", name='edit', friendly_name='edit', type='string', startIndex=20, endIndex=21, required=True, validators=[ - validators.oneOf(['1', '2']) - ]), - Field(item="9", name='encryption', friendly_name='encryption', type='string', startIndex=21, endIndex=22, required=False, validators=[ - validators.oneOf([' ', 'E']) - ]), - Field(item="10", name='update', friendly_name='update', type='string', startIndex=22, endIndex=23, required=True, validators=[ - validators.oneOf(['N', 'D', 'U']) - ]), + Field( + item="2", + name="title", + friendly_name="title", + type="string", + startIndex=0, + endIndex=6, + required=True, + validators=[ + validators.matches("HEADER"), + ], + ), + Field( + item="4", + name="year", + friendly_name="year", + type="number", + startIndex=6, + endIndex=10, + required=True, + validators=[validators.isInLimits(2000, 2099)], + ), + Field( + item="5", + name="quarter", + friendly_name="quarter", + type="string", + startIndex=10, + endIndex=11, + required=True, + validators=[validators.oneOf(["1", "2", "3", "4"])], + ), + Field( + item="6", + name="type", + friendly_name="type", + type="string", + startIndex=11, + endIndex=12, + required=True, + validators=[validators.oneOf(["A", "C", "G", "S"])], + ), + Field( + item="1", + name="state_fips", + friendly_name="state fips", + type="string", + startIndex=12, + endIndex=14, + required=True, + validators=[ + validators.oneOf( + ( + "01", + "02", + "04", + "05", + "06", + "08", + "09", + "10", + "11", + "12", + "13", + "15", + "16", + "17", + "18", + "19", + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "40", + "41", + "42", + "44", + "45", + "46", + "47", + "48", + "49", + "50", + "51", + "53", + "54", + "55", + "56", + "66", + "72", + "78", + ) + ) + ], + ), + Field( + item="3", + name="tribe_code", + friendly_name="tribe code", + type="string", + startIndex=14, + endIndex=17, + required=False, + validators=[validators.isInStringRange(0, 999)], + ), + Field( + item="7", + name="program_type", + friendly_name="program type", + type="string", + startIndex=17, + endIndex=20, + required=True, + validators=[validators.oneOf(["TAN", "SSP"])], + ), + Field( + item="8", + name="edit", + friendly_name="edit", + type="string", + startIndex=20, + endIndex=21, + required=True, + validators=[validators.oneOf(["1", "2"])], + ), + Field( + item="9", + name="encryption", + friendly_name="encryption", + type="string", + startIndex=21, + endIndex=22, + required=False, + validators=[validators.oneOf([" ", "E"])], + ), + Field( + item="10", + name="update", + friendly_name="update", + type="string", + startIndex=22, + endIndex=23, + required=True, + validators=[validators.oneOf(["N", "D", "U"])], + ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 77eba6458..ee00588c0 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -8,101 +8,445 @@ from tdpservice.search_indexes.models.ssp import SSP_M1 m1 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=SSP_M1, - preparsing_validators=[ - validators.hasLength(150), - ], - 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='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="2", name='COUNTY_FIPS_CODE', friendly_name='county fips code', type='string', startIndex=19, endIndex=22, - required=True, validators=[]), - Field(item="4", name='STRATUM', friendly_name='stratum', type='string', startIndex=22, endIndex=24, - required=True, validators=[]), - Field(item="6", name='ZIP_CODE', friendly_name='zip code', type='string', startIndex=24, endIndex=29, - required=True, validators=[]), - Field(item="7", name='DISPOSITION', friendly_name='disposition', type='number', startIndex=29, endIndex=30, - required=True, validators=[]), - Field(item="8", name='NBR_FAMILY_MEMBERS', friendly_name='number of family numbers', type='number', startIndex=30, endIndex=32, - required=True, validators=[]), - Field(item="9", name='FAMILY_TYPE', friendly_name='family type', type='number', startIndex=32, endIndex=33, - required=True, validators=[]), - Field(item="10", name='TANF_ASST_IN_6MONTHS', friendly_name='tanf assitance in 6 months', type='number', startIndex=33, endIndex=34, - required=True, validators=[]), - Field(item="11", name='RECEIVES_SUB_HOUSING', friendly_name='receives subsidized housing', type='number', startIndex=34, endIndex=35, - required=True, validators=[]), - Field(item="12", name='RECEIVES_MED_ASSISTANCE', friendly_name='receives medical assisstance', type='number', startIndex=35, endIndex=36, - required=True, validators=[]), - Field(item="13", name='RECEIVES_FOOD_STAMPS', friendly_name='receives food assisstance', type='number', startIndex=36, endIndex=37, - required=True, validators=[]), - Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', friendly_name='aount of food stamp assisstance', type='number', startIndex=37, endIndex=41, - required=True, validators=[]), - Field(item="15", name='RECEIVES_SUB_CC', friendly_name='receives subsidized child care', type='number', startIndex=41, endIndex=42, - required=True, validators=[]), - Field(item="16", name='AMT_SUB_CC', friendly_name='amount of subsidized child care', type='number', startIndex=42, endIndex=46, - required=True, validators=[]), - Field(item="17", name='CHILD_SUPPORT_AMT', friendly_name='child support amount', type='number', startIndex=46, endIndex=50, - required=True, validators=[]), - Field(item="18", name='FAMILY_CASH_RESOURCES', friendly_name='family cash resources', type='number', startIndex=50, endIndex=54, - required=True, validators=[]), - Field(item="19A", name='CASH_AMOUNT', friendly_name='cash amount', type='number', startIndex=54, endIndex=58, - required=True, validators=[]), - Field(item="19B", name='NBR_MONTHS', friendly_name='number of months', type='number', startIndex=58, endIndex=61, - required=True, validators=[]), - Field(item="20A", name='CC_AMOUNT', friendly_name='child care amount', type='number', startIndex=61, endIndex=65, - required=True, validators=[]), - Field(item="20B", name='CHILDREN_COVERED', friendly_name='children covered', type='number', startIndex=65, endIndex=67, - required=True, validators=[]), - Field(item="20C", name='CC_NBR_MONTHS', friendly_name='child care - number of months', type='number', startIndex=67, endIndex=70, - required=True, validators=[]), - Field(item="21A", name='TRANSP_AMOUNT', friendly_name='transportation amount', type='number', startIndex=70, endIndex=74, - required=True, validators=[]), - Field(item="21B", name='TRANSP_NBR_MONTHS', friendly_name='transmportation number of months', type='number', startIndex=74, endIndex=77, - required=True, validators=[]), - Field(item="22A", name='TRANSITION_SERVICES_AMOUNT', friendly_name='transition services amount', type='number', startIndex=77, endIndex=81, - required=True, validators=[]), - Field(item="22B", name='TRANSITION_NBR_MONTHS', friendly_name='transition number of months', type='number', startIndex=81, endIndex=84, - required=True, validators=[]), - Field(item="23A", name='OTHER_AMOUNT', friendly_name='other amount', type='number', startIndex=84, endIndex=88, - required=True, validators=[]), - Field(item="23B", name='OTHER_NBR_MONTHS', friendly_name='other nuber of months', type='number', startIndex=88, endIndex=91, - required=True, validators=[]), - Field(item="24AI", name='SANC_REDUCTION_AMT', friendly_name='sanction reduction amount', type='number', startIndex=91, endIndex=95, - required=True, validators=[]), - Field(item="24AII", name='WORK_REQ_SANCTION', friendly_name='work requirements sanction', type='number', startIndex=95, endIndex=96, - required=True, validators=[]), - Field(item="24AIII", name='FAMILY_SANC_ADULT', friendly_name='family sanction for adult', type='number', startIndex=96, endIndex=97, - required=True, validators=[]), - Field(item="24AIV", name='SANC_TEEN_PARENT', friendly_name='santion for teen parent', type='number', startIndex=97, endIndex=98, - required=True, validators=[]), - Field(item="24AV", name='NON_COOPERATION_CSE', friendly_name='non coopeartion case', type='number', startIndex=98, endIndex=99, - required=True, validators=[]), - Field(item="24AVI", name='FAILURE_TO_COMPLY', friendly_name='failure to comply', type='number', startIndex=99, endIndex=100, - required=True, validators=[]), - Field(item="24AVII", name='OTHER_SANCTION', friendly_name='other sanciton', type='number', startIndex=100, endIndex=101, - required=True, validators=[]), - Field(item="24B", name='RECOUPMENT_PRIOR_OVRPMT', friendly_name='recoupment prior overpayment', type='number', startIndex=101, endIndex=105, - required=True, validators=[]), - Field(item="24CI", name='OTHER_TOTAL_REDUCTIONS', friendly_name='other total reductions', type='number', startIndex=105, endIndex=109, - required=True, validators=[]), - Field(item="24CII", name='FAMILY_CAP', friendly_name='family cap', type='number', startIndex=109, endIndex=110, - required=True, validators=[]), - Field(item="24CIII", name='REDUCTIONS_ON_RECEIPTS', friendly_name='reductions on receipts', type='number', startIndex=110, endIndex=111, - required=True, validators=[]), - Field(item="24CIV", name='OTHER_NON_SANCTION', friendly_name='other non santion', type='number', startIndex=111, endIndex=112, - required=True, validators=[]), - Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', friendly_name='waiver evaluation xperimental and control groups', type='number', startIndex=112, endIndex=113, - required=True, validators=[]), - Field(item="-1", name='BLANK', friendly_name='blank', type='string', startIndex=113, endIndex=150, - required=False, validators=[]), - ] + model=SSP_M1, + preparsing_validators=[ + validators.hasLength(150), + ], + 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="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + friendly_name="county fips code", + type="string", + startIndex=19, + endIndex=22, + required=True, + validators=[], + ), + Field( + item="4", + name="STRATUM", + friendly_name="stratum", + type="string", + startIndex=22, + endIndex=24, + required=True, + validators=[], + ), + Field( + item="6", + name="ZIP_CODE", + friendly_name="zip code", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[], + ), + Field( + item="7", + name="DISPOSITION", + friendly_name="disposition", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[], + ), + Field( + item="8", + name="NBR_FAMILY_MEMBERS", + friendly_name="number of family numbers", + type="number", + startIndex=30, + endIndex=32, + required=True, + validators=[], + ), + Field( + item="9", + name="FAMILY_TYPE", + friendly_name="family type", + type="number", + startIndex=32, + endIndex=33, + required=True, + validators=[], + ), + Field( + item="10", + name="TANF_ASST_IN_6MONTHS", + friendly_name="tanf assitance in 6 months", + type="number", + startIndex=33, + endIndex=34, + required=True, + validators=[], + ), + Field( + item="11", + name="RECEIVES_SUB_HOUSING", + friendly_name="receives subsidized housing", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[], + ), + Field( + item="12", + name="RECEIVES_MED_ASSISTANCE", + friendly_name="receives medical assisstance", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[], + ), + Field( + item="13", + name="RECEIVES_FOOD_STAMPS", + friendly_name="receives food assisstance", + type="number", + startIndex=36, + endIndex=37, + required=True, + validators=[], + ), + Field( + item="14", + name="AMT_FOOD_STAMP_ASSISTANCE", + friendly_name="aount of food stamp assisstance", + type="number", + startIndex=37, + endIndex=41, + required=True, + validators=[], + ), + Field( + item="15", + name="RECEIVES_SUB_CC", + friendly_name="receives subsidized child care", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[], + ), + Field( + item="16", + name="AMT_SUB_CC", + friendly_name="amount of subsidized child care", + type="number", + startIndex=42, + endIndex=46, + required=True, + validators=[], + ), + Field( + item="17", + name="CHILD_SUPPORT_AMT", + friendly_name="child support amount", + type="number", + startIndex=46, + endIndex=50, + required=True, + validators=[], + ), + Field( + item="18", + name="FAMILY_CASH_RESOURCES", + friendly_name="family cash resources", + type="number", + startIndex=50, + endIndex=54, + required=True, + validators=[], + ), + Field( + item="19A", + name="CASH_AMOUNT", + friendly_name="cash amount", + type="number", + startIndex=54, + endIndex=58, + required=True, + validators=[], + ), + Field( + item="19B", + name="NBR_MONTHS", + friendly_name="number of months", + type="number", + startIndex=58, + endIndex=61, + required=True, + validators=[], + ), + Field( + item="20A", + name="CC_AMOUNT", + friendly_name="child care amount", + type="number", + startIndex=61, + endIndex=65, + required=True, + validators=[], + ), + Field( + item="20B", + name="CHILDREN_COVERED", + friendly_name="children covered", + type="number", + startIndex=65, + endIndex=67, + required=True, + validators=[], + ), + Field( + item="20C", + name="CC_NBR_MONTHS", + friendly_name="child care - number of months", + type="number", + startIndex=67, + endIndex=70, + required=True, + validators=[], + ), + Field( + item="21A", + name="TRANSP_AMOUNT", + friendly_name="transportation amount", + type="number", + startIndex=70, + endIndex=74, + required=True, + validators=[], + ), + Field( + item="21B", + name="TRANSP_NBR_MONTHS", + friendly_name="transmportation number of months", + type="number", + startIndex=74, + endIndex=77, + required=True, + validators=[], + ), + Field( + item="22A", + name="TRANSITION_SERVICES_AMOUNT", + friendly_name="transition services amount", + type="number", + startIndex=77, + endIndex=81, + required=True, + validators=[], + ), + Field( + item="22B", + name="TRANSITION_NBR_MONTHS", + friendly_name="transition number of months", + type="number", + startIndex=81, + endIndex=84, + required=True, + validators=[], + ), + Field( + item="23A", + name="OTHER_AMOUNT", + friendly_name="other amount", + type="number", + startIndex=84, + endIndex=88, + required=True, + validators=[], + ), + Field( + item="23B", + name="OTHER_NBR_MONTHS", + friendly_name="other nuber of months", + type="number", + startIndex=88, + endIndex=91, + required=True, + validators=[], + ), + Field( + item="24AI", + name="SANC_REDUCTION_AMT", + friendly_name="sanction reduction amount", + type="number", + startIndex=91, + endIndex=95, + required=True, + validators=[], + ), + Field( + item="24AII", + name="WORK_REQ_SANCTION", + friendly_name="work requirements sanction", + type="number", + startIndex=95, + endIndex=96, + required=True, + validators=[], + ), + Field( + item="24AIII", + name="FAMILY_SANC_ADULT", + friendly_name="family sanction for adult", + type="number", + startIndex=96, + endIndex=97, + required=True, + validators=[], + ), + Field( + item="24AIV", + name="SANC_TEEN_PARENT", + friendly_name="santion for teen parent", + type="number", + startIndex=97, + endIndex=98, + required=True, + validators=[], + ), + Field( + item="24AV", + name="NON_COOPERATION_CSE", + friendly_name="non coopeartion case", + type="number", + startIndex=98, + endIndex=99, + required=True, + validators=[], + ), + Field( + item="24AVI", + name="FAILURE_TO_COMPLY", + friendly_name="failure to comply", + type="number", + startIndex=99, + endIndex=100, + required=True, + validators=[], + ), + Field( + item="24AVII", + name="OTHER_SANCTION", + friendly_name="other sanciton", + type="number", + startIndex=100, + endIndex=101, + required=True, + validators=[], + ), + Field( + item="24B", + name="RECOUPMENT_PRIOR_OVRPMT", + friendly_name="recoupment prior overpayment", + type="number", + startIndex=101, + endIndex=105, + required=True, + validators=[], + ), + Field( + item="24CI", + name="OTHER_TOTAL_REDUCTIONS", + friendly_name="other total reductions", + type="number", + startIndex=105, + endIndex=109, + required=True, + validators=[], + ), + Field( + item="24CII", + name="FAMILY_CAP", + friendly_name="family cap", + type="number", + startIndex=109, + endIndex=110, + required=True, + validators=[], + ), + Field( + item="24CIII", + name="REDUCTIONS_ON_RECEIPTS", + friendly_name="reductions on receipts", + type="number", + startIndex=110, + endIndex=111, + required=True, + validators=[], + ), + Field( + item="24CIV", + name="OTHER_NON_SANCTION", + friendly_name="other non santion", + type="number", + startIndex=111, + endIndex=112, + required=True, + validators=[], + ), + Field( + item="25", + name="WAIVER_EVAL_CONTROL_GRPS", + friendly_name="waiver evaluation xperimental and control groups", + type="number", + startIndex=112, + endIndex=113, + required=True, + validators=[], + ), + Field( + item="-1", + name="BLANK", + friendly_name="blank", + type="string", + startIndex=113, + endIndex=150, + required=False, + validators=[], + ), + ], ) - ] - ) + ] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index a1a5a720b..aade06184 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -10,147 +10,677 @@ m2 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=SSP_M2, - preparsing_validators=[ - validators.hasLength(150), - ], - 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='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="26", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, - required=True, validators=[]), - Field(item="27", name='NONCUSTODIAL_PARENT', friendly_name='noncustodial parent', type='number', startIndex=20, endIndex=21, - required=True, validators=[]), - Field(item="28", name='DATE_OF_BIRTH', friendly_name='date of birth', type='string', startIndex=21, endIndex=29, - required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', friendly_name='social security number - SSN', type='string', - startIndex=29, endIndex=38, required=True, validators=[], is_encrypted=False), - Field(item="30A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=38, endIndex=39, required=True, - validators=[]), - Field(item="30B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=39, endIndex=40, - required=True, validators=[]), - Field(item="30C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=40, endIndex=41, - required=True, validators=[]), - Field(item="30D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=41, endIndex=42, - required=True, validators=[]), - Field(item="30E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=42, endIndex=43, - required=True, validators=[]), - Field(item="30F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=43, endIndex=44, - required=True, validators=[]), - Field(item="31", name='GENDER', friendly_name='gender', type='number', startIndex=44, endIndex=45, - required=True, validators=[]), - Field(item="32A", name='FED_OASDI_PROGRAM', friendly_name='federal qasdi program', type='number', startIndex=45, endIndex=46, - required=True, validators=[]), - Field(item="32B", name='FED_DISABILITY_STATUS', friendly_name='federal disability status', type='number', startIndex=46, endIndex=47, - required=True, validators=[]), - Field(item="32C", name='DISABLED_TITLE_XIVAPDT', friendly_name='disabled title xivapdt', type='number', startIndex=47, endIndex=48, - required=True, validators=[]), - Field(item="32D", name='AID_AGED_BLIND', friendly_name='receives aid to the aid aged blind', type='number', startIndex=48, endIndex=49, - required=True, validators=[]), - Field(item="32E", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=49, endIndex=50, - required=True, validators=[]), - Field(item="33", name='MARITAL_STATUS', friendly_name='marital status', type='number', startIndex=50, endIndex=51, - required=True, validators=[]), - Field(item="34", name='RELATIONSHIP_HOH', friendly_name='relationship to head of household', type='number', startIndex=51, endIndex=53, - required=True, validators=[]), - Field(item="35", name='PARENT_MINOR_CHILD', friendly_name='parent of minor child', type='number', startIndex=53, endIndex=54, - required=True, validators=[]), - Field(item="36", name='NEEDS_PREGNANT_WOMAN', friendly_name='needs of pregnant woman', type='number', startIndex=54, endIndex=55, - required=True, validators=[]), - Field(item="37", name='EDUCATION_LEVEL', friendly_name='education level', type='number', startIndex=55, endIndex=57, - required=True, validators=[]), - Field(item="38", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=57, endIndex=58, - required=True, validators=[]), - Field(item="39", name='COOPERATION_CHILD_SUPPORT', friendly_name='cooperation child support', type='number', startIndex=58, endIndex=59, - required=True, validators=[]), - Field(item="40", name='EMPLOYMENT_STATUS', friendly_name='employment status', type='number', startIndex=59, endIndex=60, - required=True, validators=[]), - Field(item="41", name='WORK_ELIGIBLE_INDICATOR', friendly_name='work eligible indicator', type='number', startIndex=60, endIndex=62, - required=True, validators=[]), - Field(item="42", name='WORK_PART_STATUS', friendly_name='work part-time status', type='number', startIndex=62, endIndex=64, - required=True, validators=[]), - Field(item="43", name='UNSUB_EMPLOYMENT', friendly_name='unsubsidized employment', type='number', startIndex=64, endIndex=66, - required=True, validators=[]), - Field(item="44", name='SUB_PRIVATE_EMPLOYMENT', friendly_name='subsidized private employment', type='number', startIndex=66, endIndex=68, - required=True, validators=[]), - Field(item="45", name='SUB_PUBLIC_EMPLOYMENT', friendly_name='subsidized public employment', type='number', startIndex=68, endIndex=70, - required=True, validators=[]), - Field(item="46A", name='WORK_EXPERIENCE_HOP', friendly_name='work experience - hours of participation', type='number', startIndex=70, endIndex=72, - required=True, validators=[]), - Field(item="46B", name='WORK_EXPERIENCE_EA', friendly_name='work experience - excused absense', type='number', startIndex=72, endIndex=74, - required=True, validators=[]), - Field(item="46C", name='WORK_EXPERIENCE_HOL', friendly_name='work experience holiday', type='number', startIndex=74, endIndex=76, - required=True, validators=[]), - Field(item="47", name='OJT', friendly_name='OJT', type='number', startIndex=76, endIndex=78, - required=True, validators=[]), - Field(item="48A", name='JOB_SEARCH_HOP', friendly_name='job search - hours of participation', type='number', startIndex=78, endIndex=80, - required=True, validators=[]), - Field(item="48B", name='JOB_SEARCH_EA', friendly_name='job search - excused absence', type='number', startIndex=80, endIndex=82, - required=True, validators=[]), - Field(item="48C", name='JOB_SEARCH_HOL', friendly_name='job search - holiday', type='number', startIndex=82, endIndex=84, - required=True, validators=[]), - Field(item="49A", name='COMM_SERVICES_HOP', friendly_name='community services - hours of participation', type='number', startIndex=84, endIndex=86, - required=True, validators=[]), - Field(item="49B", name='COMM_SERVICES_EA', friendly_name='community services - excused absence', type='number', startIndex=86, endIndex=88, - required=True, validators=[]), - Field(item="49C", name='COMM_SERVICES_HOL', friendly_name='community services - holiday', type='number', startIndex=88, endIndex=90, - required=True, validators=[]), - Field(item="50A", name='VOCATIONAL_ED_TRAINING_HOP', friendly_name='vocational education training - hours of operation', type='number', startIndex=90, endIndex=92, - required=True, validators=[]), - Field(item="50B", name='VOCATIONAL_ED_TRAINING_EA', friendly_name='vocational education training - excused absence', type='number', startIndex=92, endIndex=94, - required=True, validators=[]), - Field(item="50C", name='VOCATIONAL_ED_TRAINING_HOL', friendly_name='vocational education training - holiday', type='number', startIndex=94, endIndex=96, - required=True, validators=[]), - Field(item="51A", name='JOB_SKILLS_TRAINING_HOP', friendly_name='job skills training - hours of operation', type='number', startIndex=96, endIndex=98, - required=True, validators=[]), - Field(item="51B", name='JOB_SKILLS_TRAINING_EA', friendly_name='job skills training - excused absence', type='number', startIndex=98, endIndex=100, - required=True, validators=[]), - Field(item="51C", name='JOB_SKILLS_TRAINING_HOL', friendly_name='job skills training - holiday', type='number', startIndex=100, endIndex=102, - required=True, validators=[]), - Field(item="52A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', friendly_name='education no high school diploma - hours of participation', type='number', startIndex=102, endIndex=104, - required=True, validators=[]), - Field(item="52B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', friendly_name='education no high school diploma - excused absence', type='number', startIndex=104, endIndex=106, - required=True, validators=[]), - Field(item="52C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', friendly_name='education no high school diploma - holiday', type='number', startIndex=106, endIndex=108, - required=True, validators=[]), - Field(item="53A", name='SCHOOL_ATTENDENCE_HOP', friendly_name='school attendance - hours of participation', type='number', startIndex=108, endIndex=110, - required=True, validators=[]), - Field(item="53B", name='SCHOOL_ATTENDENCE_EA', friendly_name='school attendance - excused absence', type='number', startIndex=110, endIndex=112, - required=True, validators=[]), - Field(item="53C", name='SCHOOL_ATTENDENCE_HOL', friendly_name='school attendance - holiday', type='number', startIndex=112, endIndex=114, - required=True, validators=[]), - Field(item="54A", name='PROVIDE_CC_HOP', friendly_name='provide child care - hours of participation', type='number', startIndex=114, endIndex=116, - required=True, validators=[]), - Field(item="54B", name='PROVIDE_CC_EA', friendly_name='provide child care - excused absence', type='number', startIndex=116, endIndex=118, - required=True, validators=[]), - Field(item="54C", name='PROVIDE_CC_HOL', friendly_name='provide child care - holiday', type='number', startIndex=118, endIndex=120, - required=True, validators=[]), - Field(item="55", name='OTHER_WORK_ACTIVITIES', friendly_name='other work activities', type='number', startIndex=120, endIndex=122, - required=True, validators=[]), - Field(item="56", name='DEEMED_HOURS_FOR_OVERALL', friendly_name='deemed hours for overall', type='number', startIndex=122, endIndex=124, - required=True, validators=[]), - Field(item="57", name='DEEMED_HOURS_FOR_TWO_PARENT', friendly_name='deemed hours for two parents', type='number', startIndex=124, endIndex=126, - required=True, validators=[]), - Field(item="58", name='EARNED_INCOME', type='number', friendly_name='earned income', startIndex=126, endIndex=130, - required=True, validators=[]), - Field(item="59A", name='UNEARNED_INCOME_TAX_CREDIT', friendly_name='unearned income tax credit', type='number', startIndex=130, endIndex=134, - required=True, validators=[]), - Field(item="59B", name='UNEARNED_SOCIAL_SECURITY', friendly_name='unearned social security', type='number', startIndex=134, endIndex=138, - required=True, validators=[]), - Field(item="59C", name='UNEARNED_SSI', friendly_name='unearned SSI benefit', type='number', startIndex=138, endIndex=142, - required=True, validators=[]), - Field(item="59D", name='UNEARNED_WORKERS_COMP', friendly_name='unearned workers compensation', type='number', startIndex=142, endIndex=146, - required=True, validators=[]), - Field(item="59E", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='number', startIndex=146, endIndex=150, - required=True, validators=[]), - ], + model=SSP_M2, + preparsing_validators=[ + validators.hasLength(150), + ], + 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="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="26", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[], + ), + Field( + item="27", + name="NONCUSTODIAL_PARENT", + friendly_name="noncustodial parent", + type="number", + startIndex=20, + endIndex=21, + required=True, + validators=[], + ), + Field( + item="28", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="string", + startIndex=21, + endIndex=29, + required=True, + validators=[], + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="29", + name="SSN", + friendly_name="social security number - SSN", + type="string", + startIndex=29, + endIndex=38, + required=True, + validators=[], + is_encrypted=False, + ), + Field( + item="30A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[], + ), + Field( + item="30B", + name="RACE_AMER_INDIAN", + friendly_name="race american indian", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[], + ), + Field( + item="30C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[], + ), + Field( + item="30D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[], + ), + Field( + item="30E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[], + ), + Field( + item="30F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[], + ), + Field( + item="31", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[], + ), + Field( + item="32A", + name="FED_OASDI_PROGRAM", + friendly_name="federal qasdi program", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[], + ), + Field( + item="32B", + name="FED_DISABILITY_STATUS", + friendly_name="federal disability status", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[], + ), + Field( + item="32C", + name="DISABLED_TITLE_XIVAPDT", + friendly_name="disabled title xivapdt", + type="number", + startIndex=47, + endIndex=48, + required=True, + validators=[], + ), + Field( + item="32D", + name="AID_AGED_BLIND", + friendly_name="receives aid to the aid aged blind", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[], + ), + Field( + item="32E", + name="RECEIVE_SSI", + friendly_name="receive ssi", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[], + ), + Field( + item="33", + name="MARITAL_STATUS", + friendly_name="marital status", + type="number", + startIndex=50, + endIndex=51, + required=True, + validators=[], + ), + Field( + item="34", + name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", + type="number", + startIndex=51, + endIndex=53, + required=True, + validators=[], + ), + Field( + item="35", + name="PARENT_MINOR_CHILD", + friendly_name="parent of minor child", + type="number", + startIndex=53, + endIndex=54, + required=True, + validators=[], + ), + Field( + item="36", + name="NEEDS_PREGNANT_WOMAN", + friendly_name="needs of pregnant woman", + type="number", + startIndex=54, + endIndex=55, + required=True, + validators=[], + ), + Field( + item="37", + name="EDUCATION_LEVEL", + friendly_name="education level", + type="number", + startIndex=55, + endIndex=57, + required=True, + validators=[], + ), + Field( + item="38", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=57, + endIndex=58, + required=True, + validators=[], + ), + Field( + item="39", + name="COOPERATION_CHILD_SUPPORT", + friendly_name="cooperation child support", + type="number", + startIndex=58, + endIndex=59, + required=True, + validators=[], + ), + Field( + item="40", + name="EMPLOYMENT_STATUS", + friendly_name="employment status", + type="number", + startIndex=59, + endIndex=60, + required=True, + validators=[], + ), + Field( + item="41", + name="WORK_ELIGIBLE_INDICATOR", + friendly_name="work eligible indicator", + type="number", + startIndex=60, + endIndex=62, + required=True, + validators=[], + ), + Field( + item="42", + name="WORK_PART_STATUS", + friendly_name="work part-time status", + type="number", + startIndex=62, + endIndex=64, + required=True, + validators=[], + ), + Field( + item="43", + name="UNSUB_EMPLOYMENT", + friendly_name="unsubsidized employment", + type="number", + startIndex=64, + endIndex=66, + required=True, + validators=[], + ), + Field( + item="44", + name="SUB_PRIVATE_EMPLOYMENT", + friendly_name="subsidized private employment", + type="number", + startIndex=66, + endIndex=68, + required=True, + validators=[], + ), + Field( + item="45", + name="SUB_PUBLIC_EMPLOYMENT", + friendly_name="subsidized public employment", + type="number", + startIndex=68, + endIndex=70, + required=True, + validators=[], + ), + Field( + item="46A", + name="WORK_EXPERIENCE_HOP", + friendly_name="work experience - hours of participation", + type="number", + startIndex=70, + endIndex=72, + required=True, + validators=[], + ), + Field( + item="46B", + name="WORK_EXPERIENCE_EA", + friendly_name="work experience - excused absense", + type="number", + startIndex=72, + endIndex=74, + required=True, + validators=[], + ), + Field( + item="46C", + name="WORK_EXPERIENCE_HOL", + friendly_name="work experience holiday", + type="number", + startIndex=74, + endIndex=76, + required=True, + validators=[], + ), + Field( + item="47", + name="OJT", + friendly_name="OJT", + type="number", + startIndex=76, + endIndex=78, + required=True, + validators=[], + ), + Field( + item="48A", + name="JOB_SEARCH_HOP", + friendly_name="job search - hours of participation", + type="number", + startIndex=78, + endIndex=80, + required=True, + validators=[], + ), + Field( + item="48B", + name="JOB_SEARCH_EA", + friendly_name="job search - excused absence", + type="number", + startIndex=80, + endIndex=82, + required=True, + validators=[], + ), + Field( + item="48C", + name="JOB_SEARCH_HOL", + friendly_name="job search - holiday", + type="number", + startIndex=82, + endIndex=84, + required=True, + validators=[], + ), + Field( + item="49A", + name="COMM_SERVICES_HOP", + friendly_name="community services - hours of participation", + type="number", + startIndex=84, + endIndex=86, + required=True, + validators=[], + ), + Field( + item="49B", + name="COMM_SERVICES_EA", + friendly_name="community services - excused absence", + type="number", + startIndex=86, + endIndex=88, + required=True, + validators=[], + ), + Field( + item="49C", + name="COMM_SERVICES_HOL", + friendly_name="community services - holiday", + type="number", + startIndex=88, + endIndex=90, + required=True, + validators=[], + ), + Field( + item="50A", + name="VOCATIONAL_ED_TRAINING_HOP", + friendly_name="vocational education training - hours of operation", + type="number", + startIndex=90, + endIndex=92, + required=True, + validators=[], + ), + Field( + item="50B", + name="VOCATIONAL_ED_TRAINING_EA", + friendly_name="vocational education training - excused absence", + type="number", + startIndex=92, + endIndex=94, + required=True, + validators=[], + ), + Field( + item="50C", + name="VOCATIONAL_ED_TRAINING_HOL", + friendly_name="vocational education training - holiday", + type="number", + startIndex=94, + endIndex=96, + required=True, + validators=[], + ), + Field( + item="51A", + name="JOB_SKILLS_TRAINING_HOP", + friendly_name="job skills training - hours of operation", + type="number", + startIndex=96, + endIndex=98, + required=True, + validators=[], + ), + Field( + item="51B", + name="JOB_SKILLS_TRAINING_EA", + friendly_name="job skills training - excused absence", + type="number", + startIndex=98, + endIndex=100, + required=True, + validators=[], + ), + Field( + item="51C", + name="JOB_SKILLS_TRAINING_HOL", + friendly_name="job skills training - holiday", + type="number", + startIndex=100, + endIndex=102, + required=True, + validators=[], + ), + Field( + item="52A", + name="ED_NO_HIGH_SCHOOL_DIPL_HOP", + friendly_name="education no high school diploma - hours of participation", + type="number", + startIndex=102, + endIndex=104, + required=True, + validators=[], + ), + Field( + item="52B", + name="ED_NO_HIGH_SCHOOL_DIPL_EA", + friendly_name="education no high school diploma - excused absence", + type="number", + startIndex=104, + endIndex=106, + required=True, + validators=[], + ), + Field( + item="52C", + name="ED_NO_HIGH_SCHOOL_DIPL_HOL", + friendly_name="education no high school diploma - holiday", + type="number", + startIndex=106, + endIndex=108, + required=True, + validators=[], + ), + Field( + item="53A", + name="SCHOOL_ATTENDENCE_HOP", + friendly_name="school attendance - hours of participation", + type="number", + startIndex=108, + endIndex=110, + required=True, + validators=[], + ), + Field( + item="53B", + name="SCHOOL_ATTENDENCE_EA", + friendly_name="school attendance - excused absence", + type="number", + startIndex=110, + endIndex=112, + required=True, + validators=[], + ), + Field( + item="53C", + name="SCHOOL_ATTENDENCE_HOL", + friendly_name="school attendance - holiday", + type="number", + startIndex=112, + endIndex=114, + required=True, + validators=[], + ), + Field( + item="54A", + name="PROVIDE_CC_HOP", + friendly_name="provide child care - hours of participation", + type="number", + startIndex=114, + endIndex=116, + required=True, + validators=[], + ), + Field( + item="54B", + name="PROVIDE_CC_EA", + friendly_name="provide child care - excused absence", + type="number", + startIndex=116, + endIndex=118, + required=True, + validators=[], + ), + Field( + item="54C", + name="PROVIDE_CC_HOL", + friendly_name="provide child care - holiday", + type="number", + startIndex=118, + endIndex=120, + required=True, + validators=[], + ), + Field( + item="55", + name="OTHER_WORK_ACTIVITIES", + friendly_name="other work activities", + type="number", + startIndex=120, + endIndex=122, + required=True, + validators=[], + ), + Field( + item="56", + name="DEEMED_HOURS_FOR_OVERALL", + friendly_name="deemed hours for overall", + type="number", + startIndex=122, + endIndex=124, + required=True, + validators=[], + ), + Field( + item="57", + name="DEEMED_HOURS_FOR_TWO_PARENT", + friendly_name="deemed hours for two parents", + type="number", + startIndex=124, + endIndex=126, + required=True, + validators=[], + ), + Field( + item="58", + name="EARNED_INCOME", + type="number", + friendly_name="earned income", + startIndex=126, + endIndex=130, + required=True, + validators=[], + ), + Field( + item="59A", + name="UNEARNED_INCOME_TAX_CREDIT", + friendly_name="unearned income tax credit", + type="number", + startIndex=130, + endIndex=134, + required=True, + validators=[], + ), + Field( + item="59B", + name="UNEARNED_SOCIAL_SECURITY", + friendly_name="unearned social security", + type="number", + startIndex=134, + endIndex=138, + required=True, + validators=[], + ), + Field( + item="59C", + name="UNEARNED_SSI", + friendly_name="unearned SSI benefit", + type="number", + startIndex=138, + endIndex=142, + required=True, + validators=[], + ), + Field( + item="59D", + name="UNEARNED_WORKERS_COMP", + friendly_name="unearned workers compensation", + type="number", + startIndex=142, + endIndex=146, + required=True, + validators=[], + ), + Field( + item="59E", + name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", + type="number", + startIndex=146, + endIndex=150, + required=True, + validators=[], + ), + ], ) - ] - ) + ] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index 7811bb066..349e0431b 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -15,49 +15,219 @@ ], 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='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="60", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, - required=True, validators=[]), - Field(item="61", name='DATE_OF_BIRTH', friendly_name='date of birth', type='string', startIndex=20, endIndex=28, - required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=28, - endIndex=37, required=True, validators=[], is_encrypted=False), - Field(item="63A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=37, endIndex=38, - required=True, validators=[]), - Field(item="63B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=38, endIndex=39, - required=True, validators=[]), - Field(item="63C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=39, endIndex=40, - required=True, validators=[]), - Field(item="63D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=40, endIndex=41, - required=True, validators=[]), - Field(item="63E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=41, endIndex=42, - required=True, validators=[]), - Field(item="63F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=42, endIndex=43, - required=True, validators=[]), - Field(item="64", name='GENDER', friendly_name='gender', type='number', startIndex=43, endIndex=44, - required=True, validators=[]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', friendly_name='receive nonssi benefits', type='number', startIndex=44, endIndex=45, - required=True, validators=[]), - Field(item="65B", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=45, endIndex=46, - required=True, validators=[]), - Field(item="66", name='RELATIONSHIP_HOH', friendly_name='relationship - ', type='number', startIndex=46, endIndex=48, - required=True, validators=[]), - Field(item="67", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=48, endIndex=49, - required=True, validators=[]), - Field(item="68", name='EDUCATION_LEVEL', friendly_name='education level', type='number', startIndex=49, endIndex=51, - required=True, validators=[]), - Field(item="69", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=51, endIndex=52, - required=True, validators=[]), - Field(item="70A", name='UNEARNED_SSI', friendly_name='unearned SSI', type='number', startIndex=52, endIndex=56, - required=True, validators=[]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='number', startIndex=56, endIndex=60, - required=True, validators=[]) - ] + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="60", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[], + ), + Field( + item="61", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="string", + startIndex=20, + endIndex=28, + required=True, + validators=[], + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="62", + name="SSN", + friendly_name="social security number - SSN", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[], + is_encrypted=False, + ), + Field( + item="63A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=37, + endIndex=38, + required=True, + validators=[], + ), + Field( + item="63B", + name="RACE_AMER_INDIAN", + friendly_name="race american indian", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[], + ), + Field( + item="63C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[], + ), + Field( + item="63D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[], + ), + Field( + item="63E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[], + ), + Field( + item="63F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[], + ), + Field( + item="64", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[], + ), + Field( + item="65A", + name="RECEIVE_NONSSI_BENEFITS", + friendly_name="receive nonssi benefits", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[], + ), + Field( + item="65B", + name="RECEIVE_SSI", + friendly_name="receive ssi", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[], + ), + Field( + item="66", + name="RELATIONSHIP_HOH", + friendly_name="relationship - ", + type="number", + startIndex=46, + endIndex=48, + required=True, + validators=[], + ), + Field( + item="67", + name="PARENT_MINOR_CHILD", + friendly_name="parent minor child", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[], + ), + Field( + item="68", + name="EDUCATION_LEVEL", + friendly_name="education level", + type="number", + startIndex=49, + endIndex=51, + required=True, + validators=[], + ), + Field( + item="69", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=51, + endIndex=52, + required=True, + validators=[], + ), + Field( + item="70A", + name="UNEARNED_SSI", + friendly_name="unearned SSI", + type="number", + startIndex=52, + endIndex=56, + required=True, + validators=[], + ), + Field( + item="70B", + name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", + type="number", + startIndex=56, + endIndex=60, + required=True, + validators=[], + ), + ], ) second_part_schema = RowSchema( @@ -68,54 +238,219 @@ ], 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='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="60", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=60, endIndex=61, - required=True, validators=[]), - Field(item="61", name='DATE_OF_BIRTH', friendly_name='date of birth', type='string', startIndex=61, endIndex=69, - required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=69, - endIndex=78, required=True, validators=[], is_encrypted=False), - Field(item="63A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=78, endIndex=79, - required=True, validators=[]), - Field(item="63B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=79, endIndex=80, - required=True, validators=[]), - Field(item="63C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=80, endIndex=81, - required=True, validators=[]), - Field(item="63D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=81, endIndex=82, - required=True, validators=[]), - Field(item="63E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=82, endIndex=83, - required=True, validators=[]), - Field(item="63F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=83, endIndex=84, - required=True, validators=[]), - Field(item="64", name='GENDER', friendly_name='gender', type='number', startIndex=84, endIndex=85, - required=True, validators=[]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', friendly_name='receive nonssi benefit', type='number', startIndex=85, endIndex=86, - required=True, validators=[]), - Field(item="65B", name='RECEIVE_SSI', friendly_name='receives ssi', type='number', startIndex=86, endIndex=87, - required=True, validators=[]), - Field(item="66", name='RELATIONSHIP_HOH', friendly_name='realtionship head of household', type='number', startIndex=87, endIndex=89, - required=True, validators=[]), - Field(item="67", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=89, endIndex=90, - required=True, validators=[]), - Field(item="68", name='EDUCATION_LEVEL', friendly_name='education level', type='number', startIndex=90, endIndex=92, - required=True, validators=[]), - Field(item="69", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=92, endIndex=93, - required=True, validators=[]), - Field(item="70A", name='UNEARNED_SSI', friendly_name='unearned ssi', type='number', startIndex=93, endIndex=97, - required=True, validators=[]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='number', startIndex=97, endIndex=101, - required=True, validators=[]) - ] + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="60", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=60, + endIndex=61, + required=True, + validators=[], + ), + Field( + item="61", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="string", + startIndex=61, + endIndex=69, + required=True, + validators=[], + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="62", + name="SSN", + friendly_name="social security number - SSN", + type="string", + startIndex=69, + endIndex=78, + required=True, + validators=[], + is_encrypted=False, + ), + Field( + item="63A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=78, + endIndex=79, + required=True, + validators=[], + ), + Field( + item="63B", + name="RACE_AMER_INDIAN", + friendly_name="race american indian", + type="number", + startIndex=79, + endIndex=80, + required=True, + validators=[], + ), + Field( + item="63C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=80, + endIndex=81, + required=True, + validators=[], + ), + Field( + item="63D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=81, + endIndex=82, + required=True, + validators=[], + ), + Field( + item="63E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=82, + endIndex=83, + required=True, + validators=[], + ), + Field( + item="63F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=83, + endIndex=84, + required=True, + validators=[], + ), + Field( + item="64", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=84, + endIndex=85, + required=True, + validators=[], + ), + Field( + item="65A", + name="RECEIVE_NONSSI_BENEFITS", + friendly_name="receive nonssi benefit", + type="number", + startIndex=85, + endIndex=86, + required=True, + validators=[], + ), + Field( + item="65B", + name="RECEIVE_SSI", + friendly_name="receives ssi", + type="number", + startIndex=86, + endIndex=87, + required=True, + validators=[], + ), + Field( + item="66", + name="RELATIONSHIP_HOH", + friendly_name="realtionship head of household", + type="number", + startIndex=87, + endIndex=89, + required=True, + validators=[], + ), + Field( + item="67", + name="PARENT_MINOR_CHILD", + friendly_name="parent minor child", + type="number", + startIndex=89, + endIndex=90, + required=True, + validators=[], + ), + Field( + item="68", + name="EDUCATION_LEVEL", + friendly_name="education level", + type="number", + startIndex=90, + endIndex=92, + required=True, + validators=[], + ), + Field( + item="69", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=92, + endIndex=93, + required=True, + validators=[], + ), + Field( + item="70A", + name="UNEARNED_SSI", + friendly_name="unearned ssi", + type="number", + startIndex=93, + endIndex=97, + required=True, + validators=[], + ), + Field( + item="70B", + name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", + type="number", + startIndex=97, + endIndex=101, + required=True, + validators=[], + ), + ], ) -m3 = SchemaManager( - schemas=[ - first_part_schema, - second_part_schema - ] -) +m3 = SchemaManager(schemas=[first_part_schema, second_part_schema]) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 02266e884..d4db7365a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -7,259 +7,668 @@ from tdpservice.search_indexes.models.tanf import TANF_T1 -t1 = SchemaManager(schemas=[ - RowSchema( +t1 = SchemaManager( + schemas=[ + RowSchema( model=TANF_T1, preparsing_validators=[ - validators.hasLength(156), + validators.hasLength(156), ], postparsing_validators=[ - validators.if_then_validator( - condition_field='CASH_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CHILDREN_COVERED', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CC_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSP_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSP_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSITION_SERVICES_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSITION_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='OTHER_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='OTHER_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='WORK_REQ_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAMILY_SANC_ADULT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='SANC_TEEN_PARENT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='NON_COOPERATION_CSE', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAILURE_TO_COMPLY', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='OTHER_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='FAMILY_CAP', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='REDUCTIONS_ON_RECEIPTS', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='OTHER_NON_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.sumIsLarger(("AMT_FOOD_STAMP_ASSISTANCE", "AMT_SUB_CC", "CASH_AMOUNT", "CC_AMOUNT", - "TRANSP_AMOUNT", "TRANSITION_SERVICES_AMOUNT", "OTHER_AMOUNT"), 0) + validators.if_then_validator( + condition_field="CASH_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="CC_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="CHILDREN_COVERED", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="CC_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="CC_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="TRANSP_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="TRANSP_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="TRANSITION_SERVICES_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="TRANSITION_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="OTHER_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="OTHER_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="WORK_REQ_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="FAMILY_SANC_ADULT", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="SANC_TEEN_PARENT", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="NON_COOPERATION_CSE", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="FAILURE_TO_COMPLY", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="OTHER_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="FAMILY_CAP", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="REDUCTIONS_ON_RECEIPTS", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="OTHER_NON_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.sumIsLarger( + ( + "AMT_FOOD_STAMP_ASSISTANCE", + "AMT_SUB_CC", + "CASH_AMOUNT", + "CC_AMOUNT", + "TRANSP_AMOUNT", + "TRANSITION_SERVICES_AMOUNT", + "OTHER_AMOUNT", + ), + 0, + ), ], fields=[ # add fields inclding friendly_name (based on name), type, start_index, end_index, required, validators - Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', friendly_name='reporting month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', friendly_name='county fips code', type='string', startIndex=19, endIndex=22, - required=True, validators=[ - validators.isNumber(), - ]), - Field(item="5", name='STRATUM', friendly_name='stratum', type='string', startIndex=22, endIndex=24, - required=True, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="7", name='ZIP_CODE', friendly_name='zip code', type='string', startIndex=24, endIndex=29, - required=True, validators=[ - validators.isNumber(), - ]), - Field(item="8", name='FUNDING_STREAM', friendly_name='funding stream', type='number', startIndex=29, endIndex=30, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="9", name='DISPOSITION', friendly_name='disposition', type='number', startIndex=30, endIndex=31, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="10", name='NEW_APPLICANT', friendly_name='new applicant', type='number', startIndex=31, endIndex=32, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="11", name='NBR_FAMILY_MEMBERS', friendly_name='number of family members', type='number', startIndex=32, endIndex=34, - required=True, validators=[ - validators.isLargerThan(0), - ]), - Field(item="12", name='FAMILY_TYPE', friendly_name='family type', type='number', startIndex=34, endIndex=35, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="13", name='RECEIVES_SUB_HOUSING', friendly_name='receives subsidized housing', type='number', startIndex=35, endIndex=36, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="14", name='RECEIVES_MED_ASSISTANCE', friendly_name='receives medical assisstance', type='number', startIndex=36, endIndex=37, - required=True, validators=[ - validators.isInLimits(1, 2), - ]), - Field(item="15", name='RECEIVES_FOOD_STAMPS', friendly_name='receives food stamps', type='number', startIndex=37, endIndex=38, - required=True, validators=[ - validators.isInLimits(0, 2), - ]), - Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', friendly_name='amount of food stamp assisstance', type='number', startIndex=38, endIndex=42, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="17", name='RECEIVES_SUB_CC', friendly_name='receives subsidized child care', type='number', startIndex=42, endIndex=43, - required=True, validators=[ - validators.isInLimits(0, 3), - ]), - Field(item="18", name='AMT_SUB_CC', friendly_name='amount of subsidized child care', type='number', startIndex=43, endIndex=47, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="19", name='CHILD_SUPPORT_AMT', friendly_name='child support amount', type='number', startIndex=47, endIndex=51, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="20", name='FAMILY_CASH_RESOURCES', friendly_name='family cash resources', type='number', startIndex=51, endIndex=55, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="21A", name='CASH_AMOUNT', friendly_name='cash amount', type='number', startIndex=55, endIndex=59, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="21B", name='NBR_MONTHS', friendly_name='number of months', type='number', startIndex=59, endIndex=62, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22A", name='CC_AMOUNT', friendly_name='child care amount', type='number', startIndex=62, endIndex=66, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22B", name='CHILDREN_COVERED', friendly_name='children covered', type='number', startIndex=66, endIndex=68, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22C", name='CC_NBR_MONTHS', friendly_name='child care number of months', type='number', startIndex=68, endIndex=71, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="23A", name='TRANSP_AMOUNT', friendly_name='transportation amount', type='number', startIndex=71, endIndex=75, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="23B", name='TRANSP_NBR_MONTHS', friendly_name='transportation number of months', type='number', startIndex=75, endIndex=78, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', friendly_name='transition service amount', type='number', startIndex=78, endIndex=82, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24B", name='TRANSITION_NBR_MONTHS', friendly_name='transition number of months', type='number', startIndex=82, endIndex=85, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="25A", name='OTHER_AMOUNT', friendly_name='other amount', type='number', startIndex=85, endIndex=89, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="25B", name='OTHER_NBR_MONTHS', friendly_name='other number of months', type='number', startIndex=89, endIndex=92, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26AI", name='SANC_REDUCTION_AMT', friendly_name='sanction reduction amount', type='number', startIndex=92, endIndex=96, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26AII", name='WORK_REQ_SANCTION', friendly_name='work requirement sanction', type='number', startIndex=96, endIndex=97, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AIII", name='FAMILY_SANC_ADULT', friendly_name='family sanction adult', type='number', startIndex=97, endIndex=98, - required=True, validators=[ - validators.oneOf([0, 1, 2]), - ]), - Field(item="26AIV", name='SANC_TEEN_PARENT', friendly_name='sanction for teen parent not attending school', type='number', startIndex=98, endIndex=99, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AV", name='NON_COOPERATION_CSE', friendly_name='non cooperation case', type='number', startIndex=99, endIndex=100, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AVI", name='FAILURE_TO_COMPLY', friendly_name='failure to comply', type='number', startIndex=100, endIndex=101, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AVII", name='OTHER_SANCTION', friendly_name='other sanction', type='number', startIndex=101, endIndex=102, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', friendly_name='recoupment of prior overpayment', type='number', startIndex=102, endIndex=106, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', friendly_name='other total reductions', type='number', startIndex=106, endIndex=110, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26CII", name='FAMILY_CAP', friendly_name='family cap', type='number', startIndex=110, endIndex=111, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26CIII", name='REDUCTIONS_ON_RECEIPTS', friendly_name='reductions on receipts', type='number', startIndex=111, endIndex=112, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26CIV", name='OTHER_NON_SANCTION', friendly_name='other non sanction', type='number', startIndex=112, endIndex=113, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', friendly_name='waiver evaluation experimental and control groups', type='string', startIndex=113, endIndex=114, - required=True, validators=[ - validators.or_validators(validators.matches('9'), validators.isEmpty()), - validators.isAlphaNumeric(), - ]), - Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', friendly_name='is the TANF family exempt from the federal time-limit provisions', type='number', startIndex=114, endIndex=116, - required=True, validators=[ - validators.oneOf([1, 2, 3, 4, - 6, 7, 8, 9]) - ]), - Field(item="29", name='FAMILY_NEW_CHILD', friendly_name='family new child', type='number', startIndex=116, endIndex=117, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="-1", name='BLANK', friendly_name='blank', type='string', startIndex=117, endIndex=156, required=False, - validators=[]), + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + friendly_name="reporting month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + friendly_name="county fips code", + type="string", + startIndex=19, + endIndex=22, + required=True, + validators=[ + validators.isNumber(), + ], + ), + Field( + item="5", + name="STRATUM", + friendly_name="stratum", + type="string", + startIndex=22, + endIndex=24, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="7", + name="ZIP_CODE", + friendly_name="zip code", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[ + validators.isNumber(), + ], + ), + Field( + item="8", + name="FUNDING_STREAM", + friendly_name="funding stream", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="9", + name="DISPOSITION", + friendly_name="disposition", + type="number", + startIndex=30, + endIndex=31, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="10", + name="NEW_APPLICANT", + friendly_name="new applicant", + type="number", + startIndex=31, + endIndex=32, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="11", + name="NBR_FAMILY_MEMBERS", + friendly_name="number of family members", + type="number", + startIndex=32, + endIndex=34, + required=True, + validators=[ + validators.isLargerThan(0), + ], + ), + Field( + item="12", + name="FAMILY_TYPE", + friendly_name="family type", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="13", + name="RECEIVES_SUB_HOUSING", + friendly_name="receives subsidized housing", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="14", + name="RECEIVES_MED_ASSISTANCE", + friendly_name="receives medical assisstance", + type="number", + startIndex=36, + endIndex=37, + required=True, + validators=[ + validators.isInLimits(1, 2), + ], + ), + Field( + item="15", + name="RECEIVES_FOOD_STAMPS", + friendly_name="receives food stamps", + type="number", + startIndex=37, + endIndex=38, + required=True, + validators=[ + validators.isInLimits(0, 2), + ], + ), + Field( + item="16", + name="AMT_FOOD_STAMP_ASSISTANCE", + friendly_name="amount of food stamp assisstance", + type="number", + startIndex=38, + endIndex=42, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="17", + name="RECEIVES_SUB_CC", + friendly_name="receives subsidized child care", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="18", + name="AMT_SUB_CC", + friendly_name="amount of subsidized child care", + type="number", + startIndex=43, + endIndex=47, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="19", + name="CHILD_SUPPORT_AMT", + friendly_name="child support amount", + type="number", + startIndex=47, + endIndex=51, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="20", + name="FAMILY_CASH_RESOURCES", + friendly_name="family cash resources", + type="number", + startIndex=51, + endIndex=55, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="21A", + name="CASH_AMOUNT", + friendly_name="cash amount", + type="number", + startIndex=55, + endIndex=59, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="21B", + name="NBR_MONTHS", + friendly_name="number of months", + type="number", + startIndex=59, + endIndex=62, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="22A", + name="CC_AMOUNT", + friendly_name="child care amount", + type="number", + startIndex=62, + endIndex=66, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="22B", + name="CHILDREN_COVERED", + friendly_name="children covered", + type="number", + startIndex=66, + endIndex=68, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="22C", + name="CC_NBR_MONTHS", + friendly_name="child care number of months", + type="number", + startIndex=68, + endIndex=71, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="23A", + name="TRANSP_AMOUNT", + friendly_name="transportation amount", + type="number", + startIndex=71, + endIndex=75, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="23B", + name="TRANSP_NBR_MONTHS", + friendly_name="transportation number of months", + type="number", + startIndex=75, + endIndex=78, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="24A", + name="TRANSITION_SERVICES_AMOUNT", + friendly_name="transition service amount", + type="number", + startIndex=78, + endIndex=82, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="24B", + name="TRANSITION_NBR_MONTHS", + friendly_name="transition number of months", + type="number", + startIndex=82, + endIndex=85, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="25A", + name="OTHER_AMOUNT", + friendly_name="other amount", + type="number", + startIndex=85, + endIndex=89, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="25B", + name="OTHER_NBR_MONTHS", + friendly_name="other number of months", + type="number", + startIndex=89, + endIndex=92, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26AI", + name="SANC_REDUCTION_AMT", + friendly_name="sanction reduction amount", + type="number", + startIndex=92, + endIndex=96, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26AII", + name="WORK_REQ_SANCTION", + friendly_name="work requirement sanction", + type="number", + startIndex=96, + endIndex=97, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AIII", + name="FAMILY_SANC_ADULT", + friendly_name="family sanction adult", + type="number", + startIndex=97, + endIndex=98, + required=True, + validators=[ + validators.oneOf([0, 1, 2]), + ], + ), + Field( + item="26AIV", + name="SANC_TEEN_PARENT", + friendly_name="sanction for teen parent not attending school", + type="number", + startIndex=98, + endIndex=99, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AV", + name="NON_COOPERATION_CSE", + friendly_name="non cooperation case", + type="number", + startIndex=99, + endIndex=100, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AVI", + name="FAILURE_TO_COMPLY", + friendly_name="failure to comply", + type="number", + startIndex=100, + endIndex=101, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AVII", + name="OTHER_SANCTION", + friendly_name="other sanction", + type="number", + startIndex=101, + endIndex=102, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26B", + name="RECOUPMENT_PRIOR_OVRPMT", + friendly_name="recoupment of prior overpayment", + type="number", + startIndex=102, + endIndex=106, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26CI", + name="OTHER_TOTAL_REDUCTIONS", + friendly_name="other total reductions", + type="number", + startIndex=106, + endIndex=110, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26CII", + name="FAMILY_CAP", + friendly_name="family cap", + type="number", + startIndex=110, + endIndex=111, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26CIII", + name="REDUCTIONS_ON_RECEIPTS", + friendly_name="reductions on receipts", + type="number", + startIndex=111, + endIndex=112, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26CIV", + name="OTHER_NON_SANCTION", + friendly_name="other non sanction", + type="number", + startIndex=112, + endIndex=113, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="27", + name="WAIVER_EVAL_CONTROL_GRPS", + friendly_name="waiver evaluation experimental and control groups", + type="string", + startIndex=113, + endIndex=114, + required=True, + validators=[ + validators.or_validators( + validators.matches("9"), validators.isEmpty() + ), + validators.isAlphaNumeric(), + ], + ), + Field( + item="28", + name="FAMILY_EXEMPT_TIME_LIMITS", + friendly_name="is the TANF family exempt from the federal time-limit provisions", + type="number", + startIndex=114, + endIndex=116, + required=True, + validators=[validators.oneOf([1, 2, 3, 4, 6, 7, 8, 9])], + ), + Field( + item="29", + name="FAMILY_NEW_CHILD", + friendly_name="family new child", + type="number", + startIndex=116, + endIndex=117, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="-1", + name="BLANK", + friendly_name="blank", + type="string", + startIndex=117, + endIndex=156, + required=False, + validators=[], + ), ], - )] + ) + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 5d2aeb3db..fe195559b 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -9,235 +9,947 @@ from tdpservice.search_indexes.models.tanf import TANF_T2 -t2 = SchemaManager(schemas=[ - RowSchema( - model=TANF_T2, - preparsing_validators=[ - validators.hasLength(156), - ], - postparsing_validators=[ +t2 = SchemaManager( + schemas=[ + RowSchema( + model=TANF_T2, + preparsing_validators=[ + validators.hasLength(156), + ], + postparsing_validators=[ validators.validate__FAM_AFF__SSN(), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="MARITAL_STATUS", + result_function=validators.isInLimits(1, 5), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), - result_field='PARENT_WITH_MINOR_CHILD', result_function=validators.isInLimits(1, 3), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 2), + result_field="PARENT_WITH_MINOR_CHILD", + result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EDUCATION_LEVEL', result_function=validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EDUCATION_LEVEL", + result_function=validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), ), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='COOPERATION_CHILD_SUPPORT', result_function=validators.oneOf((1, 2, 9)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="COOPERATION_CHILD_SUPPORT", + result_function=validators.oneOf((1, 2, 9)), + ), validators.validate__FAM_AFF__HOH__Fed_Time(), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EMPLOYMENT_STATUS', result_function=validators.isInLimits(1, 3), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EMPLOYMENT_STATUS", + result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_ELIGIBLE_INDICATOR', result_function=validators.or_validators( - validators.isInStringRange(1, 9), - validators.oneOf(('11', '12')) - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="WORK_ELIGIBLE_INDICATOR", + result_function=validators.or_validators( + validators.isInStringRange(1, 9), validators.oneOf(("11", "12")) ), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_PART_STATUS', result_function=validators.oneOf(['01', '02', '05', '07', '09', - '15', '17', '18', '19', '99'] - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="WORK_PART_STATUS", + result_function=validators.oneOf( + ["01", "02", "05", "07", "09", "15", "17", "18", "19", "99"] ), + ), validators.if_then_validator( - condition_field='WORK_ELIGIBLE_INDICATOR', condition_function=validators.isInStringRange(1, 5), - result_field='WORK_PART_STATUS', result_function=validators.notMatches('99'), - ), + condition_field="WORK_ELIGIBLE_INDICATOR", + condition_function=validators.isInStringRange(1, 5), + result_field="WORK_PART_STATUS", + result_function=validators.notMatches("99"), + ), + ], + fields=[ + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="30", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 3, 5])], + ), + Field( + item="31", + name="NONCUSTODIAL_PARENT", + friendly_name="noncustodial parent", + type="number", + startIndex=20, + endIndex=21, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="32", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="number", + startIndex=21, + endIndex=29, + required=True, + validators=[ + validators.isLargerThan(0), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="33", + name="SSN", + friendly_name="social security number SSN", + type="string", + startIndex=29, + endIndex=38, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="34A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34B", + name="RACE_AMER_INDIAN", + friendly_name="race americal indian", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="35", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="36A", + name="FED_OASDI_PROGRAM", + friendly_name="fed qasdi program", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="36B", + name="FED_DISABILITY_STATUS", + friendly_name="fed disability status", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="36C", + name="DISABLED_TITLE_XIVAPDT", + friendly_name="disbaled title xivapdt", + type="string", + startIndex=47, + endIndex=48, + required=True, + validators=[ + validators.or_validators( + validators.oneOf(["1", "2"]), validators.isBlank() + ) + ], + ), + Field( + item="36D", + name="AID_AGED_BLIND", + friendly_name="aid aged blind", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="36E", + name="RECEIVE_SSI", + friendly_name="receive ssi", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="37", + name="MARITAL_STATUS", + friendly_name="marital status", + type="number", + startIndex=50, + endIndex=51, + required=True, + validators=[ + validators.isInLimits(0, 5), + ], + ), + Field( + item="38", + name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", + type="string", + startIndex=51, + endIndex=53, + required=True, + validators=[ + validators.isInStringRange(1, 10), + ], + ), + Field( + item="39", + name="PARENT_WITH_MINOR_CHILD", + friendly_name="parent with minor child", + type="number", + startIndex=53, + endIndex=54, + required=True, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="40", + name="NEEDS_PREGNANT_WOMAN", + friendly_name="needs of pregnant woman", + type="number", + startIndex=54, + endIndex=55, + required=True, + validators=[ + validators.isInLimits(0, 9), + ], + ), + Field( + item="41", + name="EDUCATION_LEVEL", + friendly_name="education level", + type="string", + startIndex=55, + endIndex=57, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="42", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=57, + endIndex=58, + required=True, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="43", + name="COOPERATION_CHILD_SUPPORT", + friendly_name="coopeartion with child support", + type="number", + startIndex=58, + endIndex=59, + required=True, + validators=[ + validators.oneOf([0, 1, 2, 9]), + ], + ), + Field( + item="44", + name="MONTHS_FED_TIME_LIMIT", + friendly_name="number of months countable toward federal time limit", + type="string", + startIndex=59, + endIndex=62, + required=True, + validators=[ + validators.isInStringRange(0, 999), + ], + ), + Field( + item="45", + name="MONTHS_STATE_TIME_LIMIT", + friendly_name="months of state time limit", + type="string", + startIndex=62, + endIndex=64, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="46", + name="CURRENT_MONTH_STATE_EXEMPT", + friendly_name="is current month exempt from the state time limit", + type="number", + startIndex=64, + endIndex=65, + required=True, + validators=[ + validators.isInLimits(0, 9), + ], + ), + Field( + item="47", + name="EMPLOYMENT_STATUS", + friendly_name="employment status", + type="number", + startIndex=65, + endIndex=66, + required=True, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="48", + name="WORK_ELIGIBLE_INDICATOR", + friendly_name="work-eligible indivdual indicator", + type="string", + startIndex=66, + endIndex=68, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 9), + validators.oneOf(("11", "12")), + ) + ], + ), + Field( + item="49", + name="WORK_PART_STATUS", + friendly_name="work participation status", + type="string", + startIndex=68, + endIndex=70, + required=True, + validators=[ + validators.oneOf( + [ + "01", + "02", + "05", + "07", + "09", + "15", + "16", + "17", + "18", + "19", + "99", + ] + ) + ], + ), + Field( + item="50", + name="UNSUB_EMPLOYMENT", + friendly_name="employement status", + type="string", + startIndex=70, + endIndex=72, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="51", + name="SUB_PRIVATE_EMPLOYMENT", + friendly_name="subsidized private employment", + type="string", + startIndex=72, + endIndex=74, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="52", + name="SUB_PUBLIC_EMPLOYMENT", + friendly_name="subsidized public employment", + type="string", + startIndex=74, + endIndex=76, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53A", + name="WORK_EXPERIENCE_HOP", + friendly_name="work experience - hours of participation", + type="string", + startIndex=76, + endIndex=78, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53B", + name="WORK_EXPERIENCE_EA", + friendly_name="work experience - excused absence", + type="string", + startIndex=78, + endIndex=80, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53C", + name="WORK_EXPERIENCE_HOL", + friendly_name="work experience - holiday", + type="string", + startIndex=80, + endIndex=82, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="54", + name="OJT", + friendly_name="on the job training", + type="string", + startIndex=82, + endIndex=84, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55A", + name="JOB_SEARCH_HOP", + friendly_name="job search - hours of operation", + type="string", + startIndex=84, + endIndex=86, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55B", + name="JOB_SEARCH_EA", + friendly_name="job search - exceused absense", + type="string", + startIndex=86, + endIndex=88, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55C", + name="JOB_SEARCH_HOL", + friendly_name="job search - holiday", + type="string", + startIndex=88, + endIndex=90, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56A", + name="COMM_SERVICES_HOP", + friendly_name="community service - hours of operation", + type="string", + startIndex=90, + endIndex=92, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56B", + name="COMM_SERVICES_EA", + friendly_name="community service - excused absense", + type="string", + startIndex=92, + endIndex=94, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56C", + name="COMM_SERVICES_HOL", + friendly_name="community service - holiday", + type="string", + startIndex=94, + endIndex=96, + required=True, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57A", + name="VOCATIONAL_ED_TRAINING_HOP", + friendly_name="vocational education training - hours of operation", + type="string", + startIndex=96, + endIndex=98, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57B", + name="VOCATIONAL_ED_TRAINING_EA", + friendly_name="vocational education - exceused absense", + type="string", + startIndex=98, + endIndex=100, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57C", + name="VOCATIONAL_ED_TRAINING_HOL", + friendly_name="vocational education training - holiday", + type="string", + startIndex=100, + endIndex=102, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58A", + name="JOB_SKILLS_TRAINING_HOP", + friendly_name="job skills training - hours of participation", + type="string", + startIndex=102, + endIndex=104, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58B", + name="JOB_SKILLS_TRAINING_EA", + friendly_name="job skills training - excused absense", + type="string", + startIndex=104, + endIndex=106, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58C", + name="JOB_SKILLS_TRAINING_HOL", + friendly_name="job skills training holiday", + type="string", + startIndex=106, + endIndex=108, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59A", + name="ED_NO_HIGH_SCHOOL_DIPL_HOP", + friendly_name="education no high school diploma - hours of operation", + type="string", + startIndex=108, + endIndex=110, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59B", + name="ED_NO_HIGH_SCHOOL_DIPL_EA", + friendly_name="education no high school diploma - excused absense", + type="string", + startIndex=110, + endIndex=112, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59C", + name="ED_NO_HIGH_SCHOOL_DIPL_HOL", + friendly_name="education no high school diploma - holiday", + type="string", + startIndex=112, + endIndex=114, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60A", + name="SCHOOL_ATTENDENCE_HOP", + friendly_name="school attendance - hours of participation", + type="string", + startIndex=114, + endIndex=116, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60B", + name="SCHOOL_ATTENDENCE_EA", + friendly_name="school attendance - exceused absense", + type="string", + startIndex=116, + endIndex=118, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60C", + name="SCHOOL_ATTENDENCE_HOL", + friendly_name="school attendance - holiday", + type="string", + startIndex=118, + endIndex=120, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61A", + name="PROVIDE_CC_HOP", + friendly_name="provide child care - hours of participation", + type="string", + startIndex=120, + endIndex=122, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61B", + name="PROVIDE_CC_EA", + friendly_name="provide child care - excused absense", + type="string", + startIndex=122, + endIndex=124, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61C", + name="PROVIDE_CC_HOL", + friendly_name="provide child care - holiday", + type="string", + startIndex=124, + endIndex=126, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="62", + name="OTHER_WORK_ACTIVITIES", + friendly_name="other work activities", + type="string", + startIndex=126, + endIndex=128, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="63", + name="DEEMED_HOURS_FOR_OVERALL", + friendly_name="number of deemed core hours for overall rate", + type="string", + startIndex=128, + endIndex=130, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="64", + name="DEEMED_HOURS_FOR_TWO_PARENT", + friendly_name="number of deemed core hours for two-parent rate", + type="string", + startIndex=130, + endIndex=132, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="65", + name="EARNED_INCOME", + friendly_name="earned income", + type="string", + startIndex=132, + endIndex=136, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66A", + name="UNEARNED_INCOME_TAX_CREDIT", + friendly_name="unearned income tax credit", + type="string", + startIndex=136, + endIndex=140, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66B", + name="UNEARNED_SOCIAL_SECURITY", + friendly_name="unearned social security", + type="string", + startIndex=140, + endIndex=144, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66C", + name="UNEARNED_SSI", + friendly_name="unearned SSI", + type="string", + startIndex=144, + endIndex=148, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66D", + name="UNEARNED_WORKERS_COMP", + friendly_name="unearned workers compensation", + type="string", + startIndex=148, + endIndex=152, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66E", + name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", + type="string", + startIndex=152, + endIndex=156, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), ], - fields=[ - Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="30", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, - required=True, validators=[validators.oneOf([1, 2, 3, 5])]), - Field(item="31", name='NONCUSTODIAL_PARENT', friendly_name='noncustodial parent', type='number', startIndex=20, endIndex=21, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="32", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=21, endIndex=29, required=True, - validators=[validators.isLargerThan(0),]), - TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', friendly_name='social security number SSN', type='string', startIndex=29, - endIndex=38, required=True, - validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=38, endIndex=39, required=True, - validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', friendly_name='race americal indian', type='number', startIndex=39, endIndex=40, required=True, - validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=40, endIndex=41, required=True, - validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=41, endIndex=42, required=True, - validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=42, endIndex=43, required=True, - validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=43, endIndex=44, required=True, - validators=[validators.isInLimits(0, 2)]), - Field(item="35", name='GENDER', friendly_name='gender', type='number', startIndex=44, endIndex=45, required=True, - validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36A", name='FED_OASDI_PROGRAM', friendly_name='fed qasdi program', type='number', startIndex=45, endIndex=46, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="36B", name='FED_DISABILITY_STATUS', friendly_name='fed disability status', type='number', startIndex=46, endIndex=47, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="36C", name='DISABLED_TITLE_XIVAPDT', friendly_name='disbaled title xivapdt', type='string', startIndex=47, endIndex=48, required=True, - validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), - Field(item="36D", name='AID_AGED_BLIND', friendly_name='aid aged blind', type='number', startIndex=48, endIndex=49, required=True, - validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36E", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=49, endIndex=50, required=True, - validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', friendly_name='marital status', type='number', startIndex=50, endIndex=51, required=True, - validators=[validators.isInLimits(0, 5),]), - Field(item="38", name='RELATIONSHIP_HOH', friendly_name='relationship to head of household', type='string', startIndex=51, endIndex=53, required=True, - validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_WITH_MINOR_CHILD', friendly_name='parent with minor child', type='number', startIndex=53, endIndex=54, required=True, - validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', friendly_name='needs of pregnant woman', type='number', startIndex=54, endIndex=55, required=True, - validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', friendly_name='education level', type='string', startIndex=55, endIndex=57, required=True, - validators=[validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - )]), - Field(item="42", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=57, endIndex=58, required=True, - validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', friendly_name='coopeartion with child support', type='number', startIndex=58, endIndex=59, required=True, - validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', friendly_name='number of months countable toward federal time limit', type='string', startIndex=59, endIndex=62, required=True, - validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', friendly_name='months of state time limit', type='string', startIndex=62, endIndex=64, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', friendly_name='is current month exempt from the state time limit', type='number', startIndex=64, endIndex=65, - required=True, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', friendly_name='employment status', type='number', startIndex=65, endIndex=66, required=True, - validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_ELIGIBLE_INDICATOR', friendly_name='work-eligible indivdual indicator', type='string', startIndex=66, endIndex=68, required=True, - validators=[validators.or_validators(validators.isInStringRange(0, 9), - validators.oneOf(('11', '12')) - )]), - Field(item="49", name='WORK_PART_STATUS', friendly_name='work participation status', type='string', startIndex=68, endIndex=70, required=True, - validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), - Field(item="50", name='UNSUB_EMPLOYMENT', friendly_name='employement status', type='string', startIndex=70, endIndex=72, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', friendly_name='subsidized private employment', type='string', startIndex=72, endIndex=74, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', friendly_name='subsidized public employment', type='string', startIndex=74, endIndex=76, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53A", name='WORK_EXPERIENCE_HOP', friendly_name='work experience - hours of participation', type='string', startIndex=76, endIndex=78, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53B", name='WORK_EXPERIENCE_EA', friendly_name='work experience - excused absence', type='string', startIndex=78, endIndex=80, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53C", name='WORK_EXPERIENCE_HOL', friendly_name='work experience - holiday', type='string', startIndex=80, endIndex=82, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="54", name='OJT', friendly_name='on the job training', type='string', startIndex=82, endIndex=84, required=True, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="55A", name='JOB_SEARCH_HOP', friendly_name='job search - hours of operation', type='string', startIndex=84, endIndex=86, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="55B", name='JOB_SEARCH_EA', friendly_name='job search - exceused absense', type='string', startIndex=86, endIndex=88, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="55C", name='JOB_SEARCH_HOL', friendly_name='job search - holiday', type='string', startIndex=88, endIndex=90, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56A", name='COMM_SERVICES_HOP', friendly_name='community service - hours of operation', type='string', startIndex=90, endIndex=92, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56B", name='COMM_SERVICES_EA', friendly_name='community service - excused absense', type='string', startIndex=92, endIndex=94, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56C", name='COMM_SERVICES_HOL', friendly_name='community service - holiday', type='string', startIndex=94, endIndex=96, required=True, - validators=[validators.isInStringRange(0, 99),]), - Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', friendly_name='vocational education training - hours of operation', type='string', startIndex=96, endIndex=98, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', friendly_name='vocational education - exceused absense', type='string', startIndex=98, endIndex=100, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', friendly_name='vocational education training - holiday', type='string', startIndex=100, endIndex=102, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', friendly_name='job skills training - hours of participation', type='string', startIndex=102, endIndex=104, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58B", name='JOB_SKILLS_TRAINING_EA', friendly_name='job skills training - excused absense', type='string', startIndex=104, endIndex=106, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', friendly_name='job skills training holiday', type='string', startIndex=106, endIndex=108, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', friendly_name='education no high school diploma - hours of operation', type='string', startIndex=108, endIndex=110, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', friendly_name='education no high school diploma - excused absense', type='string', startIndex=110, endIndex=112, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', friendly_name='education no high school diploma - holiday', type='string', startIndex=112, endIndex=114, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', friendly_name='school attendance - hours of participation', type='string', startIndex=114, endIndex=116, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60B", name='SCHOOL_ATTENDENCE_EA', friendly_name='school attendance - exceused absense', type='string', startIndex=116, endIndex=118, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', friendly_name='school attendance - holiday', type='string', startIndex=118, endIndex=120, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61A", name='PROVIDE_CC_HOP', friendly_name='provide child care - hours of participation', type='string', startIndex=120, endIndex=122, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61B", name='PROVIDE_CC_EA', friendly_name='provide child care - excused absense', type='string', startIndex=122, endIndex=124, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61C", name='PROVIDE_CC_HOL', friendly_name='provide child care - holiday', type='string', startIndex=124, endIndex=126, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="62", name='OTHER_WORK_ACTIVITIES', friendly_name='other work activities', type='string', startIndex=126, endIndex=128, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', friendly_name='number of deemed core hours for overall rate', type='string', startIndex=128, endIndex=130, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', friendly_name='number of deemed core hours for two-parent rate', type='string', startIndex=130, endIndex=132, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="65", name='EARNED_INCOME', friendly_name='earned income', type='string', startIndex=132, endIndex=136, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', friendly_name='unearned income tax credit', type='string', startIndex=136, endIndex=140, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', friendly_name='unearned social security', type='string', startIndex=140, endIndex=144, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66C", name='UNEARNED_SSI', friendly_name='unearned SSI', type='string', startIndex=144, endIndex=148, required=False, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66D", name='UNEARNED_WORKERS_COMP', friendly_name='unearned workers compensation', type='string', startIndex=148, endIndex=152, required=False, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66E", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='string', startIndex=152, endIndex=156, required=False, - validators=[validators.isInStringRange(0, 9999),]), - ], - )] + ) + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index c5f4df9b0..d5f2314c3 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -16,124 +16,299 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RELATIONSHIP_HOH", + result_function=validators.isInStringRange(4, 9), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="PARENT_MINOR_CHILD", + result_function=validators.oneOf((2, 3)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="EDUCATION_LEVEL", + result_function=validators.notMatches("99"), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), - ), - ], + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(2), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2, 9)), + ), + ], fields=[ - Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, - required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="68", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=20, endIndex=28, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', friendly_name='social security name - ssn', type='string', startIndex=28, - endIndex=37, required=True, validators=[validators.validateSSN()], - is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=37, endIndex=38, - required=True, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=38, endIndex=39, - required=True, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=39, endIndex=40, - required=True, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=40, endIndex=41, - required=True, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=41, endIndex=42, - required=True, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=42, endIndex=43, - required=True, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', friendly_name='gender', type='number', startIndex=43, endIndex=44, - required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', friendly_name='receives nonssa benefits', type='number', startIndex=44, endIndex=45, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="72B", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=45, endIndex=46, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="73", name='RELATIONSHIP_HOH', friendly_name='relationship to head of household', type='string', startIndex=46, endIndex=48, - required=True, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="74", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=48, endIndex=49, - required=True, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="75", name='EDUCATION_LEVEL', friendly_name='education level', type='string', startIndex=49, endIndex=51, - required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ) - ]), - Field(item="76", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=51, endIndex=52, - required=True, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="77A", name='UNEARNED_SSI', friendly_name='unearned ssi', type='string', startIndex=52, endIndex=56, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='string', startIndex=56, endIndex=60, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="6", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="67", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 4])], + ), + Field( + item="68", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="number", + startIndex=20, + endIndex=28, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="69", + name="SSN", + friendly_name="social security name - ssn", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="70A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=37, + endIndex=38, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70B", + name="RACE_AMER_INDIAN", + friendly_name="race american indian", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="71", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="72A", + name="RECEIVE_NONSSA_BENEFITS", + friendly_name="receives nonssa benefits", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="72B", + name="RECEIVE_SSI", + friendly_name="receive ssi", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="73", + name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", + type="string", + startIndex=46, + endIndex=48, + required=True, + validators=[validators.isInStringRange(0, 10)], + ), + Field( + item="74", + name="PARENT_MINOR_CHILD", + friendly_name="parent minor child", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[validators.oneOf([0, 2, 3])], + ), + Field( + item="75", + name="EDUCATION_LEVEL", + friendly_name="education level", + type="string", + startIndex=49, + endIndex=51, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="76", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=51, + endIndex=52, + required=True, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="77A", + name="UNEARNED_SSI", + friendly_name="unearned ssi", + type="string", + startIndex=52, + endIndex=56, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="77B", + name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", + type="string", + startIndex=56, + endIndex=60, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), ], ) @@ -145,130 +320,299 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RELATIONSHIP_HOH", + result_function=validators.isInStringRange(4, 9), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="PARENT_MINOR_CHILD", + result_function=validators.oneOf((2, 3)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="EDUCATION_LEVEL", + result_function=validators.notMatches("99"), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), - ), - ], + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(2), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2, 9)), + ), + ], fields=[ - Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=60, endIndex=61, - required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="68", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=61, endIndex=69, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', friendly_name='social security number - SSN', type='string', startIndex=69, - endIndex=78, required=True, validators=[validators.validateSSN()], - is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=78, endIndex=79, - required=True, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', friendly_name='race american indian', type='number', startIndex=79, endIndex=80, - required=True, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=80, endIndex=81, - required=True, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=81, endIndex=82, - required=True, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=82, endIndex=83, - required=True, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=83, endIndex=84, - required=True, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', friendly_name='gender', type='number', startIndex=84, endIndex=85, - required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', friendly_name='receive nonssa benefits', type='number', startIndex=85, endIndex=86, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="72B", name='RECEIVE_SSI', friendly_name='receive ssi', type='number', startIndex=86, endIndex=87, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="73", name='RELATIONSHIP_HOH', friendly_name='relationship head of household', type='string', startIndex=87, endIndex=89, - required=True, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="74", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=89, endIndex=90, - required=True, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="75", name='EDUCATION_LEVEL', friendly_name='education level', type='string', startIndex=90, endIndex=92, - required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.oneOf(['98', '99']) - ) - ]), - Field(item="76", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=92, endIndex=93, - required=True, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="77A", name='UNEARNED_SSI', friendly_name='unearned ssi', type='string', startIndex=93, endIndex=97, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', friendly_name='other unearned income', type='string', startIndex=97, endIndex=101, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="6", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="67", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=60, + endIndex=61, + required=True, + validators=[validators.oneOf([1, 2, 4])], + ), + Field( + item="68", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="number", + startIndex=61, + endIndex=69, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="69", + name="SSN", + friendly_name="social security number - SSN", + type="string", + startIndex=69, + endIndex=78, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="70A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=78, + endIndex=79, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70B", + name="RACE_AMER_INDIAN", + friendly_name="race american indian", + type="number", + startIndex=79, + endIndex=80, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=80, + endIndex=81, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=81, + endIndex=82, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=82, + endIndex=83, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="70F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=83, + endIndex=84, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="71", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=84, + endIndex=85, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="72A", + name="RECEIVE_NONSSA_BENEFITS", + friendly_name="receive nonssa benefits", + type="number", + startIndex=85, + endIndex=86, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="72B", + name="RECEIVE_SSI", + friendly_name="receive ssi", + type="number", + startIndex=86, + endIndex=87, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="73", + name="RELATIONSHIP_HOH", + friendly_name="relationship head of household", + type="string", + startIndex=87, + endIndex=89, + required=True, + validators=[validators.isInStringRange(0, 10)], + ), + Field( + item="74", + name="PARENT_MINOR_CHILD", + friendly_name="parent minor child", + type="number", + startIndex=89, + endIndex=90, + required=True, + validators=[validators.oneOf([0, 2, 3])], + ), + Field( + item="75", + name="EDUCATION_LEVEL", + friendly_name="education level", + type="string", + startIndex=90, + endIndex=92, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), validators.oneOf(["98", "99"]) + ) + ], + ), + Field( + item="76", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=92, + endIndex=93, + required=True, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="77A", + name="UNEARNED_SSI", + friendly_name="unearned ssi", + type="string", + startIndex=93, + endIndex=97, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="77B", + name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", + type="string", + startIndex=97, + endIndex=101, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), ], ) -t3 = SchemaManager( - schemas=[ - child_one, - child_two - ] -) +t3 = SchemaManager(schemas=[child_one, child_two]) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py index 2dbe02003..4a068c466 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py @@ -9,42 +9,152 @@ t4 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=TANF_T4, - preparsing_validators=[ - validators.hasLength(71), - ], - postparsing_validators=[], - fields=[ - Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', friendly_name='county fips code', type='string', startIndex=19, endIndex=22, - required=True, validators=[validators.isInStringRange(1, 999)]), - Field(item="5", name='STRATUM', friendly_name='stratum', type='string', startIndex=22, endIndex=24, - required=True, validators=[validators.isInStringRange(0, 99)]), - Field(item="7", name='ZIP_CODE', friendly_name='zip code', type='string', startIndex=24, endIndex=29, - required=True, validators=[]), - Field(item="8", name='DISPOSITION', friendly_name='disposition', type='number', startIndex=29, endIndex=30, - required=True, validators=[validators.oneOf([1, 2])]), - Field(item="9", name='CLOSURE_REASON', friendly_name='closure reason', type='string', startIndex=30, endIndex=32, - required=True, validators=[validators.or_validators(validators.isInStringRange(1, 19), - validators.matches("99"))]), - Field(item="10", name='REC_SUB_HOUSING', friendly_name='receives subsidized housing', type='number', startIndex=32, endIndex=33, - required=True, validators=[validators.isInLimits(1, 3)]), - Field(item="11", name='REC_MED_ASSIST', friendly_name='receives medical assisstance', type='number', startIndex=33, endIndex=34, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="12", name='REC_FOOD_STAMPS', friendly_name='receieves food stamps', type='number', startIndex=34, endIndex=35, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="13", name='REC_SUB_CC', friendly_name='receieves subsidized child care', type='number', startIndex=35, endIndex=36, - required=True, validators=[validators.isInLimits(1, 3)]), - Field(item="14", name='BLANK', friendly_name='blank', type='string', startIndex=36, endIndex=71, required=False, validators=[]), - ], + model=TANF_T4, + preparsing_validators=[ + validators.hasLength(71), + ], + postparsing_validators=[], + fields=[ + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + friendly_name="county fips code", + type="string", + startIndex=19, + endIndex=22, + required=True, + validators=[validators.isInStringRange(1, 999)], + ), + Field( + item="5", + name="STRATUM", + friendly_name="stratum", + type="string", + startIndex=22, + endIndex=24, + required=True, + validators=[validators.isInStringRange(0, 99)], + ), + Field( + item="7", + name="ZIP_CODE", + friendly_name="zip code", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[], + ), + Field( + item="8", + name="DISPOSITION", + friendly_name="disposition", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="9", + name="CLOSURE_REASON", + friendly_name="closure reason", + type="string", + startIndex=30, + endIndex=32, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(1, 19), validators.matches("99") + ) + ], + ), + Field( + item="10", + name="REC_SUB_HOUSING", + friendly_name="receives subsidized housing", + type="number", + startIndex=32, + endIndex=33, + required=True, + validators=[validators.isInLimits(1, 3)], + ), + Field( + item="11", + name="REC_MED_ASSIST", + friendly_name="receives medical assisstance", + type="number", + startIndex=33, + endIndex=34, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="12", + name="REC_FOOD_STAMPS", + friendly_name="receieves food stamps", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="13", + name="REC_SUB_CC", + friendly_name="receieves subsidized child care", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[validators.isInLimits(1, 3)], + ), + Field( + item="14", + name="BLANK", + friendly_name="blank", + type="string", + startIndex=36, + endIndex=71, + required=False, + validators=[], + ), + ], ) - ] - ) + ] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 2aa8b1240..883fed1c0 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -10,137 +10,404 @@ t5 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=TANF_T5, - preparsing_validators=[ - validators.hasLength(71), - ], - postparsing_validators=[ - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN() - ), - validators.validate__FAM_AFF__SSN(), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), - result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EDUCATION_LEVEL', result_function=validators.or_validators( - validators.isInStringRange(1, 16), - validators.isInStringRange(98, 99) - ) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.isInLimits(1, 2) - ), - validators.validate__FAM_AFF__HOH__Count_Fed_Time(), - validators.if_then_validator( - condition_field='DATE_OF_BIRTH', condition_function=validators.olderThan(18), - result_field='REC_OASDI_INSURANCE', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='REC_FEDERAL_DISABILITY', result_function=validators.isInLimits(1, 2) - ), - ], - fields=[ - Field(item="0", name='RecordType', friendly_name='record type', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="6", name='CASE_NUMBER', friendly_name='case number', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="14", name='FAMILY_AFFILIATION', friendly_name='family affiliation', type='number', startIndex=19, endIndex=20, - required=True, validators=[validators.isInLimits(1, 5)]), - Field(item="15", name='DATE_OF_BIRTH', friendly_name='date of birth', type='number', startIndex=20, endIndex=28, - required=True, validators=[validators.isLargerThan(0)]), - TransformField(transform_func=tanf_ssn_decryption_func, item="16", name='SSN', friendly_name='social security number SSN', type='string', - startIndex=28, endIndex=37, required=True, validators=[validators.isNumber()], - is_encrypted=False), - Field(item="17A", name='RACE_HISPANIC', friendly_name='race hispanic', type='number', startIndex=37, endIndex=38, - required=True, validators=[validators.validateRace()]), - Field(item="17B", name='RACE_AMER_INDIAN', friendly_name='race aerical indian', type='number', startIndex=38, endIndex=39, - required=True, validators=[validators.validateRace()]), - Field(item="17C", name='RACE_ASIAN', friendly_name='race asian', type='number', startIndex=39, endIndex=40, - required=True, validators=[validators.validateRace()]), - Field(item="17D", name='RACE_BLACK', friendly_name='race black', type='number', startIndex=40, endIndex=41, - required=True, validators=[validators.validateRace()]), - Field(item="17E", name='RACE_HAWAIIAN', friendly_name='race hawaiian', type='number', startIndex=41, endIndex=42, - required=True, validators=[validators.validateRace()]), - Field(item="17F", name='RACE_WHITE', friendly_name='race white', type='number', startIndex=42, endIndex=43, - required=True, validators=[validators.validateRace()]), - Field(item="18", name='GENDER', friendly_name='gender', type='number', startIndex=43, endIndex=44, - required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="19A", name='REC_OASDI_INSURANCE', - friendly_name='receives federal disability insurance benefits under the social security OASDI program', - type='number', startIndex=44, endIndex=45, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19B", name='REC_FEDERAL_DISABILITY', friendly_name='receives federal disability', type='number', startIndex=45, endIndex=46, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="19C", name='REC_AID_TOTALLY_DISABLED', friendly_name='receives aid totally disabled', type='number', startIndex=46, endIndex=47, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19D", name='REC_AID_AGED_BLIND', friendly_name='receives aid aged blind', type='number', startIndex=47, endIndex=48, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19E", name='REC_SSI', friendly_name='receives SSI', type='number', startIndex=48, endIndex=49, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="20", name='MARITAL_STATUS', friendly_name='marital status', type='number', startIndex=49, endIndex=50, - required=True, validators=[validators.isInLimits(0, 5)]), - Field(item="21", name='RELATIONSHIP_HOH', friendly_name='relationship head of household', type='string', startIndex=50, endIndex=52, - required=True, validators=[validators.isInStringRange(1, 10)]), - Field(item="22", name='PARENT_MINOR_CHILD', friendly_name='parent minor child', type='number', startIndex=52, endIndex=53, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="23", name='NEEDS_OF_PREGNANT_WOMAN', friendly_name='needs of pregnant woman', type='number', startIndex=53, endIndex=54, - required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="24", name='EDUCATION_LEVEL', friendly_name='educational level', type='string', startIndex=54, endIndex=56, - required=True, validators=[validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99))]), - Field(item="25", name='CITIZENSHIP_STATUS', friendly_name='citizenship status', type='number', startIndex=56, endIndex=57, - required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.matches(9))]), - Field(item="26", name='COUNTABLE_MONTH_FED_TIME', friendly_name='countable month federal time', type='string', startIndex=57, endIndex=60, - required=True, validators=[validators.isInStringRange(0, 999)]), - Field(item="27", name='COUNTABLE_MONTHS_STATE_TRIBE', friendly_name='countable months state tribe', type='string', startIndex=60, endIndex=62, - required=True, validators=[validators.isInStringRange(0, 99)]), - Field(item="28", name='EMPLOYMENT_STATUS', friendly_name='employment status', type='number', startIndex=62, endIndex=63, - required=True, validators=[validators.isInLimits(0, 3)]), - Field(item="29", name='AMOUNT_EARNED_INCOME', friendly_name='amount earned income', type='string', startIndex=63, endIndex=67, - required=True, validators=[validators.isInStringRange(0, 9999)]), - Field(item="30", name='AMOUNT_UNEARNED_INCOME', friendly_name='amount of unearned income', type='string', startIndex=67, endIndex=71, - required=True, validators=[validators.isInStringRange(0, 9999)]), - ], + model=TANF_T5, + preparsing_validators=[ + validators.hasLength(71), + ], + postparsing_validators=[ + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), + validators.validate__FAM_AFF__SSN(), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="MARITAL_STATUS", + result_function=validators.isInLimits(1, 5), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 2), + result_field="PARENT_MINOR_CHILD", + result_function=validators.isInLimits(1, 3), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EDUCATION_LEVEL", + result_function=validators.or_validators( + validators.isInStringRange(1, 16), + validators.isInStringRange(98, 99), + ), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.isInLimits(1, 2), + ), + validators.validate__FAM_AFF__HOH__Count_Fed_Time(), + validators.if_then_validator( + condition_field="DATE_OF_BIRTH", + condition_function=validators.olderThan(18), + result_field="REC_OASDI_INSURANCE", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="REC_FEDERAL_DISABILITY", + result_function=validators.isInLimits(1, 2), + ), + ], + fields=[ + Field( + item="0", + name="RecordType", + friendly_name="record type", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + friendly_name="case number", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="14", + name="FAMILY_AFFILIATION", + friendly_name="family affiliation", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.isInLimits(1, 5)], + ), + Field( + item="15", + name="DATE_OF_BIRTH", + friendly_name="date of birth", + type="number", + startIndex=20, + endIndex=28, + required=True, + validators=[validators.isLargerThan(0)], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="16", + name="SSN", + friendly_name="social security number SSN", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[validators.isNumber()], + is_encrypted=False, + ), + Field( + item="17A", + name="RACE_HISPANIC", + friendly_name="race hispanic", + type="number", + startIndex=37, + endIndex=38, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17B", + name="RACE_AMER_INDIAN", + friendly_name="race aerical indian", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17C", + name="RACE_ASIAN", + friendly_name="race asian", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17D", + name="RACE_BLACK", + friendly_name="race black", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17E", + name="RACE_HAWAIIAN", + friendly_name="race hawaiian", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17F", + name="RACE_WHITE", + friendly_name="race white", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="18", + name="GENDER", + friendly_name="gender", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="19A", + name="REC_OASDI_INSURANCE", + friendly_name="receives federal disability insurance benefits\ + under the social security OASDI program", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="19B", + name="REC_FEDERAL_DISABILITY", + friendly_name="receives federal disability", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="19C", + name="REC_AID_TOTALLY_DISABLED", + friendly_name="receives aid totally disabled", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="19D", + name="REC_AID_AGED_BLIND", + friendly_name="receives aid aged blind", + type="number", + startIndex=47, + endIndex=48, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="19E", + name="REC_SSI", + friendly_name="receives SSI", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="20", + name="MARITAL_STATUS", + friendly_name="marital status", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[validators.isInLimits(0, 5)], + ), + Field( + item="21", + name="RELATIONSHIP_HOH", + friendly_name="relationship head of household", + type="string", + startIndex=50, + endIndex=52, + required=True, + validators=[validators.isInStringRange(1, 10)], + ), + Field( + item="22", + name="PARENT_MINOR_CHILD", + friendly_name="parent minor child", + type="number", + startIndex=52, + endIndex=53, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="23", + name="NEEDS_OF_PREGNANT_WOMAN", + friendly_name="needs of pregnant woman", + type="number", + startIndex=53, + endIndex=54, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="24", + name="EDUCATION_LEVEL", + friendly_name="educational level", + type="string", + startIndex=54, + endIndex=56, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="25", + name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", + type="number", + startIndex=56, + endIndex=57, + required=True, + validators=[ + validators.or_validators( + validators.isInLimits(0, 2), validators.matches(9) + ) + ], + ), + Field( + item="26", + name="COUNTABLE_MONTH_FED_TIME", + friendly_name="countable month federal time", + type="string", + startIndex=57, + endIndex=60, + required=True, + validators=[validators.isInStringRange(0, 999)], + ), + Field( + item="27", + name="COUNTABLE_MONTHS_STATE_TRIBE", + friendly_name="countable months state tribe", + type="string", + startIndex=60, + endIndex=62, + required=True, + validators=[validators.isInStringRange(0, 99)], + ), + Field( + item="28", + name="EMPLOYMENT_STATUS", + friendly_name="employment status", + type="number", + startIndex=62, + endIndex=63, + required=True, + validators=[validators.isInLimits(0, 3)], + ), + Field( + item="29", + name="AMOUNT_EARNED_INCOME", + friendly_name="amount earned income", + type="string", + startIndex=63, + endIndex=67, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="30", + name="AMOUNT_UNEARNED_INCOME", + friendly_name="amount of unearned income", + type="string", + startIndex=67, + endIndex=71, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), + ], ) - ] + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index ed4c3748d..eeaef612c 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -16,48 +16,201 @@ ], postparsing_validators=[ validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), - validators.sumIsEqual("NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), - validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), + validators.sumIsEqual( + "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + ), ], 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()]), - TransformField(calendar_quarter_to_rpt_month_year(0), item="4", name='RPT_MONTH_YEAR', friendly_name='report month year', type='number', - startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="4A", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=7, endIndex=15, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5A", name='NUM_APPROVED', friendly_name='total number of approved applications', type='number', startIndex=31, endIndex=39, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6A", name='NUM_DENIED', friendly_name='total number of denied applications', type='number', startIndex=55, endIndex=63, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7A", name='ASSISTANCE', friendly_name='total amount of assistance', type='number', startIndex=79, endIndex=91, - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8A", name='NUM_FAMILIES', friendly_name='number of families', type='number', startIndex=115, endIndex=123, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9A", name='NUM_2_PARENTS', friendly_name='total number of two-parent families', type='number', startIndex=139, endIndex=147, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10A", name='NUM_1_PARENTS', friendly_name='total number of one-parent families', type='number', startIndex=163, endIndex=171, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11A", name='NUM_NO_PARENTS', friendly_name='total number of no parent families', type='number', startIndex=187, endIndex=195, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12A", name='NUM_RECIPIENTS', friendly_name='total number of recipients', type='number', startIndex=211, endIndex=219, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13A", name='NUM_ADULT_RECIPIENTS', friendly_name='total number of adult recipients', type='number', startIndex=235, endIndex=243, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14A", name='NUM_CHILD_RECIPIENTS', friendly_name='total number of child recipients', type='number', startIndex=259, endIndex=267, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15A", name='NUM_NONCUSTODIALS', friendly_name='total number of noncustodial parents participating in work activities', type='number', startIndex=283, endIndex=291, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16A", name='NUM_BIRTHS', friendly_name='total number of births', type='number', startIndex=307, endIndex=315, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17A", name='NUM_OUTWEDLOCK_BIRTHS', friendly_name='total number of out-of-wedlock births', type='number', startIndex=331, endIndex=339, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18A", name='NUM_CLOSED_CASES', friendly_name='total number of closed cases', type='number', startIndex=355, endIndex=363, - required=True, validators=[validators.isInLimits(0, 99999999)]), + 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( + calendar_quarter_to_rpt_month_year(0), + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="4A", + name="NUM_APPLICATIONS", + friendly_name="total number of applications", + type="number", + startIndex=7, + endIndex=15, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="5A", + name="NUM_APPROVED", + friendly_name="total number of approved applications", + type="number", + startIndex=31, + endIndex=39, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="6A", + name="NUM_DENIED", + friendly_name="total number of denied applications", + type="number", + startIndex=55, + endIndex=63, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="7A", + name="ASSISTANCE", + friendly_name="total amount of assistance", + type="number", + startIndex=79, + endIndex=91, + required=True, + validators=[validators.isInLimits(0, 999999999999)], + ), + Field( + item="8A", + name="NUM_FAMILIES", + friendly_name="number of families", + type="number", + startIndex=115, + endIndex=123, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="9A", + name="NUM_2_PARENTS", + friendly_name="total number of two-parent families", + type="number", + startIndex=139, + endIndex=147, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="10A", + name="NUM_1_PARENTS", + friendly_name="total number of one-parent families", + type="number", + startIndex=163, + endIndex=171, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="11A", + name="NUM_NO_PARENTS", + friendly_name="total number of no parent families", + type="number", + startIndex=187, + endIndex=195, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="12A", + name="NUM_RECIPIENTS", + friendly_name="total number of recipients", + type="number", + startIndex=211, + endIndex=219, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="13A", + name="NUM_ADULT_RECIPIENTS", + friendly_name="total number of adult recipients", + type="number", + startIndex=235, + endIndex=243, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="14A", + name="NUM_CHILD_RECIPIENTS", + friendly_name="total number of child recipients", + type="number", + startIndex=259, + endIndex=267, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="15A", + name="NUM_NONCUSTODIALS", + friendly_name="total number of noncustodial parents participating in work activities", + type="number", + startIndex=283, + endIndex=291, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="16A", + name="NUM_BIRTHS", + friendly_name="total number of births", + type="number", + startIndex=307, + endIndex=315, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="17A", + name="NUM_OUTWEDLOCK_BIRTHS", + friendly_name="total number of out-of-wedlock births", + type="number", + startIndex=331, + endIndex=339, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="18A", + name="NUM_CLOSED_CASES", + friendly_name="total number of closed cases", + type="number", + startIndex=355, + endIndex=363, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), ], ) @@ -68,47 +221,195 @@ ], postparsing_validators=[ validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), - validators.sumIsEqual("NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), - validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), + validators.sumIsEqual( + "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + ), ], 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=[]), - TransformField(calendar_quarter_to_rpt_month_year(1), item="4", name='RPT_MONTH_YEAR', - friendly_name='report month year', type='number', - startIndex=2, endIndex=7, required=True, validators=[]), - Field(item="4B", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=15, endIndex=23, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5B", name='NUM_APPROVED', friendly_name='total number of approved cases', type='number', startIndex=39, endIndex=47, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6B", name='NUM_DENIED', friendly_name='total number of denied', type='number', startIndex=63, endIndex=71, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7B", name='ASSISTANCE', friendly_name='assistance', type='number', startIndex=91, endIndex=103, - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8B", name='NUM_FAMILIES', friendly_name='total of number of families', type='number', startIndex=123, endIndex=131, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9B", name='NUM_2_PARENTS', friendly_name='total number of two-parent families', type='number', startIndex=147, endIndex=155, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10B", name='NUM_1_PARENTS', friendly_name='total number of one-parent families', type='number', startIndex=171, endIndex=179, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11B", name='NUM_NO_PARENTS', friendly_name='total number of noparent family', type='number', startIndex=195, endIndex=203, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12B", name='NUM_RECIPIENTS', friendly_name='total number of receipients', type='number', startIndex=219, endIndex=227, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13B", name='NUM_ADULT_RECIPIENTS', friendly_name='total number of adult recipients', type='number', startIndex=243, endIndex=251, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14B", name='NUM_CHILD_RECIPIENTS', friendly_name='total number of child recipients', type='number', startIndex=267, endIndex=275, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15B", name='NUM_NONCUSTODIALS', friendly_name='total number of noncustodial parents', type='number', startIndex=291, endIndex=299, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16B", name='NUM_BIRTHS', friendly_name='total number of births', type='number', startIndex=315, endIndex=323, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17B", name='NUM_OUTWEDLOCK_BIRTHS', friendly_name='total number of outwedlock births', type='number', startIndex=339, endIndex=347, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18B", name='NUM_CLOSED_CASES', friendly_name='total number of closed assets', type='number', startIndex=363, endIndex=371, - required=True, validators=[validators.isInLimits(0, 99999999)]), + 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=[], + ), + TransformField( + calendar_quarter_to_rpt_month_year(1), + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[], + ), + Field( + item="4B", + name="NUM_APPLICATIONS", + friendly_name="total number of applications", + type="number", + startIndex=15, + endIndex=23, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="5B", + name="NUM_APPROVED", + friendly_name="total number of approved cases", + type="number", + startIndex=39, + endIndex=47, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="6B", + name="NUM_DENIED", + friendly_name="total number of denied", + type="number", + startIndex=63, + endIndex=71, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="7B", + name="ASSISTANCE", + friendly_name="assistance", + type="number", + startIndex=91, + endIndex=103, + required=True, + validators=[validators.isInLimits(0, 999999999999)], + ), + Field( + item="8B", + name="NUM_FAMILIES", + friendly_name="total of number of families", + type="number", + startIndex=123, + endIndex=131, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="9B", + name="NUM_2_PARENTS", + friendly_name="total number of two-parent families", + type="number", + startIndex=147, + endIndex=155, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="10B", + name="NUM_1_PARENTS", + friendly_name="total number of one-parent families", + type="number", + startIndex=171, + endIndex=179, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="11B", + name="NUM_NO_PARENTS", + friendly_name="total number of noparent family", + type="number", + startIndex=195, + endIndex=203, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="12B", + name="NUM_RECIPIENTS", + friendly_name="total number of receipients", + type="number", + startIndex=219, + endIndex=227, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="13B", + name="NUM_ADULT_RECIPIENTS", + friendly_name="total number of adult recipients", + type="number", + startIndex=243, + endIndex=251, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="14B", + name="NUM_CHILD_RECIPIENTS", + friendly_name="total number of child recipients", + type="number", + startIndex=267, + endIndex=275, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="15B", + name="NUM_NONCUSTODIALS", + friendly_name="total number of noncustodial parents", + type="number", + startIndex=291, + endIndex=299, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="16B", + name="NUM_BIRTHS", + friendly_name="total number of births", + type="number", + startIndex=315, + endIndex=323, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="17B", + name="NUM_OUTWEDLOCK_BIRTHS", + friendly_name="total number of outwedlock births", + type="number", + startIndex=339, + endIndex=347, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="18B", + name="NUM_CLOSED_CASES", + friendly_name="total number of closed assets", + type="number", + startIndex=363, + endIndex=371, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), ], ) @@ -119,145 +420,197 @@ ], postparsing_validators=[ validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), - validators.sumIsEqual("NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), - validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), + validators.sumIsEqual( + "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + ), ], 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=[]), - TransformField(calendar_quarter_to_rpt_month_year(2), item="4", name='RPT_MONTH_YEAR', - friendly_name='report month year', type='number', - startIndex=2, endIndex=7, required=True, validators=[]), - Field(item="4C", name='NUM_APPLICATIONS', friendly_name='total number of applications', type='number', startIndex=23, endIndex=31, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5C", name='NUM_APPROVED', friendly_name='total number of approved applications', type='number', startIndex=47, endIndex=55, - 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="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=[], + ), + TransformField( + calendar_quarter_to_rpt_month_year(2), + item="4", + name="RPT_MONTH_YEAR", + friendly_name="report month year", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[], + ), + Field( + item="4C", + name="NUM_APPLICATIONS", + friendly_name="total number of applications", + type="number", + startIndex=23, + endIndex=31, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="5C", + name="NUM_APPROVED", + friendly_name="total number of approved applications", + type="number", + startIndex=47, + endIndex=55, + 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, - required=True, validators=[validators.isInLimits(0, 999999999999)]), + 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', + name="NUM_FAMILIES", + friendly_name="total number of families", + type="number", startIndex=131, endIndex=139, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="9C", - name='NUM_2_PARENTS', - friendly_name='total number of two parents families', - type='number', + 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)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="10C", - name='NUM_1_PARENTS', - friendly_name='total number of one parent families', - type='number', + 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)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="11C", - name='NUM_NO_PARENTS', - friendly_name='total number of no parent families', - type='number', + 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)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="12C", - name='NUM_RECIPIENTS', - friendly_name='total number of recipients', - type='number', + name="NUM_RECIPIENTS", + friendly_name="total number of recipients", + type="number", startIndex=227, endIndex=235, - required=True,validators=[validators.isInLimits(0, 99999999)] - ), + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="13C", - name='NUM_ADULT_RECIPIENTS', - friendly_name='total number of adult recipients', - type='number', + name="NUM_ADULT_RECIPIENTS", + friendly_name="total number of adult recipients", + type="number", startIndex=251, endIndex=259, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="14C", - name='NUM_CHILD_RECIPIENTS', - friendly_name='total number of child recipients', - type='number', + name="NUM_CHILD_RECIPIENTS", + friendly_name="total number of child recipients", + type="number", startIndex=275, endIndex=283, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="15C", - name='NUM_NONCUSTODIALS', - friendly_name='total number of noncustodial parents', - type='number', + name="NUM_NONCUSTODIALS", + friendly_name="total number of noncustodial parents", + type="number", startIndex=299, endIndex=307, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="16C", - name='NUM_BIRTHS', - friendly_name='total number of births', - type='number', + name="NUM_BIRTHS", + friendly_name="total number of births", + type="number", startIndex=323, endIndex=331, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="17C", - name='NUM_OUTWEDLOCK_BIRTHS', - friendly_name='total number of outwedlock births', - type='number', + name="NUM_OUTWEDLOCK_BIRTHS", + friendly_name="total number of outwedlock births", + type="number", startIndex=347, endIndex=355, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), Field( item="18C", - name='NUM_CLOSED_CASES', - friendly_name='total number of closed cases', - type='number', + name="NUM_CLOSED_CASES", + friendly_name="total number of closed cases", + type="number", startIndex=371, endIndex=379, required=True, - validators=[validators.isInLimits(0, 99999999)] - ), + validators=[validators.isInLimits(0, 99999999)], + ), ], ) -t6 = SchemaManager( - schemas=[ - s1, - s2, - s3 - ] - ) +t6 = SchemaManager(schemas=[s1, s2, s3]) From ac95c41cd235936c646c9980cac5e3f32ecc8397 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 30 Oct 2023 10:50:59 -0400 Subject: [PATCH 17/88] delete contants.py --- tdrs-backend/tdpservice/parsers/constants.py | 169 ------------------- 1 file changed, 169 deletions(-) delete mode 100644 tdrs-backend/tdpservice/parsers/constants.py diff --git a/tdrs-backend/tdpservice/parsers/constants.py b/tdrs-backend/tdpservice/parsers/constants.py deleted file mode 100644 index ecbfdc9f4..000000000 --- a/tdrs-backend/tdpservice/parsers/constants.py +++ /dev/null @@ -1,169 +0,0 @@ -"""Define constants for the parsers module.""" - -TANF_ITEM_NAME = { - "AID_AGED_BLIND": "Aid to the Aged, Blind, and Disabled", - "AMOUNT_EARNED_INCOME": "Amount of Earned Income", - "AMOUNT_UNEARNED_INCOME": "Amount of Unearned Income", - "AMT_FOOD_STAMP": "Amount of Food Stamps", - "AMT_SUB_CC": "Amount of Subsidized Child Care", - "CC_NBR_MONTHS": "Number of Months of Subsidized Child Care", - "CHILD_SUPPORT_AMT": "Amount of Child Support", - "COMM_SERVICES_EA": "Community Service - excused absence", - "COMM_SERVICES_HOL": "Community Service - holiday", - "COMM_SERVICES_HOP": "Community Service - hours of participation", - "COOPERATION_CHILD_SUPPORT": "Cooperation with Child Support", - "COUNTABLE_MONTHS_STATE": "Countable Months of State Time", - "COUNTABLE_MONTH_FED": "Countable Months of Federal Time", - "COUNTY_FIPS_CODE": "County FIPS Code", - "CURRENT_MONTH_STATE": "Current Month of State Time", - "DATE_OF_BIRTH": "Date of Birth", - "DEEMED_HOURS_FOR": "Deemed Hours for", - "DISABLED_TITLE_XIVAPDT": "Disabled under title XIV-APDT", - "ED_NO_HIGH": "Education - No High School Diploma", - "FAILURE_TO_COMPLY": "Failure to Comply", - "FAMILY_CASH_RESOURCES": "Family Cash Resources", - "FAMILY_EXEMPT_TIME": "Family Exempt Time", - "FAMILY_NEW_CHILD": "Family with a New Child", - "FAMILY_SANC_ADULT": "Family Sanctioned for an Adult", - "FED_DISABILITY_STATUS": "Federal Disability Status", - "FED_OASDI_PROGRAM": "Federal OASDI Program", - "JOB_SEARCH_EA": "Job Search - EA", - "JOB_SEARCH_HOL": "Job Search - HOL", - "JOB_SEARCH_HOP": "Job Search - HOP", - "JOB_SKILLS_TRAINING": "Job Skills Training", - "MONTHS_FED_TIME": "Months of Federal Time", - "MONTHS_STATE_TIME": "Months of State Time", - "NBR_FAMILY_MEMBERS": "Number of Family Members", - "NEEDS_OF_PREGNANT": "", - "NEEDS_PREGNANT_WOMAN": "Needs", - "NON_COOPERATION_CSE": "Non-Cooperation with Child Support Enforcement", - "NUM_ADULT_RECIPIENTS": "Number of Adult Recipients", - "NUM_CHILD_RECIPIENTS": "Number of Child Recipients", - "NUM_CLOSED_CASES": "Number of Closed Cases", - "NUM_NO_PARENTS": "Number of Cases with No Parents", - "NUM_OUTWEDLOCK_BIRTHS": "Number of Out-of-Wedlock Births", - "OTHER_NBR_MONTHS": "Number of Months of Other Time", - "OTHER_NON_SANCTION": "Other Non-Sanction", - "OTHER_TOTAL_REDUCTIONS": "Other Total Reductions", - "OTHER_UNEARNED_INCOME": "Other Unearned Income", - "OTHER_WORK_ACTIVITIES": "Other Work Activities", - "PARENT_MINOR_CHILD": "Parent with a Minor Child", - "PARENT_WITH_MINOR": "Parent with a Minor Child", - "PROVIDE_CC_EA": "Provide Child Care - excused absence", - "PROVIDE_CC_HOL": "Provide Child Care - holiday", - "PROVIDE_CC_HOP": "Provide Child Care - hours of participation", - "RACE_AMER_INDIAN": "Race American Indian", - "RECEIVES_FOOD_STAMPS": "Receives Food Stamps", - "RECEIVES_MED_ASSISTANCE": "Receives Medical Assistance", - "RECEIVES_SUB_CC": "Receives Subsidized Child Care", - "RECEIVES_SUB_HOUSING": "Receives Subsidized Housing", - "RECEIVE_NONSSA_BENEFITS": "Receives Non-SSA Benefits", - "RECOUPMENT_PRIOR_OVRPMT": "Recoupment of Prior Overpayment", - "REC_AID_AGED": "Receives Aid to the Aged", - "REC_AID_TOTALLY": "Receives Aid to the Totally Disabled", - "REC_FEDERAL_DISABILITY": "Receives Federal Disability", - "REC_FOOD_STAMPS": "Receives Food Stamps", - "REC_MED_ASSIST": "Receives Medical Assistance", - "REC_OASDI_INSURANCE": "Receives OASDI Insurance", - "REC_SUB_CC": "Receives Subsidized Child Care", - "REC_SUB_HOUSING": "Receives Subsidized Housing", - "REDUCTIONS_ON_RECEIPTS": "Reductions on Receipts", - "RPT_MONTH_YEAR": "Report Month and Year", - "SANC_REDUCTION_AMT": "Sanction Reduction Amount", - "SANC_TEEN_PARENT": "Sanctioned Teen Parent", - "SCHOOL_ATTENDENCE_EA": "School Attendance - excused absence", - "SCHOOL_ATTENDENCE_HOL": "School Attendance - holiday", - "SCHOOL_ATTENDENCE_HOP": "School Attendance - hours of participation", - "SCHOOL_DIPL_EA": "School Diploma - excused absence", - "SCHOOL_DIPL_HOL": "School Diploma - holiday", - "SCHOOL_DIPL_HOP": "School Diploma - hours of participation", - "SUB_PRIVATE_EMPLOYMENT": "Subsidized Private Employment", - "SUB_PUBLIC_EMPLOYMENT": "Subsidized Public Employment", - "TDRS_SECTION_IND": "TDRS Section Indicator", - "TRANSITION_NBR_MONTHS": "Number of Months of Transition Services", - "TRANSITION_SERVICES_AMOUNT": "Transition Services Amount", - "TRANSP_NBR_MONTHS": "Number of Months of Transportation", - "UNEARNED_INCOME_TAX": "Unearned Income Tax", - "UNEARNED_SOCIAL_SECURITY": "Unearned Social Security", - "UNEARNED_WORKERS_COMP": "Unearned Workers Compensation", - "VOCATIONAL_ED_TRAINING": "Vocational Education Training", - "WAIVER_EVAL_CONTROL": "Waiver Evaluation Control", - "WORK_ELIGIBLE_INDICATOR": "Work Eligible Indicator", - "WORK_EXPERIENCE_EA": "Work Experience - excused absence", - "WORK_EXPERIENCE_HOL": "Work Experience - holiday", - "WORK_EXPERIENCE_HOP": "Work Experience - hours of participation", - "WORK_PART_STATUS": "Work Participation Status", - "WORK_REQ_SANCTION": "Work Requirement Sanction", -} - -SSP_ITEM_NAME = { - "AID_AGED_BLIND": "Aid to the Aged, Blind, and Disabled", - "AMT_FOOD_STAMP": "Amount of Food Stamps", - "AMT_SUB_CC": "Amount of Subsidized Child Care", - "CC_NBR_MONTHS": "Number of Months of Subsidized Child Care", - "CHILD_SUPPORT_AMT": "Amount of Child Support", - "COMM_SERVICES_EA": "Community Service - EA", - "COMM_SERVICES_HOL": "Community Service - HOL", - "COMM_SERVICES_HOP": "Community Service - HOP", - "COOPERATION_CHILD_SUPPORT": "Cooperation with Child Support", - "COUNTY_FIPS_CODE": "County FIPS Code", - "DATE_OF_BIRTH": "Date of Birth", - "DEEMED_HOURS_FOR": "Deemed Hours for", - "DISABLED_TITLE_XIVAPDT": "Disabled Title XIV-A PD/T", - "ED_NO_HIGH": "Education - No High School Diploma", - "FAILURE_TO_COMPLY": "Failure to Comply", - "FAMILY_CASH_RESOURCES": "Family Cash Resources", - "FAMILY_SANC_ADULT": "Family Sanctioned for an Adult", - "FED_DISABILITY_STATUS": "Federal Disability Status", - "FED_OASDI_PROGRAM": "Federal OASDI Program", - "JOB_SEARCH_EA": "Job Search - Excused Absence", - "JOB_SEARCH_HOL": "Job Search - Holiday", - "JOB_SEARCH_HOP": "Job Search - Hours of Participation", - "JOB_SKILLS_TRAINING": "Job Skills Training", - "NBR_FAMILY_MEMBERS": "Number of Family Members", - "NEEDS_PREGNANT_WOMAN": "Needs of a pregnant woman", - "NON_COOPERATION_CSE": "Non-Cooperation with Child Support Enforcement", - "OTHER_NBR_MONTHS": "Number of Months of Other Time", - "OTHER_NON_SANCTION": "Other Non-Sanction", - "OTHER_TOTAL_REDUCTIONS": "Other Total Reductions", - "OTHER_UNEARNED_INCOME": "Other Unearned Income", - "OTHER_WORK_ACTIVITIES": "Other Work Activities", - "PARENT_MINOR_CHILD": "Parent with a Minor Child", - "PROVIDE_CC_EA": "Provide Child Care - excused absence", - "PROVIDE_CC_HOL": "Provide Child Care - holiday", - "PROVIDE_CC_HOP": "Provide Child Care - hours of participation", - "RACE_AMER_INDIAN": "Race Americal Indian", - "RECEIVES_FOOD_STAMPS": "Receives Food Stamps", - "RECEIVES_MED_ASSISTANCE": "Receives Medical Assistance", - "RECEIVES_SUB_CC": "Receives Subsidized Child Care", - "RECEIVES_SUB_HOUSING": "Receives Subsidized Housing", - "RECEIVE_NONSSI_BENEFITS": "Receives Non-SSI Benefits", - "RECOUPMENT_PRIOR_OVRPMT": "Recoupment of Prior Overpayment", - "REDUCTIONS_ON_RECEIPTS": "Reductions on Receipts", - "RPT_MONTH_YEAR": "Report Month and Year", - "SANC_REDUCTION_AMT": "Sanction Reduction Amount", - "SANC_TEEN_PARENT": "Sanctioned Teen Parent", - "SCHOOL_ATTENDENCE_EA": "School Attendance - Excused Absence", - "SCHOOL_ATTENDENCE_HOL": "School Attendance - Holiday", - "SCHOOL_ATTENDENCE_HOP": "School Attendance - Hours of Participation", - "SCHOOL_DIPL_EA": "School Diploma - Excused Absence", - "SCHOOL_DIPL_HOL": "School Diploma - Holiday", - "SCHOOL_DIPL_HOP": "School Diploma - Hours of Participation", - "SUB_PRIVATE_EMPLOYMENT": "Subsidized Private Employment", - "SUB_PUBLIC_EMPLOYMENT": "Subsidized Public Employment", - "TANF_ASST_IN": "TANF Assistance In", - "TRANSITION_NBR_MONTHS": "Number of Months of Transition Services", - "TRANSITION_SERVICES_AMOUNT": "Transition Services Amount", - "TRANSP_NBR_MONTHS": "Number of Months of Transportation", - "UNEARNED_INCOME_TAX": "Unearned Income Tax", - "UNEARNED_SOCIAL_SECURITY": "Unearned Social Security", - "UNEARNED_WORKERS_COMP": "Unearned Workers Compensation", - "VOCATIONAL_ED_TRAINING": "Vocational Education Training", - "WAIVER_EVAL_CONTROL": "Waiver Evaluation Control", - "WORK_ELIGIBLE_INDICATOR": "Work Eligible Indicator", - "WORK_EXPERIENCE_EA": "Work Experience - Excused Absence", - "WORK_EXPERIENCE_HOL": "Work Experience - Holiday", - "WORK_EXPERIENCE_HOP": "Work Experience - Hours of Participation", - "WORK_PART_STATUS": "Work Participation Status", - "WORK_REQ_SANCTION": "Work Requirement Sanction", -} From d75ba044b62e18031749293b27c7eab2a0831759 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 30 Oct 2023 12:44:31 -0400 Subject: [PATCH 18/88] added test for json field in error model --- tdrs-backend/tdpservice/parsers/test/test_parse.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 5a940a71b..7b2fdd22f 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -472,6 +472,7 @@ def test_parse_ssp_section1_datafile(ssp_section1_datafile): assert err.error_message == 'EARNED_INCOME is required but a value was not provided.' assert err.content_type is not None assert err.object_id is not None + assert err.fields_json == {'friendly_name': 'earned income'} assert SSP_M1.objects.count() == expected_m1_record_count assert SSP_M2.objects.count() == expected_m2_record_count From ea5aa307ce9e4b6552d71adfb820a5c5122d9199 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 31 Oct 2023 09:26:47 -0400 Subject: [PATCH 19/88] linting --- tdrs-backend/tdpservice/parsers/fields.py | 50 ++++++++++++++++++----- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/fields.py b/tdrs-backend/tdpservice/parsers/fields.py index f620b934e..86719bc3d 100644 --- a/tdrs-backend/tdpservice/parsers/fields.py +++ b/tdrs-backend/tdpservice/parsers/fields.py @@ -4,12 +4,13 @@ logger = logging.getLogger(__name__) + def value_is_empty(value, length): """Handle 'empty' values as field inputs.""" empty_values = [ - ' '*length, # ' ' - '#'*length, # '#####' - '_'*length, # '_____' + " " * length, # ' ' + "#" * length, # '#####' + "_" * length, # '_____' ] return value is None or value in empty_values @@ -18,7 +19,17 @@ def value_is_empty(value, length): class Field: """Provides a mapping between a field name and its position.""" - def __init__(self, item, name, friendly_name, type, startIndex, endIndex, required=True, validators=[]): + def __init__( + self, + item, + name, + friendly_name, + type, + startIndex, + endIndex, + required=True, + validators=[], + ): self.item = item self.name = name self.friendly_name = friendly_name @@ -38,31 +49,48 @@ def __repr__(self): def parse_value(self, line): """Parse the value for a field given a line, startIndex, endIndex, and field type.""" - value = line[self.startIndex:self.endIndex] + value = line[self.startIndex : self.endIndex] - if value_is_empty(value, self.endIndex-self.startIndex): - logger.debug(f"Field: '{self.name}' at position: [{self.startIndex}, {self.endIndex}) is empty.") + if value_is_empty(value, self.endIndex - self.startIndex): + logger.debug( + f"Field: '{self.name}' at position: [{self.startIndex}, {self.endIndex}) is empty." + ) return None match self.type: - case 'number': + case "number": try: value = int(value) return value except ValueError: logger.error(f"Error parsing field value: {value} to integer.") return None - case 'string': + case "string": return value case _: logger.warn(f"Unknown field type: {self.type}.") return None + class TransformField(Field): """Represents a field that requires some transformation before serializing.""" - def __init__(self, transform_func, item, name, friendly_name, type, startIndex, endIndex, required=True, validators=[], **kwargs): - super().__init__(item, name, friendly_name, type, startIndex, endIndex, required, validators) + def __init__( + self, + transform_func, + item, + name, + friendly_name, + type, + startIndex, + endIndex, + required=True, + validators=[], + **kwargs, + ): + super().__init__( + item, name, friendly_name, type, startIndex, endIndex, required, validators + ) self.transform_func = transform_func self.kwargs = kwargs From b4d05494c906444cf95641b6859b186f605f7ab4 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 31 Oct 2023 10:10:31 -0400 Subject: [PATCH 20/88] linting --- tdrs-backend/tdpservice/parsers/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/fields.py b/tdrs-backend/tdpservice/parsers/fields.py index 86719bc3d..21c3d4d93 100644 --- a/tdrs-backend/tdpservice/parsers/fields.py +++ b/tdrs-backend/tdpservice/parsers/fields.py @@ -49,7 +49,7 @@ def __repr__(self): def parse_value(self, line): """Parse the value for a field given a line, startIndex, endIndex, and field type.""" - value = line[self.startIndex : self.endIndex] + value = line[self.startIndex: self.endIndex] if value_is_empty(value, self.endIndex - self.startIndex): logger.debug( From 8ce83cec51c941c09216011e7678fec99097d6b5 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 31 Oct 2023 10:25:02 -0400 Subject: [PATCH 21/88] linting --- .../tdpservice/parsers/schema_defs/header.py | 63 ++----------------- 1 file changed, 5 insertions(+), 58 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index f20e05541..a36d4d82f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -68,64 +68,11 @@ endIndex=14, required=True, validators=[ - validators.oneOf( - ( - "01", - "02", - "04", - "05", - "06", - "08", - "09", - "10", - "11", - "12", - "13", - "15", - "16", - "17", - "18", - "19", - "20", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "30", - "31", - "32", - "33", - "34", - "35", - "36", - "37", - "38", - "39", - "40", - "41", - "42", - "44", - "45", - "46", - "47", - "48", - "49", - "50", - "51", - "53", - "54", - "55", - "56", - "66", - "72", - "78", - ) - ) + validators.oneOf(("01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "15", + "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", + "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", + "40", "41", "42", "44", "45", "46", "47", "48", "49", "50", "51", "53", + "54", "55", "56", "66", "72", "78")) ], ), Field( From 7719e8510bb16cd6788da9e84db8f5d17c4aa72d Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 31 Oct 2023 13:19:10 -0600 Subject: [PATCH 22/88] - Added Tribal models, docs, admin refs - Added support for tribal parsing --- tdrs-backend/tdpservice/parsers/parse.py | 55 +- tdrs-backend/tdpservice/parsers/row_schema.py | 11 +- .../parsers/schema_defs/__init__.py | 2 + .../tdpservice/parsers/schema_defs/header.py | 11 +- .../schema_defs/tribal_tanf/__init__.py | 7 + .../parsers/schema_defs/tribal_tanf/t_t1.py | 264 ++++++++++ .../parsers/schema_defs/tribal_tanf/t_t2.py | 135 +++++ .../parsers/schema_defs/tribal_tanf/t_t3.py | 274 ++++++++++ .../parsers/test/data/ADS.E2J.FTP1.TS142 | 473 ++++++++++++++++++ .../tdpservice/parsers/test/test_parse.py | 27 + tdrs-backend/tdpservice/parsers/util.py | 22 +- .../search_indexes/admin/__init__.py | 6 +- .../tdpservice/search_indexes/admin/tribal.py | 57 +++ .../search_indexes/documents/__init__.py | 3 +- .../search_indexes/documents/tribal.py | 186 +++++++ ...l_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py | 156 ++++++ .../search_indexes/models/__init__.py | 3 +- .../search_indexes/models/tribal.py | 189 +++++++ 18 files changed, 1815 insertions(+), 66 deletions(-) create mode 100644 tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py create mode 100644 tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py create mode 100644 tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py create mode 100644 tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py create mode 100644 tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 create mode 100644 tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index 05c3da3ca..b80d24ea0 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -28,11 +28,14 @@ def parse_datafile(datafile): bulk_create_errors({1: header_errors}, 1, flush=True) return errors - is_encrypted = util.contains_encrypted_indicator(header_line, schema_defs.header.get_field_by_name("encryption")) + fields = schema_defs.header.get_fields_by_names({"encryption", "tribe_code"}) + is_encrypted = util.line_value_check(header_line, fields["encryption"], "E") + is_tribal = util.line_value_check(header_line, fields["tribe_code"], " ", True) logger.debug(f"Datafile has encrypted fields: {is_encrypted}.") + logger.debug(f"Datafile is Tribal: {is_tribal}.") # ensure file section matches upload section - program_type = header['program_type'] + program_type = f"Tribal {header['program_type']}" if is_tribal else header['program_type'] section = header['type'] logger.debug(f"Program type: {program_type}, Section: {section}.") @@ -49,7 +52,7 @@ def parse_datafile(datafile): bulk_create_errors(unsaved_parser_errors, 1, flush=True) return errors - line_errors = parse_datafile_lines(datafile, program_type, section, is_encrypted) + line_errors = parse_datafile_lines(datafile, program_type, section, is_encrypted, is_tribal) errors = errors | line_errors @@ -117,7 +120,7 @@ def rollback_parser_errors(datafile): num_deleted, models = ParserError.objects.filter(file=datafile).delete() logger.debug(f"Deleted {num_deleted} {ParserError}.") -def parse_datafile_lines(datafile, program_type, section, is_encrypted): +def parse_datafile_lines(datafile, program_type, section, is_encrypted, is_tribal): """Parse lines with appropriate schema and return errors.""" rawfile = datafile.file errors = {} @@ -251,50 +254,6 @@ def manager_parse_line(line, schema_manager, generate_error, is_encrypted=False) ) ])] - -def get_schema_manager_options(program_type): - """Return the allowed schema options.""" - match program_type: - case 'TAN': - return { - 'A': { - 'T1': schema_defs.tanf.t1, - 'T2': schema_defs.tanf.t2, - 'T3': schema_defs.tanf.t3, - }, - 'C': { - 'T4': schema_defs.tanf.t4, - 'T5': schema_defs.tanf.t5, - }, - 'G': { - 'T6': schema_defs.tanf.t6, - }, - 'S': { - 'T7': schema_defs.tanf.t7, - }, - } - case 'SSP': - return { - 'A': { - 'M1': schema_defs.ssp.m1, - 'M2': schema_defs.ssp.m2, - 'M3': schema_defs.ssp.m3, - }, - 'C': { - # 'M4': schema_options.m4, - # 'M5': schema_options.m5, - }, - 'G': { - # 'M6': schema_options.m6, - }, - 'S': { - # 'M7': schema_options.m7, - }, - } - # case tribal? - return None - - def get_schema_manager(line, section, program_type): """Return the appropriate schema for the line.""" line_type = line[0:2] diff --git a/tdrs-backend/tdpservice/parsers/row_schema.py b/tdrs-backend/tdpservice/parsers/row_schema.py index d19f9f5f1..67c63c397 100644 --- a/tdrs-backend/tdpservice/parsers/row_schema.py +++ b/tdrs-backend/tdpservice/parsers/row_schema.py @@ -163,9 +163,10 @@ def run_postparsing_validators(self, instance, generate_error): return is_valid, errors - def get_field_by_name(self, name): - """Get field by it's name.""" + def get_fields_by_names(self, names={}): + """Return dictionary of fields keyed on their name.""" + fields = {} for field in self.fields: - if field.name == name: - return field - return None + if field.name in names: + fields[field.name] = field + return fields diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/__init__.py b/tdrs-backend/tdpservice/parsers/schema_defs/__init__.py index f79fe3075..3122c2451 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/__init__.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/__init__.py @@ -1,9 +1,11 @@ from .header import header from .trailer import trailer from . import tanf +from . import tribal_tanf from . import ssp header = header trailer = trailer tanf = tanf +tribal_tanf = tribal_tanf ssp = ssp diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index 96ede4754..b4d991aa0 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -30,10 +30,13 @@ validators.oneOf(['A', 'C', 'G', 'S']) ]), Field(item="1", name='state_fips', type='string', startIndex=12, endIndex=14, required=True, validators=[ - validators.oneOf(("01", "02", "04", "05", "06", "08", "09", "10", "11", "12", "13", "15", "16", "17", "18", - "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", - "34", "35", "36", "37", "38", "39", "40", "41", "42", "44", "45", "46", "47", "48", "49", - "50", "51", "53", "54", "55", "56", "66", "72", "78")) + validators.or_validators(validators.isInStringRange(0, 2), + validators.isInStringRange(4, 6), + validators.isInStringRange(8, 13), + validators.isInStringRange(15, 42), + validators.isInStringRange(44, 51), + validators.isInStringRange(53, 56), + validators.oneOf(['66', '72', '78'])) ]), Field(item="3", name='tribe_code', type='string', startIndex=14, endIndex=17, required=False, validators=[ validators.isInStringRange(0, 999) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py new file mode 100644 index 000000000..928723495 --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py @@ -0,0 +1,7 @@ +from .t_t1 import t_t1 +from .t_t2 import t_t2 +from .t_t3 import t_t3 + +t_t1 = t_t1 +t_t2 = t_t2 +t_t3 = t_t3 diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py new file mode 100644 index 000000000..6ed1e200e --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py @@ -0,0 +1,264 @@ +"""Schema for Tribal TANF T1 record types.""" + +from ...util import SchemaManager +from ...fields import Field +from ...row_schema import RowSchema +from ... import validators +from tdpservice.search_indexes.models.tribal import Tribal_TANF_T1 + + +t_t1 = SchemaManager(schemas=[ + RowSchema( + model=Tribal_TANF_T1, + preparsing_validators=[ + validators.hasLength(123), + ], + postparsing_validators=[ + validators.if_then_validator( + condition_field='CASH_AMOUNT', condition_function=validators.isLargerThan(0), + result_field='NBR_MONTHS', result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), + result_field='CHILDREN_COVERED', result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), + result_field='CC_NBR_MONTHS', result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='TRANSP_AMOUNT', condition_function=validators.isLargerThan(0), + result_field='TRANSP_NBR_MONTHS', result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='TRANSITION_SERVICES_AMOUNT', condition_function=validators.isLargerThan(0), + result_field='TRANSITION_NBR_MONTHS', result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='OTHER_AMOUNT', condition_function=validators.isLargerThan(0), + result_field='OTHER_NBR_MONTHS', result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), + result_field='WORK_REQ_SANCTION', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), + result_field='FAMILY_SANC_ADULT', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), + result_field='SANC_TEEN_PARENT', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), + result_field='NON_COOPERATION_CSE', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), + result_field='FAILURE_TO_COMPLY', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), + result_field='OTHER_SANCTION', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), + result_field='FAMILY_CAP', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), + result_field='REDUCTIONS_ON_RECEIPTS', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), + result_field='OTHER_NON_SANCTION', result_function=validators.oneOf((1, 2)), + ), + validators.sumIsLarger(("AMT_FOOD_STAMP_ASSISTANCE", "AMT_SUB_CC", "CASH_AMOUNT", "CC_AMOUNT", + "TRANSP_AMOUNT", "TRANSITION_SERVICES_AMOUNT", "OTHER_AMOUNT"), 0) + ], + fields=[ + Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + required=True, validators=[]), + Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + required=True, validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ]), + Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + required=True, validators=[validators.isAlphaNumeric()]), + Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, + required=True, validators=[ + validators.isNumber(), + ]), + Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, + required=True, validators=[ + validators.isInStringRange(0, 99), + ]), + Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, + required=True, validators=[ + validators.isNumber(), + ]), + Field(item="8", name='FUNDING_STREAM', type='number', startIndex=29, endIndex=30, + required=True, validators=[ + validators.isInLimits(1, 3), + ]), + Field(item="9", name='DISPOSITION', type='number', startIndex=30, endIndex=31, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="10", name='NEW_APPLICANT', type='number', startIndex=31, endIndex=32, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="11", name='NBR_FAMILY_MEMBERS', type='number', startIndex=32, endIndex=34, + required=True, validators=[ + validators.isLargerThan(0), + ]), + Field(item="12", name='FAMILY_TYPE', type='number', startIndex=34, endIndex=35, + required=True, validators=[ + validators.isInLimits(1, 3), + ]), + Field(item="13", name='RECEIVES_SUB_HOUSING', type='number', startIndex=35, endIndex=36, + required=True, validators=[ + validators.isInLimits(1, 3), + ]), + Field(item="14", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=36, endIndex=37, + required=True, validators=[ + validators.isInLimits(1, 2), + ]), + Field(item="15", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=37, endIndex=38, + required=True, validators=[ + validators.isInLimits(0, 2), + ]), + Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=38, endIndex=42, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="17", name='RECEIVES_SUB_CC', type='number', startIndex=42, endIndex=43, + required=True, validators=[ + validators.isInLimits(0, 3), + ]), + Field(item="18", name='AMT_SUB_CC', type='number', startIndex=43, endIndex=47, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="19", name='CHILD_SUPPORT_AMT', type='number', startIndex=47, endIndex=51, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="20", name='FAMILY_CASH_RESOURCES', type='number', startIndex=51, endIndex=55, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="21A", name='CASH_AMOUNT', type='number', startIndex=55, endIndex=59, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="21B", name='NBR_MONTHS', type='number', startIndex=59, endIndex=62, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="22A", name='CC_AMOUNT', type='number', startIndex=62, endIndex=66, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="22B", name='CHILDREN_COVERED', type='number', startIndex=66, endIndex=68, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="22C", name='CC_NBR_MONTHS', type='number', startIndex=68, endIndex=71, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="23A", name='TRANSP_AMOUNT', type='number', startIndex=71, endIndex=75, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="23B", name='TRANSP_NBR_MONTHS', type='number', startIndex=75, endIndex=78, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=78, endIndex=82, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="24B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=82, endIndex=85, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="25A", name='OTHER_AMOUNT', type='number', startIndex=85, endIndex=89, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="25B", name='OTHER_NBR_MONTHS', type='number', startIndex=89, endIndex=92, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="26AI", name='SANC_REDUCTION_AMT', type='number', startIndex=92, endIndex=96, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="26AII", name='WORK_REQ_SANCTION', type='number', startIndex=96, endIndex=97, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=97, endIndex=98, + required=True, validators=[ + validators.oneOf([0, 1, 2]), + ]), + Field(item="26AIV", name='SANC_TEEN_PARENT', type='number', startIndex=98, endIndex=99, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26AV", name='NON_COOPERATION_CSE', type='number', startIndex=99, endIndex=100, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=100, endIndex=101, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26AVII", name='OTHER_SANCTION', type='number', startIndex=101, endIndex=102, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=102, endIndex=106, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=106, endIndex=110, + required=True, validators=[ + validators.isLargerThanOrEqualTo(0), + ]), + Field(item="26CII", name='FAMILY_CAP', type='number', startIndex=110, endIndex=111, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=111, endIndex=112, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="26CIV", name='OTHER_NON_SANCTION', type='number', startIndex=112, endIndex=113, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', type='string', startIndex=113, endIndex=114, + required=True, validators=[ + validators.or_validators(validators.matches('9'), validators.isEmpty()), + validators.isAlphaNumeric(), + ]), + Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', type='number', startIndex=114, endIndex=116, + required=True, validators=[ + validators.oneOf([1, 2, 3, 4, + 6, 7, 8, 9]) + ]), + Field(item="29", name='FAMILY_NEW_CHILD', type='number', startIndex=116, endIndex=117, + required=True, validators=[ + validators.oneOf([1, 2]), + ]), + Field(item="-1", name='BLANK', type='string', startIndex=117, endIndex=123, required=False, + validators=[]), + ], + )] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py new file mode 100644 index 000000000..fd6b51ddb --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py @@ -0,0 +1,135 @@ +"""Schema for Tribal TANF T2 row of all submission types.""" + + +from ...util import SchemaManager +from ...transforms import tanf_ssn_decryption_func +from ...fields import TransformField, Field +from ...row_schema import RowSchema +from ... import validators +from tdpservice.search_indexes.models.tribal import Tribal_TANF_T2 + + +t_t2 = SchemaManager(schemas=[ + RowSchema( + model=Tribal_TANF_T2, + preparsing_validators=[ + validators.hasLength(123), + ], + postparsing_validators=[ + ], + fields=[ + Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + required=True, validators=[]), + Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + required=True, validators=[validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ]), + Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + required=True, validators=[validators.isAlphaNumeric()]), + Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + required=True, validators=[validators.oneOf([1, 2, 3, 5])]), + Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, + validators=[validators.oneOf([1, 2])]), + Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, + validators=[validators.isLargerThan(0),]), + TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, + endIndex=38, required=True, + validators=[validators.validateSSN()], is_encrypted=False), + Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=True, + validators=[validators.isInLimits(0, 2)]), + Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=True, + validators=[validators.isInLimits(0, 2)]), + Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=True, + validators=[validators.isInLimits(0, 2)]), + Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=True, + validators=[validators.isInLimits(0, 2)]), + Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=True, + validators=[validators.isInLimits(0, 2)]), + Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=True, + validators=[validators.isInLimits(0, 2)]), + Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, + validators=[validators.isLargerThanOrEqualTo(0),]), + Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, + validators=[validators.oneOf([1, 2])]), + Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, + validators=[validators.oneOf([1, 2])]), + Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, + validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), + Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=True, + validators=[validators.isLargerThanOrEqualTo(0),]), + Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, + validators=[validators.oneOf([1, 2]),]), + Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=True, + validators=[validators.isInLimits(0, 5),]), + Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, + validators=[validators.isInStringRange(1, 10),]), + Field(item="39", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=True, + validators=[validators.isInLimits(0, 3),]), + Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=True, + validators=[validators.isInLimits(0, 9),]), + Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=True, + validators=[validators.or_validators(validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + )]), + Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=True, + validators=[validators.oneOf([0, 1, 2, 9])]), + Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, required=True, + validators=[validators.oneOf([0, 1, 2, 9]),]), + Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=True, + validators=[validators.isInStringRange(0, 999),]), + Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, + required=True, validators=[validators.isInLimits(0, 9),]), + Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=True, + validators=[validators.isInLimits(0, 3),]), + Field(item="48", name='WORK_PART_STATUS', type='string', startIndex=66, endIndex=68, required=True, + validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), + Field(item="49", name='UNSUB_EMPLOYMENT', type='string', startIndex=68, endIndex=70, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="50", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="51", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="52", name='WORK_EXPERIENCE', type='string', startIndex=74, endIndex=76, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="53", name='OJT', type='string', startIndex=76, endIndex=78, required=True, validators=[ + validators.isInStringRange(0, 99), + ]), + Field(item="54", name='JOB_SEARCH', type='string', startIndex=78, endIndex=80, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="55", name='COMM_SERVICES', type='string', startIndex=80, endIndex=82, required=True, + validators=[validators.isInStringRange(0, 99),]), + Field(item="56", name='VOCATIONAL_ED_TRAINING', type='string', startIndex=82, endIndex=84, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="57", name='JOB_SKILLS_TRAINING', type='string', startIndex=84, endIndex=86, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58", name='ED_NO_HIGH_SCHOOL_DIPLOMA', type='string', startIndex=86, endIndex=88, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59", name='SCHOOL_ATTENDENCE', type='string', startIndex=88, endIndex=90, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60", name='PROVIDE_CC', type='string', startIndex=90, endIndex=92, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61", name='ADD_WORK_ACTIVITIES', type='string', startIndex=92, endIndex=94, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=94, endIndex=96, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="63", name='REQ_HRS_WAIVER_DEMO', type='string', startIndex=96, endIndex=98, + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="64", name='EARNED_INCOME', type='string', startIndex=98, endIndex=102, + required=False, validators=[validators.isInStringRange(0, 9999),]), + Field(item="65A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=102, endIndex=106, + required=False, validators=[validators.isInStringRange(0, 9999),]), + Field(item="65B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=106, endIndex=110, + required=False, validators=[validators.isInStringRange(0, 9999),]), + Field(item="65C", name='UNEARNED_SSI', type='string', startIndex=110, endIndex=114, required=False, + validators=[validators.isInStringRange(0, 9999),]), + Field(item="65D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=114, endIndex=118, required=False, + validators=[validators.isInStringRange(0, 9999),]), + Field(item="65E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=118, endIndex=122, required=False, + validators=[validators.isInStringRange(0, 9999),]), + Field(item="-1", name='BLANK', type='string', startIndex=122, endIndex=123, required=False, + validators=[]), + ], + )] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py new file mode 100644 index 000000000..b0b5cf7c5 --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py @@ -0,0 +1,274 @@ +"""Schema for Tribal TANF T3 row of all submission types.""" + + +from ...util import SchemaManager +from ...transforms import tanf_ssn_decryption_func +from ...fields import TransformField, Field +from ...row_schema import RowSchema +from ... import validators +from tdpservice.search_indexes.models.tribal import Tribal_TANF_T3 + + +child_one = RowSchema( + model=Tribal_TANF_T3, + preparsing_validators=[ + validators.notEmpty(start=19, end=60), + ], + postparsing_validators=[ + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='SSN', result_function=validators.validateSSN(), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), + result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), + ), + ], + fields=[ + Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + required=True, validators=[]), + Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + required=True, validators=[]), + Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + required=True, validators=[validators.isAlphaNumeric()]), + Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + required=True, validators=[ + validators.oneOf([1, 2, 4]) + ]), + Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=20, endIndex=28, + required=True, validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ]), + TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=28, + endIndex=37, required=True, validators=[validators.validateSSN()], + is_encrypted=False), + Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, + required=True, validators=[validators.validateRace()]), + Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, + required=True, validators=[validators.validateRace()]), + Field(item="70C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, + required=True, validators=[validators.validateRace()]), + Field(item="70D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, + required=True, validators=[validators.validateRace()]), + Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, + required=True, validators=[validators.validateRace()]), + Field(item="70F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, + required=True, validators=[validators.validateRace()]), + Field(item="71", name='GENDER', type='number', startIndex=43, endIndex=44, + required=True, validators=[ + validators.isInLimits(0, 9) + ]), + Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=44, endIndex=45, + required=True, validators=[ + validators.oneOf([1, 2]) + ]), + Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, + required=True, validators=[ + validators.oneOf([1, 2]) + ]), + Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=46, endIndex=48, + required=True, validators=[ + validators.isInStringRange(0, 10) + ]), + Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, + required=True, validators=[ + validators.oneOf([0, 2, 3]) + ]), + Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=49, endIndex=51, + required=True, validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + ) + ]), + Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, + required=True, validators=[ + validators.oneOf([0, 1, 2, 9]) + ]), + Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=52, endIndex=56, + required=False, validators=[ + validators.isInStringRange(0, 9999) + ]), + Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=56, endIndex=60, + required=False, validators=[ + validators.isInStringRange(0, 9999) + ]), + ], +) + +child_two = RowSchema( + model=Tribal_TANF_T3, + quiet_preparser_errors=True, + preparsing_validators=[ + validators.notEmpty(start=60, end=101), + ], + postparsing_validators=[ + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='SSN', result_function=validators.validateSSN(), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), + result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), + ), + ], + fields=[ + Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + required=True, validators=[]), + Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + required=True, validators=[]), + Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + required=True, validators=[validators.isAlphaNumeric()]), + Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, + required=True, validators=[ + validators.oneOf([1, 2, 4]) + ]), + Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=61, endIndex=69, + required=True, validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ]), + TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=69, + endIndex=78, required=True, validators=[validators.validateSSN()], + is_encrypted=False), + Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, + required=True, validators=[validators.validateRace()]), + Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, + required=True, validators=[validators.validateRace()]), + Field(item="70C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, + required=True, validators=[validators.validateRace()]), + Field(item="70D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, + required=True, validators=[validators.validateRace()]), + Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, + required=True, validators=[validators.validateRace()]), + Field(item="70F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, + required=True, validators=[validators.validateRace()]), + Field(item="71", name='GENDER', type='number', startIndex=84, endIndex=85, + required=True, validators=[ + validators.isInLimits(0, 9) + ]), + Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=85, endIndex=86, + required=True, validators=[ + validators.oneOf([1, 2]) + ]), + Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, + required=True, validators=[ + validators.oneOf([1, 2]) + ]), + Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=87, endIndex=89, + required=True, validators=[ + validators.isInStringRange(0, 10) + ]), + Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, + required=True, validators=[ + validators.oneOf([0, 2, 3]) + ]), + Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=90, endIndex=92, + required=True, validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.oneOf(['98', '99']) + ) + ]), + Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, + required=True, validators=[ + validators.oneOf([0, 1, 2, 9]) + ]), + Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=93, endIndex=97, + required=False, validators=[ + validators.isInStringRange(0, 9999) + ]), + Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=97, endIndex=101, + required=False, validators=[ + validators.isInStringRange(0, 9999) + ]), + ], +) + +t_t3 = SchemaManager( + schemas=[ + child_one, + child_two + ] +) diff --git a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 new file mode 100644 index 000000000..969114f96 --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 @@ -0,0 +1,473 @@ +HEADER20194A00142TAN1EU +T120191011111111119255 140245112 23322 03 0 0 0 502 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201910111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 +T120191011111111132255 140245112 61312 03 0 0 0 465 17 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 +T2201910111111111321219820417WTTTTTTTB2222212222223 1321619 36242219 0 0 0 0 0 0 0 0 0 0 0 00028 1149 0 0 0 0 0 +T320191011111111132120150514WTTTTTZT#212222222 43981 0 0 +T320191011111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 +T320191011111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 +T120191011111111233255 140356112 23122 03 0 0 0 502 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2201910111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 +T120191011111111241255 140245112 23312 03 0 0 0 502 8 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201910111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 +T120191011111111305255 140356112 13112 03 0 0 0 399 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201910111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111305120040508WTTTTTT9P212222222 83 71 0 0 +T120191011111111312255 140245112 13322 03 0 0 0 399121 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 +T2201910111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111312120090322WTTTTTT@9212222222 83981 0 0 +T120191011111111339255 140356111 22312 03 0 0 0 453 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201910111111113391219880402WTTTTTZ#B2122221222223 2311211 2582119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111113391219970502WTTTTTTYB2122222222221 1111119 75322 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T120191011111111350255 140245112 33322 03 0 0 0 559 27 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 +T2201910111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111350120100114WTTTTT@WB112222122 43 11 0 0 +T320191011111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 +T120191011111111382255 140245112 33312 03 0 0 0 605 33 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 +T2201910111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111382120080325WTTTTT9TB222221222 83 11 0 0 +T320191011111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 +T120191011111111415255 140356112 13112 03 0 0 0 399 41 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 +T2201910111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 +T320191011111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 +T120191011111111652255 140356111 52312 03 0 0 0 26 53 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 +T2201910111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111652120130426WTTTTTTWT212222122 43981 0 0 +T320191011111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 +T120191011111111663255 140245112 32312 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201910111111116631219910105WTTTTT9#92122221222222 2321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111116631219910303WTTTTT9BB2222212222222 1321219 5552119 3 0 0 0 0 5 0 0 0 0 0 00013 0 0 0 0 0 0 +T320191011111111663120120514WTTTTT9WP212222122 43 11 0 0 +T120191011111111668255 140356111 31112 03 0 0 0 488 6 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111116681219900413WTTTTT@@Y2122221222221 1321212 14462219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T320191011111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 +T120191011111111694255 140356112 13322 03 0 0 0 394142 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 +T2201910111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111694120010527WTTTTTZYT212222122 63 51 0 0 +T120191011111111709255 140245112 13312 03 0 0 0 399 55 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 +T2201910111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111709120110101WTTTTTZ0W212222122 83981 0 0 +T120191011111111716255 140317112 23322 03 0 0 0 502 55 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 +T2201910111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111716120140401WTTTTTTBT212222222 63981 0 0 +T320191011111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 +T120191011111111742255 140245112 31312 03 0 0 01680 94 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 +T2201910111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 033 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 +T120191011111111762255 140245112 23312 03 0 0 0 502 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111117623219880112WTTTTTTY#2222212222222 1321619 1592199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111117623219610502WTTTTTT##2222212222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111111762120160102WTTTTT@YB212222222 83981 0 0120170526WTTTTTZPW212222122 83981 0 0 +T120191011111111794255 140245112 52312 03 0 0 0 811 16 0 0 0 0 0 0 0 0 0 0212222 0 0222 12 +T2201910111111117941219800125WTTTTTZB92122222222221 1121219 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 +T2201910111111117941219760325WTTTTTZ#Y2222211222221 212 919 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 +T320191011111111794120170527WTTTTT9##212222122 43981 0 0 +T320191011111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 +T120191011111111830255 140356111 31112 03 0 0 0 585 1 0 0 0 0 0 0 0 30 1 0222222 0 0222 12 +T2201910111111118301219790105WTTTTT9BW2122222222221 1321211 65421 2 1 0 0 0 0 1 0 0 0 0 0 000 6 0 0 0 0 0 0 +T320191011111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 +T120191011111111850255 140356112 42112 03 0 0 01203 36 0 0 0 0 6 0 1 650 17 0222222 0 0222 42 +T2201910111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 0 0 0 0 0 0 00022 0 0 0 0 0 0 +T2201910111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 010 000 6 0 0 0 0 0 0 +T320191011111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 +T120191011111112010255 140356112 13322 03 0 0 0 399153 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 +T2201910111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112010120060102WTTTTT@T#212222222 63 11 0 0 +T120191011111112058255 140245112 13322 03 0 0 0 399 54 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 +T2201910111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112058120131114WTTTTT@TT212222122 83981 0 0 +T120191011111112111255 140356112 21312 03 0 0 0 502 20 0 0 0 0 0 0 0 335 8 0222222 0 0222 42 +T2201910111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 +T320191011111112111120140102WTTTTT@@@212222222 43981 0 0 +T120191011111112120255 140245112 13322 03 0 0 0 399 15 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112120120090105WTTTTTTPP212222122 83 31 0 0 +T120191011111112181255 140356112 21312 03 0 0 01219 12 0 0 0 0 0 0 0 240 2 0222212 0 0222 42 +T2201910111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 021 0 0 0 0 0 0 0 000 8 0 0 0 0 0 0 +T320191011111112181120180508WTTTTTTPZ212222222 43981 0 0 +T120191011111112235255 140245112 13322 03 0 0 0 399119 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 +T2201910111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112235120020122WTTTTTTB#212222222 83 51 0 0 +T120191011111112245255 140245112 51322 03 0 0 0 811 66 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 +T2201910111111122451219840313WTTTTTTB92122222222221 1211211 60 02119 7 0 0 0 0 8 0 0 0 0 0 00012 0 0 0 0 0 0 +T320191011111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 +T320191011111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 +T120191011111112338255 140356112 13112 03 0 0 0 399 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112338120080802WTTTTTZ0Z212222122 83 31 0 0 +T120191011111112413255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112413120150514WTTTTTZPP212222122 83981 0 0 +T120191011111112436255 140356112 13112 03 0 0 0 399 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201910111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112436120150314WTTTTTZP9212222222 63981 0 0 +T120191011111112461255 140245112 13322 03 0 0 0 399 30 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 +T2201910111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112461120171102WTTTTTZWT222221122 83981 0 0 +T120191011111112542255 140356112 13112 03 0 0 0 399 22 0 0 0 0 0 0 0 130 3 0222222 0 0222 22 +T2201910111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112542120030402WTTTTTTYP212222122 83 81 0 0 +T120191011111112583255 140245112 21312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 +T2201910111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 5 00016 0 0 0 0 0 0 +T320191011111112583120180421WTTTTT9WW222221122 43981 0 0 +T120191011111112627255 140245112 33322 03 0 0 0 605 66 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 +T2201910111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112627120110113WTTTTTTWW222221222 83981 0 0 +T320191011111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 +T120191011111112658255 140245112 13322 03 0 0 0 399 33 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112658120140412WTTTTTT9#212222222 83981 0 0 +T120191011111112870255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201910111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112870120130312WTTTTTTBY212222122 73981 0 0 +T120191011111112912255 140356111 33112 03 0 0 0 292 1 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201910111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112912120090501WTTTTT9TY222212222 63 51 0 0 +T320191011111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 +T120191011111112924255 140356112 13322 03 0 0 0 399126 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 +T2201910111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112924120080522WTTTTTZW@212222222 93981 0 0 +T120191011111112989255 140245112 13312 03 0 0 0 399 32 189 1 7 0 1 0 0 0 0 0222222 0 0222 12 +T2201910111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201910111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191011111112989120160802WTTTTTTZ#212222122 63981 0 0 +T120191111111111119255 140245112 23322 03 0 0 0 502 10 0 0 0 0 0 0 0 567 4 0222222 0 0222 12 +T2201911111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 +T120191111111111132255 140245112 61312 03 0 0 0 914 18 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 +T2201911111111111321219820417WTTTTTTTB2222212222223 1321619 3723211920 0 0 0 0 0 0 0 0 0 0 00012 0 0 0 0 0 0 +T320191111111111132120150514WTTTTTZT#212222222 43981 0 0 +T320191111111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 +T320191111111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 +T120191111111111233255 140356112 23122 03 0 0 0 502 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2201911111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 +T120191111111111241255 140245112 23312 03 0 0 0 502 9 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201911111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 +T120191111111111305255 140356112 13112 03 0 0 0 399 13 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201911111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111305120040508WTTTTTT9P212222222 83 71 0 0 +T120191111111111312255 140245112 13322 03 0 0 0 399122 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 +T2201911111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111312120090322WTTTTTT@9212222222 83981 0 0 +T120191111111111339255 140356112 22312 03 0 0 0 502 6 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201911111111113391219880402WTTTTTZ#B2122221222223 2311211 3572119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111113391219970502WTTTTTTYB2122222222221 1111119 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T120191111111111350255 140245112 33322 03 0 0 0 559 28 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 +T2201911111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111350120100114WTTTTT@WB112222122 43 11 0 0 +T320191111111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 +T120191111111111382255 140245112 33312 03 0 0 0 605 34 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 +T2201911111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111382120080325WTTTTT9TB222221222 83 11 0 0 +T320191111111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 +T120191111111111415255 140356112 13112 03 0 0 0 399 42 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 +T2201911111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 +T320191111111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 +T120191111111111652255 140356112 52312 03 0 0 0 811 54 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 +T2201911111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 +T2201911111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 +T320191111111111652120130426WTTTTTTWT212222122 43981 0 0 +T320191111111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 +T120191111111111663255 140245112 32312 03 0 0 0 605 4 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201911111111116631219910105WTTTTT9#92122221222222 2321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111116631219910303WTTTTT9BB2222212222222 1321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111663120120514WTTTTT9WP212222122 43 11 0 0 +T120191111111111668255 140356112 31112 03 0 0 0 605 7 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111116681219900413WTTTTT@@Y2122221222221 1321212 1545211921 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 +T320191111111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 +T120191111111111694255 140356112 13322 03 0 0 0 394143 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 +T2201911111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111694120010527WTTTTTZYT212222122 63 51 0 0 +T120191111111111709255 140245112 13312 03 0 0 0 399 56 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 +T2201911111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111709120110101WTTTTTZ0W212222122 83981 0 0 +T120191111111111716255 140317112 23322 03 0 0 0 502 56 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 +T2201911111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111716120140401WTTTTTTBT212222222 63981 0 0 +T320191111111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 +T120191111111111742255 140245112 31312 03 0 0 01512 95 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 +T2201911111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 028 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 +T120191111111111794255 140245112 52312 03 0 0 0 811 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111117941219800125WTTTTTZB92122222222221 1121219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111117941219760325WTTTTTZ#Y2222211222221 212 919 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111794120170527WTTTTT9##212222122 43981 0 0 +T320191111111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 +T120191111111111830255 140356112 31112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201911111111118301219790105WTTTTT9BW2122222222221 1321211 75321 2 3 0 0 0 0 0 0 0 0 0 0 00014 0 0 0 0 0 0 +T320191111111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 +T120191111111111850255 140356112 42112 03 0 0 01205 37 0 0 0 0 6 0 1 100 18 0222212 0 0222 42 +T2201911111111118501219870513WTTTTTZPY2122222222223 1321212 060111935 0 0 0 0 0 0 0 0 0 0 000 5 0 0 0 0 0 0 +T2201911111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 0 6 000 5 0 0 0 0 0 0 +T320191111111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 +T120191111111111953255 140356112 21312 03 0 0 0 264104 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 +T2201911111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 +T2201911111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111111953120070102WTTTTTZZY212222122 43981 0 0 +T120191111111112010255 140356112 13322 03 0 0 0 399154 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 +T2201911111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112010120060102WTTTTT@T#212222222 63 11 0 0 +T120191111111112058255 140245112 13322 03 0 0 0 399 55 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 +T2201911111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112058120131114WTTTTT@TT212222122 83981 0 0 +T120191111111112111255 140356112 21312 03 0 0 0 502 21 0 0 0 0 0 0 0 0 8 0222222 0 0222 42 +T2201911111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 1 0 0 0 0 0 000 4 0 0 0 0 0 0 +T320191111111112111120140102WTTTTT@@@212222222 43981 0 0 +T120191111111112120255 140245112 13322 03 0 0 0 399 16 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112120120090105WTTTTTTPP212222122 83 31 0 0 +T120191111111112181255 140356112 21312 03 0 0 01252 13 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 +T2201911111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 022 0 0 0 0 0 0 0 00011 0 0 0 0 0 0 +T320191111111112181120180508WTTTTTTPZ212222222 43981 0 0 +T120191111111112235255 140245112 13322 03 0 0 0 399120 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 +T2201911111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112235120020122WTTTTTTB#212222222 83 51 0 0 +T120191111111112245255 140245112 51322 03 0 0 0 559 67 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 +T2201911111111122451219840313WTTTTTTB92122222222221 1211211 60 0211915 0 0 0 0 1 0 0 0 0 0 00012 754 0 0 0 0 0 +T320191111111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 +T320191111111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 +T120191111111112338255 140356112 13112 03 0 0 0 399 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112338120080802WTTTTTZ0Z212222122 83 31 0 0 +T120191111111112413255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112413120150514WTTTTTZPP212222122 83981 0 0 +T120191111111112436255 140356112 13112 03 0 0 0 399 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201911111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112436120150314WTTTTTZP9212222222 63981 0 0 +T120191111111112461255 140245112 13322 03 0 0 0 399 31 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 +T2201911111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112461120171102WTTTTTZWT222221122 83981 0 0 +T120191111111112542255 140356112 13112 03 0 0 0 399 23 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2201911111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112542120030402WTTTTTTYP212222122 83 81 0 0 +T120191111111112583255 140245112 21312 03 0 0 0 502 11 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 +T2201911111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 016 00014 0 0 0 0 0 0 +T320191111111112583120180421WTTTTT9WW222221122 43981 0 0 +T120191111111112627255 140245112 33322 03 0 0 0 605 67 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 +T2201911111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112627120110113WTTTTTTWW222221222 83981 0 0 +T320191111111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 +T120191111111112658255 140245112 13322 03 0 0 0 399 34 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112658120140412WTTTTTT9#212222222 83981 0 0 +T120191111111112679255 140356111 42112 03 0 0 0 708 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111126791219790412WTTTTTZP@2122221222221 1321219 20402219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T2201911111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T320191111111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 +T120191111111112870255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201911111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112870120130312WTTTTTTBY212222122 73981 0 0 +T120191111111112912255 140356112 33112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201911111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112912120090501WTTTTT9TY222212222 63 51 0 0 +T320191111111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 +T120191111111112924255 140356112 13322 03 0 0 0 399127 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 +T2201911111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112924120080522WTTTTTZW@212222222 93981 0 0 +T120191111111112989255 140245112 13312 03 0 0 0 399 33 208 1 8 0 1 0 0 0 0 0222222 0 0222 12 +T2201911111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201911111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191111111112989120160802WTTTTTTZ#212222122 63981 0 0 +T120191211111111119255 140245112 23322 03 0 0 0 502 11 0 0 0 0 0 0 0 0 4 0222222 0 0222 12 +T2201912111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 +T120191211111111132255 140245112 61312 03 0 0 0 914 19 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 +T2201912111111111321219820417WTTTTTTTB2222212222223 1321619 3822211910 0 0 0 0 0 0 0 0 0 0 00019 0 0 0 0 0 0 +T320191211111111132120150514WTTTTTZT#212222222 43981 0 0 +T320191211111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 +T320191211111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 +T120191211111111233255 140356112 23122 03 0 0 0 502 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2201912111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 +T120191211111111241255 140245112 23312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201912111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 +T120191211111111305255 140356112 13112 03 0 0 0 399 14 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201912111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111305120040508WTTTTTT9P212222222 83 71 0 0 +T120191211111111312255 140245112 13322 03 0 0 0 399123 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 +T2201912111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111312120090322WTTTTTT@9212222222 83981 0 0 +T120191211111111382255 140245112 33312 03 0 0 0 605 35 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 +T2201912111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111382120080325WTTTTT9TB222221222 83 11 0 0 +T320191211111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 +T120191211111111415255 140356112 13112 03 0 0 0 399 43 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 +T2201912111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 +T320191211111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 +T120191211111111446255 140245112 21312 03 0 0 0 210 23 0 0 0 0 0 0 0 0 6 0222222 0 0222 12 +T2201912111111114461219791105WTTTTTZ0T2122222222221 1321219 26342219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T320191211111111446120050302WTTTTT@TW222221222 43 71 0 0 +T120191211111111652255 140356112 52312 03 0 0 0 811 55 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 +T2201912111111116521219830826WTTTTT9W02122221222221 2321219 060111927 0 0 0 0 0 0 0 0 0 0 000 6 0 0 0 0 0 0 +T2201912111111116521119880125WTTTTTZT@2122222222221 1211212 174312 1 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 +T320191211111111652120130426WTTTTTTWT212222122 43981 0 0 +T320191211111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 +T120191211111111663255 140245112 21312 03 0 0 0 502 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2201912111111116631219910303WTTTTT9BB2222212222222 1321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111663120120514WTTTTT9WP212222122 43 11 0 0 +T120191211111111668255 140356112 31112 03 0 0 0 605 8 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111116681219900413WTTTTT@@Y2122221222221 1321212 1644211918 0 0 0 0 0 0 0 0 0 0 000 2 0 0 0 0 0 0 +T320191211111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 +T120191211111111694255 140356112 13322 03 0 0 0 394144 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 +T2201912111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111694120010527WTTTTTZYT212222122 63 51 0 0 +T120191211111111709255 140245112 13312 03 0 0 0 399 57 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 +T2201912111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111709120110101WTTTTTZ0W212222122 83981 0 0 +T120191211111111716255 140317112 23322 03 0 0 0 502 57 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 +T2201912111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111716120140401WTTTTTTBT212222222 63981 0 0 +T320191211111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 +T120191211111111742255 140245112 31312 03 0 0 01326 96 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 +T2201912111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 026 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 +T120191211111111794255 140245112 52312 03 0 0 0 811 18 0 0 0 0 0 0 0 0 0 0122222 0 0222 12 +T2201912111111117941219800125WTTTTTZB92122222222221 1121219 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111117941219760325WTTTTTZ#Y2222211222221 212 919 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111794120170527WTTTTT9##212222122 43981 0 0 +T320191211111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 +T120191211111111830255 140356112 31112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0212222 0 0222 12 +T2201912111111118301219790105WTTTTT9BW2122222222221 1321211 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 +T120191211111111850255 140356112 42112 03 0 0 0 850 38 0 0 0 0 6 0 1 0 18 0222222 0 0222 42 +T2201912111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 5 0 0 0 0 0 00015 250 0 0 0 0 600 +T2201912111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 020 0 0 0 0 0 0 5 000 3 0 0 0 0 0 0 +T320191211111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 +T120191211111111953255 140356112 21312 03 0 0 0 264105 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 +T2201912111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 +T2201912111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111111953120070102WTTTTTZZY212222122 43981 0 0 +T120191211111112010255 140356112 13322 03 0 0 0 399155 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 +T2201912111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112010120060102WTTTTT@T#212222222 63 11 0 0 +T120191211111112058255 140245112 13322 03 0 0 0 399 56 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 +T2201912111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112058120131114WTTTTT@TT212222122 83981 0 0 +T120191211111112111255 140356112 21312 03 0 0 0 502 22 0 0 0 0 0 0 0 56 9 0122222 0 0222 42 +T2201912111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112111120140102WTTTTT@@@212222222 43981 0 0 +T120191211111112120255 140245112 13322 03 0 0 0 399 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112120120090105WTTTTTTPP212222122 83 31 0 0 +T120191211111112181255 140356112 21312 03 0 0 01159 14 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 +T2201912111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 025 0 0 0 0 0 0 0 000 8 250 0 0 0 0 600 +T320191211111112181120180508WTTTTTTPZ212222222 43981 0 0 +T120191211111112235255 140245112 13322 03 0 0 0 399121 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 +T2201912111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112235120020122WTTTTTTB#212222222 83 51 0 0 +T120191211111112245255 140245112 51322 03 0 0 0 672 68 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 +T2201912111111122451219840313WTTTTTTB92122222222221 1211211 60 02219 0 0 0 0 0 5 0 0 0 0 0 00022 529 0 0 0 0 0 +T320191211111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 +T320191211111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 +T120191211111112338255 140356112 13112 03 0 0 0 399 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112338120080802WTTTTTZ0Z212222122 83 31 0 0 +T120191211111112413255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112413120150514WTTTTTZPP212222122 83981 0 0 +T120191211111112436255 140356112 13112 03 0 0 0 399 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201912111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112436120150314WTTTTTZP9212222222 63981 0 0 +T120191211111112461255 140245112 13322 03 0 0 0 399 32 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 +T2201912111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112461120171102WTTTTTZWT222221122 83981 0 0 +T120191211111112542255 140356112 13112 03 0 0 0 399 24 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2201912111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112542120030402WTTTTTTYP212222122 83 81 0 0 +T120191211111112583255 140245112 21312 03 0 0 0 502 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 +T2201912111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 4 00025 0 0 0 0 0 0 +T320191211111112583120180421WTTTTT9WW222221122 43981 0 0 +T120191211111112627255 140245112 33322 03 0 0 0 605 68 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 +T2201912111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112627120110113WTTTTTTWW222221222 83981 0 0 +T320191211111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 +T120191211111112658255 140245112 13322 03 0 0 0 399 35 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112658120140412WTTTTTT9#212222222 83981 0 0 +T120191211111112679255 140356112 42112 03 0 0 0 708 5 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111126791219790412WTTTTTZP@2122221222221 1321219 21392219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 +T2201912111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 +T320191211111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 +T120191211111112870255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2201912111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112870120130312WTTTTTTBY212222122 73981 0 0 +T120191211111112912255 140356112 33112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2201912111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112912120090501WTTTTT9TY222212222 63 51 0 0 +T320191211111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 +T120191211111112924255 140356112 13322 03 0 0 0 399128 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 +T2201912111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112924120080522WTTTTTZW@212222222 93981 0 0 +T120191211111112989255 140245112 13312 03 0 0 0 399 34 0 0 8 0 1 0 0 0 0 0222222 0 0222 12 +T2201912111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2201912111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320191211111112989120160802WTTTTTTZ#212222122 63981 0 0 +TRAILER0000471 diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 5a940a71b..3821fbda3 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -5,6 +5,7 @@ from .. import parse from ..models import ParserError, ParserErrorCategoryChoices, DataFileSummary from tdpservice.search_indexes.models.tanf import TANF_T1, TANF_T2, TANF_T3, TANF_T4, TANF_T5, TANF_T6, TANF_T7 +from tdpservice.search_indexes.models.tribal import Tribal_TANF_T1, Tribal_TANF_T2, Tribal_TANF_T3 from tdpservice.search_indexes.models.ssp import SSP_M1, SSP_M2, SSP_M3 from .factories import DataFileSummaryFactory from tdpservice.data_files.models import DataFile @@ -861,3 +862,29 @@ def test_parse_tanf_section4_file(tanf_section4_file): assert first.FAMILIES_MONTH == 274 assert sixth.FAMILIES_MONTH == 499 + +@pytest.fixture +def tribal_section_1_file(stt_user, stt): + """Fixture for ADS.E2J.FTP4.TS06.""" + return util.create_test_datafile('ADS.E2J.FTP1.TS142', stt_user, stt, "Tribal Active Case Data") + +@pytest.mark.django_db() +def test_parse_tribal_section_1_file(tribal_section_1_file): + """Test parsing Tribal TANF Section 1 submission.""" + parse.parse_datafile(tribal_section_1_file) + + assert Tribal_TANF_T1.objects.all().count() == 121 + assert Tribal_TANF_T2.objects.all().count() == 199 + assert Tribal_TANF_T3.objects.all().count() == 213 + + t_t1_objs = Tribal_TANF_T1.objects.all().order_by("CASH_AMOUNT") + t_t2_objs = Tribal_TANF_T2.objects.all().order_by("MONTHS_FED_TIME_LIMIT") + t_t3_objs = Tribal_TANF_T3.objects.all().order_by("EDUCATION_LEVEL") + + t_t1 = t_t1_objs.first() + t_t2 = t_t2_objs.last() + t_t3 = t_t3_objs.last() + + assert t_t1.CASH_AMOUNT == 26 + assert t_t2.MONTHS_FED_TIME_LIMIT == ' 8' + assert t_t3.EDUCATION_LEVEL == '98' diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 6ed48e44e..2017cc019 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -103,11 +103,12 @@ def update_encrypted_fields(self, is_encrypted): if type(field) == TransformField and "is_encrypted" in field.kwargs: field.kwargs['is_encrypted'] = is_encrypted -def contains_encrypted_indicator(line, encryption_field): - """Determine if line contains encryption indicator.""" - if encryption_field is not None: - return encryption_field.parse_value(line) == "E" - return False +def line_value_check(line, field, value, should_negate=False): + """Determine if the field in the line is or is not equal to an expected value.""" + if not should_negate: + return field.parse_value(line) == value + else: + return field.parse_value(line) != value def get_schema_options(program, section, query=None, model=None, model_name=None): """Centralized function to return the appropriate schema for a given program, section, and query. @@ -178,7 +179,16 @@ def get_schema_options(program, section, query=None, model=None, model_name=None } } }, - # TODO: tribal tanf + 'Tribal TAN': { + 'A': { + 'section': DataFile.Section.TRIBAL_ACTIVE_CASE_DATA, + 'models': { + 'T1': schema_defs.tribal_tanf.t_t1, + 'T2': schema_defs.tribal_tanf.t_t2, + 'T3': schema_defs.tribal_tanf.t_t3, + } + }, + }, } if query == "text": diff --git a/tdrs-backend/tdpservice/search_indexes/admin/__init__.py b/tdrs-backend/tdpservice/search_indexes/admin/__init__.py index 92131fd35..6cece82b3 100644 --- a/tdrs-backend/tdpservice/search_indexes/admin/__init__.py +++ b/tdrs-backend/tdpservice/search_indexes/admin/__init__.py @@ -1,6 +1,6 @@ from django.contrib import admin from .. import models -from . import tanf, ssp +from . import tanf, tribal, ssp admin.site.register(models.tanf.TANF_T1, tanf.TANF_T1Admin) admin.site.register(models.tanf.TANF_T2, tanf.TANF_T2Admin) @@ -10,6 +10,10 @@ admin.site.register(models.tanf.TANF_T6, tanf.TANF_T6Admin) admin.site.register(models.tanf.TANF_T7, tanf.TANF_T7Admin) +admin.site.register(models.tribal.Tribal_TANF_T1, tribal.Tribal_TANF_T1Admin) +admin.site.register(models.tribal.Tribal_TANF_T2, tribal.Tribal_TANF_T2Admin) +admin.site.register(models.tribal.Tribal_TANF_T3, tribal.Tribal_TANF_T3Admin) + admin.site.register(models.ssp.SSP_M1, ssp.SSP_M1Admin) admin.site.register(models.ssp.SSP_M2, ssp.SSP_M2Admin) admin.site.register(models.ssp.SSP_M3, ssp.SSP_M3Admin) diff --git a/tdrs-backend/tdpservice/search_indexes/admin/tribal.py b/tdrs-backend/tdpservice/search_indexes/admin/tribal.py index dde3f9c71..f3f1eb5f1 100644 --- a/tdrs-backend/tdpservice/search_indexes/admin/tribal.py +++ b/tdrs-backend/tdpservice/search_indexes/admin/tribal.py @@ -1 +1,58 @@ """ModelAdmin classes for parsed TRIBAL data files.""" +from django.contrib import admin +from .filter import CreationDateFilter + + +class Tribal_TANF_T1Admin(admin.ModelAdmin): + """ModelAdmin class for parsed Tribal_T1 data files.""" + + list_display = [ + 'RecordType', + 'RPT_MONTH_YEAR', + 'CASE_NUMBER', + 'COUNTY_FIPS_CODE', + 'ZIP_CODE', + 'STRATUM', + 'datafile', + ] + + list_filter = [ + CreationDateFilter, + 'RPT_MONTH_YEAR', + 'ZIP_CODE', + 'STRATUM', + ] + + +class Tribal_TANF_T2Admin(admin.ModelAdmin): + """ModelAdmin class for parsed Tribal_T2 data files.""" + + list_display = [ + 'RecordType', + 'RPT_MONTH_YEAR', + 'CASE_NUMBER', + 'datafile', + ] + + list_filter = [ + CreationDateFilter, + 'RPT_MONTH_YEAR', + ] + + +class Tribal_TANF_T3Admin(admin.ModelAdmin): + """ModelAdmin class for parsed Tribal_T3 data files.""" + + list_display = [ + 'RecordType', + 'RPT_MONTH_YEAR', + 'CASE_NUMBER', + 'datafile', + ] + + list_filter = [ + CreationDateFilter, + 'RPT_MONTH_YEAR', + ] + + diff --git a/tdrs-backend/tdpservice/search_indexes/documents/__init__.py b/tdrs-backend/tdpservice/search_indexes/documents/__init__.py index d430a04df..42b15a650 100644 --- a/tdrs-backend/tdpservice/search_indexes/documents/__init__.py +++ b/tdrs-backend/tdpservice/search_indexes/documents/__init__.py @@ -1,4 +1,5 @@ -from . import tanf, ssp +from . import tanf, tribal, ssp tanf = tanf +tribal = tribal ssp = ssp diff --git a/tdrs-backend/tdpservice/search_indexes/documents/tribal.py b/tdrs-backend/tdpservice/search_indexes/documents/tribal.py index 6190f9a63..c91c60023 100644 --- a/tdrs-backend/tdpservice/search_indexes/documents/tribal.py +++ b/tdrs-backend/tdpservice/search_indexes/documents/tribal.py @@ -1 +1,187 @@ """Elasticsearch document mappings for TRIBAL submission models.""" + +from django_elasticsearch_dsl import Document +from django_elasticsearch_dsl.registries import registry +from ..models.tribal import Tribal_TANF_T1, Tribal_TANF_T2, Tribal_TANF_T3 +from .document_base import DocumentBase + +@registry.register_document +class Tribal_TANF_T1DataSubmissionDocument(DocumentBase, Document): + """Elastic search model mapping for a parsed TANF T1 data file.""" + + class Index: + """ElasticSearch index generation settings.""" + + name = 'tribal_tanf_t1_submissions' + settings = { + 'number_of_shards': 1, + 'number_of_replicas': 0, + } + + class Django: + """Django model reference and field mapping.""" + + model = Tribal_TANF_T1 + fields = [ + 'RecordType', + 'RPT_MONTH_YEAR', + 'CASE_NUMBER', + 'COUNTY_FIPS_CODE', + 'STRATUM', + 'ZIP_CODE', + 'FUNDING_STREAM', + 'DISPOSITION', + 'NEW_APPLICANT', + 'NBR_FAMILY_MEMBERS', + 'FAMILY_TYPE', + 'RECEIVES_SUB_HOUSING', + 'RECEIVES_MED_ASSISTANCE', + 'RECEIVES_FOOD_STAMPS', + 'AMT_FOOD_STAMP_ASSISTANCE', + 'RECEIVES_SUB_CC', + 'AMT_SUB_CC', + 'CHILD_SUPPORT_AMT', + 'FAMILY_CASH_RESOURCES', + 'CASH_AMOUNT', + 'NBR_MONTHS', + 'CC_AMOUNT', + 'CHILDREN_COVERED', + 'CC_NBR_MONTHS', + 'TRANSP_AMOUNT', + 'TRANSP_NBR_MONTHS', + 'TRANSITION_SERVICES_AMOUNT', + 'TRANSITION_NBR_MONTHS', + 'OTHER_AMOUNT', + 'OTHER_NBR_MONTHS', + 'SANC_REDUCTION_AMT', + 'WORK_REQ_SANCTION', + 'FAMILY_SANC_ADULT', + 'SANC_TEEN_PARENT', + 'NON_COOPERATION_CSE', + 'FAILURE_TO_COMPLY', + 'OTHER_SANCTION', + 'RECOUPMENT_PRIOR_OVRPMT', + 'OTHER_TOTAL_REDUCTIONS', + 'FAMILY_CAP', + 'REDUCTIONS_ON_RECEIPTS', + 'OTHER_NON_SANCTION', + 'WAIVER_EVAL_CONTROL_GRPS', + 'FAMILY_EXEMPT_TIME_LIMITS', + 'FAMILY_NEW_CHILD' + ] + + +@registry.register_document +class Tribal_TANF_T2DataSubmissionDocument(DocumentBase, Document): + """Elastic search model mapping for a parsed TANF T2 data file.""" + + class Index: + """ElasticSearch index generation settings.""" + + name = 'tribal_tanf_t2_submissions' + settings = { + 'number_of_shards': 1, + 'number_of_replicas': 0, + } + + class Django: + """Django model reference and field mapping.""" + + model = Tribal_TANF_T2 + fields = [ + 'RecordType', + 'RPT_MONTH_YEAR', + 'CASE_NUMBER', + 'FAMILY_AFFILIATION', + 'NONCUSTODIAL_PARENT', + 'DATE_OF_BIRTH','SSN', + 'RACE_HISPANIC', + 'RACE_AMER_INDIAN', + 'RACE_ASIAN', + 'RACE_BLACK', + 'RACE_HAWAIIAN', + 'RACE_WHITE', + 'GENDER', + 'FED_OASDI_PROGRAM', + 'FED_DISABILITY_STATUS', + 'DISABLED_TITLE_XIVAPDT', + 'AID_AGED_BLIND', + 'RECEIVE_SSI', + 'MARITAL_STATUS', + 'RELATIONSHIP_HOH', + 'PARENT_MINOR_CHILD', + 'NEEDS_PREGNANT_WOMAN', + 'EDUCATION_LEVEL', + 'CITIZENSHIP_STATUS', + 'COOPERATION_CHILD_SUPPORT', + 'MONTHS_FED_TIME_LIMIT', + 'MONTHS_STATE_TIME_LIMIT', + 'CURRENT_MONTH_STATE_EXEMPT', + 'EMPLOYMENT_STATUS', + 'WORK_PART_STATUS', + 'UNSUB_EMPLOYMENT', + 'SUB_PRIVATE_EMPLOYMENT', + 'SUB_PUBLIC_EMPLOYMENT', + 'WORK_EXPERIENCE', + 'OJT', + 'JOB_SEARCH', + 'COMM_SERVICES', + 'VOCATIONAL_ED_TRAINING', + 'JOB_SKILLS_TRAINING', + 'ED_NO_HIGH_SCHOOL_DIPLOMA', + 'SCHOOL_ATTENDENCE', + 'PROVIDE_CC', + 'ADD_WORK_ACTIVITIES', + 'OTHER_WORK_ACTIVITIES', + 'REQ_HRS_WAIVER_DEMO', + 'EARNED_INCOME', + 'UNEARNED_INCOME_TAX_CREDIT', + 'UNEARNED_SOCIAL_SECURITY', + 'UNEARNED_SSI', + 'UNEARNED_WORKERS_COMP', + 'OTHER_UNEARNED_INCOME', + ] + + +@registry.register_document +class Tribal_TANF_T3DataSubmissionDocument(DocumentBase, Document): + """Elastic search model mapping for a parsed TANF T3 data file.""" + + class Index: + """ElasticSearch index generation settings.""" + + name = 'tribal_tanf_t3_submissions' + settings = { + 'number_of_shards': 1, + 'number_of_replicas': 0, + } + + class Django: + """Django model reference and field mapping.""" + + model = Tribal_TANF_T3 + fields = [ + 'RecordType', + 'RPT_MONTH_YEAR', + 'CASE_NUMBER', + 'FAMILY_AFFILIATION', + 'DATE_OF_BIRTH', + 'SSN', + 'RACE_HISPANIC', + 'RACE_AMER_INDIAN', + 'RACE_ASIAN', + 'RACE_BLACK', + 'RACE_HAWAIIAN', + 'RACE_WHITE', + 'GENDER', + 'RECEIVE_NONSSA_BENEFITS', + 'RECEIVE_SSI', + 'RELATIONSHIP_HOH', + 'PARENT_MINOR_CHILD', + 'EDUCATION_LEVEL', + 'CITIZENSHIP_STATUS', + 'UNEARNED_SSI', + 'OTHER_UNEARNED_INCOME', + ] + + diff --git a/tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py b/tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py new file mode 100644 index 000000000..9b1221b90 --- /dev/null +++ b/tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py @@ -0,0 +1,156 @@ +# Generated by Django 3.2.15 on 2023-10-31 16:36 + +from django.db import migrations, models +import django.db.models.deletion +import uuid + + +class Migration(migrations.Migration): + + dependencies = [ + ('data_files', '0012_datafile_s3_versioning_id'), + ('search_indexes', '0018_auto_20230920_1846'), + ] + + operations = [ + migrations.CreateModel( + name='Tribal_TANF_T3', + fields=[ + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('RecordType', models.CharField(max_length=156, null=True)), + ('RPT_MONTH_YEAR', models.IntegerField(null=True)), + ('CASE_NUMBER', models.CharField(max_length=11, null=True)), + ('FAMILY_AFFILIATION', models.IntegerField(null=True)), + ('DATE_OF_BIRTH', models.IntegerField(null=True)), + ('SSN', models.CharField(max_length=9, null=True)), + ('RACE_HISPANIC', models.IntegerField(null=True)), + ('RACE_AMER_INDIAN', models.IntegerField(null=True)), + ('RACE_ASIAN', models.IntegerField(null=True)), + ('RACE_BLACK', models.IntegerField(null=True)), + ('RACE_HAWAIIAN', models.IntegerField(null=True)), + ('RACE_WHITE', models.IntegerField(null=True)), + ('GENDER', models.IntegerField(null=True)), + ('RECEIVE_NONSSA_BENEFITS', models.IntegerField(null=True)), + ('RECEIVE_SSI', models.IntegerField(null=True)), + ('RELATIONSHIP_HOH', models.CharField(max_length=2, null=True)), + ('PARENT_MINOR_CHILD', models.IntegerField(null=True)), + ('EDUCATION_LEVEL', models.CharField(max_length=2, null=True)), + ('CITIZENSHIP_STATUS', models.IntegerField(null=True)), + ('UNEARNED_SSI', models.CharField(max_length=4, null=True)), + ('OTHER_UNEARNED_INCOME', models.CharField(max_length=4, null=True)), + ('datafile', models.ForeignKey(blank=True, help_text='The parent file from which this record was created.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tribal_t3_parent', to='data_files.datafile')), + ], + ), + migrations.CreateModel( + name='Tribal_TANF_T2', + fields=[ + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('RecordType', models.CharField(max_length=156, null=True)), + ('RPT_MONTH_YEAR', models.IntegerField(null=True)), + ('CASE_NUMBER', models.CharField(max_length=11, null=True)), + ('FAMILY_AFFILIATION', models.IntegerField(null=True)), + ('NONCUSTODIAL_PARENT', models.IntegerField(null=True)), + ('DATE_OF_BIRTH', models.IntegerField(null=True)), + ('SSN', models.CharField(max_length=9, null=True)), + ('RACE_HISPANIC', models.IntegerField(null=True)), + ('RACE_AMER_INDIAN', models.IntegerField(null=True)), + ('RACE_ASIAN', models.IntegerField(null=True)), + ('RACE_BLACK', models.IntegerField(null=True)), + ('RACE_HAWAIIAN', models.IntegerField(null=True)), + ('RACE_WHITE', models.IntegerField(null=True)), + ('GENDER', models.IntegerField(null=True)), + ('FED_OASDI_PROGRAM', models.IntegerField(null=True)), + ('FED_DISABILITY_STATUS', models.IntegerField(null=True)), + ('DISABLED_TITLE_XIVAPDT', models.IntegerField(null=True)), + ('AID_AGED_BLIND', models.IntegerField(null=True)), + ('RECEIVE_SSI', models.IntegerField(null=True)), + ('MARITAL_STATUS', models.IntegerField(null=True)), + ('RELATIONSHIP_HOH', models.CharField(max_length=2, null=True)), + ('PARENT_MINOR_CHILD', models.IntegerField(null=True)), + ('NEEDS_PREGNANT_WOMAN', models.IntegerField(null=True)), + ('EDUCATION_LEVEL', models.CharField(max_length=2, null=True)), + ('CITIZENSHIP_STATUS', models.IntegerField(null=True)), + ('COOPERATION_CHILD_SUPPORT', models.IntegerField(null=True)), + ('MONTHS_FED_TIME_LIMIT', models.CharField(max_length=3, null=True)), + ('MONTHS_STATE_TIME_LIMIT', models.CharField(max_length=2, null=True)), + ('CURRENT_MONTH_STATE_EXEMPT', models.IntegerField(null=True)), + ('EMPLOYMENT_STATUS', models.IntegerField(null=True)), + ('WORK_PART_STATUS', models.CharField(max_length=2, null=True)), + ('UNSUB_EMPLOYMENT', models.CharField(max_length=2, null=True)), + ('SUB_PRIVATE_EMPLOYMENT', models.CharField(max_length=2, null=True)), + ('SUB_PUBLIC_EMPLOYMENT', models.CharField(max_length=2, null=True)), + ('WORK_EXPERIENCE', models.CharField(max_length=2, null=True)), + ('OJT', models.CharField(max_length=2, null=True)), + ('JOB_SEARCH', models.CharField(max_length=2, null=True)), + ('COMM_SERVICES', models.CharField(max_length=2, null=True)), + ('VOCATIONAL_ED_TRAINING', models.CharField(max_length=2, null=True)), + ('JOB_SKILLS_TRAINING', models.CharField(max_length=2, null=True)), + ('ED_NO_HIGH_SCHOOL_DIPLOMA', models.CharField(max_length=2, null=True)), + ('SCHOOL_ATTENDENCE', models.CharField(max_length=2, null=True)), + ('PROVIDE_CC', models.CharField(max_length=2, null=True)), + ('ADD_WORK_ACTIVITIES', models.CharField(max_length=2, null=True)), + ('OTHER_WORK_ACTIVITIES', models.CharField(max_length=2, null=True)), + ('REQ_HRS_WAIVER_DEMO', models.CharField(max_length=2, null=True)), + ('EARNED_INCOME', models.CharField(max_length=4, null=True)), + ('UNEARNED_INCOME_TAX_CREDIT', models.CharField(max_length=4, null=True)), + ('UNEARNED_SOCIAL_SECURITY', models.CharField(max_length=4, null=True)), + ('UNEARNED_SSI', models.CharField(max_length=4, null=True)), + ('UNEARNED_WORKERS_COMP', models.CharField(max_length=4, null=True)), + ('OTHER_UNEARNED_INCOME', models.CharField(max_length=4, null=True)), + ('datafile', models.ForeignKey(blank=True, help_text='The parent file from which this record was created.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tribal_t2_parent', to='data_files.datafile')), + ], + ), + migrations.CreateModel( + name='Tribal_TANF_T1', + fields=[ + ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), + ('RecordType', models.CharField(max_length=156, null=True)), + ('RPT_MONTH_YEAR', models.IntegerField(null=True)), + ('CASE_NUMBER', models.CharField(max_length=11, null=True)), + ('FIPS_CODE', models.CharField(max_length=2, null=True)), + ('COUNTY_FIPS_CODE', models.CharField(max_length=3, null=True)), + ('STRATUM', models.CharField(max_length=2, null=True)), + ('ZIP_CODE', models.CharField(max_length=5, null=True)), + ('FUNDING_STREAM', models.IntegerField(null=True)), + ('DISPOSITION', models.IntegerField(null=True)), + ('NEW_APPLICANT', models.IntegerField(null=True)), + ('NBR_FAMILY_MEMBERS', models.IntegerField(null=True)), + ('FAMILY_TYPE', models.IntegerField(null=True)), + ('RECEIVES_SUB_HOUSING', models.IntegerField(null=True)), + ('RECEIVES_MED_ASSISTANCE', models.IntegerField(null=True)), + ('RECEIVES_FOOD_STAMPS', models.IntegerField(null=True)), + ('AMT_FOOD_STAMP_ASSISTANCE', models.IntegerField(null=True)), + ('RECEIVES_SUB_CC', models.IntegerField(null=True)), + ('AMT_SUB_CC', models.IntegerField(null=True)), + ('CHILD_SUPPORT_AMT', models.IntegerField(null=True)), + ('FAMILY_CASH_RESOURCES', models.IntegerField(null=True)), + ('CASH_AMOUNT', models.IntegerField(null=True)), + ('NBR_MONTHS', models.IntegerField(null=True)), + ('CC_AMOUNT', models.IntegerField(null=True)), + ('CHILDREN_COVERED', models.IntegerField(null=True)), + ('CC_NBR_MONTHS', models.IntegerField(null=True)), + ('TRANSP_AMOUNT', models.IntegerField(null=True)), + ('TRANSP_NBR_MONTHS', models.IntegerField(null=True)), + ('TRANSITION_SERVICES_AMOUNT', models.IntegerField(null=True)), + ('TRANSITION_NBR_MONTHS', models.IntegerField(null=True)), + ('OTHER_AMOUNT', models.IntegerField(null=True)), + ('OTHER_NBR_MONTHS', models.IntegerField(null=True)), + ('SANC_REDUCTION_AMT', models.IntegerField(null=True)), + ('WORK_REQ_SANCTION', models.IntegerField(null=True)), + ('FAMILY_SANC_ADULT', models.IntegerField(null=True)), + ('SANC_TEEN_PARENT', models.IntegerField(null=True)), + ('NON_COOPERATION_CSE', models.IntegerField(null=True)), + ('FAILURE_TO_COMPLY', models.IntegerField(null=True)), + ('OTHER_SANCTION', models.IntegerField(null=True)), + ('RECOUPMENT_PRIOR_OVRPMT', models.IntegerField(null=True)), + ('OTHER_TOTAL_REDUCTIONS', models.IntegerField(null=True)), + ('FAMILY_CAP', models.IntegerField(null=True)), + ('REDUCTIONS_ON_RECEIPTS', models.IntegerField(null=True)), + ('OTHER_NON_SANCTION', models.IntegerField(null=True)), + ('WAIVER_EVAL_CONTROL_GRPS', models.IntegerField(null=True)), + ('FAMILY_EXEMPT_TIME_LIMITS', models.IntegerField(null=True)), + ('FAMILY_NEW_CHILD', models.IntegerField(null=True)), + ('datafile', models.ForeignKey(blank=True, help_text='The parent file from which this record was created.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tribal_t1_parent', to='data_files.datafile')), + ], + ), + ] diff --git a/tdrs-backend/tdpservice/search_indexes/models/__init__.py b/tdrs-backend/tdpservice/search_indexes/models/__init__.py index d430a04df..42b15a650 100644 --- a/tdrs-backend/tdpservice/search_indexes/models/__init__.py +++ b/tdrs-backend/tdpservice/search_indexes/models/__init__.py @@ -1,4 +1,5 @@ -from . import tanf, ssp +from . import tanf, tribal, ssp tanf = tanf +tribal = tribal ssp = ssp diff --git a/tdrs-backend/tdpservice/search_indexes/models/tribal.py b/tdrs-backend/tdpservice/search_indexes/models/tribal.py index 3aa00df34..710a08458 100644 --- a/tdrs-backend/tdpservice/search_indexes/models/tribal.py +++ b/tdrs-backend/tdpservice/search_indexes/models/tribal.py @@ -1 +1,190 @@ """Models representing parsed TRIBAL data file records submitted to TDP.""" + +import uuid +from django.db import models +from django.contrib.contenttypes.fields import GenericRelation +from tdpservice.data_files.models import DataFile +from tdpservice.parsers.models import ParserError + + +class Tribal_TANF_T1(models.Model): + """ + Parsed record representing a T1 data submission. + + Mapped to an elastic search index. + """ + + id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) + datafile = models.ForeignKey( + DataFile, + blank=True, + help_text='The parent file from which this record was created.', + null=True, + on_delete=models.CASCADE, + related_name='tribal_t1_parent' + ) + + error = GenericRelation(ParserError) + RecordType = models.CharField(max_length=156, null=True, blank=False) + RPT_MONTH_YEAR = models.IntegerField(null=True, blank=False) + CASE_NUMBER = models.CharField(max_length=11, null=True, blank=False) + FIPS_CODE = models.CharField(max_length=2, null=True, blank=False) + COUNTY_FIPS_CODE = models.CharField( + max_length=3, + null=True, + blank=False + ) + STRATUM = models.CharField(max_length=2, null=True, blank=False) + ZIP_CODE = models.CharField(max_length=5, null=True, blank=False) + FUNDING_STREAM = models.IntegerField(null=True, blank=False) + DISPOSITION = models.IntegerField(null=True, blank=False) + NEW_APPLICANT = models.IntegerField(null=True, blank=False) + NBR_FAMILY_MEMBERS = models.IntegerField(null=True, blank=False) + FAMILY_TYPE = models.IntegerField(null=True, blank=False) + RECEIVES_SUB_HOUSING = models.IntegerField(null=True, blank=False) + RECEIVES_MED_ASSISTANCE = models.IntegerField(null=True, blank=False) + RECEIVES_FOOD_STAMPS = models.IntegerField(null=True, blank=False) + AMT_FOOD_STAMP_ASSISTANCE = models.IntegerField(null=True, blank=False) + RECEIVES_SUB_CC = models.IntegerField(null=True, blank=False) + AMT_SUB_CC = models.IntegerField(null=True, blank=False) + CHILD_SUPPORT_AMT = models.IntegerField(null=True, blank=False) + FAMILY_CASH_RESOURCES = models.IntegerField(null=True, blank=False) + CASH_AMOUNT = models.IntegerField(null=True, blank=False) + NBR_MONTHS = models.IntegerField(null=True, blank=False) + CC_AMOUNT = models.IntegerField(null=True, blank=False) + CHILDREN_COVERED = models.IntegerField(null=True, blank=False) + CC_NBR_MONTHS = models.IntegerField(null=True, blank=False) + TRANSP_AMOUNT = models.IntegerField(null=True, blank=False) + TRANSP_NBR_MONTHS = models.IntegerField(null=True, blank=False) + TRANSITION_SERVICES_AMOUNT = models.IntegerField(null=True, blank=False) + TRANSITION_NBR_MONTHS = models.IntegerField(null=True, blank=False) + OTHER_AMOUNT = models.IntegerField(null=True, blank=False) + OTHER_NBR_MONTHS = models.IntegerField(null=True, blank=False) + SANC_REDUCTION_AMT = models.IntegerField(null=True, blank=False) + WORK_REQ_SANCTION = models.IntegerField(null=True, blank=False) + FAMILY_SANC_ADULT = models.IntegerField(null=True, blank=False) + SANC_TEEN_PARENT = models.IntegerField(null=True, blank=False) + NON_COOPERATION_CSE = models.IntegerField(null=True, blank=False) + FAILURE_TO_COMPLY = models.IntegerField(null=True, blank=False) + OTHER_SANCTION = models.IntegerField(null=True, blank=False) + RECOUPMENT_PRIOR_OVRPMT = models.IntegerField(null=True, blank=False) + OTHER_TOTAL_REDUCTIONS = models.IntegerField(null=True, blank=False) + FAMILY_CAP = models.IntegerField(null=True, blank=False) + REDUCTIONS_ON_RECEIPTS = models.IntegerField(null=True, blank=False) + OTHER_NON_SANCTION = models.IntegerField(null=True, blank=False) + WAIVER_EVAL_CONTROL_GRPS = models.IntegerField(null=True, blank=False) + FAMILY_EXEMPT_TIME_LIMITS = models.IntegerField(null=True, blank=False) + FAMILY_NEW_CHILD = models.IntegerField(null=True, blank=False) + + +class Tribal_TANF_T2(models.Model): + """ + Parsed record representing a T2 data submission. + + Mapped to an elastic search index. + """ + + id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) + datafile = models.ForeignKey( + DataFile, + blank=True, + help_text='The parent file from which this record was created.', + null=True, + on_delete=models.CASCADE, + related_name='tribal_t2_parent' + ) + + RecordType = models.CharField(max_length=156, null=True, blank=False) + RPT_MONTH_YEAR = models.IntegerField(null=True, blank=False) + CASE_NUMBER = models.CharField(max_length=11, null=True, blank=False) + + FAMILY_AFFILIATION = models.IntegerField(null=True, blank=False) + NONCUSTODIAL_PARENT = models.IntegerField(null=True, blank=False) + DATE_OF_BIRTH = models.IntegerField(null=True, blank=False) + SSN = models.CharField(max_length=9, null=True, blank=False) + RACE_HISPANIC = models.IntegerField(null=True, blank=False) + RACE_AMER_INDIAN = models.IntegerField(null=True, blank=False) + RACE_ASIAN = models.IntegerField(null=True, blank=False) + RACE_BLACK = models.IntegerField(null=True, blank=False) + RACE_HAWAIIAN = models.IntegerField(null=True, blank=False) + RACE_WHITE = models.IntegerField(null=True, blank=False) + GENDER = models.IntegerField(null=True, blank=False) + FED_OASDI_PROGRAM = models.IntegerField(null=True, blank=False) + FED_DISABILITY_STATUS = models.IntegerField(null=True, blank=False) + DISABLED_TITLE_XIVAPDT = models.IntegerField(null=True, blank=False) + AID_AGED_BLIND = models.IntegerField(null=True, blank=False) + RECEIVE_SSI = models.IntegerField(null=True, blank=False) + MARITAL_STATUS = models.IntegerField(null=True, blank=False) + RELATIONSHIP_HOH = models.CharField(max_length=2, null=True, blank=False) + PARENT_MINOR_CHILD = models.IntegerField(null=True, blank=False) + NEEDS_PREGNANT_WOMAN = models.IntegerField(null=True, blank=False) + EDUCATION_LEVEL = models.CharField(max_length=2, null=True, blank=False) + CITIZENSHIP_STATUS = models.IntegerField(null=True, blank=False) + COOPERATION_CHILD_SUPPORT = models.IntegerField(null=True, blank=False) + MONTHS_FED_TIME_LIMIT = models.CharField(max_length=3, null=True, blank=False) + MONTHS_STATE_TIME_LIMIT = models.CharField(max_length=2, null=True, blank=False) + CURRENT_MONTH_STATE_EXEMPT = models.IntegerField(null=True, blank=False) + EMPLOYMENT_STATUS = models.IntegerField(null=True, blank=False) + WORK_PART_STATUS = models.CharField(max_length=2, null=True, blank=False) + UNSUB_EMPLOYMENT = models.CharField(max_length=2, null=True, blank=False) + SUB_PRIVATE_EMPLOYMENT = models.CharField(max_length=2, null=True, blank=False) + SUB_PUBLIC_EMPLOYMENT = models.CharField(max_length=2, null=True, blank=False) + WORK_EXPERIENCE = models.CharField(max_length=2, null=True, blank=False) + OJT = models.CharField(max_length=2, null=True, blank=False) + JOB_SEARCH = models.CharField(max_length=2, null=True, blank=False) + COMM_SERVICES = models.CharField(max_length=2, null=True, blank=False) + VOCATIONAL_ED_TRAINING = models.CharField(max_length=2, null=True, blank=False) + JOB_SKILLS_TRAINING = models.CharField(max_length=2, null=True, blank=False) + ED_NO_HIGH_SCHOOL_DIPLOMA = models.CharField(max_length=2, null=True, blank=False) + SCHOOL_ATTENDENCE = models.CharField(max_length=2, null=True, blank=False) + PROVIDE_CC = models.CharField(max_length=2, null=True, blank=False) + ADD_WORK_ACTIVITIES = models.CharField(max_length=2, null=True, blank=False) + OTHER_WORK_ACTIVITIES = models.CharField(max_length=2, null=True, blank=False) + REQ_HRS_WAIVER_DEMO = models.CharField(max_length=2, null=True, blank=False) + EARNED_INCOME = models.CharField(max_length=4, null=True, blank=False) + UNEARNED_INCOME_TAX_CREDIT = models.CharField(max_length=4, null=True, blank=False) + UNEARNED_SOCIAL_SECURITY = models.CharField(max_length=4, null=True, blank=False) + UNEARNED_SSI = models.CharField(max_length=4, null=True, blank=False) + UNEARNED_WORKERS_COMP = models.CharField(max_length=4, null=True, blank=False) + OTHER_UNEARNED_INCOME = models.CharField(max_length=4, null=True, blank=False) + + +class Tribal_TANF_T3(models.Model): + """ + Parsed record representing a T3 data submission. + + Mapped to an elastic search index. + """ + + id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) + datafile = models.ForeignKey( + DataFile, + blank=True, + help_text='The parent file from which this record was created.', + null=True, + on_delete=models.CASCADE, + related_name='tribal_t3_parent' + ) + + RecordType = models.CharField(max_length=156, null=True, blank=False) + RPT_MONTH_YEAR = models.IntegerField(null=True, blank=False) + CASE_NUMBER = models.CharField(max_length=11, null=True, blank=False) + FAMILY_AFFILIATION = models.IntegerField(null=True, blank=False) + + DATE_OF_BIRTH = models.IntegerField(null=True, blank=False) + SSN = models.CharField(max_length=9, null=True, blank=False) + RACE_HISPANIC = models.IntegerField(null=True, blank=False) + RACE_AMER_INDIAN = models.IntegerField(null=True, blank=False) + RACE_ASIAN = models.IntegerField(null=True, blank=False) + RACE_BLACK = models.IntegerField(null=True, blank=False) + RACE_HAWAIIAN = models.IntegerField(null=True, blank=False) + RACE_WHITE = models.IntegerField(null=True, blank=False) + GENDER = models.IntegerField(null=True, blank=False) + RECEIVE_NONSSA_BENEFITS = models.IntegerField(null=True, blank=False) + RECEIVE_SSI = models.IntegerField(null=True, blank=False) + RELATIONSHIP_HOH = models.CharField(max_length=2, null=True, blank=False) + PARENT_MINOR_CHILD = models.IntegerField(null=True, blank=False) + EDUCATION_LEVEL = models.CharField(max_length=2, null=True, blank=False) + CITIZENSHIP_STATUS = models.IntegerField(null=True, blank=False) + UNEARNED_SSI = models.CharField(max_length=4, null=True, blank=False) + OTHER_UNEARNED_INCOME = models.CharField(max_length=4, null=True, blank=False) From 0408123e2ca19371c1924713e3486adc0837fe5f Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 31 Oct 2023 13:28:17 -0600 Subject: [PATCH 23/88] - Update t1 field validators --- .../parsers/schema_defs/tribal_tanf/t_t1.py | 74 +++++++++---------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py index 6ed1e200e..15a9a5ea4 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py @@ -88,11 +88,11 @@ Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, required=True, validators=[validators.isAlphaNumeric()]), Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, - required=True, validators=[ + required=False, validators=[ validators.isNumber(), ]), Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, - required=True, validators=[ + required=False, validators=[ validators.isInStringRange(0, 99), ]), Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, @@ -101,11 +101,11 @@ ]), Field(item="8", name='FUNDING_STREAM', type='number', startIndex=29, endIndex=30, required=True, validators=[ - validators.isInLimits(1, 3), + validators.isInLimits(1, 2), ]), Field(item="9", name='DISPOSITION', type='number', startIndex=30, endIndex=31, required=True, validators=[ - validators.oneOf([1, 2]), + validators.oneOf([1]), ]), Field(item="10", name='NEW_APPLICANT', type='number', startIndex=31, endIndex=32, required=True, validators=[ @@ -113,7 +113,7 @@ ]), Field(item="11", name='NBR_FAMILY_MEMBERS', type='number', startIndex=32, endIndex=34, required=True, validators=[ - validators.isLargerThan(0), + validators.isInLimits(1, 99), ]), Field(item="12", name='FAMILY_TYPE', type='number', startIndex=34, endIndex=35, required=True, validators=[ @@ -128,83 +128,83 @@ validators.isInLimits(1, 2), ]), Field(item="15", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=37, endIndex=38, - required=True, validators=[ + required=False, validators=[ validators.isInLimits(0, 2), ]), Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=38, endIndex=42, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="17", name='RECEIVES_SUB_CC', type='number', startIndex=42, endIndex=43, - required=True, validators=[ + required=False, validators=[ validators.isInLimits(0, 3), ]), Field(item="18", name='AMT_SUB_CC', type='number', startIndex=43, endIndex=47, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="19", name='CHILD_SUPPORT_AMT', type='number', startIndex=47, endIndex=51, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="20", name='FAMILY_CASH_RESOURCES', type='number', startIndex=51, endIndex=55, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="21A", name='CASH_AMOUNT', type='number', startIndex=55, endIndex=59, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="21B", name='NBR_MONTHS', type='number', startIndex=59, endIndex=62, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 999), ]), Field(item="22A", name='CC_AMOUNT', type='number', startIndex=62, endIndex=66, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="22B", name='CHILDREN_COVERED', type='number', startIndex=66, endIndex=68, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 99), ]), Field(item="22C", name='CC_NBR_MONTHS', type='number', startIndex=68, endIndex=71, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 999), ]), Field(item="23A", name='TRANSP_AMOUNT', type='number', startIndex=71, endIndex=75, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="23B", name='TRANSP_NBR_MONTHS', type='number', startIndex=75, endIndex=78, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 999), ]), Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=78, endIndex=82, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + required=False, validators=[ + validators.isInLimits(0, 9999), ]), Field(item="24B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=82, endIndex=85, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + required=False, validators=[ + validators.isInLimits(0, 999), ]), Field(item="25A", name='OTHER_AMOUNT', type='number', startIndex=85, endIndex=89, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + required=False, validators=[ + validators.isInLimits(0, 9999), ]), Field(item="25B", name='OTHER_NBR_MONTHS', type='number', startIndex=89, endIndex=92, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + required=False, validators=[ + validators.isInLimits(0, 999), ]), Field(item="26AI", name='SANC_REDUCTION_AMT', type='number', startIndex=92, endIndex=96, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="26AII", name='WORK_REQ_SANCTION', type='number', startIndex=96, endIndex=97, required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="26AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=97, endIndex=98, - required=True, validators=[ + required=False, validators=[ validators.oneOf([0, 1, 2]), ]), Field(item="26AIV", name='SANC_TEEN_PARENT', type='number', startIndex=98, endIndex=99, @@ -225,11 +225,11 @@ ]), Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=102, endIndex=106, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=106, endIndex=110, required=True, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 9999), ]), Field(item="26CII", name='FAMILY_CAP', type='number', startIndex=110, endIndex=111, required=True, validators=[ @@ -244,18 +244,12 @@ validators.oneOf([1, 2]), ]), Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', type='string', startIndex=113, endIndex=114, - required=True, validators=[ - validators.or_validators(validators.matches('9'), validators.isEmpty()), - validators.isAlphaNumeric(), - ]), + required=False, validators=[validators.isInStringRange(0, 9)]), Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', type='number', startIndex=114, endIndex=116, - required=True, validators=[ - validators.oneOf([1, 2, 3, 4, - 6, 7, 8, 9]) - ]), + required=True, validators=[validators.isInLimits(0, 9)]), Field(item="29", name='FAMILY_NEW_CHILD', type='number', startIndex=116, endIndex=117, - required=True, validators=[ - validators.oneOf([1, 2]), + required=False, validators=[ + validators.oneOf([0, 1, 2]), ]), Field(item="-1", name='BLANK', type='string', startIndex=117, endIndex=123, required=False, validators=[]), From d1a94071ecd298e54de5a2a980be7dce7a12fa7d Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 31 Oct 2023 14:02:03 -0600 Subject: [PATCH 24/88] - t2/t3 field validators --- .../parsers/schema_defs/tribal_tanf/t_t2.py | 71 ++++++++++--------- .../parsers/schema_defs/tribal_tanf/t_t3.py | 44 ++++++------ 2 files changed, 59 insertions(+), 56 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py index fd6b51ddb..59af6ca03 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py @@ -35,70 +35,73 @@ TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, endIndex=38, required=True, validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=True, + Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=True, + Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=True, + Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=True, + Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=True, + Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=True, + Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, validators=[validators.isInLimits(0, 2)]), Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, - validators=[validators.isLargerThanOrEqualTo(0),]), + validators=[validators.isInLimits(0, 9)]), Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, validators=[validators.oneOf([1, 2])]), Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, validators=[validators.oneOf([1, 2])]), Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, - validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), - Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=True, - validators=[validators.isLargerThanOrEqualTo(0),]), + validators=[validators.oneOf(["1", "2"])]), + Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, + validators=[validators.isInLimits(0, 9)]), Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=True, + Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, validators=[validators.isInLimits(0, 5),]), Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=True, + Field(item="39", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=False, validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=True, + Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=False, validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=True, + Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, validators=[validators.or_validators(validators.isInStringRange(0, 16), validators.isInStringRange(98, 99) )]), - Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=True, + Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, required=True, - validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=True, + Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, + required=False, validators=[validators.oneOf([0, 1, 2, 9]),]), + Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=False, validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=True, + Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=False, validators=[validators.isInStringRange(0, 99),]), Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, - required=True, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=True, + required=False, validators=[validators.isInLimits(0, 9),]), + Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_PART_STATUS', type='string', startIndex=66, endIndex=68, required=True, - validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), - Field(item="49", name='UNSUB_EMPLOYMENT', type='string', startIndex=68, endIndex=70, required=True, + Field(item="48", name='WORK_PART_STATUS', type='string', startIndex=66, endIndex=68, required=False, + validators=[validators.or_validators(validators.isInStringRange(0, 3), + validators.isInStringRange(5, 9), + validators.isInStringRange(11, 19), + validators.matches('99'))]), + Field(item="49", name='UNSUB_EMPLOYMENT', type='string', startIndex=68, endIndex=70, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="50", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=True, + Field(item="50", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=True, + Field(item="51", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='WORK_EXPERIENCE', type='string', startIndex=74, endIndex=76, required=True, + Field(item="52", name='WORK_EXPERIENCE', type='string', startIndex=74, endIndex=76, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="53", name='OJT', type='string', startIndex=76, endIndex=78, required=True, validators=[ + Field(item="53", name='OJT', type='string', startIndex=76, endIndex=78, required=False, validators=[ validators.isInStringRange(0, 99), ]), - Field(item="54", name='JOB_SEARCH', type='string', startIndex=78, endIndex=80, required=True, + Field(item="54", name='JOB_SEARCH', type='string', startIndex=78, endIndex=80, required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="55", name='COMM_SERVICES', type='string', startIndex=80, endIndex=82, required=True, + Field(item="55", name='COMM_SERVICES', type='string', startIndex=80, endIndex=82, required=False, validators=[validators.isInStringRange(0, 99),]), Field(item="56", name='VOCATIONAL_ED_TRAINING', type='string', startIndex=82, endIndex=84, required=False, validators=[validators.isInStringRange(0, 99),]), @@ -121,12 +124,12 @@ Field(item="65A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=102, endIndex=106, required=False, validators=[validators.isInStringRange(0, 9999),]), Field(item="65B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=106, endIndex=110, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="65C", name='UNEARNED_SSI', type='string', startIndex=110, endIndex=114, required=False, + required=True, validators=[validators.isInStringRange(0, 9999),]), + Field(item="65C", name='UNEARNED_SSI', type='string', startIndex=110, endIndex=114, required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="65D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=114, endIndex=118, required=False, + Field(item="65D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=114, endIndex=118, required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="65E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=118, endIndex=122, required=False, + Field(item="65E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=118, endIndex=122, required=True, validators=[validators.isInStringRange(0, 9999),]), Field(item="-1", name='BLANK', type='string', startIndex=122, endIndex=123, required=False, validators=[]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py index b0b5cf7c5..9317add96 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py @@ -84,17 +84,17 @@ endIndex=37, required=True, validators=[validators.validateSSN()], is_encrypted=False), Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="71", name='GENDER', type='number', startIndex=43, endIndex=44, required=True, validators=[ validators.isInLimits(0, 9) @@ -108,11 +108,11 @@ validators.oneOf([1, 2]) ]), Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=46, endIndex=48, - required=True, validators=[ + required=False, validators=[ validators.isInStringRange(0, 10) ]), Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, - required=True, validators=[ + required=False, validators=[ validators.oneOf([0, 2, 3]) ]), Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=49, endIndex=51, @@ -123,15 +123,15 @@ ) ]), Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, - required=True, validators=[ + required=False, validators=[ validators.oneOf([0, 1, 2, 9]) ]), Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=52, endIndex=56, - required=False, validators=[ + required=True, validators=[ validators.isInStringRange(0, 9999) ]), Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=56, endIndex=60, - required=False, validators=[ + required=True, validators=[ validators.isInStringRange(0, 9999) ]), ], @@ -213,17 +213,17 @@ endIndex=78, required=True, validators=[validators.validateSSN()], is_encrypted=False), Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="70F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, - required=True, validators=[validators.validateRace()]), + required=False, validators=[validators.validateRace()]), Field(item="71", name='GENDER', type='number', startIndex=84, endIndex=85, required=True, validators=[ validators.isInLimits(0, 9) @@ -237,11 +237,11 @@ validators.oneOf([1, 2]) ]), Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=87, endIndex=89, - required=True, validators=[ + required=False, validators=[ validators.isInStringRange(0, 10) ]), Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, - required=True, validators=[ + required=False, validators=[ validators.oneOf([0, 2, 3]) ]), Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=90, endIndex=92, @@ -252,15 +252,15 @@ ) ]), Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, - required=True, validators=[ + required=False, validators=[ validators.oneOf([0, 1, 2, 9]) ]), Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=93, endIndex=97, - required=False, validators=[ + required=True, validators=[ validators.isInStringRange(0, 9999) ]), Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=97, endIndex=101, - required=False, validators=[ + required=True, validators=[ validators.isInStringRange(0, 9999) ]), ], From c75bb7e68479f3d3af89a156cbcb251fefd6b8ad Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 1 Nov 2023 09:44:27 -0400 Subject: [PATCH 25/88] 2599-added friendly name to postparsing validators --- tdrs-backend/tdpservice/parsers/row_schema.py | 4 ++- tdrs-backend/tdpservice/parsers/validators.py | 32 ++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/row_schema.py b/tdrs-backend/tdpservice/parsers/row_schema.py index d19f9f5f1..5929bc743 100644 --- a/tdrs-backend/tdpservice/parsers/row_schema.py +++ b/tdrs-backend/tdpservice/parsers/row_schema.py @@ -148,7 +148,9 @@ def run_postparsing_validators(self, instance, generate_error): errors = [] for validator in self.postparsing_validators: - validator_is_valid, validator_error = validator(instance) + validator_is_valid, validator_error, fields = validator(instance) + friendly_field_names = [field.friendly_name for field in self.fields if field.name in fields] + print('+++++++++++++++++++: ', friendly_field_names) is_valid = False if not validator_is_valid else is_valid if validator_error: errors.append( diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index a8722794d..f31a49f65 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -43,13 +43,13 @@ def if_then_validator_func(value): validator1_result = condition_function(value1) validator2_result = result_function(value2) - return (True, None) if not validator1_result[0] else ( + return (True, None, [condition_field, result_field]) if not validator1_result[0] else ( validator2_result[0], (f'if {condition_field} ' + (validator1_result[1] if validator1_result[1] is not None else f":{value1} validator1 passed") + f' then {result_field} ' + (validator2_result[1] if validator2_result[1] is not None - else "validator2 passed")) if not validator2_result[0] else None) + else "validator2 passed")) if not validator2_result[0] else None, [condition_field, result_field]) return lambda value: if_then_validator_func(value) @@ -61,8 +61,8 @@ def sumIsEqualFunc(value): sum += value[field] if type(value) is dict else getattr(value, field) condition_val = value[condition_field] if type(value) is dict else getattr(value, condition_field) - return (True, None) if sum == condition_val else (False, - f"The sum of {sum_fields} does not equal {condition_field}.") + return (True, None, [condition_field, sum_fields]) if sum == condition_val else (False, + f"The sum of {sum_fields} does not equal {condition_field}.", [condition_field, sum_fields]) return lambda value: sumIsEqualFunc(value) @@ -73,7 +73,7 @@ def sumIsLargerFunc(value): for field in fields: sum += value[field] if type(value) is dict else getattr(value, field) - return (True, None) if sum > val else (False, f"The sum of {fields} is not larger than {val}.") + return (True, None, fields) if sum > val else (False, f"The sum of {fields} is not larger than {val}.", fields) return lambda value: sumIsLargerFunc(value) @@ -296,11 +296,12 @@ def validate(instance): if FAMILY_AFFILIATION == 2 and (CITIZENSHIP_STATUS == 1 or CITIZENSHIP_STATUS == 2): if SSN in [str(i) * 9 for i in range(10)]: return (False, - 'If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN != 000000000 -- 999999999.') + 'If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN != 000000000 -- 999999999.', + ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) else: - return (True, None) + return (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) else: - return (True, None) + return (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) return lambda instance: validate(instance) def validate__FAM_AFF__HOH__Fed_Time(): @@ -317,12 +318,12 @@ def validate(instance): if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if int(MONTHS_FED_TIME_LIMIT) < 1: return (False, - 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, then MONTHS_FED_TIME_LIMIT > 1.' - ) + 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, then MONTHS_FED_TIME_LIMIT > 1.', + ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) else: - return (True, None) + return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) else: - return (True, None) + return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) return lambda instance: validate(instance) def validate__FAM_AFF__HOH__Count_Fed_Time(): @@ -339,11 +340,12 @@ def validate(instance): if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if int(COUNTABLE_MONTH_FED_TIME) < 1: return (False, 'If FAMILY_AFFILIATION == 2 and COUNTABLE_MONTH_FED_TIME== 1 or 2, then ' + - 'COUNTABLE_MONTH_FED_TIME > 1.') + 'COUNTABLE_MONTH_FED_TIME > 1.', + ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) else: - return (True, None) + return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) else: - return (True, None) + return (True, None , ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) return lambda instance: validate(instance) From 179a81cc65ebc45fb29b902123c0ba73ebf253a7 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 1 Nov 2023 10:15:06 -0600 Subject: [PATCH 26/88] - Updated cat3 validators --- .../parsers/schema_defs/tribal_tanf/t_t2.py | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py index 59af6ca03..3ac89d9b5 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py @@ -16,6 +16,71 @@ validators.hasLength(123), ], postparsing_validators=[ + validators.validate__FAM_AFF__SSN(), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='SSN', result_function=validators.validateSSN(), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), + result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='EDUCATION_LEVEL', result_function=validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + ), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', result_function=validators.matches(1), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='COOPERATION_CHILD_SUPPORT', result_function=validators.oneOf((1, 2, 9)), + ), + validators.validate__FAM_AFF__HOH__Fed_Time(), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='EMPLOYMENT_STATUS', result_function=validators.isInLimits(1, 3), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='WORK_PART_STATUS', result_function=validators.or_validators( + validators.isInStringRange(1, 3), + validators.isInStringRange(5, 9), + validators.isInStringRange(11, 19), + validators.matches('99')), + ), ], fields=[ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, From 77acd5a50444fcc3639c77b4f9974dd132f31e46 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 1 Nov 2023 11:09:48 -0600 Subject: [PATCH 27/88] - Updated how we detect tribe code --- tdrs-backend/tdpservice/parsers/parse.py | 4 ++-- tdrs-backend/tdpservice/parsers/util.py | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index b80d24ea0..924986cad 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -29,8 +29,8 @@ def parse_datafile(datafile): return errors fields = schema_defs.header.get_fields_by_names({"encryption", "tribe_code"}) - is_encrypted = util.line_value_check(header_line, fields["encryption"], "E") - is_tribal = util.line_value_check(header_line, fields["tribe_code"], " ", True) + is_encrypted = util.contains_encrypted_indicator(header_line, fields["encryption"]) + is_tribal = util.contains_tribe_code(header_line, fields["tribe_code"]) logger.debug(f"Datafile has encrypted fields: {is_encrypted}.") logger.debug(f"Datafile is Tribal: {is_tribal}.") diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 2017cc019..ef51207e7 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -105,10 +105,24 @@ def update_encrypted_fields(self, is_encrypted): def line_value_check(line, field, value, should_negate=False): """Determine if the field in the line is or is not equal to an expected value.""" + parsed_val = field.parse_value(line) if not should_negate: - return field.parse_value(line) == value + return parsed_val == value else: - return field.parse_value(line) != value + return parsed_val != value and parsed_val != None + +def contains_encrypted_indicator(line, encryption_field): + """Determine if line contains encryption indicator.""" + if encryption_field is not None: + return encryption_field.parse_value(line) == "E" + return False + +def contains_tribe_code(line, tribe_code_field): + """Determine if the line has a valid tribal code.""" + options = {" ", None, "000"} + if tribe_code_field is not None: + return tribe_code_field.parse_value(line) not in options + return False def get_schema_options(program, section, query=None, model=None, model_name=None): """Centralized function to return the appropriate schema for a given program, section, and query. From 2eb688f29a87416abcf5f12876c1b72ec3dbea3e Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 1 Nov 2023 12:56:40 -0600 Subject: [PATCH 28/88] - Added error handling for inconsistent header info wrt tribe code - Added new test --- tdrs-backend/tdpservice/parsers/parse.py | 21 +++++++++++++++--- tdrs-backend/tdpservice/parsers/row_schema.py | 10 ++++----- .../parsers/schema_defs/tribal_tanf/t_t2.py | 2 +- .../data/tribal_section_1_inconsistency.txt | 3 +++ .../tdpservice/parsers/test/test_parse.py | 18 +++++++++++++++ tdrs-backend/tdpservice/parsers/util.py | 14 ++++++------ tdrs-backend/tdpservice/parsers/validators.py | 22 +++++++++++++++++++ .../tdpservice/search_indexes/admin/tribal.py | 2 -- .../search_indexes/documents/tribal.py | 5 ++--- 9 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 tdrs-backend/tdpservice/parsers/test/data/tribal_section_1_inconsistency.txt diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index 924986cad..8b9d81f8c 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -28,9 +28,24 @@ def parse_datafile(datafile): bulk_create_errors({1: header_errors}, 1, flush=True) return errors - fields = schema_defs.header.get_fields_by_names({"encryption", "tribe_code"}) - is_encrypted = util.contains_encrypted_indicator(header_line, fields["encryption"]) - is_tribal = util.contains_tribe_code(header_line, fields["tribe_code"]) + field_values = schema_defs.header.get_field_values_by_names(header_line, + {"encryption", "tribe_code", "state_fips"}) + + # Validate submission tribe code in submission accross program type and fips code + tribe_is_valid, tribe_error = validators.validate_header_tribe_code(header['program_type'], + field_values["tribe_code"], + field_values["state_fips"], + util.make_generate_parser_error(datafile, 1)) + + if not tribe_is_valid: + logger.info("Tribe Code binconsistency with Program Type and FIPS Code.") + errors['header'] = [tribe_error] + bulk_create_errors({1: [tribe_error]}, 1, flush=True) + return errors + + is_encrypted = util.contains_encrypted_indicator(header_line, field_values["encryption"]) + is_tribal = util.contains_tribe_code(header_line, field_values["tribe_code"]) + logger.debug(f"Datafile has encrypted fields: {is_encrypted}.") logger.debug(f"Datafile is Tribal: {is_tribal}.") diff --git a/tdrs-backend/tdpservice/parsers/row_schema.py b/tdrs-backend/tdpservice/parsers/row_schema.py index 67c63c397..fd0209a50 100644 --- a/tdrs-backend/tdpservice/parsers/row_schema.py +++ b/tdrs-backend/tdpservice/parsers/row_schema.py @@ -163,10 +163,10 @@ def run_postparsing_validators(self, instance, generate_error): return is_valid, errors - def get_fields_by_names(self, names={}): - """Return dictionary of fields keyed on their name.""" - fields = {} + def get_field_values_by_names(self, line, names={}): + """Return dictionary of field values keyed on their name.""" + field_values = {} for field in self.fields: if field.name in names: - fields[field.name] = field - return fields + field_values[field.name] = field.parse_value(line) + return field_values diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py index 3ac89d9b5..3eede769c 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py @@ -197,7 +197,7 @@ Field(item="65E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=118, endIndex=122, required=True, validators=[validators.isInStringRange(0, 9999),]), Field(item="-1", name='BLANK', type='string', startIndex=122, endIndex=123, required=False, - validators=[]), + validators=[]), ], )] ) 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 new file mode 100644 index 000000000..c50875aa1 --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/test/data/tribal_section_1_inconsistency.txt @@ -0,0 +1,3 @@ +HEADER20194A01142TAN1EU +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/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 3821fbda3..0a9b53ea4 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -888,3 +888,21 @@ def test_parse_tribal_section_1_file(tribal_section_1_file): assert t_t1.CASH_AMOUNT == 26 assert t_t2.MONTHS_FED_TIME_LIMIT == ' 8' assert t_t3.EDUCATION_LEVEL == '98' + +@pytest.fixture +def tribal_section_1_inconsistency_file(stt_user, stt): + """Fixture for ADS.E2J.FTP4.TS06.""" + return util.create_test_datafile('tribal_section_1_inconsistency.txt', stt_user, stt, "Tribal Active Case Data") + +@pytest.mark.django_db() +def test_parse_tribal_section_1_inconsistency_file(tribal_section_1_inconsistency_file): + """Test parsing inconsistent Tribal TANF Section 1 submission.""" + parse.parse_datafile(tribal_section_1_inconsistency_file) + + assert Tribal_TANF_T1.objects.all().count() == 0 + + parser_errors = ParserError.objects.filter(file=tribal_section_1_inconsistency_file) + assert parser_errors.count() == 1 + + assert parser_errors.first().error_message == "Tribe Code (142) inconsistency with Program Type (TAN) " + \ + "and FIPS Code (01)." diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index ef51207e7..e56a6382c 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -109,19 +109,19 @@ def line_value_check(line, field, value, should_negate=False): if not should_negate: return parsed_val == value else: - return parsed_val != value and parsed_val != None + return parsed_val != value and parsed_val is not None -def contains_encrypted_indicator(line, encryption_field): +def contains_encrypted_indicator(line, encryption_val): """Determine if line contains encryption indicator.""" - if encryption_field is not None: - return encryption_field.parse_value(line) == "E" + if encryption_val is not None: + return encryption_val == "E" return False -def contains_tribe_code(line, tribe_code_field): +def contains_tribe_code(line, tribe_code_val): """Determine if the line has a valid tribal code.""" options = {" ", None, "000"} - if tribe_code_field is not None: - return tribe_code_field.parse_value(line) not in options + if tribe_code_val is not None: + return tribe_code_val not in options return False def get_schema_options(program, section, query=None, model=None, model_name=None): diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index a8722794d..d60731ab5 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -362,3 +362,25 @@ def validate_header_section_matches_submission(datafile, section, generate_error ) return is_valid, error + +def validate_header_tribe_code(program_type, tribe_code, state_fips_code, generate_error): + """Validate header tribe code, fips code, and program type all agree with eachother.""" + is_valid = False + + if program_type == 'TAN' and (state_fips_code == '00' or state_fips_code is None or state_fips_code.isspace()): + is_valid = tribe_code is not None and not tribe_code.isspace() and tribe_code != '000' + else: + is_valid = tribe_code is None or tribe_code.isspace() or tribe_code == '000' + + error = None + if not is_valid: + error = generate_error( + schema=None, + error_category=ParserErrorCategoryChoices.PRE_CHECK, + error_message=f"Tribe Code ({tribe_code}) inconsistency with Program Type ({program_type}) and " + + f"FIPS Code ({state_fips_code}).", + record=None, + field=None + ) + + return is_valid, error diff --git a/tdrs-backend/tdpservice/search_indexes/admin/tribal.py b/tdrs-backend/tdpservice/search_indexes/admin/tribal.py index f3f1eb5f1..71fce22b9 100644 --- a/tdrs-backend/tdpservice/search_indexes/admin/tribal.py +++ b/tdrs-backend/tdpservice/search_indexes/admin/tribal.py @@ -54,5 +54,3 @@ class Tribal_TANF_T3Admin(admin.ModelAdmin): CreationDateFilter, 'RPT_MONTH_YEAR', ] - - diff --git a/tdrs-backend/tdpservice/search_indexes/documents/tribal.py b/tdrs-backend/tdpservice/search_indexes/documents/tribal.py index c91c60023..e9fd193e9 100644 --- a/tdrs-backend/tdpservice/search_indexes/documents/tribal.py +++ b/tdrs-backend/tdpservice/search_indexes/documents/tribal.py @@ -94,7 +94,8 @@ class Django: 'CASE_NUMBER', 'FAMILY_AFFILIATION', 'NONCUSTODIAL_PARENT', - 'DATE_OF_BIRTH','SSN', + 'DATE_OF_BIRTH', + 'SSN', 'RACE_HISPANIC', 'RACE_AMER_INDIAN', 'RACE_ASIAN', @@ -183,5 +184,3 @@ class Django: 'UNEARNED_SSI', 'OTHER_UNEARNED_INCOME', ] - - From df77436ee073deaf381bed8edd4d603a26472f03 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 1 Nov 2023 15:43:07 -0600 Subject: [PATCH 29/88] - Updated test --- tdrs-backend/tdpservice/users/test/test_permissions.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tdrs-backend/tdpservice/users/test/test_permissions.py b/tdrs-backend/tdpservice/users/test/test_permissions.py index 2f25347aa..34236d913 100644 --- a/tdrs-backend/tdpservice/users/test/test_permissions.py +++ b/tdrs-backend/tdpservice/users/test/test_permissions.py @@ -123,6 +123,15 @@ def test_ofa_system_admin_permissions(ofa_system_admin): 'search_indexes.add_ssp_m3', 'search_indexes.view_ssp_m3', 'search_indexes.change_ssp_m3', + 'search_indexes.add_tribal_tanf_t1', + 'search_indexes.view_tribal_tanf_t1', + 'search_indexes.change_tribal_tanf_t1', + 'search_indexes.add_tribal_tanf_t2', + 'search_indexes.view_tribal_tanf_t2', + 'search_indexes.change_tribal_tanf_t2', + 'search_indexes.add_tribal_tanf_t3', + 'search_indexes.view_tribal_tanf_t3', + 'search_indexes.change_tribal_tanf_t3', } group_permissions = ofa_system_admin.get_group_permissions() assert group_permissions == expected_permissions From 8da540e7ecdcb6388aeecd80beec1e3b6a17e941 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 1 Nov 2023 16:02:12 -0600 Subject: [PATCH 30/88] - Grammar fix - Removed unused function --- tdrs-backend/tdpservice/parsers/parse.py | 2 +- tdrs-backend/tdpservice/parsers/util.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index 8b9d81f8c..8a55da6d2 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -31,7 +31,7 @@ def parse_datafile(datafile): field_values = schema_defs.header.get_field_values_by_names(header_line, {"encryption", "tribe_code", "state_fips"}) - # Validate submission tribe code in submission accross program type and fips code + # Validate tribe code in submission across program type and fips code tribe_is_valid, tribe_error = validators.validate_header_tribe_code(header['program_type'], field_values["tribe_code"], field_values["state_fips"], diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index e56a6382c..a3e40e0ad 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -103,14 +103,6 @@ def update_encrypted_fields(self, is_encrypted): if type(field) == TransformField and "is_encrypted" in field.kwargs: field.kwargs['is_encrypted'] = is_encrypted -def line_value_check(line, field, value, should_negate=False): - """Determine if the field in the line is or is not equal to an expected value.""" - parsed_val = field.parse_value(line) - if not should_negate: - return parsed_val == value - else: - return parsed_val != value and parsed_val is not None - def contains_encrypted_indicator(line, encryption_val): """Determine if line contains encryption indicator.""" if encryption_val is not None: From 0ec8f1620cd34006dd6c0d894ab2e6d22ce459ff Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 7 Nov 2023 09:50:03 -0500 Subject: [PATCH 31/88] refining the validator tests --- .../parsers/test/test_validators.py | 61 ++++++++++--------- tdrs-backend/tdpservice/parsers/validators.py | 6 +- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index ecca06561..5403bb696 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -38,14 +38,14 @@ def test_if_validators(): condition_field="Field1", condition_function=validators.matches('1'), result_field="Field2", result_function=validators.matches('2'), ) - assert validator(value) == (True, None) + assert validator(value) == (True, None, ['Field1', 'Field2']) validator = validator = validators.if_then_validator( condition_field="Field1", condition_function=validators.matches('1'), result_field="Field2", result_function=validators.matches('1'), ) result = validator(value) - assert result == (False, 'if Field1 :1 validator1 passed then Field2 2 does not match 1.') + assert result == (False, 'if Field1 :1 validator1 passed then Field2 2 does not match 1.', ['Field1', 'Field2']) def test_and_validators(): @@ -64,10 +64,11 @@ def test_validate__FAM_AFF__SSN(): } result = validators.validate__FAM_AFF__SSN()(instance) assert result == (False, - 'If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN != 000000000 -- 999999999.') + 'If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN != 000000000 -- 999999999.', + ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) instance['SSN'] = '1'*8 + '0' result = validators.validate__FAM_AFF__SSN()(instance) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) def test_dateYearIsLargerThan(): """Test `dateYearIsLargerThan` gives a valid result.""" @@ -324,12 +325,12 @@ def test_validate_food_stamps(self, record): record.RECEIVES_FOOD_STAMPS = 1 record.AMT_FOOD_STAMP_ASSISTANCE = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['RECEIVES_FOOD_STAMPS', 'AMT_FOOD_STAMP_ASSISTANCE']) record.AMT_FOOD_STAMP_ASSISTANCE = 0 result = val(record) assert result == (False, 'if RECEIVES_FOOD_STAMPS :1 validator1 passed then ' - + 'AMT_FOOD_STAMP_ASSISTANCE 0 is not larger than 0.') + + 'AMT_FOOD_STAMP_ASSISTANCE 0 is not larger than 0.', ['RECEIVES_FOOD_STAMPS', 'AMT_FOOD_STAMP_ASSISTANCE']) def test_validate_subsidized_child_care(self, record): """Test cat3 validator for subsidized child care.""" @@ -340,12 +341,12 @@ def test_validate_subsidized_child_care(self, record): record.RECEIVES_SUB_CC = 4 record.AMT_SUB_CC = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['RECEIVES_SUB_CC', 'AMT_SUB_CC']) record.RECEIVES_SUB_CC = 4 record.AMT_SUB_CC = 0 result = val(record) - assert result == (False, 'if RECEIVES_SUB_CC :4 validator1 passed then AMT_SUB_CC 0 is not larger than 0.') + assert result == (False, 'if RECEIVES_SUB_CC :4 validator1 passed then AMT_SUB_CC 0 is not larger than 0.', ['RECEIVES_SUB_CC', 'AMT_SUB_CC']) def test_validate_cash_amount_and_nbr_months(self, record): """Test cat3 validator for cash amount and number of months.""" @@ -502,7 +503,7 @@ def test_validate_race_ethnicity(self, record): result_field=race, result_function=validators.isInLimits(1, 2), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) record.FAMILY_AFFILIATION = 0 for race in races: @@ -511,7 +512,7 @@ def test_validate_race_ethnicity(self, record): result_field=race, result_function=validators.isInLimits(1, 2) ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) def test_validate_marital_status(self, record): """Test cat3 validator for marital status.""" @@ -521,13 +522,13 @@ def test_validate_marital_status(self, record): ) record.FAMILY_AFFILIATION = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'MARITAL_STATUS']) record.FAMILY_AFFILIATION = 3 record.MARITAL_STATUS = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :3 validator1 passed then MARITAL_STATUS 0 is not larger or ' + - 'equal to 1 and smaller or equal to 5.') + 'equal to 1 and smaller or equal to 5.', ['FAMILY_AFFILIATION', 'MARITAL_STATUS']) def test_validate_parent_with_minor(self, record): """Test cat3 validator for parent with a minor child.""" @@ -655,13 +656,13 @@ def test_validate_work_participation(self, record): ) record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'WORK_PART_STATUS']) record.FAMILY_AFFILIATION = 2 record.WORK_PART_STATUS = "04" result = val(record) assert result == (False, "if FAMILY_AFFILIATION :2 validator1 passed then WORK_PART_STATUS 04 is not " + - "in ['01', '02', '05', '07', '09', '15', '17', '18', '19', '99'].") + "in ['01', '02', '05', '07', '09', '15', '17', '18', '19', '99'].", ['FAMILY_AFFILIATION', 'WORK_PART_STATUS']) val = validators.if_then_validator( condition_field='WORK_ELIGIBLE_INDICATOR', condition_function=validators.isInStringRange(1, 5), @@ -671,7 +672,7 @@ def test_validate_work_participation(self, record): record.WORK_ELIGIBLE_INDICATOR = "01" result = val(record) assert result == (False, 'if WORK_ELIGIBLE_INDICATOR :01 validator1 passed then ' - + 'WORK_PART_STATUS 99 matches 99.') + + 'WORK_PART_STATUS 99 matches 99.', ['FAMILY_AFFILIATION', 'WORK_PART_STATUS']) class TestT3Cat3Validators(TestCat3ValidatorsBase): @@ -709,7 +710,7 @@ def test_validate_t3_race_ethnicity(self, record): result_field=race, result_function=validators.oneOf((1, 2)), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_AMER_INDIAN']) record.FAMILY_AFFILIATION = 0 for race in races: @@ -718,7 +719,7 @@ def test_validate_t3_race_ethnicity(self, record): result_field=race, result_function=validators.oneOf((1, 2)), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) def test_validate_relationship_hoh(self, record): """Test cat3 validator for relationship to head of household.""" @@ -729,13 +730,13 @@ def test_validate_relationship_hoh(self, record): record.FAMILY_AFFILIATION = 0 record.RELATIONSHIP_HOH = "04" result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH']) record.FAMILY_AFFILIATION = 1 record.RELATIONSHIP_HOH = "01" result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then RELATIONSHIP_HOH 01 is ' + - 'not in range [4, 9].') + 'not in range [4, 9].', ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH']) def test_validate_t3_education_level(self, record): """Test cat3 validator for education level.""" @@ -745,12 +746,12 @@ def test_validate_t3_education_level(self, record): ) record.FAMILY_AFFILIATION = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) record.FAMILY_AFFILIATION = 1 record.EDUCATION_LEVEL = "99" result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then EDUCATION_LEVEL 99 matches 99.') + assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then EDUCATION_LEVEL 99 matches 99.', ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) def test_validate_t3_citizenship(self, record): """Test cat3 validator for citizenship.""" @@ -760,13 +761,13 @@ def test_validate_t3_citizenship(self, record): ) record.FAMILY_AFFILIATION = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) record.FAMILY_AFFILIATION = 1 record.CITIZENSHIP_STATUS = 3 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then CITIZENSHIP_STATUS 3 ' + - 'is not in (1, 2).') + 'is not in (1, 2).', ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) val = validators.if_then_validator( condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), @@ -776,7 +777,7 @@ def test_validate_t3_citizenship(self, record): record.CITIZENSHIP_STATUS = 3 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then CITIZENSHIP_STATUS 3 ' + - 'is not in (1, 2, 9).') + 'is not in (1, 2, 9).', ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) class TestT5Cat3Validators(TestCat3ValidatorsBase): @@ -795,27 +796,27 @@ def test_validate_ssn(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'SSN']) record.SSN = "abc" record.FAMILY_AFFILIATION = 2 result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then SSN abc is not a number.') + assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then SSN abc is not a number.',['FAMILY_AFFILIATION', 'SSN']) def test_validate_ssn_citizenship(self, record): """Test cat3 validator for SSN/citizenship.""" val = validators.validate__FAM_AFF__SSN() result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'SSN']) record.FAMILY_AFFILIATION = 2 record.SSN = "000000000" result = val(record) assert result == (False, "If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN " + - "!= 000000000 -- 999999999.") + "!= 000000000 -- 999999999.", ['FAMILY_AFFILIATION', 'SSN']) def test_validate_race_ethnicity(self, record): """Test cat3 validator for race/ethnicity.""" @@ -1017,10 +1018,10 @@ def test_sum_of_recipients(self, record): record.NUM_RECIPIENTS = 2 result = val(record) - assert result == (True, None) + assert result == (True, None, ['NUM_RECIPIENTS', 'NUM_ADULT_RECIPIENTS', 'NUM_CHILD_RECIPIENTS'] ) record.NUM_RECIPIENTS = 1 result = val(record) assert result == (False, "The sum of ['NUM_ADULT_RECIPIENTS', 'NUM_CHILD_RECIPIENTS'] does not equal " + - "NUM_RECIPIENTS.") + "NUM_RECIPIENTS.", ['NUM_RECIPIENTS', 'NUM_ADULT_RECIPIENTS', 'NUM_CHILD_RECIPIENTS']) diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index f31a49f65..a86c3b149 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -61,8 +61,10 @@ def sumIsEqualFunc(value): sum += value[field] if type(value) is dict else getattr(value, field) condition_val = value[condition_field] if type(value) is dict else getattr(value, condition_field) - return (True, None, [condition_field, sum_fields]) if sum == condition_val else (False, - f"The sum of {sum_fields} does not equal {condition_field}.", [condition_field, sum_fields]) + fields = [condition_field] + fields.extend(sum_fields) + return (True, None, fields) if sum == condition_val else (False, + f"The sum of {sum_fields} does not equal {condition_field}.", fields) return lambda value: sumIsEqualFunc(value) From 3f9bfce3e1e337623696ac8452aec3090547eeff Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 7 Nov 2023 10:21:15 -0700 Subject: [PATCH 32/88] - Format with Black - Add missing tests --- .../tdpservice/parsers/schema_defs/header.py | 142 ++- .../tdpservice/parsers/schema_defs/ssp/m1.py | 493 ++++++-- .../tdpservice/parsers/schema_defs/ssp/m2.py | 748 +++++++++--- .../tdpservice/parsers/schema_defs/ssp/m3.py | 477 ++++++-- .../tdpservice/parsers/schema_defs/tanf/t1.py | 857 +++++++++---- .../tdpservice/parsers/schema_defs/tanf/t2.py | 1057 +++++++++++++---- .../tdpservice/parsers/schema_defs/tanf/t3.py | 738 ++++++++---- .../tdpservice/parsers/schema_defs/tanf/t4.py | 171 ++- .../tdpservice/parsers/schema_defs/tanf/t5.py | 497 ++++++-- .../tdpservice/parsers/schema_defs/tanf/t6.py | 637 ++++++++-- .../tdpservice/parsers/schema_defs/tanf/t7.py | 109 +- .../tdpservice/parsers/schema_defs/trailer.py | 40 +- .../parsers/schema_defs/tribal_tanf/t_t1.py | 846 +++++++++---- .../parsers/schema_defs/tribal_tanf/t_t2.py | 812 ++++++++++--- .../parsers/schema_defs/tribal_tanf/t_t3.py | 738 ++++++++---- .../search_indexes/test/test_model_mapping.py | 181 +++ 16 files changed, 6539 insertions(+), 2004 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index b4d991aa0..f1cadb728 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -11,47 +11,113 @@ preparsing_validators=[ validators.hasLength( 23, - lambda value, length: f'Header length is {len(value)} but must be {length} characters.' + lambda value, length: f"Header length is {len(value)} but must be {length} characters.", ), - validators.startsWith('HEADER'), + validators.startsWith("HEADER"), ], postparsing_validators=[], fields=[ - Field(item="2", name='title', type='string', startIndex=0, endIndex=6, required=True, validators=[ - validators.matches('HEADER'), - ]), - Field(item="4", name='year', type='number', startIndex=6, endIndex=10, required=True, validators=[ - validators.isInLimits(2000, 2099) - ]), - Field(item="5", name='quarter', type='string', startIndex=10, endIndex=11, required=True, validators=[ - validators.oneOf(['1', '2', '3', '4']) - ]), - Field(item="6", name='type', type='string', startIndex=11, endIndex=12, required=True, validators=[ - validators.oneOf(['A', 'C', 'G', 'S']) - ]), - Field(item="1", name='state_fips', type='string', startIndex=12, endIndex=14, required=True, validators=[ - validators.or_validators(validators.isInStringRange(0, 2), - validators.isInStringRange(4, 6), - validators.isInStringRange(8, 13), - validators.isInStringRange(15, 42), - validators.isInStringRange(44, 51), - validators.isInStringRange(53, 56), - validators.oneOf(['66', '72', '78'])) - ]), - Field(item="3", name='tribe_code', type='string', startIndex=14, endIndex=17, required=False, validators=[ - validators.isInStringRange(0, 999) - ]), - Field(item="7", name='program_type', type='string', startIndex=17, endIndex=20, required=True, validators=[ - validators.oneOf(['TAN', 'SSP']) - ]), - Field(item="8", name='edit', type='string', startIndex=20, endIndex=21, required=True, validators=[ - validators.oneOf(['1', '2']) - ]), - Field(item="9", name='encryption', type='string', startIndex=21, endIndex=22, required=False, validators=[ - validators.oneOf([' ', 'E']) - ]), - Field(item="10", name='update', type='string', startIndex=22, endIndex=23, required=True, validators=[ - validators.oneOf(['N', 'D', 'U']) - ]), + Field( + item="2", + name="title", + type="string", + startIndex=0, + endIndex=6, + required=True, + validators=[ + validators.matches("HEADER"), + ], + ), + Field( + item="4", + name="year", + type="number", + startIndex=6, + endIndex=10, + required=True, + validators=[validators.isInLimits(2000, 2099)], + ), + Field( + item="5", + name="quarter", + type="string", + startIndex=10, + endIndex=11, + required=True, + validators=[validators.oneOf(["1", "2", "3", "4"])], + ), + Field( + item="6", + name="type", + type="string", + startIndex=11, + endIndex=12, + required=True, + validators=[validators.oneOf(["A", "C", "G", "S"])], + ), + Field( + item="1", + name="state_fips", + type="string", + startIndex=12, + endIndex=14, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 2), + validators.isInStringRange(4, 6), + validators.isInStringRange(8, 13), + validators.isInStringRange(15, 42), + validators.isInStringRange(44, 51), + validators.isInStringRange(53, 56), + validators.oneOf(["66", "72", "78"]), + ) + ], + ), + Field( + item="3", + name="tribe_code", + type="string", + startIndex=14, + endIndex=17, + required=False, + validators=[validators.isInStringRange(0, 999)], + ), + Field( + item="7", + name="program_type", + type="string", + startIndex=17, + endIndex=20, + required=True, + validators=[validators.oneOf(["TAN", "SSP"])], + ), + Field( + item="8", + name="edit", + type="string", + startIndex=20, + endIndex=21, + required=True, + validators=[validators.oneOf(["1", "2"])], + ), + Field( + item="9", + name="encryption", + type="string", + startIndex=21, + endIndex=22, + required=False, + validators=[validators.oneOf([" ", "E"])], + ), + Field( + item="10", + name="update", + type="string", + startIndex=22, + endIndex=23, + required=True, + validators=[validators.oneOf(["N", "D", "U"])], + ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 7d907dfd4..b5ce07b7a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -8,101 +8,402 @@ from tdpservice.search_indexes.models.ssp import SSP_M1 m1 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=SSP_M1, - preparsing_validators=[ - validators.hasLength(150), - ], - postparsing_validators=[], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, - required=True, validators=[]), - Field(item="4", name='STRATUM', type='string', startIndex=22, endIndex=24, - required=True, validators=[]), - Field(item="6", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, - required=True, validators=[]), - Field(item="7", name='DISPOSITION', type='number', startIndex=29, endIndex=30, - required=True, validators=[]), - Field(item="8", name='NBR_FAMILY_MEMBERS', type='number', startIndex=30, endIndex=32, - required=True, validators=[]), - Field(item="9", name='FAMILY_TYPE', type='number', startIndex=32, endIndex=33, - required=True, validators=[]), - Field(item="10", name='TANF_ASST_IN_6MONTHS', type='number', startIndex=33, endIndex=34, - required=True, validators=[]), - Field(item="11", name='RECEIVES_SUB_HOUSING', type='number', startIndex=34, endIndex=35, - required=True, validators=[]), - Field(item="12", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=35, endIndex=36, - required=True, validators=[]), - Field(item="13", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=36, endIndex=37, - required=True, validators=[]), - Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=37, endIndex=41, - required=True, validators=[]), - Field(item="15", name='RECEIVES_SUB_CC', type='number', startIndex=41, endIndex=42, - required=True, validators=[]), - Field(item="16", name='AMT_SUB_CC', type='number', startIndex=42, endIndex=46, - required=True, validators=[]), - Field(item="17", name='CHILD_SUPPORT_AMT', type='number', startIndex=46, endIndex=50, - required=True, validators=[]), - Field(item="18", name='FAMILY_CASH_RESOURCES', type='number', startIndex=50, endIndex=54, - required=True, validators=[]), - Field(item="19A", name='CASH_AMOUNT', type='number', startIndex=54, endIndex=58, - required=True, validators=[]), - Field(item="19B", name='NBR_MONTHS', type='number', startIndex=58, endIndex=61, - required=True, validators=[]), - Field(item="20A", name='CC_AMOUNT', type='number', startIndex=61, endIndex=65, - required=True, validators=[]), - Field(item="20B", name='CHILDREN_COVERED', type='number', startIndex=65, endIndex=67, - required=True, validators=[]), - Field(item="20C", name='CC_NBR_MONTHS', type='number', startIndex=67, endIndex=70, - required=True, validators=[]), - Field(item="21A", name='TRANSP_AMOUNT', type='number', startIndex=70, endIndex=74, - required=True, validators=[]), - Field(item="21B", name='TRANSP_NBR_MONTHS', type='number', startIndex=74, endIndex=77, - required=True, validators=[]), - Field(item="22A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=77, endIndex=81, - required=True, validators=[]), - Field(item="22B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=81, endIndex=84, - required=True, validators=[]), - Field(item="23A", name='OTHER_AMOUNT', type='number', startIndex=84, endIndex=88, - required=True, validators=[]), - Field(item="23B", name='OTHER_NBR_MONTHS', type='number', startIndex=88, endIndex=91, - required=True, validators=[]), - Field(item="24AI", name='SANC_REDUCTION_AMT', type='number', startIndex=91, endIndex=95, - required=True, validators=[]), - Field(item="24AII", name='WORK_REQ_SANCTION', type='number', startIndex=95, endIndex=96, - required=True, validators=[]), - Field(item="24AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=96, endIndex=97, - required=True, validators=[]), - Field(item="24AIV", name='SANC_TEEN_PARENT', type='number', startIndex=97, endIndex=98, - required=True, validators=[]), - Field(item="24AV", name='NON_COOPERATION_CSE', type='number', startIndex=98, endIndex=99, - required=True, validators=[]), - Field(item="24AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=99, endIndex=100, - required=True, validators=[]), - Field(item="24AVII", name='OTHER_SANCTION', type='number', startIndex=100, endIndex=101, - required=True, validators=[]), - Field(item="24B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=101, endIndex=105, - required=True, validators=[]), - Field(item="24CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=105, endIndex=109, - required=True, validators=[]), - Field(item="24CII", name='FAMILY_CAP', type='number', startIndex=109, endIndex=110, - required=True, validators=[]), - Field(item="24CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=110, endIndex=111, - required=True, validators=[]), - Field(item="24CIV", name='OTHER_NON_SANCTION', type='number', startIndex=111, endIndex=112, - required=True, validators=[]), - Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', type='number', startIndex=112, endIndex=113, - required=True, validators=[]), - Field(item="-1", name='BLANK', type='string', startIndex=113, endIndex=150, - required=False, validators=[]), - ] + model=SSP_M1, + preparsing_validators=[ + validators.hasLength(150), + ], + postparsing_validators=[], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + type="string", + startIndex=19, + endIndex=22, + required=True, + validators=[], + ), + Field( + item="4", + name="STRATUM", + type="string", + startIndex=22, + endIndex=24, + required=True, + validators=[], + ), + Field( + item="6", + name="ZIP_CODE", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[], + ), + Field( + item="7", + name="DISPOSITION", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[], + ), + Field( + item="8", + name="NBR_FAMILY_MEMBERS", + type="number", + startIndex=30, + endIndex=32, + required=True, + validators=[], + ), + Field( + item="9", + name="FAMILY_TYPE", + type="number", + startIndex=32, + endIndex=33, + required=True, + validators=[], + ), + Field( + item="10", + name="TANF_ASST_IN_6MONTHS", + type="number", + startIndex=33, + endIndex=34, + required=True, + validators=[], + ), + Field( + item="11", + name="RECEIVES_SUB_HOUSING", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[], + ), + Field( + item="12", + name="RECEIVES_MED_ASSISTANCE", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[], + ), + Field( + item="13", + name="RECEIVES_FOOD_STAMPS", + type="number", + startIndex=36, + endIndex=37, + required=True, + validators=[], + ), + Field( + item="14", + name="AMT_FOOD_STAMP_ASSISTANCE", + type="number", + startIndex=37, + endIndex=41, + required=True, + validators=[], + ), + Field( + item="15", + name="RECEIVES_SUB_CC", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[], + ), + Field( + item="16", + name="AMT_SUB_CC", + type="number", + startIndex=42, + endIndex=46, + required=True, + validators=[], + ), + Field( + item="17", + name="CHILD_SUPPORT_AMT", + type="number", + startIndex=46, + endIndex=50, + required=True, + validators=[], + ), + Field( + item="18", + name="FAMILY_CASH_RESOURCES", + type="number", + startIndex=50, + endIndex=54, + required=True, + validators=[], + ), + Field( + item="19A", + name="CASH_AMOUNT", + type="number", + startIndex=54, + endIndex=58, + required=True, + validators=[], + ), + Field( + item="19B", + name="NBR_MONTHS", + type="number", + startIndex=58, + endIndex=61, + required=True, + validators=[], + ), + Field( + item="20A", + name="CC_AMOUNT", + type="number", + startIndex=61, + endIndex=65, + required=True, + validators=[], + ), + Field( + item="20B", + name="CHILDREN_COVERED", + type="number", + startIndex=65, + endIndex=67, + required=True, + validators=[], + ), + Field( + item="20C", + name="CC_NBR_MONTHS", + type="number", + startIndex=67, + endIndex=70, + required=True, + validators=[], + ), + Field( + item="21A", + name="TRANSP_AMOUNT", + type="number", + startIndex=70, + endIndex=74, + required=True, + validators=[], + ), + Field( + item="21B", + name="TRANSP_NBR_MONTHS", + type="number", + startIndex=74, + endIndex=77, + required=True, + validators=[], + ), + Field( + item="22A", + name="TRANSITION_SERVICES_AMOUNT", + type="number", + startIndex=77, + endIndex=81, + required=True, + validators=[], + ), + Field( + item="22B", + name="TRANSITION_NBR_MONTHS", + type="number", + startIndex=81, + endIndex=84, + required=True, + validators=[], + ), + Field( + item="23A", + name="OTHER_AMOUNT", + type="number", + startIndex=84, + endIndex=88, + required=True, + validators=[], + ), + Field( + item="23B", + name="OTHER_NBR_MONTHS", + type="number", + startIndex=88, + endIndex=91, + required=True, + validators=[], + ), + Field( + item="24AI", + name="SANC_REDUCTION_AMT", + type="number", + startIndex=91, + endIndex=95, + required=True, + validators=[], + ), + Field( + item="24AII", + name="WORK_REQ_SANCTION", + type="number", + startIndex=95, + endIndex=96, + required=True, + validators=[], + ), + Field( + item="24AIII", + name="FAMILY_SANC_ADULT", + type="number", + startIndex=96, + endIndex=97, + required=True, + validators=[], + ), + Field( + item="24AIV", + name="SANC_TEEN_PARENT", + type="number", + startIndex=97, + endIndex=98, + required=True, + validators=[], + ), + Field( + item="24AV", + name="NON_COOPERATION_CSE", + type="number", + startIndex=98, + endIndex=99, + required=True, + validators=[], + ), + Field( + item="24AVI", + name="FAILURE_TO_COMPLY", + type="number", + startIndex=99, + endIndex=100, + required=True, + validators=[], + ), + Field( + item="24AVII", + name="OTHER_SANCTION", + type="number", + startIndex=100, + endIndex=101, + required=True, + validators=[], + ), + Field( + item="24B", + name="RECOUPMENT_PRIOR_OVRPMT", + type="number", + startIndex=101, + endIndex=105, + required=True, + validators=[], + ), + Field( + item="24CI", + name="OTHER_TOTAL_REDUCTIONS", + type="number", + startIndex=105, + endIndex=109, + required=True, + validators=[], + ), + Field( + item="24CII", + name="FAMILY_CAP", + type="number", + startIndex=109, + endIndex=110, + required=True, + validators=[], + ), + Field( + item="24CIII", + name="REDUCTIONS_ON_RECEIPTS", + type="number", + startIndex=110, + endIndex=111, + required=True, + validators=[], + ), + Field( + item="24CIV", + name="OTHER_NON_SANCTION", + type="number", + startIndex=111, + endIndex=112, + required=True, + validators=[], + ), + Field( + item="25", + name="WAIVER_EVAL_CONTROL_GRPS", + type="number", + startIndex=112, + endIndex=113, + required=True, + validators=[], + ), + Field( + item="-1", + name="BLANK", + type="string", + startIndex=113, + endIndex=150, + required=False, + validators=[], + ), + ], ) - ] - ) + ] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index 0b1b06379..ca0a5e47a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -10,147 +10,611 @@ m2 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=SSP_M2, - preparsing_validators=[ - validators.hasLength(150), - ], - postparsing_validators=[], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="26", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[]), - Field(item="27", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, - required=True, validators=[]), - Field(item="28", name='DATE_OF_BIRTH', type='string', startIndex=21, endIndex=29, - required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', type='string', - startIndex=29, endIndex=38, required=True, validators=[], is_encrypted=False), - Field(item="30A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=True, - validators=[]), - Field(item="30B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, - required=True, validators=[]), - Field(item="30C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, - required=True, validators=[]), - Field(item="30D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, - required=True, validators=[]), - Field(item="30E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, - required=True, validators=[]), - Field(item="30F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, - required=True, validators=[]), - Field(item="31", name='GENDER', type='number', startIndex=44, endIndex=45, - required=True, validators=[]), - Field(item="32A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, - required=True, validators=[]), - Field(item="32B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, - required=True, validators=[]), - Field(item="32C", name='DISABLED_TITLE_XIVAPDT', type='number', startIndex=47, endIndex=48, - required=True, validators=[]), - Field(item="32D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, - required=True, validators=[]), - Field(item="32E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, - required=True, validators=[]), - Field(item="33", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, - required=True, validators=[]), - Field(item="34", name='RELATIONSHIP_HOH', type='number', startIndex=51, endIndex=53, - required=True, validators=[]), - Field(item="35", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, - required=True, validators=[]), - Field(item="36", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, - required=True, validators=[]), - Field(item="37", name='EDUCATION_LEVEL', type='number', startIndex=55, endIndex=57, - required=True, validators=[]), - Field(item="38", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, - required=True, validators=[]), - Field(item="39", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - required=True, validators=[]), - Field(item="40", name='EMPLOYMENT_STATUS', type='number', startIndex=59, endIndex=60, - required=True, validators=[]), - Field(item="41", name='WORK_ELIGIBLE_INDICATOR', type='number', startIndex=60, endIndex=62, - required=True, validators=[]), - Field(item="42", name='WORK_PART_STATUS', type='number', startIndex=62, endIndex=64, - required=True, validators=[]), - Field(item="43", name='UNSUB_EMPLOYMENT', type='number', startIndex=64, endIndex=66, - required=True, validators=[]), - Field(item="44", name='SUB_PRIVATE_EMPLOYMENT', type='number', startIndex=66, endIndex=68, - required=True, validators=[]), - Field(item="45", name='SUB_PUBLIC_EMPLOYMENT', type='number', startIndex=68, endIndex=70, - required=True, validators=[]), - Field(item="46A", name='WORK_EXPERIENCE_HOP', type='number', startIndex=70, endIndex=72, - required=True, validators=[]), - Field(item="46B", name='WORK_EXPERIENCE_EA', type='number', startIndex=72, endIndex=74, - required=True, validators=[]), - Field(item="46C", name='WORK_EXPERIENCE_HOL', type='number', startIndex=74, endIndex=76, - required=True, validators=[]), - Field(item="47", name='OJT', type='number', startIndex=76, endIndex=78, - required=True, validators=[]), - Field(item="48A", name='JOB_SEARCH_HOP', type='number', startIndex=78, endIndex=80, - required=True, validators=[]), - Field(item="48B", name='JOB_SEARCH_EA', type='number', startIndex=80, endIndex=82, - required=True, validators=[]), - Field(item="48C", name='JOB_SEARCH_HOL', type='number', startIndex=82, endIndex=84, - required=True, validators=[]), - Field(item="49A", name='COMM_SERVICES_HOP', type='number', startIndex=84, endIndex=86, - required=True, validators=[]), - Field(item="49B", name='COMM_SERVICES_EA', type='number', startIndex=86, endIndex=88, - required=True, validators=[]), - Field(item="49C", name='COMM_SERVICES_HOL', type='number', startIndex=88, endIndex=90, - required=True, validators=[]), - Field(item="50A", name='VOCATIONAL_ED_TRAINING_HOP', type='number', startIndex=90, endIndex=92, - required=True, validators=[]), - Field(item="50B", name='VOCATIONAL_ED_TRAINING_EA', type='number', startIndex=92, endIndex=94, - required=True, validators=[]), - Field(item="50C", name='VOCATIONAL_ED_TRAINING_HOL', type='number', startIndex=94, endIndex=96, - required=True, validators=[]), - Field(item="51A", name='JOB_SKILLS_TRAINING_HOP', type='number', startIndex=96, endIndex=98, - required=True, validators=[]), - Field(item="51B", name='JOB_SKILLS_TRAINING_EA', type='number', startIndex=98, endIndex=100, - required=True, validators=[]), - Field(item="51C", name='JOB_SKILLS_TRAINING_HOL', type='number', startIndex=100, endIndex=102, - required=True, validators=[]), - Field(item="52A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='number', startIndex=102, endIndex=104, - required=True, validators=[]), - Field(item="52B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='number', startIndex=104, endIndex=106, - required=True, validators=[]), - Field(item="52C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='number', startIndex=106, endIndex=108, - required=True, validators=[]), - Field(item="53A", name='SCHOOL_ATTENDENCE_HOP', type='number', startIndex=108, endIndex=110, - required=True, validators=[]), - Field(item="53B", name='SCHOOL_ATTENDENCE_EA', type='number', startIndex=110, endIndex=112, - required=True, validators=[]), - Field(item="53C", name='SCHOOL_ATTENDENCE_HOL', type='number', startIndex=112, endIndex=114, - required=True, validators=[]), - Field(item="54A", name='PROVIDE_CC_HOP', type='number', startIndex=114, endIndex=116, - required=True, validators=[]), - Field(item="54B", name='PROVIDE_CC_EA', type='number', startIndex=116, endIndex=118, - required=True, validators=[]), - Field(item="54C", name='PROVIDE_CC_HOL', type='number', startIndex=118, endIndex=120, - required=True, validators=[]), - Field(item="55", name='OTHER_WORK_ACTIVITIES', type='number', startIndex=120, endIndex=122, - required=True, validators=[]), - Field(item="56", name='DEEMED_HOURS_FOR_OVERALL', type='number', startIndex=122, endIndex=124, - required=True, validators=[]), - Field(item="57", name='DEEMED_HOURS_FOR_TWO_PARENT', type='number', startIndex=124, endIndex=126, - required=True, validators=[]), - Field(item="58", name='EARNED_INCOME', type='number', startIndex=126, endIndex=130, - required=True, validators=[]), - Field(item="59A", name='UNEARNED_INCOME_TAX_CREDIT', type='number', startIndex=130, endIndex=134, - required=True, validators=[]), - Field(item="59B", name='UNEARNED_SOCIAL_SECURITY', type='number', startIndex=134, endIndex=138, - required=True, validators=[]), - Field(item="59C", name='UNEARNED_SSI', type='number', startIndex=138, endIndex=142, - required=True, validators=[]), - Field(item="59D", name='UNEARNED_WORKERS_COMP', type='number', startIndex=142, endIndex=146, - required=True, validators=[]), - Field(item="59E", name='OTHER_UNEARNED_INCOME', type='number', startIndex=146, endIndex=150, - required=True, validators=[]), - ], + model=SSP_M2, + preparsing_validators=[ + validators.hasLength(150), + ], + postparsing_validators=[], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="26", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[], + ), + Field( + item="27", + name="NONCUSTODIAL_PARENT", + type="number", + startIndex=20, + endIndex=21, + required=True, + validators=[], + ), + Field( + item="28", + name="DATE_OF_BIRTH", + type="string", + startIndex=21, + endIndex=29, + required=True, + validators=[], + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="29", + name="SSN", + type="string", + startIndex=29, + endIndex=38, + required=True, + validators=[], + is_encrypted=False, + ), + Field( + item="30A", + name="RACE_HISPANIC", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[], + ), + Field( + item="30B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[], + ), + Field( + item="30C", + name="RACE_ASIAN", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[], + ), + Field( + item="30D", + name="RACE_BLACK", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[], + ), + Field( + item="30E", + name="RACE_HAWAIIAN", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[], + ), + Field( + item="30F", + name="RACE_WHITE", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[], + ), + Field( + item="31", + name="GENDER", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[], + ), + Field( + item="32A", + name="FED_OASDI_PROGRAM", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[], + ), + Field( + item="32B", + name="FED_DISABILITY_STATUS", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[], + ), + Field( + item="32C", + name="DISABLED_TITLE_XIVAPDT", + type="number", + startIndex=47, + endIndex=48, + required=True, + validators=[], + ), + Field( + item="32D", + name="AID_AGED_BLIND", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[], + ), + Field( + item="32E", + name="RECEIVE_SSI", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[], + ), + Field( + item="33", + name="MARITAL_STATUS", + type="number", + startIndex=50, + endIndex=51, + required=True, + validators=[], + ), + Field( + item="34", + name="RELATIONSHIP_HOH", + type="number", + startIndex=51, + endIndex=53, + required=True, + validators=[], + ), + Field( + item="35", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=53, + endIndex=54, + required=True, + validators=[], + ), + Field( + item="36", + name="NEEDS_PREGNANT_WOMAN", + type="number", + startIndex=54, + endIndex=55, + required=True, + validators=[], + ), + Field( + item="37", + name="EDUCATION_LEVEL", + type="number", + startIndex=55, + endIndex=57, + required=True, + validators=[], + ), + Field( + item="38", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=57, + endIndex=58, + required=True, + validators=[], + ), + Field( + item="39", + name="COOPERATION_CHILD_SUPPORT", + type="number", + startIndex=58, + endIndex=59, + required=True, + validators=[], + ), + Field( + item="40", + name="EMPLOYMENT_STATUS", + type="number", + startIndex=59, + endIndex=60, + required=True, + validators=[], + ), + Field( + item="41", + name="WORK_ELIGIBLE_INDICATOR", + type="number", + startIndex=60, + endIndex=62, + required=True, + validators=[], + ), + Field( + item="42", + name="WORK_PART_STATUS", + type="number", + startIndex=62, + endIndex=64, + required=True, + validators=[], + ), + Field( + item="43", + name="UNSUB_EMPLOYMENT", + type="number", + startIndex=64, + endIndex=66, + required=True, + validators=[], + ), + Field( + item="44", + name="SUB_PRIVATE_EMPLOYMENT", + type="number", + startIndex=66, + endIndex=68, + required=True, + validators=[], + ), + Field( + item="45", + name="SUB_PUBLIC_EMPLOYMENT", + type="number", + startIndex=68, + endIndex=70, + required=True, + validators=[], + ), + Field( + item="46A", + name="WORK_EXPERIENCE_HOP", + type="number", + startIndex=70, + endIndex=72, + required=True, + validators=[], + ), + Field( + item="46B", + name="WORK_EXPERIENCE_EA", + type="number", + startIndex=72, + endIndex=74, + required=True, + validators=[], + ), + Field( + item="46C", + name="WORK_EXPERIENCE_HOL", + type="number", + startIndex=74, + endIndex=76, + required=True, + validators=[], + ), + Field( + item="47", + name="OJT", + type="number", + startIndex=76, + endIndex=78, + required=True, + validators=[], + ), + Field( + item="48A", + name="JOB_SEARCH_HOP", + type="number", + startIndex=78, + endIndex=80, + required=True, + validators=[], + ), + Field( + item="48B", + name="JOB_SEARCH_EA", + type="number", + startIndex=80, + endIndex=82, + required=True, + validators=[], + ), + Field( + item="48C", + name="JOB_SEARCH_HOL", + type="number", + startIndex=82, + endIndex=84, + required=True, + validators=[], + ), + Field( + item="49A", + name="COMM_SERVICES_HOP", + type="number", + startIndex=84, + endIndex=86, + required=True, + validators=[], + ), + Field( + item="49B", + name="COMM_SERVICES_EA", + type="number", + startIndex=86, + endIndex=88, + required=True, + validators=[], + ), + Field( + item="49C", + name="COMM_SERVICES_HOL", + type="number", + startIndex=88, + endIndex=90, + required=True, + validators=[], + ), + Field( + item="50A", + name="VOCATIONAL_ED_TRAINING_HOP", + type="number", + startIndex=90, + endIndex=92, + required=True, + validators=[], + ), + Field( + item="50B", + name="VOCATIONAL_ED_TRAINING_EA", + type="number", + startIndex=92, + endIndex=94, + required=True, + validators=[], + ), + Field( + item="50C", + name="VOCATIONAL_ED_TRAINING_HOL", + type="number", + startIndex=94, + endIndex=96, + required=True, + validators=[], + ), + Field( + item="51A", + name="JOB_SKILLS_TRAINING_HOP", + type="number", + startIndex=96, + endIndex=98, + required=True, + validators=[], + ), + Field( + item="51B", + name="JOB_SKILLS_TRAINING_EA", + type="number", + startIndex=98, + endIndex=100, + required=True, + validators=[], + ), + Field( + item="51C", + name="JOB_SKILLS_TRAINING_HOL", + type="number", + startIndex=100, + endIndex=102, + required=True, + validators=[], + ), + Field( + item="52A", + name="ED_NO_HIGH_SCHOOL_DIPL_HOP", + type="number", + startIndex=102, + endIndex=104, + required=True, + validators=[], + ), + Field( + item="52B", + name="ED_NO_HIGH_SCHOOL_DIPL_EA", + type="number", + startIndex=104, + endIndex=106, + required=True, + validators=[], + ), + Field( + item="52C", + name="ED_NO_HIGH_SCHOOL_DIPL_HOL", + type="number", + startIndex=106, + endIndex=108, + required=True, + validators=[], + ), + Field( + item="53A", + name="SCHOOL_ATTENDENCE_HOP", + type="number", + startIndex=108, + endIndex=110, + required=True, + validators=[], + ), + Field( + item="53B", + name="SCHOOL_ATTENDENCE_EA", + type="number", + startIndex=110, + endIndex=112, + required=True, + validators=[], + ), + Field( + item="53C", + name="SCHOOL_ATTENDENCE_HOL", + type="number", + startIndex=112, + endIndex=114, + required=True, + validators=[], + ), + Field( + item="54A", + name="PROVIDE_CC_HOP", + type="number", + startIndex=114, + endIndex=116, + required=True, + validators=[], + ), + Field( + item="54B", + name="PROVIDE_CC_EA", + type="number", + startIndex=116, + endIndex=118, + required=True, + validators=[], + ), + Field( + item="54C", + name="PROVIDE_CC_HOL", + type="number", + startIndex=118, + endIndex=120, + required=True, + validators=[], + ), + Field( + item="55", + name="OTHER_WORK_ACTIVITIES", + type="number", + startIndex=120, + endIndex=122, + required=True, + validators=[], + ), + Field( + item="56", + name="DEEMED_HOURS_FOR_OVERALL", + type="number", + startIndex=122, + endIndex=124, + required=True, + validators=[], + ), + Field( + item="57", + name="DEEMED_HOURS_FOR_TWO_PARENT", + type="number", + startIndex=124, + endIndex=126, + required=True, + validators=[], + ), + Field( + item="58", + name="EARNED_INCOME", + type="number", + startIndex=126, + endIndex=130, + required=True, + validators=[], + ), + Field( + item="59A", + name="UNEARNED_INCOME_TAX_CREDIT", + type="number", + startIndex=130, + endIndex=134, + required=True, + validators=[], + ), + Field( + item="59B", + name="UNEARNED_SOCIAL_SECURITY", + type="number", + startIndex=134, + endIndex=138, + required=True, + validators=[], + ), + Field( + item="59C", + name="UNEARNED_SSI", + type="number", + startIndex=138, + endIndex=142, + required=True, + validators=[], + ), + Field( + item="59D", + name="UNEARNED_WORKERS_COMP", + type="number", + startIndex=142, + endIndex=146, + required=True, + validators=[], + ), + Field( + item="59E", + name="OTHER_UNEARNED_INCOME", + type="number", + startIndex=146, + endIndex=150, + required=True, + validators=[], + ), + ], ) - ] - ) + ] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index 301e1b03e..fe0b19175 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -15,49 +15,198 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="60", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[]), - Field(item="61", name='DATE_OF_BIRTH', type='string', startIndex=20, endIndex=28, - required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=28, - endIndex=37, required=True, validators=[], is_encrypted=False), - Field(item="63A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, - required=True, validators=[]), - Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - required=True, validators=[]), - Field(item="63C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, - required=True, validators=[]), - Field(item="63D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, - required=True, validators=[]), - Field(item="63E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, - required=True, validators=[]), - Field(item="63F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, - required=True, validators=[]), - Field(item="64", name='GENDER', type='number', startIndex=43, endIndex=44, - required=True, validators=[]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=44, endIndex=45, - required=True, validators=[]), - Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, - required=True, validators=[]), - Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=46, endIndex=48, - required=True, validators=[]), - Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, - required=True, validators=[]), - Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=49, endIndex=51, - required=True, validators=[]), - Field(item="69", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, - required=True, validators=[]), - Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=52, endIndex=56, - required=True, validators=[]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=56, endIndex=60, - required=True, validators=[]) - ] + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="60", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[], + ), + Field( + item="61", + name="DATE_OF_BIRTH", + type="string", + startIndex=20, + endIndex=28, + required=True, + validators=[], + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="62", + name="SSN", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[], + is_encrypted=False, + ), + Field( + item="63A", + name="RACE_HISPANIC", + type="number", + startIndex=37, + endIndex=38, + required=True, + validators=[], + ), + Field( + item="63B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[], + ), + Field( + item="63C", + name="RACE_ASIAN", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[], + ), + Field( + item="63D", + name="RACE_BLACK", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[], + ), + Field( + item="63E", + name="RACE_HAWAIIAN", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[], + ), + Field( + item="63F", + name="RACE_WHITE", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[], + ), + Field( + item="64", + name="GENDER", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[], + ), + Field( + item="65A", + name="RECEIVE_NONSSI_BENEFITS", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[], + ), + Field( + item="65B", + name="RECEIVE_SSI", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[], + ), + Field( + item="66", + name="RELATIONSHIP_HOH", + type="number", + startIndex=46, + endIndex=48, + required=True, + validators=[], + ), + Field( + item="67", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[], + ), + Field( + item="68", + name="EDUCATION_LEVEL", + type="number", + startIndex=49, + endIndex=51, + required=True, + validators=[], + ), + Field( + item="69", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=51, + endIndex=52, + required=True, + validators=[], + ), + Field( + item="70A", + name="UNEARNED_SSI", + type="number", + startIndex=52, + endIndex=56, + required=True, + validators=[], + ), + Field( + item="70B", + name="OTHER_UNEARNED_INCOME", + type="number", + startIndex=56, + endIndex=60, + required=True, + validators=[], + ), + ], ) second_part_schema = RowSchema( @@ -68,54 +217,198 @@ ], postparsing_validators=[], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[]), - Field(item="60", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, - required=True, validators=[]), - Field(item="61", name='DATE_OF_BIRTH', type='string', startIndex=61, endIndex=69, - required=True, validators=[]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=69, - endIndex=78, required=True, validators=[], is_encrypted=False), - Field(item="63A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, - required=True, validators=[]), - Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, - required=True, validators=[]), - Field(item="63C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, - required=True, validators=[]), - Field(item="63D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, - required=True, validators=[]), - Field(item="63E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, - required=True, validators=[]), - Field(item="63F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, - required=True, validators=[]), - Field(item="64", name='GENDER', type='number', startIndex=84, endIndex=85, - required=True, validators=[]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=85, endIndex=86, - required=True, validators=[]), - Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, - required=True, validators=[]), - Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=87, endIndex=89, - required=True, validators=[]), - Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, - required=True, validators=[]), - Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=90, endIndex=92, - required=True, validators=[]), - Field(item="69", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, - required=True, validators=[]), - Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=93, endIndex=97, - required=True, validators=[]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=97, endIndex=101, - required=True, validators=[]) - ] + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="5", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[], + ), + Field( + item="60", + name="FAMILY_AFFILIATION", + type="number", + startIndex=60, + endIndex=61, + required=True, + validators=[], + ), + Field( + item="61", + name="DATE_OF_BIRTH", + type="string", + startIndex=61, + endIndex=69, + required=True, + validators=[], + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="62", + name="SSN", + type="string", + startIndex=69, + endIndex=78, + required=True, + validators=[], + is_encrypted=False, + ), + Field( + item="63A", + name="RACE_HISPANIC", + type="number", + startIndex=78, + endIndex=79, + required=True, + validators=[], + ), + Field( + item="63B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=79, + endIndex=80, + required=True, + validators=[], + ), + Field( + item="63C", + name="RACE_ASIAN", + type="number", + startIndex=80, + endIndex=81, + required=True, + validators=[], + ), + Field( + item="63D", + name="RACE_BLACK", + type="number", + startIndex=81, + endIndex=82, + required=True, + validators=[], + ), + Field( + item="63E", + name="RACE_HAWAIIAN", + type="number", + startIndex=82, + endIndex=83, + required=True, + validators=[], + ), + Field( + item="63F", + name="RACE_WHITE", + type="number", + startIndex=83, + endIndex=84, + required=True, + validators=[], + ), + Field( + item="64", + name="GENDER", + type="number", + startIndex=84, + endIndex=85, + required=True, + validators=[], + ), + Field( + item="65A", + name="RECEIVE_NONSSI_BENEFITS", + type="number", + startIndex=85, + endIndex=86, + required=True, + validators=[], + ), + Field( + item="65B", + name="RECEIVE_SSI", + type="number", + startIndex=86, + endIndex=87, + required=True, + validators=[], + ), + Field( + item="66", + name="RELATIONSHIP_HOH", + type="number", + startIndex=87, + endIndex=89, + required=True, + validators=[], + ), + Field( + item="67", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=89, + endIndex=90, + required=True, + validators=[], + ), + Field( + item="68", + name="EDUCATION_LEVEL", + type="number", + startIndex=90, + endIndex=92, + required=True, + validators=[], + ), + Field( + item="69", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=92, + endIndex=93, + required=True, + validators=[], + ), + Field( + item="70A", + name="UNEARNED_SSI", + type="number", + startIndex=93, + endIndex=97, + required=True, + validators=[], + ), + Field( + item="70B", + name="OTHER_UNEARNED_INCOME", + type="number", + startIndex=97, + endIndex=101, + required=True, + validators=[], + ), + ], ) -m3 = SchemaManager( - schemas=[ - first_part_schema, - second_part_schema - ] -) +m3 = SchemaManager(schemas=[first_part_schema, second_part_schema]) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index f31bc892c..4718db68e 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -7,258 +7,621 @@ from tdpservice.search_indexes.models.tanf import TANF_T1 -t1 = SchemaManager(schemas=[ - RowSchema( +t1 = SchemaManager( + schemas=[ + RowSchema( model=TANF_T1, preparsing_validators=[ - validators.hasLength(156), + validators.hasLength(156), ], postparsing_validators=[ - validators.if_then_validator( - condition_field='CASH_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CHILDREN_COVERED', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CC_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSP_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSP_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSITION_SERVICES_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSITION_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='OTHER_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='OTHER_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='WORK_REQ_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAMILY_SANC_ADULT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='SANC_TEEN_PARENT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='NON_COOPERATION_CSE', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAILURE_TO_COMPLY', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='OTHER_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='FAMILY_CAP', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='REDUCTIONS_ON_RECEIPTS', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='OTHER_NON_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.sumIsLarger(("AMT_FOOD_STAMP_ASSISTANCE", "AMT_SUB_CC", "CASH_AMOUNT", "CC_AMOUNT", - "TRANSP_AMOUNT", "TRANSITION_SERVICES_AMOUNT", "OTHER_AMOUNT"), 0) + validators.if_then_validator( + condition_field="CASH_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="CC_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="CHILDREN_COVERED", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="CC_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="CC_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="TRANSP_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="TRANSP_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="TRANSITION_SERVICES_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="TRANSITION_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="OTHER_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="OTHER_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="WORK_REQ_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="FAMILY_SANC_ADULT", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="SANC_TEEN_PARENT", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="NON_COOPERATION_CSE", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="FAILURE_TO_COMPLY", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="OTHER_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="FAMILY_CAP", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="REDUCTIONS_ON_RECEIPTS", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="OTHER_NON_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.sumIsLarger( + ( + "AMT_FOOD_STAMP_ASSISTANCE", + "AMT_SUB_CC", + "CASH_AMOUNT", + "CC_AMOUNT", + "TRANSP_AMOUNT", + "TRANSITION_SERVICES_AMOUNT", + "OTHER_AMOUNT", + ), + 0, + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, - required=True, validators=[ - validators.isNumber(), - ]), - Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, - required=False, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, - required=True, validators=[ - validators.isNumber(), - ]), - Field(item="8", name='FUNDING_STREAM', type='number', startIndex=29, endIndex=30, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="9", name='DISPOSITION', type='number', startIndex=30, endIndex=31, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="10", name='NEW_APPLICANT', type='number', startIndex=31, endIndex=32, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="11", name='NBR_FAMILY_MEMBERS', type='number', startIndex=32, endIndex=34, - required=True, validators=[ - validators.isLargerThan(0), - ]), - Field(item="12", name='FAMILY_TYPE', type='number', startIndex=34, endIndex=35, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="13", name='RECEIVES_SUB_HOUSING', type='number', startIndex=35, endIndex=36, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="14", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=36, endIndex=37, - required=True, validators=[ - validators.isInLimits(1, 2), - ]), - Field(item="15", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=37, endIndex=38, - required=False, validators=[ - validators.isInLimits(0, 2), - ]), - Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=38, endIndex=42, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="17", name='RECEIVES_SUB_CC', type='number', startIndex=42, endIndex=43, - required=False, validators=[ - validators.isInLimits(0, 3), - ]), - Field(item="18", name='AMT_SUB_CC', type='number', startIndex=43, endIndex=47, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="19", name='CHILD_SUPPORT_AMT', type='number', startIndex=47, endIndex=51, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="20", name='FAMILY_CASH_RESOURCES', type='number', startIndex=51, endIndex=55, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="21A", name='CASH_AMOUNT', type='number', startIndex=55, endIndex=59, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="21B", name='NBR_MONTHS', type='number', startIndex=59, endIndex=62, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22A", name='CC_AMOUNT', type='number', startIndex=62, endIndex=66, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22B", name='CHILDREN_COVERED', type='number', startIndex=66, endIndex=68, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22C", name='CC_NBR_MONTHS', type='number', startIndex=68, endIndex=71, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="23A", name='TRANSP_AMOUNT', type='number', startIndex=71, endIndex=75, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="23B", name='TRANSP_NBR_MONTHS', type='number', startIndex=75, endIndex=78, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=78, endIndex=82, - required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=82, endIndex=85, - required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="25A", name='OTHER_AMOUNT', type='number', startIndex=85, endIndex=89, - required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="25B", name='OTHER_NBR_MONTHS', type='number', startIndex=89, endIndex=92, - required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26AI", name='SANC_REDUCTION_AMT', type='number', startIndex=92, endIndex=96, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26AII", name='WORK_REQ_SANCTION', type='number', startIndex=96, endIndex=97, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=97, endIndex=98, - required=False, validators=[ - validators.oneOf([0, 1, 2]), - ]), - Field(item="26AIV", name='SANC_TEEN_PARENT', type='number', startIndex=98, endIndex=99, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AV", name='NON_COOPERATION_CSE', type='number', startIndex=99, endIndex=100, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=100, endIndex=101, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AVII", name='OTHER_SANCTION', type='number', startIndex=101, endIndex=102, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=102, endIndex=106, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=106, endIndex=110, - required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="26CII", name='FAMILY_CAP', type='number', startIndex=110, endIndex=111, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=111, endIndex=112, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26CIV", name='OTHER_NON_SANCTION', type='number', startIndex=112, endIndex=113, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', type='string', startIndex=113, endIndex=114, - required=False, validators=[ - validators.or_validators(validators.matches('9'), validators.isEmpty()), - validators.isAlphaNumeric(), - ]), - Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', type='number', startIndex=114, endIndex=116, - required=True, validators=[ - validators.oneOf([1, 2, 3, 4, - 6, 7, 8, 9]) - ]), - Field(item="29", name='FAMILY_NEW_CHILD', type='number', startIndex=116, endIndex=117, - required=False, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="-1", name='BLANK', type='string', startIndex=117, endIndex=156, required=False, - validators=[]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + type="string", + startIndex=19, + endIndex=22, + required=True, + validators=[ + validators.isNumber(), + ], + ), + Field( + item="5", + name="STRATUM", + type="string", + startIndex=22, + endIndex=24, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="7", + name="ZIP_CODE", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[ + validators.isNumber(), + ], + ), + Field( + item="8", + name="FUNDING_STREAM", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="9", + name="DISPOSITION", + type="number", + startIndex=30, + endIndex=31, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="10", + name="NEW_APPLICANT", + type="number", + startIndex=31, + endIndex=32, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="11", + name="NBR_FAMILY_MEMBERS", + type="number", + startIndex=32, + endIndex=34, + required=True, + validators=[ + validators.isLargerThan(0), + ], + ), + Field( + item="12", + name="FAMILY_TYPE", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="13", + name="RECEIVES_SUB_HOUSING", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="14", + name="RECEIVES_MED_ASSISTANCE", + type="number", + startIndex=36, + endIndex=37, + required=True, + validators=[ + validators.isInLimits(1, 2), + ], + ), + Field( + item="15", + name="RECEIVES_FOOD_STAMPS", + type="number", + startIndex=37, + endIndex=38, + required=False, + validators=[ + validators.isInLimits(0, 2), + ], + ), + Field( + item="16", + name="AMT_FOOD_STAMP_ASSISTANCE", + type="number", + startIndex=38, + endIndex=42, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="17", + name="RECEIVES_SUB_CC", + type="number", + startIndex=42, + endIndex=43, + required=False, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="18", + name="AMT_SUB_CC", + type="number", + startIndex=43, + endIndex=47, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="19", + name="CHILD_SUPPORT_AMT", + type="number", + startIndex=47, + endIndex=51, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="20", + name="FAMILY_CASH_RESOURCES", + type="number", + startIndex=51, + endIndex=55, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="21A", + name="CASH_AMOUNT", + type="number", + startIndex=55, + endIndex=59, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="21B", + name="NBR_MONTHS", + type="number", + startIndex=59, + endIndex=62, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="22A", + name="CC_AMOUNT", + type="number", + startIndex=62, + endIndex=66, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="22B", + name="CHILDREN_COVERED", + type="number", + startIndex=66, + endIndex=68, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="22C", + name="CC_NBR_MONTHS", + type="number", + startIndex=68, + endIndex=71, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="23A", + name="TRANSP_AMOUNT", + type="number", + startIndex=71, + endIndex=75, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="23B", + name="TRANSP_NBR_MONTHS", + type="number", + startIndex=75, + endIndex=78, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="24A", + name="TRANSITION_SERVICES_AMOUNT", + type="number", + startIndex=78, + endIndex=82, + required=False, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="24B", + name="TRANSITION_NBR_MONTHS", + type="number", + startIndex=82, + endIndex=85, + required=False, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="25A", + name="OTHER_AMOUNT", + type="number", + startIndex=85, + endIndex=89, + required=False, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="25B", + name="OTHER_NBR_MONTHS", + type="number", + startIndex=89, + endIndex=92, + required=False, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26AI", + name="SANC_REDUCTION_AMT", + type="number", + startIndex=92, + endIndex=96, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26AII", + name="WORK_REQ_SANCTION", + type="number", + startIndex=96, + endIndex=97, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AIII", + name="FAMILY_SANC_ADULT", + type="number", + startIndex=97, + endIndex=98, + required=False, + validators=[ + validators.oneOf([0, 1, 2]), + ], + ), + Field( + item="26AIV", + name="SANC_TEEN_PARENT", + type="number", + startIndex=98, + endIndex=99, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AV", + name="NON_COOPERATION_CSE", + type="number", + startIndex=99, + endIndex=100, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AVI", + name="FAILURE_TO_COMPLY", + type="number", + startIndex=100, + endIndex=101, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AVII", + name="OTHER_SANCTION", + type="number", + startIndex=101, + endIndex=102, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26B", + name="RECOUPMENT_PRIOR_OVRPMT", + type="number", + startIndex=102, + endIndex=106, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26CI", + name="OTHER_TOTAL_REDUCTIONS", + type="number", + startIndex=106, + endIndex=110, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="26CII", + name="FAMILY_CAP", + type="number", + startIndex=110, + endIndex=111, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26CIII", + name="REDUCTIONS_ON_RECEIPTS", + type="number", + startIndex=111, + endIndex=112, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26CIV", + name="OTHER_NON_SANCTION", + type="number", + startIndex=112, + endIndex=113, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="27", + name="WAIVER_EVAL_CONTROL_GRPS", + type="string", + startIndex=113, + endIndex=114, + required=False, + validators=[ + validators.or_validators( + validators.matches("9"), validators.isEmpty() + ), + validators.isAlphaNumeric(), + ], + ), + Field( + item="28", + name="FAMILY_EXEMPT_TIME_LIMITS", + type="number", + startIndex=114, + endIndex=116, + required=True, + validators=[validators.oneOf([1, 2, 3, 4, 6, 7, 8, 9])], + ), + Field( + item="29", + name="FAMILY_NEW_CHILD", + type="number", + startIndex=116, + endIndex=117, + required=False, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="-1", + name="BLANK", + type="string", + startIndex=117, + endIndex=156, + required=False, + validators=[], + ), ], - )] + ) + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 1f2088b38..89cc794d8 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -9,235 +9,878 @@ from tdpservice.search_indexes.models.tanf import TANF_T2 -t2 = SchemaManager(schemas=[ - RowSchema( - model=TANF_T2, - preparsing_validators=[ - validators.hasLength(156), - ], - postparsing_validators=[ +t2 = SchemaManager( + schemas=[ + RowSchema( + model=TANF_T2, + preparsing_validators=[ + validators.hasLength(156), + ], + postparsing_validators=[ validators.validate__FAM_AFF__SSN(), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="MARITAL_STATUS", + result_function=validators.isInLimits(1, 5), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), - result_field='PARENT_WITH_MINOR_CHILD', result_function=validators.isInLimits(1, 3), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 2), + result_field="PARENT_WITH_MINOR_CHILD", + result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EDUCATION_LEVEL', result_function=validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EDUCATION_LEVEL", + result_function=validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), ), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='COOPERATION_CHILD_SUPPORT', result_function=validators.oneOf((1, 2, 9)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="COOPERATION_CHILD_SUPPORT", + result_function=validators.oneOf((1, 2, 9)), + ), validators.validate__FAM_AFF__HOH__Fed_Time(), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EMPLOYMENT_STATUS', result_function=validators.isInLimits(1, 3), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EMPLOYMENT_STATUS", + result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_ELIGIBLE_INDICATOR', result_function=validators.or_validators( - validators.isInStringRange(1, 9), - validators.oneOf(('11', '12')) - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="WORK_ELIGIBLE_INDICATOR", + result_function=validators.or_validators( + validators.isInStringRange(1, 9), validators.oneOf(("11", "12")) ), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_PART_STATUS', result_function=validators.oneOf(['01', '02', '05', '07', '09', - '15', '17', '18', '19', '99'] - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="WORK_PART_STATUS", + result_function=validators.oneOf( + ["01", "02", "05", "07", "09", "15", "17", "18", "19", "99"] ), + ), validators.if_then_validator( - condition_field='WORK_ELIGIBLE_INDICATOR', condition_function=validators.isInStringRange(1, 5), - result_field='WORK_PART_STATUS', result_function=validators.notMatches('99'), - ), + condition_field="WORK_ELIGIBLE_INDICATOR", + condition_function=validators.isInStringRange(1, 5), + result_field="WORK_PART_STATUS", + result_function=validators.notMatches("99"), + ), + ], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="30", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 3, 5])], + ), + Field( + item="31", + name="NONCUSTODIAL_PARENT", + type="number", + startIndex=20, + endIndex=21, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="32", + name="DATE_OF_BIRTH", + type="number", + startIndex=21, + endIndex=29, + required=True, + validators=[ + validators.isLargerThan(0), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="33", + name="SSN", + type="string", + startIndex=29, + endIndex=38, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="34A", + name="RACE_HISPANIC", + type="number", + startIndex=38, + endIndex=39, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=39, + endIndex=40, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34C", + name="RACE_ASIAN", + type="number", + startIndex=40, + endIndex=41, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34D", + name="RACE_BLACK", + type="number", + startIndex=41, + endIndex=42, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34E", + name="RACE_HAWAIIAN", + type="number", + startIndex=42, + endIndex=43, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34F", + name="RACE_WHITE", + type="number", + startIndex=43, + endIndex=44, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="35", + name="GENDER", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="36A", + name="FED_OASDI_PROGRAM", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="36B", + name="FED_DISABILITY_STATUS", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="36C", + name="DISABLED_TITLE_XIVAPDT", + type="string", + startIndex=47, + endIndex=48, + required=True, + validators=[ + validators.or_validators( + validators.oneOf(["1", "2"]), validators.isBlank() + ) + ], + ), + Field( + item="36D", + name="AID_AGED_BLIND", + type="number", + startIndex=48, + endIndex=49, + required=False, + validators=[ + validators.isLargerThanOrEqualTo(0), + ], + ), + Field( + item="36E", + name="RECEIVE_SSI", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="37", + name="MARITAL_STATUS", + type="number", + startIndex=50, + endIndex=51, + required=False, + validators=[ + validators.isInLimits(0, 5), + ], + ), + Field( + item="38", + name="RELATIONSHIP_HOH", + type="string", + startIndex=51, + endIndex=53, + required=True, + validators=[ + validators.isInStringRange(1, 10), + ], + ), + Field( + item="39", + name="PARENT_WITH_MINOR_CHILD", + type="number", + startIndex=53, + endIndex=54, + required=False, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="40", + name="NEEDS_PREGNANT_WOMAN", + type="number", + startIndex=54, + endIndex=55, + required=False, + validators=[ + validators.isInLimits(0, 9), + ], + ), + Field( + item="41", + name="EDUCATION_LEVEL", + type="string", + startIndex=55, + endIndex=57, + required=False, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="42", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=57, + endIndex=58, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="43", + name="COOPERATION_CHILD_SUPPORT", + type="number", + startIndex=58, + endIndex=59, + required=False, + validators=[ + validators.oneOf([0, 1, 2, 9]), + ], + ), + Field( + item="44", + name="MONTHS_FED_TIME_LIMIT", + type="string", + startIndex=59, + endIndex=62, + required=False, + validators=[ + validators.isInStringRange(0, 999), + ], + ), + Field( + item="45", + name="MONTHS_STATE_TIME_LIMIT", + type="string", + startIndex=62, + endIndex=64, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="46", + name="CURRENT_MONTH_STATE_EXEMPT", + type="number", + startIndex=64, + endIndex=65, + required=False, + validators=[ + validators.isInLimits(0, 9), + ], + ), + Field( + item="47", + name="EMPLOYMENT_STATUS", + type="number", + startIndex=65, + endIndex=66, + required=False, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="48", + name="WORK_ELIGIBLE_INDICATOR", + type="string", + startIndex=66, + endIndex=68, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 9), + validators.oneOf(("11", "12")), + ) + ], + ), + Field( + item="49", + name="WORK_PART_STATUS", + type="string", + startIndex=68, + endIndex=70, + required=False, + validators=[ + validators.oneOf( + [ + "01", + "02", + "05", + "07", + "09", + "15", + "16", + "17", + "18", + "19", + "99", + ] + ) + ], + ), + Field( + item="50", + name="UNSUB_EMPLOYMENT", + type="string", + startIndex=70, + endIndex=72, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="51", + name="SUB_PRIVATE_EMPLOYMENT", + type="string", + startIndex=72, + endIndex=74, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="52", + name="SUB_PUBLIC_EMPLOYMENT", + type="string", + startIndex=74, + endIndex=76, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53A", + name="WORK_EXPERIENCE_HOP", + type="string", + startIndex=76, + endIndex=78, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53B", + name="WORK_EXPERIENCE_EA", + type="string", + startIndex=78, + endIndex=80, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53C", + name="WORK_EXPERIENCE_HOL", + type="string", + startIndex=80, + endIndex=82, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="54", + name="OJT", + type="string", + startIndex=82, + endIndex=84, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55A", + name="JOB_SEARCH_HOP", + type="string", + startIndex=84, + endIndex=86, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55B", + name="JOB_SEARCH_EA", + type="string", + startIndex=86, + endIndex=88, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55C", + name="JOB_SEARCH_HOL", + type="string", + startIndex=88, + endIndex=90, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56A", + name="COMM_SERVICES_HOP", + type="string", + startIndex=90, + endIndex=92, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56B", + name="COMM_SERVICES_EA", + type="string", + startIndex=92, + endIndex=94, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56C", + name="COMM_SERVICES_HOL", + type="string", + startIndex=94, + endIndex=96, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57A", + name="VOCATIONAL_ED_TRAINING_HOP", + type="string", + startIndex=96, + endIndex=98, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57B", + name="VOCATIONAL_ED_TRAINING_EA", + type="string", + startIndex=98, + endIndex=100, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57C", + name="VOCATIONAL_ED_TRAINING_HOL", + type="string", + startIndex=100, + endIndex=102, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58A", + name="JOB_SKILLS_TRAINING_HOP", + type="string", + startIndex=102, + endIndex=104, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58B", + name="JOB_SKILLS_TRAINING_EA", + type="string", + startIndex=104, + endIndex=106, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58C", + name="JOB_SKILLS_TRAINING_HOL", + type="string", + startIndex=106, + endIndex=108, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59A", + name="ED_NO_HIGH_SCHOOL_DIPL_HOP", + type="string", + startIndex=108, + endIndex=110, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59B", + name="ED_NO_HIGH_SCHOOL_DIPL_EA", + type="string", + startIndex=110, + endIndex=112, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59C", + name="ED_NO_HIGH_SCHOOL_DIPL_HOL", + type="string", + startIndex=112, + endIndex=114, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60A", + name="SCHOOL_ATTENDENCE_HOP", + type="string", + startIndex=114, + endIndex=116, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60B", + name="SCHOOL_ATTENDENCE_EA", + type="string", + startIndex=116, + endIndex=118, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60C", + name="SCHOOL_ATTENDENCE_HOL", + type="string", + startIndex=118, + endIndex=120, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61A", + name="PROVIDE_CC_HOP", + type="string", + startIndex=120, + endIndex=122, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61B", + name="PROVIDE_CC_EA", + type="string", + startIndex=122, + endIndex=124, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61C", + name="PROVIDE_CC_HOL", + type="string", + startIndex=124, + endIndex=126, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="62", + name="OTHER_WORK_ACTIVITIES", + type="string", + startIndex=126, + endIndex=128, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="63", + name="DEEMED_HOURS_FOR_OVERALL", + type="string", + startIndex=128, + endIndex=130, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="64", + name="DEEMED_HOURS_FOR_TWO_PARENT", + type="string", + startIndex=130, + endIndex=132, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="65", + name="EARNED_INCOME", + type="string", + startIndex=132, + endIndex=136, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66A", + name="UNEARNED_INCOME_TAX_CREDIT", + type="string", + startIndex=136, + endIndex=140, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66B", + name="UNEARNED_SOCIAL_SECURITY", + type="string", + startIndex=140, + endIndex=144, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66C", + name="UNEARNED_SSI", + type="string", + startIndex=144, + endIndex=148, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66D", + name="UNEARNED_WORKERS_COMP", + type="string", + startIndex=148, + endIndex=152, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="66E", + name="OTHER_UNEARNED_INCOME", + type="string", + startIndex=152, + endIndex=156, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[validators.oneOf([1, 2, 3, 5])]), - Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, - validators=[validators.isLargerThan(0),]), - TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, - endIndex=38, required=True, - validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, - validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, - validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), - Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, - validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, - validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, - validators=[validators.isInLimits(0, 5),]), - Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, - validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=False, - validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=False, - validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, - validators=[validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - )]), - Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, - validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - required=False, validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=False, - validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, - required=False, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, - validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', startIndex=66, endIndex=68, required=True, - validators=[validators.or_validators(validators.isInStringRange(0, 9), - validators.oneOf(('11', '12')) - )]), - Field(item="49", name='WORK_PART_STATUS', type='string', startIndex=68, endIndex=70, required=False, - validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), - Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=74, endIndex=76, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', startIndex=76, endIndex=78, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', startIndex=78, endIndex=80, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', startIndex=80, endIndex=82, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, - required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, - required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=True, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=148, endIndex=152, required=True, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=152, endIndex=156, required=True, - validators=[validators.isInStringRange(0, 9999),]), - ], - )] + ) + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index 66daa1e59..787828473 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -16,124 +16,278 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RELATIONSHIP_HOH", + result_function=validators.isInStringRange(4, 9), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="PARENT_MINOR_CHILD", + result_function=validators.oneOf((2, 3)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="EDUCATION_LEVEL", + result_function=validators.notMatches("99"), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), - ), - ], + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(2), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2, 9)), + ), + ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=20, endIndex=28, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=28, - endIndex=37, required=True, validators=[validators.validateSSN()], - is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, - required=False, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - required=False, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, - required=False, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, - required=False, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, - required=False, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, - required=False, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', type='number', startIndex=43, endIndex=44, - required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=44, endIndex=45, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=46, endIndex=48, - required=False, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, - required=False, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=49, endIndex=51, - required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ) - ]), - Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, - required=False, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=52, endIndex=56, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=56, endIndex=60, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="67", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 4])], + ), + Field( + item="68", + name="DATE_OF_BIRTH", + type="number", + startIndex=20, + endIndex=28, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="69", + name="SSN", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="70A", + name="RACE_HISPANIC", + type="number", + startIndex=37, + endIndex=38, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=38, + endIndex=39, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70C", + name="RACE_ASIAN", + type="number", + startIndex=39, + endIndex=40, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70D", + name="RACE_BLACK", + type="number", + startIndex=40, + endIndex=41, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70E", + name="RACE_HAWAIIAN", + type="number", + startIndex=41, + endIndex=42, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70F", + name="RACE_WHITE", + type="number", + startIndex=42, + endIndex=43, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="71", + name="GENDER", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="72A", + name="RECEIVE_NONSSA_BENEFITS", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="72B", + name="RECEIVE_SSI", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="73", + name="RELATIONSHIP_HOH", + type="string", + startIndex=46, + endIndex=48, + required=False, + validators=[validators.isInStringRange(0, 10)], + ), + Field( + item="74", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=48, + endIndex=49, + required=False, + validators=[validators.oneOf([0, 2, 3])], + ), + Field( + item="75", + name="EDUCATION_LEVEL", + type="string", + startIndex=49, + endIndex=51, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="76", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=51, + endIndex=52, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="77A", + name="UNEARNED_SSI", + type="string", + startIndex=52, + endIndex=56, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="77B", + name="OTHER_UNEARNED_INCOME", + type="string", + startIndex=56, + endIndex=60, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), ], ) @@ -145,130 +299,278 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RELATIONSHIP_HOH", + result_function=validators.isInStringRange(4, 9), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="PARENT_MINOR_CHILD", + result_function=validators.oneOf((2, 3)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="EDUCATION_LEVEL", + result_function=validators.notMatches("99"), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), - ), - ], + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(2), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2, 9)), + ), + ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, - required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=61, endIndex=69, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=69, - endIndex=78, required=True, validators=[validators.validateSSN()], - is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, - required=False, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, - required=False, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, - required=False, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, - required=False, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, - required=False, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, - required=False, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', type='number', startIndex=84, endIndex=85, - required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=85, endIndex=86, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=87, endIndex=89, - required=False, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, - required=False, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=90, endIndex=92, - required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.oneOf(['98', '99']) - ) - ]), - Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, - required=False, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=93, endIndex=97, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=97, endIndex=101, - required=False, validators=[ - validators.isInStringRange(0, 9999) - ]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="67", + name="FAMILY_AFFILIATION", + type="number", + startIndex=60, + endIndex=61, + required=True, + validators=[validators.oneOf([1, 2, 4])], + ), + Field( + item="68", + name="DATE_OF_BIRTH", + type="number", + startIndex=61, + endIndex=69, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="69", + name="SSN", + type="string", + startIndex=69, + endIndex=78, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="70A", + name="RACE_HISPANIC", + type="number", + startIndex=78, + endIndex=79, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=79, + endIndex=80, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70C", + name="RACE_ASIAN", + type="number", + startIndex=80, + endIndex=81, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70D", + name="RACE_BLACK", + type="number", + startIndex=81, + endIndex=82, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70E", + name="RACE_HAWAIIAN", + type="number", + startIndex=82, + endIndex=83, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70F", + name="RACE_WHITE", + type="number", + startIndex=83, + endIndex=84, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="71", + name="GENDER", + type="number", + startIndex=84, + endIndex=85, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="72A", + name="RECEIVE_NONSSA_BENEFITS", + type="number", + startIndex=85, + endIndex=86, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="72B", + name="RECEIVE_SSI", + type="number", + startIndex=86, + endIndex=87, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="73", + name="RELATIONSHIP_HOH", + type="string", + startIndex=87, + endIndex=89, + required=False, + validators=[validators.isInStringRange(0, 10)], + ), + Field( + item="74", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=89, + endIndex=90, + required=False, + validators=[validators.oneOf([0, 2, 3])], + ), + Field( + item="75", + name="EDUCATION_LEVEL", + type="string", + startIndex=90, + endIndex=92, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), validators.oneOf(["98", "99"]) + ) + ], + ), + Field( + item="76", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=92, + endIndex=93, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="77A", + name="UNEARNED_SSI", + type="string", + startIndex=93, + endIndex=97, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="77B", + name="OTHER_UNEARNED_INCOME", + type="string", + startIndex=97, + endIndex=101, + required=False, + validators=[validators.isInStringRange(0, 9999)], + ), ], ) -t3 = SchemaManager( - schemas=[ - child_one, - child_two - ] -) +t3 = SchemaManager(schemas=[child_one, child_two]) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py index d09aaa0cd..8ba5f7d39 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py @@ -9,42 +9,139 @@ t4 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=TANF_T4, - preparsing_validators=[ - validators.hasLength(71), - ], - postparsing_validators=[], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, - required=True, validators=[validators.isInStringRange(1, 999)]), - Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, - required=True, validators=[validators.isInStringRange(0, 99)]), - Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, - required=True, validators=[]), - Field(item="8", name='DISPOSITION', type='number', startIndex=29, endIndex=30, - required=True, validators=[validators.oneOf([1, 2])]), - Field(item="9", name='CLOSURE_REASON', type='string', startIndex=30, endIndex=32, - required=True, validators=[validators.or_validators(validators.isInStringRange(1, 19), - validators.matches("99"))]), - Field(item="10", name='REC_SUB_HOUSING', type='number', startIndex=32, endIndex=33, - required=True, validators=[validators.isInLimits(1, 3)]), - Field(item="11", name='REC_MED_ASSIST', type='number', startIndex=33, endIndex=34, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="12", name='REC_FOOD_STAMPS', type='number', startIndex=34, endIndex=35, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="13", name='REC_SUB_CC', type='number', startIndex=35, endIndex=36, - required=True, validators=[validators.isInLimits(1, 3)]), - Field(item="14", name='BLANK', type='string', startIndex=36, endIndex=71, required=False, validators=[]), - ], + model=TANF_T4, + preparsing_validators=[ + validators.hasLength(71), + ], + postparsing_validators=[], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + type="string", + startIndex=19, + endIndex=22, + required=True, + validators=[validators.isInStringRange(1, 999)], + ), + Field( + item="5", + name="STRATUM", + type="string", + startIndex=22, + endIndex=24, + required=True, + validators=[validators.isInStringRange(0, 99)], + ), + Field( + item="7", + name="ZIP_CODE", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[], + ), + Field( + item="8", + name="DISPOSITION", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="9", + name="CLOSURE_REASON", + type="string", + startIndex=30, + endIndex=32, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(1, 19), validators.matches("99") + ) + ], + ), + Field( + item="10", + name="REC_SUB_HOUSING", + type="number", + startIndex=32, + endIndex=33, + required=True, + validators=[validators.isInLimits(1, 3)], + ), + Field( + item="11", + name="REC_MED_ASSIST", + type="number", + startIndex=33, + endIndex=34, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="12", + name="REC_FOOD_STAMPS", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="13", + name="REC_SUB_CC", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[validators.isInLimits(1, 3)], + ), + Field( + item="14", + name="BLANK", + type="string", + startIndex=36, + endIndex=71, + required=False, + validators=[], + ), + ], ) - ] - ) + ] +) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 43c97225f..90047ec9a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -10,135 +10,374 @@ t5 = SchemaManager( - schemas=[ + schemas=[ RowSchema( - model=TANF_T5, - preparsing_validators=[ - validators.hasLength(71), - ], - postparsing_validators=[ - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN() - ), - validators.validate__FAM_AFF__SSN(), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), - result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EDUCATION_LEVEL', result_function=validators.or_validators( - validators.isInStringRange(1, 16), - validators.isInStringRange(98, 99) - ) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.isInLimits(1, 2) - ), - validators.validate__FAM_AFF__HOH__Count_Fed_Time(), - validators.if_then_validator( - condition_field='DATE_OF_BIRTH', condition_function=validators.olderThan(18), - result_field='REC_OASDI_INSURANCE', result_function=validators.isInLimits(1, 2) - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='REC_FEDERAL_DISABILITY', result_function=validators.isInLimits(1, 2) - ), - ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="14", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[validators.isInLimits(1, 5)]), - Field(item="15", name='DATE_OF_BIRTH', type='number', startIndex=20, endIndex=28, - required=True, validators=[validators.isLargerThan(0)]), - TransformField(transform_func=tanf_ssn_decryption_func, item="16", name='SSN', type='string', - startIndex=28, endIndex=37, required=True, validators=[validators.isNumber()], - is_encrypted=False), - Field(item="17A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, - required=True, validators=[validators.validateRace()]), - Field(item="17B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - required=True, validators=[validators.validateRace()]), - Field(item="17C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, - required=True, validators=[validators.validateRace()]), - Field(item="17D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, - required=True, validators=[validators.validateRace()]), - Field(item="17E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, - required=True, validators=[validators.validateRace()]), - Field(item="17F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, - required=True, validators=[validators.validateRace()]), - Field(item="18", name='GENDER', type='number', startIndex=43, endIndex=44, - required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="19A", name='REC_OASDI_INSURANCE', type='number', startIndex=44, endIndex=45, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19B", name='REC_FEDERAL_DISABILITY', type='number', startIndex=45, endIndex=46, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="19C", name='REC_AID_TOTALLY_DISABLED', type='number', startIndex=46, endIndex=47, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19D", name='REC_AID_AGED_BLIND', type='number', startIndex=47, endIndex=48, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="19E", name='REC_SSI', type='number', startIndex=48, endIndex=49, - required=True, validators=[validators.isInLimits(1, 2)]), - Field(item="20", name='MARITAL_STATUS', type='number', startIndex=49, endIndex=50, - required=True, validators=[validators.isInLimits(0, 5)]), - Field(item="21", name='RELATIONSHIP_HOH', type='string', startIndex=50, endIndex=52, - required=True, validators=[validators.isInStringRange(1, 10)]), - Field(item="22", name='PARENT_MINOR_CHILD', type='number', startIndex=52, endIndex=53, - required=True, validators=[validators.isInLimits(0, 2)]), - Field(item="23", name='NEEDS_OF_PREGNANT_WOMAN', type='number', startIndex=53, endIndex=54, - required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="24", name='EDUCATION_LEVEL', type='string', startIndex=54, endIndex=56, - required=True, validators=[validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99))]), - Field(item="25", name='CITIZENSHIP_STATUS', type='number', startIndex=56, endIndex=57, - required=True, validators=[validators.or_validators(validators.isInLimits(0, 2), - validators.matches(9))]), - Field(item="26", name='COUNTABLE_MONTH_FED_TIME', type='string', startIndex=57, endIndex=60, - required=True, validators=[validators.isInStringRange(0, 999)]), - Field(item="27", name='COUNTABLE_MONTHS_STATE_TRIBE', type='string', startIndex=60, endIndex=62, - required=True, validators=[validators.isInStringRange(0, 99)]), - Field(item="28", name='EMPLOYMENT_STATUS', type='number', startIndex=62, endIndex=63, - required=True, validators=[validators.isInLimits(0, 3)]), - Field(item="29", name='AMOUNT_EARNED_INCOME', type='string', startIndex=63, endIndex=67, - required=True, validators=[validators.isInStringRange(0, 9999)]), - Field(item="30", name='AMOUNT_UNEARNED_INCOME', type='string', startIndex=67, endIndex=71, - required=True, validators=[validators.isInStringRange(0, 9999)]), - ], + model=TANF_T5, + preparsing_validators=[ + validators.hasLength(71), + ], + postparsing_validators=[ + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), + validators.validate__FAM_AFF__SSN(), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="MARITAL_STATUS", + result_function=validators.isInLimits(1, 5), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 2), + result_field="PARENT_MINOR_CHILD", + result_function=validators.isInLimits(1, 3), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EDUCATION_LEVEL", + result_function=validators.or_validators( + validators.isInStringRange(1, 16), + validators.isInStringRange(98, 99), + ), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.isInLimits(1, 2), + ), + validators.validate__FAM_AFF__HOH__Count_Fed_Time(), + validators.if_then_validator( + condition_field="DATE_OF_BIRTH", + condition_function=validators.olderThan(18), + result_field="REC_OASDI_INSURANCE", + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="REC_FEDERAL_DISABILITY", + result_function=validators.isInLimits(1, 2), + ), + ], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="14", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.isInLimits(1, 5)], + ), + Field( + item="15", + name="DATE_OF_BIRTH", + type="number", + startIndex=20, + endIndex=28, + required=True, + validators=[validators.isLargerThan(0)], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="16", + name="SSN", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[validators.isNumber()], + is_encrypted=False, + ), + Field( + item="17A", + name="RACE_HISPANIC", + type="number", + startIndex=37, + endIndex=38, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=38, + endIndex=39, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17C", + name="RACE_ASIAN", + type="number", + startIndex=39, + endIndex=40, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17D", + name="RACE_BLACK", + type="number", + startIndex=40, + endIndex=41, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17E", + name="RACE_HAWAIIAN", + type="number", + startIndex=41, + endIndex=42, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="17F", + name="RACE_WHITE", + type="number", + startIndex=42, + endIndex=43, + required=True, + validators=[validators.validateRace()], + ), + Field( + item="18", + name="GENDER", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="19A", + name="REC_OASDI_INSURANCE", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="19B", + name="REC_FEDERAL_DISABILITY", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="19C", + name="REC_AID_TOTALLY_DISABLED", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="19D", + name="REC_AID_AGED_BLIND", + type="number", + startIndex=47, + endIndex=48, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="19E", + name="REC_SSI", + type="number", + startIndex=48, + endIndex=49, + required=True, + validators=[validators.isInLimits(1, 2)], + ), + Field( + item="20", + name="MARITAL_STATUS", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[validators.isInLimits(0, 5)], + ), + Field( + item="21", + name="RELATIONSHIP_HOH", + type="string", + startIndex=50, + endIndex=52, + required=True, + validators=[validators.isInStringRange(1, 10)], + ), + Field( + item="22", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=52, + endIndex=53, + required=True, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="23", + name="NEEDS_OF_PREGNANT_WOMAN", + type="number", + startIndex=53, + endIndex=54, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="24", + name="EDUCATION_LEVEL", + type="string", + startIndex=54, + endIndex=56, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="25", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=56, + endIndex=57, + required=True, + validators=[ + validators.or_validators( + validators.isInLimits(0, 2), validators.matches(9) + ) + ], + ), + Field( + item="26", + name="COUNTABLE_MONTH_FED_TIME", + type="string", + startIndex=57, + endIndex=60, + required=True, + validators=[validators.isInStringRange(0, 999)], + ), + Field( + item="27", + name="COUNTABLE_MONTHS_STATE_TRIBE", + type="string", + startIndex=60, + endIndex=62, + required=True, + validators=[validators.isInStringRange(0, 99)], + ), + Field( + item="28", + name="EMPLOYMENT_STATUS", + type="number", + startIndex=62, + endIndex=63, + required=True, + validators=[validators.isInLimits(0, 3)], + ), + Field( + item="29", + name="AMOUNT_EARNED_INCOME", + type="string", + startIndex=63, + endIndex=67, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="30", + name="AMOUNT_UNEARNED_INCOME", + type="string", + startIndex=67, + endIndex=71, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), + ], ) - ] + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index 8140322c2..c99db03e0 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -16,48 +16,183 @@ ], postparsing_validators=[ validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), - validators.sumIsEqual("NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), - validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), + validators.sumIsEqual( + "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", 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="4", name='RPT_MONTH_YEAR', type='number', - startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="4A", name='NUM_APPLICATIONS', type='number', startIndex=7, endIndex=15, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5A", name='NUM_APPROVED', type='number', startIndex=31, endIndex=39, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6A", name='NUM_DENIED', type='number', startIndex=55, endIndex=63, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7A", name='ASSISTANCE', type='number', startIndex=79, endIndex=91, - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8A", name='NUM_FAMILIES', type='number', startIndex=115, endIndex=123, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9A", name='NUM_2_PARENTS', type='number', startIndex=139, endIndex=147, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10A", name='NUM_1_PARENTS', type='number', startIndex=163, endIndex=171, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11A", name='NUM_NO_PARENTS', type='number', startIndex=187, endIndex=195, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12A", name='NUM_RECIPIENTS', type='number', startIndex=211, endIndex=219, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13A", name='NUM_ADULT_RECIPIENTS', type='number', startIndex=235, endIndex=243, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14A", name='NUM_CHILD_RECIPIENTS', type='number', startIndex=259, endIndex=267, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15A", name='NUM_NONCUSTODIALS', type='number', startIndex=283, endIndex=291, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16A", name='NUM_BIRTHS', type='number', startIndex=307, endIndex=315, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17A", name='NUM_OUTWEDLOCK_BIRTHS', type='number', startIndex=331, endIndex=339, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18A", name='NUM_CLOSED_CASES', type='number', startIndex=355, endIndex=363, - required=True, validators=[validators.isInLimits(0, 99999999)]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + 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="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="4A", + name="NUM_APPLICATIONS", + type="number", + startIndex=7, + endIndex=15, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="5A", + name="NUM_APPROVED", + type="number", + startIndex=31, + endIndex=39, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="6A", + name="NUM_DENIED", + type="number", + startIndex=55, + endIndex=63, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="7A", + name="ASSISTANCE", + type="number", + startIndex=79, + endIndex=91, + required=True, + validators=[validators.isInLimits(0, 999999999999)], + ), + Field( + item="8A", + name="NUM_FAMILIES", + type="number", + startIndex=115, + endIndex=123, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="9A", + name="NUM_2_PARENTS", + type="number", + startIndex=139, + endIndex=147, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="10A", + name="NUM_1_PARENTS", + type="number", + startIndex=163, + endIndex=171, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="11A", + name="NUM_NO_PARENTS", + type="number", + startIndex=187, + endIndex=195, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="12A", + name="NUM_RECIPIENTS", + type="number", + startIndex=211, + endIndex=219, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="13A", + name="NUM_ADULT_RECIPIENTS", + type="number", + startIndex=235, + endIndex=243, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="14A", + name="NUM_CHILD_RECIPIENTS", + type="number", + startIndex=259, + endIndex=267, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="15A", + name="NUM_NONCUSTODIALS", + type="number", + startIndex=283, + endIndex=291, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="16A", + name="NUM_BIRTHS", + type="number", + startIndex=307, + endIndex=315, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="17A", + name="NUM_OUTWEDLOCK_BIRTHS", + type="number", + startIndex=331, + endIndex=339, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="18A", + name="NUM_CLOSED_CASES", + type="number", + startIndex=355, + endIndex=363, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), ], ) @@ -68,46 +203,177 @@ ], postparsing_validators=[ validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), - validators.sumIsEqual("NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), - validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), + validators.sumIsEqual( + "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, - required=True, validators=[]), - TransformField(calendar_quarter_to_rpt_month_year(1), item="4", name='RPT_MONTH_YEAR', type='number', - startIndex=2, endIndex=7, required=True, validators=[]), - Field(item="4B", name='NUM_APPLICATIONS', type='number', startIndex=15, endIndex=23, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5B", name='NUM_APPROVED', type='number', startIndex=39, endIndex=47, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6B", name='NUM_DENIED', type='number', startIndex=63, endIndex=71, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7B", name='ASSISTANCE', type='number', startIndex=91, endIndex=103, - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8B", name='NUM_FAMILIES', type='number', startIndex=123, endIndex=131, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9B", name='NUM_2_PARENTS', type='number', startIndex=147, endIndex=155, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10B", name='NUM_1_PARENTS', type='number', startIndex=171, endIndex=179, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11B", name='NUM_NO_PARENTS', type='number', startIndex=195, endIndex=203, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12B", name='NUM_RECIPIENTS', type='number', startIndex=219, endIndex=227, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13B", name='NUM_ADULT_RECIPIENTS', type='number', startIndex=243, endIndex=251, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14B", name='NUM_CHILD_RECIPIENTS', type='number', startIndex=267, endIndex=275, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15B", name='NUM_NONCUSTODIALS', type='number', startIndex=291, endIndex=299, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16B", name='NUM_BIRTHS', type='number', startIndex=315, endIndex=323, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17B", name='NUM_OUTWEDLOCK_BIRTHS', type='number', startIndex=339, endIndex=347, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18B", name='NUM_CLOSED_CASES', type='number', startIndex=363, endIndex=371, - required=True, validators=[validators.isInLimits(0, 99999999)]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="CALENDAR_QUARTER", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[], + ), + TransformField( + calendar_quarter_to_rpt_month_year(1), + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[], + ), + Field( + item="4B", + name="NUM_APPLICATIONS", + type="number", + startIndex=15, + endIndex=23, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="5B", + name="NUM_APPROVED", + type="number", + startIndex=39, + endIndex=47, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="6B", + name="NUM_DENIED", + type="number", + startIndex=63, + endIndex=71, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="7B", + name="ASSISTANCE", + type="number", + startIndex=91, + endIndex=103, + required=True, + validators=[validators.isInLimits(0, 999999999999)], + ), + Field( + item="8B", + name="NUM_FAMILIES", + type="number", + startIndex=123, + endIndex=131, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="9B", + name="NUM_2_PARENTS", + type="number", + startIndex=147, + endIndex=155, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="10B", + name="NUM_1_PARENTS", + type="number", + startIndex=171, + endIndex=179, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="11B", + name="NUM_NO_PARENTS", + type="number", + startIndex=195, + endIndex=203, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="12B", + name="NUM_RECIPIENTS", + type="number", + startIndex=219, + endIndex=227, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="13B", + name="NUM_ADULT_RECIPIENTS", + type="number", + startIndex=243, + endIndex=251, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="14B", + name="NUM_CHILD_RECIPIENTS", + type="number", + startIndex=267, + endIndex=275, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="15B", + name="NUM_NONCUSTODIALS", + type="number", + startIndex=291, + endIndex=299, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="16B", + name="NUM_BIRTHS", + type="number", + startIndex=315, + endIndex=323, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="17B", + name="NUM_OUTWEDLOCK_BIRTHS", + type="number", + startIndex=339, + endIndex=347, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="18B", + name="NUM_CLOSED_CASES", + type="number", + startIndex=363, + endIndex=371, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), ], ) @@ -118,54 +384,179 @@ ], postparsing_validators=[ validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), - validators.sumIsEqual("NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), - validators.sumIsEqual("NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"]), + validators.sumIsEqual( + "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, - required=True, validators=[]), - TransformField(calendar_quarter_to_rpt_month_year(2), item="4", name='RPT_MONTH_YEAR', type='number', - startIndex=2, endIndex=7, required=True, validators=[]), - Field(item="4C", name='NUM_APPLICATIONS', type='number', startIndex=23, endIndex=31, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5C", name='NUM_APPROVED', type='number', startIndex=47, endIndex=55, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6C", name='NUM_DENIED', type='number', startIndex=71, endIndex=79, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7C", name='ASSISTANCE', type='number', startIndex=103, endIndex=115, - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="8C", name='NUM_FAMILIES', type='number', startIndex=131, endIndex=139, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9C", name='NUM_2_PARENTS', type='number', startIndex=155, endIndex=163, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10C", name='NUM_1_PARENTS', type='number', startIndex=179, endIndex=187, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11C", name='NUM_NO_PARENTS', type='number', startIndex=203, endIndex=211, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="12C", name='NUM_RECIPIENTS', type='number', startIndex=227, endIndex=235, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="13C", name='NUM_ADULT_RECIPIENTS', type='number', startIndex=251, endIndex=259, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="14C", name='NUM_CHILD_RECIPIENTS', type='number', startIndex=275, endIndex=283, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="15C", name='NUM_NONCUSTODIALS', type='number', startIndex=299, endIndex=307, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="16C", name='NUM_BIRTHS', type='number', startIndex=323, endIndex=331, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="17C", name='NUM_OUTWEDLOCK_BIRTHS', type='number', startIndex=347, endIndex=355, - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="18C", name='NUM_CLOSED_CASES', type='number', startIndex=371, endIndex=379, - required=True, validators=[validators.isInLimits(0, 99999999)]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + name="CALENDAR_QUARTER", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[], + ), + TransformField( + calendar_quarter_to_rpt_month_year(2), + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[], + ), + Field( + item="4C", + name="NUM_APPLICATIONS", + type="number", + startIndex=23, + endIndex=31, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="5C", + name="NUM_APPROVED", + type="number", + startIndex=47, + endIndex=55, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="6C", + name="NUM_DENIED", + type="number", + startIndex=71, + endIndex=79, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="7C", + name="ASSISTANCE", + type="number", + startIndex=103, + endIndex=115, + required=True, + validators=[validators.isInLimits(0, 999999999999)], + ), + Field( + item="8C", + name="NUM_FAMILIES", + type="number", + startIndex=131, + endIndex=139, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="9C", + name="NUM_2_PARENTS", + type="number", + startIndex=155, + endIndex=163, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="10C", + name="NUM_1_PARENTS", + type="number", + startIndex=179, + endIndex=187, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="11C", + name="NUM_NO_PARENTS", + type="number", + startIndex=203, + endIndex=211, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="12C", + name="NUM_RECIPIENTS", + type="number", + startIndex=227, + endIndex=235, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="13C", + name="NUM_ADULT_RECIPIENTS", + type="number", + startIndex=251, + endIndex=259, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="14C", + name="NUM_CHILD_RECIPIENTS", + type="number", + startIndex=275, + endIndex=283, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="15C", + name="NUM_NONCUSTODIALS", + type="number", + startIndex=299, + endIndex=307, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="16C", + name="NUM_BIRTHS", + type="number", + startIndex=323, + endIndex=331, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="17C", + name="NUM_OUTWEDLOCK_BIRTHS", + type="number", + startIndex=347, + endIndex=355, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), + Field( + item="18C", + name="NUM_CLOSED_CASES", + type="number", + startIndex=371, + endIndex=379, + required=True, + validators=[validators.isInLimits(0, 99999999)], + ), ], ) -t6 = SchemaManager( - schemas=[ - s1, - s2, - s3 - ] - ) +t6 = SchemaManager(schemas=[s1, s2, s3]) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py index 2fcb4e0fd..fec8c567d 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py @@ -15,45 +15,82 @@ families_index = 10 for i in range(1, 31): month_index = (i - 1) % 3 - sub_item_labels = ['A', 'B', 'C'] + sub_item_labels = ["A", "B", "C"] families_value_item_number = f"6{sub_item_labels[month_index]}" schemas.append( - RowSchema( - model=TANF_T7, - quiet_preparser_errors=i > 1, - preparsing_validators=[ - validators.notEmpty(0, 7), - validators.notEmpty(validator_index, validator_index + 24), - ], - postparsing_validators=[], - fields=[ - Field(item="0", name="RecordType", type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="3", 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", - name='RPT_MONTH_YEAR', - type='number', - startIndex=2, - endIndex=7, - required=True, - validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid() - ] - ), - Field(item="4", name='TDRS_SECTION_IND', type='string', startIndex=section_ind_index, - endIndex=section_ind_index + 1, required=True, validators=[validators.oneOf(['1', '2'])]), - Field(item="5", 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', type='number', startIndex=families_index, - endIndex=families_index + 7, required=True, validators=[validators.isInLimits(0, 9999999)]), - ] - ) + RowSchema( + model=TANF_T7, + quiet_preparser_errors=i > 1, + preparsing_validators=[ + validators.notEmpty(0, 7), + validators.notEmpty(validator_index, validator_index + 24), + ], + postparsing_validators=[], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="3", + 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", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=7, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="4", + name="TDRS_SECTION_IND", + type="string", + startIndex=section_ind_index, + endIndex=section_ind_index + 1, + required=True, + validators=[validators.oneOf(["1", "2"])], + ), + Field( + item="5", + 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", + type="number", + startIndex=families_index, + endIndex=families_index + 7, + required=True, + validators=[validators.isInLimits(0, 9999999)], + ), + ], + ) ) index_offset = 0 if i % 3 != 0 else 24 diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py b/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py index 46a440508..d1ad29da7 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/trailer.py @@ -11,20 +11,38 @@ preparsing_validators=[ validators.hasLength( 23, - lambda value, length: f'Trailer length is {len(value)} but must be {length} characters.' + lambda value, length: f"Trailer length is {len(value)} but must be {length} characters.", ), - validators.startsWith('TRAILER') + validators.startsWith("TRAILER"), ], postparsing_validators=[], fields=[ - Field(item="1", name='title', type='string', startIndex=0, endIndex=7, required=True, validators=[ - validators.matches('TRAILER') - ]), - Field(item="2", name='record_count', type='number', startIndex=7, endIndex=14, required=True, validators=[ - validators.between(0, 9999999) - ]), - Field(item="-1", name='blank', type='string', startIndex=14, endIndex=23, required=False, validators=[ - validators.matches(' ') - ]), + Field( + item="1", + name="title", + type="string", + startIndex=0, + endIndex=7, + required=True, + validators=[validators.matches("TRAILER")], + ), + Field( + item="2", + name="record_count", + type="number", + startIndex=7, + endIndex=14, + required=True, + validators=[validators.between(0, 9999999)], + ), + Field( + item="-1", + name="blank", + type="string", + startIndex=14, + endIndex=23, + required=False, + validators=[validators.matches(" ")], + ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py index 15a9a5ea4..0c56a013e 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py @@ -7,252 +7,616 @@ from tdpservice.search_indexes.models.tribal import Tribal_TANF_T1 -t_t1 = SchemaManager(schemas=[ - RowSchema( +t_t1 = SchemaManager( + schemas=[ + RowSchema( model=Tribal_TANF_T1, preparsing_validators=[ - validators.hasLength(123), + validators.hasLength(123), ], postparsing_validators=[ - validators.if_then_validator( - condition_field='CASH_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CHILDREN_COVERED', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CC_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSP_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSP_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSITION_SERVICES_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSITION_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='OTHER_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='OTHER_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='WORK_REQ_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAMILY_SANC_ADULT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='SANC_TEEN_PARENT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='NON_COOPERATION_CSE', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAILURE_TO_COMPLY', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='OTHER_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='FAMILY_CAP', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='REDUCTIONS_ON_RECEIPTS', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='OTHER_NON_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.sumIsLarger(("AMT_FOOD_STAMP_ASSISTANCE", "AMT_SUB_CC", "CASH_AMOUNT", "CC_AMOUNT", - "TRANSP_AMOUNT", "TRANSITION_SERVICES_AMOUNT", "OTHER_AMOUNT"), 0) + validators.if_then_validator( + condition_field="CASH_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="CC_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="CHILDREN_COVERED", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="CC_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="CC_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="TRANSP_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="TRANSP_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="TRANSITION_SERVICES_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="TRANSITION_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="OTHER_AMOUNT", + condition_function=validators.isLargerThan(0), + result_field="OTHER_NBR_MONTHS", + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="WORK_REQ_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="FAMILY_SANC_ADULT", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="SANC_TEEN_PARENT", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="NON_COOPERATION_CSE", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="FAILURE_TO_COMPLY", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="SANC_REDUCTION_AMT", + condition_function=validators.isLargerThan(0), + result_field="OTHER_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="FAMILY_CAP", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="REDUCTIONS_ON_RECEIPTS", + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field="OTHER_TOTAL_REDUCTIONS", + condition_function=validators.isLargerThan(0), + result_field="OTHER_NON_SANCTION", + result_function=validators.oneOf((1, 2)), + ), + validators.sumIsLarger( + ( + "AMT_FOOD_STAMP_ASSISTANCE", + "AMT_SUB_CC", + "CASH_AMOUNT", + "CC_AMOUNT", + "TRANSP_AMOUNT", + "TRANSITION_SERVICES_AMOUNT", + "OTHER_AMOUNT", + ), + 0, + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, - required=False, validators=[ - validators.isNumber(), - ]), - Field(item="5", name='STRATUM', type='string', startIndex=22, endIndex=24, - required=False, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="7", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, - required=True, validators=[ - validators.isNumber(), - ]), - Field(item="8", name='FUNDING_STREAM', type='number', startIndex=29, endIndex=30, - required=True, validators=[ - validators.isInLimits(1, 2), - ]), - Field(item="9", name='DISPOSITION', type='number', startIndex=30, endIndex=31, - required=True, validators=[ - validators.oneOf([1]), - ]), - Field(item="10", name='NEW_APPLICANT', type='number', startIndex=31, endIndex=32, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="11", name='NBR_FAMILY_MEMBERS', type='number', startIndex=32, endIndex=34, - required=True, validators=[ - validators.isInLimits(1, 99), - ]), - Field(item="12", name='FAMILY_TYPE', type='number', startIndex=34, endIndex=35, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="13", name='RECEIVES_SUB_HOUSING', type='number', startIndex=35, endIndex=36, - required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="14", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=36, endIndex=37, - required=True, validators=[ - validators.isInLimits(1, 2), - ]), - Field(item="15", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=37, endIndex=38, - required=False, validators=[ - validators.isInLimits(0, 2), - ]), - Field(item="16", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=38, endIndex=42, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="17", name='RECEIVES_SUB_CC', type='number', startIndex=42, endIndex=43, - required=False, validators=[ - validators.isInLimits(0, 3), - ]), - Field(item="18", name='AMT_SUB_CC', type='number', startIndex=43, endIndex=47, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="19", name='CHILD_SUPPORT_AMT', type='number', startIndex=47, endIndex=51, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="20", name='FAMILY_CASH_RESOURCES', type='number', startIndex=51, endIndex=55, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="21A", name='CASH_AMOUNT', type='number', startIndex=55, endIndex=59, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="21B", name='NBR_MONTHS', type='number', startIndex=59, endIndex=62, - required=True, validators=[ - validators.isInLimits(0, 999), - ]), - Field(item="22A", name='CC_AMOUNT', type='number', startIndex=62, endIndex=66, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="22B", name='CHILDREN_COVERED', type='number', startIndex=66, endIndex=68, - required=True, validators=[ - validators.isInLimits(0, 99), - ]), - Field(item="22C", name='CC_NBR_MONTHS', type='number', startIndex=68, endIndex=71, - required=True, validators=[ - validators.isInLimits(0, 999), - ]), - Field(item="23A", name='TRANSP_AMOUNT', type='number', startIndex=71, endIndex=75, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="23B", name='TRANSP_NBR_MONTHS', type='number', startIndex=75, endIndex=78, - required=True, validators=[ - validators.isInLimits(0, 999), - ]), - Field(item="24A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=78, endIndex=82, - required=False, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="24B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=82, endIndex=85, - required=False, validators=[ - validators.isInLimits(0, 999), - ]), - Field(item="25A", name='OTHER_AMOUNT', type='number', startIndex=85, endIndex=89, - required=False, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="25B", name='OTHER_NBR_MONTHS', type='number', startIndex=89, endIndex=92, - required=False, validators=[ - validators.isInLimits(0, 999), - ]), - Field(item="26AI", name='SANC_REDUCTION_AMT', type='number', startIndex=92, endIndex=96, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="26AII", name='WORK_REQ_SANCTION', type='number', startIndex=96, endIndex=97, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=97, endIndex=98, - required=False, validators=[ - validators.oneOf([0, 1, 2]), - ]), - Field(item="26AIV", name='SANC_TEEN_PARENT', type='number', startIndex=98, endIndex=99, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AV", name='NON_COOPERATION_CSE', type='number', startIndex=99, endIndex=100, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=100, endIndex=101, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26AVII", name='OTHER_SANCTION', type='number', startIndex=101, endIndex=102, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=102, endIndex=106, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="26CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=106, endIndex=110, - required=True, validators=[ - validators.isInLimits(0, 9999), - ]), - Field(item="26CII", name='FAMILY_CAP', type='number', startIndex=110, endIndex=111, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=111, endIndex=112, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="26CIV", name='OTHER_NON_SANCTION', type='number', startIndex=112, endIndex=113, - required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="27", name='WAIVER_EVAL_CONTROL_GRPS', type='string', startIndex=113, endIndex=114, - required=False, validators=[validators.isInStringRange(0, 9)]), - Field(item="28", name='FAMILY_EXEMPT_TIME_LIMITS', type='number', startIndex=114, endIndex=116, - required=True, validators=[validators.isInLimits(0, 9)]), - Field(item="29", name='FAMILY_NEW_CHILD', type='number', startIndex=116, endIndex=117, - required=False, validators=[ - validators.oneOf([0, 1, 2]), - ]), - Field(item="-1", name='BLANK', type='string', startIndex=117, endIndex=123, required=False, - validators=[]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="2", + name="COUNTY_FIPS_CODE", + type="string", + startIndex=19, + endIndex=22, + required=False, + validators=[ + validators.isNumber(), + ], + ), + Field( + item="5", + name="STRATUM", + type="string", + startIndex=22, + endIndex=24, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="7", + name="ZIP_CODE", + type="string", + startIndex=24, + endIndex=29, + required=True, + validators=[ + validators.isNumber(), + ], + ), + Field( + item="8", + name="FUNDING_STREAM", + type="number", + startIndex=29, + endIndex=30, + required=True, + validators=[ + validators.isInLimits(1, 2), + ], + ), + Field( + item="9", + name="DISPOSITION", + type="number", + startIndex=30, + endIndex=31, + required=True, + validators=[ + validators.oneOf([1]), + ], + ), + Field( + item="10", + name="NEW_APPLICANT", + type="number", + startIndex=31, + endIndex=32, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="11", + name="NBR_FAMILY_MEMBERS", + type="number", + startIndex=32, + endIndex=34, + required=True, + validators=[ + validators.isInLimits(1, 99), + ], + ), + Field( + item="12", + name="FAMILY_TYPE", + type="number", + startIndex=34, + endIndex=35, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="13", + name="RECEIVES_SUB_HOUSING", + type="number", + startIndex=35, + endIndex=36, + required=True, + validators=[ + validators.isInLimits(1, 3), + ], + ), + Field( + item="14", + name="RECEIVES_MED_ASSISTANCE", + type="number", + startIndex=36, + endIndex=37, + required=True, + validators=[ + validators.isInLimits(1, 2), + ], + ), + Field( + item="15", + name="RECEIVES_FOOD_STAMPS", + type="number", + startIndex=37, + endIndex=38, + required=False, + validators=[ + validators.isInLimits(0, 2), + ], + ), + Field( + item="16", + name="AMT_FOOD_STAMP_ASSISTANCE", + type="number", + startIndex=38, + endIndex=42, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="17", + name="RECEIVES_SUB_CC", + type="number", + startIndex=42, + endIndex=43, + required=False, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="18", + name="AMT_SUB_CC", + type="number", + startIndex=43, + endIndex=47, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="19", + name="CHILD_SUPPORT_AMT", + type="number", + startIndex=47, + endIndex=51, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="20", + name="FAMILY_CASH_RESOURCES", + type="number", + startIndex=51, + endIndex=55, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="21A", + name="CASH_AMOUNT", + type="number", + startIndex=55, + endIndex=59, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="21B", + name="NBR_MONTHS", + type="number", + startIndex=59, + endIndex=62, + required=True, + validators=[ + validators.isInLimits(0, 999), + ], + ), + Field( + item="22A", + name="CC_AMOUNT", + type="number", + startIndex=62, + endIndex=66, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="22B", + name="CHILDREN_COVERED", + type="number", + startIndex=66, + endIndex=68, + required=True, + validators=[ + validators.isInLimits(0, 99), + ], + ), + Field( + item="22C", + name="CC_NBR_MONTHS", + type="number", + startIndex=68, + endIndex=71, + required=True, + validators=[ + validators.isInLimits(0, 999), + ], + ), + Field( + item="23A", + name="TRANSP_AMOUNT", + type="number", + startIndex=71, + endIndex=75, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="23B", + name="TRANSP_NBR_MONTHS", + type="number", + startIndex=75, + endIndex=78, + required=True, + validators=[ + validators.isInLimits(0, 999), + ], + ), + Field( + item="24A", + name="TRANSITION_SERVICES_AMOUNT", + type="number", + startIndex=78, + endIndex=82, + required=False, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="24B", + name="TRANSITION_NBR_MONTHS", + type="number", + startIndex=82, + endIndex=85, + required=False, + validators=[ + validators.isInLimits(0, 999), + ], + ), + Field( + item="25A", + name="OTHER_AMOUNT", + type="number", + startIndex=85, + endIndex=89, + required=False, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="25B", + name="OTHER_NBR_MONTHS", + type="number", + startIndex=89, + endIndex=92, + required=False, + validators=[ + validators.isInLimits(0, 999), + ], + ), + Field( + item="26AI", + name="SANC_REDUCTION_AMT", + type="number", + startIndex=92, + endIndex=96, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="26AII", + name="WORK_REQ_SANCTION", + type="number", + startIndex=96, + endIndex=97, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AIII", + name="FAMILY_SANC_ADULT", + type="number", + startIndex=97, + endIndex=98, + required=False, + validators=[ + validators.oneOf([0, 1, 2]), + ], + ), + Field( + item="26AIV", + name="SANC_TEEN_PARENT", + type="number", + startIndex=98, + endIndex=99, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AV", + name="NON_COOPERATION_CSE", + type="number", + startIndex=99, + endIndex=100, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AVI", + name="FAILURE_TO_COMPLY", + type="number", + startIndex=100, + endIndex=101, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26AVII", + name="OTHER_SANCTION", + type="number", + startIndex=101, + endIndex=102, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26B", + name="RECOUPMENT_PRIOR_OVRPMT", + type="number", + startIndex=102, + endIndex=106, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="26CI", + name="OTHER_TOTAL_REDUCTIONS", + type="number", + startIndex=106, + endIndex=110, + required=True, + validators=[ + validators.isInLimits(0, 9999), + ], + ), + Field( + item="26CII", + name="FAMILY_CAP", + type="number", + startIndex=110, + endIndex=111, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26CIII", + name="REDUCTIONS_ON_RECEIPTS", + type="number", + startIndex=111, + endIndex=112, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="26CIV", + name="OTHER_NON_SANCTION", + type="number", + startIndex=112, + endIndex=113, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="27", + name="WAIVER_EVAL_CONTROL_GRPS", + type="string", + startIndex=113, + endIndex=114, + required=False, + validators=[validators.isInStringRange(0, 9)], + ), + Field( + item="28", + name="FAMILY_EXEMPT_TIME_LIMITS", + type="number", + startIndex=114, + endIndex=116, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="29", + name="FAMILY_NEW_CHILD", + type="number", + startIndex=116, + endIndex=117, + required=False, + validators=[ + validators.oneOf([0, 1, 2]), + ], + ), + Field( + item="-1", + name="BLANK", + type="string", + startIndex=117, + endIndex=123, + required=False, + validators=[], + ), ], - )] + ) + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py index 3eede769c..655ff1c7d 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py @@ -9,195 +9,669 @@ from tdpservice.search_indexes.models.tribal import Tribal_TANF_T2 -t_t2 = SchemaManager(schemas=[ - RowSchema( - model=Tribal_TANF_T2, - preparsing_validators=[ - validators.hasLength(123), - ], - postparsing_validators=[ +t_t2 = SchemaManager( + schemas=[ + RowSchema( + model=Tribal_TANF_T2, + preparsing_validators=[ + validators.hasLength(123), + ], + postparsing_validators=[ validators.validate__FAM_AFF__SSN(), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="MARITAL_STATUS", + result_function=validators.isInLimits(1, 5), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), - result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 2), + result_field="PARENT_MINOR_CHILD", + result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EDUCATION_LEVEL', result_function=validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EDUCATION_LEVEL", + result_function=validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), ), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.matches(1), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.matches(1), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='COOPERATION_CHILD_SUPPORT', result_function=validators.oneOf((1, 2, 9)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="COOPERATION_CHILD_SUPPORT", + result_function=validators.oneOf((1, 2, 9)), + ), validators.validate__FAM_AFF__HOH__Fed_Time(), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EMPLOYMENT_STATUS', result_function=validators.isInLimits(1, 3), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.isInLimits(1, 3), + result_field="EMPLOYMENT_STATUS", + result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_PART_STATUS', result_function=validators.or_validators( - validators.isInStringRange(1, 3), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="WORK_PART_STATUS", + result_function=validators.or_validators( + validators.isInStringRange(1, 3), + validators.isInStringRange(5, 9), + validators.isInStringRange(11, 19), + validators.matches("99"), + ), + ), + ], + fields=[ + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="30", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 3, 5])], + ), + Field( + item="31", + name="NONCUSTODIAL_PARENT", + type="number", + startIndex=20, + endIndex=21, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="32", + name="DATE_OF_BIRTH", + type="number", + startIndex=21, + endIndex=29, + required=True, + validators=[ + validators.isLargerThan(0), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="33", + name="SSN", + type="string", + startIndex=29, + endIndex=38, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="34A", + name="RACE_HISPANIC", + type="number", + startIndex=38, + endIndex=39, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=39, + endIndex=40, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34C", + name="RACE_ASIAN", + type="number", + startIndex=40, + endIndex=41, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34D", + name="RACE_BLACK", + type="number", + startIndex=41, + endIndex=42, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34E", + name="RACE_HAWAIIAN", + type="number", + startIndex=42, + endIndex=43, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="34F", + name="RACE_WHITE", + type="number", + startIndex=43, + endIndex=44, + required=False, + validators=[validators.isInLimits(0, 2)], + ), + Field( + item="35", + name="GENDER", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="36A", + name="FED_OASDI_PROGRAM", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="36B", + name="FED_DISABILITY_STATUS", + type="number", + startIndex=46, + endIndex=47, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="36C", + name="DISABLED_TITLE_XIVAPDT", + type="string", + startIndex=47, + endIndex=48, + required=True, + validators=[validators.oneOf(["1", "2"])], + ), + Field( + item="36D", + name="AID_AGED_BLIND", + type="number", + startIndex=48, + endIndex=49, + required=False, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="36E", + name="RECEIVE_SSI", + type="number", + startIndex=49, + endIndex=50, + required=True, + validators=[ + validators.oneOf([1, 2]), + ], + ), + Field( + item="37", + name="MARITAL_STATUS", + type="number", + startIndex=50, + endIndex=51, + required=False, + validators=[ + validators.isInLimits(0, 5), + ], + ), + Field( + item="38", + name="RELATIONSHIP_HOH", + type="string", + startIndex=51, + endIndex=53, + required=True, + validators=[ + validators.isInStringRange(1, 10), + ], + ), + Field( + item="39", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=53, + endIndex=54, + required=False, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="40", + name="NEEDS_PREGNANT_WOMAN", + type="number", + startIndex=54, + endIndex=55, + required=False, + validators=[ + validators.isInLimits(0, 9), + ], + ), + Field( + item="41", + name="EDUCATION_LEVEL", + type="string", + startIndex=55, + endIndex=57, + required=False, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="42", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=57, + endIndex=58, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="43", + name="COOPERATION_CHILD_SUPPORT", + type="number", + startIndex=58, + endIndex=59, + required=False, + validators=[ + validators.oneOf([0, 1, 2, 9]), + ], + ), + Field( + item="44", + name="MONTHS_FED_TIME_LIMIT", + type="string", + startIndex=59, + endIndex=62, + required=False, + validators=[ + validators.isInStringRange(0, 999), + ], + ), + Field( + item="45", + name="MONTHS_STATE_TIME_LIMIT", + type="string", + startIndex=62, + endIndex=64, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="46", + name="CURRENT_MONTH_STATE_EXEMPT", + type="number", + startIndex=64, + endIndex=65, + required=False, + validators=[ + validators.isInLimits(0, 9), + ], + ), + Field( + item="47", + name="EMPLOYMENT_STATUS", + type="number", + startIndex=65, + endIndex=66, + required=False, + validators=[ + validators.isInLimits(0, 3), + ], + ), + Field( + item="48", + name="WORK_PART_STATUS", + type="string", + startIndex=66, + endIndex=68, + required=False, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 3), validators.isInStringRange(5, 9), validators.isInStringRange(11, 19), - validators.matches('99')), - ), + validators.matches("99"), + ) + ], + ), + Field( + item="49", + name="UNSUB_EMPLOYMENT", + type="string", + startIndex=68, + endIndex=70, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="50", + name="SUB_PRIVATE_EMPLOYMENT", + type="string", + startIndex=70, + endIndex=72, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="51", + name="SUB_PUBLIC_EMPLOYMENT", + type="string", + startIndex=72, + endIndex=74, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="52", + name="WORK_EXPERIENCE", + type="string", + startIndex=74, + endIndex=76, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="53", + name="OJT", + type="string", + startIndex=76, + endIndex=78, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="54", + name="JOB_SEARCH", + type="string", + startIndex=78, + endIndex=80, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="55", + name="COMM_SERVICES", + type="string", + startIndex=80, + endIndex=82, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="56", + name="VOCATIONAL_ED_TRAINING", + type="string", + startIndex=82, + endIndex=84, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="57", + name="JOB_SKILLS_TRAINING", + type="string", + startIndex=84, + endIndex=86, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="58", + name="ED_NO_HIGH_SCHOOL_DIPLOMA", + type="string", + startIndex=86, + endIndex=88, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="59", + name="SCHOOL_ATTENDENCE", + type="string", + startIndex=88, + endIndex=90, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="60", + name="PROVIDE_CC", + type="string", + startIndex=90, + endIndex=92, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="61", + name="ADD_WORK_ACTIVITIES", + type="string", + startIndex=92, + endIndex=94, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="62", + name="OTHER_WORK_ACTIVITIES", + type="string", + startIndex=94, + endIndex=96, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="63", + name="REQ_HRS_WAIVER_DEMO", + type="string", + startIndex=96, + endIndex=98, + required=False, + validators=[ + validators.isInStringRange(0, 99), + ], + ), + Field( + item="64", + name="EARNED_INCOME", + type="string", + startIndex=98, + endIndex=102, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="65A", + name="UNEARNED_INCOME_TAX_CREDIT", + type="string", + startIndex=102, + endIndex=106, + required=False, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="65B", + name="UNEARNED_SOCIAL_SECURITY", + type="string", + startIndex=106, + endIndex=110, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="65C", + name="UNEARNED_SSI", + type="string", + startIndex=110, + endIndex=114, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="65D", + name="UNEARNED_WORKERS_COMP", + type="string", + startIndex=114, + endIndex=118, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="65E", + name="OTHER_UNEARNED_INCOME", + type="string", + startIndex=118, + endIndex=122, + required=True, + validators=[ + validators.isInStringRange(0, 9999), + ], + ), + Field( + item="-1", + name="BLANK", + type="string", + startIndex=122, + endIndex=123, + required=False, + validators=[], + ), ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[validators.oneOf([1, 2, 3, 5])]), - Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, - validators=[validators.isLargerThan(0),]), - TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, - endIndex=38, required=True, - validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, - validators=[validators.isInLimits(0, 2)]), - Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, - validators=[validators.isInLimits(0, 9)]), - Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, - validators=[validators.oneOf([1, 2])]), - Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, - validators=[validators.oneOf(["1", "2"])]), - Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, - validators=[validators.isInLimits(0, 9)]), - Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, - validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, - validators=[validators.isInLimits(0, 5),]), - Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, - validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=False, - validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=False, - validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, - validators=[validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - )]), - Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, - validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - required=False, validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=False, - validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, - required=False, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, - validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_PART_STATUS', type='string', startIndex=66, endIndex=68, required=False, - validators=[validators.or_validators(validators.isInStringRange(0, 3), - validators.isInStringRange(5, 9), - validators.isInStringRange(11, 19), - validators.matches('99'))]), - Field(item="49", name='UNSUB_EMPLOYMENT', type='string', startIndex=68, endIndex=70, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="50", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='WORK_EXPERIENCE', type='string', startIndex=74, endIndex=76, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="53", name='OJT', type='string', startIndex=76, endIndex=78, required=False, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="54", name='JOB_SEARCH', type='string', startIndex=78, endIndex=80, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="55", name='COMM_SERVICES', type='string', startIndex=80, endIndex=82, required=False, - validators=[validators.isInStringRange(0, 99),]), - Field(item="56", name='VOCATIONAL_ED_TRAINING', type='string', startIndex=82, endIndex=84, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57", name='JOB_SKILLS_TRAINING', type='string', startIndex=84, endIndex=86, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58", name='ED_NO_HIGH_SCHOOL_DIPLOMA', type='string', startIndex=86, endIndex=88, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59", name='SCHOOL_ATTENDENCE', type='string', startIndex=88, endIndex=90, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60", name='PROVIDE_CC', type='string', startIndex=90, endIndex=92, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61", name='ADD_WORK_ACTIVITIES', type='string', startIndex=92, endIndex=94, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=94, endIndex=96, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="63", name='REQ_HRS_WAIVER_DEMO', type='string', startIndex=96, endIndex=98, - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="64", name='EARNED_INCOME', type='string', startIndex=98, endIndex=102, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="65A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=102, endIndex=106, - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="65B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=106, endIndex=110, - required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="65C", name='UNEARNED_SSI', type='string', startIndex=110, endIndex=114, required=True, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="65D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=114, endIndex=118, required=True, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="65E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=118, endIndex=122, required=True, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="-1", name='BLANK', type='string', startIndex=122, endIndex=123, required=False, - validators=[]), - ], - )] + ) + ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py index 9317add96..d612a4c3f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py @@ -16,124 +16,278 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RELATIONSHIP_HOH", + result_function=validators.isInStringRange(4, 9), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="PARENT_MINOR_CHILD", + result_function=validators.oneOf((2, 3)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="EDUCATION_LEVEL", + result_function=validators.notMatches("99"), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), - ), - ], + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(2), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2, 9)), + ), + ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=20, endIndex=28, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=28, - endIndex=37, required=True, validators=[validators.validateSSN()], - is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, - required=False, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - required=False, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, - required=False, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, - required=False, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, - required=False, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, - required=False, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', type='number', startIndex=43, endIndex=44, - required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=44, endIndex=45, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=46, endIndex=48, - required=False, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, - required=False, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=49, endIndex=51, - required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ) - ]), - Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, - required=False, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=52, endIndex=56, - required=True, validators=[ - validators.isInStringRange(0, 9999) - ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=56, endIndex=60, - required=True, validators=[ - validators.isInStringRange(0, 9999) - ]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="67", + name="FAMILY_AFFILIATION", + type="number", + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 4])], + ), + Field( + item="68", + name="DATE_OF_BIRTH", + type="number", + startIndex=20, + endIndex=28, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="69", + name="SSN", + type="string", + startIndex=28, + endIndex=37, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="70A", + name="RACE_HISPANIC", + type="number", + startIndex=37, + endIndex=38, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=38, + endIndex=39, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70C", + name="RACE_ASIAN", + type="number", + startIndex=39, + endIndex=40, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70D", + name="RACE_BLACK", + type="number", + startIndex=40, + endIndex=41, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70E", + name="RACE_HAWAIIAN", + type="number", + startIndex=41, + endIndex=42, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70F", + name="RACE_WHITE", + type="number", + startIndex=42, + endIndex=43, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="71", + name="GENDER", + type="number", + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="72A", + name="RECEIVE_NONSSA_BENEFITS", + type="number", + startIndex=44, + endIndex=45, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="72B", + name="RECEIVE_SSI", + type="number", + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="73", + name="RELATIONSHIP_HOH", + type="string", + startIndex=46, + endIndex=48, + required=False, + validators=[validators.isInStringRange(0, 10)], + ), + Field( + item="74", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=48, + endIndex=49, + required=False, + validators=[validators.oneOf([0, 2, 3])], + ), + Field( + item="75", + name="EDUCATION_LEVEL", + type="string", + startIndex=49, + endIndex=51, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99), + ) + ], + ), + Field( + item="76", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=51, + endIndex=52, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="77A", + name="UNEARNED_SSI", + type="string", + startIndex=52, + endIndex=56, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="77B", + name="OTHER_UNEARNED_INCOME", + type="string", + startIndex=56, + endIndex=60, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), ], ) @@ -145,130 +299,278 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="SSN", + result_function=validators.validateSSN(), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HISPANIC", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_AMER_INDIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_ASIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_BLACK", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_HAWAIIAN", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RACE_WHITE", + result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="RELATIONSHIP_HOH", + result_function=validators.isInStringRange(4, 9), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((2, 3)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.oneOf((1, 2)), + result_field="PARENT_MINOR_CHILD", + result_function=validators.oneOf((2, 3)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches('99'), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="EDUCATION_LEVEL", + result_function=validators.notMatches("99"), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), - ), + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(1), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 9)), - ), - ], + condition_field="FAMILY_AFFILIATION", + condition_function=validators.matches(2), + result_field="CITIZENSHIP_STATUS", + result_function=validators.oneOf((1, 2, 9)), + ), + ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - required=True, validators=[]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - required=True, validators=[validators.isAlphaNumeric()]), - Field(item="67", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, - required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="68", name='DATE_OF_BIRTH', type='number', startIndex=61, endIndex=69, - required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=tanf_ssn_decryption_func, item="69", name='SSN', type='string', startIndex=69, - endIndex=78, required=True, validators=[validators.validateSSN()], - is_encrypted=False), - Field(item="70A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, - required=False, validators=[validators.validateRace()]), - Field(item="70B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, - required=False, validators=[validators.validateRace()]), - Field(item="70C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, - required=False, validators=[validators.validateRace()]), - Field(item="70D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, - required=False, validators=[validators.validateRace()]), - Field(item="70E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, - required=False, validators=[validators.validateRace()]), - Field(item="70F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, - required=False, validators=[validators.validateRace()]), - Field(item="71", name='GENDER', type='number', startIndex=84, endIndex=85, - required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="72A", name='RECEIVE_NONSSA_BENEFITS', type='number', startIndex=85, endIndex=86, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="72B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, - required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="73", name='RELATIONSHIP_HOH', type='string', startIndex=87, endIndex=89, - required=False, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="74", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, - required=False, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="75", name='EDUCATION_LEVEL', type='string', startIndex=90, endIndex=92, - required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.oneOf(['98', '99']) - ) - ]), - Field(item="76", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, - required=False, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="77A", name='UNEARNED_SSI', type='string', startIndex=93, endIndex=97, - required=True, validators=[ - validators.isInStringRange(0, 9999) - ]), - Field(item="77B", name='OTHER_UNEARNED_INCOME', type='string', startIndex=97, endIndex=101, - required=True, validators=[ - validators.isInStringRange(0, 9999) - ]), + Field( + item="0", + name="RecordType", + type="string", + startIndex=0, + endIndex=2, + required=True, + validators=[], + ), + Field( + item="4", + name="RPT_MONTH_YEAR", + type="number", + startIndex=2, + endIndex=8, + required=True, + validators=[], + ), + Field( + item="6", + name="CASE_NUMBER", + type="string", + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()], + ), + Field( + item="67", + name="FAMILY_AFFILIATION", + type="number", + startIndex=60, + endIndex=61, + required=True, + validators=[validators.oneOf([1, 2, 4])], + ), + Field( + item="68", + name="DATE_OF_BIRTH", + type="number", + startIndex=61, + endIndex=69, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ], + ), + TransformField( + transform_func=tanf_ssn_decryption_func, + item="69", + name="SSN", + type="string", + startIndex=69, + endIndex=78, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False, + ), + Field( + item="70A", + name="RACE_HISPANIC", + type="number", + startIndex=78, + endIndex=79, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70B", + name="RACE_AMER_INDIAN", + type="number", + startIndex=79, + endIndex=80, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70C", + name="RACE_ASIAN", + type="number", + startIndex=80, + endIndex=81, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70D", + name="RACE_BLACK", + type="number", + startIndex=81, + endIndex=82, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70E", + name="RACE_HAWAIIAN", + type="number", + startIndex=82, + endIndex=83, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="70F", + name="RACE_WHITE", + type="number", + startIndex=83, + endIndex=84, + required=False, + validators=[validators.validateRace()], + ), + Field( + item="71", + name="GENDER", + type="number", + startIndex=84, + endIndex=85, + required=True, + validators=[validators.isInLimits(0, 9)], + ), + Field( + item="72A", + name="RECEIVE_NONSSA_BENEFITS", + type="number", + startIndex=85, + endIndex=86, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="72B", + name="RECEIVE_SSI", + type="number", + startIndex=86, + endIndex=87, + required=True, + validators=[validators.oneOf([1, 2])], + ), + Field( + item="73", + name="RELATIONSHIP_HOH", + type="string", + startIndex=87, + endIndex=89, + required=False, + validators=[validators.isInStringRange(0, 10)], + ), + Field( + item="74", + name="PARENT_MINOR_CHILD", + type="number", + startIndex=89, + endIndex=90, + required=False, + validators=[validators.oneOf([0, 2, 3])], + ), + Field( + item="75", + name="EDUCATION_LEVEL", + type="string", + startIndex=90, + endIndex=92, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), validators.oneOf(["98", "99"]) + ) + ], + ), + Field( + item="76", + name="CITIZENSHIP_STATUS", + type="number", + startIndex=92, + endIndex=93, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])], + ), + Field( + item="77A", + name="UNEARNED_SSI", + type="string", + startIndex=93, + endIndex=97, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), + Field( + item="77B", + name="OTHER_UNEARNED_INCOME", + type="string", + startIndex=97, + endIndex=101, + required=True, + validators=[validators.isInStringRange(0, 9999)], + ), ], ) -t_t3 = SchemaManager( - schemas=[ - child_one, - child_two - ] -) +t_t3 = SchemaManager(schemas=[child_one, child_two]) diff --git a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py index 4d81eaac9..c99b5e559 100644 --- a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py +++ b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py @@ -578,3 +578,184 @@ def test_can_create_and_index_ssp_m3_submission(): response = search.execute() assert response.hits.total.value == 1 + +@pytest.mark.django_db +def test_can_create_and_index_tribal_tanf_t1_submission(test_datafile): + """Tribal TANF T1 submissions can be created and mapped.""" + record_num = fake.uuid4() + + submission = models.tribal.Tribal_TANF_T1() + submission.datafile = test_datafile + submission.RecordType = record_num + submission.RPT_MONTH_YEAR = 1 + submission.CASE_NUMBER = "1" + submission.COUNTY_FIPS_CODE = 1 + submission.STRATUM = "1" + submission.ZIP_CODE = "01" + submission.FUNDING_STREAM = 1 + submission.DISPOSITION = 1 + submission.NEW_APPLICANT = 1 + submission.NBR_FAMILY_MEMBERS = 1 + submission.FAMILY_TYPE = 1 + submission.RECEIVES_SUB_HOUSING = 1 + submission.RECEIVES_MED_ASSISTANCE = 1 + submission.RECEIVES_FOOD_STAMPS = 1 + submission.AMT_FOOD_STAMP_ASSISTANCE = 1 + submission.RECEIVES_SUB_CC = 1 + submission.AMT_SUB_CC = 1 + submission.CHILD_SUPPORT_AMT = 1 + submission.FAMILY_CASH_RESOURCES = 1 + submission.CASH_AMOUNT = 1 + submission.NBR_MONTHS = 1 + submission.CC_AMOUNT = 1 + submission.CHILDREN_COVERED = 1 + submission.CC_NBR_MONTHS = 1 + submission.TRANSP_AMOUNT = 1 + submission.TRANSP_NBR_MONTHS = 1 + submission.TRANSITION_SERVICES_AMOUNT = 1 + submission.TRANSITION_NBR_MONTHS = 1 + submission.OTHER_AMOUNT = 1 + submission.OTHER_NBR_MONTHS = 1 + submission.SANC_REDUCTION_AMT = 1 + submission.WORK_REQ_SANCTION = 1 + submission.FAMILY_SANC_ADULT = 1 + submission.SANC_TEEN_PARENT = 1 + submission.NON_COOPERATION_CSE = 1 + submission.FAILURE_TO_COMPLY = 1 + submission.OTHER_SANCTION = 1 + submission.RECOUPMENT_PRIOR_OVRPMT = 1 + submission.OTHER_TOTAL_REDUCTIONS = 1 + submission.FAMILY_CAP = 1 + submission.REDUCTIONS_ON_RECEIPTS = 1 + submission.OTHER_NON_SANCTION = 1 + submission.WAIVER_EVAL_CONTROL_GRPS = 1 + submission.FAMILY_EXEMPT_TIME_LIMITS = 1 + submission.FAMILY_NEW_CHILD = 1 + + submission.save() + + # submission.full_clean() + + assert submission.id is not None + + search = documents.tribal.Tribal_TANF_T1DataSubmissionDocument.search().query( + 'match', + RecordType=record_num + ) + response = search.execute() + + assert response.hits.total.value == 1 + + +@pytest.mark.django_db +def test_can_create_and_index_tribal_tanf_t2_submission(test_datafile): + """Tribal TANF T2 submissions can be created and mapped.""" + record_num = fake.uuid4() + + submission = models.tribal.Tribal_TANF_T2() + submission.datafile = test_datafile + submission.RecordType = record_num + submission.RPT_MONTH_YEAR = 1 + submission.CASE_NUMBER = '1' + submission.FAMILY_AFFILIATION = 1 + submission.NONCUSTODIAL_PARENT = 1 + submission.DATE_OF_BIRTH = 1 + submission.SSN = '1' + submission.RACE_HISPANIC = 1 + submission.RACE_AMER_INDIAN = 1 + submission.RACE_ASIAN = 1 + submission.RACE_BLACK = 1 + submission.RACE_HAWAIIAN = 1 + submission.RACE_WHITE = 1 + submission.GENDER = 1 + submission.FED_OASDI_PROGRAM = 1 + submission.FED_DISABILITY_STATUS = 1 + submission.DISABLED_TITLE_XIVAPDT = 1 + submission.AID_AGED_BLIND = 1 + submission.RECEIVE_SSI = 1 + submission.MARITAL_STATUS = 1 + submission.RELATIONSHIP_HOH = "01" + submission.NEEDS_PREGNANT_WOMAN = 1 + submission.EDUCATION_LEVEL = 1 + submission.CITIZENSHIP_STATUS = 1 + submission.COOPERATION_CHILD_SUPPORT = 1 + submission.MONTHS_FED_TIME_LIMIT = 1 + submission.MONTHS_STATE_TIME_LIMIT = 1 + submission.CURRENT_MONTH_STATE_EXEMPT = 1 + submission.EMPLOYMENT_STATUS = 1 + submission.WORK_PART_STATUS = 1 + submission.UNSUB_EMPLOYMENT = 1 + submission.SUB_PRIVATE_EMPLOYMENT = 1 + submission.SUB_PUBLIC_EMPLOYMENT = 1 + submission.WORK_EXPERIENCE = 1 + submission.OJT = 1 + submission.JOB_SEARCH = 1 + submission.COMM_SERVICES = 1 + submission.VOCATIONAL_ED_TRAINING = 1 + submission.JOB_SKILLS_TRAINING = 1 + submission.ED_NO_HIGH_SCHOOL_DIPLOMA = 1 + submission.SCHOOL_ATTENDENCE = 1 + submission.PROVIDE_CC = 1 + submission.ADD_WORK_ACTIVITIES = '01' + submission.OTHER_WORK_ACTIVITIES = 1 + submission.REQ_HRS_WAIVER_DEMO = 1 + submission.EARNED_INCOME = 1 + submission.UNEARNED_INCOME_TAX_CREDIT = 1 + submission.UNEARNED_SOCIAL_SECURITY = 1 + submission.UNEARNED_SSI = 1 + submission.UNEARNED_WORKERS_COMP = 1 + submission.OTHER_UNEARNED_INCOME = 1 + + submission.save() + + assert submission.id is not None + + search = documents.tribal.Tribal_TANF_T2DataSubmissionDocument.search().query( + 'match', + RecordType=record_num + ) + response = search.execute() + + assert response.hits.total.value == 1 + + +@pytest.mark.django_db +def test_can_create_and_index_tribal_tanf_t3_submission(test_datafile): + """Tribal TANF T3 submissions can be created and mapped.""" + record_num = fake.uuid4() + + submission = models.tribal.Tribal_TANF_T3() + submission.datafile = test_datafile + submission.RecordType = record_num + submission.RPT_MONTH_YEAR = 1 + submission.CASE_NUMBER = '1' + submission.FAMILY_AFFILIATION = 1 + submission.DATE_OF_BIRTH = 1 + submission.SSN = '1' + submission.RACE_HISPANIC = 1 + submission.RACE_AMER_INDIAN = 1 + submission.RACE_ASIAN = 1 + submission.RACE_BLACK = 1 + submission.RACE_HAWAIIAN = 1 + submission.RACE_WHITE = 1 + submission.GENDER = 1 + submission.RECEIVE_NONSSA_BENEFITS = 1 + submission.RECEIVE_SSI = 1 + submission.RELATIONSHIP_HOH = "01" + submission.PARENT_MINOR_CHILD = 1 + submission.EDUCATION_LEVEL = 1 + submission.CITIZENSHIP_STATUS = 1 + submission.UNEARNED_SSI = 1 + submission.OTHER_UNEARNED_INCOME = 1 + + submission.save() + + assert submission.id is not None + + search = documents.tribal.Tribal_TANF_T3DataSubmissionDocument.search().query( + 'match', + RecordType=record_num + ) + response = search.execute() + + assert response.hits.total.value == 1 \ No newline at end of file From c8607b27193bdd2f1eb2dc0ce3b863390b515171 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 7 Nov 2023 10:39:39 -0700 Subject: [PATCH 33/88] - Fix lint --- .../tdpservice/search_indexes/test/test_model_mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py index c99b5e559..d79583247 100644 --- a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py +++ b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py @@ -758,4 +758,4 @@ def test_can_create_and_index_tribal_tanf_t3_submission(test_datafile): ) response = search.execute() - assert response.hits.total.value == 1 \ No newline at end of file + assert response.hits.total.value == 1 From 359dae01e9470040a992179bb82a52aa6350e8f2 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 8 Nov 2023 08:30:56 -0500 Subject: [PATCH 34/88] added returning fields names to validators --- tdrs-backend/tdpservice/parsers/validators.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index a86c3b149..fb93e8a99 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -49,7 +49,8 @@ def if_then_validator_func(value): else f":{value1} validator1 passed") + f' then {result_field} ' + (validator2_result[1] if validator2_result[1] is not None - else "validator2 passed")) if not validator2_result[0] else None, [condition_field, result_field]) + else "validator2 passed")) if not validator2_result[0] + else None, [condition_field, result_field]) return lambda value: if_then_validator_func(value) @@ -63,8 +64,11 @@ def sumIsEqualFunc(value): condition_val = value[condition_field] if type(value) is dict else getattr(value, condition_field) fields = [condition_field] fields.extend(sum_fields) - return (True, None, fields) if sum == condition_val else (False, - f"The sum of {sum_fields} does not equal {condition_field}.", fields) + return (True, + None, + fields) if sum == condition_val else (False, + f"The sum of {sum_fields} does not equal {condition_field}.", + fields) return lambda value: sumIsEqualFunc(value) @@ -75,7 +79,11 @@ def sumIsLargerFunc(value): for field in fields: sum += value[field] if type(value) is dict else getattr(value, field) - return (True, None, fields) if sum > val else (False, f"The sum of {fields} is not larger than {val}.", fields) + return (True, + None, + [field for field in fields]) if sum > val else (False, + f"The sum of {fields} is not larger than {val}.", + [field for field in fields]) return lambda value: sumIsLargerFunc(value) @@ -320,7 +328,8 @@ def validate(instance): if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if int(MONTHS_FED_TIME_LIMIT) < 1: return (False, - 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, then MONTHS_FED_TIME_LIMIT > 1.', + 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2,\ + then MONTHS_FED_TIME_LIMIT > 1.', ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) else: return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) @@ -347,7 +356,7 @@ def validate(instance): else: return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) else: - return (True, None , ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) + return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) return lambda instance: validate(instance) From 8ed0b4a7bc32b9ce0c7c77a439fa931ef5108875 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 13 Nov 2023 13:58:18 -0500 Subject: [PATCH 35/88] added friendly_name to error field --- tdrs-backend/tdpservice/parsers/row_schema.py | 9 +- .../tdpservice/parsers/test/test_util.py | 32 +- .../parsers/test/test_validators.py | 139 ++++--- tdrs-backend/tdpservice/parsers/util.py | 13 +- tdrs-backend/tdpservice/parsers/validators.py | 352 ++++++++++++------ tdrs-backend/tdpservice/parsers/views.py | 8 +- 6 files changed, 369 insertions(+), 184 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/row_schema.py b/tdrs-backend/tdpservice/parsers/row_schema.py index 5929bc743..50a131856 100644 --- a/tdrs-backend/tdpservice/parsers/row_schema.py +++ b/tdrs-backend/tdpservice/parsers/row_schema.py @@ -148,18 +148,19 @@ def run_postparsing_validators(self, instance, generate_error): errors = [] for validator in self.postparsing_validators: - validator_is_valid, validator_error, fields = validator(instance) - friendly_field_names = [field.friendly_name for field in self.fields if field.name in fields] - print('+++++++++++++++++++: ', friendly_field_names) + validator_is_valid, validator_error, field_names = validator(instance) + #friendly_field_names = [field.friendly_name for field in self.fields if field.name in fields] is_valid = False if not validator_is_valid else is_valid if validator_error: + # get field from field name + fields = [self.get_field_by_name(name) for name in field_names] errors.append( generate_error( schema=self, error_category=ParserErrorCategoryChoices.VALUE_CONSISTENCY, error_message=validator_error, record=instance, - field=None + field=fields, ) ) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index e1e9dea9a..4e14671cd 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -3,7 +3,8 @@ import pytest from ..fields import Field, value_is_empty from ..row_schema import RowSchema -from ..util import SchemaManager +from .. import schema_defs +from ..util import SchemaManager, make_generate_parser_error, create_test_datafile def passing_validator(): @@ -15,6 +16,14 @@ def failing_validator(): """Fake validator that always returns invalid.""" return lambda _: (False, 'Value is not valid.') +def passing_postparsing_validator(): + """Fake validator that always returns valid.""" + return lambda _: (True, None, []) + + +def failing_postparsing_validator(): + """Fake validator that always returns invalid.""" + return lambda _: (False, 'Value is not valid.', []) def error_func(schema, error_category, error_message, record, field): """Fake error func that returns an error_message.""" @@ -306,12 +315,19 @@ def test_field_validators_blank_and_not_required_returns_valid(first): assert errors == [] +@pytest.fixture +def test_datafile(stt_user, stt): + """Fixture for small_correct_file.""" + return create_test_datafile('empty_file', stt_user, stt) + + + def test_run_postparsing_validators_returns_valid(): """Test run_postparsing_validators executes all postparsing_validators provided in schema.""" instance = {} schema = RowSchema( postparsing_validators=[ - passing_validator() + passing_postparsing_validator() ] ) @@ -325,8 +341,8 @@ def test_run_postparsing_validators_returns_invalid_and_errors(): instance = {} schema = RowSchema( postparsing_validators=[ - passing_validator(), - failing_validator() + passing_postparsing_validator(), + failing_postparsing_validator() ] ) @@ -373,7 +389,7 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], postparsing_validators=[ - failing_validator() + failing_postparsing_validator() ], fields=[ Field( @@ -393,7 +409,7 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], postparsing_validators=[ - passing_validator() + passing_postparsing_validator() ], fields=[ Field( @@ -412,7 +428,7 @@ def test_multi_record_schema_parses_and_validates(): failing_validator() ], postparsing_validators=[ - passing_validator() + passing_postparsing_validator() ], fields=[ Field( @@ -432,7 +448,7 @@ def test_multi_record_schema_parses_and_validates(): passing_validator() ], postparsing_validators=[ - passing_validator() + passing_postparsing_validator() ], fields=[ Field( diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index 5403bb696..fefbe2da6 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -355,12 +355,12 @@ def test_validate_cash_amount_and_nbr_months(self, record): result_field='NBR_MONTHS', result_function=validators.isLargerThan(0), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['CASH_AMOUNT', 'NBR_MONTHS']) record.CASH_AMOUNT = 1 record.NBR_MONTHS = -1 result = val(record) - assert result == (False, 'if CASH_AMOUNT :1 validator1 passed then NBR_MONTHS -1 is not larger than 0.') + assert result == (False, 'if CASH_AMOUNT :1 validator1 passed then NBR_MONTHS -1 is not larger than 0.', ['CASH_AMOUNT', 'NBR_MONTHS']) def test_validate_child_care(self, record): """Test cat3 validator for child care.""" @@ -369,12 +369,13 @@ def test_validate_child_care(self, record): result_field='CHILDREN_COVERED', result_function=validators.isLargerThan(0), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['CC_AMOUNT', 'CHILDREN_COVERED']) record.CC_AMOUNT = 1 record.CHILDREN_COVERED = -1 result = val(record) - assert result == (False, 'if CC_AMOUNT :1 validator1 passed then CHILDREN_COVERED -1 is not larger than 0.') + assert result == (False, 'if CC_AMOUNT :1 validator1 passed then CHILDREN_COVERED -1 is not larger than 0.', + ['CC_AMOUNT', 'CHILDREN_COVERED']) val = validators.if_then_validator( condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), @@ -383,7 +384,8 @@ def test_validate_child_care(self, record): record.CC_AMOUNT = 10 record.CC_NBR_MONTHS = -1 result = val(record) - assert result == (False, 'if CC_AMOUNT :10 validator1 passed then CC_NBR_MONTHS -1 is not larger than 0.') + assert result == (False, 'if CC_AMOUNT :10 validator1 passed then CC_NBR_MONTHS -1 is not larger than 0.', + ['CC_AMOUNT', 'CC_NBR_MONTHS']) def test_validate_transportation(self, record): """Test cat3 validator for transportation.""" @@ -392,13 +394,14 @@ def test_validate_transportation(self, record): result_field='TRANSP_NBR_MONTHS', result_function=validators.isLargerThan(0), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['TRANSP_AMOUNT', 'TRANSP_NBR_MONTHS']) record.TRANSP_AMOUNT = 1 record.TRANSP_NBR_MONTHS = -1 result = val(record) assert result == (False, 'if TRANSP_AMOUNT :1 validator1 passed then ' - + 'TRANSP_NBR_MONTHS -1 is not larger than 0.') + + 'TRANSP_NBR_MONTHS -1 is not larger than 0.', + ['TRANSP_AMOUNT', 'TRANSP_NBR_MONTHS']) def test_validate_transitional_services(self, record): """Test cat3 validator for transitional services.""" @@ -407,13 +410,14 @@ def test_validate_transitional_services(self, record): result_field='TRANSITION_NBR_MONTHS', result_function=validators.isLargerThan(0), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['TRANSITION_SERVICES_AMOUNT', 'TRANSITION_NBR_MONTHS']) record.TRANSITION_SERVICES_AMOUNT = 1 record.TRANSITION_NBR_MONTHS = -1 result = val(record) assert result == (False, 'if TRANSITION_SERVICES_AMOUNT :1 validator1 passed then ' - + 'TRANSITION_NBR_MONTHS -1 is not larger than 0.') + + 'TRANSITION_NBR_MONTHS -1 is not larger than 0.', + ['TRANSITION_SERVICES_AMOUNT', 'TRANSITION_NBR_MONTHS']) def test_validate_other(self, record): """Test cat3 validator for other.""" @@ -422,12 +426,13 @@ def test_validate_other(self, record): result_field='OTHER_NBR_MONTHS', result_function=validators.isLargerThan(0), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['OTHER_AMOUNT', 'OTHER_NBR_MONTHS']) record.OTHER_AMOUNT = 1 record.OTHER_NBR_MONTHS = -1 result = val(record) - assert result == (False, 'if OTHER_AMOUNT :1 validator1 passed then OTHER_NBR_MONTHS -1 is not larger than 0.') + assert result == (False, 'if OTHER_AMOUNT :1 validator1 passed then OTHER_NBR_MONTHS -1 is not larger than 0.', + ['OTHER_AMOUNT', 'OTHER_NBR_MONTHS']) def test_validate_reasons_for_amount_of_assistance_reductions(self, record): """Test cat3 validator for assistance reductions.""" @@ -437,20 +442,22 @@ def test_validate_reasons_for_amount_of_assistance_reductions(self, record): ) record.SANC_REDUCTION_AMT = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['SANC_REDUCTION_AMT', 'WORK_REQ_SANCTION']) record.SANC_REDUCTION_AMT = 10 record.WORK_REQ_SANCTION = -1 result = val(record) assert result == (False, 'if SANC_REDUCTION_AMT :10 validator1 passed then ' - + 'WORK_REQ_SANCTION -1 is not in (1, 2).') + + 'WORK_REQ_SANCTION -1 is not in (1, 2).', + ['SANC_REDUCTION_AMT', 'WORK_REQ_SANCTION']) def test_validate_sum(self, record): """Test cat3 validator for sum of cash fields.""" val = validators.sumIsLarger(("AMT_FOOD_STAMP_ASSISTANCE", "AMT_SUB_CC", "CC_AMOUNT", "TRANSP_AMOUNT", "TRANSITION_SERVICES_AMOUNT", "OTHER_AMOUNT"), 0) result = val(record) - assert result == (True, None) + assert result == (True, None, ['AMT_FOOD_STAMP_ASSISTANCE', 'AMT_SUB_CC', 'CC_AMOUNT', 'TRANSP_AMOUNT', + 'TRANSITION_SERVICES_AMOUNT', 'OTHER_AMOUNT']) record.AMT_FOOD_STAMP_ASSISTANCE = 0 record.AMT_SUB_CC = 0 @@ -460,7 +467,9 @@ def test_validate_sum(self, record): record.OTHER_AMOUNT = 0 result = val(record) assert result == (False, "The sum of ('AMT_FOOD_STAMP_ASSISTANCE', 'AMT_SUB_CC', 'CC_AMOUNT', " + - "'TRANSP_AMOUNT', 'TRANSITION_SERVICES_AMOUNT', 'OTHER_AMOUNT') is not larger than 0.") + "'TRANSP_AMOUNT', 'TRANSITION_SERVICES_AMOUNT', 'OTHER_AMOUNT') is not larger than 0.", + ['AMT_FOOD_STAMP_ASSISTANCE', 'AMT_SUB_CC', 'CC_AMOUNT', 'TRANSP_AMOUNT', + 'TRANSITION_SERVICES_AMOUNT', 'OTHER_AMOUNT']) class TestT2Cat3Validators(TestCat3ValidatorsBase): @@ -483,7 +492,7 @@ def test_validate_ssn(self, record): record.SSN = "999989999" record.FAMILY_AFFILIATION = 1 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'SSN']) record.FAMILY_AFFILIATION = 1 record.SSN = "999999999" @@ -491,7 +500,7 @@ def test_validate_ssn(self, record): assert result == (False, "if FAMILY_AFFILIATION :1 validator1 passed then " + "SSN 999999999 is in ('000000000', '111111111', " + "'222222222', '333333333', '444444444', '555555555', '666666666', '777777777', '888888888'," + - " '999999999').") + " '999999999').", ['FAMILY_AFFILIATION', 'SSN']) def test_validate_race_ethnicity(self, record): """Test cat3 validator for race/ethnicity.""" @@ -503,7 +512,7 @@ def test_validate_race_ethnicity(self, record): result_field=race, result_function=validators.isInLimits(1, 2), ) result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) + assert result == (True, None, ['FAMILY_AFFILIATION', race]) record.FAMILY_AFFILIATION = 0 for race in races: @@ -512,7 +521,7 @@ def test_validate_race_ethnicity(self, record): result_field=race, result_function=validators.isInLimits(1, 2) ) result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) + assert result == (True, None, ['FAMILY_AFFILIATION', race]) def test_validate_marital_status(self, record): """Test cat3 validator for marital status.""" @@ -537,12 +546,13 @@ def test_validate_parent_with_minor(self, record): result_field='PARENT_WITH_MINOR_CHILD', result_function=validators.isInLimits(1, 3), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_WITH_MINOR_CHILD']) record.PARENT_WITH_MINOR_CHILD = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_WITH_MINOR_CHILD 0 is not ' + - 'larger or equal to 1 and smaller or equal to 3.') + 'larger or equal to 1 and smaller or equal to 3.', + ['FAMILY_AFFILIATION', 'PARENT_WITH_MINOR_CHILD']) def test_validate_education_level(self, record): """Test cat3 validator for education level.""" @@ -555,14 +565,15 @@ def test_validate_education_level(self, record): ) record.FAMILY_AFFILIATION = 3 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) record.FAMILY_AFFILIATION = 1 record.EDUCATION_LEVEL = "00" result = val(record) assert result == (False, "if FAMILY_AFFILIATION :1 validator1 passed then " + "EDUCATION_LEVEL 00 is not in ('01', '02', '03', '04', '05', '06'," - + " '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '98', '99').") + + " '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '98', '99').", + ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) def test_validate_citizenship(self, record): """Test cat3 validator for citizenship.""" @@ -572,13 +583,13 @@ def test_validate_citizenship(self, record): ) record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) record.FAMILY_AFFILIATION = 1 record.CITIZENSHIP_STATUS = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then CITIZENSHIP_STATUS 0 ' + - 'is not in (1, 2).') + 'is not in (1, 2).', ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) def test_validate_cooperation_with_child_support(self, record): """Test cat3 validator for cooperation with child support.""" @@ -588,13 +599,13 @@ def test_validate_cooperation_with_child_support(self, record): ) record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'COOPERATION_CHILD_SUPPORT']) record.FAMILY_AFFILIATION = 1 record.COOPERATION_CHILD_SUPPORT = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then COOPERATION_CHILD_SUPPORT 0 ' + - 'is not in (1, 2, 9).') + 'is not in (1, 2, 9).', ['FAMILY_AFFILIATION', 'COOPERATION_CHILD_SUPPORT']) def test_validate_months_federal_time_limit(self, record): """Test cat3 validator for federal time limit.""" @@ -602,14 +613,15 @@ def test_validate_months_federal_time_limit(self, record): val = validators.validate__FAM_AFF__HOH__Fed_Time() record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) record.FAMILY_AFFILIATION = 1 record.MONTHS_FED_TIME_LIMIT = "000" record.RELATIONSHIP_HOH = "01" result = val(record) assert result == (False, 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, ' + - 'then MONTHS_FED_TIME_LIMIT > 1.') + 'then MONTHS_FED_TIME_LIMIT > 1.', + ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) def test_validate_employment_status(self, record): """Test cat3 validator for employment status.""" @@ -619,13 +631,13 @@ def test_validate_employment_status(self, record): ) record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'EMPLOYMENT_STATUS']) record.FAMILY_AFFILIATION = 3 record.EMPLOYMENT_STATUS = 4 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :3 validator1 passed then EMPLOYMENT_STATUS 4 is not larger ' + - 'or equal to 1 and smaller or equal to 3.') + 'or equal to 1 and smaller or equal to 3.', ['FAMILY_AFFILIATION', 'EMPLOYMENT_STATUS']) def test_validate_work_eligible_indicator(self, record): """Test cat3 validator for work eligibility.""" @@ -638,13 +650,13 @@ def test_validate_work_eligible_indicator(self, record): ) record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'WORK_ELIGIBLE_INDICATOR']) record.FAMILY_AFFILIATION = 1 record.WORK_ELIGIBLE_INDICATOR = "00" result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then WORK_ELIGIBLE_INDICATOR 00 is not ' + - 'in range [1, 9]. or 00 does not match 12.') + 'in range [1, 9]. or 00 does not match 12.', ['FAMILY_AFFILIATION', 'WORK_ELIGIBLE_INDICATOR']) def test_validate_work_participation(self, record): """Test cat3 validator for work participation.""" @@ -672,7 +684,7 @@ def test_validate_work_participation(self, record): record.WORK_ELIGIBLE_INDICATOR = "01" result = val(record) assert result == (False, 'if WORK_ELIGIBLE_INDICATOR :01 validator1 passed then ' - + 'WORK_PART_STATUS 99 matches 99.', ['FAMILY_AFFILIATION', 'WORK_PART_STATUS']) + + 'WORK_PART_STATUS 99 matches 99.', ['WORK_ELIGIBLE_INDICATOR', 'WORK_PART_STATUS']) class TestT3Cat3Validators(TestCat3ValidatorsBase): @@ -692,13 +704,13 @@ def test_validate_ssn(self, record): result_field='SSN', result_function=validators.notOneOf(("999999999", "000000000")), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'SSN']) record.FAMILY_AFFILIATION = 1 record.SSN = "999999999" result = val(record) assert result == (False, "if FAMILY_AFFILIATION :1 validator1 passed then " - + "SSN 999999999 is in ('999999999', '000000000').") + + "SSN 999999999 is in ('999999999', '000000000').", ['FAMILY_AFFILIATION', 'SSN']) def test_validate_t3_race_ethnicity(self, record): """Test cat3 validator for race/ethnicity.""" @@ -710,7 +722,7 @@ def test_validate_t3_race_ethnicity(self, record): result_field=race, result_function=validators.oneOf((1, 2)), ) result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_AMER_INDIAN']) + assert result == (True, None, ['FAMILY_AFFILIATION', race]) record.FAMILY_AFFILIATION = 0 for race in races: @@ -719,7 +731,7 @@ def test_validate_t3_race_ethnicity(self, record): result_field=race, result_function=validators.oneOf((1, 2)), ) result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) + assert result == (True, None, ['FAMILY_AFFILIATION', race]) def test_validate_relationship_hoh(self, record): """Test cat3 validator for relationship to head of household.""" @@ -809,14 +821,14 @@ def test_validate_ssn_citizenship(self, record): val = validators.validate__FAM_AFF__SSN() result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'SSN']) + assert result == (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) record.FAMILY_AFFILIATION = 2 record.SSN = "000000000" result = val(record) assert result == (False, "If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN " + - "!= 000000000 -- 999999999.", ['FAMILY_AFFILIATION', 'SSN']) + "!= 000000000 -- 999999999.", ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) def test_validate_race_ethnicity(self, record): """Test cat3 validator for race/ethnicity.""" @@ -828,7 +840,7 @@ def test_validate_race_ethnicity(self, record): result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2) ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RACE_HISPANIC']) record.FAMILY_AFFILIATION = 1 record.RACE_HISPANIC = 0 @@ -844,7 +856,8 @@ def test_validate_race_ethnicity(self, record): ) result = val(record) assert result == (False, f'if FAMILY_AFFILIATION :1 validator1 passed then {race} 0 is not larger or ' + - 'equal to 1 and smaller or equal to 2.') + 'equal to 1 and smaller or equal to 2.', + ['FAMILY_AFFILIATION', race]) def test_validate_marital_status(self, record): """Test cat3 validator for marital status.""" @@ -855,14 +868,15 @@ def test_validate_marital_status(self, record): record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'MARITAL_STATUS']) record.FAMILY_AFFILIATION = 2 record.MARITAL_STATUS = 6 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then MARITAL_STATUS 6 is not larger or ' + - 'equal to 0 and smaller or equal to 5.') + 'equal to 0 and smaller or equal to 5.', + ['FAMILY_AFFILIATION', 'MARITAL_STATUS']) def test_validate_parent_minor(self, record): """Test cat3 validator for parent with minor.""" @@ -873,14 +887,15 @@ def test_validate_parent_minor(self, record): record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) record.FAMILY_AFFILIATION = 2 record.PARENT_MINOR_CHILD = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then PARENT_MINOR_CHILD 0 is not larger ' + - 'or equal to 1 and smaller or equal to 3.') + 'or equal to 1 and smaller or equal to 3.', + ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) def test_validate_education(self, record): """Test cat3 validator for education level.""" @@ -894,14 +909,15 @@ def test_validate_education(self, record): record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) record.FAMILY_AFFILIATION = 2 record.EDUCATION_LEVEL = "0" result = val(record) assert result == (False, "if FAMILY_AFFILIATION :2 validator1 passed then EDUCATION_LEVEL 0 is not in range " + - "[1, 16]. or 0 is not in range [98, 99].") + "[1, 16]. or 0 is not in range [98, 99].", + ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) def test_validate_citizenship_status(self, record): """Test cat3 validator for citizenship status.""" @@ -912,14 +928,15 @@ def test_validate_citizenship_status(self, record): record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) record.FAMILY_AFFILIATION = 1 record.CITIZENSHIP_STATUS = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then CITIZENSHIP_STATUS 0 is not larger ' + - 'or equal to 1 and smaller or equal to 2.') + 'or equal to 1 and smaller or equal to 2.', + ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) def test_validate_hoh_fed_time(self, record): """Test cat3 validator for federal disability.""" @@ -927,7 +944,7 @@ def test_validate_hoh_fed_time(self, record): record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) record.FAMILY_AFFILIATION = 1 record.RELATIONSHIP_HOH = 1 @@ -935,7 +952,8 @@ def test_validate_hoh_fed_time(self, record): result = val(record) assert result == (False, 'If FAMILY_AFFILIATION == 2 and COUNTABLE_MONTH_FED_TIME== 1 or 2, then ' + - 'COUNTABLE_MONTH_FED_TIME > 1.') + 'COUNTABLE_MONTH_FED_TIME > 1.', + ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) def test_validate_oasdi_insurance(self, record): """Test cat3 validator for OASDI insurance.""" @@ -946,14 +964,14 @@ def test_validate_oasdi_insurance(self, record): record.DATE_OF_BIRTH = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['DATE_OF_BIRTH', 'REC_OASDI_INSURANCE']) record.DATE_OF_BIRTH = 200001 record.REC_OASDI_INSURANCE = 0 result = val(record) assert result == (False, 'if DATE_OF_BIRTH :200001 validator1 passed then REC_OASDI_INSURANCE 0 is not ' + - 'larger or equal to 1 and smaller or equal to 2.') + 'larger or equal to 1 and smaller or equal to 2.', ['DATE_OF_BIRTH', 'REC_OASDI_INSURANCE']) def test_validate_federal_disability(self, record): """Test cat3 validator for federal disability.""" @@ -964,14 +982,14 @@ def test_validate_federal_disability(self, record): record.FAMILY_AFFILIATION = 0 result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'REC_FEDERAL_DISABILITY']) record.FAMILY_AFFILIATION = 1 record.REC_FEDERAL_DISABILITY = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then REC_FEDERAL_DISABILITY 0 is not ' + - 'larger or equal to 1 and smaller or equal to 2.') + 'larger or equal to 1 and smaller or equal to 2.', ['FAMILY_AFFILIATION', 'REC_FEDERAL_DISABILITY']) class TestT6Cat3Validators(TestCat3ValidatorsBase): @@ -989,12 +1007,13 @@ def test_sum_of_applications(self, record): record.NUM_APPLICATIONS = 2 result = val(record) - assert result == (True, None) + assert result == (True, None, ['NUM_APPLICATIONS', 'NUM_APPROVED', 'NUM_DENIED']) record.NUM_APPLICATIONS = 1 result = val(record) - assert result == (False, "The sum of ['NUM_APPROVED', 'NUM_DENIED'] does not equal NUM_APPLICATIONS.") + assert result == (False, "The sum of ['NUM_APPROVED', 'NUM_DENIED'] does not equal NUM_APPLICATIONS.", + ['NUM_APPLICATIONS', 'NUM_APPROVED', 'NUM_DENIED']) def test_sum_of_families(self, record): """Test cat3 validator for sum of families.""" @@ -1003,13 +1022,13 @@ def test_sum_of_families(self, record): record.NUM_FAMILIES = 3 result = val(record) - assert result == (True, None) + assert result == (True, None, ['NUM_FAMILIES', 'NUM_2_PARENTS', 'NUM_1_PARENTS', 'NUM_NO_PARENTS']) record.NUM_FAMILIES = 1 result = val(record) assert result == (False, "The sum of ['NUM_2_PARENTS', 'NUM_1_PARENTS', 'NUM_NO_PARENTS'] does not equal " + - "NUM_FAMILIES.") + "NUM_FAMILIES.", ['NUM_FAMILIES', 'NUM_2_PARENTS', 'NUM_1_PARENTS', 'NUM_NO_PARENTS']) def test_sum_of_recipients(self, record): """Test cat3 validator for sum of recipients.""" diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index a6208305f..567d218da 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -30,6 +30,15 @@ def create_test_datafile(filename, stt_user, stt, section='Active Case Data'): def generate_parser_error(datafile, line_number, schema, error_category, error_message, record=None, field=None): """Create and return a ParserError using args.""" + if type(field) == list: + fields_json = { + "friend_name": { + getattr(f, 'name', None): getattr(f, 'friendly_name', None) for f in field + } + } + else: + fields_json = {} + return ParserError( file=datafile, row_number=line_number, @@ -44,9 +53,7 @@ def generate_parser_error(datafile, line_number, schema, error_category, error_m model=schema.model if schema else None ) if record and not isinstance(record, dict) else None, object_id=getattr(record, 'id', None) if record and not isinstance(record, dict) else None, - fields_json={ - "friendly_name": getattr(field, 'friendly_name', None) if hasattr(field, 'friendly_name') else None - } + fields_json=fields_json ) diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index fb93e8a99..98635dd50 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -5,31 +5,61 @@ # higher order validator func + def make_validator(validator_func, error_func): """Return a function accepting a value input and returning (bool, string) to represent validation state.""" - return lambda value: (True, None) if value is not None and validator_func(value) else (False, error_func(value)) + return ( + lambda value: (True, None) + if value is not None and validator_func(value) + else (False, error_func(value)) + ) def or_validators(*args, **kwargs): """Return a validator that is true only if one of the validators is true.""" - return lambda value: (True, None) if any([validator(value)[0] for validator in args])\ - else (False, ' or '.join([validator(value)[1] for validator in args])) + return ( + lambda value: (True, None) + if any([validator(value)[0] for validator in args]) + else (False, " or ".join([validator(value)[1] for validator in args])) + ) def and_validators(validator1, validator2): """Return a validator that is true only if both validators are true.""" - return lambda value: (True, None) if (validator1(value)[0] and validator2(value)[0])\ - else (False, (validator1(value)[1]) if validator1(value)[1] is not None else '' + - ' and ' + validator2(value)[1] if validator2(value)[1] is not None else '') + return ( + lambda value: (True, None) + if (validator1(value)[0] and validator2(value)[0]) + else ( + False, + (validator1(value)[1]) + if validator1(value)[1] is not None + else "" + " and " + validator2(value)[1] + if validator2(value)[1] is not None + else "", + ) + ) + def extended_and_validators(*args, **kwargs): """Return a validator that is true only if all validators are true.""" - return lambda value: (True, None) if all([validator(value)[0] for validator in args])\ - else (False, ''.join([' and ' + validator(value)[1] if validator(value)[0] else '' for validator in args])) + return ( + lambda value: (True, None) + if all([validator(value)[0] for validator in args]) + else ( + False, + "".join( + [ + " and " + validator(value)[1] if validator(value)[0] else "" + for validator in args + ] + ), + ) + ) -def if_then_validator(condition_field, condition_function, - result_field, result_function): +def if_then_validator( + condition_field, condition_function, result_field, result_function +): """Return second validation if the first validator is true. :param condition_field: function that returns (bool, string) to represent validation state @@ -37,87 +67,124 @@ def if_then_validator(condition_field, condition_function, :param result_field: function that returns (bool, string) to represent validation state :param result_function: function that returns (bool, string) to represent validation state """ + def if_then_validator_func(value): - value1 = value[condition_field] if type(value) is dict else getattr(value, condition_field) - value2 = value[result_field] if type(value) is dict else getattr(value, result_field) + value1 = ( + value[condition_field] + if type(value) is dict + else getattr(value, condition_field) + ) + value2 = ( + value[result_field] if type(value) is dict else getattr(value, result_field) + ) validator1_result = condition_function(value1) validator2_result = result_function(value2) - return (True, None, [condition_field, result_field]) if not validator1_result[0] else ( - validator2_result[0], (f'if {condition_field} ' - + (validator1_result[1] if validator1_result[1] is not None - else f":{value1} validator1 passed") - + f' then {result_field} ' - + (validator2_result[1] if validator2_result[1] is not None - else "validator2 passed")) if not validator2_result[0] - else None, [condition_field, result_field]) + return ( + (True, None, [condition_field, result_field]) + if not validator1_result[0] + else ( + validator2_result[0], + ( + f"if {condition_field} " + + ( + validator1_result[1] + if validator1_result[1] is not None + else f":{value1} validator1 passed" + ) + + f" then {result_field} " + + ( + validator2_result[1] + if validator2_result[1] is not None + else "validator2 passed" + ) + ) + if not validator2_result[0] + else None, + [condition_field, result_field], + ) + ) return lambda value: if_then_validator_func(value) + def sumIsEqual(condition_field, sum_fields=[]): """Validate that the sum of the sum_fields equals the condition_field.""" + def sumIsEqualFunc(value): sum = 0 for field in sum_fields: sum += value[field] if type(value) is dict else getattr(value, field) - condition_val = value[condition_field] if type(value) is dict else getattr(value, condition_field) + condition_val = ( + value[condition_field] + if type(value) is dict + else getattr(value, condition_field) + ) fields = [condition_field] fields.extend(sum_fields) - return (True, - None, - fields) if sum == condition_val else (False, - f"The sum of {sum_fields} does not equal {condition_field}.", - fields) + return ( + (True, None, fields) + if sum == condition_val + else ( + False, + f"The sum of {sum_fields} does not equal {condition_field}.", + fields, + ) + ) return lambda value: sumIsEqualFunc(value) + def sumIsLarger(fields, val): """Validate that the sum of the fields is larger than val.""" + def sumIsLargerFunc(value): sum = 0 for field in fields: sum += value[field] if type(value) is dict else getattr(value, field) - return (True, - None, - [field for field in fields]) if sum > val else (False, - f"The sum of {fields} is not larger than {val}.", - [field for field in fields]) + return ( + (True, None, [field for field in fields]) + if sum > val + else ( + False, + f"The sum of {fields} is not larger than {val}.", + [field for field in fields], + ) + ) return lambda value: sumIsLargerFunc(value) # generic validators + def matches(option): """Validate that value is equal to option.""" return make_validator( - lambda value: value == option, - lambda value: f'{value} does not match {option}.' + lambda value: value == option, lambda value: f"{value} does not match {option}." ) + def notMatches(option): """Validate that value is not equal to option.""" return make_validator( - lambda value: value != option, - lambda value: f'{value} matches {option}.' + lambda value: value != option, lambda value: f"{value} matches {option}." ) def oneOf(options=[]): """Validate that value does not exist in the provided options array.""" return make_validator( - lambda value: value in options, - lambda value: f'{value} is not in {options}.' + lambda value: value in options, lambda value: f"{value} is not in {options}." ) def notOneOf(options=[]): """Validate that value exists in the provided options array.""" return make_validator( - lambda value: value not in options, - lambda value: f'{value} is in {options}.' + lambda value: value not in options, lambda value: f"{value} is in {options}." ) @@ -125,7 +192,7 @@ def between(min, max): """Validate value, when casted to int, is greater than min and less than max.""" return make_validator( lambda value: int(value) > min and int(value) < max, - lambda value: f'{value} is not between {min} and {max}.' + lambda value: f"{value} is not between {min} and {max}.", ) @@ -133,7 +200,9 @@ def hasLength(length, error_func=None): """Validate that value (string or array) has a length matching length param.""" return make_validator( lambda value: len(value) == length, - lambda value: error_func(value, length) if error_func else f'Value length {len(value)} does not match {length}.' + lambda value: error_func(value, length) + if error_func + else f"Value length {len(value)} does not match {length}.", ) @@ -141,7 +210,7 @@ def contains(substring): """Validate that string value contains the given substring param.""" return make_validator( lambda value: value.find(substring) != -1, - lambda value: f'{value} does not contain {substring}.' + lambda value: f"{value} does not contain {substring}.", ) @@ -149,65 +218,67 @@ def startsWith(substring): """Validate that string value starts with the given substring param.""" return make_validator( lambda value: value.startswith(substring), - lambda value: f'{value} does not start with {substring}.' + lambda value: f"{value} does not start with {substring}.", ) def isNumber(): """Validate that value can be casted to a number.""" return make_validator( - lambda value: value.isnumeric(), - lambda value: f'{value} is not a number.' + lambda value: value.isnumeric(), lambda value: f"{value} is not a number." ) + def isAlphaNumeric(): """Validate that value is alphanumeric.""" return make_validator( - lambda value: value.isalnum(), - lambda value: f'{value} is not alphanumeric.' + lambda value: value.isalnum(), lambda value: f"{value} is not alphanumeric." ) + def isBlank(): """Validate that string value is blank.""" return make_validator( - lambda value: value.isspace(), - lambda value: f'{value} is not blank.' + lambda value: value.isspace(), lambda value: f"{value} is not blank." ) + def isInStringRange(lower, upper): """Validate that string value is in a specific range.""" return make_validator( lambda value: int(value) >= lower and int(value) <= upper, - lambda value: f'{value} is not in range [{lower}, {upper}].' + lambda value: f"{value} is not in range [{lower}, {upper}].", ) + def isStringLargerThan(val): """Validate that string value is larger than val.""" return make_validator( lambda value: int(value) > val, - lambda value: f'{value} is not larger than {val}.' + lambda value: f"{value} is not larger than {val}.", ) + def notEmpty(start=0, end=None): """Validate that string value isn't only blanks.""" return make_validator( - lambda value: not str(value)[start:end if end else len(str(value))].isspace(), - lambda value: f'{str(value)} contains blanks between positions {start} and {end if end else len(str(value))}.' + lambda value: not str(value)[start: end if end else len(str(value))].isspace(), + lambda value: f"{str(value)} contains blanks between positions {start} and {end if end else len(str(value))}.", ) + def isEmpty(start=0, end=None): """Validate that string value is only blanks.""" return make_validator( - lambda value: value[start:end if end else len(value)].isspace(), - lambda value: f'{value} is not blank between positions {start} and {end if end else len(value)}.' + lambda value: value[start: end if end else len(value)].isspace(), + lambda value: f"{value} is not blank between positions {start} and {end if end else len(value)}.", ) def notZero(number_of_zeros=1): """Validate that value is not zero.""" return make_validator( - lambda value: value != '0' * number_of_zeros, - lambda value: f'{value} is zero.' + lambda value: value != "0" * number_of_zeros, lambda value: f"{value} is zero." ) @@ -215,7 +286,7 @@ def isLargerThan(LowerBound): """Validate that value is larger than the given value.""" return make_validator( lambda value: float(value) > LowerBound if value is not None else False, - lambda value: f'{value} is not larger than {LowerBound}.' + lambda value: f"{value} is not larger than {LowerBound}.", ) @@ -223,73 +294,82 @@ def isSmallerThan(UpperBound): """Validate that value is smaller than the given value.""" return make_validator( lambda value: value < UpperBound, - lambda value: f'{value} is not smaller than {UpperBound}.' + lambda value: f"{value} is not smaller than {UpperBound}.", ) + def isLargerThanOrEqualTo(LowerBound): """Validate that value is larger than the given value.""" return make_validator( lambda value: value >= LowerBound, - lambda value: f'{value} is not larger than {LowerBound}.' + lambda value: f"{value} is not larger than {LowerBound}.", ) + def isSmallerThanOrEqualTo(UpperBound): """Validate that value is smaller than the given value.""" return make_validator( lambda value: value <= UpperBound, - lambda value: f'{value} is not smaller than {UpperBound}.' + lambda value: f"{value} is not smaller than {UpperBound}.", ) + def isInLimits(LowerBound, UpperBound): """Validate that value is in a range including the limits.""" return make_validator( lambda value: value >= LowerBound and value <= UpperBound, - lambda value: f'{value} is not larger or equal to {LowerBound} and smaller or equal to {UpperBound}.' + lambda value: f"{value} is not larger or equal to {LowerBound} and smaller or equal to {UpperBound}.", ) + # custom validators + def dateMonthIsValid(): """Validate that in a monthyear combination, the month is a valid month.""" return make_validator( lambda value: int(str(value)[4:6]) in range(1, 13), - lambda value: f'{str(value)[4:6]} is not a valid month.' + lambda value: f"{str(value)[4:6]} is not a valid month.", ) + def olderThan(min_age): """Validate that value is larger than min_age.""" return make_validator( lambda value: date.today().year - int(str(value)[:4]) > min_age, - lambda value: f'{date.today().year - int(str(value)[:4])} is not larger than {min_age}.' + lambda value: f"{date.today().year - int(str(value)[:4])} is not larger than {min_age}.", ) + def dateYearIsLargerThan(year): """Validate that in a monthyear combination, the year is larger than the given year.""" return make_validator( lambda value: int(str(value)[:4]) > year, - lambda value: f'{str(value)[:4]} year must be larger than {year}.' + lambda value: f"{str(value)[:4]} year must be larger than {year}.", ) + def quarterIsValid(): """Validate in a year quarter combination, the quarter is valid.""" return make_validator( lambda value: int(str(value)[-1]) > 0 and int(str(value)[-1]) < 5, - lambda value: f'{str(value)[-1]} is not a valid quarter.' + lambda value: f"{str(value)[-1]} is not a valid quarter.", ) + def validateSSN(): """Validate that SSN value is not a repeating digit.""" - options = [str(i)*9 for i in range(0, 10)] + options = [str(i) * 9 for i in range(0, 10)] return make_validator( - lambda value: value not in options, - lambda value: f'{value} is in {options}.' + lambda value: value not in options, lambda value: f"{value} is in {options}." ) + def validateRace(): """Validate race.""" return make_validator( lambda value: value >= 0 and value <= 2, - lambda value: f'{value} is not greater than or equal to 0 or smaller than or equal to 1.' + lambda value: f"{value} is not greater than or equal to 0 or smaller than or equal to 1.", ) @@ -298,65 +378,127 @@ def validate__FAM_AFF__SSN(): """If item 30 ==2 and item 42 ==1 or 2, then item 33 != 000000000 -- 999999999.""" # value is instance def validate(instance): - FAMILY_AFFILIATION = instance['FAMILY_AFFILIATION'] if type(instance) is dict else \ - getattr(instance, 'FAMILY_AFFILIATION') - CITIZENSHIP_STATUS = instance['CITIZENSHIP_STATUS'] if type(instance) is dict else \ - getattr(instance, 'CITIZENSHIP_STATUS') - SSN = instance['SSN'] if type(instance) is dict else getattr(instance, 'SSN') - if FAMILY_AFFILIATION == 2 and (CITIZENSHIP_STATUS == 1 or CITIZENSHIP_STATUS == 2): + FAMILY_AFFILIATION = ( + instance["FAMILY_AFFILIATION"] + if type(instance) is dict + else getattr(instance, "FAMILY_AFFILIATION") + ) + CITIZENSHIP_STATUS = ( + instance["CITIZENSHIP_STATUS"] + if type(instance) is dict + else getattr(instance, "CITIZENSHIP_STATUS") + ) + SSN = instance["SSN"] if type(instance) is dict else getattr(instance, "SSN") + if FAMILY_AFFILIATION == 2 and ( + CITIZENSHIP_STATUS == 1 or CITIZENSHIP_STATUS == 2 + ): if SSN in [str(i) * 9 for i in range(10)]: - return (False, - 'If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN != 000000000 -- 999999999.', - ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) + return ( + False, + "If FAMILY_AFFILIATION ==2 and CITIZENSHIP_STATUS==1 or 2, then SSN != 000000000 -- 999999999.", + ["FAMILY_AFFILIATION", "CITIZENSHIP_STATUS", "SSN"], + ) else: - return (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) + return (True, None, ["FAMILY_AFFILIATION", "CITIZENSHIP_STATUS", "SSN"]) else: - return (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS', 'SSN']) + return (True, None, ["FAMILY_AFFILIATION", "CITIZENSHIP_STATUS", "SSN"]) + return lambda instance: validate(instance) + def validate__FAM_AFF__HOH__Fed_Time(): """If FAMILY_AFFILIATION == 1 and RELATIONSHIP_HOH== 1 or 2, then MONTHS_FED_TIME_LIMIT >= 1.""" # value is instance def validate(instance): - FAMILY_AFFILIATION = instance['FAMILY_AFFILIATION'] if type(instance) is dict else \ - getattr(instance, 'FAMILY_AFFILIATION') - RELATIONSHIP_HOH = instance['RELATIONSHIP_HOH'] if type(instance) is dict else \ - getattr(instance, 'RELATIONSHIP_HOH') + FAMILY_AFFILIATION = ( + instance["FAMILY_AFFILIATION"] + if type(instance) is dict + else getattr(instance, "FAMILY_AFFILIATION") + ) + RELATIONSHIP_HOH = ( + instance["RELATIONSHIP_HOH"] + if type(instance) is dict + else getattr(instance, "RELATIONSHIP_HOH") + ) RELATIONSHIP_HOH = int(RELATIONSHIP_HOH) - MONTHS_FED_TIME_LIMIT = instance['MONTHS_FED_TIME_LIMIT'] if type(instance) is dict else \ - getattr(instance, 'MONTHS_FED_TIME_LIMIT') + MONTHS_FED_TIME_LIMIT = ( + instance["MONTHS_FED_TIME_LIMIT"] + if type(instance) is dict + else getattr(instance, "MONTHS_FED_TIME_LIMIT") + ) if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if int(MONTHS_FED_TIME_LIMIT) < 1: - return (False, - 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2,\ - then MONTHS_FED_TIME_LIMIT > 1.', - ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) + return ( + False, + "If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2,\ + then MONTHS_FED_TIME_LIMIT > 1.", + ["FAMILY_AFFILIATION", "RELATIONSHIP_HOH", "MONTHS_FED_TIME_LIMIT"], + ) else: - return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) + return ( + True, + None, + ["FAMILY_AFFILIATION", "RELATIONSHIP_HOH", "MONTHS_FED_TIME_LIMIT"], + ) else: - return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) + return ( + True, + None, + ["FAMILY_AFFILIATION", "RELATIONSHIP_HOH", "MONTHS_FED_TIME_LIMIT"], + ) + return lambda instance: validate(instance) + def validate__FAM_AFF__HOH__Count_Fed_Time(): """If FAMILY_AFFILIATION == 1 and RELATIONSHIP_HOH== 1 or 2, then COUNTABLE_MONTH_FED_TIME >= 1.""" # value is instance def validate(instance): - FAMILY_AFFILIATION = instance['FAMILY_AFFILIATION'] if type(instance) is dict else \ - getattr(instance, 'FAMILY_AFFILIATION') - RELATIONSHIP_HOH = instance['RELATIONSHIP_HOH'] if type(instance) is dict else \ - getattr(instance, 'RELATIONSHIP_HOH') + FAMILY_AFFILIATION = ( + instance["FAMILY_AFFILIATION"] + if type(instance) is dict + else getattr(instance, "FAMILY_AFFILIATION") + ) + RELATIONSHIP_HOH = ( + instance["RELATIONSHIP_HOH"] + if type(instance) is dict + else getattr(instance, "RELATIONSHIP_HOH") + ) RELATIONSHIP_HOH = int(RELATIONSHIP_HOH) - COUNTABLE_MONTH_FED_TIME = instance['COUNTABLE_MONTH_FED_TIME'] if type(instance) is dict else \ - getattr(instance, 'COUNTABLE_MONTH_FED_TIME') + COUNTABLE_MONTH_FED_TIME = ( + instance["COUNTABLE_MONTH_FED_TIME"] + if type(instance) is dict + else getattr(instance, "COUNTABLE_MONTH_FED_TIME") + ) if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if int(COUNTABLE_MONTH_FED_TIME) < 1: - return (False, 'If FAMILY_AFFILIATION == 2 and COUNTABLE_MONTH_FED_TIME== 1 or 2, then ' + - 'COUNTABLE_MONTH_FED_TIME > 1.', - ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) + return ( + False, + "If FAMILY_AFFILIATION == 2 and COUNTABLE_MONTH_FED_TIME== 1 or 2, then " + + "COUNTABLE_MONTH_FED_TIME > 1.", + [ + "FAMILY_AFFILIATION", + "RELATIONSHIP_HOH", + "COUNTABLE_MONTH_FED_TIME", + ], + ) else: - return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) + return ( + True, + None, + [ + "FAMILY_AFFILIATION", + "RELATIONSHIP_HOH", + "COUNTABLE_MONTH_FED_TIME", + ], + ) else: - return (True, None, ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'COUNTABLE_MONTH_FED_TIME']) + return ( + True, + None, + ["FAMILY_AFFILIATION", "RELATIONSHIP_HOH", "COUNTABLE_MONTH_FED_TIME"], + ) + return lambda instance: validate(instance) @@ -371,7 +513,7 @@ def validate_header_section_matches_submission(datafile, section, generate_error error_category=ParserErrorCategoryChoices.PRE_CHECK, error_message=f"Data does not match the expected layout for {datafile.section}.", record=None, - field=None + field=None, ) return is_valid, error diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index 4ab8d8364..0f32a80e6 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -50,11 +50,11 @@ def _get_xls_serialized_file(self, data): int(str(x['rpt_month_year'])[4:]) ] if x['rpt_month_year'] else None), ('error_type', lambda x: x['error_type']), - ('error_message', lambda x: x['error_message'].replace( - x['field_name'], - str(x['fields_json']['friendly_name']))), + ('error_message', lambda x: 1), #lambda x: x['error_message'].replace( + #x['field_name'], + #str(x['fields_json']))), ('item_number', lambda x: x['item_number']), - ('item_name', lambda x: x['fields_json']['friendly_name']), + ('item_name', lambda x: str(x['fields_json'])), ('internal_variable_name', lambda x: x['field_name']), ('row_number', lambda x: x['row_number']), ('column_number', lambda x: x['column_number']) From 812a2ddbea72d26f687d4c530d13aed4532b38e8 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 14 Nov 2023 11:59:15 -0500 Subject: [PATCH 36/88] linting --- tdrs-backend/tdpservice/parsers/row_schema.py | 1 - .../tdpservice/parsers/schema_defs/ssp/m2.py | 3 +- .../tdpservice/parsers/schema_defs/ssp/m3.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t2.py | 384 ++++++++++-------- .../tdpservice/parsers/test/test_util.py | 4 +- .../parsers/test/test_validators.py | 26 +- tdrs-backend/tdpservice/parsers/util.py | 6 +- 7 files changed, 230 insertions(+), 196 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/row_schema.py b/tdrs-backend/tdpservice/parsers/row_schema.py index e8fd0eb72..796a0ea57 100644 --- a/tdrs-backend/tdpservice/parsers/row_schema.py +++ b/tdrs-backend/tdpservice/parsers/row_schema.py @@ -151,7 +151,6 @@ def run_postparsing_validators(self, instance, generate_error): for validator in self.postparsing_validators: validator_is_valid, validator_error, field_names = validator(instance) - #friendly_field_names = [field.friendly_name for field in self.fields if field.name in fields] is_valid = False if not validator_is_valid else is_valid if validator_error: # get field from field name diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index 0a26facc5..6873e02a6 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -291,7 +291,8 @@ validators.isInLimits(0, 99) ]), Field(item="52A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='number', startIndex=102, endIndex=104, - friendly_name="education no high school diploma - hours of participation", required=False, validators=[ + friendly_name="education no high school diploma - hours of participation", + required=False, validators=[ validators.isInLimits(0, 99) ]), Field(item="52B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='number', startIndex=104, endIndex=106, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index 982212cbb..f17dcd74d 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -293,7 +293,7 @@ validators.oneOf([0, 1, 2, 3, 9]) ]), Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=93, endIndex=97, - friendly_name="unearned ssi", required=False, validators=[ + friendly_name="unearned ssi", required=True, validators=[ validators.isInLimits(0, 9999) ]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 0199d1261..d06b793a5 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -123,181 +123,209 @@ result_function=validators.notMatches("99"), ), ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name="record type", required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="report month year", required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - friendly_name="case number", required=True, validators=[validators.isAlphaNumeric()]), - Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - friendly_name="family affiliation", required=True, validators=[validators.oneOf([1, 2, 3, 5])]), - Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, - friendly_name="noncustodial parent", validators=[validators.oneOf([1, 2])]), - Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, - friendly_name="date of birth", validators=[validators.isLargerThan(0),]), - TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, - friendly_name="social security number SSN", endIndex=38, required=True, - validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, - friendly_name="race hispanic", validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, - friendly_name="race american indian", validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, - friendly_name="race asian", validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, - friendly_name="race black", validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, - friendly_name="race hawaiian", validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, - friendly_name="race white", validators=[validators.isInLimits(0, 2)]), - Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, - friendly_name="gender", validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, - friendly_name="fed qasdi program", validators=[validators.oneOf([1, 2])]), - Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, - friendly_name="fed disability status", validators=[validators.oneOf([1, 2])]), - Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, - friendly_name="disbaled title xivapdt", validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), - Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, - friendly_name="aid aged blind", validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, - friendly_name="receive ssi", validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, - friendly_name="marital status", validators=[validators.isInLimits(0, 5),]), - Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, - friendly_name="relationship to head of household", validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=False, - friendly_name="parent with minor child", validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=False, - friendly_name="needs of pregnant woman", validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, - friendly_name="education level", validators=[validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - )]), - Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, - friendly_name="citizenship status", validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - friendly_name="coopeartion with child support", required=False, validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=False, - friendly_name="number of months countable toward federal time limit", - validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=False, - friendly_name="months of state time limit", validators=[validators.isInStringRange(0, 99),]), - Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, - friendly_name="is current month exempt from the state time limit", - required=False, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, - friendly_name="employment status", validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', startIndex=66, endIndex=68, required=True, - friendly_name="work-eligible indivdual indicator", - validators=[validators.or_validators(validators.isInStringRange(0, 9), - validators.oneOf(('11', '12')) - )]), - Field(item="49", name='WORK_PART_STATUS', type='string', startIndex=68, endIndex=70, required=False, - friendly_name="work participation status", - validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), - Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, - friendly_name="employement status", validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=False, - friendly_name="subsidized private employment", validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=74, endIndex=76, required=False, - friendly_name="subsidized public employment", validators=[validators.isInStringRange(0, 99),]), - Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', startIndex=76, endIndex=78, required=False, - friendly_name="work experience - hours of participation", - validators=[validators.isInStringRange(0, 99),]), - Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', startIndex=78, endIndex=80, required=False, - friendly_name="work experience - excused absence", validators=[validators.isInStringRange(0, 99),]), - Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', startIndex=80, endIndex=82, required=False, - friendly_name="work experience - holiday", validators=[validators.isInStringRange(0, 99),]), - Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, - friendly_name="on the job training", - validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=False, - friendly_name="job search - hours of operation", validators=[validators.isInStringRange(0, 99),]), - Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, required=False, - friendly_name="job search - exceused absense", validators=[validators.isInStringRange(0, 99),]), - Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, required=False, - friendly_name="job search - holiday", validators=[validators.isInStringRange(0, 99),]), - Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, required=False, - friendly_name="community service - hours of operation", validators=[validators.isInStringRange(0, 99),]), - Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, required=False, - friendly_name="community service - excused absense", validators=[validators.isInStringRange(0, 99),]), - Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, required=False, - friendly_name="community service - holiday", validators=[validators.isInStringRange(0, 99),]), - Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, - friendly_name="vocational education training - hours of operation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, - friendly_name="vocational education - exceused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, - friendly_name="vocational education training - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, - friendly_name="job skills training - hours of participation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, - friendly_name="job skills training - excused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, - friendly_name="job skills training holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, - friendly_name="education no high school diploma - hours of operation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, - friendly_name="education no high school diploma - excused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, - friendly_name="education no high school diploma - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, - friendly_name="school attendance - hours of participation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, - friendly_name="school attendance - exceused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, - friendly_name="school attendance - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, - friendly_name="provide child care - hours of participation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, - friendly_name="provide child care - excused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, - friendly_name="provide child care - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, - friendly_name="other work activities", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, - friendly_name="number of deemed core hours for overall rate", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, - friendly_name="number of deemed core hours for two-parent rate", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, - friendly_name="earned income", required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, - friendly_name="unearned income tax credit", - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, - friendly_name="unearned social security", - required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=True, - friendly_name="unearned SSI", validators=[validators.isInStringRange(0, 9999),]), - Field(item="66D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=148, endIndex=152, required=True, - friendly_name="unearned workers compensation", - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=152, endIndex=156, required=True, - friendly_name="other unearned income", validators=[validators.isInStringRange(0, 9999),]), - ], - )] -) + fields=[ + Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + friendly_name="record type", required=True, validators=[]), + Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + friendly_name="report month year", required=True, + validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(),]), + Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + friendly_name="case number", required=True, validators=[validators.isAlphaNumeric()]), + Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + friendly_name="family affiliation", required=True, validators=[validators.oneOf([1, 2, 3, 5])]), + Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, + friendly_name="noncustodial parent", validators=[validators.oneOf([1, 2])]), + Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, + friendly_name="date of birth", validators=[validators.isLargerThan(0),]), + TransformField( + transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, + friendly_name="social security number SSN", endIndex=38, required=True, + validators=[validators.validateSSN()], is_encrypted=False), + Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, + friendly_name="race hispanic", validators=[validators.isInLimits(0, 2)]), + Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, + friendly_name="race american indian", validators=[validators.isInLimits(0, 2)]), + Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, + friendly_name="race asian", validators=[validators.isInLimits(0, 2)]), + Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, + friendly_name="race black", validators=[validators.isInLimits(0, 2)]), + Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, + friendly_name="race hawaiian", validators=[validators.isInLimits(0, 2)]), + Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, + friendly_name="race white", validators=[validators.isInLimits(0, 2)]), + Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, + friendly_name="gender", validators=[validators.isLargerThanOrEqualTo(0),]), + Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, + friendly_name="fed qasdi program", validators=[validators.oneOf([1, 2])]), + Field(item="36B", name='FED_DISABILITY_STATUS', type='number', + startIndex=46, endIndex=47, required=True, + friendly_name="fed disability status", validators=[validators.oneOf([1, 2])]), + Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', + startIndex=47, endIndex=48, required=True, + friendly_name="disbaled title xivapdt", + validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), + Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, + friendly_name="aid aged blind", validators=[validators.isLargerThanOrEqualTo(0),]), + Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, + friendly_name="receive ssi", validators=[validators.oneOf([1, 2]),]), + Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, + friendly_name="marital status", validators=[validators.isInLimits(0, 5),]), + Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, + friendly_name="relationship to head of household", + validators=[validators.isInStringRange(1, 10),]), + Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', + startIndex=53, endIndex=54, required=False, + friendly_name="parent with minor child", validators=[validators.isInLimits(0, 3),]), + Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', + startIndex=54, endIndex=55, required=False, + friendly_name="needs of pregnant woman", validators=[validators.isInLimits(0, 9),]), + Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, + friendly_name="education level", + validators=[ + validators.or_validators(validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99)) + ]), + Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, + friendly_name="citizenship status", validators=[validators.oneOf([0, 1, 2, 9])]), + Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, + friendly_name="coopeartion with child support", required=False, + validators=[validators.oneOf([0, 1, 2, 9]),]), + Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', + startIndex=59, endIndex=62, required=False, + friendly_name="number of months countable toward federal time limit", + validators=[validators.isInStringRange(0, 999),]), + Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', + startIndex=62, endIndex=64, required=False, + friendly_name="months of state time limit", validators=[validators.isInStringRange(0, 99),]), + Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, + friendly_name="is current month exempt from the state time limit", + required=False, validators=[validators.isInLimits(0, 9),]), + Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, + friendly_name="employment status", validators=[validators.isInLimits(0, 3),]), + Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', + startIndex=66, endIndex=68, required=True, + friendly_name="work-eligible indivdual indicator", + validators=[ + validators.or_validators(validators.isInStringRange(0, 9), + validators.oneOf(('11', '12'))) + ]), + Field(item="49", name='WORK_PART_STATUS', type='string', startIndex=68, endIndex=70, required=False, + friendly_name="work participation status", + validators=[ + validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99']) + ]), + Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, + friendly_name="employement status", validators=[validators.isInStringRange(0, 99),]), + Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', + startIndex=72, endIndex=74, required=False, + friendly_name="subsidized private employment", validators=[validators.isInStringRange(0, 99),]), + Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', + startIndex=74, endIndex=76, required=False, + friendly_name="subsidized public employment", validators=[validators.isInStringRange(0, 99),]), + Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', + startIndex=76, endIndex=78, required=False, + friendly_name="work experience - hours of participation", + validators=[validators.isInStringRange(0, 99),]), + Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', + startIndex=78, endIndex=80, required=False, + friendly_name="work experience - excused absence", + validators=[validators.isInStringRange(0, 99),]), + Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', + startIndex=80, endIndex=82, required=False, + friendly_name="work experience - holiday", validators=[validators.isInStringRange(0, 99),]), + Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, + friendly_name="on the job training", + validators=[ + validators.isInStringRange(0, 99), + ]), + Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=False, + friendly_name="job search - hours of operation", + validators=[validators.isInStringRange(0, 99),]), + Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, required=False, + friendly_name="job search - exceused absense", validators=[validators.isInStringRange(0, 99),]), + Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, required=False, + friendly_name="job search - holiday", validators=[validators.isInStringRange(0, 99),]), + Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, required=False, + friendly_name="community service - hours of operation", + validators=[validators.isInStringRange(0, 99),]), + Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, required=False, + friendly_name="community service - excused absense", + validators=[validators.isInStringRange(0, 99),]), + Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, required=False, + friendly_name="community service - holiday", validators=[validators.isInStringRange(0, 99),]), + Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, + friendly_name="vocational education training - hours of operation", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, + friendly_name="vocational education - exceused absense", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, + friendly_name="vocational education training - holiday", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, + friendly_name="job skills training - hours of participation", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, + friendly_name="job skills training - excused absense", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, + friendly_name="job skills training holiday", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, + friendly_name="education no high school diploma - hours of operation", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, + friendly_name="education no high school diploma - excused absense", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, + friendly_name="education no high school diploma - holiday", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, + friendly_name="school attendance - hours of participation", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, + friendly_name="school attendance - exceused absense", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, + friendly_name="school attendance - holiday", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, + friendly_name="provide child care - hours of participation", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, + friendly_name="provide child care - excused absense", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, + friendly_name="provide child care - holiday", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, + friendly_name="other work activities", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, + friendly_name="number of deemed core hours for overall rate", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, + friendly_name="number of deemed core hours for two-parent rate", + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, + friendly_name="earned income", required=True, + validators=[validators.isInStringRange(0, 9999),]), + Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, + friendly_name="unearned income tax credit", + required=False, validators=[validators.isInStringRange(0, 9999),]), + Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, + friendly_name="unearned social security", + required=True, validators=[validators.isInStringRange(0, 9999),]), + Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=True, + friendly_name="unearned SSI", validators=[validators.isInStringRange(0, 9999),]), + Field(item="66D", name='UNEARNED_WORKERS_COMP', type='string', + startIndex=148, endIndex=152, required=True, + friendly_name="unearned workers compensation", + validators=[validators.isInStringRange(0, 9999),]), + Field(item="66E", name='OTHER_UNEARNED_INCOME', type='string', + startIndex=152, endIndex=156, required=True, + friendly_name="other unearned income", validators=[validators.isInStringRange(0, 9999),]), + ], + ) + ] + ) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index 4e14671cd..eba6cf68c 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -3,8 +3,7 @@ import pytest from ..fields import Field, value_is_empty from ..row_schema import RowSchema -from .. import schema_defs -from ..util import SchemaManager, make_generate_parser_error, create_test_datafile +from ..util import SchemaManager, create_test_datafile def passing_validator(): @@ -321,7 +320,6 @@ def test_datafile(stt_user, stt): return create_test_datafile('empty_file', stt_user, stt) - def test_run_postparsing_validators_returns_valid(): """Test run_postparsing_validators executes all postparsing_validators provided in schema.""" instance = {} diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index fefbe2da6..f962449c2 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -330,7 +330,8 @@ def test_validate_food_stamps(self, record): record.AMT_FOOD_STAMP_ASSISTANCE = 0 result = val(record) assert result == (False, 'if RECEIVES_FOOD_STAMPS :1 validator1 passed then ' - + 'AMT_FOOD_STAMP_ASSISTANCE 0 is not larger than 0.', ['RECEIVES_FOOD_STAMPS', 'AMT_FOOD_STAMP_ASSISTANCE']) + + 'AMT_FOOD_STAMP_ASSISTANCE 0 is not larger than 0.', + ['RECEIVES_FOOD_STAMPS', 'AMT_FOOD_STAMP_ASSISTANCE']) def test_validate_subsidized_child_care(self, record): """Test cat3 validator for subsidized child care.""" @@ -346,7 +347,8 @@ def test_validate_subsidized_child_care(self, record): record.RECEIVES_SUB_CC = 4 record.AMT_SUB_CC = 0 result = val(record) - assert result == (False, 'if RECEIVES_SUB_CC :4 validator1 passed then AMT_SUB_CC 0 is not larger than 0.', ['RECEIVES_SUB_CC', 'AMT_SUB_CC']) + assert result == (False, 'if RECEIVES_SUB_CC :4 validator1 passed then AMT_SUB_CC 0 is not larger than 0.', + ['RECEIVES_SUB_CC', 'AMT_SUB_CC']) def test_validate_cash_amount_and_nbr_months(self, record): """Test cat3 validator for cash amount and number of months.""" @@ -360,7 +362,8 @@ def test_validate_cash_amount_and_nbr_months(self, record): record.CASH_AMOUNT = 1 record.NBR_MONTHS = -1 result = val(record) - assert result == (False, 'if CASH_AMOUNT :1 validator1 passed then NBR_MONTHS -1 is not larger than 0.', ['CASH_AMOUNT', 'NBR_MONTHS']) + assert result == (False, 'if CASH_AMOUNT :1 validator1 passed then NBR_MONTHS -1 is not larger than 0.', + ['CASH_AMOUNT', 'NBR_MONTHS']) def test_validate_child_care(self, record): """Test cat3 validator for child care.""" @@ -656,7 +659,8 @@ def test_validate_work_eligible_indicator(self, record): record.WORK_ELIGIBLE_INDICATOR = "00" result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then WORK_ELIGIBLE_INDICATOR 00 is not ' + - 'in range [1, 9]. or 00 does not match 12.', ['FAMILY_AFFILIATION', 'WORK_ELIGIBLE_INDICATOR']) + 'in range [1, 9]. or 00 does not match 12.', + ['FAMILY_AFFILIATION', 'WORK_ELIGIBLE_INDICATOR']) def test_validate_work_participation(self, record): """Test cat3 validator for work participation.""" @@ -674,7 +678,8 @@ def test_validate_work_participation(self, record): record.WORK_PART_STATUS = "04" result = val(record) assert result == (False, "if FAMILY_AFFILIATION :2 validator1 passed then WORK_PART_STATUS 04 is not " + - "in ['01', '02', '05', '07', '09', '15', '17', '18', '19', '99'].", ['FAMILY_AFFILIATION', 'WORK_PART_STATUS']) + "in ['01', '02', '05', '07', '09', '15', '17', '18', '19', '99'].", + ['FAMILY_AFFILIATION', 'WORK_PART_STATUS']) val = validators.if_then_validator( condition_field='WORK_ELIGIBLE_INDICATOR', condition_function=validators.isInStringRange(1, 5), @@ -763,7 +768,8 @@ def test_validate_t3_education_level(self, record): record.FAMILY_AFFILIATION = 1 record.EDUCATION_LEVEL = "99" result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then EDUCATION_LEVEL 99 matches 99.', ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) + assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then EDUCATION_LEVEL 99 matches 99.', + ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) def test_validate_t3_citizenship(self, record): """Test cat3 validator for citizenship.""" @@ -814,7 +820,8 @@ def test_validate_ssn(self, record): record.FAMILY_AFFILIATION = 2 result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then SSN abc is not a number.',['FAMILY_AFFILIATION', 'SSN']) + assert result == (False, 'if FAMILY_AFFILIATION :2 validator1 passed then SSN abc is not a number.', + ['FAMILY_AFFILIATION', 'SSN']) def test_validate_ssn_citizenship(self, record): """Test cat3 validator for SSN/citizenship.""" @@ -989,7 +996,8 @@ def test_validate_federal_disability(self, record): result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then REC_FEDERAL_DISABILITY 0 is not ' + - 'larger or equal to 1 and smaller or equal to 2.', ['FAMILY_AFFILIATION', 'REC_FEDERAL_DISABILITY']) + 'larger or equal to 1 and smaller or equal to 2.', + ['FAMILY_AFFILIATION', 'REC_FEDERAL_DISABILITY']) class TestT6Cat3Validators(TestCat3ValidatorsBase): @@ -1037,7 +1045,7 @@ def test_sum_of_recipients(self, record): record.NUM_RECIPIENTS = 2 result = val(record) - assert result == (True, None, ['NUM_RECIPIENTS', 'NUM_ADULT_RECIPIENTS', 'NUM_CHILD_RECIPIENTS'] ) + assert result == (True, None, ['NUM_RECIPIENTS', 'NUM_ADULT_RECIPIENTS', 'NUM_CHILD_RECIPIENTS']) record.NUM_RECIPIENTS = 1 result = val(record) diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index a85749f7c..1c4205445 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -31,14 +31,14 @@ def create_test_datafile(filename, stt_user, stt, section='Active Case Data'): def generate_parser_error(datafile, line_number, schema, error_category, error_message, record=None, field=None): """Create and return a ParserError using args.""" if type(field) == list: - fields_json = { + fields_json = { "friend_name": { - getattr(f, 'name', None): getattr(f, 'friendly_name', None) for f in field + getattr(f, 'name', None): getattr(f, 'friendly_name', None) for f in field } } else: fields_json = {} - + return ParserError( file=datafile, row_number=line_number, From 96634b2cc991685347e940e7d565cf9dbd420fa5 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 14 Nov 2023 16:38:59 -0500 Subject: [PATCH 37/88] corrections on views/tests --- .../tdpservice/parsers/schema_defs/ssp/m1.py | 2 +- .../tdpservice/parsers/test/test_util.py | 58 ++++++++++++++++--- tdrs-backend/tdpservice/parsers/util.py | 2 +- tdrs-backend/tdpservice/parsers/views.py | 8 +-- 4 files changed, 57 insertions(+), 13 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 4ebf423c5..8b14fbd19 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -192,7 +192,7 @@ validators.isLargerThanOrEqualTo(0), ]), Field(item="24AII", name='WORK_REQ_SANCTION', type='number', startIndex=95, endIndex=96, - friendly_name="work requirements sanction", srequired=True, validators=[ + friendly_name="work requirements sanction", required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="24AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=96, endIndex=97, diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index eba6cf68c..98dcf98de 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -3,7 +3,7 @@ import pytest from ..fields import Field, value_is_empty from ..row_schema import RowSchema -from ..util import SchemaManager, create_test_datafile +from ..util import SchemaManager, make_generate_parser_error, create_test_datafile def passing_validator(): @@ -314,12 +314,6 @@ def test_field_validators_blank_and_not_required_returns_valid(first): assert errors == [] -@pytest.fixture -def test_datafile(stt_user, stt): - """Fixture for small_correct_file.""" - return create_test_datafile('empty_file', stt_user, stt) - - def test_run_postparsing_validators_returns_valid(): """Test run_postparsing_validators executes all postparsing_validators provided in schema.""" instance = {} @@ -485,3 +479,53 @@ def test_multi_record_schema_parses_and_validates(): assert r3_record == {'fourth': '5'} assert r3_is_valid is False assert r3_errors == ['Value is not valid.'] + +@pytest.fixture +def test_datafile(stt_user, stt): + """Fixture for small_correct_file.""" + return create_test_datafile('empty_file', stt_user, stt) + +@pytest.mark.django_db() +def test_run_postparsing_validators_returns_frinedly_fieldnames(test_datafile): + """Test run_postparsing_validators executes all postparsing_validators provided in schema.""" + + def postparse_validator(): + """Fake validator that always returns valid.""" + return lambda _: (False, "an Error", ["FIRST", "SECOND"]) + + instance = {} + schema = RowSchema( + model=dict, + postparsing_validators=[ + postparse_validator() + ], + fields=[ + Field( + item=1, + name='FIRST', + friendly_name='first', + type='string', + startIndex=0, + endIndex=3, + required=False, + validators=[] + ), + Field( + item=2, + name='SECOND', + friendly_name='second', + type='string', + startIndex=3, + endIndex=4, + required=False, + validators=[] + ), + ] + ) + + is_valid, errors = schema.run_postparsing_validators(instance, make_generate_parser_error( + test_datafile, 10 + )) + assert is_valid is False + assert errors[0].fields_json == {'friendly_name': {'FIRST': 'first', 'SECOND': 'second'}} + assert errors[0].error_message == "an Error" diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 1c4205445..b61a82913 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -32,7 +32,7 @@ def generate_parser_error(datafile, line_number, schema, error_category, error_m """Create and return a ParserError using args.""" if type(field) == list: fields_json = { - "friend_name": { + "friendly_name": { getattr(f, 'name', None): getattr(f, 'friendly_name', None) for f in field } } diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index 0f32a80e6..ca8b77842 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -50,11 +50,11 @@ def _get_xls_serialized_file(self, data): int(str(x['rpt_month_year'])[4:]) ] if x['rpt_month_year'] else None), ('error_type', lambda x: x['error_type']), - ('error_message', lambda x: 1), #lambda x: x['error_message'].replace( - #x['field_name'], - #str(x['fields_json']))), + ('error_message', lambda x: 1), lambda x: x['error_message'].replace( + x['field_name'], + str(x['fields_json']['friendly_name'])), ('item_number', lambda x: x['item_number']), - ('item_name', lambda x: str(x['fields_json'])), + ('item_name', lambda x: str(x['fields_json']['friendly_name'])), ('internal_variable_name', lambda x: x['field_name']), ('row_number', lambda x: x['row_number']), ('column_number', lambda x: x['column_number']) From 0be491f9056cdfd5e0c9e46763174c084a8f38bb Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 15 Nov 2023 11:46:53 -0500 Subject: [PATCH 38/88] corrections for fields --- tdrs-backend/tdpservice/parsers/fields.py | 12 +- .../tdpservice/parsers/schema_defs/tanf/t2.py | 570 +++++++++--------- tdrs-backend/tdpservice/parsers/validators.py | 3 +- 3 files changed, 286 insertions(+), 299 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/fields.py b/tdrs-backend/tdpservice/parsers/fields.py index af60769dd..617006f32 100644 --- a/tdrs-backend/tdpservice/parsers/fields.py +++ b/tdrs-backend/tdpservice/parsers/fields.py @@ -75,9 +75,17 @@ def parse_value(self, line): class TransformField(Field): """Represents a field that requires some transformation before serializing.""" - def __init__(self, transform_func, item, name, type, startIndex, endIndex, required=True, + def __init__(self, transform_func, item, name, friendly_name, type, startIndex, endIndex, required=True, validators=[], **kwargs): - super().__init__(item, name, type, startIndex, endIndex, required, validators) + super().__init__( + item=item, + name=name, + type=type, + friendly_name=friendly_name, + startIndex=startIndex, + endIndex=endIndex, + required=required, + validators=validators) self.transform_func = transform_func self.kwargs = kwargs diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index d06b793a5..0c39f08bc 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -9,323 +9,301 @@ from tdpservice.search_indexes.models.tanf import TANF_T2 -t2 = SchemaManager( - schemas=[ - RowSchema( - model=TANF_T2, - preparsing_validators=[ - validators.hasLength(156), - ], - postparsing_validators=[ +t2 = SchemaManager(schemas=[ + RowSchema( + model=TANF_T2, + preparsing_validators=[ + validators.hasLength(156), + ], + postparsing_validators=[ validators.validate__FAM_AFF__SSN(), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.matches(1), - result_field="SSN", - result_function=validators.validateSSN(), + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='SSN', result_function=validators.validateSSN(), ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="RACE_HISPANIC", - result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="RACE_AMER_INDIAN", - result_function=validators.isInLimits(1, 2), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="RACE_ASIAN", - result_function=validators.isInLimits(1, 2), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="RACE_BLACK", - result_function=validators.isInLimits(1, 2), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="RACE_HAWAIIAN", - result_function=validators.isInLimits(1, 2), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="RACE_WHITE", - result_function=validators.isInLimits(1, 2), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="MARITAL_STATUS", - result_function=validators.isInLimits(1, 5), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 2), - result_field="PARENT_WITH_MINOR_CHILD", - result_function=validators.isInLimits(1, 3), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), + result_field='PARENT_WITH_MINOR_CHILD', result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="EDUCATION_LEVEL", - result_function=validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='EDUCATION_LEVEL', result_function=validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + ), ), - ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.matches(1), - result_field="CITIZENSHIP_STATUS", - result_function=validators.oneOf((1, 2)), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="COOPERATION_CHILD_SUPPORT", - result_function=validators.oneOf((1, 2, 9)), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='COOPERATION_CHILD_SUPPORT', result_function=validators.oneOf((1, 2, 9)), + ), validators.validate__FAM_AFF__HOH__Fed_Time(), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.isInLimits(1, 3), - result_field="EMPLOYMENT_STATUS", - result_function=validators.isInLimits(1, 3), - ), + condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), + result_field='EMPLOYMENT_STATUS', result_function=validators.isInLimits(1, 3), + ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.oneOf((1, 2)), - result_field="WORK_ELIGIBLE_INDICATOR", - result_function=validators.or_validators( - validators.isInStringRange(1, 9), validators.oneOf(("11", "12")) + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='WORK_ELIGIBLE_INDICATOR', result_function=validators.or_validators( + validators.isInStringRange(1, 9), + validators.oneOf(('11', '12')) + ), ), - ), validators.if_then_validator( - condition_field="FAMILY_AFFILIATION", - condition_function=validators.oneOf((1, 2)), - result_field="WORK_PART_STATUS", - result_function=validators.oneOf( - ["01", "02", "05", "07", "09", "15", "17", "18", "19", "99"] + condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), + result_field='WORK_PART_STATUS', result_function=validators.oneOf(['01', '02', '05', '07', '09', + '15', '17', '18', '19', '99'] + ), ), - ), validators.if_then_validator( - condition_field="WORK_ELIGIBLE_INDICATOR", - condition_function=validators.isInStringRange(1, 5), - result_field="WORK_PART_STATUS", - result_function=validators.notMatches("99"), - ), + condition_field='WORK_ELIGIBLE_INDICATOR', condition_function=validators.isInStringRange(1, 5), + result_field='WORK_PART_STATUS', result_function=validators.notMatches('99'), + ), ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name="record type", required=True, validators=[]), - Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="report month year", required=True, - validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(),]), - Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - friendly_name="case number", required=True, validators=[validators.isAlphaNumeric()]), - Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - friendly_name="family affiliation", required=True, validators=[validators.oneOf([1, 2, 3, 5])]), - Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, - friendly_name="noncustodial parent", validators=[validators.oneOf([1, 2])]), - Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, - friendly_name="date of birth", validators=[validators.isLargerThan(0),]), - TransformField( - transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, - friendly_name="social security number SSN", endIndex=38, required=True, - validators=[validators.validateSSN()], is_encrypted=False), - Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, - friendly_name="race hispanic", validators=[validators.isInLimits(0, 2)]), - Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, - friendly_name="race american indian", validators=[validators.isInLimits(0, 2)]), - Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, - friendly_name="race asian", validators=[validators.isInLimits(0, 2)]), - Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, - friendly_name="race black", validators=[validators.isInLimits(0, 2)]), - Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, - friendly_name="race hawaiian", validators=[validators.isInLimits(0, 2)]), - Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, - friendly_name="race white", validators=[validators.isInLimits(0, 2)]), - Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, - friendly_name="gender", validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, - friendly_name="fed qasdi program", validators=[validators.oneOf([1, 2])]), - Field(item="36B", name='FED_DISABILITY_STATUS', type='number', - startIndex=46, endIndex=47, required=True, - friendly_name="fed disability status", validators=[validators.oneOf([1, 2])]), - Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', - startIndex=47, endIndex=48, required=True, - friendly_name="disbaled title xivapdt", - validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), - Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, - friendly_name="aid aged blind", validators=[validators.isLargerThanOrEqualTo(0),]), - Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, - friendly_name="receive ssi", validators=[validators.oneOf([1, 2]),]), - Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, - friendly_name="marital status", validators=[validators.isInLimits(0, 5),]), - Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, - friendly_name="relationship to head of household", - validators=[validators.isInStringRange(1, 10),]), - Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', - startIndex=53, endIndex=54, required=False, - friendly_name="parent with minor child", validators=[validators.isInLimits(0, 3),]), - Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', - startIndex=54, endIndex=55, required=False, - friendly_name="needs of pregnant woman", validators=[validators.isInLimits(0, 9),]), - Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, - friendly_name="education level", - validators=[ - validators.or_validators(validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99)) - ]), - Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, - friendly_name="citizenship status", validators=[validators.oneOf([0, 1, 2, 9])]), - Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - friendly_name="coopeartion with child support", required=False, - validators=[validators.oneOf([0, 1, 2, 9]),]), - Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', - startIndex=59, endIndex=62, required=False, - friendly_name="number of months countable toward federal time limit", - validators=[validators.isInStringRange(0, 999),]), - Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', - startIndex=62, endIndex=64, required=False, - friendly_name="months of state time limit", validators=[validators.isInStringRange(0, 99),]), - Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, - friendly_name="is current month exempt from the state time limit", - required=False, validators=[validators.isInLimits(0, 9),]), - Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, - friendly_name="employment status", validators=[validators.isInLimits(0, 3),]), - Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', - startIndex=66, endIndex=68, required=True, - friendly_name="work-eligible indivdual indicator", - validators=[ - validators.or_validators(validators.isInStringRange(0, 9), - validators.oneOf(('11', '12'))) - ]), - Field(item="49", name='WORK_PART_STATUS', type='string', startIndex=68, endIndex=70, required=False, - friendly_name="work participation status", - validators=[ - validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99']) - ]), - Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, - friendly_name="employement status", validators=[validators.isInStringRange(0, 99),]), - Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', - startIndex=72, endIndex=74, required=False, - friendly_name="subsidized private employment", validators=[validators.isInStringRange(0, 99),]), - Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', - startIndex=74, endIndex=76, required=False, - friendly_name="subsidized public employment", validators=[validators.isInStringRange(0, 99),]), - Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', - startIndex=76, endIndex=78, required=False, - friendly_name="work experience - hours of participation", - validators=[validators.isInStringRange(0, 99),]), - Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', - startIndex=78, endIndex=80, required=False, - friendly_name="work experience - excused absence", - validators=[validators.isInStringRange(0, 99),]), - Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', - startIndex=80, endIndex=82, required=False, - friendly_name="work experience - holiday", validators=[validators.isInStringRange(0, 99),]), - Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, - friendly_name="on the job training", - validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=False, - friendly_name="job search - hours of operation", - validators=[validators.isInStringRange(0, 99),]), - Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, required=False, - friendly_name="job search - exceused absense", validators=[validators.isInStringRange(0, 99),]), - Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, required=False, - friendly_name="job search - holiday", validators=[validators.isInStringRange(0, 99),]), - Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, required=False, - friendly_name="community service - hours of operation", - validators=[validators.isInStringRange(0, 99),]), - Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, required=False, - friendly_name="community service - excused absense", - validators=[validators.isInStringRange(0, 99),]), - Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, required=False, - friendly_name="community service - holiday", validators=[validators.isInStringRange(0, 99),]), - Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, - friendly_name="vocational education training - hours of operation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, - friendly_name="vocational education - exceused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, - friendly_name="vocational education training - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, - friendly_name="job skills training - hours of participation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, - friendly_name="job skills training - excused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, - friendly_name="job skills training holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, - friendly_name="education no high school diploma - hours of operation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, - friendly_name="education no high school diploma - excused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, - friendly_name="education no high school diploma - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, - friendly_name="school attendance - hours of participation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, - friendly_name="school attendance - exceused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, - friendly_name="school attendance - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, - friendly_name="provide child care - hours of participation", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, - friendly_name="provide child care - excused absense", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, - friendly_name="provide child care - holiday", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, - friendly_name="other work activities", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, - friendly_name="number of deemed core hours for overall rate", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, - friendly_name="number of deemed core hours for two-parent rate", - required=False, validators=[validators.isInStringRange(0, 99),]), - Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, - friendly_name="earned income", required=True, - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, - friendly_name="unearned income tax credit", - required=False, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, - friendly_name="unearned social security", - required=True, validators=[validators.isInStringRange(0, 9999),]), - Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=True, - friendly_name="unearned SSI", validators=[validators.isInStringRange(0, 9999),]), - Field(item="66D", name='UNEARNED_WORKERS_COMP', type='string', - startIndex=148, endIndex=152, required=True, - friendly_name="unearned workers compensation", - validators=[validators.isInStringRange(0, 9999),]), - Field(item="66E", name='OTHER_UNEARNED_INCOME', type='string', - startIndex=152, endIndex=156, required=True, - friendly_name="other unearned income", validators=[validators.isInStringRange(0, 9999),]), - ], - ) - ] - ) + fields=[ + Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + required=True, friendly_name='record type', validators=[]), + Field(item="4", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, + required=True, friendly_name='reporting month/year', + validators=[validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ]), + Field(item="6", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, + required=True, friendly_name='case number', + validators=[validators.isAlphaNumeric()]), + Field(item="30", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, + required=True, friendly_name='family affiliation', + validators=[validators.oneOf([1, 2, 3, 5])]), + Field(item="31", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, required=True, + friendly_name='noncustodial parent', + validators=[validators.oneOf([1, 2])]), + Field(item="32", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, required=True, + friendly_name='date of birth', + validators=[validators.isLargerThan(0),]), + TransformField(transform_func=tanf_ssn_decryption_func, item="33", name='SSN', type='string', startIndex=29, + endIndex=38, required=True, friendly_name='social security number', + validators=[validators.validateSSN()], is_encrypted=False), + Field(item="34A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, + friendly_name='race hispanic', + validators=[validators.isInLimits(0, 2)]), + Field(item="34B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, required=False, + friendly_name='race american Indian', + validators=[validators.isInLimits(0, 2)]), + Field(item="34C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, required=False, + friendly_name='race asian', + validators=[validators.isInLimits(0, 2)]), + Field(item="34D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, required=False, + friendly_name='race black', + validators=[validators.isInLimits(0, 2)]), + Field(item="34E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, required=False, + friendly_name='race Hawaiian', + validators=[validators.isInLimits(0, 2)]), + Field(item="34F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, required=False, + friendly_name='race white', + validators=[validators.isInLimits(0, 2)]), + Field(item="35", name='GENDER', type='number', startIndex=44, endIndex=45, required=True, + friendly_name='gender', + validators=[validators.isLargerThanOrEqualTo(0),]), + Field(item="36A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, required=True, + friendly_name='federal oasdi program', + validators=[validators.oneOf([1, 2])]), + Field(item="36B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, required=True, + friendly_name='federal disability status', + validators=[validators.oneOf([1, 2])]), + Field(item="36C", name='DISABLED_TITLE_XIVAPDT', type='string', startIndex=47, endIndex=48, required=True, + friendly_name='disabled title xivapdt', + validators=[validators.or_validators(validators.oneOf(["1", "2"]), validators.isBlank())]), + Field(item="36D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, required=False, + friendly_name='aid aged blind', + validators=[validators.isLargerThanOrEqualTo(0),]), + Field(item="36E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, required=True, + friendly_name='receive ssi', + validators=[validators.oneOf([1, 2]),]), + Field(item="37", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, required=False, + friendly_name='marital status', + validators=[validators.isInLimits(0, 5),]), + Field(item="38", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, required=True, + friendly_name='relationship to head of household', + validators=[validators.isInStringRange(1, 10),]), + Field(item="39", name='PARENT_WITH_MINOR_CHILD', type='number', startIndex=53, endIndex=54, required=False, + friendly_name='parent with minor child', + validators=[validators.isInLimits(0, 3),]), + Field(item="40", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, required=False, + friendly_name='needs pregnant woman', + validators=[validators.isInLimits(0, 9),]), + Field(item="41", name='EDUCATION_LEVEL', type='string', startIndex=55, endIndex=57, required=False, + friendly_name='education level', + validators=[validators.or_validators(validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + )]), + Field(item="42", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, required=False, + friendly_name='citizenship status', + validators=[validators.oneOf([0, 1, 2, 9])]), + Field(item="43", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, + friendly_name='cooperation child support', + required=False, validators=[validators.oneOf([0, 1, 2, 9]),]), + Field(item="44", name='MONTHS_FED_TIME_LIMIT', type='string', startIndex=59, endIndex=62, required=False, + friendly_name='months federal time limit', + validators=[validators.isInStringRange(0, 999),]), + Field(item="45", name='MONTHS_STATE_TIME_LIMIT', type='string', startIndex=62, endIndex=64, required=False, + friendly_name='months state time limit', + validators=[validators.isInStringRange(0, 99),]), + Field(item="46", name='CURRENT_MONTH_STATE_EXEMPT', type='number', startIndex=64, endIndex=65, + friendly_name='current month state exempt', + required=False, validators=[validators.isInLimits(0, 9),]), + Field(item="47", name='EMPLOYMENT_STATUS', type='number', startIndex=65, endIndex=66, required=False, + friendly_name='employment status', + validators=[validators.isInLimits(0, 3),]), + Field(item="48", name='WORK_ELIGIBLE_INDICATOR', type='string', startIndex=66, endIndex=68, required=True, + friendly_name='work eligible indicator', + validators=[validators.or_validators(validators.isInStringRange(0, 9), + validators.oneOf(('11', '12')) + )]), + Field(item="49", name='WORK_PART_STATUS', type='string', startIndex=68, endIndex=70, required=False, + friendly_name='work participation status', + validators=[validators.oneOf(['01', '02', '05', '07', '09', '15', '16', '17', '18', '19', '99'])]), + Field(item="50", name='UNSUB_EMPLOYMENT', type='string', startIndex=70, endIndex=72, required=False, + friendly_name='unsubsidized employment', + validators=[validators.isInStringRange(0, 99),]), + Field(item="51", name='SUB_PRIVATE_EMPLOYMENT', type='string', startIndex=72, endIndex=74, required=False, + friendly_name='subsidized provate employment', + validators=[validators.isInStringRange(0, 99),]), + Field(item="52", name='SUB_PUBLIC_EMPLOYMENT', type='string', startIndex=74, endIndex=76, required=False, + friendly_name='subsidized public employment', + validators=[validators.isInStringRange(0, 99),]), + Field(item="53A", name='WORK_EXPERIENCE_HOP', type='string', startIndex=76, endIndex=78, required=False, + friendly_name='work experience hours of participation', + validators=[validators.isInStringRange(0, 99),]), + Field(item="53B", name='WORK_EXPERIENCE_EA', type='string', startIndex=78, endIndex=80, required=False, + friendly_name='work experience excused absence', + validators=[validators.isInStringRange(0, 99),]), + Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', startIndex=80, endIndex=82, required=False, + friendly_name='work experience holiday', + validators=[validators.isInStringRange(0, 99),]), + Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, + friendly_name='ojt', + validators=[validators.isInStringRange(0, 99),]), + Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=False, + friendly_name='job search hours of participation', + validators=[validators.isInStringRange(0, 99),]), + Field(item="55B", name='JOB_SEARCH_EA', type='string', startIndex=86, endIndex=88, required=False, + friendly_name='job search excused absence', + validators=[validators.isInStringRange(0, 99),]), + Field(item="55C", name='JOB_SEARCH_HOL', type='string', startIndex=88, endIndex=90, required=False, + friendly_name='job search holiday', + validators=[validators.isInStringRange(0, 99),]), + Field(item="56A", name='COMM_SERVICES_HOP', type='string', startIndex=90, endIndex=92, required=False, + friendly_name='community services hrs of participation', + validators=[validators.isInStringRange(0, 99),]), + Field(item="56B", name='COMM_SERVICES_EA', type='string', startIndex=92, endIndex=94, required=False, + friendly_name='community services excused absence', + validators=[validators.isInStringRange(0, 99),]), + Field(item="56C", name='COMM_SERVICES_HOL', type='string', startIndex=94, endIndex=96, required=False, + friendly_name='community services holiday', + validators=[validators.isInStringRange(0, 99),]), + Field(item="57A", name='VOCATIONAL_ED_TRAINING_HOP', type='string', startIndex=96, endIndex=98, + friendly_name='vocational education training - hrs of participation', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="57B", name='VOCATIONAL_ED_TRAINING_EA', type='string', startIndex=98, endIndex=100, + friendly_name='vocational education training excused absence', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="57C", name='VOCATIONAL_ED_TRAINING_HOL', type='string', startIndex=100, endIndex=102, + friendly_name='vocational education training holiday', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58A", name='JOB_SKILLS_TRAINING_HOP', type='string', startIndex=102, endIndex=104, + friendly_name='job skills training hrs of participation', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58B", name='JOB_SKILLS_TRAINING_EA', type='string', startIndex=104, endIndex=106, + friendly_name='job skills training excused absence', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="58C", name='JOB_SKILLS_TRAINING_HOL', type='string', startIndex=106, endIndex=108, + friendly_name='job skills training - holiday', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='string', startIndex=108, endIndex=110, + friendly_name='education no high schoold diploma hrs of particiation', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='string', startIndex=110, endIndex=112, + friendly_name='education no high school diploma eacused absence', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="59C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='string', startIndex=112, endIndex=114, + friendly_name='education no high school diploma - holiday', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60A", name='SCHOOL_ATTENDENCE_HOP', type='string', startIndex=114, endIndex=116, + friendly_name='school attendance - hrs of participation', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60B", name='SCHOOL_ATTENDENCE_EA', type='string', startIndex=116, endIndex=118, + friendly_name='school attendance - excused absence', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="60C", name='SCHOOL_ATTENDENCE_HOL', type='string', startIndex=118, endIndex=120, + friendly_name='school attendance - holiday', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61A", name='PROVIDE_CC_HOP', type='string', startIndex=120, endIndex=122, + friendly_name='provide child care - hrs of participation', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61B", name='PROVIDE_CC_EA', type='string', startIndex=122, endIndex=124, + friendly_name='provide child care - excused absence', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="61C", name='PROVIDE_CC_HOL', type='string', startIndex=124, endIndex=126, + friendly_name='provide child care - holiday', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="62", name='OTHER_WORK_ACTIVITIES', type='string', startIndex=126, endIndex=128, + friendly_name='other work activities', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="63", name='DEEMED_HOURS_FOR_OVERALL', type='string', startIndex=128, endIndex=130, + friendly_name='deemed hours for overall', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="64", name='DEEMED_HOURS_FOR_TWO_PARENT', type='string', startIndex=130, endIndex=132, + friendly_name='deemed hours for two parent', + required=False, validators=[validators.isInStringRange(0, 99),]), + Field(item="65", name='EARNED_INCOME', type='string', startIndex=132, endIndex=136, + friendly_name='earned income', + required=True, validators=[validators.isInStringRange(0, 9999),]), + Field(item="66A", name='UNEARNED_INCOME_TAX_CREDIT', type='string', startIndex=136, endIndex=140, + friendly_name='unearned income tax credit', + required=False, validators=[validators.isInStringRange(0, 9999),]), + Field(item="66B", name='UNEARNED_SOCIAL_SECURITY', type='string', startIndex=140, endIndex=144, + friendly_name='un earned social security', + required=True, validators=[validators.isInStringRange(0, 9999),]), + Field(item="66C", name='UNEARNED_SSI', type='string', startIndex=144, endIndex=148, required=True, + friendly_name='unearned ssi', + validators=[validators.isInStringRange(0, 9999),]), + Field(item="66D", name='UNEARNED_WORKERS_COMP', type='string', startIndex=148, endIndex=152, required=True, + friendly_name='unearned workers compensation', + validators=[validators.isInStringRange(0, 9999),]), + Field(item="66E", name='OTHER_UNEARNED_INCOME', type='string', startIndex=152, endIndex=156, required=True, + friendly_name='other unearned income', + validators=[validators.isInStringRange(0, 9999),]), + ], + )] +) \ No newline at end of file diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index accc166de..dde771cc3 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -443,7 +443,8 @@ def validate(instance): if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if MONTHS_FED_TIME_LIMIT is None or int(MONTHS_FED_TIME_LIMIT) < 1: return (False, - 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, then MONTHS_FED_TIME_LIMIT > 1.' + 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, then MONTHS_FED_TIME_LIMIT > 1.', + ['FAMILY_AFFILIATION', 'MONTHS_FED_TIME_LIMIT'] ) else: return ( From 02ce7d0fd80d7bda6ed5274576307d36db7abba9 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 15 Nov 2023 11:56:02 -0500 Subject: [PATCH 39/88] failing test corrected --- tdrs-backend/tdpservice/parsers/test/test_util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index 98dcf98de..2a4e75c15 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -3,6 +3,7 @@ import pytest from ..fields import Field, value_is_empty from ..row_schema import RowSchema +from ..schema_defs import * from ..util import SchemaManager, make_generate_parser_error, create_test_datafile From aa8a534e33a894231d4b80ecc2903f1639bb2933 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 15 Nov 2023 12:59:15 -0500 Subject: [PATCH 40/88] failing test corrected --- .../tdpservice/parsers/schema_defs/tanf/t2.py | 4 ++-- tdrs-backend/tdpservice/parsers/test/test_util.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 0c39f08bc..82b70e7fb 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -211,7 +211,7 @@ Field(item="53C", name='WORK_EXPERIENCE_HOL', type='string', startIndex=80, endIndex=82, required=False, friendly_name='work experience holiday', validators=[validators.isInStringRange(0, 99),]), - Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, + Field(item="54", name='OJT', type='string', startIndex=82, endIndex=84, required=False, friendly_name='ojt', validators=[validators.isInStringRange(0, 99),]), Field(item="55A", name='JOB_SEARCH_HOP', type='string', startIndex=84, endIndex=86, required=False, @@ -306,4 +306,4 @@ validators=[validators.isInStringRange(0, 9999),]), ], )] -) \ No newline at end of file +) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index 2a4e75c15..4b2d18319 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -281,12 +281,12 @@ def test_field_validators_blank_and_required_returns_error(first, second): ] -@pytest.mark.parametrize('first', [ - (' '), - ('#'), - (None), +@pytest.mark.parametrize('first, expected_valid, expected_errors', [ + (' ', True, []), + ('####', False, ['Value is not valid.']), + (None, True, []), ]) -def test_field_validators_blank_and_not_required_returns_valid(first): +def test_field_validators_blank_and_not_required_returns_valid(first, expected_valid, expected_errors): """Test not required field returns valid if value not provided (blank).""" instance = { 'first': first, @@ -311,8 +311,8 @@ def test_field_validators_blank_and_not_required_returns_valid(first): ) is_valid, errors = schema.run_field_validators(instance, error_func) - assert is_valid is True - assert errors == [] + assert is_valid is expected_valid + assert errors == expected_errors def test_run_postparsing_validators_returns_valid(): From 19926ea17a4a5506c091d680557d8559bdbf055c Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 15 Nov 2023 13:52:12 -0500 Subject: [PATCH 41/88] correcting test failures --- tdrs-backend/tdpservice/parsers/test/test_parse.py | 7 +++---- tdrs-backend/tdpservice/parsers/test/test_util.py | 6 +++--- tdrs-backend/tdpservice/parsers/test/test_validators.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index dfb70f724..9a2e9ad8a 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -453,16 +453,15 @@ def test_parse_ssp_section1_datafile(ssp_section1_datafile): parse.parse_datafile(ssp_section1_datafile) parser_errors = ParserError.objects.filter(file=ssp_section1_datafile) - assert parser_errors.count() == 10 + assert parser_errors.count() == 19846 err = parser_errors.first() - assert err.row_number == 10339 + assert err.row_number == 2 assert err.error_type == ParserErrorCategoryChoices.FIELD_VALUE - assert err.error_message == 'EARNED_INCOME is required but a value was not provided.' + assert err.error_message == '3 is not larger or equal to 1 and smaller or equal to 2.' assert err.content_type is not None assert err.object_id is not None - assert err.fields_json == {'friendly_name': 'earned income'} assert parser_errors.count() == 19846 assert SSP_M1.objects.count() == expected_m1_record_count diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index 4b2d18319..887ba21b3 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -482,12 +482,12 @@ def test_multi_record_schema_parses_and_validates(): assert r3_errors == ['Value is not valid.'] @pytest.fixture -def test_datafile(stt_user, stt): +def test_datafile_empty_file(stt_user, stt): """Fixture for small_correct_file.""" return create_test_datafile('empty_file', stt_user, stt) @pytest.mark.django_db() -def test_run_postparsing_validators_returns_frinedly_fieldnames(test_datafile): +def test_run_postparsing_validators_returns_frinedly_fieldnames(test_datafile_empty_file): """Test run_postparsing_validators executes all postparsing_validators provided in schema.""" def postparse_validator(): @@ -525,7 +525,7 @@ def postparse_validator(): ) is_valid, errors = schema.run_postparsing_validators(instance, make_generate_parser_error( - test_datafile, 10 + test_datafile_empty_file, 10 )) assert is_valid is False assert errors[0].fields_json == {'friendly_name': {'FIRST': 'first', 'SECOND': 'second'}} diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index f962449c2..22e1a3208 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -624,7 +624,7 @@ def test_validate_months_federal_time_limit(self, record): result = val(record) assert result == (False, 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, ' + 'then MONTHS_FED_TIME_LIMIT > 1.', - ['FAMILY_AFFILIATION', 'RELATIONSHIP_HOH', 'MONTHS_FED_TIME_LIMIT']) + ['FAMILY_AFFILIATION', 'MONTHS_FED_TIME_LIMIT']) def test_validate_employment_status(self, record): """Test cat3 validator for employment status.""" From 6b7c86eff9fda09674e3aa00d466251e030ce750 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 16 Nov 2023 09:47:00 -0500 Subject: [PATCH 42/88] linting --- tdrs-backend/tdpservice/parsers/fields.py | 4 ++-- tdrs-backend/tdpservice/parsers/validators.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/fields.py b/tdrs-backend/tdpservice/parsers/fields.py index 617006f32..e411d1efa 100644 --- a/tdrs-backend/tdpservice/parsers/fields.py +++ b/tdrs-backend/tdpservice/parsers/fields.py @@ -78,8 +78,8 @@ class TransformField(Field): def __init__(self, transform_func, item, name, friendly_name, type, startIndex, endIndex, required=True, validators=[], **kwargs): super().__init__( - item=item, - name=name, + item=item, + name=name, type=type, friendly_name=friendly_name, startIndex=startIndex, diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index dde771cc3..ec7aef37f 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -443,7 +443,8 @@ def validate(instance): if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if MONTHS_FED_TIME_LIMIT is None or int(MONTHS_FED_TIME_LIMIT) < 1: return (False, - 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2, then MONTHS_FED_TIME_LIMIT > 1.', + 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2,\ + then MONTHS_FED_TIME_LIMIT > 1.', ['FAMILY_AFFILIATION', 'MONTHS_FED_TIME_LIMIT'] ) else: From 94ef1803464cdda18d035e442a95892da532db38 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 16 Nov 2023 16:10:31 -0500 Subject: [PATCH 43/88] corrected the excel fiel generator --- tdrs-backend/tdpservice/parsers/util.py | 6 ++++++ tdrs-backend/tdpservice/parsers/views.py | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index b61a82913..4749042e2 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -36,6 +36,12 @@ def generate_parser_error(datafile, line_number, schema, error_category, error_m getattr(f, 'name', None): getattr(f, 'friendly_name', None) for f in field } } + elif field is not None: + fields_json = { + "friendly_name": { + getattr(field, 'name', None): getattr(field, 'friendly_name', None), + } + } else: fields_json = {} diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index ca8b77842..b5a9d20a4 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -39,6 +39,14 @@ def get_queryset(self): def _get_xls_serialized_file(self, data): """Return xls file created from the error.""" + + def format_error_msg(x): + """Format error message.""" + error_msg = x['error_message'] + for key, value in x['fields_json']['friendly_name'].items(): + error_msg = error_msg.replace(key, value) + return error_msg + row, col = 0, 0 output = BytesIO() workbook = xlsxwriter.Workbook(output) @@ -50,12 +58,10 @@ def _get_xls_serialized_file(self, data): int(str(x['rpt_month_year'])[4:]) ] if x['rpt_month_year'] else None), ('error_type', lambda x: x['error_type']), - ('error_message', lambda x: 1), lambda x: x['error_message'].replace( - x['field_name'], - str(x['fields_json']['friendly_name'])), + ('error_message', lambda x: format_error_msg(x)), ('item_number', lambda x: x['item_number']), - ('item_name', lambda x: str(x['fields_json']['friendly_name'])), - ('internal_variable_name', lambda x: x['field_name']), + ('item_name', lambda x: ','.join([i for i in x['fields_json']['friendly_name'].values()])), + ('internal_variable_name', lambda x: ','.join([i for i in x['fields_json']['friendly_name'].keys()])), ('row_number', lambda x: x['row_number']), ('column_number', lambda x: x['column_number']) ] @@ -73,10 +79,11 @@ def format_header(header_list: list): """Format header.""" return ' '.join([i.capitalize() for i in header_list.split('_')]) - [worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)] + # We will write the headers in the first row + [worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)] [ - worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns) + worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns) for row, data_i in enumerate(data) ] From b6eee039a813f8f93c899b847968c230841a0076 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 20 Nov 2023 10:50:14 -0500 Subject: [PATCH 44/88] removed excessive space in validator --- tdrs-backend/tdpservice/parsers/validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index ec7aef37f..f99d4970b 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -443,8 +443,8 @@ def validate(instance): if FAMILY_AFFILIATION == 1 and (RELATIONSHIP_HOH == 1 or RELATIONSHIP_HOH == 2): if MONTHS_FED_TIME_LIMIT is None or int(MONTHS_FED_TIME_LIMIT) < 1: return (False, - 'If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2,\ - then MONTHS_FED_TIME_LIMIT > 1.', + "If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2," + +" then MONTHS_FED_TIME_LIMIT > 1.", ['FAMILY_AFFILIATION', 'MONTHS_FED_TIME_LIMIT'] ) else: From 49dc39821ca5f7713bc13fd2d8c45b7c85ccb726 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 20 Nov 2023 11:33:18 -0500 Subject: [PATCH 45/88] linting --- tdrs-backend/tdpservice/parsers/test/test_util.py | 1 - tdrs-backend/tdpservice/parsers/validators.py | 2 +- tdrs-backend/tdpservice/parsers/views.py | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index 887ba21b3..32584b64a 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -3,7 +3,6 @@ import pytest from ..fields import Field, value_is_empty from ..row_schema import RowSchema -from ..schema_defs import * from ..util import SchemaManager, make_generate_parser_error, create_test_datafile diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index f99d4970b..ee1dcd587 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -444,7 +444,7 @@ def validate(instance): if MONTHS_FED_TIME_LIMIT is None or int(MONTHS_FED_TIME_LIMIT) < 1: return (False, "If FAMILY_AFFILIATION == 2 and MONTHS_FED_TIME_LIMIT== 1 or 2," - +" then MONTHS_FED_TIME_LIMIT > 1.", + + " then MONTHS_FED_TIME_LIMIT > 1.", ['FAMILY_AFFILIATION', 'MONTHS_FED_TIME_LIMIT'] ) else: diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index b5a9d20a4..606caf629 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -42,8 +42,8 @@ def _get_xls_serialized_file(self, data): def format_error_msg(x): """Format error message.""" - error_msg = x['error_message'] - for key, value in x['fields_json']['friendly_name'].items(): + error_msg = x['error_message'] + for key, value in x['fields_json']['friendly_name'].items(): error_msg = error_msg.replace(key, value) return error_msg @@ -80,10 +80,10 @@ def format_header(header_list: list): return ' '.join([i.capitalize() for i in header_list.split('_')]) # We will write the headers in the first row - [worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)] + [worksheet.write(row, col, format_header(key[0]), bold) for col, key in enumerate(report_columns)] [ - worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns) + worksheet.write(row + 3, col, key[1](data_i)) for col, key in enumerate(report_columns) for row, data_i in enumerate(data) ] From 92a549faac6837156c878561f55be983c81f680c Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 20 Nov 2023 11:30:43 -0700 Subject: [PATCH 46/88] - Updated based on review feedback --- tdrs-backend/tdpservice/parsers/parse.py | 15 ++++++++------- tdrs-backend/tdpservice/parsers/row_schema.py | 7 +++++++ .../tdpservice/parsers/test/test_parse.py | 2 ++ tdrs-backend/tdpservice/parsers/util.py | 15 +++------------ tdrs-backend/tdpservice/parsers/validators.py | 11 ++++++----- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index 8a55da6d2..a52a7f042 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -32,22 +32,23 @@ def parse_datafile(datafile): {"encryption", "tribe_code", "state_fips"}) # Validate tribe code in submission across program type and fips code - tribe_is_valid, tribe_error = validators.validate_header_tribe_code(header['program_type'], + tribe_is_valid, tribe_error = validators.validate_tribe_fips_program_agree(header['program_type'], field_values["tribe_code"], field_values["state_fips"], util.make_generate_parser_error(datafile, 1)) if not tribe_is_valid: - logger.info("Tribe Code binconsistency with Program Type and FIPS Code.") + logger.info(f"Tribe Code ({field_values['tribe_code']}) inconsistency with Program Type " + + f"({header['program_type']}) and FIPS Code ({field_values['state_fips']}).",) errors['header'] = [tribe_error] bulk_create_errors({1: [tribe_error]}, 1, flush=True) return errors - is_encrypted = util.contains_encrypted_indicator(header_line, field_values["encryption"]) - is_tribal = util.contains_tribe_code(header_line, field_values["tribe_code"]) + is_encrypted = field_values["encryption"] == "E" + is_tribal = util.is_string_field_valid(field_values["tribe_code"], 3) logger.debug(f"Datafile has encrypted fields: {is_encrypted}.") - logger.debug(f"Datafile is Tribal: {is_tribal}.") + logger.debug(f"Datafile: {datafile.__repr__()}, is Tribal: {is_tribal}.") # ensure file section matches upload section program_type = f"Tribal {header['program_type']}" if is_tribal else header['program_type'] @@ -67,7 +68,7 @@ def parse_datafile(datafile): bulk_create_errors(unsaved_parser_errors, 1, flush=True) return errors - line_errors = parse_datafile_lines(datafile, program_type, section, is_encrypted, is_tribal) + line_errors = parse_datafile_lines(datafile, program_type, section, is_encrypted) errors = errors | line_errors @@ -135,7 +136,7 @@ def rollback_parser_errors(datafile): num_deleted, models = ParserError.objects.filter(file=datafile).delete() logger.debug(f"Deleted {num_deleted} {ParserError}.") -def parse_datafile_lines(datafile, program_type, section, is_encrypted, is_tribal): +def parse_datafile_lines(datafile, program_type, section, is_encrypted): """Parse lines with appropriate schema and return errors.""" rawfile = datafile.file errors = {} diff --git a/tdrs-backend/tdpservice/parsers/row_schema.py b/tdrs-backend/tdpservice/parsers/row_schema.py index 8e217e78f..55a48ae33 100644 --- a/tdrs-backend/tdpservice/parsers/row_schema.py +++ b/tdrs-backend/tdpservice/parsers/row_schema.py @@ -172,3 +172,10 @@ def get_field_values_by_names(self, line, names={}): if field.name in names: field_values[field.name] = field.parse_value(line) return field_values + + def get_field_by_name(self, name): + """Get field by it's name.""" + for field in self.fields: + if field.name == name: + return field + return None diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 79f4c8174..18348df0a 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -538,6 +538,7 @@ def super_big_s1_file(stt_user, stt): @pytest.mark.django_db() +@pytest.mark.skip(reason="long runtime") # big_files def test_parse_super_big_s1_file(super_big_s1_file): """Test parsing of super_big_s1_file and validate all T1/T2/T3 records are created.""" parse.parse_datafile(super_big_s1_file) @@ -898,6 +899,7 @@ def test_parse_tribal_section_1_file(tribal_section_1_file): assert t_t1.CASH_AMOUNT == 26 assert t_t2.MONTHS_FED_TIME_LIMIT == ' 8' assert t_t3.EDUCATION_LEVEL == '98' + assert False @pytest.fixture def tribal_section_1_inconsistency_file(stt_user, stt): diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 17a781ce3..cb6d3ebdc 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -103,18 +103,9 @@ def update_encrypted_fields(self, is_encrypted): if type(field) == TransformField and "is_encrypted" in field.kwargs: field.kwargs['is_encrypted'] = is_encrypted -def contains_encrypted_indicator(line, encryption_val): - """Determine if line contains encryption indicator.""" - if encryption_val is not None: - return encryption_val == "E" - return False - -def contains_tribe_code(line, tribe_code_val): - """Determine if the line has a valid tribal code.""" - options = {" ", None, "000"} - if tribe_code_val is not None: - return tribe_code_val not in options - return False +def is_string_field_valid(val, field_length): + """Determine if the field's value is valid.""" + return val not in {" "*field_length, None, "0"*field_length} def get_schema_options(program, section, query=None, model=None, model_name=None): """Centralized function to return the appropriate schema for a given program, section, and query. diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index 1ffccf93a..054bbd50f 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -1,6 +1,7 @@ """Generic parser validator functions for use in schema definitions.""" from .models import ParserErrorCategoryChoices +from .util import is_string_field_valid from datetime import date import logging @@ -381,14 +382,14 @@ def validate_header_section_matches_submission(datafile, section, generate_error return is_valid, error -def validate_header_tribe_code(program_type, tribe_code, state_fips_code, generate_error): - """Validate header tribe code, fips code, and program type all agree with eachother.""" +def validate_tribe_fips_program_agree(program_type, tribe_code, state_fips_code, generate_error): + """Validate tribe code, fips code, and program type all agree with eachother.""" is_valid = False - if program_type == 'TAN' and (state_fips_code == '00' or state_fips_code is None or state_fips_code.isspace()): - is_valid = tribe_code is not None and not tribe_code.isspace() and tribe_code != '000' + if program_type == 'TAN' and (not is_string_field_valid(state_fips_code, 2)): + is_valid = is_string_field_valid(tribe_code, 3) else: - is_valid = tribe_code is None or tribe_code.isspace() or tribe_code == '000' + is_valid = not is_string_field_valid(tribe_code, 3) error = None if not is_valid: From f4e6bfac88de5bd48215f62a559150ec94a6f6c9 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 20 Nov 2023 11:41:36 -0700 Subject: [PATCH 47/88] - removing debug assert --- tdrs-backend/tdpservice/parsers/test/test_parse.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 18348df0a..2a290ec5d 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -899,7 +899,6 @@ def test_parse_tribal_section_1_file(tribal_section_1_file): assert t_t1.CASH_AMOUNT == 26 assert t_t2.MONTHS_FED_TIME_LIMIT == ' 8' assert t_t3.EDUCATION_LEVEL == '98' - assert False @pytest.fixture def tribal_section_1_inconsistency_file(stt_user, stt): From 3699cdf36e59c2afd21838f1ed84e5e1009565ee Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 20 Nov 2023 11:54:36 -0700 Subject: [PATCH 48/88] - Fix lint --- tdrs-backend/tdpservice/parsers/parse.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index a52a7f042..c1dc9e3fa 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -32,10 +32,11 @@ def parse_datafile(datafile): {"encryption", "tribe_code", "state_fips"}) # Validate tribe code in submission across program type and fips code + generate_error = util.make_generate_parser_error(datafile, 1) tribe_is_valid, tribe_error = validators.validate_tribe_fips_program_agree(header['program_type'], - field_values["tribe_code"], - field_values["state_fips"], - util.make_generate_parser_error(datafile, 1)) + field_values["tribe_code"], + field_values["state_fips"], + generate_error) if not tribe_is_valid: logger.info(f"Tribe Code ({field_values['tribe_code']}) inconsistency with Program Type " + From 700a965e58e76bf704825b87271736b011330374 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 20 Nov 2023 16:33:01 -0500 Subject: [PATCH 49/88] listing --- .../tdpservice/parsers/test/test_parse.py | 1 - tdrs-backend/tdpservice/parsers/validators.py | 16 +++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 9a2e9ad8a..7f6a1d1a6 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -453,7 +453,6 @@ def test_parse_ssp_section1_datafile(ssp_section1_datafile): parse.parse_datafile(ssp_section1_datafile) parser_errors = ParserError.objects.filter(file=ssp_section1_datafile) - assert parser_errors.count() == 19846 err = parser_errors.first() diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index ee1dcd587..8e5c5f882 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -49,19 +49,17 @@ def and_validators(validator1, validator2): def extended_and_validators(*args, **kwargs): """Return a validator that is true only if all validators are true.""" - return ( - lambda value: (True, None) - if all([validator(value)[0] for validator in args]) - else ( - False, - "".join( + def returned_func(value): + if all([validator(value)[0] for validator in args]): + return (True, None) + else: + return (False, "".join( [ " and " + validator(value)[1] if validator(value)[0] else "" for validator in args ] - ), - ) - ) + )) + return returned_func def if_then_validator( From 7d1eb79f9ed07c0fc39f45bb5ddcb844ce92ec76 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 21 Nov 2023 09:50:34 -0700 Subject: [PATCH 50/88] - deconflicting migrations --- ....py => 0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tdrs-backend/tdpservice/search_indexes/migrations/{0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py => 0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py} (99%) diff --git a/tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py b/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py similarity index 99% rename from tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py rename to tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py index 9b1221b90..0a5f55848 100644 --- a/tdrs-backend/tdpservice/search_indexes/migrations/0019_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py +++ b/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py @@ -9,7 +9,7 @@ class Migration(migrations.Migration): dependencies = [ ('data_files', '0012_datafile_s3_versioning_id'), - ('search_indexes', '0018_auto_20230920_1846'), + ('search_indexes', '0019_ssp_m6'), ] operations = [ From 41cada2809d4bc885c9f098d0ec1817c9131b1a8 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Tue, 21 Nov 2023 10:04:45 -0700 Subject: [PATCH 51/88] - Fixing test --- .../search_indexes/test/test_model_mapping.py | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py index 15b3f582b..44ddda3ee 100644 --- a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py +++ b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py @@ -579,6 +579,44 @@ def test_can_create_and_index_ssp_m3_submission(): assert response.hits.total.value == 1 +@pytest.mark.django_db +def test_can_create_and_index_ssp_m6_submission(test_datafile): + """SSP M6 submissions can be created and mapped.""" + record_num = fake.uuid4() + + submission = models.ssp.SSP_M6() + submission.datafile = test_datafile + submission.RecordType = record_num + submission.CALENDAR_QUARTER = 1 + submission.RPT_MONTH_YEAR = 1 + submission.NUM_APPLICATIONS = 1 + submission.NUM_APPROVED = 1 + submission.NUM_DENIED = 1 + submission.ASSISTANCE = 1 + submission.NUM_FAMILIES = 1 + submission.NUM_2_PARENTS = 1 + submission.NUM_1_PARENTS = 1 + submission.NUM_NO_PARENTS = 1 + submission.NUM_RECIPIENTS = 1 + submission.NUM_ADULT_RECIPIENTS = 1 + submission.NUM_CHILD_RECIPIENTS = 1 + submission.NUM_NONCUSTODIALS = 1 + submission.NUM_BIRTHS = 1 + submission.NUM_OUTWEDLOCK_BIRTHS = 1 + submission.NUM_CLOSED_CASES = 1 + + submission.save() + + assert submission.id is not None + + search = documents.ssp.SSP_M6DataSubmissionDocument.search().query( + 'match', + RecordType=record_num + ) + response = search.execute() + + assert response.hits.total.value == 1 + @pytest.mark.django_db def test_can_create_and_index_tribal_tanf_t1_submission(test_datafile): """Tribal TANF T1 submissions can be created and mapped.""" @@ -752,45 +790,7 @@ def test_can_create_and_index_tribal_tanf_t3_submission(test_datafile): assert submission.id is not None - search = documents.ssp.SSP_M6DataSubmissionDocument.search().query( - 'match', - RecordType=record_num - ) - response = search.execute() - - assert response.hits.total.value == 1 - -@pytest.mark.django_db -def test_can_create_and_index_ssp_m6_submission(test_datafile): - """SSP M6 submissions can be created and mapped.""" - record_num = fake.uuid4() - - submission = models.ssp.SSP_M6() - submission.datafile = test_datafile - submission.RecordType = record_num - submission.CALENDAR_QUARTER = 1 - submission.RPT_MONTH_YEAR = 1 - submission.NUM_APPLICATIONS = 1 - submission.NUM_APPROVED = 1 - submission.NUM_DENIED = 1 - submission.ASSISTANCE = 1 - submission.NUM_FAMILIES = 1 - submission.NUM_2_PARENTS = 1 - submission.NUM_1_PARENTS = 1 - submission.NUM_NO_PARENTS = 1 - submission.NUM_RECIPIENTS = 1 - submission.NUM_ADULT_RECIPIENTS = 1 - submission.NUM_CHILD_RECIPIENTS = 1 - submission.NUM_NONCUSTODIALS = 1 - submission.NUM_BIRTHS = 1 - submission.NUM_OUTWEDLOCK_BIRTHS = 1 - submission.NUM_CLOSED_CASES = 1 - - submission.save() - - assert submission.id is not None - - search = documents.ssp.SSP_M6DataSubmissionDocument.search().query( + search = documents.tribal.Tribal_TANF_T3DataSubmissionDocument.search().query( 'match', RecordType=record_num ) From 96368548ad7690fa44efe835b89c08a1e3ec959b Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 21 Nov 2023 12:34:33 -0500 Subject: [PATCH 52/88] added m6 --- .../tdpservice/parsers/schema_defs/ssp/m6.py | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py index 6bea60b11..16e70b3c0 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py @@ -21,32 +21,43 @@ ], fields=[ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - required=True, validators=[]), + friendly_name='record type', required=True, validators=[]), Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, - required=True, validators=[validators.dateYearIsLargerThan(1998), + friendly_name='calendar quarter', required=True, validators=[validators.dateYearIsLargerThan(1998), validators.quarterIsValid()]), TransformField(calendar_quarter_to_rpt_month_year(0), item="2B", name='RPT_MONTH_YEAR', type='number', + friendly_name='reporting month year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), Field(item="3A", name='SSPMOE_FAMILIES', type='number', startIndex=7, endIndex=15, + friendly_name='ssp/moe families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="4A", name='NUM_2_PARENTS', type='number', startIndex=31, endIndex=39, + friendly_name='number of two-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="5A", name='NUM_1_PARENTS', type='number', startIndex=55, endIndex=63, + friendly_name='number of one-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="6A", name='NUM_NO_PARENTS', type='number', startIndex=79, endIndex=87, + friendly_name='number of no-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="7A", name='NUM_RECIPIENTS', type='number', startIndex=103, endIndex=111, + friendly_name='number of recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="8A", name='ADULT_RECIPIENTS', type='number', startIndex=127, endIndex=135, + friendly_name='number of adult recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="9A", name='CHILD_RECIPIENTS', type='number', startIndex=151, endIndex=159, + friendly_name='number of child recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="10A", name='NONCUSTODIALS', type='number', startIndex=175, endIndex=183, + friendly_name='number of noncustodial parents', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="11A", name='AMT_ASSISTANCE', type='number', startIndex=199, endIndex=211, + friendly_name='amount of assistance', required=True, validators=[validators.isInLimits(0, 999999999999)]), Field(item="12A", name='CLOSED_CASES', type='number', startIndex=235, endIndex=243, + friendly_name='number of closed cases', required=True, validators=[validators.isInLimits(0, 99999999)]), ], ) @@ -64,32 +75,45 @@ ], fields=[ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + friendly_name='record type', required=True, validators=[]), Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, + friendly_name='calendar quarter', required=True, validators=[validators.dateYearIsLargerThan(1998), validators.quarterIsValid()]), TransformField(calendar_quarter_to_rpt_month_year(1), item="2B", name='RPT_MONTH_YEAR', type='number', + friendly_name='reporting month year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), Field(item="3B", name='SSPMOE_FAMILIES', type='number', startIndex=15, endIndex=23, + friendly_name='ssp/moe families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="4B", name='NUM_2_PARENTS', type='number', startIndex=39, endIndex=47, + friendly_name='number of two-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="5B", name='NUM_1_PARENTS', type='number', startIndex=63, endIndex=71, + friendly_name='number of one-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="6B", name='NUM_NO_PARENTS', type='number', startIndex=87, endIndex=95, + friendly_name='number of no-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="7B", name='NUM_RECIPIENTS', type='number', startIndex=111, endIndex=119, + friendly_name='number of recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="8B", name='ADULT_RECIPIENTS', type='number', startIndex=135, endIndex=143, + friendly_name='number of adult recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="9B", name='CHILD_RECIPIENTS', type='number', startIndex=159, endIndex=167, + friendly_name='number of child recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="10B", name='NONCUSTODIALS', type='number', startIndex=183, endIndex=191, + friendly_name='number of noncustodial parents', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="11B", name='AMT_ASSISTANCE', type='number', startIndex=211, endIndex=223, + friendly_name='amount of assistance', required=True, validators=[validators.isInLimits(0, 999999999999)]), Field(item="12B", name='CLOSED_CASES', type='number', startIndex=243, endIndex=251, + friendly_name='number of closed cases', required=True, validators=[validators.isInLimits(0, 99999999)]), ], ) @@ -107,32 +131,45 @@ ], fields=[ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, + friendly_name='record type', required=True, validators=[]), Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, + friendly_name='calendar quarter', required=True, validators=[validators.dateYearIsLargerThan(1998), validators.quarterIsValid()]), TransformField(calendar_quarter_to_rpt_month_year(2), item="2B", name='RPT_MONTH_YEAR', type='number', + friendly_name='reporting month year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), Field(item="3C", name='SSPMOE_FAMILIES', type='number', startIndex=23, endIndex=31, + friendly_name='ssp/moe families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="4C", name='NUM_2_PARENTS', type='number', startIndex=47, endIndex=55, + friendly_name='number of two-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="5C", name='NUM_1_PARENTS', type='number', startIndex=71, endIndex=79, + friendly_name='number of one-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="6C", name='NUM_NO_PARENTS', type='number', startIndex=95, endIndex=103, + friendly_name='number of no-parent families', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="7C", name='NUM_RECIPIENTS', type='number', startIndex=119, endIndex=127, + friendly_name='number of recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="8C", name='ADULT_RECIPIENTS', type='number', startIndex=143, endIndex=151, + friendly_name='number of adult recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="9C", name='CHILD_RECIPIENTS', type='number', startIndex=167, endIndex=175, + friendly_name='number of child recipients', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="10C", name='NONCUSTODIALS', type='number', startIndex=191, endIndex=199, + friendly_name='number of noncustodial parents', required=True, validators=[validators.isInLimits(0, 99999999)]), Field(item="11C", name='AMT_ASSISTANCE', type='number', startIndex=223, endIndex=235, + friendly_name='amount of assistance', required=True, validators=[validators.isInLimits(0, 999999999999)]), Field(item="12C", name='CLOSED_CASES', type='number', startIndex=251, endIndex=259, + friendly_name='number of closed cases', required=True, validators=[validators.isInLimits(0, 99999999)]), ], ) From 5c2e819dc447aa56f2baafb041663c8e41da5f19 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Tue, 21 Nov 2023 12:52:57 -0500 Subject: [PATCH 53/88] lint --- tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py index 16e70b3c0..9a7caaebe 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py @@ -24,7 +24,7 @@ friendly_name='record type', required=True, validators=[]), Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, friendly_name='calendar quarter', required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.quarterIsValid()]), + validators.quarterIsValid()]), TransformField(calendar_quarter_to_rpt_month_year(0), item="2B", name='RPT_MONTH_YEAR', type='number', friendly_name='reporting month year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), From 763c09be8b7619e057d3b257687e510867178e9f Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 22 Nov 2023 09:58:42 -0500 Subject: [PATCH 54/88] corrected new line break --- tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 883fed1c0..3c7053df7 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -240,8 +240,8 @@ Field( item="19A", name="REC_OASDI_INSURANCE", - friendly_name="receives federal disability insurance benefits\ - under the social security OASDI program", + friendly_name="receives federal disability insurance benefits" + + " under the social security OASDI program", type="number", startIndex=44, endIndex=45, From 3e73dbce810284865e4b075dfff8fc1796247ccd Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Wed, 22 Nov 2023 13:07:49 -0500 Subject: [PATCH 55/88] refactored validator logic --- .../tdpservice/parsers/schema_defs/tanf/t5.py | 2 +- tdrs-backend/tdpservice/parsers/validators.py | 49 ++++++++++--------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 3c7053df7..fb09c1036 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -241,7 +241,7 @@ item="19A", name="REC_OASDI_INSURANCE", friendly_name="receives federal disability insurance benefits" - + " under the social security OASDI program", + + " under the social security OASDI program", type="number", startIndex=44, endIndex=45, diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index 8e5c5f882..f465887cf 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -85,30 +85,31 @@ def if_then_validator_func(value): validator1_result = condition_function(value1) validator2_result = result_function(value2) - return ( - (True, None, [condition_field, result_field]) - if not validator1_result[0] - else ( - validator2_result[0], - ( - f"if {condition_field} " - + ( - validator1_result[1] - if validator1_result[1] is not None - else f":{value1} validator1 passed" - ) - + f" then {result_field} " - + ( - validator2_result[1] - if validator2_result[1] is not None - else "validator2 passed" - ) - ) - if not validator2_result[0] - else None, - [condition_field, result_field], - ) - ) + + if not validator1_result[0]: + returned_value = (True, None, [condition_field, result_field]) + else: + if not validator2_result[0]: + + # center of error message + if validator1_result[1] is not None: + center_error = validator1_result[1] + else: + center_error = f":{value1} validator1 passed" + + # ending of error message + if validator2_result[1] is not None: + ending_error = validator2_result[1] + else: + ending_error = "validator2 passed" + + error_message = f"if {condition_field} " + (center_error) + f" then {result_field} " + ending_error + else: + error_message = None + + returned_value = (validator2_result[0], error_message, [condition_field, result_field]) + + return returned_value return lambda value: if_then_validator_func(value) From 8161b4c8104960fc0af978b9a83a4c891beb45eb Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 22 Nov 2023 12:57:56 -0700 Subject: [PATCH 56/88] - resolving conflict --- .../0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py b/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py index 0a5f55848..a0690e688 100644 --- a/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py +++ b/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py @@ -9,7 +9,7 @@ class Migration(migrations.Migration): dependencies = [ ('data_files', '0012_datafile_s3_versioning_id'), - ('search_indexes', '0019_ssp_m6'), + ('search_indexes', '0021_ssp_m7'), ] operations = [ From 8a5665aca22b17b16c554a8d023999ff4c89f69d Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 22 Nov 2023 12:59:12 -0700 Subject: [PATCH 57/88] - Fix lint errors --- tdrs-backend/tdpservice/parsers/test/test_parse.py | 2 +- .../tdpservice/search_indexes/test/test_model_mapping.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index b28845013..3ecb8c010 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -1027,4 +1027,4 @@ def test_parse_tribal_section_1_inconsistency_file(tribal_section_1_inconsistenc assert parser_errors.count() == 1 assert parser_errors.first().error_message == "Tribe Code (142) inconsistency with Program Type (TAN) " + \ - "and FIPS Code (01)." \ No newline at end of file + "and FIPS Code (01)." diff --git a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py index d44bf85a5..28b948553 100644 --- a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py +++ b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py @@ -901,4 +901,4 @@ def test_can_create_and_index_tribal_tanf_t3_submission(test_datafile): ) response = search.execute() - assert response.hits.total.value == 1 \ No newline at end of file + assert response.hits.total.value == 1 From 2d68b52351d8adccdabcc49f4e963ee54021d517 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 22 Nov 2023 13:03:00 -0700 Subject: [PATCH 58/88] - Resolve conflict --- tdrs-backend/tdpservice/parsers/test/test_parse.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 3ecb8c010..1a8599a22 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -911,6 +911,7 @@ def test_parse_tanf_section4_file(tanf_section4_file): assert first.FAMILIES_MONTH == 274 assert sixth.FAMILIES_MONTH == 499 +@pytest.fixture def ssp_section4_file(stt_user, stt): """Fixture for ADS.E2J.NDM4.MS24.""" return util.create_test_datafile('ADS.E2J.NDM4.MS24', stt_user, stt, "SSP Stratum Data") From dcc1dca6e75e2e98b2f40bc4de5578a9c30d5570 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Sat, 25 Nov 2023 13:48:30 -0500 Subject: [PATCH 59/88] linting and correction on t1 --- tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py | 6 ++++++ tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py index 1fb1aa8fa..b2ec5e21e 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py @@ -32,6 +32,7 @@ Field( item="0", name="RecordType", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -41,6 +42,7 @@ Field( item="2", name="CALENDAR_QUARTER", + friendly_name="calendar quarter", type="number", startIndex=2, endIndex=7, @@ -54,6 +56,7 @@ transform_func=calendar_quarter_to_rpt_month_year((i - 1) % 3), item="2A", name="RPT_MONTH_YEAR", + friendly_name="reporting month year", type="number", startIndex=2, endIndex=7, @@ -66,6 +69,7 @@ Field( item="3", name="TDRS_SECTION_IND", + friendly_name="tdrs section indicator", type="string", startIndex=section_ind_index, endIndex=section_ind_index + 1, @@ -75,6 +79,7 @@ Field( item="4", name="STRATUM", + friendly_name="stratum", type="string", startIndex=stratum_index, endIndex=stratum_index + 2, @@ -84,6 +89,7 @@ Field( item=families_item_numbers[i - 1], name="FAMILIES_MONTH", + friendly_name="families month", type="number", startIndex=families_index, endIndex=families_index + 7, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 04dd6e0cf..0ec37c117 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -648,7 +648,7 @@ Field( item="29", name="FAMILY_NEW_CHILD", - family_name="family new child", + friendly_name="family new child", type="number", startIndex=116, endIndex=117, From 28c963640cb2880c1c78b01e1bf8d51e4b07d546 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Sat, 25 Nov 2023 13:57:03 -0500 Subject: [PATCH 60/88] friendly_name correction from comments --- .../tdpservice/parsers/schema_defs/ssp/m1.py | 18 +++++++++--------- .../tdpservice/parsers/schema_defs/ssp/m2.py | 4 ++-- .../tdpservice/parsers/schema_defs/ssp/m3.py | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 8b14fbd19..7e1720209 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -108,7 +108,7 @@ validators.isInLimits(1, 3), ]), Field(item="10", name='TANF_ASST_IN_6MONTHS', type='number', startIndex=33, endIndex=34, - friendly_name="tanf assitance in 6 months", required=True, validators=[ + friendly_name="tanf assistance in 6 months", required=True, validators=[ validators.isInLimits(1, 3), ]), Field(item="11", name='RECEIVES_SUB_HOUSING', type='number', startIndex=34, endIndex=35, @@ -116,15 +116,15 @@ validators.isInLimits(1, 2), ]), Field(item="12", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=35, endIndex=36, - friendly_name="receives medical assisstance", required=True, validators=[ + friendly_name="receives medical assistance", required=True, validators=[ validators.isInLimits(1, 2), ]), Field(item="13", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=36, endIndex=37, - friendly_name="receives food assisstance", required=False, validators=[ + friendly_name="receives food assistance", required=False, validators=[ validators.isInLimits(0, 2), ]), Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=37, endIndex=41, - friendly_name="amount of food stamp assisstance", required=True, validators=[ + friendly_name="amount of food stamp assistance", required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), Field(item="15", name='RECEIVES_SUB_CC', type='number', startIndex=41, endIndex=42, @@ -168,7 +168,7 @@ validators.isLargerThanOrEqualTo(0), ]), Field(item="21B", name='TRANSP_NBR_MONTHS', type='number', startIndex=74, endIndex=77, - friendly_name="transmportation number of months", required=True, validators=[ + friendly_name="transportation number of months", required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), Field(item="22A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=77, endIndex=81, @@ -184,7 +184,7 @@ validators.isLargerThanOrEqualTo(0), ]), Field(item="23B", name='OTHER_NBR_MONTHS', type='number', startIndex=88, endIndex=91, - friendly_name="other nuber of months", required=False, validators=[ + friendly_name="other number of months", required=False, validators=[ validators.isLargerThanOrEqualTo(0), ]), Field(item="24AI", name='SANC_REDUCTION_AMT', type='number', startIndex=91, endIndex=95, @@ -212,7 +212,7 @@ validators.oneOf([1, 2]), ]), Field(item="24AVII", name='OTHER_SANCTION', type='number', startIndex=100, endIndex=101, - friendly_name="other sanciton", required=True, validators=[ + friendly_name="other sanction", required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="24B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=101, endIndex=105, @@ -232,11 +232,11 @@ validators.oneOf([1, 2]), ]), Field(item="24CIV", name='OTHER_NON_SANCTION', type='number', startIndex=111, endIndex=112, - friendly_name="other non santion", required=True, validators=[ + friendly_name="other non sanction", required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', type='number', startIndex=112, endIndex=113, - friendly_name="waiver evaluation xperimental and control groups", required=False, validators=[ + friendly_name="waiver evaluation experimental and control groups", required=False, validators=[ validators.isInLimits(0, 9), ]), Field(item="-1", name='BLANK', type='string', startIndex=113, endIndex=150, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index 6873e02a6..498283ffa 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -118,7 +118,7 @@ ]), TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', type='string', startIndex=29, endIndex=38, required=True, validators=[validators.validateSSN()], - friendly_name="social security number - SSN", is_encrypted=False), + friendly_name="social security number - ssn", is_encrypted=False), Field(item="30A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, friendly_name="race hispanic", validators=[ validators.isInLimits(0, 2) @@ -352,7 +352,7 @@ validators.isInLimits(0, 9999) ]), Field(item="59C", name='UNEARNED_SSI', type='number', startIndex=138, endIndex=142, - friendly_name="unearned SSI benefit", required=True, validators=[ + friendly_name="unearned ssi benefit", required=True, validators=[ validators.isInLimits(0, 9999) ]), Field(item="59D", name='UNEARNED_WORKERS_COMP', type='number', startIndex=142, endIndex=146, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index f17dcd74d..22623a271 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -85,7 +85,7 @@ validators.dateMonthIsValid(), ]), TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=28, - friendly_name="social security number - SSN", endIndex=37, required=True, is_encrypted=False, + friendly_name="social security number - ssn", endIndex=37, required=True, is_encrypted=False, validators=[ validators.validateSSN() ]), @@ -233,7 +233,7 @@ validators.dateMonthIsValid(), ]), TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=69, - endIndex=78, required=True, is_encrypted=False, friendly_name="social security number - SSN", + endIndex=78, required=True, is_encrypted=False, friendly_name="social security number - ssn", validators=[ validators.validateSSN() ]), @@ -266,7 +266,7 @@ validators.isInLimits(0, 9) ]), Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=85, endIndex=86, - friendly_name="receive nonssi benefit", required=True, validators=[ + friendly_name="receive non ssi benefit", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, @@ -274,7 +274,7 @@ validators.oneOf([1, 2]) ]), Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=87, endIndex=89, - friendly_name="realtionship head of household", required=False, validators=[ + friendly_name="relationship head of household", required=False, validators=[ validators.isInLimits(0, 10) ]), Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, From 3e19f2dc5c2d3f8f4c28ba239337063eb2b970bb Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Sat, 25 Nov 2023 13:58:24 -0500 Subject: [PATCH 61/88] friendly_name correction --- tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index f0f3dd601..6ae8f2b52 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -118,7 +118,7 @@ validators.isInLimits(0, 9) ]), Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=44, endIndex=45, - friendly_name="receive nonssi benefits", required=True, validators=[ + friendly_name="receive non ssi benefits", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, From c2501f86d20ae3cbabf54e2f4afec9a95482e378 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Sat, 25 Nov 2023 14:28:57 -0500 Subject: [PATCH 62/88] corrected failing test for m5 --- .../tdpservice/parsers/schema_defs/ssp/m4.py | 13 +++++++ .../tdpservice/parsers/schema_defs/ssp/m5.py | 27 ++++++++++++++ .../parsers/test/test_validators.py | 35 ++++++++++--------- 3 files changed, 59 insertions(+), 16 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py index e23a279aa..095a71a94 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py @@ -19,6 +19,7 @@ Field( item="0", name="RecordType", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -28,6 +29,7 @@ Field( item="3", name="RPT_MONTH_YEAR", + friendly_name="report month year", type="number", startIndex=2, endIndex=8, @@ -40,6 +42,7 @@ Field( item="5", name="CASE_NUMBER", + friendly_name="case number", type="string", startIndex=8, endIndex=19, @@ -49,6 +52,7 @@ Field( item="2", name="COUNTY_FIPS_CODE", + friendly_name="county fips code", type="string", startIndex=19, endIndex=22, @@ -58,6 +62,7 @@ Field( item="4", name="STRATUM", + friendly_name="stratum", type="string", startIndex=22, endIndex=24, @@ -67,6 +72,7 @@ Field( item="6", name="ZIP_CODE", + friendly_name="zip code", type="string", startIndex=24, endIndex=29, @@ -76,6 +82,7 @@ Field( item="7", name="DISPOSITION", + friendly_name="disposition", type="number", startIndex=29, endIndex=30, @@ -85,6 +92,7 @@ Field( item="8", name="CLOSURE_REASON", + friendly_name="closure reason", type="string", startIndex=30, endIndex=32, @@ -98,6 +106,7 @@ Field( item="9", name="REC_SUB_HOUSING", + friendly_name="receives subsidized housing", type="number", startIndex=32, endIndex=33, @@ -107,6 +116,7 @@ Field( item="10`", name="REC_MED_ASSIST", + friendly_name="receives medical assistance", type="number", startIndex=33, endIndex=34, @@ -116,6 +126,7 @@ Field( item="11", name="REC_FOOD_STAMPS", + friendly_name="receives food stamps", type="number", startIndex=34, endIndex=35, @@ -125,6 +136,7 @@ Field( item="12", name="REC_SUB_CC", + friendly_name="receives subsidized child care", type="number", startIndex=35, endIndex=36, @@ -134,6 +146,7 @@ Field( item="-1", name="BLANK", + friendly_name="blank", type="string", startIndex=36, endIndex=66, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py index 98c2b6f83..8b19cfc36 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py @@ -104,6 +104,7 @@ Field( item="0", name="RecordType", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -113,6 +114,7 @@ Field( item="3", name="RPT_MONTH_YEAR", + friendly_name="report month year", type="number", startIndex=2, endIndex=8, @@ -125,6 +127,7 @@ Field( item="5", name="CASE_NUMBER", + friendly_name="case number", type="string", startIndex=8, endIndex=19, @@ -134,6 +137,7 @@ Field( item="13", name="FAMILY_AFFILIATION", + friendly_name="family affiliation", type="number", startIndex=19, endIndex=20, @@ -143,6 +147,7 @@ Field( item="14", name="DATE_OF_BIRTH", + friendly_name="date of birth", type="string", startIndex=20, endIndex=28, @@ -156,6 +161,7 @@ transform_func=ssp_ssn_decryption_func, item="15", name="SSN", + friendly_name="social security number", type="string", startIndex=28, endIndex=37, @@ -166,6 +172,7 @@ Field( item="16A", name="RACE_HISPANIC", + friendly_name="race hispanic", type="number", startIndex=37, endIndex=38, @@ -175,6 +182,7 @@ Field( item="16B", name="RACE_AMER_INDIAN", + friendly_name="race american indian", type="number", startIndex=38, endIndex=39, @@ -184,6 +192,7 @@ Field( item="16C", name="RACE_ASIAN", + friendly_name="race asian", type="number", startIndex=39, endIndex=40, @@ -193,6 +202,7 @@ Field( item="16D", name="RACE_BLACK", + friendly_name="race black", type="number", startIndex=40, endIndex=41, @@ -202,6 +212,7 @@ Field( item="16E", name="RACE_HAWAIIAN", + friendly_name="race hawaiian", type="number", startIndex=41, endIndex=42, @@ -211,6 +222,7 @@ Field( item="16F", name="RACE_WHITE", + friendly_name="race white", type="number", startIndex=42, endIndex=43, @@ -220,6 +232,7 @@ Field( item="17", name="GENDER", + friendly_name="gender", type="number", startIndex=43, endIndex=44, @@ -229,6 +242,7 @@ Field( item="18A", name="REC_OASDI_INSURANCE", + friendly_name="receives old-age survivors and disability insurance", type="number", startIndex=44, endIndex=45, @@ -238,6 +252,7 @@ Field( item="18B", name="REC_FEDERAL_DISABILITY", + friendly_name="receives federal disability", type="number", startIndex=45, endIndex=46, @@ -247,6 +262,7 @@ Field( item="18C", name="REC_AID_TOTALLY_DISABLED", + friendly_name="receives aid for totally disabled", type="number", startIndex=46, endIndex=47, @@ -256,6 +272,7 @@ Field( item="18D", name="REC_AID_AGED_BLIND", + friendly_name="receives aid for aged blind", type="number", startIndex=47, endIndex=48, @@ -265,6 +282,7 @@ Field( item="18E", name="REC_SSI", + friendly_name="receives social security insurance", type="number", startIndex=48, endIndex=49, @@ -274,6 +292,7 @@ Field( item="19", name="MARITAL_STATUS", + friendly_name="marital status", type="number", startIndex=49, endIndex=50, @@ -283,6 +302,7 @@ Field( item="20", name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", type="string", startIndex=50, endIndex=52, @@ -292,6 +312,7 @@ Field( item="21", name="PARENT_MINOR_CHILD", + friendly_name="parent of minor child", type="number", startIndex=52, endIndex=53, @@ -301,6 +322,7 @@ Field( item="22", name="NEEDS_OF_PREGNANT_WOMAN", + friendly_name="needs of pregnant woman", type="number", startIndex=53, endIndex=54, @@ -310,6 +332,7 @@ Field( item="23", name="EDUCATION_LEVEL", + friendly_name="education level", type="string", startIndex=54, endIndex=56, @@ -324,6 +347,7 @@ Field( item="24", name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", type="number", startIndex=56, endIndex=57, @@ -337,6 +361,7 @@ Field( item="25", name="EMPLOYMENT_STATUS", + friendly_name="employment status", type="number", startIndex=57, endIndex=58, @@ -346,6 +371,7 @@ Field( item="26", name="AMOUNT_EARNED_INCOME", + friendly_name="amount of earned income", type="string", startIndex=58, endIndex=62, @@ -355,6 +381,7 @@ Field( item="27", name="AMOUNT_UNEARNED_INCOME", + friendly_name="amount of unearned income", type="string", startIndex=62, endIndex=66, diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index 384b0b797..8aeb4f718 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -1070,14 +1070,14 @@ def test_fam_affil_ssn(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ["FAMILY_AFFILIATION", "SSN"]) record.SSN = '111111111' result = val(record) assert result == (False, "if FAMILY_AFFILIATION :1 validator1 passed then SSN 111111111 is in ['000000000', " + "'111111111', '222222222', '333333333', '444444444', '555555555', '666666666', '777777777'," + - " '888888888', '999999999'].") + " '888888888', '999999999'].", ["FAMILY_AFFILIATION", "SSN"]) def test_validate_race_ethnicity(self, record): """Test cat3 validator for race/ethnicity.""" @@ -1088,7 +1088,7 @@ def test_validate_race_ethnicity(self, record): result_field=race, result_function=validators.isInLimits(1, 2), ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', race]) def test_fam_affil_marital_stat(self, record): """Test cat3 validator for family affiliation, and marital status.""" @@ -1098,13 +1098,13 @@ def test_fam_affil_marital_stat(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'MARITAL_STATUS']) record.MARITAL_STATUS = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then MARITAL_STATUS 0 is not larger ' + - 'or equal to 1 and smaller or equal to 5.') + 'or equal to 1 and smaller or equal to 5.', ['FAMILY_AFFILIATION', 'MARITAL_STATUS']) def test_fam_affil_parent_with_minor(self, record): """Test cat3 validator for family affiliation, and parent with minor child.""" @@ -1114,13 +1114,15 @@ def test_fam_affil_parent_with_minor(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) record.PARENT_MINOR_CHILD = 0 result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_MINOR_CHILD 0 is not ' + - 'larger or equal to 1 and smaller or equal to 3.') + assert result == (False, + 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_MINOR_CHILD 0 is not ' + + 'larger or equal to 1 and smaller or equal to 3.', + ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) def test_fam_affil_ed_level(self, record): """Test cat3 validator for family affiliation, and education level.""" @@ -1131,13 +1133,13 @@ def test_fam_affil_ed_level(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) record.EDUCATION_LEVEL = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then EDUCATION_LEVEL 0 is not in range ' + - '[1, 16]. or 0 is not in range [98, 99].') + '[1, 16]. or 0 is not in range [98, 99].', ['FAMILY_AFFILIATION', 'EDUCATION_LEVEL']) def test_fam_affil_citz_stat(self, record): """Test cat3 validator for family affiliation, and citizenship status.""" @@ -1147,13 +1149,13 @@ def test_fam_affil_citz_stat(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) record.CITIZENSHIP_STATUS = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then CITIZENSHIP_STATUS 0 is not larger ' + - 'or equal to 1 and smaller or equal to 3.') + 'or equal to 1 and smaller or equal to 3.', ['FAMILY_AFFILIATION', 'CITIZENSHIP_STATUS']) def test_dob_oasdi_insur(self, record): """Test cat3 validator for dob, and REC_OASDI_INSURANCE.""" @@ -1163,13 +1165,13 @@ def test_dob_oasdi_insur(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['DATE_OF_BIRTH', 'REC_OASDI_INSURANCE']) record.REC_OASDI_INSURANCE = 0 result = val(record) assert result == (False, 'if DATE_OF_BIRTH :11111111 validator1 passed then REC_OASDI_INSURANCE 0 is not ' + - 'larger or equal to 1 and smaller or equal to 2.') + 'larger or equal to 1 and smaller or equal to 2.', ['DATE_OF_BIRTH', 'REC_OASDI_INSURANCE']) def test_fam_affil_fed_disability(self, record): """Test cat3 validator for family affiliation, and REC_FEDERAL_DISABILITY.""" @@ -1179,10 +1181,11 @@ def test_fam_affil_fed_disability(self, record): ) result = val(record) - assert result == (True, None) + assert result == (True, None, ['FAMILY_AFFILIATION', 'REC_FEDERAL_DISABILITY']) record.REC_FEDERAL_DISABILITY = 0 result = val(record) assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then REC_FEDERAL_DISABILITY 0 is not ' + - 'larger or equal to 1 and smaller or equal to 2.') + 'larger or equal to 1 and smaller or equal to 2.', + ['FAMILY_AFFILIATION', 'REC_FEDERAL_DISABILITY']) From b04df527791334da537924dc05075d63df94da57 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 27 Nov 2023 13:16:04 -0500 Subject: [PATCH 63/88] refactor the field_json creation DRY --- tdrs-backend/tdpservice/parsers/util.py | 18 +++++------------- tdrs-backend/tdpservice/parsers/views.py | 2 +- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index a845414f5..2a497e48e 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -30,20 +30,12 @@ def create_test_datafile(filename, stt_user, stt, section='Active Case Data'): def generate_parser_error(datafile, line_number, schema, error_category, error_message, record=None, field=None): """Create and return a ParserError using args.""" - if type(field) == list: - fields_json = { - "friendly_name": { - getattr(f, 'name', None): getattr(f, 'friendly_name', None) for f in field - } - } - elif field is not None: - fields_json = { - "friendly_name": { - getattr(field, 'name', None): getattr(field, 'friendly_name', None), - } + fields = [*field] if type(field) is list else [field] + fields_json = { + "friendly_name": { + getattr(f, 'name', ''): getattr(f, 'friendly_name', '') for f in fields } - else: - fields_json = {} + } return ParserError( file=datafile, diff --git a/tdrs-backend/tdpservice/parsers/views.py b/tdrs-backend/tdpservice/parsers/views.py index 606caf629..72d84e4f7 100644 --- a/tdrs-backend/tdpservice/parsers/views.py +++ b/tdrs-backend/tdpservice/parsers/views.py @@ -44,7 +44,7 @@ def format_error_msg(x): """Format error message.""" error_msg = x['error_message'] for key, value in x['fields_json']['friendly_name'].items(): - error_msg = error_msg.replace(key, value) + error_msg = error_msg.replace(key, value) if value else error_msg return error_msg row, col = 0, 0 From cda507d0ef93097f96e1805c3a3c7ee0c5b3f9e7 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 27 Nov 2023 11:47:45 -0700 Subject: [PATCH 64/88] - Renamed tribal files - Updated to allow case aggregates - Updated datafile to have a more convenient date range - Updated tests to capture case aggregates --- .../schema_defs/tribal_tanf/__init__.py | 12 +- .../tribal_tanf/{t_t1.py => t1.py} | 2 +- .../tribal_tanf/{t_t2.py => t2.py} | 2 +- .../tribal_tanf/{t_t3.py => t3.py} | 2 +- .../parsers/test/data/ADS.E2J.FTP1.TS142 | 944 +++++++++--------- .../tdpservice/parsers/test/test_parse.py | 39 +- tdrs-backend/tdpservice/parsers/util.py | 8 +- 7 files changed, 514 insertions(+), 495 deletions(-) rename tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/{t_t1.py => t1.py} (99%) rename tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/{t_t2.py => t2.py} (99%) rename tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/{t_t3.py => t3.py} (99%) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py index 928723495..a0727f36b 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/__init__.py @@ -1,7 +1,7 @@ -from .t_t1 import t_t1 -from .t_t2 import t_t2 -from .t_t3 import t_t3 +from .t1 import t1 +from .t2 import t2 +from .t3 import t3 -t_t1 = t_t1 -t_t2 = t_t2 -t_t3 = t_t3 +t1 = t1 +t2 = t2 +t3 = t3 diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py similarity index 99% rename from tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py rename to tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py index 0c56a013e..f6bca0786 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py @@ -7,7 +7,7 @@ from tdpservice.search_indexes.models.tribal import Tribal_TANF_T1 -t_t1 = SchemaManager( +t1 = SchemaManager( schemas=[ RowSchema( model=Tribal_TANF_T1, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py similarity index 99% rename from tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py rename to tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 655ff1c7d..5289deffc 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -9,7 +9,7 @@ from tdpservice.search_indexes.models.tribal import Tribal_TANF_T2 -t_t2 = SchemaManager( +t2 = SchemaManager( schemas=[ RowSchema( model=Tribal_TANF_T2, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py similarity index 99% rename from tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py rename to tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index d612a4c3f..f49270c98 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t_t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -573,4 +573,4 @@ ], ) -t_t3 = SchemaManager(schemas=[child_one, child_two]) +t3 = SchemaManager(schemas=[child_one, child_two]) 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 969114f96..1de31cf64 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 @@ -1,473 +1,473 @@ -HEADER20194A00142TAN1EU -T120191011111111119255 140245112 23322 03 0 0 0 502 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201910111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 -T120191011111111132255 140245112 61312 03 0 0 0 465 17 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 -T2201910111111111321219820417WTTTTTTTB2222212222223 1321619 36242219 0 0 0 0 0 0 0 0 0 0 0 00028 1149 0 0 0 0 0 -T320191011111111132120150514WTTTTTZT#212222222 43981 0 0 -T320191011111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 -T320191011111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 -T120191011111111233255 140356112 23122 03 0 0 0 502 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2201910111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 -T120191011111111241255 140245112 23312 03 0 0 0 502 8 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201910111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 -T120191011111111305255 140356112 13112 03 0 0 0 399 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201910111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111305120040508WTTTTTT9P212222222 83 71 0 0 -T120191011111111312255 140245112 13322 03 0 0 0 399121 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 -T2201910111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111312120090322WTTTTTT@9212222222 83981 0 0 -T120191011111111339255 140356111 22312 03 0 0 0 453 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201910111111113391219880402WTTTTTZ#B2122221222223 2311211 2582119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111113391219970502WTTTTTTYB2122222222221 1111119 75322 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T120191011111111350255 140245112 33322 03 0 0 0 559 27 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 -T2201910111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111350120100114WTTTTT@WB112222122 43 11 0 0 -T320191011111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 -T120191011111111382255 140245112 33312 03 0 0 0 605 33 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 -T2201910111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111382120080325WTTTTT9TB222221222 83 11 0 0 -T320191011111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 -T120191011111111415255 140356112 13112 03 0 0 0 399 41 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 -T2201910111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 -T320191011111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 -T120191011111111652255 140356111 52312 03 0 0 0 26 53 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 -T2201910111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111652120130426WTTTTTTWT212222122 43981 0 0 -T320191011111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 -T120191011111111663255 140245112 32312 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201910111111116631219910105WTTTTT9#92122221222222 2321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111116631219910303WTTTTT9BB2222212222222 1321219 5552119 3 0 0 0 0 5 0 0 0 0 0 00013 0 0 0 0 0 0 -T320191011111111663120120514WTTTTT9WP212222122 43 11 0 0 -T120191011111111668255 140356111 31112 03 0 0 0 488 6 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111116681219900413WTTTTT@@Y2122221222221 1321212 14462219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T320191011111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 -T120191011111111694255 140356112 13322 03 0 0 0 394142 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 -T2201910111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111694120010527WTTTTTZYT212222122 63 51 0 0 -T120191011111111709255 140245112 13312 03 0 0 0 399 55 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 -T2201910111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111709120110101WTTTTTZ0W212222122 83981 0 0 -T120191011111111716255 140317112 23322 03 0 0 0 502 55 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 -T2201910111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111716120140401WTTTTTTBT212222222 63981 0 0 -T320191011111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 -T120191011111111742255 140245112 31312 03 0 0 01680 94 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 -T2201910111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 033 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 -T120191011111111762255 140245112 23312 03 0 0 0 502 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111117623219880112WTTTTTTY#2222212222222 1321619 1592199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111117623219610502WTTTTTT##2222212222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111111762120160102WTTTTT@YB212222222 83981 0 0120170526WTTTTTZPW212222122 83981 0 0 -T120191011111111794255 140245112 52312 03 0 0 0 811 16 0 0 0 0 0 0 0 0 0 0212222 0 0222 12 -T2201910111111117941219800125WTTTTTZB92122222222221 1121219 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 -T2201910111111117941219760325WTTTTTZ#Y2222211222221 212 919 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 -T320191011111111794120170527WTTTTT9##212222122 43981 0 0 -T320191011111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 -T120191011111111830255 140356111 31112 03 0 0 0 585 1 0 0 0 0 0 0 0 30 1 0222222 0 0222 12 -T2201910111111118301219790105WTTTTT9BW2122222222221 1321211 65421 2 1 0 0 0 0 1 0 0 0 0 0 000 6 0 0 0 0 0 0 -T320191011111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 -T120191011111111850255 140356112 42112 03 0 0 01203 36 0 0 0 0 6 0 1 650 17 0222222 0 0222 42 -T2201910111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 0 0 0 0 0 0 00022 0 0 0 0 0 0 -T2201910111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 010 000 6 0 0 0 0 0 0 -T320191011111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 -T120191011111112010255 140356112 13322 03 0 0 0 399153 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 -T2201910111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112010120060102WTTTTT@T#212222222 63 11 0 0 -T120191011111112058255 140245112 13322 03 0 0 0 399 54 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 -T2201910111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112058120131114WTTTTT@TT212222122 83981 0 0 -T120191011111112111255 140356112 21312 03 0 0 0 502 20 0 0 0 0 0 0 0 335 8 0222222 0 0222 42 -T2201910111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 -T320191011111112111120140102WTTTTT@@@212222222 43981 0 0 -T120191011111112120255 140245112 13322 03 0 0 0 399 15 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112120120090105WTTTTTTPP212222122 83 31 0 0 -T120191011111112181255 140356112 21312 03 0 0 01219 12 0 0 0 0 0 0 0 240 2 0222212 0 0222 42 -T2201910111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 021 0 0 0 0 0 0 0 000 8 0 0 0 0 0 0 -T320191011111112181120180508WTTTTTTPZ212222222 43981 0 0 -T120191011111112235255 140245112 13322 03 0 0 0 399119 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 -T2201910111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112235120020122WTTTTTTB#212222222 83 51 0 0 -T120191011111112245255 140245112 51322 03 0 0 0 811 66 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 -T2201910111111122451219840313WTTTTTTB92122222222221 1211211 60 02119 7 0 0 0 0 8 0 0 0 0 0 00012 0 0 0 0 0 0 -T320191011111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 -T320191011111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 -T120191011111112338255 140356112 13112 03 0 0 0 399 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112338120080802WTTTTTZ0Z212222122 83 31 0 0 -T120191011111112413255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112413120150514WTTTTTZPP212222122 83981 0 0 -T120191011111112436255 140356112 13112 03 0 0 0 399 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201910111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112436120150314WTTTTTZP9212222222 63981 0 0 -T120191011111112461255 140245112 13322 03 0 0 0 399 30 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 -T2201910111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112461120171102WTTTTTZWT222221122 83981 0 0 -T120191011111112542255 140356112 13112 03 0 0 0 399 22 0 0 0 0 0 0 0 130 3 0222222 0 0222 22 -T2201910111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112542120030402WTTTTTTYP212222122 83 81 0 0 -T120191011111112583255 140245112 21312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 -T2201910111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 5 00016 0 0 0 0 0 0 -T320191011111112583120180421WTTTTT9WW222221122 43981 0 0 -T120191011111112627255 140245112 33322 03 0 0 0 605 66 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 -T2201910111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112627120110113WTTTTTTWW222221222 83981 0 0 -T320191011111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 -T120191011111112658255 140245112 13322 03 0 0 0 399 33 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112658120140412WTTTTTT9#212222222 83981 0 0 -T120191011111112870255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201910111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112870120130312WTTTTTTBY212222122 73981 0 0 -T120191011111112912255 140356111 33112 03 0 0 0 292 1 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201910111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112912120090501WTTTTT9TY222212222 63 51 0 0 -T320191011111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 -T120191011111112924255 140356112 13322 03 0 0 0 399126 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 -T2201910111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112924120080522WTTTTTZW@212222222 93981 0 0 -T120191011111112989255 140245112 13312 03 0 0 0 399 32 189 1 7 0 1 0 0 0 0 0222222 0 0222 12 -T2201910111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201910111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191011111112989120160802WTTTTTTZ#212222122 63981 0 0 -T120191111111111119255 140245112 23322 03 0 0 0 502 10 0 0 0 0 0 0 0 567 4 0222222 0 0222 12 -T2201911111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 -T120191111111111132255 140245112 61312 03 0 0 0 914 18 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 -T2201911111111111321219820417WTTTTTTTB2222212222223 1321619 3723211920 0 0 0 0 0 0 0 0 0 0 00012 0 0 0 0 0 0 -T320191111111111132120150514WTTTTTZT#212222222 43981 0 0 -T320191111111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 -T320191111111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 -T120191111111111233255 140356112 23122 03 0 0 0 502 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2201911111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 -T120191111111111241255 140245112 23312 03 0 0 0 502 9 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201911111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 -T120191111111111305255 140356112 13112 03 0 0 0 399 13 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201911111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111305120040508WTTTTTT9P212222222 83 71 0 0 -T120191111111111312255 140245112 13322 03 0 0 0 399122 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 -T2201911111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111312120090322WTTTTTT@9212222222 83981 0 0 -T120191111111111339255 140356112 22312 03 0 0 0 502 6 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201911111111113391219880402WTTTTTZ#B2122221222223 2311211 3572119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111113391219970502WTTTTTTYB2122222222221 1111119 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T120191111111111350255 140245112 33322 03 0 0 0 559 28 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 -T2201911111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111350120100114WTTTTT@WB112222122 43 11 0 0 -T320191111111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 -T120191111111111382255 140245112 33312 03 0 0 0 605 34 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 -T2201911111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111382120080325WTTTTT9TB222221222 83 11 0 0 -T320191111111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 -T120191111111111415255 140356112 13112 03 0 0 0 399 42 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 -T2201911111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 -T320191111111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 -T120191111111111652255 140356112 52312 03 0 0 0 811 54 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 -T2201911111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 -T2201911111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 -T320191111111111652120130426WTTTTTTWT212222122 43981 0 0 -T320191111111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 -T120191111111111663255 140245112 32312 03 0 0 0 605 4 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201911111111116631219910105WTTTTT9#92122221222222 2321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111116631219910303WTTTTT9BB2222212222222 1321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111663120120514WTTTTT9WP212222122 43 11 0 0 -T120191111111111668255 140356112 31112 03 0 0 0 605 7 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111116681219900413WTTTTT@@Y2122221222221 1321212 1545211921 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 -T320191111111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 -T120191111111111694255 140356112 13322 03 0 0 0 394143 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 -T2201911111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111694120010527WTTTTTZYT212222122 63 51 0 0 -T120191111111111709255 140245112 13312 03 0 0 0 399 56 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 -T2201911111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111709120110101WTTTTTZ0W212222122 83981 0 0 -T120191111111111716255 140317112 23322 03 0 0 0 502 56 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 -T2201911111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111716120140401WTTTTTTBT212222222 63981 0 0 -T320191111111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 -T120191111111111742255 140245112 31312 03 0 0 01512 95 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 -T2201911111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 028 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 -T120191111111111794255 140245112 52312 03 0 0 0 811 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111117941219800125WTTTTTZB92122222222221 1121219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111117941219760325WTTTTTZ#Y2222211222221 212 919 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111794120170527WTTTTT9##212222122 43981 0 0 -T320191111111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 -T120191111111111830255 140356112 31112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201911111111118301219790105WTTTTT9BW2122222222221 1321211 75321 2 3 0 0 0 0 0 0 0 0 0 0 00014 0 0 0 0 0 0 -T320191111111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 -T120191111111111850255 140356112 42112 03 0 0 01205 37 0 0 0 0 6 0 1 100 18 0222212 0 0222 42 -T2201911111111118501219870513WTTTTTZPY2122222222223 1321212 060111935 0 0 0 0 0 0 0 0 0 0 000 5 0 0 0 0 0 0 -T2201911111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 0 6 000 5 0 0 0 0 0 0 -T320191111111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 -T120191111111111953255 140356112 21312 03 0 0 0 264104 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 -T2201911111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 -T2201911111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111111953120070102WTTTTTZZY212222122 43981 0 0 -T120191111111112010255 140356112 13322 03 0 0 0 399154 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 -T2201911111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112010120060102WTTTTT@T#212222222 63 11 0 0 -T120191111111112058255 140245112 13322 03 0 0 0 399 55 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 -T2201911111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112058120131114WTTTTT@TT212222122 83981 0 0 -T120191111111112111255 140356112 21312 03 0 0 0 502 21 0 0 0 0 0 0 0 0 8 0222222 0 0222 42 -T2201911111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 1 0 0 0 0 0 000 4 0 0 0 0 0 0 -T320191111111112111120140102WTTTTT@@@212222222 43981 0 0 -T120191111111112120255 140245112 13322 03 0 0 0 399 16 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112120120090105WTTTTTTPP212222122 83 31 0 0 -T120191111111112181255 140356112 21312 03 0 0 01252 13 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 -T2201911111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 022 0 0 0 0 0 0 0 00011 0 0 0 0 0 0 -T320191111111112181120180508WTTTTTTPZ212222222 43981 0 0 -T120191111111112235255 140245112 13322 03 0 0 0 399120 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 -T2201911111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112235120020122WTTTTTTB#212222222 83 51 0 0 -T120191111111112245255 140245112 51322 03 0 0 0 559 67 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 -T2201911111111122451219840313WTTTTTTB92122222222221 1211211 60 0211915 0 0 0 0 1 0 0 0 0 0 00012 754 0 0 0 0 0 -T320191111111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 -T320191111111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 -T120191111111112338255 140356112 13112 03 0 0 0 399 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112338120080802WTTTTTZ0Z212222122 83 31 0 0 -T120191111111112413255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112413120150514WTTTTTZPP212222122 83981 0 0 -T120191111111112436255 140356112 13112 03 0 0 0 399 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201911111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112436120150314WTTTTTZP9212222222 63981 0 0 -T120191111111112461255 140245112 13322 03 0 0 0 399 31 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 -T2201911111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112461120171102WTTTTTZWT222221122 83981 0 0 -T120191111111112542255 140356112 13112 03 0 0 0 399 23 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2201911111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112542120030402WTTTTTTYP212222122 83 81 0 0 -T120191111111112583255 140245112 21312 03 0 0 0 502 11 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 -T2201911111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 016 00014 0 0 0 0 0 0 -T320191111111112583120180421WTTTTT9WW222221122 43981 0 0 -T120191111111112627255 140245112 33322 03 0 0 0 605 67 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 -T2201911111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112627120110113WTTTTTTWW222221222 83981 0 0 -T320191111111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 -T120191111111112658255 140245112 13322 03 0 0 0 399 34 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112658120140412WTTTTTT9#212222222 83981 0 0 -T120191111111112679255 140356111 42112 03 0 0 0 708 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111126791219790412WTTTTTZP@2122221222221 1321219 20402219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T2201911111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T320191111111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 -T120191111111112870255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201911111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112870120130312WTTTTTTBY212222122 73981 0 0 -T120191111111112912255 140356112 33112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201911111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112912120090501WTTTTT9TY222212222 63 51 0 0 -T320191111111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 -T120191111111112924255 140356112 13322 03 0 0 0 399127 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 -T2201911111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112924120080522WTTTTTZW@212222222 93981 0 0 -T120191111111112989255 140245112 13312 03 0 0 0 399 33 208 1 8 0 1 0 0 0 0 0222222 0 0222 12 -T2201911111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201911111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191111111112989120160802WTTTTTTZ#212222122 63981 0 0 -T120191211111111119255 140245112 23322 03 0 0 0 502 11 0 0 0 0 0 0 0 0 4 0222222 0 0222 12 -T2201912111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 -T120191211111111132255 140245112 61312 03 0 0 0 914 19 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 -T2201912111111111321219820417WTTTTTTTB2222212222223 1321619 3822211910 0 0 0 0 0 0 0 0 0 0 00019 0 0 0 0 0 0 -T320191211111111132120150514WTTTTTZT#212222222 43981 0 0 -T320191211111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 -T320191211111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 -T120191211111111233255 140356112 23122 03 0 0 0 502 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2201912111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 -T120191211111111241255 140245112 23312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201912111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 -T120191211111111305255 140356112 13112 03 0 0 0 399 14 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201912111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111305120040508WTTTTTT9P212222222 83 71 0 0 -T120191211111111312255 140245112 13322 03 0 0 0 399123 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 -T2201912111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111312120090322WTTTTTT@9212222222 83981 0 0 -T120191211111111382255 140245112 33312 03 0 0 0 605 35 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 -T2201912111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111382120080325WTTTTT9TB222221222 83 11 0 0 -T320191211111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 -T120191211111111415255 140356112 13112 03 0 0 0 399 43 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 -T2201912111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 -T320191211111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 -T120191211111111446255 140245112 21312 03 0 0 0 210 23 0 0 0 0 0 0 0 0 6 0222222 0 0222 12 -T2201912111111114461219791105WTTTTTZ0T2122222222221 1321219 26342219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T320191211111111446120050302WTTTTT@TW222221222 43 71 0 0 -T120191211111111652255 140356112 52312 03 0 0 0 811 55 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 -T2201912111111116521219830826WTTTTT9W02122221222221 2321219 060111927 0 0 0 0 0 0 0 0 0 0 000 6 0 0 0 0 0 0 -T2201912111111116521119880125WTTTTTZT@2122222222221 1211212 174312 1 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 -T320191211111111652120130426WTTTTTTWT212222122 43981 0 0 -T320191211111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 -T120191211111111663255 140245112 21312 03 0 0 0 502 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2201912111111116631219910303WTTTTT9BB2222212222222 1321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111663120120514WTTTTT9WP212222122 43 11 0 0 -T120191211111111668255 140356112 31112 03 0 0 0 605 8 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111116681219900413WTTTTT@@Y2122221222221 1321212 1644211918 0 0 0 0 0 0 0 0 0 0 000 2 0 0 0 0 0 0 -T320191211111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 -T120191211111111694255 140356112 13322 03 0 0 0 394144 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 -T2201912111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111694120010527WTTTTTZYT212222122 63 51 0 0 -T120191211111111709255 140245112 13312 03 0 0 0 399 57 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 -T2201912111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111709120110101WTTTTTZ0W212222122 83981 0 0 -T120191211111111716255 140317112 23322 03 0 0 0 502 57 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 -T2201912111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111716120140401WTTTTTTBT212222222 63981 0 0 -T320191211111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 -T120191211111111742255 140245112 31312 03 0 0 01326 96 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 -T2201912111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 026 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 -T120191211111111794255 140245112 52312 03 0 0 0 811 18 0 0 0 0 0 0 0 0 0 0122222 0 0222 12 -T2201912111111117941219800125WTTTTTZB92122222222221 1121219 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111117941219760325WTTTTTZ#Y2222211222221 212 919 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111794120170527WTTTTT9##212222122 43981 0 0 -T320191211111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 -T120191211111111830255 140356112 31112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0212222 0 0222 12 -T2201912111111118301219790105WTTTTT9BW2122222222221 1321211 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 -T120191211111111850255 140356112 42112 03 0 0 0 850 38 0 0 0 0 6 0 1 0 18 0222222 0 0222 42 -T2201912111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 5 0 0 0 0 0 00015 250 0 0 0 0 600 -T2201912111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 020 0 0 0 0 0 0 5 000 3 0 0 0 0 0 0 -T320191211111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 -T120191211111111953255 140356112 21312 03 0 0 0 264105 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 -T2201912111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 -T2201912111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111111953120070102WTTTTTZZY212222122 43981 0 0 -T120191211111112010255 140356112 13322 03 0 0 0 399155 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 -T2201912111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112010120060102WTTTTT@T#212222222 63 11 0 0 -T120191211111112058255 140245112 13322 03 0 0 0 399 56 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 -T2201912111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112058120131114WTTTTT@TT212222122 83981 0 0 -T120191211111112111255 140356112 21312 03 0 0 0 502 22 0 0 0 0 0 0 0 56 9 0122222 0 0222 42 -T2201912111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112111120140102WTTTTT@@@212222222 43981 0 0 -T120191211111112120255 140245112 13322 03 0 0 0 399 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112120120090105WTTTTTTPP212222122 83 31 0 0 -T120191211111112181255 140356112 21312 03 0 0 01159 14 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 -T2201912111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 025 0 0 0 0 0 0 0 000 8 250 0 0 0 0 600 -T320191211111112181120180508WTTTTTTPZ212222222 43981 0 0 -T120191211111112235255 140245112 13322 03 0 0 0 399121 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 -T2201912111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112235120020122WTTTTTTB#212222222 83 51 0 0 -T120191211111112245255 140245112 51322 03 0 0 0 672 68 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 -T2201912111111122451219840313WTTTTTTB92122222222221 1211211 60 02219 0 0 0 0 0 5 0 0 0 0 0 00022 529 0 0 0 0 0 -T320191211111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 -T320191211111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 -T120191211111112338255 140356112 13112 03 0 0 0 399 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112338120080802WTTTTTZ0Z212222122 83 31 0 0 -T120191211111112413255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112413120150514WTTTTTZPP212222122 83981 0 0 -T120191211111112436255 140356112 13112 03 0 0 0 399 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201912111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112436120150314WTTTTTZP9212222222 63981 0 0 -T120191211111112461255 140245112 13322 03 0 0 0 399 32 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 -T2201912111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112461120171102WTTTTTZWT222221122 83981 0 0 -T120191211111112542255 140356112 13112 03 0 0 0 399 24 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2201912111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112542120030402WTTTTTTYP212222122 83 81 0 0 -T120191211111112583255 140245112 21312 03 0 0 0 502 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 -T2201912111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 4 00025 0 0 0 0 0 0 -T320191211111112583120180421WTTTTT9WW222221122 43981 0 0 -T120191211111112627255 140245112 33322 03 0 0 0 605 68 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 -T2201912111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112627120110113WTTTTTTWW222221222 83981 0 0 -T320191211111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 -T120191211111112658255 140245112 13322 03 0 0 0 399 35 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112658120140412WTTTTTT9#212222222 83981 0 0 -T120191211111112679255 140356112 42112 03 0 0 0 708 5 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111126791219790412WTTTTTZP@2122221222221 1321219 21392219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 -T2201912111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 -T320191211111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 -T120191211111112870255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2201912111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112870120130312WTTTTTTBY212222122 73981 0 0 -T120191211111112912255 140356112 33112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2201912111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112912120090501WTTTTT9TY222212222 63 51 0 0 -T320191211111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 -T120191211111112924255 140356112 13322 03 0 0 0 399128 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 -T2201912111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112924120080522WTTTTTZW@212222222 93981 0 0 -T120191211111112989255 140245112 13312 03 0 0 0 399 34 0 0 8 0 1 0 0 0 0 0222222 0 0222 12 -T2201912111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2201912111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320191211111112989120160802WTTTTTTZ#212222122 63981 0 0 +HEADER20214A00142TAN1EU +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 +T120211011111111132255 140245112 61312 03 0 0 0 465 17 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 +T2202110111111111321219820417WTTTTTTTB2222212222223 1321619 36242219 0 0 0 0 0 0 0 0 0 0 0 00028 1149 0 0 0 0 0 +T320211011111111132120150514WTTTTTZT#212222222 43981 0 0 +T320211011111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 +T320211011111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 +T120211011111111233255 140356112 23122 03 0 0 0 502 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2202110111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 +T120211011111111241255 140245112 23312 03 0 0 0 502 8 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202110111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 +T120211011111111305255 140356112 13112 03 0 0 0 399 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202110111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111305120040508WTTTTTT9P212222222 83 71 0 0 +T120211011111111312255 140245112 13322 03 0 0 0 399121 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 +T2202110111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111312120090322WTTTTTT@9212222222 83981 0 0 +T120211011111111339255 140356111 22312 03 0 0 0 453 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202110111111113391219880402WTTTTTZ#B2122221222223 2311211 2582119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111113391219970502WTTTTTTYB2122222222221 1111119 75322 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T120211011111111350255 140245112 33322 03 0 0 0 559 27 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 +T2202110111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111350120100114WTTTTT@WB112222122 43 11 0 0 +T320211011111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 +T120211011111111382255 140245112 33312 03 0 0 0 605 33 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 +T2202110111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111382120080325WTTTTT9TB222221222 83 11 0 0 +T320211011111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 +T120211011111111415255 140356112 13112 03 0 0 0 399 41 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 +T2202110111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 +T320211011111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 +T120211011111111652255 140356111 52312 03 0 0 0 26 53 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 +T2202110111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111652120130426WTTTTTTWT212222122 43981 0 0 +T320211011111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 +T120211011111111663255 140245112 32312 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202110111111116631219910105WTTTTT9#92122221222222 2321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111116631219910303WTTTTT9BB2222212222222 1321219 5552119 3 0 0 0 0 5 0 0 0 0 0 00013 0 0 0 0 0 0 +T320211011111111663120120514WTTTTT9WP212222122 43 11 0 0 +T120211011111111668255 140356111 31112 03 0 0 0 488 6 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111116681219900413WTTTTT@@Y2122221222221 1321212 14462219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T320211011111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 +T120211011111111694255 140356112 13322 03 0 0 0 394142 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 +T2202110111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111694120010527WTTTTTZYT212222122 63 51 0 0 +T120211011111111709255 140245112 13312 03 0 0 0 399 55 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 +T2202110111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111709120110101WTTTTTZ0W212222122 83981 0 0 +T120211011111111716255 140317112 23322 03 0 0 0 502 55 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 +T2202110111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111716120140401WTTTTTTBT212222222 63981 0 0 +T320211011111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 +T120211011111111742255 140245112 31312 03 0 0 01680 94 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 +T2202110111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 033 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 +T120211011111111762255 140245112 23312 03 0 0 0 502 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111117623219880112WTTTTTTY#2222212222222 1321619 1592199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111117623219610502WTTTTTT##2222212222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111111762120160102WTTTTT@YB212222222 83981 0 0120170526WTTTTTZPW212222122 83981 0 0 +T120211011111111794255 140245112 52312 03 0 0 0 811 16 0 0 0 0 0 0 0 0 0 0212222 0 0222 12 +T2202110111111117941219800125WTTTTTZB92122222222221 1121219 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 +T2202110111111117941219760325WTTTTTZ#Y2222211222221 212 919 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 +T320211011111111794120170527WTTTTT9##212222122 43981 0 0 +T320211011111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 +T120211011111111830255 140356111 31112 03 0 0 0 585 1 0 0 0 0 0 0 0 30 1 0222222 0 0222 12 +T2202110111111118301219790105WTTTTT9BW2122222222221 1321211 65421 2 1 0 0 0 0 1 0 0 0 0 0 000 6 0 0 0 0 0 0 +T320211011111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 +T120211011111111850255 140356112 42112 03 0 0 01203 36 0 0 0 0 6 0 1 650 17 0222222 0 0222 42 +T2202110111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 0 0 0 0 0 0 00022 0 0 0 0 0 0 +T2202110111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 010 000 6 0 0 0 0 0 0 +T320211011111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 +T120211011111112010255 140356112 13322 03 0 0 0 399153 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 +T2202110111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112010120060102WTTTTT@T#212222222 63 11 0 0 +T120211011111112058255 140245112 13322 03 0 0 0 399 54 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 +T2202110111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112058120131114WTTTTT@TT212222122 83981 0 0 +T120211011111112111255 140356112 21312 03 0 0 0 502 20 0 0 0 0 0 0 0 335 8 0222222 0 0222 42 +T2202110111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 +T320211011111112111120140102WTTTTT@@@212222222 43981 0 0 +T120211011111112120255 140245112 13322 03 0 0 0 399 15 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112120120090105WTTTTTTPP212222122 83 31 0 0 +T120211011111112181255 140356112 21312 03 0 0 01219 12 0 0 0 0 0 0 0 240 2 0222212 0 0222 42 +T2202110111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 021 0 0 0 0 0 0 0 000 8 0 0 0 0 0 0 +T320211011111112181120180508WTTTTTTPZ212222222 43981 0 0 +T120211011111112235255 140245112 13322 03 0 0 0 399119 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 +T2202110111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112235120020122WTTTTTTB#212222222 83 51 0 0 +T120211011111112245255 140245112 51322 03 0 0 0 811 66 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 +T2202110111111122451219840313WTTTTTTB92122222222221 1211211 60 02119 7 0 0 0 0 8 0 0 0 0 0 00012 0 0 0 0 0 0 +T320211011111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 +T320211011111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 +T120211011111112338255 140356112 13112 03 0 0 0 399 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112338120080802WTTTTTZ0Z212222122 83 31 0 0 +T120211011111112413255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112413120150514WTTTTTZPP212222122 83981 0 0 +T120211011111112436255 140356112 13112 03 0 0 0 399 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2202110111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112436120150314WTTTTTZP9212222222 63981 0 0 +T120211011111112461255 140245112 13322 03 0 0 0 399 30 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 +T2202110111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112461120171102WTTTTTZWT222221122 83981 0 0 +T120211011111112542255 140356112 13112 03 0 0 0 399 22 0 0 0 0 0 0 0 130 3 0222222 0 0222 22 +T2202110111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112542120030402WTTTTTTYP212222122 83 81 0 0 +T120211011111112583255 140245112 21312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 +T2202110111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 5 00016 0 0 0 0 0 0 +T320211011111112583120180421WTTTTT9WW222221122 43981 0 0 +T120211011111112627255 140245112 33322 03 0 0 0 605 66 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 +T2202110111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112627120110113WTTTTTTWW222221222 83981 0 0 +T320211011111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 +T120211011111112658255 140245112 13322 03 0 0 0 399 33 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112658120140412WTTTTTT9#212222222 83981 0 0 +T120211011111112870255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2202110111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112870120130312WTTTTTTBY212222122 73981 0 0 +T120211011111112912255 140356111 33112 03 0 0 0 292 1 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202110111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112912120090501WTTTTT9TY222212222 63 51 0 0 +T320211011111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 +T120211011111112924255 140356112 13322 03 0 0 0 399126 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 +T2202110111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112924120080522WTTTTTZW@212222222 93981 0 0 +T120211011111112989255 140245112 13312 03 0 0 0 399 32 189 1 7 0 1 0 0 0 0 0222222 0 0222 12 +T2202110111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202110111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211011111112989120160802WTTTTTTZ#212222122 63981 0 0 +T120211111111111119255 140245112 23322 03 0 0 0 502 10 0 0 0 0 0 0 0 567 4 0222222 0 0222 12 +T2202111111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 +T120211111111111132255 140245112 61312 03 0 0 0 914 18 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 +T2202111111111111321219820417WTTTTTTTB2222212222223 1321619 3723211920 0 0 0 0 0 0 0 0 0 0 00012 0 0 0 0 0 0 +T320211111111111132120150514WTTTTTZT#212222222 43981 0 0 +T320211111111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 +T320211111111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 +T120211111111111233255 140356112 23122 03 0 0 0 502 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2202111111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 +T120211111111111241255 140245112 23312 03 0 0 0 502 9 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202111111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 +T120211111111111305255 140356112 13112 03 0 0 0 399 13 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202111111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111305120040508WTTTTTT9P212222222 83 71 0 0 +T120211111111111312255 140245112 13322 03 0 0 0 399122 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 +T2202111111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111312120090322WTTTTTT@9212222222 83981 0 0 +T120211111111111339255 140356112 22312 03 0 0 0 502 6 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202111111111113391219880402WTTTTTZ#B2122221222223 2311211 3572119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111113391219970502WTTTTTTYB2122222222221 1111119 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T120211111111111350255 140245112 33322 03 0 0 0 559 28 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 +T2202111111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111350120100114WTTTTT@WB112222122 43 11 0 0 +T320211111111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 +T120211111111111382255 140245112 33312 03 0 0 0 605 34 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 +T2202111111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111382120080325WTTTTT9TB222221222 83 11 0 0 +T320211111111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 +T120211111111111415255 140356112 13112 03 0 0 0 399 42 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 +T2202111111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 +T320211111111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 +T120211111111111652255 140356112 52312 03 0 0 0 811 54 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 +T2202111111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 +T2202111111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 +T320211111111111652120130426WTTTTTTWT212222122 43981 0 0 +T320211111111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 +T120211111111111663255 140245112 32312 03 0 0 0 605 4 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202111111111116631219910105WTTTTT9#92122221222222 2321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111116631219910303WTTTTT9BB2222212222222 1321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111663120120514WTTTTT9WP212222122 43 11 0 0 +T120211111111111668255 140356112 31112 03 0 0 0 605 7 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111116681219900413WTTTTT@@Y2122221222221 1321212 1545211921 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 +T320211111111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 +T120211111111111694255 140356112 13322 03 0 0 0 394143 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 +T2202111111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111694120010527WTTTTTZYT212222122 63 51 0 0 +T120211111111111709255 140245112 13312 03 0 0 0 399 56 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 +T2202111111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111709120110101WTTTTTZ0W212222122 83981 0 0 +T120211111111111716255 140317112 23322 03 0 0 0 502 56 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 +T2202111111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111716120140401WTTTTTTBT212222222 63981 0 0 +T320211111111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 +T120211111111111742255 140245112 31312 03 0 0 01512 95 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 +T2202111111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 028 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 +T120211111111111794255 140245112 52312 03 0 0 0 811 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111117941219800125WTTTTTZB92122222222221 1121219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111117941219760325WTTTTTZ#Y2222211222221 212 919 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111794120170527WTTTTT9##212222122 43981 0 0 +T320211111111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 +T120211111111111830255 140356112 31112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202111111111118301219790105WTTTTT9BW2122222222221 1321211 75321 2 3 0 0 0 0 0 0 0 0 0 0 00014 0 0 0 0 0 0 +T320211111111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 +T120211111111111850255 140356112 42112 03 0 0 01205 37 0 0 0 0 6 0 1 100 18 0222212 0 0222 42 +T2202111111111118501219870513WTTTTTZPY2122222222223 1321212 060111935 0 0 0 0 0 0 0 0 0 0 000 5 0 0 0 0 0 0 +T2202111111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 0 6 000 5 0 0 0 0 0 0 +T320211111111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 +T120211111111111953255 140356112 21312 03 0 0 0 264104 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 +T2202111111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 +T2202111111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111111953120070102WTTTTTZZY212222122 43981 0 0 +T120211111111112010255 140356112 13322 03 0 0 0 399154 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 +T2202111111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112010120060102WTTTTT@T#212222222 63 11 0 0 +T120211111111112058255 140245112 13322 03 0 0 0 399 55 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 +T2202111111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112058120131114WTTTTT@TT212222122 83981 0 0 +T120211111111112111255 140356112 21312 03 0 0 0 502 21 0 0 0 0 0 0 0 0 8 0222222 0 0222 42 +T2202111111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 1 0 0 0 0 0 000 4 0 0 0 0 0 0 +T320211111111112111120140102WTTTTT@@@212222222 43981 0 0 +T120211111111112120255 140245112 13322 03 0 0 0 399 16 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112120120090105WTTTTTTPP212222122 83 31 0 0 +T120211111111112181255 140356112 21312 03 0 0 01252 13 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 +T2202111111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 022 0 0 0 0 0 0 0 00011 0 0 0 0 0 0 +T320211111111112181120180508WTTTTTTPZ212222222 43981 0 0 +T120211111111112235255 140245112 13322 03 0 0 0 399120 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 +T2202111111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112235120020122WTTTTTTB#212222222 83 51 0 0 +T120211111111112245255 140245112 51322 03 0 0 0 559 67 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 +T2202111111111122451219840313WTTTTTTB92122222222221 1211211 60 0211915 0 0 0 0 1 0 0 0 0 0 00012 754 0 0 0 0 0 +T320211111111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 +T320211111111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 +T120211111111112338255 140356112 13112 03 0 0 0 399 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112338120080802WTTTTTZ0Z212222122 83 31 0 0 +T120211111111112413255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112413120150514WTTTTTZPP212222122 83981 0 0 +T120211111111112436255 140356112 13112 03 0 0 0 399 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2202111111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112436120150314WTTTTTZP9212222222 63981 0 0 +T120211111111112461255 140245112 13322 03 0 0 0 399 31 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 +T2202111111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112461120171102WTTTTTZWT222221122 83981 0 0 +T120211111111112542255 140356112 13112 03 0 0 0 399 23 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2202111111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112542120030402WTTTTTTYP212222122 83 81 0 0 +T120211111111112583255 140245112 21312 03 0 0 0 502 11 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 +T2202111111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 016 00014 0 0 0 0 0 0 +T320211111111112583120180421WTTTTT9WW222221122 43981 0 0 +T120211111111112627255 140245112 33322 03 0 0 0 605 67 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 +T2202111111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112627120110113WTTTTTTWW222221222 83981 0 0 +T320211111111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 +T120211111111112658255 140245112 13322 03 0 0 0 399 34 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112658120140412WTTTTTT9#212222222 83981 0 0 +T120211111111112679255 140356111 42112 03 0 0 0 708 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111126791219790412WTTTTTZP@2122221222221 1321219 20402219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T2202111111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T320211111111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 +T120211111111112870255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2202111111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112870120130312WTTTTTTBY212222122 73981 0 0 +T120211111111112912255 140356112 33112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202111111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112912120090501WTTTTT9TY222212222 63 51 0 0 +T320211111111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 +T120211111111112924255 140356112 13322 03 0 0 0 399127 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 +T2202111111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112924120080522WTTTTTZW@212222222 93981 0 0 +T120211111111112989255 140245112 13312 03 0 0 0 399 33 208 1 8 0 1 0 0 0 0 0222222 0 0222 12 +T2202111111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202111111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211111111112989120160802WTTTTTTZ#212222122 63981 0 0 +T120211211111111119255 140245112 23322 03 0 0 0 502 11 0 0 0 0 0 0 0 0 4 0222222 0 0222 12 +T2202112111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 +T120211211111111132255 140245112 61312 03 0 0 0 914 19 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 +T2202112111111111321219820417WTTTTTTTB2222212222223 1321619 3822211910 0 0 0 0 0 0 0 0 0 0 00019 0 0 0 0 0 0 +T320211211111111132120150514WTTTTTZT#212222222 43981 0 0 +T320211211111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 +T320211211111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 +T120211211111111233255 140356112 23122 03 0 0 0 502 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2202112111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 +T120211211111111241255 140245112 23312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202112111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 +T120211211111111305255 140356112 13112 03 0 0 0 399 14 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202112111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111305120040508WTTTTTT9P212222222 83 71 0 0 +T120211211111111312255 140245112 13322 03 0 0 0 399123 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 +T2202112111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111312120090322WTTTTTT@9212222222 83981 0 0 +T120211211111111382255 140245112 33312 03 0 0 0 605 35 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 +T2202112111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111382120080325WTTTTT9TB222221222 83 11 0 0 +T320211211111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 +T120211211111111415255 140356112 13112 03 0 0 0 399 43 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 +T2202112111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 +T320211211111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 +T120211211111111446255 140245112 21312 03 0 0 0 210 23 0 0 0 0 0 0 0 0 6 0222222 0 0222 12 +T2202112111111114461219791105WTTTTTZ0T2122222222221 1321219 26342219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 +T320211211111111446120050302WTTTTT@TW222221222 43 71 0 0 +T120211211111111652255 140356112 52312 03 0 0 0 811 55 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 +T2202112111111116521219830826WTTTTT9W02122221222221 2321219 060111927 0 0 0 0 0 0 0 0 0 0 000 6 0 0 0 0 0 0 +T2202112111111116521119880125WTTTTTZT@2122222222221 1211212 174312 1 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 +T320211211111111652120130426WTTTTTTWT212222122 43981 0 0 +T320211211111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 +T120211211111111663255 140245112 21312 03 0 0 0 502 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 +T2202112111111116631219910303WTTTTT9BB2222212222222 1321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111663120120514WTTTTT9WP212222122 43 11 0 0 +T120211211111111668255 140356112 31112 03 0 0 0 605 8 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111116681219900413WTTTTT@@Y2122221222221 1321212 1644211918 0 0 0 0 0 0 0 0 0 0 000 2 0 0 0 0 0 0 +T320211211111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 +T120211211111111694255 140356112 13322 03 0 0 0 394144 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 +T2202112111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111694120010527WTTTTTZYT212222122 63 51 0 0 +T120211211111111709255 140245112 13312 03 0 0 0 399 57 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 +T2202112111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111709120110101WTTTTTZ0W212222122 83981 0 0 +T120211211111111716255 140317112 23322 03 0 0 0 502 57 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 +T2202112111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111716120140401WTTTTTTBT212222222 63981 0 0 +T320211211111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 +T120211211111111742255 140245112 31312 03 0 0 01326 96 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 +T2202112111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 026 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 +T120211211111111794255 140245112 52312 03 0 0 0 811 18 0 0 0 0 0 0 0 0 0 0122222 0 0222 12 +T2202112111111117941219800125WTTTTTZB92122222222221 1121219 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111117941219760325WTTTTTZ#Y2222211222221 212 919 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111794120170527WTTTTT9##212222122 43981 0 0 +T320211211111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 +T120211211111111830255 140356112 31112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0212222 0 0222 12 +T2202112111111118301219790105WTTTTT9BW2122222222221 1321211 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 +T120211211111111850255 140356112 42112 03 0 0 0 850 38 0 0 0 0 6 0 1 0 18 0222222 0 0222 42 +T2202112111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 5 0 0 0 0 0 00015 250 0 0 0 0 600 +T2202112111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 020 0 0 0 0 0 0 5 000 3 0 0 0 0 0 0 +T320211211111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 +T120211211111111953255 140356112 21312 03 0 0 0 264105 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 +T2202112111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 +T2202112111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111111953120070102WTTTTTZZY212222122 43981 0 0 +T120211211111112010255 140356112 13322 03 0 0 0 399155 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 +T2202112111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112010120060102WTTTTT@T#212222222 63 11 0 0 +T120211211111112058255 140245112 13322 03 0 0 0 399 56 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 +T2202112111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112058120131114WTTTTT@TT212222122 83981 0 0 +T120211211111112111255 140356112 21312 03 0 0 0 502 22 0 0 0 0 0 0 0 56 9 0122222 0 0222 42 +T2202112111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112111120140102WTTTTT@@@212222222 43981 0 0 +T120211211111112120255 140245112 13322 03 0 0 0 399 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112120120090105WTTTTTTPP212222122 83 31 0 0 +T120211211111112181255 140356112 21312 03 0 0 01159 14 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 +T2202112111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 025 0 0 0 0 0 0 0 000 8 250 0 0 0 0 600 +T320211211111112181120180508WTTTTTTPZ212222222 43981 0 0 +T120211211111112235255 140245112 13322 03 0 0 0 399121 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 +T2202112111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112235120020122WTTTTTTB#212222222 83 51 0 0 +T120211211111112245255 140245112 51322 03 0 0 0 672 68 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 +T2202112111111122451219840313WTTTTTTB92122222222221 1211211 60 02219 0 0 0 0 0 5 0 0 0 0 0 00022 529 0 0 0 0 0 +T320211211111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 +T320211211111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 +T120211211111112338255 140356112 13112 03 0 0 0 399 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112338120080802WTTTTTZ0Z212222122 83 31 0 0 +T120211211111112413255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112413120150514WTTTTTZPP212222122 83981 0 0 +T120211211111112436255 140356112 13112 03 0 0 0 399 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2202112111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112436120150314WTTTTTZP9212222222 63981 0 0 +T120211211111112461255 140245112 13322 03 0 0 0 399 32 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 +T2202112111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112461120171102WTTTTTZWT222221122 83981 0 0 +T120211211111112542255 140356112 13112 03 0 0 0 399 24 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 +T2202112111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112542120030402WTTTTTTYP212222122 83 81 0 0 +T120211211111112583255 140245112 21312 03 0 0 0 502 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 +T2202112111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 4 00025 0 0 0 0 0 0 +T320211211111112583120180421WTTTTT9WW222221122 43981 0 0 +T120211211111112627255 140245112 33322 03 0 0 0 605 68 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 +T2202112111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112627120110113WTTTTTTWW222221222 83981 0 0 +T320211211111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 +T120211211111112658255 140245112 13322 03 0 0 0 399 35 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112658120140412WTTTTTT9#212222222 83981 0 0 +T120211211111112679255 140356112 42112 03 0 0 0 708 5 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111126791219790412WTTTTTZP@2122221222221 1321219 21392219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 +T2202112111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 +T320211211111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 +T120211211111112870255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 +T2202112111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112870120130312WTTTTTTBY212222122 73981 0 0 +T120211211111112912255 140356112 33112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 +T2202112111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112912120090501WTTTTT9TY222212222 63 51 0 0 +T320211211111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 +T120211211111112924255 140356112 13322 03 0 0 0 399128 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 +T2202112111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112924120080522WTTTTTZW@212222222 93981 0 0 +T120211211111112989255 140245112 13312 03 0 0 0 399 34 0 0 8 0 1 0 0 0 0 0222222 0 0222 12 +T2202112111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T2202112111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 +T320211211111112989120160802WTTTTTTZ#212222122 63981 0 0 TRAILER0000471 diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index 1a8599a22..e12445fc2 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -992,25 +992,44 @@ def tribal_section_1_file(stt_user, stt): return util.create_test_datafile('ADS.E2J.FTP1.TS142', stt_user, stt, "Tribal Active Case Data") @pytest.mark.django_db() -def test_parse_tribal_section_1_file(tribal_section_1_file): +def test_parse_tribal_section_1_file(tribal_section_1_file, dfs): """Test parsing Tribal TANF Section 1 submission.""" + tribal_section_1_file.year = 2022 + tribal_section_1_file.quarter = 'Q1' + tribal_section_1_file.save() + + dfs.datafile = tribal_section_1_file + dfs.save() + parse.parse_datafile(tribal_section_1_file) + dfs.status = dfs.get_status() + assert dfs.status == DataFileSummary.Status.ACCEPTED_WITH_ERRORS + dfs.case_aggregates = util.case_aggregates_by_month( + dfs.datafile, dfs.status) + assert dfs.case_aggregates == {'rejected': 0, + 'months': [{'month': 'Oct', 'accepted_without_errors': 35, + 'accepted_with_errors': 5}, + {'month': 'Nov', 'accepted_without_errors': 36, + 'accepted_with_errors': 5}, + {'month': 'Dec', 'accepted_without_errors': 35, + 'accepted_with_errors': 5}]} + assert Tribal_TANF_T1.objects.all().count() == 121 assert Tribal_TANF_T2.objects.all().count() == 199 assert Tribal_TANF_T3.objects.all().count() == 213 - t_t1_objs = Tribal_TANF_T1.objects.all().order_by("CASH_AMOUNT") - t_t2_objs = Tribal_TANF_T2.objects.all().order_by("MONTHS_FED_TIME_LIMIT") - t_t3_objs = Tribal_TANF_T3.objects.all().order_by("EDUCATION_LEVEL") + t1_objs = Tribal_TANF_T1.objects.all().order_by("CASH_AMOUNT") + t2_objs = Tribal_TANF_T2.objects.all().order_by("MONTHS_FED_TIME_LIMIT") + t3_objs = Tribal_TANF_T3.objects.all().order_by("EDUCATION_LEVEL") - t_t1 = t_t1_objs.first() - t_t2 = t_t2_objs.last() - t_t3 = t_t3_objs.last() + t1 = t1_objs.first() + t2 = t2_objs.last() + t3 = t3_objs.last() - assert t_t1.CASH_AMOUNT == 26 - assert t_t2.MONTHS_FED_TIME_LIMIT == ' 8' - assert t_t3.EDUCATION_LEVEL == '98' + assert t1.CASH_AMOUNT == 26 + assert t2.MONTHS_FED_TIME_LIMIT == ' 8' + assert t3.EDUCATION_LEVEL == '98' @pytest.fixture def tribal_section_1_inconsistency_file(stt_user, stt): diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index ee0b5a15d..664df553b 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -180,9 +180,9 @@ def get_schema_options(program, section, query=None, model=None, model_name=None 'A': { 'section': DataFile.Section.TRIBAL_ACTIVE_CASE_DATA, 'models': { - 'T1': schema_defs.tribal_tanf.t_t1, - 'T2': schema_defs.tribal_tanf.t_t2, - 'T3': schema_defs.tribal_tanf.t_t3, + 'T1': schema_defs.tribal_tanf.t1, + 'T2': schema_defs.tribal_tanf.t2, + 'T3': schema_defs.tribal_tanf.t3, } }, }, @@ -247,7 +247,7 @@ def get_prog_from_section(str_section): if str_section.startswith('SSP'): return 'SSP' elif str_section.startswith('Tribal'): - return 'TAN' # problematic, do we need to infer tribal entirely from tribe/fips code? + return 'Tribal TAN' else: return 'TAN' From 1838bf891ce0866124061c10a16a4c3fb3ddeb60 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 27 Nov 2023 12:14:47 -0700 Subject: [PATCH 65/88] - Reduced file size - Updated test --- .../parsers/test/data/ADS.E2J.FTP1.TS142 | 470 +----------------- .../tdpservice/parsers/test/test_parse.py | 26 +- 2 files changed, 14 insertions(+), 482 deletions(-) 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 1de31cf64..5fa1ab095 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 @@ -2,472 +2,4 @@ HEADER20214A00142TAN1EU 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 -T120211011111111132255 140245112 61312 03 0 0 0 465 17 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 -T2202110111111111321219820417WTTTTTTTB2222212222223 1321619 36242219 0 0 0 0 0 0 0 0 0 0 0 00028 1149 0 0 0 0 0 -T320211011111111132120150514WTTTTTZT#212222222 43981 0 0 -T320211011111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 -T320211011111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 -T120211011111111233255 140356112 23122 03 0 0 0 502 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2202110111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 -T120211011111111241255 140245112 23312 03 0 0 0 502 8 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202110111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 -T120211011111111305255 140356112 13112 03 0 0 0 399 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202110111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111305120040508WTTTTTT9P212222222 83 71 0 0 -T120211011111111312255 140245112 13322 03 0 0 0 399121 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 -T2202110111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111312120090322WTTTTTT@9212222222 83981 0 0 -T120211011111111339255 140356111 22312 03 0 0 0 453 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202110111111113391219880402WTTTTTZ#B2122221222223 2311211 2582119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111113391219970502WTTTTTTYB2122222222221 1111119 75322 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T120211011111111350255 140245112 33322 03 0 0 0 559 27 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 -T2202110111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111350120100114WTTTTT@WB112222122 43 11 0 0 -T320211011111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 -T120211011111111382255 140245112 33312 03 0 0 0 605 33 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 -T2202110111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111382120080325WTTTTT9TB222221222 83 11 0 0 -T320211011111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 -T120211011111111415255 140356112 13112 03 0 0 0 399 41 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 -T2202110111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 -T320211011111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 -T120211011111111652255 140356111 52312 03 0 0 0 26 53 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 -T2202110111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111652120130426WTTTTTTWT212222122 43981 0 0 -T320211011111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 -T120211011111111663255 140245112 32312 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202110111111116631219910105WTTTTT9#92122221222222 2321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111116631219910303WTTTTT9BB2222212222222 1321219 5552119 3 0 0 0 0 5 0 0 0 0 0 00013 0 0 0 0 0 0 -T320211011111111663120120514WTTTTT9WP212222122 43 11 0 0 -T120211011111111668255 140356111 31112 03 0 0 0 488 6 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111116681219900413WTTTTT@@Y2122221222221 1321212 14462219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T320211011111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 -T120211011111111694255 140356112 13322 03 0 0 0 394142 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 -T2202110111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111694120010527WTTTTTZYT212222122 63 51 0 0 -T120211011111111709255 140245112 13312 03 0 0 0 399 55 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 -T2202110111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111709120110101WTTTTTZ0W212222122 83981 0 0 -T120211011111111716255 140317112 23322 03 0 0 0 502 55 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 -T2202110111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111716120140401WTTTTTTBT212222222 63981 0 0 -T320211011111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 -T120211011111111742255 140245112 31312 03 0 0 01680 94 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 -T2202110111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 033 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 -T120211011111111762255 140245112 23312 03 0 0 0 502 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111117623219880112WTTTTTTY#2222212222222 1321619 1592199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111117623219610502WTTTTTT##2222212222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111111762120160102WTTTTT@YB212222222 83981 0 0120170526WTTTTTZPW212222122 83981 0 0 -T120211011111111794255 140245112 52312 03 0 0 0 811 16 0 0 0 0 0 0 0 0 0 0212222 0 0222 12 -T2202110111111117941219800125WTTTTTZB92122222222221 1121219 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 -T2202110111111117941219760325WTTTTTZ#Y2222211222221 212 919 65422 2 0 0 0 0 0 0 0 0 0 0 0 00018 0 0 0 0 0 0 -T320211011111111794120170527WTTTTT9##212222122 43981 0 0 -T320211011111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 -T120211011111111830255 140356111 31112 03 0 0 0 585 1 0 0 0 0 0 0 0 30 1 0222222 0 0222 12 -T2202110111111118301219790105WTTTTT9BW2122222222221 1321211 65421 2 1 0 0 0 0 1 0 0 0 0 0 000 6 0 0 0 0 0 0 -T320211011111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 -T120211011111111850255 140356112 42112 03 0 0 01203 36 0 0 0 0 6 0 1 650 17 0222222 0 0222 42 -T2202110111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 0 0 0 0 0 0 00022 0 0 0 0 0 0 -T2202110111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 010 000 6 0 0 0 0 0 0 -T320211011111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 -T120211011111112010255 140356112 13322 03 0 0 0 399153 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 -T2202110111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112010120060102WTTTTT@T#212222222 63 11 0 0 -T120211011111112058255 140245112 13322 03 0 0 0 399 54 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 -T2202110111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112058120131114WTTTTT@TT212222122 83981 0 0 -T120211011111112111255 140356112 21312 03 0 0 0 502 20 0 0 0 0 0 0 0 335 8 0222222 0 0222 42 -T2202110111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 -T320211011111112111120140102WTTTTT@@@212222222 43981 0 0 -T120211011111112120255 140245112 13322 03 0 0 0 399 15 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112120120090105WTTTTTTPP212222122 83 31 0 0 -T120211011111112181255 140356112 21312 03 0 0 01219 12 0 0 0 0 0 0 0 240 2 0222212 0 0222 42 -T2202110111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 021 0 0 0 0 0 0 0 000 8 0 0 0 0 0 0 -T320211011111112181120180508WTTTTTTPZ212222222 43981 0 0 -T120211011111112235255 140245112 13322 03 0 0 0 399119 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 -T2202110111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112235120020122WTTTTTTB#212222222 83 51 0 0 -T120211011111112245255 140245112 51322 03 0 0 0 811 66 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 -T2202110111111122451219840313WTTTTTTB92122222222221 1211211 60 02119 7 0 0 0 0 8 0 0 0 0 0 00012 0 0 0 0 0 0 -T320211011111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 -T320211011111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 -T120211011111112338255 140356112 13112 03 0 0 0 399 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112338120080802WTTTTTZ0Z212222122 83 31 0 0 -T120211011111112413255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112413120150514WTTTTTZPP212222122 83981 0 0 -T120211011111112436255 140356112 13112 03 0 0 0 399 28 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2202110111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112436120150314WTTTTTZP9212222222 63981 0 0 -T120211011111112461255 140245112 13322 03 0 0 0 399 30 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 -T2202110111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112461120171102WTTTTTZWT222221122 83981 0 0 -T120211011111112542255 140356112 13112 03 0 0 0 399 22 0 0 0 0 0 0 0 130 3 0222222 0 0222 22 -T2202110111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112542120030402WTTTTTTYP212222122 83 81 0 0 -T120211011111112583255 140245112 21312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 -T2202110111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 5 00016 0 0 0 0 0 0 -T320211011111112583120180421WTTTTT9WW222221122 43981 0 0 -T120211011111112627255 140245112 33322 03 0 0 0 605 66 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 -T2202110111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112627120110113WTTTTTTWW222221222 83981 0 0 -T320211011111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 -T120211011111112658255 140245112 13322 03 0 0 0 399 33 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112658120140412WTTTTTT9#212222222 83981 0 0 -T120211011111112870255 140245112 13312 03 0 0 0 399 9 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2202110111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112870120130312WTTTTTTBY212222122 73981 0 0 -T120211011111112912255 140356111 33112 03 0 0 0 292 1 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202110111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112912120090501WTTTTT9TY222212222 63 51 0 0 -T320211011111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 -T120211011111112924255 140356112 13322 03 0 0 0 399126 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 -T2202110111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112924120080522WTTTTTZW@212222222 93981 0 0 -T120211011111112989255 140245112 13312 03 0 0 0 399 32 189 1 7 0 1 0 0 0 0 0222222 0 0222 12 -T2202110111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202110111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211011111112989120160802WTTTTTTZ#212222122 63981 0 0 -T120211111111111119255 140245112 23322 03 0 0 0 502 10 0 0 0 0 0 0 0 567 4 0222222 0 0222 12 -T2202111111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 -T120211111111111132255 140245112 61312 03 0 0 0 914 18 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 -T2202111111111111321219820417WTTTTTTTB2222212222223 1321619 3723211920 0 0 0 0 0 0 0 0 0 0 00012 0 0 0 0 0 0 -T320211111111111132120150514WTTTTTZT#212222222 43981 0 0 -T320211111111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 -T320211111111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 -T120211111111111233255 140356112 23122 03 0 0 0 502 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2202111111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 -T120211111111111241255 140245112 23312 03 0 0 0 502 9 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202111111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 -T120211111111111305255 140356112 13112 03 0 0 0 399 13 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202111111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111305120040508WTTTTTT9P212222222 83 71 0 0 -T120211111111111312255 140245112 13322 03 0 0 0 399122 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 -T2202111111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111312120090322WTTTTTT@9212222222 83981 0 0 -T120211111111111339255 140356112 22312 03 0 0 0 502 6 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202111111111113391219880402WTTTTTZ#B2122221222223 2311211 3572119 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111113391219970502WTTTTTTYB2122222222221 1111119 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T120211111111111350255 140245112 33322 03 0 0 0 559 28 0 0 0 0 0 0 0 0 5 0222222 47 0222 22 -T2202111111111113503219801101WTTTTT@@@1222221222221 1329999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111350120100114WTTTTT@WB112222122 43 11 0 0 -T320211111111111350120070525WTTTTTZTP112222122 43 31 0 0120080124WTTTTT@09112222122 43 21 0 0 -T120211111111111382255 140245112 33312 03 0 0 0 605 34 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 -T2202111111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111382120080325WTTTTT9TB222221222 83 11 0 0 -T320211111111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 -T120211111111111415255 140356112 13112 03 0 0 0 399 42 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 -T2202111111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 -T320211111111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 -T120211111111111652255 140356112 52312 03 0 0 0 811 54 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 -T2202111111111116521219830826WTTTTT9W02122221222221 2321219 0601219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 -T2202111111111116521119880125WTTTTTZT@2122222222221 1211212 17431219 0 0 0 0 0 0 0 0 0 0 0 00020 0 0 0 0 0 0 -T320211111111111652120130426WTTTTTTWT212222122 43981 0 0 -T320211111111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 -T120211111111111663255 140245112 32312 03 0 0 0 605 4 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202111111111116631219910105WTTTTT9#92122221222222 2321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111116631219910303WTTTTT9BB2222212222222 1321219 6542219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111663120120514WTTTTT9WP212222122 43 11 0 0 -T120211111111111668255 140356112 31112 03 0 0 0 605 7 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111116681219900413WTTTTT@@Y2122221222221 1321212 1545211921 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 -T320211111111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 -T120211111111111694255 140356112 13322 03 0 0 0 394143 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 -T2202111111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111694120010527WTTTTTZYT212222122 63 51 0 0 -T120211111111111709255 140245112 13312 03 0 0 0 399 56 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 -T2202111111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111709120110101WTTTTTZ0W212222122 83981 0 0 -T120211111111111716255 140317112 23322 03 0 0 0 502 56 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 -T2202111111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111716120140401WTTTTTTBT212222222 63981 0 0 -T320211111111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 -T120211111111111742255 140245112 31312 03 0 0 01512 95 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 -T2202111111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 028 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 -T120211111111111794255 140245112 52312 03 0 0 0 811 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111117941219800125WTTTTTZB92122222222221 1121219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111117941219760325WTTTTTZ#Y2222211222221 212 919 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111794120170527WTTTTT9##212222122 43981 0 0 -T320211111111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 -T120211111111111830255 140356112 31112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202111111111118301219790105WTTTTT9BW2122222222221 1321211 75321 2 3 0 0 0 0 0 0 0 0 0 0 00014 0 0 0 0 0 0 -T320211111111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 -T120211111111111850255 140356112 42112 03 0 0 01205 37 0 0 0 0 6 0 1 100 18 0222212 0 0222 42 -T2202111111111118501219870513WTTTTTZPY2122222222223 1321212 060111935 0 0 0 0 0 0 0 0 0 0 000 5 0 0 0 0 0 0 -T2202111111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 025 0 0 0 0 0 0 6 000 5 0 0 0 0 0 0 -T320211111111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 -T120211111111111953255 140356112 21312 03 0 0 0 264104 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 -T2202111111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 -T2202111111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111111953120070102WTTTTTZZY212222122 43981 0 0 -T120211111111112010255 140356112 13322 03 0 0 0 399154 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 -T2202111111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112010120060102WTTTTT@T#212222222 63 11 0 0 -T120211111111112058255 140245112 13322 03 0 0 0 399 55 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 -T2202111111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112058120131114WTTTTT@TT212222122 83981 0 0 -T120211111111112111255 140356112 21312 03 0 0 0 502 21 0 0 0 0 0 0 0 0 8 0222222 0 0222 42 -T2202111111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 1 0 0 0 0 0 000 4 0 0 0 0 0 0 -T320211111111112111120140102WTTTTT@@@212222222 43981 0 0 -T120211111111112120255 140245112 13322 03 0 0 0 399 16 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112120120090105WTTTTTTPP212222122 83 31 0 0 -T120211111111112181255 140356112 21312 03 0 0 01252 13 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 -T2202111111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 022 0 0 0 0 0 0 0 00011 0 0 0 0 0 0 -T320211111111112181120180508WTTTTTTPZ212222222 43981 0 0 -T120211111111112235255 140245112 13322 03 0 0 0 399120 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 -T2202111111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112235120020122WTTTTTTB#212222222 83 51 0 0 -T120211111111112245255 140245112 51322 03 0 0 0 559 67 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 -T2202111111111122451219840313WTTTTTTB92122222222221 1211211 60 0211915 0 0 0 0 1 0 0 0 0 0 00012 754 0 0 0 0 0 -T320211111111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 -T320211111111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 -T120211111111112338255 140356112 13112 03 0 0 0 399 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112338120080802WTTTTTZ0Z212222122 83 31 0 0 -T120211111111112413255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112413120150514WTTTTTZPP212222122 83981 0 0 -T120211111111112436255 140356112 13112 03 0 0 0 399 29 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2202111111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112436120150314WTTTTTZP9212222222 63981 0 0 -T120211111111112461255 140245112 13322 03 0 0 0 399 31 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 -T2202111111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112461120171102WTTTTTZWT222221122 83981 0 0 -T120211111111112542255 140356112 13112 03 0 0 0 399 23 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2202111111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112542120030402WTTTTTTYP212222122 83 81 0 0 -T120211111111112583255 140245112 21312 03 0 0 0 502 11 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 -T2202111111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 016 00014 0 0 0 0 0 0 -T320211111111112583120180421WTTTTT9WW222221122 43981 0 0 -T120211111111112627255 140245112 33322 03 0 0 0 605 67 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 -T2202111111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112627120110113WTTTTTTWW222221222 83981 0 0 -T320211111111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 -T120211111111112658255 140245112 13322 03 0 0 0 399 34 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112658120140412WTTTTTT9#212222222 83981 0 0 -T120211111111112679255 140356111 42112 03 0 0 0 708 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111126791219790412WTTTTTZP@2122221222221 1321219 20402219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T2202111111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T320211111111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 -T120211111111112870255 140245112 13312 03 0 0 0 399 10 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2202111111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112870120130312WTTTTTTBY212222122 73981 0 0 -T120211111111112912255 140356112 33112 03 0 0 0 605 2 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202111111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112912120090501WTTTTT9TY222212222 63 51 0 0 -T320211111111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 -T120211111111112924255 140356112 13322 03 0 0 0 399127 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 -T2202111111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112924120080522WTTTTTZW@212222222 93981 0 0 -T120211111111112989255 140245112 13312 03 0 0 0 399 33 208 1 8 0 1 0 0 0 0 0222222 0 0222 12 -T2202111111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202111111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211111111112989120160802WTTTTTTZ#212222122 63981 0 0 -T120211211111111119255 140245112 23322 03 0 0 0 502 11 0 0 0 0 0 0 0 0 4 0222222 0 0222 12 -T2202112111111111193219690425WTTTTTZBT2222212222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111119120100412WTTTTT9ZB212222222 63 11 0 0120140424WTTTTT@0T212222122 63981 0 0 -T120211211111111132255 140245112 61312 03 0 0 0 914 19 0 0 0 0 0 0 0 0 5 0222222 0 0222 12 -T2202112111111111321219820417WTTTTTTTB2222212222223 1321619 3822211910 0 0 0 0 0 0 0 0 0 0 00019 0 0 0 0 0 0 -T320211211111111132120150514WTTTTTZT#212222222 43981 0 0 -T320211211111111132120030502WTTTTTZP#222221122 43 81 0 0120050301WTTTTT@T9222221122 43 71 0 0 -T320211211111111132120070403WTTTTT@0#222221222 43 41 0 0120131112WTTTTT@@@212222222 43981 0 0 -T120211211111111233255 140356112 23122 03 0 0 0 502 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2202112111111112333219710814WTTTTTT@P2122222222222 2321219 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111112333219771105WTTTTTT#P2122222222222 1321119 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111233120040303WTTTTT99Y212222222 83 61 0 0120060327WTTTTT9W#212222222 43 51 0 0 -T120211211111111241255 140245112 23312 03 0 0 0 502 10 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202112111111112413219960827WTTTTT9TY2222212222222 2321212 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111112413219940527WTTTTTZ0@2122221222222 1321612 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111241120100402WTTTTT9YP212222222 83 31 0 0120120502WTTTTT@@Z212222222 83 11 0 0 -T120211211111111305255 140356112 13112 03 0 0 0 399 14 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202112111111113053219780125WTTTTTTTP2122222222223 1321219 5552199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111305120040508WTTTTTT9P212222222 83 71 0 0 -T120211211111111312255 140245112 13322 03 0 0 0 399123 0 0 32 0 0 0 0 0 0 0222222 0 0222 22 -T2202112111111113123219740312WTTTTT@T02122222222222 1321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111113123219720312WTTTTT9ZZ1222211222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111312120090322WTTTTTT@9212222222 83981 0 0 -T120211211111111382255 140245112 33312 03 0 0 0 605 35 0 0 0 0 0 0 0 0 5 0222222 0 0222 22 -T2202112111111113823219620513WTTTTT@901222222222222 2321619 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111113823219630113WTTTTTTY@2222211222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111382120080325WTTTTT9TB222221222 83 11 0 0 -T320211211111111382120060102WTTTTT@TB212222222 83 31 0 0120071107WTTTTTT#Y212222222 73 21 0 0 -T120211211111111415255 140356112 13112 03 0 0 0 399 43 0 0 2 0 0 0 0 0 9 0222222 0 0222 22 -T2202112111111114153219660301WTTTTT9@P2222212222222 1321519 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111114153219670321WTTTTT@9@2122221222222 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111415319980423WTTTTT@ZB212222222 43111 0 0319990307WTTTTTT90212222222 43 91 0 0 -T320211211111111415320040427WTTTTT9@B212222122 43 51 0 0120150414WTTTTT@@@122222122 83981 0 0 -T120211211111111446255 140245112 21312 03 0 0 0 210 23 0 0 0 0 0 0 0 0 6 0222222 0 0222 12 -T2202112111111114461219791105WTTTTTZ0T2122222222221 1321219 26342219 0 0 0 0 0 0 0 0 0 0 0 00025 0 0 0 0 0 0 -T320211211111111446120050302WTTTTT@TW222221222 43 71 0 0 -T120211211111111652255 140356112 52312 03 0 0 0 811 55 0 0 0 0 1 0 1 0 15 0222222 0 0222 42 -T2202112111111116521219830826WTTTTT9W02122221222221 2321219 060111927 0 0 0 0 0 0 0 0 0 0 000 6 0 0 0 0 0 0 -T2202112111111116521119880125WTTTTTZT@2122222222221 1211212 174312 1 0 0 0 0 0 0 0 0 0 0 0 000 3 0 0 0 0 0 0 -T320211211111111652120130426WTTTTTTWT212222122 43981 0 0 -T320211211111111652120070124WTTTTTZTW212222122 43981 0 0120110508WTTTTT9TY212222122 43981 0 0 -T120211211111111663255 140245112 21312 03 0 0 0 502 5 0 0 0 0 0 0 0 0 1 0222222 0 0222 12 -T2202112111111116631219910303WTTTTT9BB2222212222222 1321219 7532219 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111663120120514WTTTTT9WP212222122 43 11 0 0 -T120211211111111668255 140356112 31112 03 0 0 0 605 8 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111116681219900413WTTTTT@@Y2122221222221 1321212 1644211918 0 0 0 0 0 0 0 0 0 0 000 2 0 0 0 0 0 0 -T320211211111111668120130303WTTTTT@@P212222122 43981 0 0120160303WTTTTTT@W212222122 43981 0 0 -T120211211111111694255 140356112 13322 03 0 0 0 394144 0 0 0 0 8 0 0 0 22 0222222 5 0222 22 -T2202112111111116943119620508WTTTTT9ZP2122221222222 7321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111116943219590527WTTTTTZB02122222222222 232 919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111694120010527WTTTTTZYT212222122 63 51 0 0 -T120211211111111709255 140245112 13312 03 0 0 0 399 57 0 0 15 0 1 0 0 0 1 0222222 0 0222 22 -T2202112111111117093219660114WTTTTTZ9P2122222222222 1221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111117093219570524WTTTTT@@W2222221222222 2221219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111709120110101WTTTTTZ0W212222122 83981 0 0 -T120211211111111716255 140317112 23322 03 0 0 0 502 57 0 0 41 0 0 0 0 0 0 0222222 0 0222 22 -T2202112111111117163219620321WTTTTTT992222212222222 1321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111117163219550512WTTTTT9P@2222211222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111117163219930102WTTTTT9902222222222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111117162219890112WTTTTT@W@2222212222221 4321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111716120140401WTTTTTTBT212222222 63981 0 0 -T320211211111111716120110312WTTTTTTW9212222222 63981 0 0419970108WTTTTTTTW222221222 43111 0 0 -T120211211111111742255 140245112 31312 03 0 0 01326 96 0 0 0 0 0 0 0 0 11 0222222 0 0222 12 -T2202112111111117421219910403WTTTTT@002122222222221 1311219 60 02119 0 0 026 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111742120110502WTTTTT90#112222122 43981 0 0120181114WTTTTTTZ0112222222 43981 0 0 -T120211211111111794255 140245112 52312 03 0 0 0 811 18 0 0 0 0 0 0 0 0 0 0122222 0 0222 12 -T2202112111111117941219800125WTTTTTZB92122222222221 1121219 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111117941219760325WTTTTTZ#Y2222211222221 212 919 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111794120170527WTTTTT9##212222122 43981 0 0 -T320211211111111794120090514WTTTTT@@@212222222 43 21 0 0120170527WTTTTT@BT212222122 43981 0 0 -T120211211111111830255 140356112 31112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 1 0212222 0 0222 12 -T2202112111111118301219790105WTTTTT9BW2122222222221 1321211 85222 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111830120050812WTTTTT@@@212222122 43 81 0 0120090312WTTTTT9TY212222222 43 41 0 0 -T120211211111111850255 140356112 42112 03 0 0 0 850 38 0 0 0 0 6 0 1 0 18 0222222 0 0222 42 -T2202112111111118501219870513WTTTTTZPY2122222222223 1321212 0601219 0 0 0 0 0 5 0 0 0 0 0 00015 250 0 0 0 0 600 -T2202112111111118501219880501WTTTTTZWB2122221222222 2321219 0601119 0 0 020 0 0 0 0 0 0 5 000 3 0 0 0 0 0 0 -T320211211111111850120120308WTTTTTT0T212222122 43981 0 0120141121WTTTTT@T@212222122 43981 0 0 -T120211211111111953255 140356112 21312 03 0 0 0 264105 0 0 0 0 2 0 1 0 20 0222222 0 0222 42 -T2202112111111119531219870314WTTTTT@Z@2122222222221 1221219 4561211 0 0 0 0 0 0 0 0 0 0 0 000 4 250 0 0 0 0 238 -T2202112111111119535219830125WTTTTT@@@1222221222221 2229999 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111111953120070102WTTTTTZZY212222122 43981 0 0 -T120211211111112010255 140356112 13322 03 0 0 0 399155 0 0 2 0 0 0 0 0 6 0222222 0 0222 22 -T2202112111111120103219560114WTTTTT9ZY2222222222222 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111120103219530113WTTTTT@B@2122221222222 2321119 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112010120060102WTTTTT@T#212222222 63 11 0 0 -T120211211111112058255 140245112 13322 03 0 0 0 399 56 0 0 0 0 0 0 0 0 8 0222222 0 0222 22 -T2202112111111120583119640513WTTTTT@TP2222211222221 1321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111120583119650314WTTTTTT0Z2222211222221 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112058120131114WTTTTT@TT212222122 83981 0 0 -T120211211111112111255 140356112 21312 03 0 0 0 502 22 0 0 0 0 0 0 0 56 9 0122222 0 0222 42 -T2202112111111121111119900503WTTTTTTZ@2122222222221 1221219 06012 2 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112111120140102WTTTTT@@@212222222 43981 0 0 -T120211211111112120255 140245112 13322 03 0 0 0 399 17 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111121203219590525WTTTTT@YW2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111121203219580312WTTTTTZB@2222211222222 2321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112120120090105WTTTTTTPP212222122 83 31 0 0 -T120211211111112181255 140356112 21312 03 0 0 01159 14 0 0 0 0 0 0 0 0 2 0222222 0 0222 42 -T2202112111111121811219880125WTTTTTT9W2122222222221 131 912 1591119 0 0 025 0 0 0 0 0 0 0 000 8 250 0 0 0 0 600 -T320211211111112181120180508WTTTTTTPZ212222222 43981 0 0 -T120211211111112235255 140245112 13322 03 0 0 0 399121 0 0 0 0 3 0 0 0 25 0222222 0 0222 22 -T2202112111111122353219660427WTTTTTZBY1222222222222 1321319 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111122353219670827WTTTTTZY9122222122222210329919 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112235120020122WTTTTTTB#212222222 83 51 0 0 -T120211211111112245255 140245112 51322 03 0 0 0 672 68 0 0 0 0 1 0 0 0 11 0222222 0 0222 12 -T2202112111111122451219840313WTTTTTTB92122222222221 1211211 60 02219 0 0 0 0 0 5 0 0 0 0 0 00022 529 0 0 0 0 0 -T320211211111112245120050425WTTTTT9B0212222222 43981 0 0120070312WTTTTTT9T212222122 43981 0 0 -T320211211111112245120100823WTTTTTTZY212222122 43 11 0 0120111123WTTTTTT09212222122 43981 0 0 -T120211211111112338255 140356112 13112 03 0 0 0 399 4 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111123383219830121WTTTTT@0@2122222222221 1321619 7532199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112338120080802WTTTTTZ0Z212222122 83 31 0 0 -T120211211111112413255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111124133219801122WTTTTT9092222212222222 1321219 2582199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112413120150514WTTTTTZPP212222122 83981 0 0 -T120211211111112436255 140356112 13112 03 0 0 0 399 30 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2202112111111124363219590325WTTTTTZW#2122222222225 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112436120150314WTTTTTZP9212222222 63981 0 0 -T120211211111112461255 140245112 13322 03 0 0 0 399 32 0 0 1 0 0 0 0 0 0 0222222 0 0222 22 -T2202112111111124613219801122WTTTTT9092222212222222 1321619 2581199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111124613219770123WTTTTTT@@2222211222222 2321212 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112461120171102WTTTTTZWT222221122 83981 0 0 -T120211211111112542255 140356112 13112 03 0 0 0 399 24 0 0 0 0 0 0 0 0 3 0222222 0 0222 22 -T2202112111111125423219830826WTTTTT9W02122221222221 2321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111125423219880125WTTTTTZT@2122222222221 1321219 17431199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112542120030402WTTTTTTYP212222122 83 81 0 0 -T120211211111112583255 140245112 21312 03 0 0 0 502 12 0 0 0 0 0 0 0 0 1 0222222 0 0222 22 -T2202112111111125831220020114WTTTTT@@@2222212222221 132 919 1591219 0 0 0 0 0 0 0 0 0 0 4 00025 0 0 0 0 0 0 -T320211211111112583120180421WTTTTT9WW222221122 43981 0 0 -T120211211111112627255 140245112 33322 03 0 0 0 605 68 0 0 60 0 0 0 1 0 9 0222222 0 0222 12 -T2202112111111126273119640513WTTTTT@TP2222211222222 1321319 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111126273119650314WTTTTTT0Z2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112627120110113WTTTTTTWW222221222 83981 0 0 -T320211211111112627120060323WTTTTT9PW222221122 83981 0 0120091112WTTTTT9WB222221122 83981 0 0 -T120211211111112658255 140245112 13322 03 0 0 0 399 35 0 0 1 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111126583219740112WTTTTTTZZ2122222222224 1321619 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112658120140412WTTTTTT9#212222222 83981 0 0 -T120211211111112679255 140356112 42112 03 0 0 0 708 5 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111126791219790412WTTTTTZP@2122221222221 1321219 21392219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 -T2202112111111126791219850527WTTTTTTW#2122222222221 2321019 60 02219 0 0 0 0 0 0 0 0 0 0 0 00023 0 0 0 0 0 0 -T320211211111112679120160102WTTTTT@YB212222222 43981 0 0120170526WTTTTTZPW212222122 43981 0 0 -T120211211111112870255 140245112 13312 03 0 0 0 399 11 0 0 0 0 0 0 0 0 3 0222222 0 0222 12 -T2202112111111128703219840314WTTTTTT#Z2222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112870120130312WTTTTTTBY212222122 73981 0 0 -T120211211111112912255 140356112 33112 03 0 0 0 605 3 0 0 0 0 0 0 0 0 0 0222222 0 0222 12 -T2202112111111129123219540107WTTTTTZ0B2122222222222 1321019 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111129123219510827WTTTTTZ@#2122221222222 2321219 0602299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112912120090501WTTTTT9TY222212222 63 51 0 0 -T320211211111112912120040802WTTTTTTPB212222222 63 91 0 0120070817WTTTTTZPT122222222 63 61 0 0 -T120211211111112924255 140356112 13322 03 0 0 0 399128 0 0 15 0 1 0 0 0 8 0222222 0 0222 22 -T2202112111111129243219620101WTTTTT9W@2122221222222 9321219 0601199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111129243219650512WTTTTTTWY2122222222222 2321219 0601299 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112924120080522WTTTTTZW@212222222 93981 0 0 -T120211211111112989255 140245112 13312 03 0 0 0 399 34 0 0 8 0 1 0 0 0 0 0222222 0 0222 12 -T2202112111111129893219660525WTTTTT@#92222212222222 1321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T2202112111111129893219610302WTTTTTT0W2222211222222 2321219 0602199 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 0 0 0 0 -T320211211111112989120160802WTTTTTTZ#212222122 63981 0 0 -TRAILER0000471 +TRAILER0000003 diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index e12445fc2..d934b8f23 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -1004,31 +1004,31 @@ def test_parse_tribal_section_1_file(tribal_section_1_file, dfs): parse.parse_datafile(tribal_section_1_file) dfs.status = dfs.get_status() - assert dfs.status == DataFileSummary.Status.ACCEPTED_WITH_ERRORS + assert dfs.status == DataFileSummary.Status.ACCEPTED dfs.case_aggregates = util.case_aggregates_by_month( dfs.datafile, dfs.status) assert dfs.case_aggregates == {'rejected': 0, - 'months': [{'month': 'Oct', 'accepted_without_errors': 35, - 'accepted_with_errors': 5}, - {'month': 'Nov', 'accepted_without_errors': 36, - 'accepted_with_errors': 5}, - {'month': 'Dec', 'accepted_without_errors': 35, - 'accepted_with_errors': 5}]} + 'months': [{'month': 'Oct', 'accepted_without_errors': 1, + 'accepted_with_errors': 0}, + {'month': 'Nov', 'accepted_without_errors': 0, + 'accepted_with_errors': 0}, + {'month': 'Dec', 'accepted_without_errors': 0, + 'accepted_with_errors': 0}]} - assert Tribal_TANF_T1.objects.all().count() == 121 - assert Tribal_TANF_T2.objects.all().count() == 199 - assert Tribal_TANF_T3.objects.all().count() == 213 + assert Tribal_TANF_T1.objects.all().count() == 1 + assert Tribal_TANF_T2.objects.all().count() == 1 + assert Tribal_TANF_T3.objects.all().count() == 2 t1_objs = Tribal_TANF_T1.objects.all().order_by("CASH_AMOUNT") t2_objs = Tribal_TANF_T2.objects.all().order_by("MONTHS_FED_TIME_LIMIT") t3_objs = Tribal_TANF_T3.objects.all().order_by("EDUCATION_LEVEL") t1 = t1_objs.first() - t2 = t2_objs.last() + t2 = t2_objs.first() t3 = t3_objs.last() - assert t1.CASH_AMOUNT == 26 - assert t2.MONTHS_FED_TIME_LIMIT == ' 8' + assert t1.CASH_AMOUNT == 502 + assert t2.MONTHS_FED_TIME_LIMIT == ' 0' assert t3.EDUCATION_LEVEL == '98' @pytest.fixture From 7ae9054e4cc6b4b82c98383282b3041b9c21c324 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 27 Nov 2023 12:18:09 -0700 Subject: [PATCH 66/88] - Fix lint errors --- tdrs-backend/tdpservice/parsers/test/test_parse.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_parse.py b/tdrs-backend/tdpservice/parsers/test/test_parse.py index d934b8f23..091e4c939 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_parse.py +++ b/tdrs-backend/tdpservice/parsers/test/test_parse.py @@ -1008,12 +1008,10 @@ def test_parse_tribal_section_1_file(tribal_section_1_file, dfs): dfs.case_aggregates = util.case_aggregates_by_month( dfs.datafile, dfs.status) assert dfs.case_aggregates == {'rejected': 0, - 'months': [{'month': 'Oct', 'accepted_without_errors': 1, - 'accepted_with_errors': 0}, - {'month': 'Nov', 'accepted_without_errors': 0, - 'accepted_with_errors': 0}, - {'month': 'Dec', 'accepted_without_errors': 0, - 'accepted_with_errors': 0}]} + 'months': [{'month': 'Oct', 'accepted_without_errors': 1, 'accepted_with_errors': 0}, + {'month': 'Nov', 'accepted_without_errors': 0, 'accepted_with_errors': 0}, + {'month': 'Dec', 'accepted_without_errors': 0, 'accepted_with_errors': 0} + ]} assert Tribal_TANF_T1.objects.all().count() == 1 assert Tribal_TANF_T2.objects.all().count() == 1 From ad17b566dd578c164d401d7adb9512c12cef3179 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Thu, 30 Nov 2023 01:06:32 -0500 Subject: [PATCH 67/88] friendly_name corrections --- .../tdpservice/parsers/schema_defs/ssp/m1.py | 14 ++++----- .../tdpservice/parsers/schema_defs/ssp/m2.py | 25 ++++++++------- .../tdpservice/parsers/schema_defs/ssp/m3.py | 22 ++++++------- .../tdpservice/parsers/schema_defs/ssp/m4.py | 2 +- .../tdpservice/parsers/schema_defs/ssp/m5.py | 8 ++--- .../tdpservice/parsers/schema_defs/tanf/t1.py | 6 ++-- .../tdpservice/parsers/schema_defs/tanf/t2.py | 31 ++++++++++--------- .../tdpservice/parsers/schema_defs/tanf/t3.py | 18 +++++------ .../tdpservice/parsers/schema_defs/tanf/t4.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t5.py | 14 ++++----- .../tdpservice/parsers/schema_defs/tanf/t6.py | 6 ++-- 11 files changed, 76 insertions(+), 72 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 459d12167..877ac5518 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -75,7 +75,7 @@ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, friendly_name="record type", required=True, validators=[]), Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="report month year", required=True, validators=[ + friendly_name="reporting month and year", required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), @@ -100,7 +100,7 @@ validators.oneOf([1, 2]), ]), Field(item="8", name='NBR_FAMILY_MEMBERS', type='number', startIndex=30, endIndex=32, - friendly_name="number of family numbers", required=True, validators=[ + friendly_name="number of family members", required=True, validators=[ validators.isInLimits(1, 99), ]), Field(item="9", name='FAMILY_TYPE', type='number', startIndex=32, endIndex=33, @@ -124,7 +124,7 @@ validators.isInLimits(0, 2), ]), Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=37, endIndex=41, - friendly_name="amount of food stamp assistance", required=True, validators=[ + friendly_name="amount of food stamp assistance/stamps", required=True, validators=[ validators.isLargerThanOrEqualTo(0), ]), Field(item="15", name='RECEIVES_SUB_CC', type='number', startIndex=41, endIndex=42, @@ -176,7 +176,7 @@ validators.isLargerThanOrEqualTo(0), ]), Field(item="22B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=81, endIndex=84, - friendly_name="transition number of months", required=False, validators=[ + friendly_name="transition services number of months", required=False, validators=[ validators.isLargerThanOrEqualTo(0), ]), Field(item="23A", name='OTHER_AMOUNT', type='number', startIndex=84, endIndex=88, @@ -200,11 +200,11 @@ validators.isInLimits(0, 9), ]), Field(item="24AIV", name='SANC_TEEN_PARENT', type='number', startIndex=97, endIndex=98, - friendly_name="santion for teen parent", required=True, validators=[ + friendly_name="sanction for teen parent", required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="24AV", name='NON_COOPERATION_CSE', type='number', startIndex=98, endIndex=99, - friendly_name="non coopeartion case", required=True, validators=[ + friendly_name="non-cooperation with child support", required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="24AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=99, endIndex=100, @@ -232,7 +232,7 @@ validators.oneOf([1, 2]), ]), Field(item="24CIV", name='OTHER_NON_SANCTION', type='number', startIndex=111, endIndex=112, - friendly_name="other non sanction", required=True, validators=[ + friendly_name="other, non sanction", required=True, validators=[ validators.oneOf([1, 2]), ]), Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', type='number', startIndex=112, endIndex=113, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index ebf175fee..25e377e84 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -96,7 +96,7 @@ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, friendly_name="record type", required=True, validators=[]), Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="report month year", required=True, validators=[ + friendly_name="reporting month and year", required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), @@ -148,7 +148,8 @@ validators.isLargerThanOrEqualTo(0) ]), Field(item="32A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, - friendly_name="federal qasdi program", required=True, validators=[ + friendly_name="federal old-age survivors and disability insurance program", required=True, + validators=[ validators.oneOf([1, 2]) ]), Field(item="32B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, @@ -156,15 +157,17 @@ validators.oneOf([1, 2]) ]), Field(item="32C", name='DISABLED_TITLE_XIVAPDT', type='number', startIndex=47, endIndex=48, - friendly_name="disabled title xivapdt", required=True, validators=[ + friendly_name="receives aid to the permanently and totally disabled" + + " under title xiv-apdt of the social security act", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="32D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, - friendly_name="receives aid to the aid aged blind", required=False, validators=[ + friendly_name="receives from the aid to the aged, blind, and disabled program", + required=False, validators=[ validators.isLargerThanOrEqualTo(0) ]), Field(item="32E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, - friendly_name="receive ssi", required=True, validators=[ + friendly_name="receives social security income", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="33", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, @@ -195,7 +198,7 @@ validators.oneOf([0, 1, 2, 3, 9]) ]), Field(item="39", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - friendly_name="cooperation child support", required=False, validators=[ + friendly_name="cooperation with child support", required=False, validators=[ validators.oneOf([0, 1, 2, 9]) ]), Field(item="40", name='EMPLOYMENT_STATUS', type='number', startIndex=59, endIndex=60, @@ -211,7 +214,7 @@ ) ]), Field(item="42", name='WORK_PART_STATUS', type='number', startIndex=62, endIndex=64, - friendly_name="work part-time status", required=False, validators=[ + friendly_name="work participation status", required=False, validators=[ validators.oneOf([1, 2, 5, 7, 9, 15, 16, 17, 18, 19, 99]) ]), Field(item="43", name='UNSUB_EMPLOYMENT', type='number', startIndex=64, endIndex=66, @@ -231,11 +234,11 @@ validators.isInLimits(0, 99) ]), Field(item="46B", name='WORK_EXPERIENCE_EA', type='number', startIndex=72, endIndex=74, - friendly_name="work experience - excused absense", required=False, validators=[ + friendly_name="work experience - excused absence", required=False, validators=[ validators.isInLimits(0, 99) ]), Field(item="46C", name='WORK_EXPERIENCE_HOL', type='number', startIndex=74, endIndex=76, - friendly_name="work experience holiday", required=False, validators=[ + friendly_name="work experience hours - holiday", required=False, validators=[ validators.isInLimits(0, 99) ]), Field(item="47", name='OJT', type='number', startIndex=76, endIndex=78, @@ -267,7 +270,7 @@ validators.isInLimits(0, 99) ]), Field(item="50A", name='VOCATIONAL_ED_TRAINING_HOP', type='number', startIndex=90, endIndex=92, - friendly_name="vocational education training - hours of operation", required=False, validators=[ + friendly_name="vocational education training - hours of participation", required=False, validators=[ validators.isInLimits(0, 99) ]), Field(item="50B", name='VOCATIONAL_ED_TRAINING_EA', type='number', startIndex=92, endIndex=94, @@ -279,7 +282,7 @@ validators.isInLimits(0, 99) ]), Field(item="51A", name='JOB_SKILLS_TRAINING_HOP', type='number', startIndex=96, endIndex=98, - friendly_name="job skills training - hours of operation", required=False, validators=[ + friendly_name="job skills training - hours of participation", required=False, validators=[ validators.isInLimits(0, 99) ]), Field(item="51B", name='JOB_SKILLS_TRAINING_EA', type='number', startIndex=98, endIndex=100, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index 6ae8f2b52..fa41e5de8 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -67,7 +67,7 @@ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, friendly_name="record type", required=True, validators=[]), Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="report month year", required=True, validators=[ + friendly_name="reporting month and year", required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), @@ -118,19 +118,19 @@ validators.isInLimits(0, 9) ]), Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=44, endIndex=45, - friendly_name="receive non ssi benefits", required=True, validators=[ + friendly_name="receive non-ssi benefits", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, - friendly_name="receive ssi", required=True, validators=[ + friendly_name="receives ssi", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=46, endIndex=48, - friendly_name="relationship - head of household", required=False, validators=[ + friendly_name="relationship to head of household", required=False, validators=[ validators.isInStringRange(0, 10) ]), Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, - friendly_name="parent with minor child", required=False, validators=[ + friendly_name="parent of minor child", required=False, validators=[ validators.oneOf([0, 2, 3]) ]), Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=49, endIndex=51, @@ -145,7 +145,7 @@ validators.oneOf([0, 1, 2, 3, 9]) ]), Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=52, endIndex=56, - friendly_name="unearned SSI", required=True, validators=[ + friendly_name="unearned ssi benefit", required=True, validators=[ validators.isInLimits(0, 9999) ]), Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=56, endIndex=60, @@ -215,7 +215,7 @@ Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, friendly_name="record type", required=True, validators=[]), Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="report month year", required=True, validators=[ + friendly_name="reporting month and year", required=True, validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), ]), @@ -266,7 +266,7 @@ validators.isInLimits(0, 9) ]), Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=85, endIndex=86, - friendly_name="receive non ssi benefit", required=True, validators=[ + friendly_name="receives non-ssi benefit", required=True, validators=[ validators.oneOf([1, 2]) ]), Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, @@ -274,11 +274,11 @@ validators.oneOf([1, 2]) ]), Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=87, endIndex=89, - friendly_name="relationship head of household", required=False, validators=[ + friendly_name="relationship to head of household", required=False, validators=[ validators.isInLimits(0, 10) ]), Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, - friendly_name="parent minor child", required=False, validators=[ + friendly_name="parent of minor child", required=False, validators=[ validators.oneOf([0, 2, 3]) ]), Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=90, endIndex=92, @@ -293,7 +293,7 @@ validators.oneOf([0, 1, 2, 3, 9]) ]), Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=93, endIndex=97, - friendly_name="unearned ssi", + friendly_name="unearned ssi benefit", required=True, validators=[ validators.isInLimits(0, 9999) ]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py index 095a71a94..00057d1b1 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py @@ -29,7 +29,7 @@ Field( item="3", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py index 8b19cfc36..4449c142f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py @@ -114,7 +114,7 @@ Field( item="3", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, @@ -161,7 +161,7 @@ transform_func=ssp_ssn_decryption_func, item="15", name="SSN", - friendly_name="social security number", + friendly_name="social security number - ssn", type="string", startIndex=28, endIndex=37, @@ -272,7 +272,7 @@ Field( item="18D", name="REC_AID_AGED_BLIND", - friendly_name="receives aid for aged blind", + friendly_name="receives from the aid to the aged, blind, and disabled program", type="number", startIndex=47, endIndex=48, @@ -282,7 +282,7 @@ Field( item="18E", name="REC_SSI", - friendly_name="receives social security insurance", + friendly_name="receives social security income", type="number", startIndex=48, endIndex=49, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index bf9131e06..851ef0792 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -527,7 +527,7 @@ Field( item="26AV", name="NON_COOPERATION_CSE", - friendly_name="non-cooperation child support enforcement", + friendly_name="non-cooperation with child support", type="number", startIndex=99, endIndex=100, @@ -551,7 +551,7 @@ Field( item="26AVII", name="OTHER_SANCTION", - friendly_name="other sanction", + friendly_name="other, sanction", type="number", startIndex=101, endIndex=102, @@ -611,7 +611,7 @@ Field( item="26CIV", name="OTHER_NON_SANCTION", - friendly_name="other non-sanction", + friendly_name="other, non-sanction", type="number", startIndex=112, endIndex=113, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index d78052420..0e827e953 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -137,7 +137,7 @@ Field( item="4", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, @@ -194,7 +194,7 @@ transform_func=tanf_ssn_decryption_func, item="33", name="SSN", - friendly_name="social security number (ssn)", + friendly_name="social security number - ssn", type="string", startIndex=29, endIndex=38, @@ -297,7 +297,8 @@ Field( item="36C", name="DISABLED_TITLE_XIVAPDT", - friendly_name="disabled title xivapdt", + friendly_name="Receives Aid to the Permanently and Totally Disabled" + + " Under Title XIV-APDT of the Social Security Act", type="string", startIndex=47, endIndex=48, @@ -311,7 +312,7 @@ Field( item="36D", name="AID_AGED_BLIND", - friendly_name="aid aged blind", + friendly_name="receives from the aid to the aged, blind, and disabled program", type="number", startIndex=48, endIndex=49, @@ -323,7 +324,7 @@ Field( item="36E", name="RECEIVE_SSI", - friendly_name="receive social security income", + friendly_name="receives social security income", type="number", startIndex=49, endIndex=50, @@ -408,7 +409,7 @@ Field( item="43", name="COOPERATION_CHILD_SUPPORT", - friendly_name="cooperation child support", + friendly_name="cooperation with child support", type="number", startIndex=58, endIndex=59, @@ -420,7 +421,7 @@ Field( item="44", name="MONTHS_FED_TIME_LIMIT", - friendly_name="months of federal time limit", + friendly_name="countable months toward federal time limit", type="string", startIndex=59, endIndex=62, @@ -569,7 +570,7 @@ Field( item="53C", name="WORK_EXPERIENCE_HOL", - friendly_name="work experience hours of leave", + friendly_name="work experience - holiday", type="string", startIndex=80, endIndex=82, @@ -617,7 +618,7 @@ Field( item="55C", name="JOB_SEARCH_HOL", - friendly_name="job search hours of leave", + friendly_name="job search - holidays", type="string", startIndex=88, endIndex=90, @@ -761,7 +762,7 @@ Field( item="59C", name="ED_NO_HIGH_SCHOOL_DIPL_HOL", - friendly_name="education no high school diploma hours of leave", + friendly_name="education no high school diploma - holiday", type="string", startIndex=112, endIndex=114, @@ -773,7 +774,7 @@ Field( item="60A", name="SCHOOL_ATTENDENCE_HOP", - friendly_name="school attendence hours of participation", + friendly_name="school attendance hours of participation", type="string", startIndex=114, endIndex=116, @@ -785,7 +786,7 @@ Field( item="60B", name="SCHOOL_ATTENDENCE_EA", - friendly_name="school attendence excused absence", + friendly_name="school attendance excused absence", type="string", startIndex=116, endIndex=118, @@ -797,7 +798,7 @@ Field( item="60C", name="SCHOOL_ATTENDENCE_HOL", - friendly_name="school attendance hours of leave", + friendly_name="school attendance - holiday", type="string", startIndex=118, endIndex=120, @@ -833,7 +834,7 @@ Field( item="61C", name="PROVIDE_CC_HOL", - friendly_name="provide child care hours of leave", + friendly_name="provide child care - holiday", type="string", startIndex=124, endIndex=126, @@ -917,7 +918,7 @@ Field( item="66C", name="UNEARNED_SSI", - friendly_name="unearned supplemental security income", + friendly_name="unearned ssi benefit", type="string", startIndex=144, endIndex=148, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index 5c920e76e..6b18652b9 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -146,7 +146,7 @@ transform_func=tanf_ssn_decryption_func, item="69", name="SSN", - friendly_name="social security number", + friendly_name="social security number - ssn", type="string", startIndex=28, endIndex=37, @@ -227,7 +227,7 @@ Field( item="72A", name="RECEIVE_NONSSA_BENEFITS", - friendly_name="receive non-ssa benefits", + friendly_name="receives non-social security act benefits", type="number", startIndex=44, endIndex=45, @@ -237,7 +237,7 @@ Field( item="72B", name="RECEIVE_SSI", - friendly_name="receive social security income", + friendly_name="receives social security income", type="number", startIndex=45, endIndex=46, @@ -292,7 +292,7 @@ Field( item="77A", name="UNEARNED_SSI", - friendly_name="unearned social security income", + friendly_name="unearned ssi benefit", type="string", startIndex=52, endIndex=56, @@ -450,7 +450,7 @@ transform_func=tanf_ssn_decryption_func, item="69", name="SSN", - friendly_name="social security number", + friendly_name="social security number - ssn", type="string", startIndex=69, endIndex=78, @@ -461,7 +461,7 @@ Field( item="70A", name="RACE_HISPANIC", - friendly_name="rce hispanic", + friendly_name="race hispanic", type="number", startIndex=78, endIndex=79, @@ -531,7 +531,7 @@ Field( item="72A", name="RECEIVE_NONSSA_BENEFITS", - friendly_name="receive non-ssa benefits", + friendly_name="receives non-ssa benefits", type="number", startIndex=85, endIndex=86, @@ -541,7 +541,7 @@ Field( item="72B", name="RECEIVE_SSI", - friendly_name="receive social security income", + friendly_name="receives social security income", type="number", startIndex=86, endIndex=87, @@ -595,7 +595,7 @@ Field( item="77A", name="UNEARNED_SSI", - friendly_name="unearned social security income", + friendly_name="unearned ssi benefit", type="string", startIndex=93, endIndex=97, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py index 9ec6191ca..71427fa34 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py @@ -30,7 +30,7 @@ Field( item="4", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 34d1581a8..8049684a9 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -115,7 +115,7 @@ Field( item="4", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, @@ -162,7 +162,7 @@ transform_func=tanf_ssn_decryption_func, item="16", name="SSN", - friendly_name="social security number", + friendly_name="social security number - ssn", type="string", startIndex=28, endIndex=37, @@ -273,7 +273,7 @@ Field( item="19D", name="REC_AID_AGED_BLIND", - friendly_name="receives aid aged blind", + friendly_name="receives from the aid to the aged, blind, and disabled program", type="number", startIndex=47, endIndex=48, @@ -313,7 +313,7 @@ Field( item="22", name="PARENT_MINOR_CHILD", - friendly_name="parent minor child", + friendly_name="parent of minor child", type="number", startIndex=52, endIndex=53, @@ -362,7 +362,7 @@ Field( item="26", name="COUNTABLE_MONTH_FED_TIME", - friendly_name="countable month federal time", + friendly_name="countable months toward federal time", type="string", startIndex=57, endIndex=60, @@ -372,7 +372,7 @@ Field( item="27", name="COUNTABLE_MONTHS_STATE_TRIBE", - friendly_name="countable months state tribe", + friendly_name="countable months remaining under state tribe", type="string", startIndex=60, endIndex=62, @@ -392,7 +392,7 @@ Field( item="29", name="AMOUNT_EARNED_INCOME", - friendly_name="amount earned income", + friendly_name="amount earnedof income", type="string", startIndex=63, endIndex=67, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index ce19b8b77..018241fe4 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -51,7 +51,7 @@ calendar_quarter_to_rpt_month_year(0), item="4", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=7, @@ -253,7 +253,7 @@ calendar_quarter_to_rpt_month_year(1), item="4", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=7, @@ -452,7 +452,7 @@ calendar_quarter_to_rpt_month_year(2), item="4", name="RPT_MONTH_YEAR", - friendly_name="report month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=7, From fdd3b725a868382d81770943cc323db621d6c9cf Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 4 Dec 2023 08:59:23 -0700 Subject: [PATCH 68/88] - Adding friendly names to tribal --- .../parsers/schema_defs/tribal_tanf/t1.py | 48 +++++++++++- .../parsers/schema_defs/tribal_tanf/t2.py | 73 +++++++++++++++++-- .../parsers/schema_defs/tribal_tanf/t3.py | 46 +++++++++++- 3 files changed, 159 insertions(+), 8 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py index f6bca0786..e09e61f19 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py @@ -122,6 +122,7 @@ Field( item="0", name="RecordType", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -131,6 +132,7 @@ Field( item="4", name="RPT_MONTH_YEAR", + friendly_name="reporting month year", type="number", startIndex=2, endIndex=8, @@ -143,6 +145,7 @@ Field( item="6", name="CASE_NUMBER", + friendly_name="case number", type="string", startIndex=8, endIndex=19, @@ -152,6 +155,7 @@ Field( item="2", name="COUNTY_FIPS_CODE", + friendly_name="county fips code", type="string", startIndex=19, endIndex=22, @@ -163,6 +167,7 @@ Field( item="5", name="STRATUM", + friendly_name="stratum", type="string", startIndex=22, endIndex=24, @@ -174,6 +179,7 @@ Field( item="7", name="ZIP_CODE", + friendly_name="zip code", type="string", startIndex=24, endIndex=29, @@ -185,6 +191,7 @@ Field( item="8", name="FUNDING_STREAM", + friendly_name="funding stream", type="number", startIndex=29, endIndex=30, @@ -196,17 +203,19 @@ Field( item="9", name="DISPOSITION", + friendly_name="disposition", type="number", startIndex=30, endIndex=31, required=True, validators=[ - validators.oneOf([1]), + validators.matches(1), ], ), Field( item="10", name="NEW_APPLICANT", + friendly_name="new applicant", type="number", startIndex=31, endIndex=32, @@ -218,6 +227,7 @@ Field( item="11", name="NBR_FAMILY_MEMBERS", + friendly_name="number of family members", type="number", startIndex=32, endIndex=34, @@ -229,6 +239,7 @@ Field( item="12", name="FAMILY_TYPE", + friendly_name="family type", type="number", startIndex=34, endIndex=35, @@ -240,6 +251,7 @@ Field( item="13", name="RECEIVES_SUB_HOUSING", + friendly_name="receives subsidized housing", type="number", startIndex=35, endIndex=36, @@ -251,6 +263,7 @@ Field( item="14", name="RECEIVES_MED_ASSISTANCE", + friendly_name="receives medical assistance", type="number", startIndex=36, endIndex=37, @@ -262,6 +275,7 @@ Field( item="15", name="RECEIVES_FOOD_STAMPS", + friendly_name="receives food stamps", type="number", startIndex=37, endIndex=38, @@ -273,6 +287,7 @@ Field( item="16", name="AMT_FOOD_STAMP_ASSISTANCE", + friendly_name="amount of food stamp assistance", type="number", startIndex=38, endIndex=42, @@ -284,6 +299,7 @@ Field( item="17", name="RECEIVES_SUB_CC", + friendly_name="receives subsidized child care", type="number", startIndex=42, endIndex=43, @@ -295,6 +311,7 @@ Field( item="18", name="AMT_SUB_CC", + friendly_name="amount of subsidized child care", type="number", startIndex=43, endIndex=47, @@ -306,6 +323,7 @@ Field( item="19", name="CHILD_SUPPORT_AMT", + friendly_name="child support amount", type="number", startIndex=47, endIndex=51, @@ -317,6 +335,7 @@ Field( item="20", name="FAMILY_CASH_RESOURCES", + friendly_name="family cash resources", type="number", startIndex=51, endIndex=55, @@ -328,6 +347,7 @@ Field( item="21A", name="CASH_AMOUNT", + friendly_name="cash amount", type="number", startIndex=55, endIndex=59, @@ -339,6 +359,7 @@ Field( item="21B", name="NBR_MONTHS", + friendly_name="number of months", type="number", startIndex=59, endIndex=62, @@ -350,6 +371,7 @@ Field( item="22A", name="CC_AMOUNT", + friendly_name="child care amount", type="number", startIndex=62, endIndex=66, @@ -361,6 +383,7 @@ Field( item="22B", name="CHILDREN_COVERED", + friendly_name="children covered", type="number", startIndex=66, endIndex=68, @@ -372,6 +395,7 @@ Field( item="22C", name="CC_NBR_MONTHS", + friendly_name="child care number of months", type="number", startIndex=68, endIndex=71, @@ -383,6 +407,7 @@ Field( item="23A", name="TRANSP_AMOUNT", + friendly_name="transportation amount", type="number", startIndex=71, endIndex=75, @@ -394,6 +419,7 @@ Field( item="23B", name="TRANSP_NBR_MONTHS", + friendly_name="transportation number of months", type="number", startIndex=75, endIndex=78, @@ -405,6 +431,7 @@ Field( item="24A", name="TRANSITION_SERVICES_AMOUNT", + friendly_name="transition services amount", type="number", startIndex=78, endIndex=82, @@ -416,6 +443,7 @@ Field( item="24B", name="TRANSITION_NBR_MONTHS", + friendly_name="transition services number of months", type="number", startIndex=82, endIndex=85, @@ -427,6 +455,7 @@ Field( item="25A", name="OTHER_AMOUNT", + friendly_name="other amount", type="number", startIndex=85, endIndex=89, @@ -438,6 +467,7 @@ Field( item="25B", name="OTHER_NBR_MONTHS", + friendly_name="other number of months", type="number", startIndex=89, endIndex=92, @@ -449,6 +479,7 @@ Field( item="26AI", name="SANC_REDUCTION_AMT", + friendly_name="sanction reduction amount", type="number", startIndex=92, endIndex=96, @@ -460,6 +491,7 @@ Field( item="26AII", name="WORK_REQ_SANCTION", + friendly_name="work requirement sanction", type="number", startIndex=96, endIndex=97, @@ -471,6 +503,7 @@ Field( item="26AIII", name="FAMILY_SANC_ADULT", + friendly_name="family sanction adult", type="number", startIndex=97, endIndex=98, @@ -482,6 +515,7 @@ Field( item="26AIV", name="SANC_TEEN_PARENT", + friendly_name="sanctioned teen parent", type="number", startIndex=98, endIndex=99, @@ -493,6 +527,7 @@ Field( item="26AV", name="NON_COOPERATION_CSE", + friendly_name="non-cooperation with child support", type="number", startIndex=99, endIndex=100, @@ -504,6 +539,7 @@ Field( item="26AVI", name="FAILURE_TO_COMPLY", + friendly_name="failure to comply", type="number", startIndex=100, endIndex=101, @@ -515,6 +551,7 @@ Field( item="26AVII", name="OTHER_SANCTION", + friendly_name="other, sanction", type="number", startIndex=101, endIndex=102, @@ -526,6 +563,7 @@ Field( item="26B", name="RECOUPMENT_PRIOR_OVRPMT", + friendly_name="recoupment prior overpayment", type="number", startIndex=102, endIndex=106, @@ -537,6 +575,7 @@ Field( item="26CI", name="OTHER_TOTAL_REDUCTIONS", + friendly_name="other total reductions", type="number", startIndex=106, endIndex=110, @@ -548,6 +587,7 @@ Field( item="26CII", name="FAMILY_CAP", + friendly_name="family cap", type="number", startIndex=110, endIndex=111, @@ -559,6 +599,7 @@ Field( item="26CIII", name="REDUCTIONS_ON_RECEIPTS", + friendly_name="reductions on receipts", type="number", startIndex=111, endIndex=112, @@ -570,6 +611,7 @@ Field( item="26CIV", name="OTHER_NON_SANCTION", + friendly_name="other, non-sanction", type="number", startIndex=112, endIndex=113, @@ -581,6 +623,7 @@ Field( item="27", name="WAIVER_EVAL_CONTROL_GRPS", + friendly_name="waiver evaluation control groups", type="string", startIndex=113, endIndex=114, @@ -590,6 +633,7 @@ Field( item="28", name="FAMILY_EXEMPT_TIME_LIMITS", + friendly_name="family exempt time limits", type="number", startIndex=114, endIndex=116, @@ -599,6 +643,7 @@ Field( item="29", name="FAMILY_NEW_CHILD", + friendly_name="family new child", type="number", startIndex=116, endIndex=117, @@ -610,6 +655,7 @@ Field( item="-1", name="BLANK", + friendly_name="blank", type="string", startIndex=117, endIndex=123, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 5289deffc..8e3c3d4c2 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -116,6 +116,7 @@ Field( item="0", name="RecordType", + friendly_name="record tsype", type="string", startIndex=0, endIndex=2, @@ -125,6 +126,7 @@ Field( item="4", name="RPT_MONTH_YEAR", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, @@ -137,6 +139,7 @@ Field( item="6", name="CASE_NUMBER", + friendly_name="case number", type="string", startIndex=8, endIndex=19, @@ -146,6 +149,7 @@ Field( item="30", name="FAMILY_AFFILIATION", + friendly_name="family affiliation", type="number", startIndex=19, endIndex=20, @@ -155,6 +159,7 @@ Field( item="31", name="NONCUSTODIAL_PARENT", + friendly_name="noncustodial parent", type="number", startIndex=20, endIndex=21, @@ -164,18 +169,21 @@ Field( item="32", name="DATE_OF_BIRTH", + friendly_name="date of birth", type="number", startIndex=21, endIndex=29, required=True, validators=[ - validators.isLargerThan(0), + validators.dateYearIsLargerThan(1900), + validators.dateMonthIsValid(), ], ), TransformField( transform_func=tanf_ssn_decryption_func, item="33", name="SSN", + friendly_name="social security number - ssn", type="string", startIndex=29, endIndex=38, @@ -186,6 +194,7 @@ Field( item="34A", name="RACE_HISPANIC", + friendly_name="race hispanic", type="number", startIndex=38, endIndex=39, @@ -195,6 +204,7 @@ Field( item="34B", name="RACE_AMER_INDIAN", + friendly_name="race american-indian", type="number", startIndex=39, endIndex=40, @@ -204,6 +214,7 @@ Field( item="34C", name="RACE_ASIAN", + friendly_name="race asian", type="number", startIndex=40, endIndex=41, @@ -213,6 +224,7 @@ Field( item="34D", name="RACE_BLACK", + friendly_name="race black", type="number", startIndex=41, endIndex=42, @@ -222,6 +234,7 @@ Field( item="34E", name="RACE_HAWAIIAN", + friendly_name="race hawaiian", type="number", startIndex=42, endIndex=43, @@ -231,6 +244,7 @@ Field( item="34F", name="RACE_WHITE", + friendly_name="race white", type="number", startIndex=43, endIndex=44, @@ -240,15 +254,19 @@ Field( item="35", name="GENDER", + friendly_name="gender", type="number", startIndex=44, endIndex=45, required=True, - validators=[validators.isInLimits(0, 9)], + validators=[ + validators.isLargerThanOrEqualTo(0), + ], ), Field( item="36A", name="FED_OASDI_PROGRAM", + friendly_name="federal old age survivors and disability insurance program", type="number", startIndex=45, endIndex=46, @@ -258,6 +276,7 @@ Field( item="36B", name="FED_DISABILITY_STATUS", + friendly_name="federal disability status", type="number", startIndex=46, endIndex=47, @@ -267,24 +286,34 @@ Field( item="36C", name="DISABLED_TITLE_XIVAPDT", + friendly_name="Receives Aid to the Permanently and Totally Disabled" + + " Under Title XIV-APDT of the Social Security Act", type="string", startIndex=47, endIndex=48, required=True, - validators=[validators.oneOf(["1", "2"])], + validators=[ + validators.or_validators( + validators.oneOf(["1", "2"]), validators.isBlank() + ) + ], ), Field( item="36D", name="AID_AGED_BLIND", + friendly_name="receives from the aid to the aged, blind, and disabled program", type="number", startIndex=48, endIndex=49, required=False, - validators=[validators.isInLimits(0, 9)], + validators=[ + validators.isLargerThanOrEqualTo(0), + ], ), Field( item="36E", name="RECEIVE_SSI", + friendly_name="receives social security income", type="number", startIndex=49, endIndex=50, @@ -296,6 +325,7 @@ Field( item="37", name="MARITAL_STATUS", + friendly_name="marital status", type="number", startIndex=50, endIndex=51, @@ -307,6 +337,7 @@ Field( item="38", name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", type="string", startIndex=51, endIndex=53, @@ -317,7 +348,8 @@ ), Field( item="39", - name="PARENT_MINOR_CHILD", + name="PARENT_WITH_MINOR_CHILD", + friendly_name="parent with minor child", type="number", startIndex=53, endIndex=54, @@ -329,6 +361,7 @@ Field( item="40", name="NEEDS_PREGNANT_WOMAN", + friendly_name="needs of pregnant woman", type="number", startIndex=54, endIndex=55, @@ -340,6 +373,7 @@ Field( item="41", name="EDUCATION_LEVEL", + friendly_name="education level", type="string", startIndex=55, endIndex=57, @@ -354,6 +388,7 @@ Field( item="42", name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", type="number", startIndex=57, endIndex=58, @@ -363,6 +398,7 @@ Field( item="43", name="COOPERATION_CHILD_SUPPORT", + friendly_name="cooperation with child support", type="number", startIndex=58, endIndex=59, @@ -374,6 +410,7 @@ Field( item="44", name="MONTHS_FED_TIME_LIMIT", + friendly_name="countable months toward federal time limit", type="string", startIndex=59, endIndex=62, @@ -385,6 +422,7 @@ Field( item="45", name="MONTHS_STATE_TIME_LIMIT", + friendly_name="months of state time limit", type="string", startIndex=62, endIndex=64, @@ -396,6 +434,7 @@ Field( item="46", name="CURRENT_MONTH_STATE_EXEMPT", + friendly_name="current month state exempt", type="number", startIndex=64, endIndex=65, @@ -407,6 +446,7 @@ Field( item="47", name="EMPLOYMENT_STATUS", + friendly_name="employment status", type="number", startIndex=65, endIndex=66, @@ -418,6 +458,7 @@ Field( item="48", name="WORK_PART_STATUS", + friendly_name="work participation status", type="string", startIndex=66, endIndex=68, @@ -434,6 +475,7 @@ Field( item="49", name="UNSUB_EMPLOYMENT", + friendly_name="unsubsidized employment", type="string", startIndex=68, endIndex=70, @@ -445,6 +487,7 @@ Field( item="50", name="SUB_PRIVATE_EMPLOYMENT", + friendly_name="subsidized private employment", type="string", startIndex=70, endIndex=72, @@ -456,6 +499,7 @@ Field( item="51", name="SUB_PUBLIC_EMPLOYMENT", + friendly_name="subsidized public employment", type="string", startIndex=72, endIndex=74, @@ -467,6 +511,7 @@ Field( item="52", name="WORK_EXPERIENCE", + friendly_name="work experience", type="string", startIndex=74, endIndex=76, @@ -478,6 +523,7 @@ Field( item="53", name="OJT", + friendly_name="on the job training", type="string", startIndex=76, endIndex=78, @@ -489,6 +535,7 @@ Field( item="54", name="JOB_SEARCH", + friendly_name="job search", type="string", startIndex=78, endIndex=80, @@ -500,6 +547,7 @@ Field( item="55", name="COMM_SERVICES", + friendly_name="community service", type="string", startIndex=80, endIndex=82, @@ -511,6 +559,7 @@ Field( item="56", name="VOCATIONAL_ED_TRAINING", + friendly_name="vocational education", type="string", startIndex=82, endIndex=84, @@ -522,6 +571,7 @@ Field( item="57", name="JOB_SKILLS_TRAINING", + friendly_name="job skills training", type="string", startIndex=84, endIndex=86, @@ -533,6 +583,7 @@ Field( item="58", name="ED_NO_HIGH_SCHOOL_DIPLOMA", + friendly_name="education no high school diploma", type="string", startIndex=86, endIndex=88, @@ -544,6 +595,7 @@ Field( item="59", name="SCHOOL_ATTENDENCE", + friendly_name="school attendance", type="string", startIndex=88, endIndex=90, @@ -555,6 +607,7 @@ Field( item="60", name="PROVIDE_CC", + friendly_name="provide child care", type="string", startIndex=90, endIndex=92, @@ -566,6 +619,7 @@ Field( item="61", name="ADD_WORK_ACTIVITIES", + friendly_name="additional work activities", type="string", startIndex=92, endIndex=94, @@ -577,6 +631,7 @@ Field( item="62", name="OTHER_WORK_ACTIVITIES", + friendly_name="other work activities", type="string", startIndex=94, endIndex=96, @@ -588,6 +643,7 @@ Field( item="63", name="REQ_HRS_WAIVER_DEMO", + friendly_name="required hours under waiver demo", type="string", startIndex=96, endIndex=98, @@ -599,6 +655,7 @@ Field( item="64", name="EARNED_INCOME", + friendly_name="earned income", type="string", startIndex=98, endIndex=102, @@ -610,6 +667,7 @@ Field( item="65A", name="UNEARNED_INCOME_TAX_CREDIT", + friendly_name="unearned income tax credit", type="string", startIndex=102, endIndex=106, @@ -621,6 +679,7 @@ Field( item="65B", name="UNEARNED_SOCIAL_SECURITY", + friendly_name="unearned social security", type="string", startIndex=106, endIndex=110, @@ -632,6 +691,7 @@ Field( item="65C", name="UNEARNED_SSI", + friendly_name="unearned ssi benefit", type="string", startIndex=110, endIndex=114, @@ -643,6 +703,7 @@ Field( item="65D", name="UNEARNED_WORKERS_COMP", + friendly_name="unearned workers compensation", type="string", startIndex=114, endIndex=118, @@ -654,6 +715,7 @@ Field( item="65E", name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", type="string", startIndex=118, endIndex=122, @@ -665,6 +727,7 @@ Field( item="-1", name="BLANK", + friendly_name="blank", type="string", startIndex=122, endIndex=123, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index f49270c98..7aba4ba08 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -92,6 +92,7 @@ Field( item="0", name="RecordType", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -101,6 +102,7 @@ Field( item="4", name="RPT_MONTH_YEAR", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, @@ -110,6 +112,7 @@ Field( item="6", name="CASE_NUMBER", + friendly_name="case number", type="string", startIndex=8, endIndex=19, @@ -119,6 +122,7 @@ Field( item="67", name="FAMILY_AFFILIATION", + friendly_name="family affiliation", type="number", startIndex=19, endIndex=20, @@ -128,12 +132,13 @@ Field( item="68", name="DATE_OF_BIRTH", + friendly_name="date of birth", type="number", startIndex=20, endIndex=28, required=True, validators=[ - validators.dateYearIsLargerThan(1998), + validators.dateYearIsLargerThan(1950), validators.dateMonthIsValid(), ], ), @@ -141,6 +146,7 @@ transform_func=tanf_ssn_decryption_func, item="69", name="SSN", + friendly_name="social security number - ssn", type="string", startIndex=28, endIndex=37, @@ -151,6 +157,7 @@ Field( item="70A", name="RACE_HISPANIC", + friendly_name="race hispanic", type="number", startIndex=37, endIndex=38, @@ -160,6 +167,7 @@ Field( item="70B", name="RACE_AMER_INDIAN", + friendly_name="race american indian", type="number", startIndex=38, endIndex=39, @@ -169,6 +177,7 @@ Field( item="70C", name="RACE_ASIAN", + friendly_name="race asian", type="number", startIndex=39, endIndex=40, @@ -178,6 +187,7 @@ Field( item="70D", name="RACE_BLACK", + friendly_name="race black", type="number", startIndex=40, endIndex=41, @@ -187,6 +197,7 @@ Field( item="70E", name="RACE_HAWAIIAN", + friendly_name="race hawaiian", type="number", startIndex=41, endIndex=42, @@ -196,6 +207,7 @@ Field( item="70F", name="RACE_WHITE", + friendly_name="race white", type="number", startIndex=42, endIndex=43, @@ -205,6 +217,7 @@ Field( item="71", name="GENDER", + friendly_name="gender", type="number", startIndex=43, endIndex=44, @@ -214,6 +227,7 @@ Field( item="72A", name="RECEIVE_NONSSA_BENEFITS", + friendly_name="receives non-social security act benefits", type="number", startIndex=44, endIndex=45, @@ -223,6 +237,7 @@ Field( item="72B", name="RECEIVE_SSI", + friendly_name="receives social security income", type="number", startIndex=45, endIndex=46, @@ -232,6 +247,7 @@ Field( item="73", name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", type="string", startIndex=46, endIndex=48, @@ -241,6 +257,7 @@ Field( item="74", name="PARENT_MINOR_CHILD", + friendly_name="parent of minor child", type="number", startIndex=48, endIndex=49, @@ -250,6 +267,7 @@ Field( item="75", name="EDUCATION_LEVEL", + friendly_name="education level", type="string", startIndex=49, endIndex=51, @@ -264,6 +282,7 @@ Field( item="76", name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", type="number", startIndex=51, endIndex=52, @@ -273,6 +292,7 @@ Field( item="77A", name="UNEARNED_SSI", + friendly_name="unearned ssi benefit", type="string", startIndex=52, endIndex=56, @@ -282,6 +302,7 @@ Field( item="77B", name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", type="string", startIndex=56, endIndex=60, @@ -375,6 +396,7 @@ Field( item="0", name="RecordType", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -384,6 +406,7 @@ Field( item="4", name="RPT_MONTH_YEAR", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, @@ -393,6 +416,7 @@ Field( item="6", name="CASE_NUMBER", + friendly_name="case number", type="string", startIndex=8, endIndex=19, @@ -402,6 +426,7 @@ Field( item="67", name="FAMILY_AFFILIATION", + friendly_name="family affiliation", type="number", startIndex=60, endIndex=61, @@ -411,12 +436,13 @@ Field( item="68", name="DATE_OF_BIRTH", + friendly_name="date of birth", type="number", startIndex=61, endIndex=69, required=True, validators=[ - validators.dateYearIsLargerThan(1998), + validators.dateYearIsLargerThan(1950), validators.dateMonthIsValid(), ], ), @@ -424,6 +450,7 @@ transform_func=tanf_ssn_decryption_func, item="69", name="SSN", + friendly_name="social security number - ssn", type="string", startIndex=69, endIndex=78, @@ -434,6 +461,7 @@ Field( item="70A", name="RACE_HISPANIC", + friendly_name="race hispanic", type="number", startIndex=78, endIndex=79, @@ -443,6 +471,7 @@ Field( item="70B", name="RACE_AMER_INDIAN", + friendly_name="race american indian", type="number", startIndex=79, endIndex=80, @@ -452,6 +481,7 @@ Field( item="70C", name="RACE_ASIAN", + friendly_name="race asian", type="number", startIndex=80, endIndex=81, @@ -461,6 +491,7 @@ Field( item="70D", name="RACE_BLACK", + friendly_name="race black", type="number", startIndex=81, endIndex=82, @@ -470,6 +501,7 @@ Field( item="70E", name="RACE_HAWAIIAN", + friendly_name="race hawaiian", type="number", startIndex=82, endIndex=83, @@ -479,6 +511,7 @@ Field( item="70F", name="RACE_WHITE", + friendly_name="race white", type="number", startIndex=83, endIndex=84, @@ -488,6 +521,7 @@ Field( item="71", name="GENDER", + friendly_name="gender", type="number", startIndex=84, endIndex=85, @@ -497,6 +531,7 @@ Field( item="72A", name="RECEIVE_NONSSA_BENEFITS", + friendly_name="receives non-ssa benefits", type="number", startIndex=85, endIndex=86, @@ -506,6 +541,7 @@ Field( item="72B", name="RECEIVE_SSI", + friendly_name="receives social security income", type="number", startIndex=86, endIndex=87, @@ -515,6 +551,7 @@ Field( item="73", name="RELATIONSHIP_HOH", + friendly_name="relationship to head of household", type="string", startIndex=87, endIndex=89, @@ -524,6 +561,7 @@ Field( item="74", name="PARENT_MINOR_CHILD", + friendly_name="parent of minor child", type="number", startIndex=89, endIndex=90, @@ -533,6 +571,7 @@ Field( item="75", name="EDUCATION_LEVEL", + friendly_name="education level", type="string", startIndex=90, endIndex=92, @@ -546,6 +585,7 @@ Field( item="76", name="CITIZENSHIP_STATUS", + friendly_name="citizenship status", type="number", startIndex=92, endIndex=93, @@ -555,6 +595,7 @@ Field( item="77A", name="UNEARNED_SSI", + friendly_name="unearned ssi benefit", type="string", startIndex=93, endIndex=97, @@ -564,6 +605,7 @@ Field( item="77B", name="OTHER_UNEARNED_INCOME", + friendly_name="other unearned income", type="string", startIndex=97, endIndex=101, From 7d0674619727d26a4116935cc7f2d9c94d7cf379 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 4 Dec 2023 09:27:15 -0700 Subject: [PATCH 69/88] - Fixing typo --- tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 8e3c3d4c2..41a1c4523 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -116,7 +116,7 @@ Field( item="0", name="RecordType", - friendly_name="record tsype", + friendly_name="record type", type="string", startIndex=0, endIndex=2, From d2d443d527f47c155a9ca1ddac51347bf0ec22e8 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 4 Dec 2023 11:50:54 -0500 Subject: [PATCH 70/88] linting and cleaning errors --- .../tdpservice/parsers/schema_defs/ssp/m2.py | 5 ++--- .../tdpservice/parsers/schema_defs/ssp/m3.py | 8 ++++---- .../tdpservice/parsers/schema_defs/ssp/m5.py | 4 ++-- .../tdpservice/parsers/schema_defs/ssp/m6.py | 6 +++--- .../tdpservice/parsers/schema_defs/ssp/m7.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t1.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t2.py | 12 ++++++------ .../tdpservice/parsers/schema_defs/tanf/t3.py | 8 ++++---- .../tdpservice/parsers/schema_defs/tanf/t5.py | 4 ++-- .../tdpservice/parsers/schema_defs/tanf/t7.py | 2 +- 10 files changed, 26 insertions(+), 27 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index 25e377e84..d2fdacb80 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -118,16 +118,15 @@ ]), TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', type='string', startIndex=29, endIndex=38, required=True, validators=[validators.validateSSN()], - friendly_name="social security number - ssn", is_encrypted=False), + friendly_name="social security number", is_encrypted=False), Field(item="30A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, friendly_name="race hispanic", validators=[ validators.isInLimits(0, 2) ]), Field(item="30B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, - friendly_name="race american indian", required=False, validators=[ + friendly_name="race american-indian", required=False, validators=[ validators.isInLimits(0, 2) ]), - Field(item="30C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, friendly_name="race asian", required=False, validators=[ validators.isInLimits(0, 2) ]), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index fa41e5de8..3ae40faa5 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -85,7 +85,7 @@ validators.dateMonthIsValid(), ]), TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=28, - friendly_name="social security number - ssn", endIndex=37, required=True, is_encrypted=False, + friendly_name="social security number", endIndex=37, required=True, is_encrypted=False, validators=[ validators.validateSSN() ]), @@ -94,7 +94,7 @@ validators.isInLimits(0, 2) ]), Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - friendly_name="race american indian", required=False, validators=[ + friendly_name="race american-indian", required=False, validators=[ validators.isInLimits(0, 2) ]), Field(item="63C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, @@ -233,7 +233,7 @@ validators.dateMonthIsValid(), ]), TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=69, - endIndex=78, required=True, is_encrypted=False, friendly_name="social security number - ssn", + endIndex=78, required=True, is_encrypted=False, friendly_name="social security number", validators=[ validators.validateSSN() ]), @@ -242,7 +242,7 @@ validators.isInLimits(0, 2) ]), Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, - friendly_name="race american indian", required=False, validators=[ + friendly_name="race american-indian", required=False, validators=[ validators.isInLimits(0, 2) ]), Field(item="63C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py index 4449c142f..c9c72c3cb 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py @@ -161,7 +161,7 @@ transform_func=ssp_ssn_decryption_func, item="15", name="SSN", - friendly_name="social security number - ssn", + friendly_name="social security number", type="string", startIndex=28, endIndex=37, @@ -182,7 +182,7 @@ Field( item="16B", name="RACE_AMER_INDIAN", - friendly_name="race american indian", + friendly_name="race american-indian", type="number", startIndex=38, endIndex=39, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py index 9a7caaebe..7096ace8e 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py @@ -26,7 +26,7 @@ friendly_name='calendar quarter', required=True, validators=[validators.dateYearIsLargerThan(1998), validators.quarterIsValid()]), TransformField(calendar_quarter_to_rpt_month_year(0), item="2B", name='RPT_MONTH_YEAR', type='number', - friendly_name='reporting month year', + friendly_name='reporting month and year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), Field(item="3A", name='SSPMOE_FAMILIES', type='number', startIndex=7, endIndex=15, @@ -82,7 +82,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', - friendly_name='reporting month year', + friendly_name='reporting month and year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), Field(item="3B", name='SSPMOE_FAMILIES', type='number', startIndex=15, endIndex=23, @@ -138,7 +138,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', - friendly_name='reporting month year', + friendly_name='reporting month and year', startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid()]), Field(item="3C", name='SSPMOE_FAMILIES', type='number', startIndex=23, endIndex=31, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py index b2ec5e21e..cde0c1fc3 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m7.py @@ -56,7 +56,7 @@ transform_func=calendar_quarter_to_rpt_month_year((i - 1) % 3), item="2A", name="RPT_MONTH_YEAR", - friendly_name="reporting month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=7, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 851ef0792..1bf37e3ce 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -132,7 +132,7 @@ Field( item="4", name="RPT_MONTH_YEAR", - friendly_name="reporting month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=8, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 0e827e953..2725af62c 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -127,7 +127,7 @@ Field( item="0", name="RecordType", - friendly_name="record tsype", + friendly_name="record type", type="string", startIndex=0, endIndex=2, @@ -194,7 +194,7 @@ transform_func=tanf_ssn_decryption_func, item="33", name="SSN", - friendly_name="social security number - ssn", + friendly_name="social security number", type="string", startIndex=29, endIndex=38, @@ -297,8 +297,8 @@ Field( item="36C", name="DISABLED_TITLE_XIVAPDT", - friendly_name="Receives Aid to the Permanently and Totally Disabled" + - " Under Title XIV-APDT of the Social Security Act", + friendly_name="receives aid to the permanently and totally disabled" + + " under title xiv-apdt of the social security act", type="string", startIndex=47, endIndex=48, @@ -546,7 +546,7 @@ Field( item="53A", name="WORK_EXPERIENCE_HOP", - friendly_name="work experience hours of participation", + friendly_name="work experience - hours of participation", type="string", startIndex=76, endIndex=78, @@ -558,7 +558,7 @@ Field( item="53B", name="WORK_EXPERIENCE_EA", - friendly_name="work experience excused absence", + friendly_name="work experience - excused absence", type="string", startIndex=78, endIndex=80, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index 6b18652b9..ea5d65e6c 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -146,7 +146,7 @@ transform_func=tanf_ssn_decryption_func, item="69", name="SSN", - friendly_name="social security number - ssn", + friendly_name="social security number", type="string", startIndex=28, endIndex=37, @@ -167,7 +167,7 @@ Field( item="70B", name="RACE_AMER_INDIAN", - friendly_name="race american indian", + friendly_name="race american-indian", type="number", startIndex=38, endIndex=39, @@ -450,7 +450,7 @@ transform_func=tanf_ssn_decryption_func, item="69", name="SSN", - friendly_name="social security number - ssn", + friendly_name="social security number", type="string", startIndex=69, endIndex=78, @@ -471,7 +471,7 @@ Field( item="70B", name="RACE_AMER_INDIAN", - friendly_name="race american indian", + friendly_name="race american-indian", type="number", startIndex=79, endIndex=80, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 8049684a9..1112f6d6b 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -162,7 +162,7 @@ transform_func=tanf_ssn_decryption_func, item="16", name="SSN", - friendly_name="social security number - ssn", + friendly_name="social security number", type="string", startIndex=28, endIndex=37, @@ -183,7 +183,7 @@ Field( item="17B", name="RACE_AMER_INDIAN", - friendly_name="race american indian", + friendly_name="race american-indian", type="number", startIndex=38, endIndex=39, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py index 9d0aa6056..e6a05bb9a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t7.py @@ -56,7 +56,7 @@ transform_func=calendar_quarter_to_rpt_month_year(month_index), item="3A", name="RPT_MONTH_YEAR", - friendly_name="reporting month year", + friendly_name="reporting month and year", type="number", startIndex=2, endIndex=7, From 573a05610b5e22ca6b477a5ac8a8c36334be0360 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 4 Dec 2023 11:51:03 -0500 Subject: [PATCH 71/88] linting --- tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index d2fdacb80..fe3295e11 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -127,6 +127,7 @@ friendly_name="race american-indian", required=False, validators=[ validators.isInLimits(0, 2) ]), + Field(item="30C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, friendly_name="race asian", required=False, validators=[ validators.isInLimits(0, 2) ]), From b1be7bb9e3849b4c90403968995e1cc9bd7ed52e Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 4 Dec 2023 12:00:08 -0500 Subject: [PATCH 72/88] correction on friendly_names --- .../tdpservice/parsers/schema_defs/tanf/t5.py | 2 +- .../tdpservice/parsers/schema_defs/tanf/t6.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 1112f6d6b..63250181c 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -392,7 +392,7 @@ Field( item="29", name="AMOUNT_EARNED_INCOME", - friendly_name="amount earnedof income", + friendly_name="amount of earned income", type="string", startIndex=63, endIndex=67, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index 018241fe4..215039fa4 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -114,7 +114,7 @@ Field( item="9A", name="NUM_2_PARENTS", - friendly_name="total number of two-parent families", + friendly_name="number of two-parent families", type="number", startIndex=139, endIndex=147, @@ -313,7 +313,7 @@ Field( item="9B", name="NUM_2_PARENTS", - friendly_name="total number of two-parent families", + friendly_name="number of two-parent families", type="number", startIndex=147, endIndex=155, @@ -333,7 +333,7 @@ Field( item="11B", name="NUM_NO_PARENTS", - friendly_name="total number of no-parent family", + friendly_name="total number of no-parent families", type="number", startIndex=195, endIndex=203, @@ -393,7 +393,7 @@ Field( item="17B", name="NUM_OUTWEDLOCK_BIRTHS", - friendly_name="total number of out wedlock births", + friendly_name="total number of out-of-wedlock births", type="number", startIndex=339, endIndex=347, @@ -512,7 +512,7 @@ Field( item="9C", name="NUM_2_PARENTS", - friendly_name="total number of two parents families", + friendly_name="number of two-parent families", type="number", startIndex=155, endIndex=163, @@ -592,7 +592,7 @@ Field( item="17C", name="NUM_OUTWEDLOCK_BIRTHS", - friendly_name="total number of out wedlock births", + friendly_name="total number of out-of-wedlock births", type="number", startIndex=347, endIndex=355, From cad917361bb403c621434b5207fc1a5fef80646b Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 4 Dec 2023 12:06:03 -0500 Subject: [PATCH 73/88] corrected friendly_name for test_util --- tdrs-backend/tdpservice/parsers/test/test_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/test/test_util.py b/tdrs-backend/tdpservice/parsers/test/test_util.py index 32584b64a..d029e1c84 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_util.py +++ b/tdrs-backend/tdpservice/parsers/test/test_util.py @@ -407,7 +407,7 @@ def test_multi_record_schema_parses_and_validates(): Field( item=2, name='second', - friendly_name='first', + friendly_name='second', type='string', startIndex=2, endIndex=4, @@ -426,7 +426,7 @@ def test_multi_record_schema_parses_and_validates(): Field( item=3, name='third', - friendly_name='first', + friendly_name='third', type='string', startIndex=4, endIndex=5, @@ -446,7 +446,7 @@ def test_multi_record_schema_parses_and_validates(): Field( item=4, name='fourth', - friendly_name='first', + friendly_name='fourth', type='string', startIndex=4, endIndex=5, From 4bce93dd33bfe430b31b7073da1c070eea06c0b6 Mon Sep 17 00:00:00 2001 From: Mo Sohani Date: Mon, 4 Dec 2023 13:26:14 -0500 Subject: [PATCH 74/88] correction child care - number of months --- tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 1bf37e3ce..64c750a22 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -395,7 +395,7 @@ Field( item="22C", name="CC_NBR_MONTHS", - friendly_name="child care number of months", + friendly_name="child care - number of months", type="number", startIndex=68, endIndex=71, From bd29c099ba6e437a8f7761c04c3986994d88739e Mon Sep 17 00:00:00 2001 From: George Hudson Date: Tue, 5 Dec 2023 10:05:04 -0700 Subject: [PATCH 75/88] fixed a few more typos and some spacing. (#2767) * fixed a few more typos and some spacing. * fixed linting issues * missed a spot. --------- Co-authored-by: George Hudson --- .../tdpservice/parsers/schema_defs/ssp/m1.py | 747 +++++++---- .../tdpservice/parsers/schema_defs/ssp/m2.py | 1093 ++++++++++++----- .../tdpservice/parsers/schema_defs/ssp/m3.py | 767 ++++++++---- .../tdpservice/parsers/schema_defs/ssp/m4.py | 3 +- .../tdpservice/parsers/schema_defs/ssp/m5.py | 3 +- .../tdpservice/parsers/schema_defs/ssp/m6.py | 571 +++++++-- .../tdpservice/parsers/schema_defs/tanf/t1.py | 13 +- .../tdpservice/parsers/schema_defs/tanf/t2.py | 37 +- .../tdpservice/parsers/schema_defs/tanf/t3.py | 3 +- .../tdpservice/parsers/schema_defs/tanf/t4.py | 3 +- .../tdpservice/parsers/schema_defs/tanf/t5.py | 3 +- .../tdpservice/parsers/schema_defs/tanf/t6.py | 60 +- 12 files changed, 2350 insertions(+), 953 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py index 877ac5518..ea0aaf189 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m1.py @@ -10,238 +10,525 @@ m1 = SchemaManager( schemas=[ RowSchema( - model=SSP_M1, - preparsing_validators=[ - validators.hasLength(150), - ], - postparsing_validators=[ - validators.if_then_validator( - condition_field='CASH_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CHILDREN_COVERED', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='CC_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='CC_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='TRANSP_AMOUNT', condition_function=validators.isLargerThan(0), - result_field='TRANSP_NBR_MONTHS', result_function=validators.isLargerThan(0), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='WORK_REQ_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='SANC_TEEN_PARENT', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='NON_COOPERATION_CSE', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='FAILURE_TO_COMPLY', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='SANC_REDUCTION_AMT', condition_function=validators.isLargerThan(0), - result_field='OTHER_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='FAMILY_CAP', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='REDUCTIONS_ON_RECEIPTS', result_function=validators.oneOf((1, 2)), - ), - validators.if_then_validator( - condition_field='OTHER_TOTAL_REDUCTIONS', condition_function=validators.isLargerThan(0), - result_field='OTHER_NON_SANCTION', result_function=validators.oneOf((1, 2)), - ), - validators.sumIsLarger([ - "AMT_FOOD_STAMP_ASSISTANCE", - "AMT_SUB_CC", - "CASH_AMOUNT", - "CC_AMOUNT", - "CC_NBR_MONTHS" - ], 0) - ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name="record type", required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="reporting month and year", required=True, validators=[ + model=SSP_M1, + preparsing_validators=[ + validators.hasLength(150), + ], + postparsing_validators=[ + validators.if_then_validator( + condition_field='CASH_AMOUNT', + condition_function=validators.isLargerThan(0), + result_field='NBR_MONTHS', + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='CC_AMOUNT', + condition_function=validators.isLargerThan(0), + result_field='CHILDREN_COVERED', + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='CC_AMOUNT', + condition_function=validators.isLargerThan(0), + result_field='CC_NBR_MONTHS', + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='TRANSP_AMOUNT', + condition_function=validators.isLargerThan(0), + result_field='TRANSP_NBR_MONTHS', + result_function=validators.isLargerThan(0), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', + condition_function=validators.isLargerThan(0), + result_field='WORK_REQ_SANCTION', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', + condition_function=validators.isLargerThan(0), + result_field='SANC_TEEN_PARENT', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', + condition_function=validators.isLargerThan(0), + result_field='NON_COOPERATION_CSE', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', + condition_function=validators.isLargerThan(0), + result_field='FAILURE_TO_COMPLY', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='SANC_REDUCTION_AMT', + condition_function=validators.isLargerThan(0), + result_field='OTHER_SANCTION', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='OTHER_TOTAL_REDUCTIONS', + condition_function=validators.isLargerThan(0), + result_field='FAMILY_CAP', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='OTHER_TOTAL_REDUCTIONS', + condition_function=validators.isLargerThan(0), + result_field='REDUCTIONS_ON_RECEIPTS', + result_function=validators.oneOf((1, 2)), + ), + validators.if_then_validator( + condition_field='OTHER_TOTAL_REDUCTIONS', + condition_function=validators.isLargerThan(0), + result_field='OTHER_NON_SANCTION', + result_function=validators.oneOf((1, 2)), + ), + validators.sumIsLarger([ + "AMT_FOOD_STAMP_ASSISTANCE", + "AMT_SUB_CC", + "CASH_AMOUNT", + "CC_AMOUNT", + "CC_NBR_MONTHS"], 0) + ], + fields=[ + Field( + item="0", + name='RecordType', + friendly_name="record type", + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="3", + name='RPT_MONTH_YEAR', + friendly_name="reporting month and year", + type='number', + startIndex=2, + endIndex=8, + required=True, + validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), - ]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - friendly_name="case number", required=True, validators=[ - validators.isAlphaNumeric() - ]), - Field(item="2", name='COUNTY_FIPS_CODE', type='string', startIndex=19, endIndex=22, - friendly_name="county fips code", required=True, validators=[ - validators.isNumber(), - ]), - Field(item="4", name='STRATUM', type='string', startIndex=22, endIndex=24, - friendly_name="stratum", required=False, validators=[ - validators.isInStringRange(0, 99), - ]), - Field(item="6", name='ZIP_CODE', type='string', startIndex=24, endIndex=29, - friendly_name="zip code", required=True, validators=[ - validators.isNumber(), - ]), - Field(item="7", name='DISPOSITION', type='number', startIndex=29, endIndex=30, - friendly_name="disposition", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="8", name='NBR_FAMILY_MEMBERS', type='number', startIndex=30, endIndex=32, - friendly_name="number of family members", required=True, validators=[ - validators.isInLimits(1, 99), - ]), - Field(item="9", name='FAMILY_TYPE', type='number', startIndex=32, endIndex=33, - friendly_name="family type", required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="10", name='TANF_ASST_IN_6MONTHS', type='number', startIndex=33, endIndex=34, - friendly_name="tanf assistance in 6 months", required=True, validators=[ - validators.isInLimits(1, 3), - ]), - Field(item="11", name='RECEIVES_SUB_HOUSING', type='number', startIndex=34, endIndex=35, - friendly_name="receives subsidized housing", required=True, validators=[ - validators.isInLimits(1, 2), - ]), - Field(item="12", name='RECEIVES_MED_ASSISTANCE', type='number', startIndex=35, endIndex=36, - friendly_name="receives medical assistance", required=True, validators=[ - validators.isInLimits(1, 2), - ]), - Field(item="13", name='RECEIVES_FOOD_STAMPS', type='number', startIndex=36, endIndex=37, - friendly_name="receives food assistance", required=False, validators=[ - validators.isInLimits(0, 2), - ]), - Field(item="14", name='AMT_FOOD_STAMP_ASSISTANCE', type='number', startIndex=37, endIndex=41, - friendly_name="amount of food stamp assistance/stamps", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="15", name='RECEIVES_SUB_CC', type='number', startIndex=41, endIndex=42, - friendly_name="receives subsidized child care", required=False, validators=[ - validators.isInLimits(0, 2), - ]), - Field(item="16", name='AMT_SUB_CC', type='number', startIndex=42, endIndex=46, - friendly_name="amount of subsidized child care", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="17", name='CHILD_SUPPORT_AMT', type='number', startIndex=46, endIndex=50, - friendly_name="child support amount", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="18", name='FAMILY_CASH_RESOURCES', type='number', startIndex=50, endIndex=54, - friendly_name="family cash resources", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="19A", name='CASH_AMOUNT', type='number', startIndex=54, endIndex=58, - friendly_name="cash amount", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="19B", name='NBR_MONTHS', type='number', startIndex=58, endIndex=61, - friendly_name="number of months", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="20A", name='CC_AMOUNT', type='number', startIndex=61, endIndex=65, - friendly_name="child care amount", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="20B", name='CHILDREN_COVERED', type='number', startIndex=65, endIndex=67, - friendly_name="children covered", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="20C", name='CC_NBR_MONTHS', type='number', startIndex=67, endIndex=70, - friendly_name="child care - number of months", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="21A", name='TRANSP_AMOUNT', type='number', startIndex=70, endIndex=74, - friendly_name="transportation amount", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="21B", name='TRANSP_NBR_MONTHS', type='number', startIndex=74, endIndex=77, - friendly_name="transportation number of months", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22A", name='TRANSITION_SERVICES_AMOUNT', type='number', startIndex=77, endIndex=81, - friendly_name="transition services amount", required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="22B", name='TRANSITION_NBR_MONTHS', type='number', startIndex=81, endIndex=84, - friendly_name="transition services number of months", required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="23A", name='OTHER_AMOUNT', type='number', startIndex=84, endIndex=88, - friendly_name="other amount", required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="23B", name='OTHER_NBR_MONTHS', type='number', startIndex=88, endIndex=91, - friendly_name="other number of months", required=False, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24AI", name='SANC_REDUCTION_AMT', type='number', startIndex=91, endIndex=95, - friendly_name="sanction reduction amount", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24AII", name='WORK_REQ_SANCTION', type='number', startIndex=95, endIndex=96, - friendly_name="work requirements sanction", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24AIII", name='FAMILY_SANC_ADULT', type='number', startIndex=96, endIndex=97, - friendly_name="family sanction for adult", required=False, validators=[ - validators.isInLimits(0, 9), - ]), - Field(item="24AIV", name='SANC_TEEN_PARENT', type='number', startIndex=97, endIndex=98, - friendly_name="sanction for teen parent", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24AV", name='NON_COOPERATION_CSE', type='number', startIndex=98, endIndex=99, - friendly_name="non-cooperation with child support", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24AVI", name='FAILURE_TO_COMPLY', type='number', startIndex=99, endIndex=100, - friendly_name="failure to comply", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24AVII", name='OTHER_SANCTION', type='number', startIndex=100, endIndex=101, - friendly_name="other sanction", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24B", name='RECOUPMENT_PRIOR_OVRPMT', type='number', startIndex=101, endIndex=105, - friendly_name="recoupment prior overpayment", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24CI", name='OTHER_TOTAL_REDUCTIONS', type='number', startIndex=105, endIndex=109, - friendly_name="other total reductions", required=True, validators=[ - validators.isLargerThanOrEqualTo(0), - ]), - Field(item="24CII", name='FAMILY_CAP', type='number', startIndex=109, endIndex=110, - friendly_name="family cap", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24CIII", name='REDUCTIONS_ON_RECEIPTS', type='number', startIndex=110, endIndex=111, - friendly_name="reductions on receipts", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="24CIV", name='OTHER_NON_SANCTION', type='number', startIndex=111, endIndex=112, - friendly_name="other, non sanction", required=True, validators=[ - validators.oneOf([1, 2]), - ]), - Field(item="25", name='WAIVER_EVAL_CONTROL_GRPS', type='number', startIndex=112, endIndex=113, - friendly_name="waiver evaluation experimental and control groups", required=False, validators=[ - validators.isInLimits(0, 9), - ]), - Field(item="-1", name='BLANK', type='string', startIndex=113, endIndex=150, - friendly_name="blank", required=False, validators=[]), - ] + ] + ), + Field( + item="5", + name='CASE_NUMBER', + friendly_name="case number", + type='string', + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()] + ), + Field( + item="2", + name='COUNTY_FIPS_CODE', + friendly_name="county fips code", + type='string', + startIndex=19, + endIndex=22, + required=True, + validators=[validators.isNumber(),] + ), + Field( + item="4", + name='STRATUM', + friendly_name="stratum", + type='string', + startIndex=22, + endIndex=24, + required=False, + validators=[validators.isInStringRange(0, 99),] + ), + Field( + item="6", + name='ZIP_CODE', + friendly_name="zip code", + type='string', + startIndex=24, + endIndex=29, + required=True, + validators=[validators.isNumber(),] + ), + Field( + item="7", + name='DISPOSITION', + friendly_name="disposition", + type='number', + startIndex=29, + endIndex=30, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="8", + name='NBR_FAMILY_MEMBERS', + friendly_name="number of family members", + type='number', + startIndex=30, + endIndex=32, + required=True, + validators=[validators.isInLimits(1, 99),] + ), + Field( + item="9", + name='FAMILY_TYPE', + friendly_name="family type", + type='number', + startIndex=32, + endIndex=33, + required=True, + validators=[validators.isInLimits(1, 3),] + ), + Field( + item="10", + name='TANF_ASST_IN_6MONTHS', + friendly_name="tanf assistance in 6 months", + type='number', + startIndex=33, + endIndex=34, + required=True, + validators=[validators.isInLimits(1, 3),] + ), + Field( + item="11", + name='RECEIVES_SUB_HOUSING', + friendly_name="receives subsidized housing", + type='number', + startIndex=34, + endIndex=35, + required=True, + validators=[validators.isInLimits(1, 2),] + ), + Field( + item="12", + name='RECEIVES_MED_ASSISTANCE', + friendly_name="receives medical assistance", + type='number', + startIndex=35, + endIndex=36, + required=True, + validators=[validators.isInLimits(1, 2),] + ), + Field( + item="13", + name='RECEIVES_FOOD_STAMPS', + friendly_name="receives food assistance", + type='number', + startIndex=36, + endIndex=37, + required=False, + validators=[validators.isInLimits(0, 2),] + ), + Field( + item="14", + name='AMT_FOOD_STAMP_ASSISTANCE', + friendly_name="amount of food stamp assistance/stamps", + type='number', + startIndex=37, + endIndex=41, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="15", + name='RECEIVES_SUB_CC', + friendly_name="receives subsidized child care", + type='number', + startIndex=41, + endIndex=42, + required=False, + validators=[validators.isInLimits(0, 2),] + ), + Field( + item="16", + name='AMT_SUB_CC', + friendly_name="amount of subsidized child care", + type='number', + startIndex=42, + endIndex=46, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="17", + name='CHILD_SUPPORT_AMT', + friendly_name="child support amount", + type='number', + startIndex=46, + endIndex=50, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="18", + name='FAMILY_CASH_RESOURCES', + friendly_name="family cash resources", + type='number', + startIndex=50, + endIndex=54, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="19A", + name='CASH_AMOUNT', + friendly_name="cash amount", + type='number', + startIndex=54, + endIndex=58, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="19B", + name='NBR_MONTHS', + friendly_name="number of months", + type='number', + startIndex=58, + endIndex=61, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="20A", + name='CC_AMOUNT', + friendly_name="child care amount", + type='number', + startIndex=61, + endIndex=65, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="20B", + name='CHILDREN_COVERED', + friendly_name="children covered", + type='number', + startIndex=65, + endIndex=67, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="20C", + name='CC_NBR_MONTHS', + friendly_name="child care - number of months", + type='number', + startIndex=67, + endIndex=70, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="21A", + name='TRANSP_AMOUNT', + friendly_name="transportation amount", + type='number', + startIndex=70, + endIndex=74, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="21B", + name='TRANSP_NBR_MONTHS', + friendly_name="transportation - number of months", + type='number', + startIndex=74, + endIndex=77, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="22A", + name='TRANSITION_SERVICES_AMOUNT', + friendly_name="transition services amount", + type='number', + startIndex=77, + endIndex=81, + required=False, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="22B", + name='TRANSITION_NBR_MONTHS', + friendly_name="transition services - number of months", + type='number', + startIndex=81, + endIndex=84, + required=False, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="23A", + name='OTHER_AMOUNT', + friendly_name="other amount", + type='number', + startIndex=84, + endIndex=88, + required=False, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="23B", + name='OTHER_NBR_MONTHS', + friendly_name="other - number of months", + type='number', + startIndex=88, + endIndex=91, + required=False, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="24AI", + name='SANC_REDUCTION_AMT', + friendly_name="sanction reduction amount", + type='number', + startIndex=91, + endIndex=95, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="24AII", + name='WORK_REQ_SANCTION', + friendly_name="work requirements sanction", + type='number', + startIndex=95, + endIndex=96, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24AIII", + name='FAMILY_SANC_ADULT', + friendly_name="family sanction for adult", + type='number', + startIndex=96, + endIndex=97, + required=False, + validators=[validators.isInLimits(0, 9),] + ), + Field( + item="24AIV", + name='SANC_TEEN_PARENT', + friendly_name="sanction for teen parent", + type='number', + startIndex=97, + endIndex=98, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24AV", + name='NON_COOPERATION_CSE', + friendly_name="non-cooperation with child support", + type='number', + startIndex=98, + endIndex=99, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24AVI", + name='FAILURE_TO_COMPLY', + friendly_name="failure to comply", + type='number', + startIndex=99, + endIndex=100, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24AVII", + name='OTHER_SANCTION', + friendly_name="other sanction", + type='number', + startIndex=100, + endIndex=101, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24B", + name='RECOUPMENT_PRIOR_OVRPMT', + friendly_name="recoupment prior overpayment", + type='number', + startIndex=101, + endIndex=105, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="24CI", + name='OTHER_TOTAL_REDUCTIONS', + friendly_name="other total reductions", + type='number', + startIndex=105, + endIndex=109, + required=True, + validators=[validators.isLargerThanOrEqualTo(0),] + ), + Field( + item="24CII", + name='FAMILY_CAP', + friendly_name="family cap", + type='number', + startIndex=109, + endIndex=110, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24CIII", + name='REDUCTIONS_ON_RECEIPTS', + friendly_name="reductions on receipts", + type='number', + startIndex=110, + endIndex=111, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="24CIV", + name='OTHER_NON_SANCTION', + friendly_name="other non-sanction", + type='number', + startIndex=111, + endIndex=112, + required=True, + validators=[validators.oneOf([1, 2]),] + ), + Field( + item="25", + name='WAIVER_EVAL_CONTROL_GRPS', + friendly_name="waiver evaluation experimental and control groups", + type='number', + startIndex=112, + endIndex=113, + required=False, + validators=[validators.isInLimits(0, 9),] + ), + Field( + item="-1", + name='BLANK', + friendly_name="blank", + type='string', + startIndex=113, + endIndex=150, + required=False, + validators=[] + ), + ] ) ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py index fe3295e11..eebfa9e0c 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m2.py @@ -12,361 +12,794 @@ m2 = SchemaManager( schemas=[ RowSchema( - model=SSP_M2, - preparsing_validators=[ - validators.hasLength(150), - ], - postparsing_validators=[ - validators.validate__FAM_AFF__SSN(), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='MARITAL_STATUS', result_function=validators.isInLimits(1, 5), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 2), - result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3), - ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EDUCATION_LEVEL', result_function=validators.or_validators( + model=SSP_M2, + preparsing_validators=[ + validators.hasLength(150), + ], + postparsing_validators=[ + validators.validate__FAM_AFF__SSN(), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='SSN', + result_function=validators.validateSSN(), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='RACE_HISPANIC', + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='RACE_AMER_INDIAN', + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='RACE_ASIAN', + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='RACE_BLACK', + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='RACE_HAWAIIAN', + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='RACE_WHITE', + result_function=validators.isInLimits(1, 2), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='MARITAL_STATUS', + result_function=validators.isInLimits(1, 5), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 2), + result_field='PARENT_MINOR_CHILD', + result_function=validators.isInLimits(1, 3), + ), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='EDUCATION_LEVEL', + result_function=validators.or_validators( validators.isInStringRange(1, 16), validators.isInStringRange(98, 99) ), ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', + result_function=validators.oneOf((1, 2)), ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='COOPERATION_CHILD_SUPPORT', result_function=validators.oneOf((1, 2, 9)), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='COOPERATION_CHILD_SUPPORT', + result_function=validators.oneOf((1, 2, 9)), ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='EMPLOYMENT_STATUS', result_function=validators.isInLimits(1, 3), + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.isInLimits(1, 3), + result_field='EMPLOYMENT_STATUS', + result_function=validators.isInLimits(1, 3), ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_ELIGIBLE_INDICATOR', result_function=validators.or_validators( + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='WORK_ELIGIBLE_INDICATOR', + result_function=validators.or_validators( validators.isInLimits(1, 9), validators.oneOf((11, 12)) ), ), - validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='WORK_PART_STATUS', result_function=validators.oneOf([ - 1, 2, 5, 7, 9, - 15, 16, 17, 18, 99 - ]), - ), - validators.if_then_validator( - condition_field='WORK_ELIGIBLE_INDICATOR', condition_function=validators.isInLimits(1, 5), - result_field='WORK_PART_STATUS', result_function=validators.notMatches(99), - ), - ], - fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name="record type", required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="reporting month and year", required=True, validators=[ + validators.if_then_validator( + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='WORK_PART_STATUS', + result_function=validators.oneOf([1, 2, 5, 7, 9, 15, 16, 17, 18, 99]), + ), + validators.if_then_validator( + condition_field='WORK_ELIGIBLE_INDICATOR', + condition_function=validators.isInLimits(1, 5), + result_field='WORK_PART_STATUS', + result_function=validators.notMatches(99), + ), + ], + fields=[ + Field( + item="0", + name='RecordType', + friendly_name="record type", + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="3", + name='RPT_MONTH_YEAR', + friendly_name="reporting month and year", + type='number', + startIndex=2, + endIndex=8, + required=True, + validators=[ validators.dateYearIsLargerThan(1998), validators.dateMonthIsValid(), - ]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - friendly_name="case number", required=True, validators=[ - validators.isAlphaNumeric() - ]), - Field(item="26", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - friendly_name="family affiliation", required=True, validators=[ - validators.oneOf([1, 2, 3, 5]) - ]), - Field(item="27", name='NONCUSTODIAL_PARENT', type='number', startIndex=20, endIndex=21, - friendly_name="noncustodial parent", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="28", name='DATE_OF_BIRTH', type='number', startIndex=21, endIndex=29, - friendly_name="date of birth", required=True, validators=[ - validators.isLargerThan(0) - ]), - TransformField(transform_func=ssp_ssn_decryption_func, item="29", name='SSN', type='string', - startIndex=29, endIndex=38, required=True, validators=[validators.validateSSN()], - friendly_name="social security number", is_encrypted=False), - Field(item="30A", name='RACE_HISPANIC', type='number', startIndex=38, endIndex=39, required=False, - friendly_name="race hispanic", validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="30B", name='RACE_AMER_INDIAN', type='number', startIndex=39, endIndex=40, - friendly_name="race american-indian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="30C", name='RACE_ASIAN', type='number', startIndex=40, endIndex=41, - friendly_name="race asian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="30D", name='RACE_BLACK', type='number', startIndex=41, endIndex=42, - friendly_name="race black", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="30E", name='RACE_HAWAIIAN', type='number', startIndex=42, endIndex=43, - friendly_name="race hawaiian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="30F", name='RACE_WHITE', type='number', startIndex=43, endIndex=44, - friendly_name="race white", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="31", name='GENDER', type='number', startIndex=44, endIndex=45, - friendly_name="gender", required=True, validators=[ - validators.isLargerThanOrEqualTo(0) - ]), - Field(item="32A", name='FED_OASDI_PROGRAM', type='number', startIndex=45, endIndex=46, - friendly_name="federal old-age survivors and disability insurance program", required=True, - validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="32B", name='FED_DISABILITY_STATUS', type='number', startIndex=46, endIndex=47, - friendly_name="federal disability status", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="32C", name='DISABLED_TITLE_XIVAPDT', type='number', startIndex=47, endIndex=48, + ] + ), + Field( + item="5", + name='CASE_NUMBER', + friendly_name="case number", + type='string', + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()] + ), + Field( + item="26", + name='FAMILY_AFFILIATION', + friendly_name="family affiliation", + type='number', + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 3, 5])] + ), + Field( + item="27", + name='NONCUSTODIAL_PARENT', + friendly_name="noncustodial parent", + type='number', + startIndex=20, + endIndex=21, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="28", + name='DATE_OF_BIRTH', + friendly_name="date of birth", + type='number', + startIndex=21, + endIndex=29, + required=True, + validators=[validators.isLargerThan(0)] + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="29", + name='SSN', + friendly_name="social security number", + type='string', + startIndex=29, + endIndex=38, + required=True, + validators=[validators.validateSSN()], + is_encrypted=False + ), + Field( + item="30A", + name='RACE_HISPANIC', + type='number', + friendly_name="race hispanic", + startIndex=38, + endIndex=39, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="30B", + name='RACE_AMER_INDIAN', + friendly_name="race american-indian", + type='number', + startIndex=39, + endIndex=40, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="30C", + name='RACE_ASIAN', + friendly_name="race asian", + type='number', + startIndex=40, + endIndex=41, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="30D", + name='RACE_BLACK', + friendly_name="race black", + type='number', + startIndex=41, + endIndex=42, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="30E", + name='RACE_HAWAIIAN', + friendly_name="race hawaiian", + type='number', + startIndex=42, + endIndex=43, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="30F", + name='RACE_WHITE', + friendly_name="race white", + type='number', + startIndex=43, + endIndex=44, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="31", + name='GENDER', + friendly_name="gender", + type='number', + startIndex=44, + endIndex=45, + required=True, + validators=[validators.isLargerThanOrEqualTo(0)] + ), + Field( + item="32A", + name='FED_OASDI_PROGRAM', + friendly_name="federal old-age survivors and disability insurance program", + type='number', + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="32B", + name='FED_DISABILITY_STATUS', + friendly_name="federal disability status", + type='number', + startIndex=46, + endIndex=47, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="32C", + name='DISABLED_TITLE_XIVAPDT', friendly_name="receives aid to the permanently and totally disabled" + - " under title xiv-apdt of the social security act", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="32D", name='AID_AGED_BLIND', type='number', startIndex=48, endIndex=49, + " under title xiv-apdt of the social security act", + type='number', + startIndex=47, + endIndex=48, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="32D", + name='AID_AGED_BLIND', friendly_name="receives from the aid to the aged, blind, and disabled program", - required=False, validators=[ - validators.isLargerThanOrEqualTo(0) - ]), - Field(item="32E", name='RECEIVE_SSI', type='number', startIndex=49, endIndex=50, - friendly_name="receives social security income", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="33", name='MARITAL_STATUS', type='number', startIndex=50, endIndex=51, - friendly_name="marital status", required=False, validators=[ - validators.isInLimits(0, 5) - ]), - Field(item="34", name='RELATIONSHIP_HOH', type='string', startIndex=51, endIndex=53, - friendly_name="relationship to head of household", required=True, validators=[ - validators.isInStringRange(1, 10) - ]), - Field(item="35", name='PARENT_MINOR_CHILD', type='number', startIndex=53, endIndex=54, - friendly_name="parent of minor child", required=False, validators=[ - validators.isInLimits(0, 3) - ]), - Field(item="36", name='NEEDS_PREGNANT_WOMAN', type='number', startIndex=54, endIndex=55, - friendly_name="needs of pregnant woman", required=False, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="37", name='EDUCATION_LEVEL', type='number', startIndex=55, endIndex=57, - friendly_name="education level", required=False, validators=[ + type='number', + startIndex=48, + endIndex=49, + required=False, + validators=[validators.isLargerThanOrEqualTo(0)] + ), + Field( + item="32E", + name='RECEIVE_SSI', + friendly_name="receives social security income", + type='number', + startIndex=49, + endIndex=50, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="33", + name='MARITAL_STATUS', + friendly_name="marital status", + type='number', + startIndex=50, + endIndex=51, + required=False, + validators=[validators.isInLimits(0, 5)] + ), + Field( + item="34", + name='RELATIONSHIP_HOH', + friendly_name="relationship to head of household", + type='string', + startIndex=51, + endIndex=53, + required=True, + validators=[validators.isInStringRange(1, 10)] + ), + Field( + item="35", + name='PARENT_MINOR_CHILD', + friendly_name="parent of minor child", + type='number', + startIndex=53, + endIndex=54, + required=False, + validators=[validators.isInLimits(0, 3)] + ), + Field( + item="36", + name='NEEDS_PREGNANT_WOMAN', + friendly_name="needs of pregnant woman", + type='number', + startIndex=54, + endIndex=55, + required=False, + validators=[validators.isInLimits(0, 9)] + ), + Field( + item="37", + name='EDUCATION_LEVEL', + friendly_name="education level", + type='number', + startIndex=55, + endIndex=57, + required=False, + validators=[ validators.or_validators( validators.isInLimits(0, 16), validators.isInLimits(98, 99) ) - ]), - Field(item="38", name='CITIZENSHIP_STATUS', type='number', startIndex=57, endIndex=58, - friendly_name="citizenship status", required=False, validators=[ - validators.oneOf([0, 1, 2, 3, 9]) - ]), - Field(item="39", name='COOPERATION_CHILD_SUPPORT', type='number', startIndex=58, endIndex=59, - friendly_name="cooperation with child support", required=False, validators=[ - validators.oneOf([0, 1, 2, 9]) - ]), - Field(item="40", name='EMPLOYMENT_STATUS', type='number', startIndex=59, endIndex=60, - friendly_name="employment status", required=False, validators=[ - validators.isInLimits(0, 3) - ]), - Field(item="41", name='WORK_ELIGIBLE_INDICATOR', type='number', startIndex=60, endIndex=62, - friendly_name="work eligible indicator", required=True, validators=[ + ] + ), + Field( + item="38", + name='CITIZENSHIP_STATUS', + friendly_name="citizenship status", + type='number', + startIndex=57, + endIndex=58, + required=False, + validators=[validators.oneOf([0, 1, 2, 3, 9])] + ), + Field( + item="39", + name='COOPERATION_CHILD_SUPPORT', + friendly_name="cooperation with child support", + type='number', + startIndex=58, + endIndex=59, + required=False, + validators=[validators.oneOf([0, 1, 2, 9])] + ), + Field( + item="40", + name='EMPLOYMENT_STATUS', + friendly_name="employment status", + type='number', + startIndex=59, + endIndex=60, + required=False, + validators=[validators.isInLimits(0, 3)] + ), + Field( + item="41", + name='WORK_ELIGIBLE_INDICATOR', + friendly_name="work eligible indicator", + type='number', + startIndex=60, + endIndex=62, + required=True, + validators=[ validators.or_validators( validators.isInLimits(1, 4), validators.isInLimits(6, 9), validators.isInLimits(11, 12) ) - ]), - Field(item="42", name='WORK_PART_STATUS', type='number', startIndex=62, endIndex=64, - friendly_name="work participation status", required=False, validators=[ - validators.oneOf([1, 2, 5, 7, 9, 15, 16, 17, 18, 19, 99]) - ]), - Field(item="43", name='UNSUB_EMPLOYMENT', type='number', startIndex=64, endIndex=66, - friendly_name="unsubsidized employment", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="44", name='SUB_PRIVATE_EMPLOYMENT', type='number', startIndex=66, endIndex=68, - friendly_name="subsidized private employment", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="45", name='SUB_PUBLIC_EMPLOYMENT', type='number', startIndex=68, endIndex=70, - friendly_name="subsidized public employment", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="46A", name='WORK_EXPERIENCE_HOP', type='number', startIndex=70, endIndex=72, - friendly_name="work experience - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="46B", name='WORK_EXPERIENCE_EA', type='number', startIndex=72, endIndex=74, - friendly_name="work experience - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="46C", name='WORK_EXPERIENCE_HOL', type='number', startIndex=74, endIndex=76, - friendly_name="work experience hours - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="47", name='OJT', type='number', startIndex=76, endIndex=78, - friendly_name="OJT", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="48A", name='JOB_SEARCH_HOP', type='number', startIndex=78, endIndex=80, - friendly_name="job search - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="48B", name='JOB_SEARCH_EA', type='number', startIndex=80, endIndex=82, - friendly_name="job search - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="48C", name='JOB_SEARCH_HOL', type='number', startIndex=82, endIndex=84, - friendly_name="job search - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="49A", name='COMM_SERVICES_HOP', type='number', startIndex=84, endIndex=86, - friendly_name="community services - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="49B", name='COMM_SERVICES_EA', type='number', startIndex=86, endIndex=88, - friendly_name="community services - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="49C", name='COMM_SERVICES_HOL', type='number', startIndex=88, endIndex=90, - friendly_name="community services - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="50A", name='VOCATIONAL_ED_TRAINING_HOP', type='number', startIndex=90, endIndex=92, - friendly_name="vocational education training - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="50B", name='VOCATIONAL_ED_TRAINING_EA', type='number', startIndex=92, endIndex=94, - friendly_name="vocational education training - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="50C", name='VOCATIONAL_ED_TRAINING_HOL', type='number', startIndex=94, endIndex=96, - friendly_name="vocational education training - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="51A", name='JOB_SKILLS_TRAINING_HOP', type='number', startIndex=96, endIndex=98, - friendly_name="job skills training - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="51B", name='JOB_SKILLS_TRAINING_EA', type='number', startIndex=98, endIndex=100, - friendly_name="job skills training - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="51C", name='JOB_SKILLS_TRAINING_HOL', type='number', startIndex=100, endIndex=102, - friendly_name="job skills training - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="52A", name='ED_NO_HIGH_SCHOOL_DIPL_HOP', type='number', startIndex=102, endIndex=104, + ] + ), + Field( + item="42", + name='WORK_PART_STATUS', + friendly_name="work participation status", + type='number', + startIndex=62, + endIndex=64, + required=False, + validators=[validators.oneOf([1, 2, 5, 7, 9, 15, 16, 17, 18, 19, 99])] + ), + Field( + item="43", + name='UNSUB_EMPLOYMENT', + friendly_name="unsubsidized employment", + type='number', + startIndex=64, + endIndex=66, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="44", + name='SUB_PRIVATE_EMPLOYMENT', + friendly_name="subsidized private employment", + type='number', + startIndex=66, + endIndex=68, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="45", + name='SUB_PUBLIC_EMPLOYMENT', + friendly_name="subsidized public employment", + type='number', + startIndex=68, + endIndex=70, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="46A", + name='WORK_EXPERIENCE_HOP', + friendly_name="work experience - hours of participation", + type='number', + startIndex=70, + endIndex=72, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="46B", + name='WORK_EXPERIENCE_EA', + friendly_name="work experience - excused absence", + type='number', + startIndex=72, + endIndex=74, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="46C", + name='WORK_EXPERIENCE_HOL', + friendly_name="work experience hours - holiday", + type='number', + startIndex=74, + endIndex=76, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="47", + name='OJT', + friendly_name="OJT", + type='number', + startIndex=76, + endIndex=78, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="48A", + name='JOB_SEARCH_HOP', + friendly_name="job search - hours of participation", + type='number', + startIndex=78, + endIndex=80, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="48B", + name='JOB_SEARCH_EA', + friendly_name="job search - excused absence", + type='number', + startIndex=80, + endIndex=82, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="48C", + name='JOB_SEARCH_HOL', + friendly_name="job search - holiday", + type='number', + startIndex=82, + endIndex=84, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="49A", + name='COMM_SERVICES_HOP', + friendly_name="community services - hours of participation", + type='number', + startIndex=84, + endIndex=86, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="49B", + name='COMM_SERVICES_EA', + friendly_name="community services - excused absence", + type='number', + startIndex=86, + endIndex=88, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="49C", + name='COMM_SERVICES_HOL', + friendly_name="community services - holiday", + type='number', + startIndex=88, + endIndex=90, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="50A", + name='VOCATIONAL_ED_TRAINING_HOP', + friendly_name="vocational education training - hours of participation", + type='number', + startIndex=90, + endIndex=92, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="50B", + name='VOCATIONAL_ED_TRAINING_EA', + friendly_name="vocational education training - excused absence", + type='number', + startIndex=92, + endIndex=94, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="50C", + name='VOCATIONAL_ED_TRAINING_HOL', + friendly_name="vocational education training - holiday", + type='number', + startIndex=94, + endIndex=96, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="51A", + name='JOB_SKILLS_TRAINING_HOP', + friendly_name="job skills training - hours of participation", + type='number', + startIndex=96, + endIndex=98, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="51B", + name='JOB_SKILLS_TRAINING_EA', + friendly_name="job skills training - excused absence", + type='number', + startIndex=98, + endIndex=100, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="51C", + name='JOB_SKILLS_TRAINING_HOL', + friendly_name="job skills training - holiday", + type='number', + startIndex=100, + endIndex=102, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="52A", + name='ED_NO_HIGH_SCHOOL_DIPL_HOP', friendly_name="education no high school diploma - hours of participation", - required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="52B", name='ED_NO_HIGH_SCHOOL_DIPL_EA', type='number', startIndex=104, endIndex=106, - friendly_name="education no high school diploma - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="52C", name='ED_NO_HIGH_SCHOOL_DIPL_HOL', type='number', startIndex=106, endIndex=108, - friendly_name="education no high school diploma - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="53A", name='SCHOOL_ATTENDENCE_HOP', type='number', startIndex=108, endIndex=110, - friendly_name="school attendance - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="53B", name='SCHOOL_ATTENDENCE_EA', type='number', startIndex=110, endIndex=112, - friendly_name="school attendance - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="53C", name='SCHOOL_ATTENDENCE_HOL', type='number', startIndex=112, endIndex=114, - friendly_name="school attendance - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="54A", name='PROVIDE_CC_HOP', type='number', startIndex=114, endIndex=116, - friendly_name="provide child care - hours of participation", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="54B", name='PROVIDE_CC_EA', type='number', startIndex=116, endIndex=118, - friendly_name="provide child care - excused absence", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="54C", name='PROVIDE_CC_HOL', type='number', startIndex=118, endIndex=120, - friendly_name="provide child care - holiday", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="55", name='OTHER_WORK_ACTIVITIES', type='number', startIndex=120, endIndex=122, - friendly_name="other work activities", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="56", name='DEEMED_HOURS_FOR_OVERALL', type='number', startIndex=122, endIndex=124, - friendly_name="deemed hours for overall", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="57", name='DEEMED_HOURS_FOR_TWO_PARENT', type='number', startIndex=124, endIndex=126, - friendly_name="deemed hours for two parents", required=False, validators=[ - validators.isInLimits(0, 99) - ]), - Field(item="58", name='EARNED_INCOME', type='number', startIndex=126, endIndex=130, - friendly_name="earned income", required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="59A", name='UNEARNED_INCOME_TAX_CREDIT', type='number', startIndex=130, endIndex=134, - friendly_name="unearned income tax credit", required=False, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="59B", name='UNEARNED_SOCIAL_SECURITY', type='number', startIndex=134, endIndex=138, - friendly_name="unearned social security", required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="59C", name='UNEARNED_SSI', type='number', startIndex=138, endIndex=142, - friendly_name="unearned ssi benefit", required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="59D", name='UNEARNED_WORKERS_COMP', type='number', startIndex=142, endIndex=146, - friendly_name="unearned workers compensation", required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="59E", name='OTHER_UNEARNED_INCOME', type='number', startIndex=146, endIndex=150, - friendly_name="other unearned income", required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - ], + type='number', + startIndex=102, + endIndex=104, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="52B", + name='ED_NO_HIGH_SCHOOL_DIPL_EA', + friendly_name="education no high school diploma - excused absence", + type='number', + startIndex=104, + endIndex=106, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="52C", + name='ED_NO_HIGH_SCHOOL_DIPL_HOL', + friendly_name="education no high school diploma - holiday", + type='number', + startIndex=106, + endIndex=108, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="53A", + name='SCHOOL_ATTENDENCE_HOP', + friendly_name="school attendance - hours of participation", + type='number', + startIndex=108, + endIndex=110, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="53B", + name='SCHOOL_ATTENDENCE_EA', + friendly_name="school attendance - excused absence", + type='number', + startIndex=110, + endIndex=112, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="53C", + name='SCHOOL_ATTENDENCE_HOL', + friendly_name="school attendance - holiday", + type='number', + startIndex=112, + endIndex=114, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="54A", + name='PROVIDE_CC_HOP', + friendly_name="provide child care - hours of participation", + type='number', + startIndex=114, + endIndex=116, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="54B", + name='PROVIDE_CC_EA', + friendly_name="provide child care - excused absence", + type='number', + startIndex=116, + endIndex=118, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="54C", + name='PROVIDE_CC_HOL', + friendly_name="provide child care - holiday", + type='number', + startIndex=118, + endIndex=120, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="55", + name='OTHER_WORK_ACTIVITIES', + friendly_name="other work activities", + type='number', + startIndex=120, + endIndex=122, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="56", + name='DEEMED_HOURS_FOR_OVERALL', + friendly_name="deemed hours for overall", + type='number', + startIndex=122, + endIndex=124, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="57", + name='DEEMED_HOURS_FOR_TWO_PARENT', + friendly_name="deemed hours for two parents", + type='number', + startIndex=124, + endIndex=126, + required=False, + validators=[validators.isInLimits(0, 99)] + ), + Field( + item="58", + name='EARNED_INCOME', + friendly_name="earned income", + type='number', + startIndex=126, + endIndex=130, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="59A", + name='UNEARNED_INCOME_TAX_CREDIT', + friendly_name="unearned income tax credit", + type='number', + startIndex=130, + endIndex=134, + required=False, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="59B", + name='UNEARNED_SOCIAL_SECURITY', + friendly_name="unearned social security", + type='number', + startIndex=134, + endIndex=138, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="59C", + name='UNEARNED_SSI', + friendly_name="unearned ssi benefit", + type='number', + startIndex=138, + endIndex=142, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="59D", + name='UNEARNED_WORKERS_COMP', + friendly_name="unearned workers compensation", + type='number', + startIndex=142, + endIndex=146, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="59E", + name='OTHER_UNEARNED_INCOME', + friendly_name="other unearned income", + type='number', + startIndex=146, + endIndex=150, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + ], ) ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py index 3ae40faa5..19c101687 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m3.py @@ -15,143 +15,302 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='SSN', + result_function=validators.validateSSN(), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_HISPANIC', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_AMER_INDIAN', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_ASIAN', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_BLACK', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_HAWAIIAN', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_WHITE', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInLimits(4, 9), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RELATIONSHIP_HOH', + result_function=validators.isInLimits(4, 9), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((1, 2, 3)), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='PARENT_MINOR_CHILD', + result_function=validators.oneOf((1, 2, 3)), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches(99), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='EDUCATION_LEVEL', + result_function=validators.notMatches(99), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', + result_function=validators.oneOf((1, 2)), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 3, 9)), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(2), + result_field='CITIZENSHIP_STATUS', + result_function=validators.oneOf((1, 2, 3, 9)), ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name="record type", required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="reporting month and year", required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - friendly_name="case number", required=True, validators=[ - validators.isAlphaNumeric() - ]), - Field(item="60", name='FAMILY_AFFILIATION', type='number', startIndex=19, endIndex=20, - friendly_name="family affiliation", required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="61", name='DATE_OF_BIRTH', type='string', startIndex=20, endIndex=28, - friendly_name="date of birth", required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=28, - friendly_name="social security number", endIndex=37, required=True, is_encrypted=False, - validators=[ - validators.validateSSN() - ]), - Field(item="63A", name='RACE_HISPANIC', type='number', startIndex=37, endIndex=38, - friendly_name="race hispanic", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=38, endIndex=39, - friendly_name="race american-indian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63C", name='RACE_ASIAN', type='number', startIndex=39, endIndex=40, - friendly_name="race asian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63D", name='RACE_BLACK', type='number', startIndex=40, endIndex=41, - friendly_name="race black", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63E", name='RACE_HAWAIIAN', type='number', startIndex=41, endIndex=42, - friendly_name="race hawaiian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63F", name='RACE_WHITE', type='number', startIndex=42, endIndex=43, - friendly_name="race white", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="64", name='GENDER', type='number', startIndex=43, endIndex=44, - friendly_name="gender", required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=44, endIndex=45, - friendly_name="receive non-ssi benefits", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=45, endIndex=46, - friendly_name="receives ssi", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=46, endIndex=48, - friendly_name="relationship to head of household", required=False, validators=[ - validators.isInStringRange(0, 10) - ]), - Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=48, endIndex=49, - friendly_name="parent of minor child", required=False, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=49, endIndex=51, - friendly_name="education level", required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ) - ]), - Field(item="69", name='CITIZENSHIP_STATUS', type='number', startIndex=51, endIndex=52, - friendly_name="citizenship status", required=False, validators=[ - validators.oneOf([0, 1, 2, 3, 9]) - ]), - Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=52, endIndex=56, - friendly_name="unearned ssi benefit", required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=56, endIndex=60, - friendly_name="other unearned income", required=True, validators=[ - validators.isInLimits(0, 9999) - ]) + Field( + item="0", + name='RecordType', + friendly_name="record type", + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="3", + name='RPT_MONTH_YEAR', + friendly_name="reporting month and year", + type='number', + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ] + ), + Field( + item="5", + name='CASE_NUMBER', + friendly_name="case number", + type='string', + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()] + ), + Field( + item="60", + name='FAMILY_AFFILIATION', + friendly_name="family affiliation", + type='number', + startIndex=19, + endIndex=20, + required=True, + validators=[validators.oneOf([1, 2, 4])] + ), + Field( + item="61", + name='DATE_OF_BIRTH', + friendly_name="date of birth", + type='string', + startIndex=20, + endIndex=28, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ] + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="62", + name='SSN', + friendly_name="social security number", + type='string', + startIndex=28, + endIndex=37, + required=True, + is_encrypted=False, + validators=[validators.validateSSN()] + ), + Field( + item="63A", + name='RACE_HISPANIC', + friendly_name="race hispanic", + type='number', + startIndex=37, + endIndex=38, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63B", + name='RACE_AMER_INDIAN', + friendly_name="race american-indian", + type='number', + startIndex=38, + endIndex=39, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63C", + name='RACE_ASIAN', + friendly_name="race asian", + type='number', + startIndex=39, + endIndex=40, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63D", + name='RACE_BLACK', + friendly_name="race black", + type='number', + startIndex=40, + endIndex=41, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63E", + name='RACE_HAWAIIAN', + friendly_name="race hawaiian", + type='number', + startIndex=41, + endIndex=42, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63F", + name='RACE_WHITE', + friendly_name="race white", + type='number', + startIndex=42, + endIndex=43, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="64", + name='GENDER', + friendly_name="gender", + type='number', + startIndex=43, + endIndex=44, + required=True, + validators=[validators.isInLimits(0, 9)] + ), + Field( + item="65A", + name='RECEIVE_NONSSI_BENEFITS', + friendly_name="receive non-ssi benefits", + type='number', + startIndex=44, + endIndex=45, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="65B", + name='RECEIVE_SSI', + friendly_name="receives ssi", + type='number', + startIndex=45, + endIndex=46, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="66", + name='RELATIONSHIP_HOH', + friendly_name="relationship to head of household", + type='number', + startIndex=46, + endIndex=48, + required=False, + validators=[validators.isInStringRange(0, 10)] + ), + Field( + item="67", + name='PARENT_MINOR_CHILD', + friendly_name="parent of minor child", + type='number', + startIndex=48, + endIndex=49, + required=False, + validators=[validators.oneOf([0, 2, 3])] + ), + Field( + item="68", + name='EDUCATION_LEVEL', + friendly_name="education level", + type='number', + startIndex=49, + endIndex=51, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + ) + ] + ), + Field( + item="69", + name='CITIZENSHIP_STATUS', + friendly_name="citizenship status", + type='number', + startIndex=51, + endIndex=52, + required=False, + validators=[validators.oneOf([0, 1, 2, 3, 9])] + ), + Field( + item="70A", + name='UNEARNED_SSI', + friendly_name="unearned ssi benefit", + type='number', + startIndex=52, + endIndex=56, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="70B", + name='OTHER_UNEARNED_INCOME', + friendly_name="other unearned income", + type='number', + startIndex=56, + endIndex=60, + required=True, + validators=[validators.isInLimits(0, 9999)] + ) ] ) @@ -163,144 +322,302 @@ ], postparsing_validators=[ validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='SSN', result_function=validators.validateSSN(), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='SSN', + result_function=validators.validateSSN(), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HISPANIC', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_HISPANIC', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_AMER_INDIAN', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_AMER_INDIAN', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_ASIAN', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_ASIAN', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_BLACK', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_BLACK', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_HAWAIIAN', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_HAWAIIAN', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RACE_WHITE', result_function=validators.isInLimits(1, 2), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RACE_WHITE', + result_function=validators.isInLimits(1, 2), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='RELATIONSHIP_HOH', result_function=validators.isInStringRange(4, 9), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='RELATIONSHIP_HOH', + result_function=validators.isInStringRange(4, 9), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.oneOf((1, 2)), - result_field='PARENT_MINOR_CHILD', result_function=validators.oneOf((1, 2, 3)), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.oneOf((1, 2)), + result_field='PARENT_MINOR_CHILD', + result_function=validators.oneOf((1, 2, 3)), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='EDUCATION_LEVEL', result_function=validators.notMatches(99), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='EDUCATION_LEVEL', + result_function=validators.notMatches(99), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(1), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2)), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(1), + result_field='CITIZENSHIP_STATUS', + result_function=validators.oneOf((1, 2)), ), validators.if_then_validator( - condition_field='FAMILY_AFFILIATION', condition_function=validators.matches(2), - result_field='CITIZENSHIP_STATUS', result_function=validators.oneOf((1, 2, 3, 9)), + condition_field='FAMILY_AFFILIATION', + condition_function=validators.matches(2), + result_field='CITIZENSHIP_STATUS', + result_function=validators.oneOf((1, 2, 3, 9)), ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name="record type", required=True, validators=[]), - Field(item="3", name='RPT_MONTH_YEAR', type='number', startIndex=2, endIndex=8, - friendly_name="reporting month and year", required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - Field(item="5", name='CASE_NUMBER', type='string', startIndex=8, endIndex=19, - friendly_name="case number", required=True, validators=[ - validators.isAlphaNumeric() - ]), - Field(item="60", name='FAMILY_AFFILIATION', type='number', startIndex=60, endIndex=61, - friendly_name="family affiliation", required=True, validators=[ - validators.oneOf([1, 2, 4]) - ]), - Field(item="61", name='DATE_OF_BIRTH', type='string', startIndex=61, endIndex=69, - friendly_name="date of birth", required=True, validators=[ - validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid(), - ]), - TransformField(transform_func=ssp_ssn_decryption_func, item="62", name='SSN', type='string', startIndex=69, - endIndex=78, required=True, is_encrypted=False, friendly_name="social security number", - validators=[ - validators.validateSSN() - ]), - Field(item="63A", name='RACE_HISPANIC', type='number', startIndex=78, endIndex=79, - friendly_name="race hispanic", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63B", name='RACE_AMER_INDIAN', type='number', startIndex=79, endIndex=80, - friendly_name="race american-indian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63C", name='RACE_ASIAN', type='number', startIndex=80, endIndex=81, - friendly_name="race asian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63D", name='RACE_BLACK', type='number', startIndex=81, endIndex=82, - friendly_name="race black", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63E", name='RACE_HAWAIIAN', type='number', startIndex=82, endIndex=83, - friendly_name="race hawaiian", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="63F", name='RACE_WHITE', type='number', startIndex=83, endIndex=84, - friendly_name="race white", required=False, validators=[ - validators.isInLimits(0, 2) - ]), - Field(item="64", name='GENDER', type='number', startIndex=84, endIndex=85, - friendly_name="gender", required=True, validators=[ - validators.isInLimits(0, 9) - ]), - Field(item="65A", name='RECEIVE_NONSSI_BENEFITS', type='number', startIndex=85, endIndex=86, - friendly_name="receives non-ssi benefit", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="65B", name='RECEIVE_SSI', type='number', startIndex=86, endIndex=87, - friendly_name="receives ssi", required=True, validators=[ - validators.oneOf([1, 2]) - ]), - Field(item="66", name='RELATIONSHIP_HOH', type='number', startIndex=87, endIndex=89, - friendly_name="relationship to head of household", required=False, validators=[ - validators.isInLimits(0, 10) - ]), - Field(item="67", name='PARENT_MINOR_CHILD', type='number', startIndex=89, endIndex=90, - friendly_name="parent of minor child", required=False, validators=[ - validators.oneOf([0, 2, 3]) - ]), - Field(item="68", name='EDUCATION_LEVEL', type='number', startIndex=90, endIndex=92, - friendly_name="education level", required=True, validators=[ - validators.or_validators( - validators.isInStringRange(0, 16), - validators.isInStringRange(98, 99) - ) - ]), - Field(item="69", name='CITIZENSHIP_STATUS', type='number', startIndex=92, endIndex=93, - friendly_name="citizenship status", required=False, validators=[ - validators.oneOf([0, 1, 2, 3, 9]) - ]), - Field(item="70A", name='UNEARNED_SSI', type='number', startIndex=93, endIndex=97, - friendly_name="unearned ssi benefit", - required=True, validators=[ - validators.isInLimits(0, 9999) - ]), - Field(item="70B", name='OTHER_UNEARNED_INCOME', type='number', startIndex=97, endIndex=101, - friendly_name="other unearned income", required=True, validators=[ - validators.isInLimits(0, 9999) - ]) + Field( + item="0", + name='RecordType', + friendly_name="record type", + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="3", + name='RPT_MONTH_YEAR', + friendly_name="reporting month and year", + type='number', + startIndex=2, + endIndex=8, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ] + ), + Field( + item="5", + name='CASE_NUMBER', + friendly_name="case number", + type='string', + startIndex=8, + endIndex=19, + required=True, + validators=[validators.isAlphaNumeric()] + ), + Field( + item="60", + name='FAMILY_AFFILIATION', + friendly_name="family affiliation", + type='number', + startIndex=60, + endIndex=61, + required=True, + validators=[validators.oneOf([1, 2, 4])] + ), + Field( + item="61", + name='DATE_OF_BIRTH', + friendly_name="date of birth", + type='string', + startIndex=61, + endIndex=69, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid(), + ] + ), + TransformField( + transform_func=ssp_ssn_decryption_func, + item="62", + name='SSN', + friendly_name="social security number", + type='string', + startIndex=69, + endIndex=78, + required=True, + is_encrypted=False, + validators=[validators.validateSSN()] + ), + Field( + item="63A", + name='RACE_HISPANIC', + friendly_name="race hispanic", + type='number', + startIndex=78, + endIndex=79, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63B", + name='RACE_AMER_INDIAN', + friendly_name="race american-indian", + type='number', + startIndex=79, + endIndex=80, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63C", + name='RACE_ASIAN', + friendly_name="race asian", + type='number', + startIndex=80, + endIndex=81, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63D", + name='RACE_BLACK', + friendly_name="race black", + type='number', + startIndex=81, + endIndex=82, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63E", + name='RACE_HAWAIIAN', + friendly_name="race hawaiian", + type='number', + startIndex=82, + endIndex=83, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="63F", + name='RACE_WHITE', + friendly_name="race white", + type='number', + startIndex=83, + endIndex=84, + required=False, + validators=[validators.isInLimits(0, 2)] + ), + Field( + item="64", + name='GENDER', + friendly_name="gender", + type='number', + startIndex=84, + endIndex=85, + required=True, + validators=[validators.isInLimits(0, 9)] + ), + Field( + item="65A", + name='RECEIVE_NONSSI_BENEFITS', + friendly_name="receives non-ssi benefit", + type='number', + startIndex=85, + endIndex=86, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="65B", + name='RECEIVE_SSI', + friendly_name="receives ssi", + type='number', + startIndex=86, + endIndex=87, + required=True, + validators=[validators.oneOf([1, 2])] + ), + Field( + item="66", + name='RELATIONSHIP_HOH', + friendly_name="relationship to head of household", + type='number', + startIndex=87, + endIndex=89, + required=False, + validators=[validators.isInLimits(0, 10)] + ), + Field( + item="67", + name='PARENT_MINOR_CHILD', + friendly_name="parent of minor child", + type='number', + startIndex=89, + endIndex=90, + required=False, + validators=[validators.oneOf([0, 2, 3])] + ), + Field( + item="68", + name='EDUCATION_LEVEL', + friendly_name="education level", + type='number', + startIndex=90, + endIndex=92, + required=True, + validators=[ + validators.or_validators( + validators.isInStringRange(0, 16), + validators.isInStringRange(98, 99) + ) + ] + ), + Field( + item="69", + name='CITIZENSHIP_STATUS', + friendly_name="citizenship status", + type='number', + startIndex=92, + endIndex=93, + required=False, + validators=[validators.oneOf([0, 1, 2, 3, 9])] + ), + Field( + item="70A", + name='UNEARNED_SSI', + friendly_name="unearned ssi benefit", + type='number', + startIndex=93, + endIndex=97, + required=True, + validators=[validators.isInLimits(0, 9999)] + ), + Field( + item="70B", + name='OTHER_UNEARNED_INCOME', + friendly_name="other unearned income", + type='number', + startIndex=97, + endIndex=101, + required=True, + validators=[validators.isInLimits(0, 9999)] + ) ] ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py index 00057d1b1..4d8f04f64 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m4.py @@ -99,7 +99,8 @@ required=True, validators=[ validators.or_validators( - validators.isInStringRange(1, 19), validators.matches("99") + validators.isInStringRange(1, 19), + validators.matches("99") ) ], ), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py index c9c72c3cb..b37ad8bda 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m5.py @@ -354,7 +354,8 @@ required=False, validators=[ validators.or_validators( - validators.isInLimits(0, 3), validators.matches(9) + validators.isInLimits(0, 3), + validators.matches(9) ) ], ), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py index 7096ace8e..6f266168b 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/ssp/m6.py @@ -15,50 +15,157 @@ ], postparsing_validators=[ validators.sumIsEqual( - "SSPMOE_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), + "SSPMOE_FAMILIES", [ + "NUM_2_PARENTS", + "NUM_1_PARENTS", + "NUM_NO_PARENTS" + ] + ), validators.sumIsEqual( - "NUM_RECIPIENTS", ["ADULT_RECIPIENTS", "CHILD_RECIPIENTS"]), + "NUM_RECIPIENTS", [ + "ADULT_RECIPIENTS", + "CHILD_RECIPIENTS" + ] + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name='record type', required=True, validators=[]), - Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, - friendly_name='calendar quarter', required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.quarterIsValid()]), - TransformField(calendar_quarter_to_rpt_month_year(0), item="2B", name='RPT_MONTH_YEAR', type='number', - friendly_name='reporting month and year', - startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="3A", name='SSPMOE_FAMILIES', type='number', startIndex=7, endIndex=15, - friendly_name='ssp/moe families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="4A", name='NUM_2_PARENTS', type='number', startIndex=31, endIndex=39, - friendly_name='number of two-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5A", name='NUM_1_PARENTS', type='number', startIndex=55, endIndex=63, - friendly_name='number of one-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6A", name='NUM_NO_PARENTS', type='number', startIndex=79, endIndex=87, - friendly_name='number of no-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7A", name='NUM_RECIPIENTS', type='number', startIndex=103, endIndex=111, - friendly_name='number of recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="8A", name='ADULT_RECIPIENTS', type='number', startIndex=127, endIndex=135, - friendly_name='number of adult recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9A", name='CHILD_RECIPIENTS', type='number', startIndex=151, endIndex=159, - friendly_name='number of child recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10A", name='NONCUSTODIALS', type='number', startIndex=175, endIndex=183, - friendly_name='number of noncustodial parents', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11A", name='AMT_ASSISTANCE', type='number', startIndex=199, endIndex=211, - friendly_name='amount of assistance', - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="12A", name='CLOSED_CASES', type='number', startIndex=235, endIndex=243, - friendly_name='number of closed cases', - required=True, validators=[validators.isInLimits(0, 99999999)]), + Field( + item="0", + name='RecordType', + friendly_name='record type', + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="2", + name='CALENDAR_QUARTER', + friendly_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', + friendly_name='reporting month and year', + type='number', + startIndex=2, + endIndex=7, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid() + ] + ), + Field( + item="3A", + name='SSPMOE_FAMILIES', + friendly_name='ssp/moe families', + type='number', + startIndex=7, + endIndex=15, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="4A", + name='NUM_2_PARENTS', + friendly_name='number of two-parent families', + type='number', + startIndex=31, + endIndex=39, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="5A", + name='NUM_1_PARENTS', + friendly_name='number of one-parent families', + type='number', + startIndex=55, + endIndex=63, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="6A", + name='NUM_NO_PARENTS', + friendly_name='number of no-parent families', + type='number', + startIndex=79, + endIndex=87, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="7A", + name='NUM_RECIPIENTS', + friendly_name='number of recipients', + type='number', + startIndex=103, + endIndex=111, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="8A", + name='ADULT_RECIPIENTS', + friendly_name='number of adult recipients', + type='number', + startIndex=127, + endIndex=135, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="9A", + name='CHILD_RECIPIENTS', + friendly_name='number of child recipients', + type='number', + startIndex=151, + endIndex=159, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="10A", + name='NONCUSTODIALS', + friendly_name='number of noncustodial parents', + type='number', + startIndex=175, + endIndex=183, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="11A", + name='AMT_ASSISTANCE', + friendly_name='amount of assistance', + type='number', + startIndex=199, + endIndex=211, + required=True, + validators=[validators.isInLimits(0, 999999999999)] + ), + Field( + item="12A", + name='CLOSED_CASES', + friendly_name='number of closed cases', + type='number', + startIndex=235, + endIndex=243, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), ], ) @@ -69,52 +176,157 @@ ], postparsing_validators=[ validators.sumIsEqual( - "SSPMOE_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), + "SSPMOE_FAMILIES", [ + "NUM_2_PARENTS", + "NUM_1_PARENTS", + "NUM_NO_PARENTS" + ] + ), validators.sumIsEqual( - "NUM_RECIPIENTS", ["ADULT_RECIPIENTS", "CHILD_RECIPIENTS"]), + "NUM_RECIPIENTS", [ + "ADULT_RECIPIENTS", + "CHILD_RECIPIENTS" + ] + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name='record type', - required=True, validators=[]), - Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, - friendly_name='calendar quarter', - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.quarterIsValid()]), - TransformField(calendar_quarter_to_rpt_month_year(1), item="2B", name='RPT_MONTH_YEAR', type='number', - friendly_name='reporting month and year', - startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="3B", name='SSPMOE_FAMILIES', type='number', startIndex=15, endIndex=23, - friendly_name='ssp/moe families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="4B", name='NUM_2_PARENTS', type='number', startIndex=39, endIndex=47, - friendly_name='number of two-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5B", name='NUM_1_PARENTS', type='number', startIndex=63, endIndex=71, - friendly_name='number of one-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6B", name='NUM_NO_PARENTS', type='number', startIndex=87, endIndex=95, - friendly_name='number of no-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7B", name='NUM_RECIPIENTS', type='number', startIndex=111, endIndex=119, - friendly_name='number of recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="8B", name='ADULT_RECIPIENTS', type='number', startIndex=135, endIndex=143, - friendly_name='number of adult recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9B", name='CHILD_RECIPIENTS', type='number', startIndex=159, endIndex=167, - friendly_name='number of child recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10B", name='NONCUSTODIALS', type='number', startIndex=183, endIndex=191, - friendly_name='number of noncustodial parents', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11B", name='AMT_ASSISTANCE', type='number', startIndex=211, endIndex=223, - friendly_name='amount of assistance', - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="12B", name='CLOSED_CASES', type='number', startIndex=243, endIndex=251, - friendly_name='number of closed cases', - required=True, validators=[validators.isInLimits(0, 99999999)]), + Field( + item="0", + name='RecordType', + friendly_name='record type', + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="2", + name='CALENDAR_QUARTER', + friendly_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', + friendly_name='reporting month and year', + type='number', + startIndex=2, + endIndex=7, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid() + ] + ), + Field( + item="3B", + name='SSPMOE_FAMILIES', + friendly_name='ssp/moe families', + type='number', + startIndex=15, + endIndex=23, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="4B", + name='NUM_2_PARENTS', + friendly_name='number of two-parent families', + type='number', + startIndex=39, + endIndex=47, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="5B", + name='NUM_1_PARENTS', + friendly_name='number of one-parent families', + type='number', + startIndex=63, + endIndex=71, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="6B", + name='NUM_NO_PARENTS', + friendly_name='number of no-parent families', + type='number', + startIndex=87, + endIndex=95, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="7B", + name='NUM_RECIPIENTS', + friendly_name='number of recipients', + type='number', + startIndex=111, + endIndex=119, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="8B", + name='ADULT_RECIPIENTS', + friendly_name='number of adult recipients', + type='number', + startIndex=135, + endIndex=143, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="9B", + name='CHILD_RECIPIENTS', + friendly_name='number of child recipients', + type='number', + startIndex=159, + endIndex=167, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="10B", + name='NONCUSTODIALS', + friendly_name='number of noncustodial parents', + type='number', + startIndex=183, + endIndex=191, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="11B", + name='AMT_ASSISTANCE', + friendly_name='amount of assistance', + type='number', + startIndex=211, + endIndex=223, + required=True, + validators=[validators.isInLimits(0, 999999999999)] + ), + Field( + item="12B", + name='CLOSED_CASES', + friendly_name='number of closed cases', + type='number', + startIndex=243, + endIndex=251, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), ], ) @@ -125,52 +337,157 @@ ], postparsing_validators=[ validators.sumIsEqual( - "SSPMOE_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"]), + "SSPMOE_FAMILIES", [ + "NUM_2_PARENTS", + "NUM_1_PARENTS", + "NUM_NO_PARENTS" + ] + ), validators.sumIsEqual( - "NUM_RECIPIENTS", ["ADULT_RECIPIENTS", "CHILD_RECIPIENTS"]), + "NUM_RECIPIENTS", [ + "ADULT_RECIPIENTS", + "CHILD_RECIPIENTS" + ] + ), ], fields=[ - Field(item="0", name='RecordType', type='string', startIndex=0, endIndex=2, - friendly_name='record type', - required=True, validators=[]), - Field(item="2", name='CALENDAR_QUARTER', type='number', startIndex=2, endIndex=7, - friendly_name='calendar quarter', - required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.quarterIsValid()]), - TransformField(calendar_quarter_to_rpt_month_year(2), item="2B", name='RPT_MONTH_YEAR', type='number', - friendly_name='reporting month and year', - startIndex=2, endIndex=7, required=True, validators=[validators.dateYearIsLargerThan(1998), - validators.dateMonthIsValid()]), - Field(item="3C", name='SSPMOE_FAMILIES', type='number', startIndex=23, endIndex=31, - friendly_name='ssp/moe families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="4C", name='NUM_2_PARENTS', type='number', startIndex=47, endIndex=55, - friendly_name='number of two-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="5C", name='NUM_1_PARENTS', type='number', startIndex=71, endIndex=79, - friendly_name='number of one-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="6C", name='NUM_NO_PARENTS', type='number', startIndex=95, endIndex=103, - friendly_name='number of no-parent families', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="7C", name='NUM_RECIPIENTS', type='number', startIndex=119, endIndex=127, - friendly_name='number of recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="8C", name='ADULT_RECIPIENTS', type='number', startIndex=143, endIndex=151, - friendly_name='number of adult recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="9C", name='CHILD_RECIPIENTS', type='number', startIndex=167, endIndex=175, - friendly_name='number of child recipients', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="10C", name='NONCUSTODIALS', type='number', startIndex=191, endIndex=199, - friendly_name='number of noncustodial parents', - required=True, validators=[validators.isInLimits(0, 99999999)]), - Field(item="11C", name='AMT_ASSISTANCE', type='number', startIndex=223, endIndex=235, - friendly_name='amount of assistance', - required=True, validators=[validators.isInLimits(0, 999999999999)]), - Field(item="12C", name='CLOSED_CASES', type='number', startIndex=251, endIndex=259, - friendly_name='number of closed cases', - required=True, validators=[validators.isInLimits(0, 99999999)]), + Field( + item="0", + name='RecordType', + friendly_name='record type', + type='string', + startIndex=0, + endIndex=2, + required=True, + validators=[] + ), + Field( + item="2", + name='CALENDAR_QUARTER', + friendly_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', + friendly_name='reporting month and year', + type='number', + startIndex=2, + endIndex=7, + required=True, + validators=[ + validators.dateYearIsLargerThan(1998), + validators.dateMonthIsValid() + ] + ), + Field( + item="3C", + name='SSPMOE_FAMILIES', + friendly_name='ssp/moe families', + type='number', + startIndex=23, + endIndex=31, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="4C", + name='NUM_2_PARENTS', + friendly_name='number of two-parent families', + type='number', + startIndex=47, + endIndex=55, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="5C", + name='NUM_1_PARENTS', + friendly_name='number of one-parent families', + type='number', + startIndex=71, + endIndex=79, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="6C", + name='NUM_NO_PARENTS', + friendly_name='number of no-parent families', + type='number', + startIndex=95, + endIndex=103, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="7C", + name='NUM_RECIPIENTS', + friendly_name='number of recipients', + type='number', + startIndex=119, + endIndex=127, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="8C", + name='ADULT_RECIPIENTS', + friendly_name='number of adult recipients', + type='number', + startIndex=143, + endIndex=151, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="9C", + name='CHILD_RECIPIENTS', + friendly_name='number of child recipients', + type='number', + startIndex=167, + endIndex=175, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="10C", + name='NONCUSTODIALS', + friendly_name='number of noncustodial parents', + type='number', + startIndex=191, + endIndex=199, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), + Field( + item="11C", + name='AMT_ASSISTANCE', + friendly_name='amount of assistance', + type='number', + startIndex=223, + endIndex=235, + required=True, + validators=[validators.isInLimits(0, 999999999999)] + ), + Field( + item="12C", + name='CLOSED_CASES', + friendly_name='number of closed cases', + type='number', + startIndex=251, + endIndex=259, + required=True, + validators=[validators.isInLimits(0, 99999999)] + ), ], ) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py index 64c750a22..76ce8f0f5 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t1.py @@ -419,7 +419,7 @@ Field( item="23B", name="TRANSP_NBR_MONTHS", - friendly_name="transportation number of months", + friendly_name="transportation - number of months", type="number", startIndex=75, endIndex=78, @@ -443,7 +443,7 @@ Field( item="24B", name="TRANSITION_NBR_MONTHS", - friendly_name="transition services number of months", + friendly_name="transition services - number of months", type="number", startIndex=82, endIndex=85, @@ -467,7 +467,7 @@ Field( item="25B", name="OTHER_NBR_MONTHS", - friendly_name="other number of months", + friendly_name="other - number of months", type="number", startIndex=89, endIndex=92, @@ -551,7 +551,7 @@ Field( item="26AVII", name="OTHER_SANCTION", - friendly_name="other, sanction", + friendly_name="other sanction", type="number", startIndex=101, endIndex=102, @@ -611,7 +611,7 @@ Field( item="26CIV", name="OTHER_NON_SANCTION", - friendly_name="other, non-sanction", + friendly_name="other non-sanction", type="number", startIndex=112, endIndex=113, @@ -630,7 +630,8 @@ required=False, validators=[ validators.or_validators( - validators.matches("9"), validators.isEmpty() + validators.matches("9"), + validators.isEmpty() ), validators.isAlphaNumeric(), ], diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 2725af62c..441795ca1 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -305,7 +305,8 @@ required=True, validators=[ validators.or_validators( - validators.oneOf(["1", "2"]), validators.isBlank() + validators.oneOf(["1", "2"]), + validators.isBlank() ) ], ), @@ -594,7 +595,7 @@ Field( item="55A", name="JOB_SEARCH_HOP", - friendly_name="job search hours of participation", + friendly_name="job search - hours of participation", type="string", startIndex=84, endIndex=86, @@ -606,7 +607,7 @@ Field( item="55B", name="JOB_SEARCH_EA", - friendly_name="job search excused absence", + friendly_name="job search - excused absence", type="string", startIndex=86, endIndex=88, @@ -630,7 +631,7 @@ Field( item="56A", name="COMM_SERVICES_HOP", - friendly_name="community service hours of participation", + friendly_name="community service - hours of participation", type="string", startIndex=90, endIndex=92, @@ -642,7 +643,7 @@ Field( item="56B", name="COMM_SERVICES_EA", - friendly_name="community service excused absence", + friendly_name="community service - excused absence", type="string", startIndex=92, endIndex=94, @@ -654,7 +655,7 @@ Field( item="56C", name="COMM_SERVICES_HOL", - friendly_name="community service hours of leave", + friendly_name="community service - hours of leave", type="string", startIndex=94, endIndex=96, @@ -666,7 +667,7 @@ Field( item="57A", name="VOCATIONAL_ED_TRAINING_HOP", - friendly_name="vocational education training hours of participation", + friendly_name="vocational education training - hours of participation", type="string", startIndex=96, endIndex=98, @@ -678,7 +679,7 @@ Field( item="57B", name="VOCATIONAL_ED_TRAINING_EA", - friendly_name="vocational education training excused absence", + friendly_name="vocational education training - excused absence", type="string", startIndex=98, endIndex=100, @@ -690,7 +691,7 @@ Field( item="57C", name="VOCATIONAL_ED_TRAINING_HOL", - friendly_name="vocational education training hours of leave", + friendly_name="vocational education training - hours of leave", type="string", startIndex=100, endIndex=102, @@ -702,7 +703,7 @@ Field( item="58A", name="JOB_SKILLS_TRAINING_HOP", - friendly_name="job skills training hours of participation", + friendly_name="job skills training - hours of participation", type="string", startIndex=102, endIndex=104, @@ -714,7 +715,7 @@ Field( item="58B", name="JOB_SKILLS_TRAINING_EA", - friendly_name="job skills training excused absence", + friendly_name="job skills training - excused absence", type="string", startIndex=104, endIndex=106, @@ -726,7 +727,7 @@ Field( item="58C", name="JOB_SKILLS_TRAINING_HOL", - friendly_name="job skills training hours of leave", + friendly_name="job skills training - hours of leave", type="string", startIndex=106, endIndex=108, @@ -738,7 +739,7 @@ Field( item="59A", name="ED_NO_HIGH_SCHOOL_DIPL_HOP", - friendly_name="education no high school diploma hours of participation", + friendly_name="education no high school diploma - hours of participation", type="string", startIndex=108, endIndex=110, @@ -750,7 +751,7 @@ Field( item="59B", name="ED_NO_HIGH_SCHOOL_DIPL_EA", - friendly_name="education no high school diploma excused absence", + friendly_name="education no high school diploma - excused absence", type="string", startIndex=110, endIndex=112, @@ -774,7 +775,7 @@ Field( item="60A", name="SCHOOL_ATTENDENCE_HOP", - friendly_name="school attendance hours of participation", + friendly_name="school attendance - hours of participation", type="string", startIndex=114, endIndex=116, @@ -786,7 +787,7 @@ Field( item="60B", name="SCHOOL_ATTENDENCE_EA", - friendly_name="school attendance excused absence", + friendly_name="school attendance - excused absence", type="string", startIndex=116, endIndex=118, @@ -810,7 +811,7 @@ Field( item="61A", name="PROVIDE_CC_HOP", - friendly_name="provide child care hours of participation", + friendly_name="provide child care - hours of participation", type="string", startIndex=120, endIndex=122, @@ -822,7 +823,7 @@ Field( item="61B", name="PROVIDE_CC_EA", - friendly_name="provide child care excused absence", + friendly_name="provide child care - excused absence", type="string", startIndex=122, endIndex=124, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py index ea5d65e6c..f91217ccd 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t3.py @@ -578,7 +578,8 @@ required=True, validators=[ validators.or_validators( - validators.isInStringRange(0, 16), validators.oneOf(["98", "99"]) + validators.isInStringRange(0, 16), + validators.oneOf(["98", "99"]) ) ], ), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py index 71427fa34..1a5a13c54 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t4.py @@ -100,7 +100,8 @@ required=True, validators=[ validators.or_validators( - validators.isInStringRange(1, 19), validators.matches("99") + validators.isInStringRange(1, 19), + validators.matches("99") ) ], ), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py index 63250181c..120c9389e 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t5.py @@ -355,7 +355,8 @@ required=True, validators=[ validators.or_validators( - validators.isInLimits(0, 2), validators.matches(9) + validators.isInLimits(0, 2), + validators.matches(9) ) ], ), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py index 215039fa4..77925781a 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t6.py @@ -15,12 +15,24 @@ validators.hasLength(379), ], postparsing_validators=[ - validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), validators.sumIsEqual( - "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + "NUM_APPLICATIONS", [ + "NUM_APPROVED", + "NUM_DENIED" + ] ), validators.sumIsEqual( - "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + "NUM_FAMILIES", [ + "NUM_2_PARENTS", + "NUM_1_PARENTS", + "NUM_NO_PARENTS" + ] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", [ + "NUM_ADULT_RECIPIENTS", + "NUM_CHILD_RECIPIENTS" + ] ), ], fields=[ @@ -134,7 +146,7 @@ Field( item="11A", name="NUM_NO_PARENTS", - friendly_name="total number of no parent families", + friendly_name="total number of no-parent families", type="number", startIndex=187, endIndex=195, @@ -220,12 +232,24 @@ validators.hasLength(379), ], postparsing_validators=[ - validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), validators.sumIsEqual( - "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + "NUM_APPLICATIONS", [ + "NUM_APPROVED", + "NUM_DENIED" + ] + ), + validators.sumIsEqual( + "NUM_FAMILIES", [ + "NUM_2_PARENTS", + "NUM_1_PARENTS", + "NUM_NO_PARENTS" + ] ), validators.sumIsEqual( - "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + "NUM_RECIPIENTS", [ + "NUM_ADULT_RECIPIENTS", + "NUM_CHILD_RECIPIENTS" + ] ), ], fields=[ @@ -419,12 +443,24 @@ validators.hasLength(379), ], postparsing_validators=[ - validators.sumIsEqual("NUM_APPLICATIONS", ["NUM_APPROVED", "NUM_DENIED"]), validators.sumIsEqual( - "NUM_FAMILIES", ["NUM_2_PARENTS", "NUM_1_PARENTS", "NUM_NO_PARENTS"] + "NUM_APPLICATIONS", [ + "NUM_APPROVED", + "NUM_DENIED" + ] ), validators.sumIsEqual( - "NUM_RECIPIENTS", ["NUM_ADULT_RECIPIENTS", "NUM_CHILD_RECIPIENTS"] + "NUM_FAMILIES", [ + "NUM_2_PARENTS", + "NUM_1_PARENTS", + "NUM_NO_PARENTS" + ] + ), + validators.sumIsEqual( + "NUM_RECIPIENTS", [ + "NUM_ADULT_RECIPIENTS", + "NUM_CHILD_RECIPIENTS" + ] ), ], fields=[ @@ -522,7 +558,7 @@ Field( item="10C", name="NUM_1_PARENTS", - friendly_name="total number of one parent families", + friendly_name="total number of one-parent families", type="number", startIndex=179, endIndex=187, @@ -532,7 +568,7 @@ Field( item="11C", name="NUM_NO_PARENTS", - friendly_name="total number of no parent families", + friendly_name="total number of no-parent families", type="number", startIndex=203, endIndex=211, From 55ce817c9da934c2eefd84b62bf783de98822aab Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Mon, 11 Dec 2023 10:45:40 -0700 Subject: [PATCH 76/88] - knowledge center --- .../knowledge-center/FTANF_2009.zip | Bin 18951206 -> 18951204 bytes .../knowledge-center/SSPMOE_2009.zip | Bin 18669401 -> 18669399 bytes product-updates/knowledge-center/ftanf.zip | Bin 18639641 -> 18639640 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/product-updates/knowledge-center/FTANF_2009.zip b/product-updates/knowledge-center/FTANF_2009.zip index 763a09a1e534c26eb8a38ee8b0e9d02444f03ebf..f148fef1d189e560e5b7035df8b1f75a795a59c6 100644 GIT binary patch delta 1189 zcmWmA`G3!K0KoCb%x2%&W{1t#m>iYR;i^=U4Mm4i6xF7YBVBZ#=rgNU)S~I_Xe(zJGYW{(#r~#wa$AX;D(tBub8&Mk!Hh)GSJ?iG9LPZ&OcxHJE8XbMp&Z8H z96=9y(u>~o;Yg0+X!>#t$8sF~IG+BTzyL}qV<3YV%!!=D5QcIxr*JB#F^tnWgW;UX zS&U#LXLAmt7|pqy$N7{~!5A(eydKLqE@V6tn8+k9Vlo$V372vimotT_T)~xG#noKH zwOq&b+`x_8#LY}&Iy1P1h$?1M&8^(V?bL7wcQT7w?&5Cl;a+Alhx@pn2Y8T&c$i0c zl*f3SCwP*%JjFboW6qiD_F@Y-sT|!@R^9#T78^7}hd)UjL{Ken=!#@7yKmMCOq9NDq3_i<3B+Q#h60^r0{P=+6L7<8;p8Oa?NDvpAb`7|gj0 zVJO2G&Im?w9-}y)(Of_o7jh97Q_dJJ;ZiPRESGZyS2B*P7|#SIay650F&gWI`-nN)KpvzSc{cQJ>%xrckXkNbIm2YHBxd4xxK zjJZ6{Jf7f5o?<==sO4!EvWRDRmgjh$#Vp|kmhvJmQOCz$zDl1sYYs<^Z>np4L zx~aLIRW$HAZ}28>@iy;$uEx9iQ?UpYsJ@@)eDI&3eA!TQ;zf zO*FBY@A#e{_>nFAL^E62#&&+@7k03dU-^w){LXIv;7|VIZ~oz5{$me&*~k9srsh}; zA#ow`AuU2$h9rcv3P}t}3P}!W9g-4~8j=>09?~WxBP25$` WVMtL(aY#u>yI4b0b7`zk@BaZE`Cmo= diff --git a/product-updates/knowledge-center/SSPMOE_2009.zip b/product-updates/knowledge-center/SSPMOE_2009.zip index 94458c7a082e9f54eb03119d7bf1ca69111aeda9..b67f67043ba908cac89381172e86a17b110576ac 100644 GIT binary patch delta 1170 zcmWmA_n+5u0KoCb_wKsYjc!!8tV$X>TSllzq@qC-g)4HnuXWiv^--u?QAQK(q*9md zjs^`g>RcHqo2<(!*LW(G+go8MkLpYSfXhmza$lQ@}EIF&A(#_60vSGv)iGdYVMoJ~*8;aqxg9=+*9U(V+O`q7^O4CF#C zVh|T|34EMhTBc!s4s%QBX;g6CMtDr#8G^Sr=|yu{1A!mGSSEp@!k8?0e1 z>sZg5yu}7KvWd;S%{#oyd%VvFY~e#bVk_II=VKb!&JI4|Q$FK!cJc+g*v*%G#n*hp zw|vL<{J@Xw;U|9P7k=e88rjS5{K236#oz2>KmYJA|8ZbKyew8ttS(-b5Ub6pF0D+6 zNn%J+NRyD{kd% z6kF+Zr-S6`R46J}&OASVJYRpj|9@|+*q6A8k|-9%MOC7zQGApTRf`hKlZpyrsbh-@ zl1L_n>V&NZY1Aa03~EuEI%JYXHg(A%mwKGSsnq8*8qko_IfF(trU_?q7EQ?`pR;Mk zIh@ORH0OL;Z~-m3kc+sOOK3%F+HfgtX~$)>=W?##O0J><9l4roxR&eaL}$9tmFwxo z4ctg~ZsKNoa0|C`8@F=@J-L%!+{N7#(3?K=r62tnKp_LUhd~rEn0vX8A>7YUig|!x zJjg=~X9Od8m{B}J38Q(G$A}oi9<`;hD zH+Jwlf3TBX?B-AYVh?-yn}7J1eeCA|2RX!l9Oei|ImU5L@PDa;ml3NhDu|0!q{mXr z@{8kQQYEBnNPI{_NVSl}kff00kd%<>A*mrXLefHNhNOpNgwzVD9a1MGGbAe{JEU$% PPDpO7GQYT9EU)k+Vm=biZ8(m$wBvZ%a{?VW zk(201Cr;)RPNg%aaXM$vg|3`QH_oCvXVZh8oI@{q(}#08kMrqEKQ7=x`g0Kj7)U8) zT+Ah0${+@F8JBYfLm0}HTt(RWYOdj0uH$-c;6`rZW^UnDhH)FWa|gp2!JXX2-Q2@S z?qw9C8N*oaqk?ga=YAq4Fp)|g;6Wx)#X~&IBUJM!k1?4kJkAq5$y3xYm8Y4;bY?J< zSl%H-eL{) ztYsZKU7KI9`l<`X_;6Q9w*=WON+zT_*mu$8ab#y5P+cYM!wcJKo` z*~M=5@FPF*Gke*`FEsKi`}vLE`GY_Civ#@4Km5yo9OVD1vhtW}LSjSWLgGUbLJ~ug zLXtyLLQ+H0LefJrLNY_LLYjnRhvbAb4ap733&{^D2q_FH3MmdLiK%l9G4)A@0KM1e A1poj5 delta 1165 zcmWmESG>=49LMp;|2TU($Jr+;MOF!EXeVhJTloQ#mw5!}ELbd|iC*-=FIGhU6)fN3kd_Y81ss2~lE{6eZWBl$OOZDoV>z zNF|MQ!Yz|58k0>9O~@sWdaE{9Ln~U-hPJfhSdODT z$J2q1bm9a$b0Q~kGN;gmQ#p;(IfFAfi?cb0uAECZ&Z9f$a{(7}5k2V1#azOr^rAO? zxQtTz(vSWO;Bp2sh%2~~!Cb}FTtgW{7|Jk)GlG#^%P6kndT!uGMspK4a|^d}8@F=@ zV;IYw+{NA8!@b-`IrsAb4-)YZtL>CE6IUS=k?yZDB0 z`Ht`TfgkyapV`eX{K{|ap@F^Z<9GhxPyS**e{+C?{KLQe$N!ZEUPVY;NTZPWkc5!L zkff00kd% Date: Mon, 11 Dec 2023 11:08:32 -0700 Subject: [PATCH 77/88] - Integrating Jans changes. Parametrizing values_is_empty --- tdrs-backend/tdpservice/parsers/parse.py | 2 +- tdrs-backend/tdpservice/parsers/util.py | 4 ---- tdrs-backend/tdpservice/parsers/validators.py | 15 ++++++++------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/parse.py b/tdrs-backend/tdpservice/parsers/parse.py index a6cb20764..dbe80980b 100644 --- a/tdrs-backend/tdpservice/parsers/parse.py +++ b/tdrs-backend/tdpservice/parsers/parse.py @@ -46,7 +46,7 @@ def parse_datafile(datafile): return errors is_encrypted = field_values["encryption"] == "E" - is_tribal = util.is_string_field_valid(field_values["tribe_code"], 3) + is_tribal = not validators.value_is_empty(field_values["tribe_code"], 3, extra_vals={'0'*3}) logger.debug(f"Datafile has encrypted fields: {is_encrypted}.") logger.debug(f"Datafile: {datafile.__repr__()}, is Tribal: {is_tribal}.") diff --git a/tdrs-backend/tdpservice/parsers/util.py b/tdrs-backend/tdpservice/parsers/util.py index 49424c282..685fdc59e 100644 --- a/tdrs-backend/tdpservice/parsers/util.py +++ b/tdrs-backend/tdpservice/parsers/util.py @@ -110,10 +110,6 @@ def update_encrypted_fields(self, is_encrypted): if type(field) == TransformField and "is_encrypted" in field.kwargs: field.kwargs['is_encrypted'] = is_encrypted -def is_string_field_valid(val, field_length): - """Determine if the field's value is valid.""" - return val not in {" "*field_length, None, "0"*field_length} - def get_schema_options(program, section, query=None, model=None, model_name=None): """Centralized function to return the appropriate schema for a given program, section, and query. diff --git a/tdrs-backend/tdpservice/parsers/validators.py b/tdrs-backend/tdpservice/parsers/validators.py index e1bd8fa10..e7c2257cc 100644 --- a/tdrs-backend/tdpservice/parsers/validators.py +++ b/tdrs-backend/tdpservice/parsers/validators.py @@ -1,21 +1,22 @@ """Generic parser validator functions for use in schema definitions.""" from .models import ParserErrorCategoryChoices -from .util import is_string_field_valid from datetime import date import logging logger = logging.getLogger(__name__) -def value_is_empty(value, length): +def value_is_empty(value, length, extra_vals={}): """Handle 'empty' values as field inputs.""" - empty_values = [ + empty_values = { '', ' '*length, # ' ' '#'*length, # '#####' '_'*length, # '_____' - ] + } + + empty_values = empty_values.union(extra_vals) return value is None or value in empty_values @@ -554,10 +555,10 @@ def validate_tribe_fips_program_agree(program_type, tribe_code, state_fips_code, """Validate tribe code, fips code, and program type all agree with eachother.""" is_valid = False - if program_type == 'TAN' and (not is_string_field_valid(state_fips_code, 2)): - is_valid = is_string_field_valid(tribe_code, 3) + if program_type == 'TAN' and value_is_empty(state_fips_code, 2, extra_vals={'0'*2}): + is_valid = not value_is_empty(tribe_code, 3, extra_vals={'0'*3}) else: - is_valid = not is_string_field_valid(tribe_code, 3) + is_valid = value_is_empty(tribe_code, 3, extra_vals={'0'*3}) error = None if not is_valid: From 06ca2ab6813baa0e293395b422289e0d53aa3469 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Wed, 20 Dec 2023 11:10:32 -0700 Subject: [PATCH 78/88] - Update based on review feedback --- .../parsers/schema_defs/tribal_tanf/t2.py | 6 +- .../parsers/schema_defs/tribal_tanf/t3.py | 72 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 41a1c4523..02b84f1a7 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -307,7 +307,7 @@ endIndex=49, required=False, validators=[ - validators.isLargerThanOrEqualTo(0), + validators.isInLimits(0, 2), ], ), Field( @@ -367,7 +367,7 @@ endIndex=55, required=False, validators=[ - validators.isInLimits(0, 9), + validators.isInLimits(0, 2), ], ), Field( @@ -440,7 +440,7 @@ endIndex=65, required=False, validators=[ - validators.isInLimits(0, 9), + validators.isInLimits(0, 2), ], ), Field( diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index 7aba4ba08..2b54b7144 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -120,7 +120,7 @@ validators=[validators.isAlphaNumeric()], ), Field( - item="67", + item="66", name="FAMILY_AFFILIATION", friendly_name="family affiliation", type="number", @@ -130,7 +130,7 @@ validators=[validators.oneOf([1, 2, 4])], ), Field( - item="68", + item="67", name="DATE_OF_BIRTH", friendly_name="date of birth", type="number", @@ -144,7 +144,7 @@ ), TransformField( transform_func=tanf_ssn_decryption_func, - item="69", + item="68", name="SSN", friendly_name="social security number - ssn", type="string", @@ -155,7 +155,7 @@ is_encrypted=False, ), Field( - item="70A", + item="69A", name="RACE_HISPANIC", friendly_name="race hispanic", type="number", @@ -165,7 +165,7 @@ validators=[validators.validateRace()], ), Field( - item="70B", + item="69B", name="RACE_AMER_INDIAN", friendly_name="race american indian", type="number", @@ -175,7 +175,7 @@ validators=[validators.validateRace()], ), Field( - item="70C", + item="69C", name="RACE_ASIAN", friendly_name="race asian", type="number", @@ -185,7 +185,7 @@ validators=[validators.validateRace()], ), Field( - item="70D", + item="69D", name="RACE_BLACK", friendly_name="race black", type="number", @@ -195,7 +195,7 @@ validators=[validators.validateRace()], ), Field( - item="70E", + item="69E", name="RACE_HAWAIIAN", friendly_name="race hawaiian", type="number", @@ -205,7 +205,7 @@ validators=[validators.validateRace()], ), Field( - item="70F", + item="69F", name="RACE_WHITE", friendly_name="race white", type="number", @@ -215,7 +215,7 @@ validators=[validators.validateRace()], ), Field( - item="71", + item="70", name="GENDER", friendly_name="gender", type="number", @@ -225,7 +225,7 @@ validators=[validators.isInLimits(0, 9)], ), Field( - item="72A", + item="71A", name="RECEIVE_NONSSA_BENEFITS", friendly_name="receives non-social security act benefits", type="number", @@ -235,7 +235,7 @@ validators=[validators.oneOf([1, 2])], ), Field( - item="72B", + item="71B", name="RECEIVE_SSI", friendly_name="receives social security income", type="number", @@ -245,7 +245,7 @@ validators=[validators.oneOf([1, 2])], ), Field( - item="73", + item="72", name="RELATIONSHIP_HOH", friendly_name="relationship to head of household", type="string", @@ -255,7 +255,7 @@ validators=[validators.isInStringRange(0, 10)], ), Field( - item="74", + item="73", name="PARENT_MINOR_CHILD", friendly_name="parent of minor child", type="number", @@ -265,7 +265,7 @@ validators=[validators.oneOf([0, 2, 3])], ), Field( - item="75", + item="74", name="EDUCATION_LEVEL", friendly_name="education level", type="string", @@ -280,7 +280,7 @@ ], ), Field( - item="76", + item="75", name="CITIZENSHIP_STATUS", friendly_name="citizenship status", type="number", @@ -290,7 +290,7 @@ validators=[validators.oneOf([0, 1, 2, 9])], ), Field( - item="77A", + item="76A", name="UNEARNED_SSI", friendly_name="unearned ssi benefit", type="string", @@ -300,7 +300,7 @@ validators=[validators.isInStringRange(0, 9999)], ), Field( - item="77B", + item="76B", name="OTHER_UNEARNED_INCOME", friendly_name="other unearned income", type="string", @@ -424,7 +424,7 @@ validators=[validators.isAlphaNumeric()], ), Field( - item="67", + item="66", name="FAMILY_AFFILIATION", friendly_name="family affiliation", type="number", @@ -434,7 +434,7 @@ validators=[validators.oneOf([1, 2, 4])], ), Field( - item="68", + item="67", name="DATE_OF_BIRTH", friendly_name="date of birth", type="number", @@ -448,7 +448,7 @@ ), TransformField( transform_func=tanf_ssn_decryption_func, - item="69", + item="68", name="SSN", friendly_name="social security number - ssn", type="string", @@ -459,7 +459,7 @@ is_encrypted=False, ), Field( - item="70A", + item="69A", name="RACE_HISPANIC", friendly_name="race hispanic", type="number", @@ -469,7 +469,7 @@ validators=[validators.validateRace()], ), Field( - item="70B", + item="69B", name="RACE_AMER_INDIAN", friendly_name="race american indian", type="number", @@ -479,7 +479,7 @@ validators=[validators.validateRace()], ), Field( - item="70C", + item="69C", name="RACE_ASIAN", friendly_name="race asian", type="number", @@ -489,7 +489,7 @@ validators=[validators.validateRace()], ), Field( - item="70D", + item="69D", name="RACE_BLACK", friendly_name="race black", type="number", @@ -499,7 +499,7 @@ validators=[validators.validateRace()], ), Field( - item="70E", + item="69E", name="RACE_HAWAIIAN", friendly_name="race hawaiian", type="number", @@ -509,7 +509,7 @@ validators=[validators.validateRace()], ), Field( - item="70F", + item="69F", name="RACE_WHITE", friendly_name="race white", type="number", @@ -519,7 +519,7 @@ validators=[validators.validateRace()], ), Field( - item="71", + item="70", name="GENDER", friendly_name="gender", type="number", @@ -529,7 +529,7 @@ validators=[validators.isInLimits(0, 9)], ), Field( - item="72A", + item="71A", name="RECEIVE_NONSSA_BENEFITS", friendly_name="receives non-ssa benefits", type="number", @@ -539,7 +539,7 @@ validators=[validators.oneOf([1, 2])], ), Field( - item="72B", + item="71B", name="RECEIVE_SSI", friendly_name="receives social security income", type="number", @@ -549,7 +549,7 @@ validators=[validators.oneOf([1, 2])], ), Field( - item="73", + item="72", name="RELATIONSHIP_HOH", friendly_name="relationship to head of household", type="string", @@ -559,7 +559,7 @@ validators=[validators.isInStringRange(0, 10)], ), Field( - item="74", + item="73", name="PARENT_MINOR_CHILD", friendly_name="parent of minor child", type="number", @@ -569,7 +569,7 @@ validators=[validators.oneOf([0, 2, 3])], ), Field( - item="75", + item="74", name="EDUCATION_LEVEL", friendly_name="education level", type="string", @@ -583,7 +583,7 @@ ], ), Field( - item="76", + item="75", name="CITIZENSHIP_STATUS", friendly_name="citizenship status", type="number", @@ -593,7 +593,7 @@ validators=[validators.oneOf([0, 1, 2, 9])], ), Field( - item="77A", + item="76A", name="UNEARNED_SSI", friendly_name="unearned ssi benefit", type="string", @@ -603,7 +603,7 @@ validators=[validators.isInStringRange(0, 9999)], ), Field( - item="77B", + item="76B", name="OTHER_UNEARNED_INCOME", friendly_name="other unearned income", type="string", From bce13b4b9cfb26aadbf6e2c0b33ee4a9f0b66dbf Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Thu, 21 Dec 2023 13:01:06 -0700 Subject: [PATCH 79/88] - Updated length checks --- .../tdpservice/parsers/schema_defs/tribal_tanf/t1.py | 2 +- .../tdpservice/parsers/schema_defs/tribal_tanf/t2.py | 2 +- .../tdpservice/parsers/schema_defs/tribal_tanf/t3.py | 2 ++ .../tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py index e09e61f19..fc228b118 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py @@ -12,7 +12,7 @@ RowSchema( model=Tribal_TANF_T1, preparsing_validators=[ - validators.hasLength(123), + validators.hasLength(122), ], postparsing_validators=[ validators.if_then_validator( diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 02b84f1a7..6f6d124ab 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -14,7 +14,7 @@ RowSchema( model=Tribal_TANF_T2, preparsing_validators=[ - validators.hasLength(123), + validators.hasLength(122), ], postparsing_validators=[ validators.validate__FAM_AFF__SSN(), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index 2b54b7144..129ede311 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -13,6 +13,7 @@ model=Tribal_TANF_T3, preparsing_validators=[ validators.notEmpty(start=19, end=60), + validators.hasLength(122), ], postparsing_validators=[ validators.if_then_validator( @@ -317,6 +318,7 @@ quiet_preparser_errors=True, preparsing_validators=[ validators.notEmpty(start=60, end=101), + validators.hasLength(122), ], postparsing_validators=[ validators.if_then_validator( 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 5fa1ab095..c5de5c6a7 100644 --- a/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 +++ b/tdrs-backend/tdpservice/parsers/test/data/ADS.E2J.FTP1.TS142 @@ -1,5 +1,5 @@ HEADER20214A00142TAN1EU -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 +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 TRAILER0000003 From 7152df2f9192919930da4b8bda13f0f6d2f41341 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Thu, 28 Dec 2023 10:59:00 -0700 Subject: [PATCH 80/88] - removing fips code --- tdrs-backend/tdpservice/search_indexes/models/tribal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tdrs-backend/tdpservice/search_indexes/models/tribal.py b/tdrs-backend/tdpservice/search_indexes/models/tribal.py index 710a08458..92c328d4a 100644 --- a/tdrs-backend/tdpservice/search_indexes/models/tribal.py +++ b/tdrs-backend/tdpservice/search_indexes/models/tribal.py @@ -28,7 +28,6 @@ class Tribal_TANF_T1(models.Model): RecordType = models.CharField(max_length=156, null=True, blank=False) RPT_MONTH_YEAR = models.IntegerField(null=True, blank=False) CASE_NUMBER = models.CharField(max_length=11, null=True, blank=False) - FIPS_CODE = models.CharField(max_length=2, null=True, blank=False) COUNTY_FIPS_CODE = models.CharField( max_length=3, null=True, From e84b01fd1f3142f23c963963f4043ebc9e1d95f2 Mon Sep 17 00:00:00 2001 From: Eric Lipe <125676261+elipe17@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:02:26 -0700 Subject: [PATCH 81/88] Update tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py Co-authored-by: Alex P. <63075587+ADPennington@users.noreply.github.com> --- tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 6f6d124ab..5f88bf674 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -343,7 +343,7 @@ endIndex=53, required=True, validators=[ - validators.isInStringRange(1, 10), + validators.isInStringRange(0, 10), ], ), Field( From 5e29f462769febc6874fdeca7db0784b665761fa Mon Sep 17 00:00:00 2001 From: Eric Lipe <125676261+elipe17@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:04:31 -0700 Subject: [PATCH 82/88] Update tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py Co-authored-by: Alex P. <63075587+ADPennington@users.noreply.github.com> --- tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index 129ede311..201373baf 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -543,7 +543,7 @@ Field( item="71B", name="RECEIVE_SSI", - friendly_name="receives social security income", + friendly_name="receives SSI", type="number", startIndex=86, endIndex=87, From f4477ce8c83ba7de7585b85eb0588dc58d652390 Mon Sep 17 00:00:00 2001 From: Eric Lipe <125676261+elipe17@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:04:57 -0700 Subject: [PATCH 83/88] Update tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py Co-authored-by: Alex P. <63075587+ADPennington@users.noreply.github.com> --- tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index 201373baf..71efc6c37 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -222,7 +222,7 @@ type="number", startIndex=43, endIndex=44, - required=True, + required=False, validators=[validators.isInLimits(0, 9)], ), Field( From 4e1fed7f93d27b99db465302e8185ae8d5fefc33 Mon Sep 17 00:00:00 2001 From: Eric Lipe <125676261+elipe17@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:05:08 -0700 Subject: [PATCH 84/88] Update tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py Co-authored-by: Alex P. <63075587+ADPennington@users.noreply.github.com> --- tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index 71efc6c37..69270635f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -527,7 +527,7 @@ type="number", startIndex=84, endIndex=85, - required=True, + required=False, validators=[validators.isInLimits(0, 9)], ), Field( From 1d9070d2baba6ffd7665da0411c295fe3c5c5865 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Thu, 28 Dec 2023 11:05:50 -0700 Subject: [PATCH 85/88] - update based on review --- tdrs-backend/tdpservice/parsers/schema_defs/header.py | 2 +- .../tdpservice/parsers/schema_defs/tribal_tanf/t1.py | 2 +- .../tdpservice/parsers/schema_defs/tribal_tanf/t2.py | 8 ++++---- .../tdpservice/parsers/schema_defs/tribal_tanf/t3.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/header.py b/tdrs-backend/tdpservice/parsers/schema_defs/header.py index 8ac9c82d5..5a9960af1 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/header.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/header.py @@ -66,7 +66,7 @@ type="string", startIndex=12, endIndex=14, - required=True, + required=False, validators=[ validators.or_validators( validators.isInStringRange(0, 2), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py index fc228b118..2820b76fa 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t1.py @@ -138,7 +138,7 @@ endIndex=8, required=True, validators=[ - validators.dateYearIsLargerThan(1998), + validators.dateYearIsLargerThan(1900), validators.dateMonthIsValid(), ], ), diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 6f6d124ab..653a8c31f 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -132,7 +132,7 @@ endIndex=8, required=True, validators=[ - validators.dateYearIsLargerThan(1998), + validators.dateYearIsLargerThan(1900), validators.dateMonthIsValid(), ], ), @@ -258,7 +258,7 @@ type="number", startIndex=44, endIndex=45, - required=True, + required=False, validators=[ validators.isLargerThanOrEqualTo(0), ], @@ -341,7 +341,7 @@ type="string", startIndex=51, endIndex=53, - required=True, + required=False, validators=[ validators.isInStringRange(1, 10), ], @@ -625,7 +625,7 @@ endIndex=94, required=False, validators=[ - validators.isInStringRange(0, 99), + validators.matches("00"), ], ), Field( diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py index 129ede311..9e47adca4 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t3.py @@ -139,7 +139,7 @@ endIndex=28, required=True, validators=[ - validators.dateYearIsLargerThan(1950), + validators.dateYearIsLargerThan(1900), validators.dateMonthIsValid(), ], ), @@ -444,7 +444,7 @@ endIndex=69, required=True, validators=[ - validators.dateYearIsLargerThan(1950), + validators.dateYearIsLargerThan(1900), validators.dateMonthIsValid(), ], ), From a5e9cf36b2f1585303fbd67538b6fc8621b7be27 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Thu, 28 Dec 2023 11:24:47 -0700 Subject: [PATCH 86/88] - Fix migration --- .../0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py b/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py index a0690e688..55211011a 100644 --- a/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py +++ b/tdrs-backend/tdpservice/search_indexes/migrations/0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3.py @@ -107,7 +107,6 @@ class Migration(migrations.Migration): ('RecordType', models.CharField(max_length=156, null=True)), ('RPT_MONTH_YEAR', models.IntegerField(null=True)), ('CASE_NUMBER', models.CharField(max_length=11, null=True)), - ('FIPS_CODE', models.CharField(max_length=2, null=True)), ('COUNTY_FIPS_CODE', models.CharField(max_length=3, null=True)), ('STRATUM', models.CharField(max_length=2, null=True)), ('ZIP_CODE', models.CharField(max_length=5, null=True)), From 5850dc845e2f84d7858e591cb6c0f5c381e63470 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Fri, 29 Dec 2023 10:21:35 -0700 Subject: [PATCH 87/88] - Fixed name clash on PARENT_MINOR_CHILD --- .../tdpservice/parsers/schema_defs/tanf/t2.py | 6 +++--- .../tdpservice/parsers/schema_defs/test.py | 10 ++++++++++ .../parsers/schema_defs/tribal_tanf/t2.py | 4 ++-- .../tdpservice/parsers/test/factories.py | 2 +- .../tdpservice/parsers/test/test_validators.py | 10 +++++----- .../search_indexes/documents/tanf.py | 2 +- .../0026_parent_minor_child_rename.py | 18 ++++++++++++++++++ .../tdpservice/search_indexes/models/tanf.py | 2 +- .../search_indexes/test/test_model_mapping.py | 8 ++++---- 9 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 tdrs-backend/tdpservice/parsers/schema_defs/test.py create mode 100644 tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 63f8706ac..1331490ea 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -69,7 +69,7 @@ validators.if_then_validator( condition_field="FAMILY_AFFILIATION", condition_function=validators.isInLimits(1, 2), - result_field="PARENT_WITH_MINOR_CHILD", + result_field="PARENT_MINOR_CHILD", result_function=validators.isInLimits(1, 3), ), validators.if_then_validator( @@ -359,8 +359,8 @@ ), Field( item="39", - name="PARENT_WITH_MINOR_CHILD", - friendly_name="parent with minor child", + name="PARENT_MINOR_CHILD", + friendly_name="parent of minor child", type="number", startIndex=53, endIndex=54, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/test.py b/tdrs-backend/tdpservice/parsers/schema_defs/test.py new file mode 100644 index 000000000..bd30dea14 --- /dev/null +++ b/tdrs-backend/tdpservice/parsers/schema_defs/test.py @@ -0,0 +1,10 @@ + +class Field: + name="name" + friendly_name="friendly_name" + +field = Field() +fields = [field] + +x = {getattr(f, 'name', ''): getattr(f, 'friendly_name', '') for f in fields} +print(x) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index ed1d03e8d..980e653fd 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -348,8 +348,8 @@ ), Field( item="39", - name="PARENT_WITH_MINOR_CHILD", - friendly_name="parent with minor child", + name="PARENT_MINOR_CHILD", + friendly_name="parent of minor child", type="number", startIndex=53, endIndex=54, diff --git a/tdrs-backend/tdpservice/parsers/test/factories.py b/tdrs-backend/tdpservice/parsers/test/factories.py index 63a6d237d..1d5bb28af 100644 --- a/tdrs-backend/tdpservice/parsers/test/factories.py +++ b/tdrs-backend/tdpservice/parsers/test/factories.py @@ -170,7 +170,7 @@ class Meta: RECEIVE_SSI = 1 MARITAL_STATUS = 1 RELATIONSHIP_HOH = "01" - PARENT_WITH_MINOR_CHILD = 1 + PARENT_MINOR_CHILD = 1 NEEDS_PREGNANT_WOMAN = 1 EDUCATION_LEVEL = "01" CITIZENSHIP_STATUS = 1 diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index dc65d2745..bd3eb88ce 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -587,16 +587,16 @@ def test_validate_parent_with_minor(self, record): """Test cat3 validator for parent with a minor child.""" val = validators.if_then_validator( condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='PARENT_WITH_MINOR_CHILD', result_function=validators.isInLimits(1, 3), + result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3), ) result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_WITH_MINOR_CHILD']) + assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) - record.PARENT_WITH_MINOR_CHILD = 0 + record.PARENT_MINOR_CHILD = 0 result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_WITH_MINOR_CHILD 0 is not ' + + assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_MINOR_CHILD 0 is not ' + 'larger or equal to 1 and smaller or equal to 3.', - ['FAMILY_AFFILIATION', 'PARENT_WITH_MINOR_CHILD']) + ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) def test_validate_education_level(self, record): """Test cat3 validator for education level.""" diff --git a/tdrs-backend/tdpservice/search_indexes/documents/tanf.py b/tdrs-backend/tdpservice/search_indexes/documents/tanf.py index c613c50a2..a6b5fd6b4 100644 --- a/tdrs-backend/tdpservice/search_indexes/documents/tanf.py +++ b/tdrs-backend/tdpservice/search_indexes/documents/tanf.py @@ -110,7 +110,7 @@ class Django: 'RECEIVE_SSI', 'MARITAL_STATUS', 'RELATIONSHIP_HOH', - 'PARENT_WITH_MINOR_CHILD', + 'PARENT_MINOR_CHILD', 'NEEDS_PREGNANT_WOMAN', 'EDUCATION_LEVEL', 'CITIZENSHIP_STATUS', diff --git a/tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py b/tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py new file mode 100644 index 000000000..73fe7eda6 --- /dev/null +++ b/tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.15 on 2023-09-14 17:20 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('search_indexes', '0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3'), + ] + + operations = [ + migrations.RenameField( + model_name='tanf_t2', + old_name='PARENT_WITH_MINOR_CHILD', + new_name='PARENT_MINOR_CHILD', + ), + ] diff --git a/tdrs-backend/tdpservice/search_indexes/models/tanf.py b/tdrs-backend/tdpservice/search_indexes/models/tanf.py index f6ba10f29..204106406 100644 --- a/tdrs-backend/tdpservice/search_indexes/models/tanf.py +++ b/tdrs-backend/tdpservice/search_indexes/models/tanf.py @@ -113,7 +113,7 @@ class TANF_T2(models.Model): RECEIVE_SSI = models.IntegerField(null=True, blank=False) MARITAL_STATUS = models.IntegerField(null=True, blank=False) RELATIONSHIP_HOH = models.CharField(max_length=2, null=True, blank=False) - PARENT_WITH_MINOR_CHILD = models.IntegerField(null=True, blank=False) + PARENT_MINOR_CHILD = models.IntegerField(null=True, blank=False) NEEDS_PREGNANT_WOMAN = models.IntegerField(null=True, blank=False) EDUCATION_LEVEL = models.CharField(max_length=2, null=True, blank=False) CITIZENSHIP_STATUS = models.IntegerField(null=True, blank=False) diff --git a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py index 28b948553..187f0e760 100644 --- a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py +++ b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py @@ -112,7 +112,7 @@ def test_can_create_and_index_tanf_t2_submission(test_datafile): submission.RECEIVE_SSI = 1 submission.MARITAL_STATUS = 1 submission.RELATIONSHIP_HOH = "01" - submission.PARENT_WITH_MINOR_CHILD = 1 + submission.PARENT_MINOR_CHILD = 1 submission.NEEDS_PREGNANT_WOMAN = 1 submission.EDUCATION_LEVEL = 1 submission.CITIZENSHIP_STATUS = 1 @@ -273,11 +273,11 @@ def test_can_create_and_index_tanf_t5_submission(test_datafile): submission.REC_FEDERAL_DISABILITY = 1 submission.REC_AID_TOTALLY_DISABLED = 1 submission.REC_AID_AGED_BLIND = 1 - submission.RECEIVE_SSI = 1 + submission.REC_SSI = 1 submission.MARITAL_STATUS = 1 submission.RELATIONSHIP_HOH = "01" - submission.PARENT_WITH_MINOR_CHILD = 1 - submission.NEEDS_PREGNANT_WOMAN = 1 + submission.PARENT_MINOR_CHILD = 1 + submission.NEEDS_OF_PREGNANT_WOMAN = 1 submission.EDUCATION_LEVEL = "1" submission.CITIZENSHIP_STATUS = 1 submission.COUNTABLE_MONTH_FED_TIME = "1" From c15d92d3d3b45035f10e04bbe919050fd7c21328 Mon Sep 17 00:00:00 2001 From: Eric Lipe Date: Fri, 29 Dec 2023 10:36:20 -0700 Subject: [PATCH 88/88] Revert "- Fixed name clash on PARENT_MINOR_CHILD" This reverts commit 5850dc845e2f84d7858e591cb6c0f5c381e63470. --- .../tdpservice/parsers/schema_defs/tanf/t2.py | 6 +++--- .../tdpservice/parsers/schema_defs/test.py | 10 ---------- .../parsers/schema_defs/tribal_tanf/t2.py | 4 ++-- .../tdpservice/parsers/test/factories.py | 2 +- .../tdpservice/parsers/test/test_validators.py | 10 +++++----- .../search_indexes/documents/tanf.py | 2 +- .../0026_parent_minor_child_rename.py | 18 ------------------ .../tdpservice/search_indexes/models/tanf.py | 2 +- .../search_indexes/test/test_model_mapping.py | 8 ++++---- 9 files changed, 17 insertions(+), 45 deletions(-) delete mode 100644 tdrs-backend/tdpservice/parsers/schema_defs/test.py delete mode 100644 tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py index 1331490ea..63f8706ac 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tanf/t2.py @@ -69,7 +69,7 @@ validators.if_then_validator( condition_field="FAMILY_AFFILIATION", condition_function=validators.isInLimits(1, 2), - result_field="PARENT_MINOR_CHILD", + result_field="PARENT_WITH_MINOR_CHILD", result_function=validators.isInLimits(1, 3), ), validators.if_then_validator( @@ -359,8 +359,8 @@ ), Field( item="39", - name="PARENT_MINOR_CHILD", - friendly_name="parent of minor child", + name="PARENT_WITH_MINOR_CHILD", + friendly_name="parent with minor child", type="number", startIndex=53, endIndex=54, diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/test.py b/tdrs-backend/tdpservice/parsers/schema_defs/test.py deleted file mode 100644 index bd30dea14..000000000 --- a/tdrs-backend/tdpservice/parsers/schema_defs/test.py +++ /dev/null @@ -1,10 +0,0 @@ - -class Field: - name="name" - friendly_name="friendly_name" - -field = Field() -fields = [field] - -x = {getattr(f, 'name', ''): getattr(f, 'friendly_name', '') for f in fields} -print(x) diff --git a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py index 980e653fd..ed1d03e8d 100644 --- a/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py +++ b/tdrs-backend/tdpservice/parsers/schema_defs/tribal_tanf/t2.py @@ -348,8 +348,8 @@ ), Field( item="39", - name="PARENT_MINOR_CHILD", - friendly_name="parent of minor child", + name="PARENT_WITH_MINOR_CHILD", + friendly_name="parent with minor child", type="number", startIndex=53, endIndex=54, diff --git a/tdrs-backend/tdpservice/parsers/test/factories.py b/tdrs-backend/tdpservice/parsers/test/factories.py index 1d5bb28af..63a6d237d 100644 --- a/tdrs-backend/tdpservice/parsers/test/factories.py +++ b/tdrs-backend/tdpservice/parsers/test/factories.py @@ -170,7 +170,7 @@ class Meta: RECEIVE_SSI = 1 MARITAL_STATUS = 1 RELATIONSHIP_HOH = "01" - PARENT_MINOR_CHILD = 1 + PARENT_WITH_MINOR_CHILD = 1 NEEDS_PREGNANT_WOMAN = 1 EDUCATION_LEVEL = "01" CITIZENSHIP_STATUS = 1 diff --git a/tdrs-backend/tdpservice/parsers/test/test_validators.py b/tdrs-backend/tdpservice/parsers/test/test_validators.py index bd3eb88ce..dc65d2745 100644 --- a/tdrs-backend/tdpservice/parsers/test/test_validators.py +++ b/tdrs-backend/tdpservice/parsers/test/test_validators.py @@ -587,16 +587,16 @@ def test_validate_parent_with_minor(self, record): """Test cat3 validator for parent with a minor child.""" val = validators.if_then_validator( condition_field='FAMILY_AFFILIATION', condition_function=validators.isInLimits(1, 3), - result_field='PARENT_MINOR_CHILD', result_function=validators.isInLimits(1, 3), + result_field='PARENT_WITH_MINOR_CHILD', result_function=validators.isInLimits(1, 3), ) result = val(record) - assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) + assert result == (True, None, ['FAMILY_AFFILIATION', 'PARENT_WITH_MINOR_CHILD']) - record.PARENT_MINOR_CHILD = 0 + record.PARENT_WITH_MINOR_CHILD = 0 result = val(record) - assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_MINOR_CHILD 0 is not ' + + assert result == (False, 'if FAMILY_AFFILIATION :1 validator1 passed then PARENT_WITH_MINOR_CHILD 0 is not ' + 'larger or equal to 1 and smaller or equal to 3.', - ['FAMILY_AFFILIATION', 'PARENT_MINOR_CHILD']) + ['FAMILY_AFFILIATION', 'PARENT_WITH_MINOR_CHILD']) def test_validate_education_level(self, record): """Test cat3 validator for education level.""" diff --git a/tdrs-backend/tdpservice/search_indexes/documents/tanf.py b/tdrs-backend/tdpservice/search_indexes/documents/tanf.py index a6b5fd6b4..c613c50a2 100644 --- a/tdrs-backend/tdpservice/search_indexes/documents/tanf.py +++ b/tdrs-backend/tdpservice/search_indexes/documents/tanf.py @@ -110,7 +110,7 @@ class Django: 'RECEIVE_SSI', 'MARITAL_STATUS', 'RELATIONSHIP_HOH', - 'PARENT_MINOR_CHILD', + 'PARENT_WITH_MINOR_CHILD', 'NEEDS_PREGNANT_WOMAN', 'EDUCATION_LEVEL', 'CITIZENSHIP_STATUS', diff --git a/tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py b/tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py deleted file mode 100644 index 73fe7eda6..000000000 --- a/tdrs-backend/tdpservice/search_indexes/migrations/0026_parent_minor_child_rename.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 3.2.15 on 2023-09-14 17:20 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('search_indexes', '0022_tribal_tanf_t1_tribal_tanf_t2_tribal_tanf_t3'), - ] - - operations = [ - migrations.RenameField( - model_name='tanf_t2', - old_name='PARENT_WITH_MINOR_CHILD', - new_name='PARENT_MINOR_CHILD', - ), - ] diff --git a/tdrs-backend/tdpservice/search_indexes/models/tanf.py b/tdrs-backend/tdpservice/search_indexes/models/tanf.py index 204106406..f6ba10f29 100644 --- a/tdrs-backend/tdpservice/search_indexes/models/tanf.py +++ b/tdrs-backend/tdpservice/search_indexes/models/tanf.py @@ -113,7 +113,7 @@ class TANF_T2(models.Model): RECEIVE_SSI = models.IntegerField(null=True, blank=False) MARITAL_STATUS = models.IntegerField(null=True, blank=False) RELATIONSHIP_HOH = models.CharField(max_length=2, null=True, blank=False) - PARENT_MINOR_CHILD = models.IntegerField(null=True, blank=False) + PARENT_WITH_MINOR_CHILD = models.IntegerField(null=True, blank=False) NEEDS_PREGNANT_WOMAN = models.IntegerField(null=True, blank=False) EDUCATION_LEVEL = models.CharField(max_length=2, null=True, blank=False) CITIZENSHIP_STATUS = models.IntegerField(null=True, blank=False) diff --git a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py index 187f0e760..28b948553 100644 --- a/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py +++ b/tdrs-backend/tdpservice/search_indexes/test/test_model_mapping.py @@ -112,7 +112,7 @@ def test_can_create_and_index_tanf_t2_submission(test_datafile): submission.RECEIVE_SSI = 1 submission.MARITAL_STATUS = 1 submission.RELATIONSHIP_HOH = "01" - submission.PARENT_MINOR_CHILD = 1 + submission.PARENT_WITH_MINOR_CHILD = 1 submission.NEEDS_PREGNANT_WOMAN = 1 submission.EDUCATION_LEVEL = 1 submission.CITIZENSHIP_STATUS = 1 @@ -273,11 +273,11 @@ def test_can_create_and_index_tanf_t5_submission(test_datafile): submission.REC_FEDERAL_DISABILITY = 1 submission.REC_AID_TOTALLY_DISABLED = 1 submission.REC_AID_AGED_BLIND = 1 - submission.REC_SSI = 1 + submission.RECEIVE_SSI = 1 submission.MARITAL_STATUS = 1 submission.RELATIONSHIP_HOH = "01" - submission.PARENT_MINOR_CHILD = 1 - submission.NEEDS_OF_PREGNANT_WOMAN = 1 + submission.PARENT_WITH_MINOR_CHILD = 1 + submission.NEEDS_PREGNANT_WOMAN = 1 submission.EDUCATION_LEVEL = "1" submission.CITIZENSHIP_STATUS = 1 submission.COUNTABLE_MONTH_FED_TIME = "1"