feat: add 11 digit vat

This commit is contained in:
Nathnael
2026-08-10 13:56:25 +00:00
parent ce57be252c
commit c24c93bcf3
5 changed files with 23 additions and 11 deletions

View File

@@ -36,13 +36,13 @@ export class UpdateProfileDto {
@IsTin({ message: "TIN must be exactly 10 digits" })
tin?: string;
// Ethiopian VAT registration numbers are 10 digits, the same shape as the
// TIN. Both portal forms enforce that; without it here the API happily stored
// whatever a stale client sent, and the two layers disagreed about what the
// column may hold.
// Ethiopian VAT registration numbers are 10 digits (the same shape as the
// TIN), but some are issued with an 11th. Both portal forms enforce the same
// range; without it here the API happily stored whatever a stale client sent,
// and the two layers disagreed about what the column may hold.
@IsOptional()
@IsString()
@Matches(/^\d{10}$/, { message: "VAT number must be exactly 10 digits" })
@Matches(/^\d{10,11}$/, { message: "VAT number must be 10 or 11 digits" })
vatNumber?: string;
// `fanNumber` is deliberately absent: the FAN is the Fayda number of the