Merge pull request 'Changed Price units to Rial' (#316) from s.yahyaee/yara724-api:main into main

Reviewed-on: Yara724/api#316
This commit is contained in:
2026-09-14 16:49:02 +03:30
2 changed files with 6 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ export class PartPricingV2Dto {
@ApiPropertyOptional({
example: "5000000",
description:
"Required for change lines; omitted for repair lines. Every supplied amount must be between 100,000 and 10,000,000,000 Toman.",
"Required for change lines; omitted for repair lines. Every supplied amount must be between 1,000,000 and 100,000,000,000 Rial.",
})
@ValidateIf(
(part: PartPricingV2Dto) =>
@@ -74,7 +74,7 @@ export class PartPricingV2Dto {
@ApiProperty({
example: "2000000",
description:
"Labor in Toman (integer string; 100,000 to 10,000,000,000).",
"Labor in Rial (integer string; 1,000,000 to 100,000,000,000).",
})
@IsString()
@IsNotEmpty()
@@ -84,7 +84,7 @@ export class PartPricingV2Dto {
@ApiProperty({
example: "7000000",
description:
"Line total in Toman (integer string; 100,000 to 10,000,000,000).",
"Line total in Rial (integer string; 1,000,000 to 100,000,000,000).",
})
@IsString()
@IsNotEmpty()

View File

@@ -11,8 +11,8 @@ type ExpertReplyPricingPart = {
daghi?: { option?: unknown; price?: unknown };
};
export const EXPERT_REPLY_MIN_AMOUNT_TOMAN = 100_000;
export const EXPERT_REPLY_MAX_AMOUNT_TOMAN = 10_000_000_000;
export const EXPERT_REPLY_MIN_AMOUNT_TOMAN = 1_000_000; // It is Rial from now on but we managed to keep the variables named as *Toman so that we won't have conflicts elsewhere.
export const EXPERT_REPLY_MAX_AMOUNT_TOMAN = 100_000_000_000; // It it Rial from now on
export type ExpertReplyPricingValidationError = {
message: string;
@@ -150,7 +150,7 @@ export function getExpertReplyPricingValidationError(
? "دستمزد"
: "مبلغ کل";
return localizedError(
`${fieldName} قطعه ${String(part.partId)} باید به‌صورت مبلغ صحیح و غیرمنفی (تومان) وارد شود.`,
`${fieldName} قطعه ${String(part.partId)} باید به‌صورت مبلغ صحیح و غیرمنفی (ریال) وارد شود.`,
`parts[${index}].${field}`,
"invalid_amount",
String(part.partId),