mssql fee updated
This commit is contained in:
parent
1e0e177fd0
commit
06ccbec937
@ -66,80 +66,80 @@ export class ManageFeeController {
|
|||||||
|
|
||||||
// Counter Foil
|
// Counter Foil
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Get('/GetCfFeeRates')
|
@Get('/GetCfFeeRates')
|
||||||
GetCfFeeRates(@Query() body: GetFeeGeneralDTO) {
|
GetCfFeeRates(@Query() body: GetFeeGeneralDTO) {
|
||||||
return this.manageFeeService.GETCFFEERATES(body);
|
return this.manageFeeService.GETCFFEERATES(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Post('/CreateCfFee')
|
@Post('/CreateCfFee')
|
||||||
CreateCfFee(@Body() body: CreateCfFeeDTO) {
|
CreateCfFee(@Body() body: CreateCfFeeDTO) {
|
||||||
return this.manageFeeService.CREATECFFEE(body);
|
return this.manageFeeService.CREATECFFEE(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Patch('/UpdateCfFee')
|
@Patch('/UpdateCfFee')
|
||||||
UpdateCfFee(@Body() body: UpdateCfFeeDTO) {
|
UpdateCfFee(@Body() body: UpdateCfFeeDTO) {
|
||||||
return this.manageFeeService.UPDATECFFEE(body);
|
return this.manageFeeService.UPDATECFFEE(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continuation sheet
|
// Continuation sheet
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Get('/GetCsFeeRates')
|
@Get('/GetCsFeeRates')
|
||||||
GetCsFeeRates(@Query() body: GetFeeGeneralDTO) {
|
GetCsFeeRates(@Query() body: GetFeeGeneralDTO) {
|
||||||
return this.manageFeeService.GETCSFEERATES(body);
|
return this.manageFeeService.GETCSFEERATES(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Post('/CreateCsFee')
|
@Post('/CreateCsFee')
|
||||||
CreateCsFee(@Body() body: CreateCsFeeDTO) {
|
CreateCsFee(@Body() body: CreateCsFeeDTO) {
|
||||||
return this.manageFeeService.CREATECSFEE(body);
|
return this.manageFeeService.CREATECSFEE(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Patch('/UpdateCsFee')
|
@Patch('/UpdateCsFee')
|
||||||
UpdateCsFee(@Body() body: UpdateCsFeeDTO) {
|
UpdateCsFee(@Body() body: UpdateCsFeeDTO) {
|
||||||
return this.manageFeeService.UPDATECSFEE(body);
|
return this.manageFeeService.UPDATECSFEE(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expedited Fee
|
// Expedited Fee
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Get('/GetEfFeeRates')
|
@Get('/GetEfFeeRates')
|
||||||
GetEfFeeRates(@Query() body: GetFeeGeneralDTO) {
|
GetEfFeeRates(@Query() body: GetFeeGeneralDTO) {
|
||||||
return this.manageFeeService.GETEFFEERATES(body);
|
return this.manageFeeService.GETEFFEERATES(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Post('/CreateEfFee')
|
@Post('/CreateEfFee')
|
||||||
CreateEeFee(@Body() body: CreateEfFeeDTO) {
|
CreateEeFee(@Body() body: CreateEfFeeDTO) {
|
||||||
return this.manageFeeService.CREATEEFFEE(body);
|
return this.manageFeeService.CREATEEFFEE(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Patch('/UpdateEfFee')
|
@Patch('/UpdateEfFee')
|
||||||
UpdateEfFee(@Body() body: UpdateEfFeeDTO) {
|
UpdateEfFee(@Body() body: UpdateEfFeeDTO) {
|
||||||
return this.manageFeeService.UPDATEEFFEE(body);
|
return this.manageFeeService.UPDATEEFFEE(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fee Comm
|
// Fee Comm
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Get('/GetFeeComm')
|
@Get('/GetFeeComm')
|
||||||
GetFeeComm(@Query() body: GetFeeGeneralDTO) {
|
GetFeeComm(@Query() body: GetFeeGeneralDTO) {
|
||||||
return this.manageFeeService.GETFEECOMM(body);
|
return this.manageFeeService.GETFEECOMM(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Post('/CreateFeeComm')
|
@Post('/CreateFeeComm')
|
||||||
CreateFeeComm(@Body() body: CreateFeeCommDTO) {
|
CreateFeeComm(@Body() body: CreateFeeCommDTO) {
|
||||||
return this.manageFeeService.CREATEFEECOMM(body);
|
return this.manageFeeService.CREATEFEECOMM(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiTags('Manage Fee - Mssql')
|
@ApiTags('Manage Fee - Mssql')
|
||||||
// @Patch('/UpdateFeeComm')
|
@Patch('/UpdateFeeComm')
|
||||||
UpdateFeeComm(@Body() body: UpdateFeeCommDTO) {
|
UpdateFeeComm(@Body() body: UpdateFeeCommDTO) {
|
||||||
return this.manageFeeService.UPDATEFEECOMM(body);
|
return this.manageFeeService.UPDATEFEECOMM(body);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { Injectable, Logger } from '@nestjs/common';
|
import { Injectable, Logger } from '@nestjs/common';
|
||||||
import { MssqlDBService, OracleDBService } from 'src/db/db.service';
|
import { MssqlDBService } from 'src/db/db.service';
|
||||||
import { InternalServerException } from 'src/exceptions/internalServerError.exception';
|
import { InternalServerException } from 'src/exceptions/internalServerError.exception';
|
||||||
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, GetFeeGeneralDTO, UpdateBasicFeeDTO, UpdateBondRateDTO, UpdateCargoRateDTO, UpdateCfFeeDTO, UpdateCsFeeDTO, UpdateEfFeeDTO, UpdateFeeCommDTO } from 'src/oracle/manage-fee/manage-fee.dto';
|
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, GetFeeGeneralDTO, UpdateBasicFeeDTO, UpdateBondRateDTO, UpdateCargoRateDTO, UpdateCfFeeDTO, UpdateCsFeeDTO, UpdateEfFeeDTO, UpdateFeeCommDTO } from 'src/oracle/manage-fee/manage-fee.dto';
|
||||||
import * as oracledb from 'oracledb';
|
|
||||||
import { BadRequestException } from 'src/exceptions/badRequest.exception';
|
import { BadRequestException } from 'src/exceptions/badRequest.exception';
|
||||||
import { Connection, Request } from 'mssql';
|
import { Connection, Request } from 'mssql';
|
||||||
import * as mssql from 'mssql';
|
import * as mssql from 'mssql';
|
||||||
@ -16,7 +15,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
// Basic Fee Setup
|
// Basic Fee Setup
|
||||||
|
|
||||||
async GETBASICFEERATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
async GETBASICFEERATES(body: GetFeeGeneralDTO): Promise<any[] | Object> {
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
try {
|
try {
|
||||||
connection = await this.mssqlDBService.getConnection();
|
connection = await this.mssqlDBService.getConnection();
|
||||||
@ -24,7 +23,14 @@ export class ManageFeeService {
|
|||||||
request.input('p_spid', mssql.Int, body.P_SPID);
|
request.input('p_spid', mssql.Int, body.P_SPID);
|
||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetBasicFeeRates');
|
const result = await request.execute('carnetsys.GetBasicFeeRates');
|
||||||
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
|
}
|
||||||
|
throw new InternalServerException();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
}
|
}
|
||||||
@ -42,7 +48,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_FEES', mssql.Int, body.P_FEES);
|
request.input('P_FEES', mssql.Int, body.P_FEES);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateBasicFee');
|
const result = await request.execute('carnetsys.CreateBasicFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
}
|
}
|
||||||
@ -58,7 +68,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateBasicFee');
|
const result = await request.execute('carnetsys.UpdateBasicFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
}
|
}
|
||||||
@ -66,7 +80,7 @@ export class ManageFeeService {
|
|||||||
|
|
||||||
// Bond Rate Setup
|
// Bond Rate Setup
|
||||||
|
|
||||||
async GETBONDRATES(body: GetFeeGeneralDTO): Promise<any[]> {
|
async GETBONDRATES(body: GetFeeGeneralDTO): Promise<any[] | object> {
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: Connection;
|
||||||
try {
|
try {
|
||||||
@ -75,8 +89,14 @@ export class ManageFeeService {
|
|||||||
request.input('p_spid', mssql.Int, body.P_SPID);
|
request.input('p_spid', mssql.Int, body.P_SPID);
|
||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetBondRates');
|
const result = await request.execute('carnetsys.GetBondRates');
|
||||||
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
|
}
|
||||||
|
throw new InternalServerException();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
||||||
@ -100,7 +120,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_RATE', mssql.Float, body.P_RATE);
|
request.input('P_RATE', mssql.Float, body.P_RATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateBondRate');
|
const result = await request.execute('carnetsys.CreateBondRate');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -119,7 +143,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateBondRate');
|
const result = await request.execute('carnetsys.UpdateBondRate');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
}
|
}
|
||||||
@ -137,6 +165,10 @@ export class ManageFeeService {
|
|||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetCargoRates');
|
const result = await request.execute('carnetsys.GetCargoRates');
|
||||||
if (result.recordset) {
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
}
|
}
|
||||||
throw new BadRequestException();
|
throw new BadRequestException();
|
||||||
@ -161,7 +193,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_RATE', mssql.Float, body.P_RATE);
|
request.input('P_RATE', mssql.Float, body.P_RATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateCargoRate');
|
const result = await request.execute('carnetsys.CreateCargoRate');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -178,7 +214,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateCargoRate');
|
const result = await request.execute('carnetsys.UpdateCargoRate');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -197,6 +237,10 @@ export class ManageFeeService {
|
|||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetCFFeeRates');
|
const result = await request.execute('carnetsys.GetCFFeeRates');
|
||||||
if (result.recordset) {
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
}
|
}
|
||||||
throw new BadRequestException();
|
throw new BadRequestException();
|
||||||
@ -223,7 +267,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_RATE', mssql.Float, body.P_RATE);
|
request.input('P_RATE', mssql.Float, body.P_RATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateCFFee');
|
const result = await request.execute('carnetsys.CreateCFFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -242,7 +290,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateCFFee');
|
const result = await request.execute('carnetsys.UpdateCFFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -260,6 +312,10 @@ export class ManageFeeService {
|
|||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetCSFeeRates');
|
const result = await request.execute('carnetsys.GetCSFeeRates');
|
||||||
if (result.recordset) {
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
}
|
}
|
||||||
throw new BadRequestException();
|
throw new BadRequestException();
|
||||||
@ -284,7 +340,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_RATE', mssql.Float, body.P_RATE);
|
request.input('P_RATE', mssql.Float, body.P_RATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateCSFee');
|
const result = await request.execute('carnetsys.CreateCSFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -302,7 +362,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateCSFee');
|
const result = await request.execute('carnetsys.UpdateCSFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -321,6 +385,10 @@ export class ManageFeeService {
|
|||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetEFFeeRates');
|
const result = await request.execute('carnetsys.GetEFFeeRates');
|
||||||
if (result.recordset) {
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
}
|
}
|
||||||
throw new BadRequestException();
|
throw new BadRequestException();
|
||||||
@ -347,7 +415,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_FEES', mssql.Float, body.P_FEES);
|
request.input('P_FEES', mssql.Float, body.P_FEES);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateEFFee');
|
const result = await request.execute('carnetsys.CreateEFFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -365,7 +437,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateEFFee');
|
const result = await request.execute('carnetsys.UpdateEFFee');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -384,6 +460,10 @@ export class ManageFeeService {
|
|||||||
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
request.input('p_active_inactive', mssql.VarChar(8), body.P_ACTIVE_INACTIVE);
|
||||||
const result = await request.execute('carnetsys.GetFeecomm');
|
const result = await request.execute('carnetsys.GetFeecomm');
|
||||||
if (result.recordset) {
|
if (result.recordset) {
|
||||||
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
return result.recordset;
|
return result.recordset;
|
||||||
}
|
}
|
||||||
throw new BadRequestException();
|
throw new BadRequestException();
|
||||||
@ -409,7 +489,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.CreateFeeComm');
|
const result = await request.execute('carnetsys.CreateFeeComm');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 201, message: "Created Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
@ -426,7 +510,11 @@ export class ManageFeeService {
|
|||||||
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
request.input('P_EFFDATE', mssql.VarChar(100), body.P_EFFDATE);
|
||||||
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
request.input('P_USERID', mssql.VarChar(100), body.P_USERID);
|
||||||
const result = await request.execute('carnetsys.UpdateFeeComm');
|
const result = await request.execute('carnetsys.UpdateFeeComm');
|
||||||
return result.recordset;
|
if (result.recordset && result.recordset.length > 0 && result.recordset[0].ERRORMESG) {
|
||||||
|
this.logger.warn(`error from DB: ${result.recordset[0].ERRORMESG}`);
|
||||||
|
throw new BadRequestException(result.recordset[0].ERRORMESG);
|
||||||
|
}
|
||||||
|
return { statusCode: 200, message: "Updated Successfully" };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
throw new InternalServerException();
|
throw new InternalServerException();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user