forked from Yara724/api
Merge pull request 'YARA-908' (#73) from s.yahyaee/yara724-api:main into main
Reviewed-on: Yara724/api#73
This commit is contained in:
@@ -2304,6 +2304,15 @@ export class ExpertClaimService {
|
|||||||
return await this.branchDbService.findAll(insuranceId);
|
return await this.branchDbService.findAll(insuranceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* V2: branches for the damage expert's insurer tenant (JWT `clientKey`).
|
||||||
|
* Same data as v1 `GET expert-claim/branches/:insuranceId` without passing client id.
|
||||||
|
*/
|
||||||
|
async retrieveInsuranceBranchesV2(actor: { clientKey?: string }) {
|
||||||
|
const clientKey = requireActorClientKey(actor);
|
||||||
|
return await this.branchDbService.findAll(clientKey);
|
||||||
|
}
|
||||||
|
|
||||||
private globalErrHandler(error) {
|
private globalErrHandler(error) {
|
||||||
this.logger.error(error.response?.responseCode, error.response);
|
this.logger.error(error.response?.responseCode, error.response);
|
||||||
throw new HttpException(error.response, error.claimStatus);
|
throw new HttpException(error.response, error.claimStatus);
|
||||||
|
|||||||
@@ -71,6 +71,22 @@ export class ExpertClaimV2Controller {
|
|||||||
return this.claimRequestManagementService.getOuterPartsCatalogV2(carType);
|
return this.claimRequestManagementService.getOuterPartsCatalogV2(carType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("branches")
|
||||||
|
@ApiOperation({
|
||||||
|
summary: "List insurer branches for this damage expert (V2)",
|
||||||
|
description:
|
||||||
|
"Returns branches for the insurance company bound to the expert JWT (`clientKey`). " +
|
||||||
|
"Same payload as v1 `GET expert-claim/branches/:insuranceId` — no client id in the URL.",
|
||||||
|
})
|
||||||
|
@ApiResponse({
|
||||||
|
status: 200,
|
||||||
|
description:
|
||||||
|
"Branch list (name, code, address, city, state, phoneNumber, isActive, …) for daghi / branch selection in expert replies",
|
||||||
|
})
|
||||||
|
async getInsuranceBranchesV2(@CurrentUser() actor: { clientKey?: string }) {
|
||||||
|
return await this.expertClaimService.retrieveInsuranceBranchesV2(actor);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("requests")
|
@Get("requests")
|
||||||
@ApiOperation({
|
@ApiOperation({
|
||||||
summary: "List available claim requests for damage expert",
|
summary: "List available claim requests for damage expert",
|
||||||
|
|||||||
Reference in New Issue
Block a user