BE/src/oracle/carnet-application/carnet-application.controller.ts

142 lines
4.8 KiB
TypeScript
Raw Normal View History

import { Body, Controller, Delete, Get, Param, Patch, Post, Put, UseGuards } from '@nestjs/common';
2025-02-24 10:32:41 +05:30
import { CarnetApplicationService } from './carnet-application.service';
import { ApiTags } from '@nestjs/swagger';
import {
AddCountriesDTO,
AddGenerallistItemsDTO,
CA_UpdateHolderDTO,
2025-07-14 20:39:12 +05:30
CarnetProcessingCenterDTO, CreateApplicationDTO, DeleteGenerallistItemsDTO, GetCarnetControlCenterDTO, SaveCarnetApplicationDTO, TransmitApplicationtoProcessDTO,
2025-02-24 10:32:41 +05:30
UpdateExpGoodsAuthRepDTO,
UpdateShippingDetailsDTO
} from 'src/dto/property.dto';
2025-06-17 17:14:27 +05:30
import { Roles } from 'src/decorators/roles.decorator';
2025-06-18 17:15:21 +05:30
import { JwtAuthGuard } from 'src/guards/jwt-auth.guard';
import { RolesGuard } from 'src/guards/roles.guard';
2025-02-24 10:32:41 +05:30
@ApiTags('Carnet Application - Oracle')
2025-06-18 17:15:21 +05:30
@UseGuards(JwtAuthGuard, RolesGuard)
2025-06-17 17:14:27 +05:30
@Roles('ca', 'sa')
2025-02-24 10:32:41 +05:30
@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')
2025-06-17 17:14:27 +05:30
@Roles('ca')
2025-02-24 10:32:41 +05:30
TransmitApplicationtoProcess(@Body() body: TransmitApplicationtoProcessDTO) {
return this.carnetApplicationService.TransmitApplicationtoProcess(body);
}
@Post('CreateApplication')
2025-06-17 17:14:27 +05:30
@Roles('ca')
2025-02-24 10:32:41 +05:30
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')
2025-07-14 20:39:12 +05:30
DeleteGenerallistItems(@Body() body: DeleteGenerallistItemsDTO) {
return this.carnetApplicationService.DeleteGenerallistItems(body);
}
2025-02-24 10:32:41 +05:30
@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);
}
2025-06-17 17:14:27 +05:30
2025-02-24 10:32:41 +05:30
@Patch('UpdatePrintCarnet')
UpdatePrintCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.UpdatePrintCarnet(body);
}
2025-06-17 17:14:27 +05:30
2025-02-24 10:32:41 +05:30
@Patch('VoidCarnet')
2025-06-17 17:14:27 +05:30
@Roles('sa')
2025-02-24 10:32:41 +05:30
VoidCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.VoidCarnet(body);
}
2025-06-17 17:14:27 +05:30
2025-02-24 10:32:41 +05:30
@Patch('DuplicateCarnet')
2025-06-17 17:14:27 +05:30
@Roles('ca')
2025-02-24 10:32:41 +05:30
DuplicateCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.DuplicateCarnet(body);
}
2025-06-17 17:14:27 +05:30
2025-02-24 10:32:41 +05:30
@Patch('CloseCarnet')
2025-06-17 17:14:27 +05:30
@Roles('sa')
2025-02-24 10:32:41 +05:30
CloseCarnet(@Body() body: CarnetProcessingCenterDTO) {
return this.carnetApplicationService.CloseCarnet(body);
}
2025-07-03 16:57:37 +05:30
// [ 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);
}
2025-07-03 16:57:37 +05:30
@Get('GetCountryDetailstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetCountryDetailstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetCountryDetailstoEdit(body);
}
2025-07-03 16:57:37 +05:30
@Get('GetShipPaymentDetailstoEdit/:P_SPID/:P_USERID/:P_HEADERID')
GetShipPaymentDetailstoEdit(@Param() body: GetCarnetControlCenterDTO) {
return this.carnetApplicationService.GetShipPaymentDetailstoEdit(body);
}
2025-02-24 10:32:41 +05:30
}