Skip to content

Commit

Permalink
force parse material sheet hs_2017_code to string
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Dec 14, 2024
1 parent 56e9924 commit 29f4e94
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Transform } from 'class-transformer';
import {
IsEnum,
IsJSON,
Expand All @@ -10,6 +11,7 @@ import {
//TODO: double check if we only use the material sheet in the excel to activate materials

export class MaterialSheetValidator {
@Transform(({ value }) => String(value))
@IsString({ message: 'Material hs_2017_code must be a string' })
@MinLength(1, { message: 'Material hs_2017_code is too short' })
@IsNotEmpty({ message: 'Material hs_2017_code must not be empty' })
Expand Down

0 comments on commit 29f4e94

Please sign in to comment.