completed create part in manage fee
This commit is contained in:
parent
5dc6979560
commit
0d435c3411
@ -85,9 +85,9 @@ Content-Type: application/json
|
||||
|
||||
###
|
||||
|
||||
// CreateEeFee
|
||||
// CreateEfFee
|
||||
|
||||
POST http://localhost:3000/oracle/CreateEeFee
|
||||
POST http://localhost:3000/oracle/CreateEfFee
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
@ -103,4 +103,20 @@ Content-Type: application/json
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
|
||||
// CreateFeeComm
|
||||
|
||||
POST http://localhost:3000/oracle/CreateFeeComm
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"P_SPID": 0,
|
||||
"P_PARAMID": 0,
|
||||
"P_COMMRATE": 0,
|
||||
"P_EFFDATE": "",
|
||||
"P_USERID": ""
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
@ -1,6 +1,6 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { OracleDBService } from "src/db/db.service";
|
||||
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO } from "./oracle.dto";
|
||||
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO } from "./oracle.dto";
|
||||
import * as oracledb from 'oracledb';
|
||||
|
||||
@Injectable()
|
||||
@ -437,7 +437,67 @@ export class ManageFeeService {
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async CREATEFEECOMM() { }
|
||||
async CREATEFEECOMM(body: CreateFeeCommDTO) {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG. CREATEFEECOMM(
|
||||
:P_SPID,
|
||||
:P_PARAMID,
|
||||
:P_COMMRATE,
|
||||
:P_EFFDATE,
|
||||
:P_USERID,
|
||||
:P_CURSOR);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: body.P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER
|
||||
},
|
||||
P_PARAMID: {
|
||||
val: body.P_PARAMID,
|
||||
type: oracledb.DB_TYPE_NUMBER
|
||||
},
|
||||
P_COMMRATE: {
|
||||
val: body.P_COMMRATE,
|
||||
type: oracledb.DB_TYPE_NUMBER
|
||||
},
|
||||
P_EFFDATE: {
|
||||
val: body.P_EFFDATE,
|
||||
type: oracledb.DB_TYPE_NVARCHAR
|
||||
},
|
||||
P_USERID: {
|
||||
val: body.P_USERID,
|
||||
type: oracledb.DB_TYPE_NVARCHAR
|
||||
},
|
||||
P_CURSOR: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
}, {
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
await connection.commit();
|
||||
|
||||
let fres = await result.outBinds.p_cursor.getRows();
|
||||
|
||||
return fres
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
|
||||
}
|
||||
async GETBASICFEERATES() { }
|
||||
async GETBONDRATES() { }
|
||||
async GETCARGORATES() { }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put, Query, UsePipes } from '@nestjs/common';
|
||||
import { OracleService } from './oracle.service';
|
||||
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCarnetSequenceDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateParamRecordDTO, CreateTableRecordDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateParamRecordDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto';
|
||||
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCarnetSequenceDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, CreateParamRecordDTO, CreateTableRecordDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateParamRecordDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto';
|
||||
import { ParamTableService } from './paramTable.service';
|
||||
import { ManageFeeService } from './manageFee.service';
|
||||
|
||||
@ -234,4 +234,9 @@ export class OracleController {
|
||||
return this.manageFeeService.CREATEEFFEE(body)
|
||||
}
|
||||
|
||||
@Post('/CreateFeeComm')
|
||||
CreateFeeComm(@Body() body: CreateFeeCommDTO) {
|
||||
return this.manageFeeService.CREATEFEECOMM(body)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -424,3 +424,20 @@ export class CreateEfFeeDTO {
|
||||
@IsString()
|
||||
P_USERID: string;
|
||||
}
|
||||
|
||||
export class CreateFeeCommDTO {
|
||||
@IsNumber()
|
||||
P_SPID: number;
|
||||
|
||||
@IsNumber()
|
||||
P_PARAMID: number;
|
||||
|
||||
@IsNumber()
|
||||
P_COMMRATE: number;
|
||||
|
||||
@IsString()
|
||||
P_EFFDATE: string;
|
||||
|
||||
@IsString()
|
||||
P_USERID: string;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user