Merge pull request 'main' (#153) from s.hajizadeh/yara724api:main into main

Reviewed-on: Yara724/api#153
This commit is contained in:
2026-06-23 17:44:03 +03:30

View File

@@ -188,6 +188,8 @@ export interface FanavaranAutoSubmitResult {
fanavaranResponse?: unknown; fanavaranResponse?: unknown;
} }
const FANAVARAN_ACCIDENT_LOCATION_ADDRESS = "استان تهران شهر تهران";
@Injectable() @Injectable()
export class ClaimRequestManagementService { export class ClaimRequestManagementService {
private readonly logger = new Logger(ClaimRequestManagementService.name); private readonly logger = new Logger(ClaimRequestManagementService.name);
@@ -3449,12 +3451,7 @@ export class ClaimRequestManagementService {
result.AccidentTime = this.getTime24Hour(input.createdAt); result.AccidentTime = this.getTime24Hour(input.createdAt);
} }
if (input.location?.lat && input.location?.lon) { result.AccidentLocationAddress = FANAVARAN_ACCIDENT_LOCATION_ADDRESS;
result.AccidentLocationAddress = await this.getAddressFromCoordinates(
input.location.lat,
input.location.lon,
);
}
result.EstimateAmount = input.damageParts result.EstimateAmount = input.damageParts
? this.calculateEstimateAmount(input.damageParts) ? this.calculateEstimateAmount(input.damageParts)
@@ -3613,16 +3610,7 @@ export class ClaimRequestManagementService {
result.AccidentTime = this.getTime24Hour(blameRequest.createdAt); result.AccidentTime = this.getTime24Hour(blameRequest.createdAt);
} }
// AccidentLocationAddress: Get from reverse geocoding API result.AccidentLocationAddress = FANAVARAN_ACCIDENT_LOCATION_ADDRESS;
if (
blameRequest.firstPartyLocation?.lat &&
blameRequest.firstPartyLocation?.lon
) {
result.AccidentLocationAddress = await this.getAddressFromCoordinates(
blameRequest.firstPartyLocation.lat,
blameRequest.firstPartyLocation.lon,
);
}
// EstimateAmount: Sum of totalPayment from damageExpertReply parts // EstimateAmount: Sum of totalPayment from damageExpertReply parts
const damageReply = const damageReply =