forked from Yara724/api
fix(fanavaran): require vehicle review and recover submitted base claims
Require approved vehicle classification before new base submissions. Allow a first review for existing base claims without damage or expertise, preserve remote IDs, and resume deferred damage submission. Keep approved submitted classifications locked and compare stage IDs and review snapshots when saving.
This commit is contained in:
@@ -6875,7 +6875,7 @@ export class ClaimRequestManagementService {
|
||||
throw new ConflictException({
|
||||
code: 'FANAVARAN_VEHICLE_REVIEW_REQUIRED',
|
||||
message:
|
||||
'An expert must review and approve the vehicle group, use type, system, and kind before any data can be sent to Fanavaran.',
|
||||
'کارشناس باید پیش از ارسال به فناوران، نوع خودرو، نوع استفاده، سیستم و نام خودرو را بررسی و تأیید کند.',
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6887,8 +6887,11 @@ export class ClaimRequestManagementService {
|
||||
return 'Already submitted to Fanavaran';
|
||||
}
|
||||
|
||||
// GEN.03 base claim is sent as soon as the local claim exists.
|
||||
// Vehicle review remains required for damage / attachments / expertise only.
|
||||
try {
|
||||
this.assertFanavaranVehicleReviewApproved(claimCase);
|
||||
} catch {
|
||||
return 'کارشناس باید پیش از ارسال پرونده به فناوران، مشخصات خودرو را بررسی و تأیید کند.';
|
||||
}
|
||||
|
||||
const clientKey = resolveFanavaranClientKey();
|
||||
const notifierAllowed =
|
||||
@@ -8071,7 +8074,7 @@ export class ClaimRequestManagementService {
|
||||
);
|
||||
}
|
||||
if (!existing) throw new NotFoundException('Claim case not found');
|
||||
// Vehicle review is not required for GEN.03 base — only for later stages.
|
||||
this.assertFanavaranVehicleReviewApproved(existing);
|
||||
const notifierAllowed =
|
||||
clientKey === 'tejaratno'
|
||||
? await this.tejaratNotifierAllowedIds(clientKey)
|
||||
|
||||
Reference in New Issue
Block a user