modified responses and error handling for oracle api

This commit is contained in:
Kallesh B S 2025-05-16 15:32:20 +05:30
parent 2413ba955e
commit 1e0e177fd0
8 changed files with 963 additions and 957 deletions

View File

@ -8,58 +8,58 @@ export class ManageFeeController {
constructor(private readonly manageFeeService: ManageFeeService) { }
// @ApiTags('Manage Fee - Mssql')
// @Get('/GetBasicFeeRates')
@ApiTags('Manage Fee - Mssql')
@Get('/GetBasicFeeRates')
GetBasicFeeRates(@Query() body: GetFeeGeneralDTO) {
return this.manageFeeService.GETBASICFEERATES(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Post('/CreateBasicFee')
@ApiTags('Manage Fee - Mssql')
@Post('/CreateBasicFee')
CreateBasicFee(@Body() body: CreateBasicFeeDTO) {
return this.manageFeeService.CREATEBASICFEE(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Patch('/UpdateBasicFee')
@ApiTags('Manage Fee - Mssql')
@Patch('/UpdateBasicFee')
UpdateBasicFee(@Body() body: UpdateBasicFeeDTO) {
return this.manageFeeService.UPDATEBASICFEE(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Get('/GetBondRates')
@ApiTags('Manage Fee - Mssql')
@Get('/GetBondRates')
GetBondRates(@Query() body: GetFeeGeneralDTO) {
return this.manageFeeService.GETBONDRATES(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Post('/CreateBondRate')
@ApiTags('Manage Fee - Mssql')
@Post('/CreateBondRate')
CreateBondRate(@Body() body: CreateBondRateDTO) {
return this.manageFeeService.CREATEBONDRATE(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Patch('/UpdateBondRate')
@ApiTags('Manage Fee - Mssql')
@Patch('/UpdateBondRate')
UpdateBondRate(@Body() body: UpdateBondRateDTO) {
return this.manageFeeService.UPDATEBONDRATE(body);
}
// Cargo Rate
// @ApiTags('Manage Fee - Mssql')
// @Get('/GetCargoRates')
@ApiTags('Manage Fee - Mssql')
@Get('/GetCargoRates')
GetCargoRates(@Query() body: GetFeeGeneralDTO) {
return this.manageFeeService.GETCARGORATES(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Post('/CreateCargoRate')
@ApiTags('Manage Fee - Mssql')
@Post('/CreateCargoRate')
CreateCargoRate(@Body() body: CreateCargoRateDTO) {
return this.manageFeeService.CREATECARGORATE(body);
}
// @ApiTags('Manage Fee - Mssql')
// @Patch('/UpdateCargoRate')
@ApiTags('Manage Fee - Mssql')
@Patch('/UpdateCargoRate')
UpdateCargoRate(@Body() body: UpdateCargoRateDTO) {
return this.manageFeeService.UPDATECARGORATE(body);
}

View File

@ -325,7 +325,7 @@ export class ManageClientsService {
// throw new Error('No cursor returned from the stored procedure');
// }
if (p_clientcursor_rows[0].ERRORMESG) {
if (p_clientcursor_rows.length>0 && p_clientcursor_rows[0].ERRORMESG) {
throw new BadRequestException(p_clientcursor_rows[0].ERRORMESG);
}
@ -477,7 +477,7 @@ export class ManageClientsService {
throw new Error('No cursor returned from the stored procedure');
}
if (p_cursor_rows[0].ERRORMESG) {
if (p_cursor_rows.length>0 && p_cursor_rows[0].ERRORMESG) {
throw new BadRequestException(p_cursor_rows[0].ERRORMESG);
}
@ -629,7 +629,7 @@ export class ManageClientsService {
throw new Error('No cursor returned from the stored procedure');
}
if (p_cursor_rows[0].ERRORMESG) {
if (p_cursor_rows.length>0 && p_cursor_rows[0].ERRORMESG) {
throw new BadRequestException(p_cursor_rows[0].ERRORMESG);
}
@ -774,7 +774,7 @@ export class ManageClientsService {
throw new Error('No cursor returned from the stored procedure');
}
if (p_cursor_rows[0].ERRORMESG) {
if (p_cursor_rows.length>0 && p_cursor_rows[0].ERRORMESG) {
throw new BadRequestException(p_cursor_rows[0].ERRORMESG);
}
@ -950,7 +950,7 @@ export class ManageClientsService {
throw new InternalServerException('No cursor returned from the stored procedure');
}
if (p_cursor_rows[0].ERRORMESG) {
if (p_cursor_rows.length>0 && p_cursor_rows[0].ERRORMESG) {
throw new BadRequestException(p_cursor_rows[0].ERRORMESG);
}
@ -1119,7 +1119,7 @@ export class ManageClientsService {
throw new Error('No cursor returned from the stored procedure');
}
if (p_cursor_rows[0].ERRORMESG) {
if (p_cursor_rows.length>0 && p_cursor_rows[0].ERRORMESG) {
throw new BadRequestException(p_cursor_rows[0].ERRORMESG);
}

File diff suppressed because it is too large Load Diff

View File

@ -126,12 +126,12 @@ export class ParamTableService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return fres;
return { statusCode: 201, message: "Createdted Successfully", ...fres[0] };
} catch (error) {
if (error instanceof BadRequestException) {
this.logger.warn(error.message);
@ -233,12 +233,12 @@ export class ParamTableService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return fres;
return { statusCode: 201, message: "Createdted Successfully", ...fres[0] };
} catch (error) {
if (error instanceof BadRequestException) {
throw error;
@ -337,12 +337,12 @@ export class ParamTableService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return fres;
return { statusCode: 200, message: "Updated Successfully", ...fres[0] };
} catch (error) {
if (error instanceof BadRequestException) {
this.logger.warn(error.message);

View File

@ -70,12 +70,12 @@ export class CarnetSequenceService {
await result.outBinds.p_cursor.close();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return fres;
return { statusCode: 201, message: "Createdted Successfully", ...fres[0] };
} catch (error) {
if (error instanceof BadRequestException) {
this.logger.warn(error.message);

View File

@ -129,12 +129,12 @@ export class RegionService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return fres;
return { statusCode: 201, message: "Createdted Successfully", ...fres[0] };
} catch (error) {
if (error instanceof BadRequestException) {
this.logger.warn(error.message);
@ -188,12 +188,12 @@ export class RegionService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return fres;
return { statusCode: 200, message: "Updated Successfully", ...fres[0] };
} catch (error) {
if (error instanceof BadRequestException) {
this.logger.warn(error.message);

View File

@ -101,7 +101,7 @@ export class SpContactsService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
@ -239,7 +239,7 @@ export class SpContactsService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}

View File

@ -124,7 +124,8 @@ export class SpService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
@ -296,7 +297,8 @@ export class SpService {
const fres = await result.outBinds.p_cursor.getRows();
if (fres[0].ERRORMESG) {
if (fres.length>0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}