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

101 lines
3.2 KiB
TypeScript
Raw Normal View History

2025-06-18 17:15:21 +05:30
import { Body, Controller, 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,
CarnetProcessingCenterDTO, CreateApplicationDTO, SaveCarnetApplicationDTO, TransmitApplicationtoProcessDTO,
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);
}
@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);
}
}