2025-04-21 11:00:34 +05:30
|
|
|
import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put } from '@nestjs/common';
|
2025-04-16 17:19:35 +05:30
|
|
|
import { ApiTags } from '@nestjs/swagger';
|
2025-04-21 11:00:34 +05:30
|
|
|
import { CreateHoldersDTO, GetHolderContactActivateOrInactivateDTO, GetHolderOrContactDTO, UpdateHolderContactDTO, UpdateHolderDTO } from 'src/oracle/manage-holders/manage-holders.dto';
|
2025-04-16 17:19:35 +05:30
|
|
|
import { ManageHoldersService } from './manage-holders.service';
|
|
|
|
|
|
|
|
|
|
@Controller('mssql')
|
|
|
|
|
export class ManageHoldersController {
|
|
|
|
|
|
|
|
|
|
constructor(private readonly manageHoldersService: ManageHoldersService) { }
|
|
|
|
|
|
|
|
|
|
@ApiTags('Manage Holders - Mssql')
|
2025-04-21 11:00:34 +05:30
|
|
|
@Post('/CreateHolderData')
|
|
|
|
|
CreateHolders(@Body() body: CreateHoldersDTO) {
|
2025-04-16 17:19:35 +05:30
|
|
|
return this.manageHoldersService.CreateHolders(body);
|
2025-04-21 11:00:34 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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(
|
2025-04-16 17:19:35 +05:30
|
|
|
@Param('p_spid', ParseIntPipe) p_spid: number,
|
|
|
|
|
@Param('p_holderid', ParseIntPipe) p_holderid: number,
|
2025-04-21 11:00:34 +05:30
|
|
|
) {
|
2025-04-16 17:19:35 +05:30
|
|
|
const reqParams: GetHolderOrContactDTO = { p_spid, p_holderid };
|
2025-04-21 11:00:34 +05:30
|
|
|
|
2025-04-16 17:19:35 +05:30
|
|
|
return this.manageHoldersService.GetHolderRecord(reqParams);
|
2025-04-21 11:00:34 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@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);
|
|
|
|
|
}
|
2025-04-16 17:19:35 +05:30
|
|
|
}
|