forked from Yara724/api
Merge pull request 'main' (#153) from s.hajizadeh/yara724api:main into main
Reviewed-on: Yara724/api#153
This commit is contained in:
@@ -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 =
|
||||||
|
|||||||
Reference in New Issue
Block a user