swagger updated

This commit is contained in:
Kallesh B S 2025-03-07 13:35:13 +05:30
parent d65df441bb
commit a82ef35a00
3 changed files with 28 additions and 16 deletions

View File

@ -1,9 +1,9 @@
import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put, Query, UsePipes } from '@nestjs/common'; import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put, Query, UsePipes } from '@nestjs/common';
import { OracleService } from './oracle.service'; import { OracleService } from './oracle.service';
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCarnetSequenceDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, CreateParamRecordDTO, CreateTableRecordDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateBasicFeeDTO, UpdateBondRateDTO, UpdateCargoRateDTO, UpdateCfFeeDTO, UpdateCsFeeDTO, UpdateEfFeeDTO, UpdateFeeCommDTO, UpdateParamRecordDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto'; import { ActivateOrInactivateParamRecordDTO, CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCarnetSequenceDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, CreateParamRecordDTO, CreateTableRecordDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateBasicFeeDTO, UpdateBondRateDTO, UpdateCargoRateDTO, UpdateCfFeeDTO, UpdateCsFeeDTO, UpdateEfFeeDTO, UpdateFeeCommDTO, UpdateParamRecordDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto';
import { ParamTableService } from './paramTable.service'; import { ParamTableService } from './paramTable.service';
import { ManageFeeService } from './manageFee.service'; import { ManageFeeService } from './manageFee.service';
import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { ApiOperation, ApiPropertyOptional, ApiQuery, ApiTags } from '@nestjs/swagger';
@Controller('oracle') @Controller('oracle')
export class OracleController { export class OracleController {
@ -173,6 +173,8 @@ export class OracleController {
@ApiTags('Param Table - Oracle') @ApiTags('Param Table - Oracle')
@Get('/GetParamValues') @Get('/GetParamValues')
@UsePipes() @UsePipes()
@ApiQuery({ name: 'id', required: false, type: Number, description: 'The ID of the parameter' })
@ApiQuery({ name: 'type', required: false, type: String, description: 'The type of the parameter' })
getParamValues( getParamValues(
@Query('id') id: string, @Query('id') id: string,
@Query('type') type: string @Query('type') type: string
@ -211,16 +213,15 @@ export class OracleController {
} }
@ApiTags('Param Table - Oracle') @ApiTags('Param Table - Oracle')
@Patch('/InActivateParamRecord') @Put('/InActivateParamRecord')
inActivateParamRecord(@Query('pid') pid,@Query('uid') uid) { inActivateParamRecord(@Body() body: ActivateOrInactivateParamRecordDTO) {
return this.paramTableService.INACTIVATEPARAMRECORD(pid?Number(pid):pid,uid) return this.paramTableService.INACTIVATEPARAMRECORD(body)
} }
@ApiTags('Param Table - Oracle') @ApiTags('Param Table - Oracle')
@Patch('/ReActivateParamRecord') @Put('/ReActivateParamRecord')
@ApiOperation({ summary: 'Retrieve all users', description: 'This endpoint returns a list of all users.' }) reActivateParamRecord(@Body() body: ActivateOrInactivateParamRecordDTO) {
reActivateParamRecord(@Query('pid') pid,@Query('uid') uid) { return this.paramTableService.REACTIVATEPARAMRECORD(body)
return this.paramTableService.REACTIVATEPARAMRECORD(pid?Number(pid):pid,uid)
} }

View File

@ -699,3 +699,14 @@ export class UpdateFeeCommDTO {
@IsString() @IsString()
P_USERID: string; P_USERID: string;
} }
export class ActivateOrInactivateParamRecordDTO{
@ApiProperty({required:true})
@IsNumber()
P_PARAMID:number;
@ApiProperty({required:true})
@IsString()
P_USERID:string;
}

View File

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { OracleDBService } from 'src/db/db.service'; import { OracleDBService } from 'src/db/db.service';
import * as oracledb from 'oracledb' import * as oracledb from 'oracledb'
import { UpdateParamRecordDTO } from './oracle.dto'; import { ActivateOrInactivateParamRecordDTO, UpdateParamRecordDTO } from './oracle.dto';
@Injectable() @Injectable()
export class ParamTableService { export class ParamTableService {
@ -301,7 +301,7 @@ export class ParamTableService {
} finally { } } finally { }
} }
async INACTIVATEPARAMRECORD(P_PARAMID: number, P_USERID: string) { async INACTIVATEPARAMRECORD(body:ActivateOrInactivateParamRecordDTO) {
let connection; let connection;
try { try {
// Connect to the Oracle database using oracledb // Connect to the Oracle database using oracledb
@ -318,11 +318,11 @@ export class ParamTableService {
END;`, END;`,
{ {
P_PARAMID: { P_PARAMID: {
val: P_PARAMID, val: body.P_PARAMID,
type: oracledb.DB_TYPE_NUMBER type: oracledb.DB_TYPE_NUMBER
}, },
P_USERID: { P_USERID: {
val: P_USERID, val: body.P_USERID,
type: oracledb.DB_TYPE_VARCHAR type: oracledb.DB_TYPE_VARCHAR
}, },
} }
@ -338,7 +338,7 @@ export class ParamTableService {
} finally { } } finally { }
} }
async REACTIVATEPARAMRECORD(P_PARAMID: number, P_USERID: string) { async REACTIVATEPARAMRECORD(body:ActivateOrInactivateParamRecordDTO) {
let connection; let connection;
try { try {
// Connect to the Oracle database using oracledb // Connect to the Oracle database using oracledb
@ -355,11 +355,11 @@ export class ParamTableService {
END;`, END;`,
{ {
P_PARAMID: { P_PARAMID: {
val: P_PARAMID, val: body.P_PARAMID,
type: oracledb.DB_TYPE_NUMBER type: oracledb.DB_TYPE_NUMBER
}, },
P_USERID: { P_USERID: {
val: P_USERID, val: body.P_USERID,
type: oracledb.DB_TYPE_VARCHAR type: oracledb.DB_TYPE_VARCHAR
}, },
}, },