Skip to content

Commit

Permalink
61 getting rid of workbookValidation files and just attempted to Type…
Browse files Browse the repository at this point in the history
…script the validate-upload.js file
  • Loading branch information
ed-snodgrass committed Jan 7, 2024
1 parent 70bcbf3 commit b4ae20f
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 1,175 deletions.
24 changes: 24 additions & 0 deletions api/src/lib/uploadValidationTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export type FormatterFunction = (value: string | number) => string | number

export type Rule = {
key: string
index: number
required: boolean | string
dataType: string
maxLength: number
listVals: string[]
columnName: string
humanColName: string
ecCodes: string[] | boolean
version?: string
isRequiredFn?: (value: WorkbookContentItem) => boolean
validationFormatters: FormatterFunction[]
}

export type WorkbookContentItem = Record<string, string | number>

export type WorkbookRecord = {
type: string
content: WorkbookContentItem
subcategory?: string
}
Loading

0 comments on commit b4ae20f

Please sign in to comment.