raft-tech / TANF-app

Repo for development of a new TANF Data Reporting System
Other
16 stars 3 forks source link

as an STT user, I need the error message related to the header update indicator clarified #3049

Open ADPennington opened 5 days ago

ADPennington commented 5 days ago

Description:

As noted here, when #2963 merges, this will introduce an item number into the error message related to header update indicator, which is currently the most common error message that STTs receive.

It looks like the following (when the update indicator is N, for example): HEADER Item 10 (update indicator): N does not match D.

Acceptance Criteria: Create a list of functional outcomes that must be achieved to complete this issue

Tasks: Create a list of granular, specific work items that must be completed to deliver the desired outcomes of this issue

Notes: Add additional useful information, such as related issues and functionality that isn't covered by this specific issue, and other considerations that will be helpful for anyone reading this

the change is relatively easy:

Field(
item="10",
name="update",
friendly_name="update indicator",
type="string",
startIndex=22,
endIndex=23,
required=True,
validators=[validators.matches("D")],
),

for our update indicator field, the matches validator can take a second argument error_func, similar to how startsWith works in the preparsing validators

validators.startsWith(
"HEADER",
lambda value: f"Your file does not begin with a {value} record."
)

that would let us hard code the message for the one specific case

Supporting Documentation: Please include any relevant log snippets/files/screen shots

Open Questions: Please include any questions or decisions that must be made before beginning work or to confidently call this issue complete