added and modified API
This commit is contained in:
parent
e272d303c7
commit
f7700b09a7
@ -112,7 +112,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.CreateClientData');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -131,7 +131,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.GetPreparerbyClientID');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -191,7 +191,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.UpdateClient');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -268,7 +268,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.CreateClientContact');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -327,7 +327,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.UpdateClientContacts');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -385,7 +385,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.UpdateClientlocations');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -461,7 +461,7 @@ export class ManageClientsService {
|
||||
const result = await request.execute('carnetsys.CreateClientLocation');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -516,7 +516,7 @@ export class ManageClientsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -569,7 +569,7 @@ export class ManageClientsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -621,7 +621,7 @@ export class ManageClientsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
|
||||
@ -1,100 +1,122 @@
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put } from '@nestjs/common';
|
||||
import { BadRequestException, Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { CreateHoldersDTO, GetHolderContactActivateOrInactivateDTO, GetHolderOrContactDTO, UpdateHolderContactDTO, UpdateHolderDTO } from 'src/oracle/manage-holders/manage-holders.dto';
|
||||
import { CreateHoldersDTO, GetHolderDTO, HolderActivateOrInactivateDTO, HolderContactActivateOrInactivateDTO, UpdateHolderContactDTO, UpdateHolderDTO } from 'src/oracle/manage-holders/manage-holders.dto';
|
||||
import { ManageHoldersService } from './manage-holders.service';
|
||||
|
||||
@Controller('mssql')
|
||||
export class ManageHoldersController {
|
||||
|
||||
constructor(private readonly manageHoldersService: ManageHoldersService) { }
|
||||
constructor(private readonly manageHoldersService: ManageHoldersService) { }
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Post('/CreateHolderData')
|
||||
CreateHolders(@Body() body: CreateHoldersDTO) {
|
||||
return this.manageHoldersService.CreateHolders(body);
|
||||
}
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Post('/CreateHolderData')
|
||||
CreateHolders(@Body() body: CreateHoldersDTO) {
|
||||
return this.manageHoldersService.CreateHolders(body);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Put('/UpdateHolder')
|
||||
UpdateHolder(@Body() body: UpdateHolderDTO) {
|
||||
return this.manageHoldersService.UpdateHolder(body);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Put('/UpdateHolderContact')
|
||||
UpdateHolderContact(@Body() body: UpdateHolderContactDTO) {
|
||||
return this.manageHoldersService.UpdateHolderContact(body);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Get('/GetHolderRecord/:p_spid/:p_holderid')
|
||||
GetHolderMaster(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.GetHolderRecord(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Get('/GetHolderContacts/:p_spid/:p_holderid')
|
||||
GetHolderContacts(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.GetHolderContacts(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/InactivateHolder/:p_spid/:p_holderid/:p_userid')
|
||||
InactivateHolder(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Put('/UpdateHolder')
|
||||
UpdateHolder(@Body() body: UpdateHolderDTO) {
|
||||
return this.manageHoldersService.UpdateHolder(body);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Put('/UpdateHolderContact')
|
||||
UpdateHolderContact(@Body() body: UpdateHolderContactDTO) {
|
||||
return this.manageHoldersService.UpdateHolderContact(body);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Get('/GetHolderRecord/:p_spid/:p_holderid')
|
||||
GetHolderMaster(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.GetHolderRecord(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Get('/GetHolderContacts/:p_spid/:p_holderid')
|
||||
GetHolderContacts(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.GetHolderContacts(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/InactivateHolder/:p_spid/:p_holderid')
|
||||
InactivateHolder(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.InactivateHolder(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/ReactivateHolder/:p_spid/:p_holderid')
|
||||
ReactivateHolder(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.ReactivateHolder(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/InactivateHolderContact/:p_spid/:p_holderContactid')
|
||||
InactivateHolderContact(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderContactid', ParseIntPipe) p_holderContactid: number,
|
||||
) {
|
||||
const reqParams: GetHolderContactActivateOrInactivateDTO = {
|
||||
p_spid,
|
||||
p_holderContactid,
|
||||
};
|
||||
|
||||
return this.manageHoldersService.InactivateHolderContact(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/ReactivateHolderContact/:p_spid/:p_holderContactid')
|
||||
ReactivateHolderContact(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderContactid: number,
|
||||
) {
|
||||
const reqParams: GetHolderContactActivateOrInactivateDTO = {
|
||||
p_spid,
|
||||
p_holderContactid,
|
||||
};
|
||||
|
||||
return this.manageHoldersService.ReactivateHolderContact(reqParams);
|
||||
}
|
||||
if(!p_userid){
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
const reqParams: HolderActivateOrInactivateDTO = { p_spid, p_holderid, p_userid };
|
||||
|
||||
return this.manageHoldersService.InactivateHolder(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/ReactivateHolder/:p_spid/:p_holderid/:p_userid')
|
||||
ReactivateHolder(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
if(!p_userid){
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
|
||||
const reqParams: HolderActivateOrInactivateDTO = { p_spid, p_holderid, p_userid };
|
||||
|
||||
return this.manageHoldersService.ReactivateHolder(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/InactivateHolderContact/:p_spid/:p_holderContactid/:p_userid')
|
||||
InactivateHolderContact(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderContactid', ParseIntPipe) p_holderContactid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
if(!p_userid){
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
|
||||
const reqParams: HolderContactActivateOrInactivateDTO = {
|
||||
p_spid,
|
||||
p_holderContactid,
|
||||
p_userid
|
||||
};
|
||||
|
||||
return this.manageHoldersService.InactivateHolderContact(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Mssql')
|
||||
@Patch('/ReactivateHolderContact/:p_spid/:p_holderContactid/:p_userid')
|
||||
ReactivateHolderContact(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderContactid', ParseIntPipe) p_holderContactid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
if(!p_userid){
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
|
||||
const reqParams: HolderContactActivateOrInactivateDTO = {
|
||||
p_spid,
|
||||
p_holderContactid,
|
||||
p_userid
|
||||
};
|
||||
|
||||
return this.manageHoldersService.ReactivateHolderContact(reqParams);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Connection, Request } from 'mssql';
|
||||
import { MssqlDBService } from 'src/db/db.service';
|
||||
import { CreateHoldersDTO, GetHolderContactActivateOrInactivateDTO, GetHolderOrContactDTO, UpdateHolderContactDTO, UpdateHolderDTO } from 'src/oracle/manage-holders/manage-holders.dto';
|
||||
import { CreateHoldersDTO, GetHolderDTO, HolderActivateOrInactivateDTO, HolderContactActivateOrInactivateDTO, UpdateHolderContactDTO, UpdateHolderDTO } from 'src/oracle/manage-holders/manage-holders.dto';
|
||||
import * as mssql from 'mssql';
|
||||
|
||||
@Injectable()
|
||||
@ -48,7 +48,7 @@ export class ManageHoldersService {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, finalBody.p_spid);
|
||||
request.input('p_clientlocationid', mssql.Int, finalBody.p_clientlocationid);
|
||||
request.input('p_holderno', mssql.VarChar(15), finalBody.p_holderno);
|
||||
@ -95,7 +95,7 @@ export class ManageHoldersService {
|
||||
const result = await request.execute('carnetsys.CreateHolderData');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -105,18 +105,18 @@ export class ManageHoldersService {
|
||||
|
||||
};
|
||||
|
||||
GetHolderRecord = async (body: GetHolderOrContactDTO) => {
|
||||
GetHolderRecord = async (body: GetHolderDTO) => {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
request.input('p_holderid', mssql.Int, body.p_holderid);
|
||||
|
||||
const result = await request.execute('carnetsys.GetHolderMaster');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -129,7 +129,7 @@ export class ManageHoldersService {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new mssql.Request(connection);
|
||||
const request: Request = new mssql.Request(connection);
|
||||
|
||||
request.input('p_holderid', mssql.Int, body.p_holderid);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
@ -152,7 +152,7 @@ export class ManageHoldersService {
|
||||
const result = await request.execute('carnetsys.UpdateHolders');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -166,7 +166,7 @@ export class ManageHoldersService {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new mssql.Request(connection);
|
||||
const request: Request = new mssql.Request(connection);
|
||||
|
||||
request.input('p_holdercontactid', mssql.Int, body.p_holdercontactid);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
@ -184,7 +184,7 @@ export class ManageHoldersService {
|
||||
const result = await request.execute('carnetsys.UpdateHolderContacts');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -193,19 +193,19 @@ export class ManageHoldersService {
|
||||
}
|
||||
};
|
||||
|
||||
GetHolderContacts = async (body: GetHolderOrContactDTO) => {
|
||||
GetHolderContacts = async (body: GetHolderDTO) => {
|
||||
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
request.input('p_holderid', mssql.Int, body.p_holderid);
|
||||
|
||||
const result = await request.execute('carnetsys.GetHolderContacts');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -214,18 +214,21 @@ export class ManageHoldersService {
|
||||
}
|
||||
};
|
||||
|
||||
InactivateHolder = async (body: GetHolderOrContactDTO) => {
|
||||
InactivateHolder = async (body: HolderActivateOrInactivateDTO) => {
|
||||
|
||||
console.log(body);
|
||||
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
request.input('p_holderid', mssql.Int, body.p_holderid);
|
||||
|
||||
request.input('p_userid', mssql.VarChar(100), body.p_userid);
|
||||
const result = await request.execute('carnetsys.InactivateHolder');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -234,18 +237,19 @@ export class ManageHoldersService {
|
||||
}
|
||||
};
|
||||
|
||||
ReactivateHolder = async (body: GetHolderOrContactDTO) => {
|
||||
ReactivateHolder = async (body: HolderActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
request.input('p_holderid', mssql.Int, body.p_holderid);
|
||||
request.input('p_userid', mssql.VarChar(100), body.p_userid);
|
||||
|
||||
const result = await request.execute('carnetsys.ReactivateHolder');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -254,18 +258,19 @@ export class ManageHoldersService {
|
||||
}
|
||||
};
|
||||
|
||||
InactivateHolderContact = async (body: GetHolderContactActivateOrInactivateDTO) => {
|
||||
InactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
request.input('p_holderContactid', mssql.Int, body.p_holderContactid);
|
||||
request.input('p_userid', mssql.VarChar(100), body.p_userid);
|
||||
|
||||
const result = await request.execute('carnetsys.InactivateHolderContact');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
@ -274,18 +279,19 @@ export class ManageHoldersService {
|
||||
}
|
||||
};
|
||||
|
||||
ReactivateHolderContact = async (body: GetHolderContactActivateOrInactivateDTO) => {
|
||||
ReactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request:Request = new Request(connection);
|
||||
const request: Request = new Request(connection);
|
||||
request.input('p_spid', mssql.Int, body.p_spid);
|
||||
request.input('p_holderContactid', mssql.Int, body.p_holderContactid);
|
||||
|
||||
request.input('p_userid', mssql.VarChar(100), body.p_userid);
|
||||
|
||||
const result = await request.execute('carnetsys.ReactivateHolderContact');
|
||||
return { data: result.recordset };
|
||||
} catch (error) {
|
||||
|
||||
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
|
||||
@ -14,9 +14,9 @@ export class CarnetSequenceController {
|
||||
return this.carnetSequenceService.getCarnetSequence(body);
|
||||
}
|
||||
|
||||
// @ApiTags('Carnet Sequence - Mssql')
|
||||
// @Post('/CreateCarnetSequence/')
|
||||
// createCarnetSequence(@Body() body: CreateCarnetSequenceDTO) {
|
||||
// return this.carnetSequenceService.createCarnetSequence(body);
|
||||
// }
|
||||
@ApiTags('Carnet Sequence - Mssql')
|
||||
@Post('/CreateCarnetSequence/')
|
||||
createCarnetSequence(@Body() body: CreateCarnetSequenceDTO) {
|
||||
return this.carnetSequenceService.createCarnetSequence(body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export class CarnetSequenceService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error executing stored procedure:', error);
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -43,7 +43,7 @@ export class CarnetSequenceService {
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error executing stored procedure:', error);
|
||||
return { error: error.message }
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Patch, Post } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { RegionService } from './region.service';
|
||||
import { InsertRegionsDto } from 'src/oracle/uscib-managed-sp/region/region.dto';
|
||||
import { InsertRegionsDto, UpdateRegionDto } from 'src/oracle/uscib-managed-sp/region/region.dto';
|
||||
|
||||
@Controller('mssql')
|
||||
export class RegionController {
|
||||
|
||||
constructor(private readonly regionService:RegionService){}
|
||||
constructor(private readonly regionService: RegionService) { }
|
||||
|
||||
@ApiTags('Regions - Mssql')
|
||||
@Get('/GetRegions')
|
||||
@ -19,4 +19,10 @@ export class RegionController {
|
||||
insertRegions(@Body() body: InsertRegionsDto) {
|
||||
return this.regionService.insetNewRegions(body);
|
||||
}
|
||||
|
||||
@ApiTags('Regions - Mssql')
|
||||
@Patch('/UpdateRegion')
|
||||
updateRegions(@Body() body: UpdateRegionDto) {
|
||||
return this.regionService.updateRegions(body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Connection, Request } from 'mssql';
|
||||
import { MssqlDBService } from 'src/db/db.service';
|
||||
import { InsertRegionsDto } from 'src/oracle/uscib-managed-sp/region/region.dto';
|
||||
import { InsertRegionsDto, UpdateRegionDto } from 'src/oracle/uscib-managed-sp/region/region.dto';
|
||||
import * as mssql from 'mssql';
|
||||
|
||||
@Injectable()
|
||||
@ -18,7 +18,7 @@ export class RegionService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error executing stored procedure:', error);
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -26,7 +26,7 @@ export class RegionService {
|
||||
}
|
||||
}
|
||||
|
||||
async insetNewRegions(body:InsertRegionsDto) {
|
||||
async insetNewRegions(body: InsertRegionsDto) {
|
||||
|
||||
let connection: Connection;
|
||||
try {
|
||||
@ -38,7 +38,26 @@ export class RegionService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async updateRegions(body: UpdateRegionDto){
|
||||
let connection: Connection;
|
||||
try {
|
||||
connection = await this.mssqlDBService.getConnection();
|
||||
const request = new Request(connection);
|
||||
request.input('p_regionID', mssql.Int, body.p_regionID);
|
||||
request.input('P_NAME', mssql.VarChar(mssql.MAX), body.p_name);
|
||||
const result = await request.execute('carnetsys.UpdateRegion');
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
|
||||
@ -20,7 +20,7 @@ export class SpContactsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -39,7 +39,7 @@ export class SpContactsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -58,7 +58,7 @@ export class SpContactsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -86,8 +86,7 @@ export class SpContactsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message }
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -105,8 +104,7 @@ export class SpContactsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message }
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -133,8 +131,7 @@ export class SpContactsService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message }
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
|
||||
@ -26,9 +26,9 @@ export class SpController {
|
||||
return this.spService.insertNewServiceProvider(body);
|
||||
}
|
||||
|
||||
// @ApiTags('SP - Mssql')
|
||||
// @Put('/UpdateServiceProvider')
|
||||
// updateServiceProider(@Body() body: UpdateServiceProviderDTO) {
|
||||
// return this.spService.updateServiceProvider(body);
|
||||
// }
|
||||
@ApiTags('SP - Mssql')
|
||||
@Put('/UpdateServiceProvider')
|
||||
updateServiceProider(@Body() body: UpdateServiceProviderDTO) {
|
||||
return this.spService.updateServiceProvider(body);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ export class SpService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -38,7 +38,7 @@ export class SpService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -71,7 +71,7 @@ export class SpService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
@ -105,7 +105,7 @@ export class SpService {
|
||||
return { data: result.recordset };
|
||||
|
||||
} catch (error) {
|
||||
return {error:error.message}
|
||||
return { error: error.message };
|
||||
} finally {
|
||||
if (connection) {
|
||||
connection.close();
|
||||
|
||||
@ -10,7 +10,7 @@ import {
|
||||
|
||||
@Injectable()
|
||||
export class HomePageService {
|
||||
constructor(private readonly oracleDBService: OracleDBService) {}
|
||||
constructor(private readonly oracleDBService: OracleDBService) { }
|
||||
|
||||
async GetHomePageData(P_spid: number) {
|
||||
let connection;
|
||||
@ -490,32 +490,32 @@ export class HomePageService {
|
||||
|
||||
const GLTABLE_ARRAY = finalBody.p_gltable
|
||||
? await Promise.all(
|
||||
finalBody.p_gltable.map(async (x: p_gltableDTO) => {
|
||||
return await createGLArrayInstance(
|
||||
connection,
|
||||
x.ItemNo,
|
||||
x.ItemDescription,
|
||||
x.ItemValue,
|
||||
x.Noofpieces,
|
||||
x.ItemWeight,
|
||||
x.ItemWeightUOM,
|
||||
x.GoodsOriginCountry,
|
||||
);
|
||||
}),
|
||||
)
|
||||
finalBody.p_gltable.map(async (x: p_gltableDTO) => {
|
||||
return await createGLArrayInstance(
|
||||
connection,
|
||||
x.ItemNo,
|
||||
x.ItemDescription,
|
||||
x.ItemValue,
|
||||
x.Noofpieces,
|
||||
x.ItemWeight,
|
||||
x.ItemWeightUOM,
|
||||
x.GoodsOriginCountry,
|
||||
);
|
||||
}),
|
||||
)
|
||||
: [];
|
||||
|
||||
const CARNETCOUNTRYTABLE_ARRAY = finalBody.p_countrytable
|
||||
? await Promise.all(
|
||||
finalBody.p_countrytable.map(async (x) => {
|
||||
return await createCarnetCountryArrayInstance(
|
||||
connection,
|
||||
x.VisitTransitInd,
|
||||
x.CountryCode,
|
||||
x.NoOfTimesEntLeave,
|
||||
);
|
||||
}),
|
||||
)
|
||||
finalBody.p_countrytable.map(async (x) => {
|
||||
return await createCarnetCountryArrayInstance(
|
||||
connection,
|
||||
x.VisitTransitInd,
|
||||
x.CountryCode,
|
||||
x.NoOfTimesEntLeave,
|
||||
);
|
||||
}),
|
||||
)
|
||||
: [];
|
||||
|
||||
const GLTABLE_INSTANCE = new GLTABLE(GLTABLE_ARRAY);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import {
|
||||
BadRequestException,
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
@ -11,16 +12,17 @@ import {
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
CreateHoldersDTO,
|
||||
GetHolderContactActivateOrInactivateDTO,
|
||||
GetHolderOrContactDTO,
|
||||
GetHolderDTO,
|
||||
HolderActivateOrInactivateDTO,
|
||||
HolderContactActivateOrInactivateDTO,
|
||||
UpdateHolderContactDTO,
|
||||
UpdateHolderDTO,
|
||||
UpdateHolderDTO
|
||||
} from './manage-holders.dto';
|
||||
import { ManageHoldersService } from './manage-holders.service';
|
||||
|
||||
@Controller('oracle')
|
||||
export class ManageHoldersController {
|
||||
constructor(private readonly manageHoldersService: ManageHoldersService) {}
|
||||
constructor(private readonly manageHoldersService: ManageHoldersService) { }
|
||||
|
||||
@ApiTags('Manage Holders - Oracle')
|
||||
@Post('/CreateHolderData')
|
||||
@ -47,7 +49,7 @@ export class ManageHoldersController {
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
const reqParams: GetHolderDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.GetHolderRecord(reqParams);
|
||||
}
|
||||
@ -58,56 +60,78 @@ export class ManageHoldersController {
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
const reqParams: GetHolderDTO = { p_spid, p_holderid };
|
||||
|
||||
return this.manageHoldersService.GetHolderContacts(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Oracle')
|
||||
@Patch('/InactivateHolder/:p_spid/:p_holderid')
|
||||
@Patch('/InactivateHolder/:p_spid/:p_holderid/:p_userid')
|
||||
InactivateHolder(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
if (!p_userid) {
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
const reqParams: HolderActivateOrInactivateDTO = { p_spid, p_holderid, p_userid };
|
||||
|
||||
return this.manageHoldersService.InactivateHolder(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Oracle')
|
||||
@Patch('/ReactivateHolder/:p_spid/:p_holderid')
|
||||
@Patch('/ReactivateHolder/:p_spid/:p_holderid/:p_userid')
|
||||
ReactivateHolder(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
||||
if (!p_userid) {
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
|
||||
const reqParams: HolderActivateOrInactivateDTO = { p_spid, p_holderid, p_userid };
|
||||
|
||||
return this.manageHoldersService.ReactivateHolder(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Oracle')
|
||||
@Patch('/InactivateHolderContact/:p_spid/:p_holderContactid')
|
||||
@Patch('/InactivateHolderContact/:p_spid/:p_holderContactid/:p_userid')
|
||||
InactivateHolderContact(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderContactid', ParseIntPipe) p_holderContactid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
const reqParams: GetHolderContactActivateOrInactivateDTO = {
|
||||
|
||||
if (!p_userid) {
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
|
||||
const reqParams: HolderContactActivateOrInactivateDTO = {
|
||||
p_spid,
|
||||
p_holderContactid,
|
||||
p_userid
|
||||
};
|
||||
|
||||
return this.manageHoldersService.InactivateHolderContact(reqParams);
|
||||
}
|
||||
|
||||
@ApiTags('Manage Holders - Oracle')
|
||||
@Patch('/ReactivateHolderContact/:p_spid/:p_holderContactid')
|
||||
@Patch('/ReactivateHolderContact/:p_spid/:p_holderContactid/:p_userid')
|
||||
ReactivateHolderContact(
|
||||
@Param('p_spid', ParseIntPipe) p_spid: number,
|
||||
@Param('p_holderid', ParseIntPipe) p_holderContactid: number,
|
||||
@Param('p_userid') p_userid: string
|
||||
) {
|
||||
const reqParams: GetHolderContactActivateOrInactivateDTO = {
|
||||
if (!p_userid) {
|
||||
throw new BadRequestException("Bad Request");
|
||||
}
|
||||
|
||||
const reqParams: HolderContactActivateOrInactivateDTO = {
|
||||
p_spid,
|
||||
p_holderContactid,
|
||||
p_userid
|
||||
};
|
||||
|
||||
return this.manageHoldersService.ReactivateHolderContact(reqParams);
|
||||
|
||||
@ -450,7 +450,7 @@ export class UpdateHolderContactDTO {
|
||||
p_userid: string;
|
||||
}
|
||||
|
||||
export class GetHolderOrContactDTO {
|
||||
export class GetHolderDTO {
|
||||
@ApiProperty({ required: true })
|
||||
@Max(999999999, { message: 'Property p_spid must not exceed 999999999' })
|
||||
@Min(0, { message: 'Property p_spid must be at least 0 or more' })
|
||||
@ -468,7 +468,33 @@ export class GetHolderOrContactDTO {
|
||||
p_holderid: number;
|
||||
}
|
||||
|
||||
export class GetHolderContactActivateOrInactivateDTO {
|
||||
export class HolderActivateOrInactivateDTO {
|
||||
@ApiProperty({ required: true })
|
||||
@Max(999999999, { message: 'Property p_spid must not exceed 999999999' })
|
||||
@Min(0, { message: 'Property p_spid must be at least 0 or more' })
|
||||
@IsInt({ message: 'Property p_spid allows only whole numbers' })
|
||||
@IsNumber({}, { message: 'Property p_spid must be a number' })
|
||||
@IsDefined({ message: 'Property p_spid is required' })
|
||||
p_spid: number;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@Max(999999999, { message: 'Property p_holderid must not exceed 999999999' })
|
||||
@Min(0, { message: 'Property p_holderid must be at least 0 or more' })
|
||||
@IsInt({ message: 'Property p_holderid allows only whole numbers' })
|
||||
@IsNumber({}, { message: 'Property p_holderid must be a number' })
|
||||
@IsDefined({ message: 'Property p_holderid is required' })
|
||||
p_holderid: number;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@Length(0, 100, {
|
||||
message: 'Property p_userid must be between 0 to 100 characters',
|
||||
})
|
||||
@IsString({ message: 'Property p_userid must be a string' })
|
||||
@IsDefined({ message: 'Property p_userid is required' })
|
||||
p_userid: string;
|
||||
}
|
||||
|
||||
export class HolderContactActivateOrInactivateDTO {
|
||||
@ApiProperty({ required: true })
|
||||
@Max(999999999, { message: 'Property p_spid must not exceed 999999999' })
|
||||
@Min(0, { message: 'Property p_spid must be at least 0 or more' })
|
||||
@ -484,4 +510,12 @@ export class GetHolderContactActivateOrInactivateDTO {
|
||||
@IsNumber({}, { message: 'Property p_holderid must be a number' })
|
||||
@IsDefined({ message: 'Property p_holderid is required' })
|
||||
p_holderContactid: number;
|
||||
|
||||
@ApiProperty({ required: true })
|
||||
@Length(0, 100, {
|
||||
message: 'Property p_userid must be between 0 to 100 characters',
|
||||
})
|
||||
@IsString({ message: 'Property p_userid must be a string' })
|
||||
@IsDefined({ message: 'Property p_userid is required' })
|
||||
p_userid: string;
|
||||
}
|
||||
|
||||
@ -2,8 +2,9 @@ import { Injectable } from '@nestjs/common';
|
||||
import { OracleDBService } from 'src/db/db.service';
|
||||
import {
|
||||
CreateHoldersDTO,
|
||||
GetHolderContactActivateOrInactivateDTO,
|
||||
GetHolderOrContactDTO,
|
||||
GetHolderDTO,
|
||||
HolderActivateOrInactivateDTO,
|
||||
HolderContactActivateOrInactivateDTO,
|
||||
p_contactstableDTO,
|
||||
UpdateHolderContactDTO,
|
||||
UpdateHolderDTO,
|
||||
@ -13,7 +14,7 @@ import { Connection, Result } from 'oracledb';
|
||||
|
||||
@Injectable()
|
||||
export class ManageHoldersService {
|
||||
constructor(private readonly oracleDBService: OracleDBService) {}
|
||||
constructor(private readonly oracleDBService: OracleDBService) { }
|
||||
|
||||
CreateHolders = async (body: CreateHoldersDTO) => {
|
||||
const newBody = {
|
||||
@ -52,7 +53,7 @@ export class ManageHoldersService {
|
||||
|
||||
const finalBody: CreateHoldersDTO = { ...newBody, ...reqBody };
|
||||
|
||||
let connection:Connection;
|
||||
let connection: Connection;
|
||||
let p_holdercursor_rows = [];
|
||||
let p_holdercontactcursor_rows = [];
|
||||
try {
|
||||
@ -86,7 +87,7 @@ export class ManageHoldersService {
|
||||
MobileNo,
|
||||
FaxNo,
|
||||
) {
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`SELECT CARNETSYS.CONTACTSARRAY(:FirstName, :LastName, :MiddleInitial, :Title, :EmailAddress, :PhoneNo, :MobileNo, :FaxNo) FROM dual`,
|
||||
{
|
||||
FirstName,
|
||||
@ -104,26 +105,26 @@ export class ManageHoldersService {
|
||||
|
||||
const CONTACTSARRAY = finalBody.p_contactstable
|
||||
? await Promise.all(
|
||||
finalBody.p_contactstable.map(async (x: p_contactstableDTO) => {
|
||||
return await CREATECONTACTSTABLE_INSTANCE(
|
||||
connection,
|
||||
x.FirstName,
|
||||
x.LastName,
|
||||
x.MiddleInitial,
|
||||
x.Title,
|
||||
x.EmailAddress,
|
||||
x.PhoneNo,
|
||||
x.MobileNo,
|
||||
x.FaxNo,
|
||||
);
|
||||
}),
|
||||
)
|
||||
finalBody.p_contactstable.map(async (x: p_contactstableDTO) => {
|
||||
return await CREATECONTACTSTABLE_INSTANCE(
|
||||
connection,
|
||||
x.FirstName,
|
||||
x.LastName,
|
||||
x.MiddleInitial,
|
||||
x.Title,
|
||||
x.EmailAddress,
|
||||
x.PhoneNo,
|
||||
x.MobileNo,
|
||||
x.FaxNo,
|
||||
);
|
||||
}),
|
||||
)
|
||||
: [];
|
||||
|
||||
// Create an instance of GLTABLE
|
||||
const CONTACTSTABLE_INSTANCE = new CONTACTSTABLE(CONTACTSARRAY);
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEHOLDER_PKG.CreateHolderData(
|
||||
:p_spid,
|
||||
@ -319,7 +320,7 @@ export class ManageHoldersService {
|
||||
|
||||
const finalBody = { ...newBody, ...reqBody };
|
||||
|
||||
let connection:Connection;
|
||||
let connection: Connection;
|
||||
let P_cursor_rows = [];
|
||||
try {
|
||||
connection = await this.oracleDBService.getConnection();
|
||||
@ -327,7 +328,7 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEHOLDER_PKG.UpdateHolders(
|
||||
:p_holderid,
|
||||
@ -459,8 +460,8 @@ export class ManageHoldersService {
|
||||
}
|
||||
}
|
||||
};
|
||||
GetHolderRecord = async (body: GetHolderOrContactDTO) => {
|
||||
let connection:Connection;
|
||||
GetHolderRecord = async (body: GetHolderDTO) => {
|
||||
let connection: Connection;
|
||||
let p_cursor_rows = [];
|
||||
|
||||
try {
|
||||
@ -469,7 +470,7 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEHOLDER_PKG.GetHolderMaster(
|
||||
:p_spid,
|
||||
@ -548,7 +549,7 @@ export class ManageHoldersService {
|
||||
|
||||
const finalBody: UpdateHolderContactDTO = { ...newBody, ...reqBody };
|
||||
|
||||
let connection:Connection;
|
||||
let connection: Connection;
|
||||
let P_cursor_rows = [];
|
||||
try {
|
||||
connection = await this.oracleDBService.getConnection();
|
||||
@ -556,7 +557,7 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEHOLDER_PKG.UpdateHolders(
|
||||
:p_holdercontactid,
|
||||
@ -658,8 +659,8 @@ export class ManageHoldersService {
|
||||
}
|
||||
}
|
||||
};
|
||||
GetHolderContacts = async (body: GetHolderOrContactDTO) => {
|
||||
let connection:Connection;
|
||||
GetHolderContacts = async (body: GetHolderDTO) => {
|
||||
let connection: Connection;
|
||||
let p_cursor_rows = [];
|
||||
|
||||
try {
|
||||
@ -668,7 +669,7 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEHOLDER_PKG.GetHolderContacts(
|
||||
:p_spid,
|
||||
@ -716,8 +717,8 @@ export class ManageHoldersService {
|
||||
}
|
||||
}
|
||||
};
|
||||
InactivateHolder = async (body: GetHolderOrContactDTO) => {
|
||||
let connection:Connection;
|
||||
InactivateHolder = async (body: HolderActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
let p_cursor_rows = [];
|
||||
|
||||
try {
|
||||
@ -726,11 +727,12 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
ManageHolder_Pkg.InactivateHolder(
|
||||
:p_spid,
|
||||
:p_holderid,
|
||||
:p_userid,
|
||||
:p_cursor
|
||||
);
|
||||
END;`,
|
||||
@ -743,6 +745,10 @@ export class ManageHoldersService {
|
||||
val: body.p_holderid,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_userid: {
|
||||
val: body.p_userid,
|
||||
type: oracledb.DB_TYPE_NVARCHAR,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT,
|
||||
@ -774,8 +780,8 @@ export class ManageHoldersService {
|
||||
}
|
||||
}
|
||||
};
|
||||
ReactivateHolder = async (body: GetHolderOrContactDTO) => {
|
||||
let connection:Connection;
|
||||
ReactivateHolder = async (body: HolderActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
let p_cursor_rows = [];
|
||||
|
||||
try {
|
||||
@ -784,11 +790,12 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
ManageHolder_Pkg.ReactivateHolder(
|
||||
:p_spid,
|
||||
:p_holderid,
|
||||
:p_p_userid,
|
||||
:p_cursor
|
||||
);
|
||||
END;`,
|
||||
@ -801,6 +808,10 @@ export class ManageHoldersService {
|
||||
val: body.p_holderid,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_userid: {
|
||||
val: body.p_userid,
|
||||
type: oracledb.DB_TYPE_NVARCHAR,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT,
|
||||
@ -832,8 +843,8 @@ export class ManageHoldersService {
|
||||
}
|
||||
}
|
||||
};
|
||||
InactivateHolderContact = async (body: GetHolderContactActivateOrInactivateDTO) => {
|
||||
let connection:Connection;
|
||||
InactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
let p_cursor_rows = [];
|
||||
|
||||
try {
|
||||
@ -842,11 +853,12 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
ManageHolder_Pkg.InactivateHolderContact(
|
||||
:p_spid,
|
||||
:p_holderid,
|
||||
:p_holderContactid,
|
||||
:p_userid,
|
||||
:p_cursor
|
||||
);
|
||||
END;`,
|
||||
@ -855,10 +867,14 @@ export class ManageHoldersService {
|
||||
val: body.p_spid,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_holderid: {
|
||||
p_holderContactid: {
|
||||
val: body.p_holderContactid,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_userid: {
|
||||
val: body.p_userid,
|
||||
type: oracledb.DB_TYPE_NVARCHAR,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT,
|
||||
@ -890,8 +906,8 @@ export class ManageHoldersService {
|
||||
}
|
||||
}
|
||||
};
|
||||
ReactivateHolderContact = async (body: GetHolderContactActivateOrInactivateDTO) => {
|
||||
let connection:Connection;
|
||||
ReactivateHolderContact = async (body: HolderContactActivateOrInactivateDTO) => {
|
||||
let connection: Connection;
|
||||
let p_cursor_rows = [];
|
||||
|
||||
try {
|
||||
@ -900,11 +916,12 @@ export class ManageHoldersService {
|
||||
throw new Error('No DB Connected');
|
||||
}
|
||||
|
||||
const result:Result<any> = await connection.execute(
|
||||
const result: Result<any> = await connection.execute(
|
||||
`BEGIN
|
||||
ManageHolder_Pkg.ReactivateHolderContact(
|
||||
:p_spid,
|
||||
:p_holderid,
|
||||
:p_holderContactid,
|
||||
:p_userid,
|
||||
:p_cursor
|
||||
);
|
||||
END;`,
|
||||
@ -913,10 +930,14 @@ export class ManageHoldersService {
|
||||
val: body.p_spid,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_holderid: {
|
||||
p_holderContactid: {
|
||||
val: body.p_holderContactid,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_userid: {
|
||||
val: body.p_userid,
|
||||
type: oracledb.DB_TYPE_NVARCHAR,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user