You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// @description Prijs per liter van de brandstof
PRIJS Decimal? @db.Decimal(6, 2)
}
The Create DTO looks like
@ApiProperty({
description: "Het bedrag van de tankbeurt om te kunnen factureren",
type: "number", <-- number
format: "double",
required: false,
nullable: true,
})
@IsOptional()
@IsDecimal()
PRIJS?: Prisma.Decimal | null;
The swagger example
{
"PRIJS": 0, <-- number
}
So far so good. It means that I have to provide numeric value for these fields. However when calling the api I need to provide these decimals as string. such as ""PRIJS": "2.01" to make it work. If is specify "PRIJS": 2.01, the error message "PRIJS is not a valid decimal number."
Also for the output the decimal is provided as string. So the interface implementation and the definition are inconsistent. I prefer to work with numbers instead of string. How can I solve this ?
The text was updated successfully, but these errors were encountered:
Prisma model
model OperBrandstof {
@@Map("oper_brandstof")
/// @description Prijs per liter van de brandstof
PRIJS Decimal? @db.Decimal(6, 2)
}
The Create DTO looks like
@ApiProperty({
description: "Het bedrag van de tankbeurt om te kunnen factureren",
type: "number", <-- number
format: "double",
required: false,
nullable: true,
})
@IsOptional()
@IsDecimal()
PRIJS?: Prisma.Decimal | null;
The swagger example
{
"PRIJS": 0, <-- number
}
So far so good. It means that I have to provide numeric value for these fields. However when calling the api I need to provide these decimals as string. such as ""PRIJS": "2.01" to make it work. If is specify "PRIJS": 2.01, the error message "PRIJS is not a valid decimal number."
Also for the output the decimal is provided as string. So the interface implementation and the definition are inconsistent. I prefer to work with numbers instead of string. How can I solve this ?
The text was updated successfully, but these errors were encountered: