feat: replace OpenAI pricing with AI assessment estimates

Extend durable image assessments with explicit Persian vehicle names, deployment severity settings and advisory market prices normalized to rials. Preserve case access and retry boundaries, and remove the retired OpenAI pricing module and routes.
This commit is contained in:
SepehrYahyaee
2026-11-08 10:52:45 +03:30
parent a8bb0d8e35
commit 755e921c08
32 changed files with 638 additions and 2702 deletions
+8 -17
View File
@@ -128,21 +128,12 @@ export class EnvironmentVariables {
AI_DAMAGE_TIMEOUT_MS?: number;
@IsOptional()
@IsBooleanString()
OPENAI_PRICE_ESTIMATION_ENABLED?: string;
@IsOptional()
@IsString()
OPENAI_PRICE_ESTIMATION_API_KEY?: string;
@IsOptional()
@IsString()
@MinLength(1)
OPENAI_PRICE_ESTIMATION_MODEL?: string;
@IsOptional()
@IsInt()
@Min(1000)
@Max(600000)
OPENAI_PRICE_ESTIMATION_TIMEOUT_MS?: number;
@IsEnum(
{ Minor: "minor", Moderate: "moderate", Severe: "severe", All: "null" },
{
message:
"AI_DAMAGE_PRICE_MIN_SEVERITY must be minor, moderate, severe or null",
},
)
AI_DAMAGE_PRICE_MIN_SEVERITY?: string;
}
-9
View File
@@ -27,15 +27,6 @@ export function validate(config: Record<string, unknown>) {
skipMissingProperties: false,
});
if (
validatedConfig.OPENAI_PRICE_ESTIMATION_ENABLED === "true" &&
!validatedConfig.OPENAI_PRICE_ESTIMATION_API_KEY?.trim()
) {
throw new Error(
"OPENAI_PRICE_ESTIMATION_API_KEY is required when OPENAI_PRICE_ESTIMATION_ENABLED=true",
);
}
if (errors.length > 0) {
const messages = errors
.flatMap((error) => Object.values(error.constraints ?? {}))