BE/src/oracle/carnet-application/carnet-application.controller.ts
2025-07-09 15:48:47 +05:30

142 lines
4.7 KiB
TypeScript

import { Body, Controller, Delete, Get, Param, Patch, Post, Put, UseGuards } from '@nestjs/common';
import { CarnetApplicationService } from './carnet-application.service';
import { ApiTags } from '@nestjs/swagger';
import {
AddCountriesDTO,
AddGenerallistItemsDTO,
CA_UpdateHolderDTO,
CarnetProcessingCenterDTO, CreateApplicationDTO, GetCarnetControlCenterDTO, SaveCarnetApplicationDTO, TransmitApplicationtoProcessDTO,
UpdateExpGoodsAuthRepDTO,
UpdateShippingDetailsDTO
} from 'src/dto/property.dto';
import { Roles } from 'src/decorators/roles.decorator';
import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
import { RolesGuard } from 'src/guards/roles.guard';
@ApiTags('Carnet Application - Oracle')
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles('ca', 'sa')
@Controller('oracle')
export class CarnetApplicationController {
constructor(private readonly carnetApplicationService: CarnetApplicationService) { }
// [ CARNETAPPLICATION_PKG ]
@Post('SaveCarnetApplication')
async CreateClientData(@Body() body: SaveCarnetApplicationDTO) {
return this.carnetApplicationService.SaveCarnetApplication(body);
}
@Post('TransmitApplicationtoProcess')
@Roles('ca')
TransmitApplicationtoProcess(@Body() body: TransmitApplicationtoProcessDTO) {
return this.carnetApplicationService.TransmitApplicationtoProcess(body);
}
@Post('CreateApplication')
@Roles('ca')
CreateApplication(@Body() body: CreateApplicationDTO) {
return this.carnetApplicationService.CreateApplication(body);
}
@Patch('update-holder')
UpdateHolder(@Body() body: CA_UpdateHolderDTO) {
return this.carnetApplicationService.UpdateHolder(body);
}
@Patch('UpdateExpGoodsAuthRep')
UpdateExpGoodsAuthRep(@Body() body: UpdateExpGoodsAuthRepDTO) {
return this.carnetApplicationService.UpdateExpGoodsAuthRep(body);
}
@Post('AddGenerallistItems')
AddGenerallistItems(@Body() body: AddGenerallistItemsDTO) {
return this.carnetApplicationService.AddGenerallistItems(body);
}
@Post('AddCountries')
AddCountries(@Body() body: AddCountriesDTO) {
return this.carnetApplicationService.AddCountries(body);
}
@Put('EditGenerallistItems')
EditGenerallistItems(@Body() body: AddGenerallistItemsDTO) {
return this.carnetApplicationService.EditGenerallistItems(body);
}
@Delete('DeleteGenerallistItems')
DeleteGenerallistItems() {
return this.carnetApplicationService.DeleteGenerallistItems();
}
@Patch('UpdateShippingDetails')
UpdateShippingDetails(@Body() body: UpdateShippingDetailsDTO) {
return this.carnetApplicationService.UpdateShippingDetails(body);
}
// processing [ PROCESSINGCENTER_PKG ]
@Patch('ProcessOriginalCarnet')
ProcessOriginalCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.ProcessOriginalCarnet(body);
}
@Patch('UpdatePrintCarnet')
UpdatePrintCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.UpdatePrintCarnet(body);
}
@Patch('VoidCarnet')
@Roles('sa')
VoidCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.VoidCarnet(body);
}
@Patch('DuplicateCarnet')
@Roles('ca')
DuplicateCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.DuplicateCarnet(body);
}
@Patch('CloseCarnet')
@Roles('sa')
CloseCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.CloseCarnet(body);
}
// [ CARNETCONTROLCENTER_PKG ]
@Get('GetHolderstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetHolderstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetHolderstoEdit(body);
}
@Get('GetGoodsDetailstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetGoodsDetailstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetGoodsDetailstoEdit(body);
}
@Get('GetGoodsItemstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetGoodsItemstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetGoodsItemstoEdit(body);
}
@Get('GetCountryDetailstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetCountryDetailstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetCountryDetailstoEdit(body);
}
@Get('GetShipPaymentDetailstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetShipPaymentDetailstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetShipPaymentDetailstoEdit(body);
}
}