Skip to content

Commit

Permalink
Allow R 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Riron committed Nov 20, 2024
1 parent 5dfa2ae commit d4302e9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions libs/back/registry/src/shared/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ export const operationCodeSchema = z
.string()
.transform(val => val.replace(/([A-Z])(\d)/, "$1 $2")) // D5 becomes D 5
.pipe(
z.nativeEnum(PROCESSING_OPERATIONS_CODES_ENUM, {
required_error: "Le code de traitement est requis",
invalid_type_error:
"Le code de traitement n'est pas une valeur autorisée. Valeurs possibles: R1 à R13, D1 à D15"
})
z.nativeEnum(
{ ...PROCESSING_OPERATIONS_CODES_ENUM, "R 0": "R 0" },
{
required_error: "Le code de traitement est requis",
invalid_type_error:
"Le code de traitement n'est pas une valeur autorisée. Valeurs possibles: R 0 à R 13, D 1 à D 15"
}
)
);

export const weightValueSchema = z.coerce
Expand Down

0 comments on commit d4302e9

Please sign in to comment.