forked from Shared/esg
parsian inquiries implemented
This commit is contained in:
@@ -28,6 +28,9 @@ import { GenericInquiryResponseDto } from './dto/generic-inquiry-response.dto';
|
||||
import { PostalCodeRequestDto } from './dto/postal-code-request.dto';
|
||||
import { ShahkarRequestDto } from './dto/shahkar-request.dto';
|
||||
import { SayahRequestDto } from './dto/sayah-request.dto';
|
||||
import { PolicyByChassisRequestDto } from './dto/policy-by-chassis-request.dto';
|
||||
import { PolicyByNationalCodeRequestDto } from './dto/policy-by-national-code-request.dto';
|
||||
import { PolicyByPlateRequestDto } from './dto/policy-by-plate-request.dto';
|
||||
import { InquiryService } from './inquiry.service';
|
||||
|
||||
/**
|
||||
@@ -127,6 +130,54 @@ export class InquiryController {
|
||||
return this.inquireGeneric(InquiryType.LEGAL_PERSON, payload, req);
|
||||
}
|
||||
|
||||
@Post('policyByChassis')
|
||||
@InquiryAccess(InquiryType.POLICY_BY_CHASSIS)
|
||||
@Throttle({ default: { limit: 30, ttl: 60000 } })
|
||||
@ApiOperation({ summary: 'Policy inquiry by chassis number' })
|
||||
@ApiResponse({ status: 200, type: GenericInquiryResponseDto })
|
||||
async inquirePolicyByChassis(
|
||||
@Body() payload: PolicyByChassisRequestDto,
|
||||
@Req() req: Request & { requestId?: string; trackingCode?: string },
|
||||
): Promise<BaseInquiryResponseDto<Record<string, unknown>>> {
|
||||
return this.inquireGeneric(
|
||||
InquiryType.POLICY_BY_CHASSIS,
|
||||
payload as unknown as Record<string, unknown>,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
@Post('policyByPlate')
|
||||
@InquiryAccess(InquiryType.POLICY_BY_PLATE)
|
||||
@Throttle({ default: { limit: 30, ttl: 60000 } })
|
||||
@ApiOperation({ summary: 'Policy inquiry by national vehicle plate' })
|
||||
@ApiResponse({ status: 200, type: GenericInquiryResponseDto })
|
||||
async inquirePolicyByPlate(
|
||||
@Body() payload: PolicyByPlateRequestDto,
|
||||
@Req() req: Request & { requestId?: string; trackingCode?: string },
|
||||
): Promise<BaseInquiryResponseDto<Record<string, unknown>>> {
|
||||
return this.inquireGeneric(
|
||||
InquiryType.POLICY_BY_PLATE,
|
||||
payload as unknown as Record<string, unknown>,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
@Post('policyByNationalCode')
|
||||
@InquiryAccess(InquiryType.POLICY_BY_NATIONAL_CODE)
|
||||
@Throttle({ default: { limit: 30, ttl: 60000 } })
|
||||
@ApiOperation({ summary: 'Policy inquiry by national code' })
|
||||
@ApiResponse({ status: 200, type: GenericInquiryResponseDto })
|
||||
async inquirePolicyByNationalCode(
|
||||
@Body() payload: PolicyByNationalCodeRequestDto,
|
||||
@Req() req: Request & { requestId?: string; trackingCode?: string },
|
||||
): Promise<BaseInquiryResponseDto<Record<string, unknown>>> {
|
||||
return this.inquireGeneric(
|
||||
InquiryType.POLICY_BY_NATIONAL_CODE,
|
||||
payload as unknown as Record<string, unknown>,
|
||||
req,
|
||||
);
|
||||
}
|
||||
|
||||
private async inquireGeneric(
|
||||
inquiryType: InquiryType,
|
||||
payload: Record<string, unknown>,
|
||||
|
||||
Reference in New Issue
Block a user