Fixed company code error not found

This commit is contained in:
SepehrYahyaee
2026-05-30 15:01:53 +03:30
parent da298a3350
commit d6f1cb9eeb
5 changed files with 60 additions and 5 deletions

View File

@@ -1068,10 +1068,19 @@ export class RequestManagementService {
const companyCode = inquiryMapped?.CompanyCode;
const client =
await this.clientService.findClientWithCompanyCode(+companyCode);
if (!client) {
throw new HttpException("Client not found", HttpStatus.CONFLICT);
await this.clientService.addClient({
clientName,
clientCode: companyCode,
useExpertMode: "legal",
});
}
// if (!client) {
// throw new HttpException("Client not found", HttpStatus.CONFLICT);
// }
// Persist inquiry/body data into new model
if (!party.person) party.person = {} as any;
const resolvedClientId = (client as any)?._id ?? (client as any)?._doc?._id;