updated faxno as optional every-where and create-logins response updated

This commit is contained in:
Kallesh B S 2025-06-16 17:05:11 +05:30
parent c79b37d2e0
commit 7334f93831
6 changed files with 46 additions and 22 deletions

View File

@ -29,6 +29,7 @@ export class CLIENT_CONTACTID_DTO {
@Min(0, { message: 'Property P_CLIENTCONTACTID must be at least 0 or more' }) @Min(0, { message: 'Property P_CLIENTCONTACTID must be at least 0 or more' })
@IsInt({ message: 'Property P_CLIENTCONTACTID allows only whole numbers' }) @IsInt({ message: 'Property P_CLIENTCONTACTID allows only whole numbers' })
@IsNumber({}, { message: 'Property P_CLIENTCONTACTID must be a number' }) @IsNumber({}, { message: 'Property P_CLIENTCONTACTID must be a number' })
@Transform(({ value }) => Number(value))
@IsDefined({ message: 'Property P_CLIENTCONTACTID is required' }) @IsDefined({ message: 'Property P_CLIENTCONTACTID is required' })
P_CLIENTCONTACTID: number; P_CLIENTCONTACTID: number;
} }

View File

@ -60,7 +60,7 @@ export class UpdateClientContactsDTO extends IntersectionType(
PartialType(MIDDLE_INITIAL_DTO), PartialType(MIDDLE_INITIAL_DTO),
PartialType(TITLE_DTO), PartialType(TITLE_DTO),
PHONE_NO_DTO, PHONE_NO_DTO,
FAX_NO_DTO, PartialType(FAX_NO_DTO),
PartialType(MOBILE_NO_DTO), PartialType(MOBILE_NO_DTO),
EMAIL_ADDRESS_DTO, EMAIL_ADDRESS_DTO,
USERID_DTO USERID_DTO

View File

@ -1,4 +1,4 @@
import { IntersectionType } from '@nestjs/swagger'; import { IntersectionType, PartialType } from '@nestjs/swagger';
import { import {
DEFAULT_CONTACT_FLAG_DTO, EMAIL_ADDRESS_DTO, FAX_NO_DTO, DEFAULT_CONTACT_FLAG_DTO, EMAIL_ADDRESS_DTO, FAX_NO_DTO,
@ -10,11 +10,11 @@ import { SPID_DTO } from '../sp/sp-property.dto';
export class InsertSPContactsDTO extends IntersectionType( export class InsertSPContactsDTO extends IntersectionType(
SPID_DTO, DEFAULT_CONTACT_FLAG_DTO, FIRSTNAME_DTO, LASTNAME_DTO, MIDDLE_INITIAL_DTO, TITLE_DTO, SPID_DTO, DEFAULT_CONTACT_FLAG_DTO, FIRSTNAME_DTO, LASTNAME_DTO, MIDDLE_INITIAL_DTO, TITLE_DTO,
PHONE_NO_DTO, MOBILE_NO_DTO, FAX_NO_DTO, EMAIL_ADDRESS_DTO, USER_ID_DTO PHONE_NO_DTO, MOBILE_NO_DTO, PartialType(FAX_NO_DTO), EMAIL_ADDRESS_DTO, USER_ID_DTO
) { } ) { }
export class UpdateSPContactsDTO extends IntersectionType( export class UpdateSPContactsDTO extends IntersectionType(
SP_CONTACTID_DTO, FIRSTNAME_DTO, LASTNAME_DTO, MIDDLE_INITIAL_DTO, TITLE_DTO, PHONE_NO_DTO, SP_CONTACTID_DTO, FIRSTNAME_DTO, LASTNAME_DTO, MIDDLE_INITIAL_DTO, TITLE_DTO, PHONE_NO_DTO,
MOBILE_NO_DTO, FAX_NO_DTO, EMAIL_ADDRESS_DTO, USER_ID_DTO MOBILE_NO_DTO, PartialType(FAX_NO_DTO), EMAIL_ADDRESS_DTO, USER_ID_DTO
) { } ) { }

View File

@ -16,10 +16,10 @@ export class OriginCheckMiddleware implements NestMiddleware {
req.headers['x-forwarded-for']?.toString().split(',')[0].trim() || req.headers['x-forwarded-for']?.toString().split(',')[0].trim() ||
req.socket.remoteAddress; req.socket.remoteAddress;
this.logger.warn(`Client IP: ${ip}`); // this.logger.warn(`Client IP: ${ip}`);
this.logger.warn(`User-Agent: ${req.headers['user-agent']}`); // this.logger.warn(`User-Agent: ${req.headers['user-agent']}`);
this.logger.warn(`Origin: ${origin}`); // this.logger.warn(`Origin: ${origin}`);
this.logger.warn(`Host: ${req.headers.host}`); // this.logger.warn(`Host: ${req.headers.host}`);
// if (origin === allowedOrigin) { // if (origin === allowedOrigin) {

View File

@ -397,13 +397,13 @@ export class ManageClientsService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEPREPARER_PKG.CreateClientContact( MANAGEPREPARER_PKG.SetDefaultClientContacts(
:P_SPID, :P_CLIENTID, :P_USERID, :P_CURSOR :P_SPID, :P_CLIENTCONTACTID, :P_USERID, :P_CURSOR
); );
END;`, END;`,
{ {
P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER }, P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER },
P_CLIENTID: { val: body.P_CLIENTCONTACTID, type: oracledb.DB_TYPE_NUMBER }, P_CLIENTCONTACTID: { val: body.P_CLIENTCONTACTID, type: oracledb.DB_TYPE_NUMBER },
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR }, P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT } P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
}, },
@ -441,13 +441,13 @@ export class ManageClientsService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEPREPARER_PKG.CreateClientContact( MANAGEPREPARER_PKG.InactivateClientContacts(
:P_SPID, :P_CLIENTID, :P_USERID, :P_CURSOR :P_SPID, :P_CLIENTCONTACTID, :P_USERID, :P_CURSOR
); );
END;`, END;`,
{ {
P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER }, P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER },
P_CLIENTID: { val: body.P_CLIENTCONTACTID, type: oracledb.DB_TYPE_NUMBER }, P_CLIENTCONTACTID: { val: body.P_CLIENTCONTACTID, type: oracledb.DB_TYPE_NUMBER },
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR }, P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT } P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
}, },
@ -485,13 +485,13 @@ export class ManageClientsService {
const result = await connection.execute( const result = await connection.execute(
`BEGIN `BEGIN
MANAGEPREPARER_PKG.CreateClientContact( MANAGEPREPARER_PKG.ReactivateClientContacts(
:P_SPID, :P_CLIENTID, :P_USERID, :P_CURSOR :P_SPID, :P_CLIENTCONTACTID, :P_USERID, :P_CURSOR
); );
END;`, END;`,
{ {
P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER }, P_SPID: { val: body.P_SPID, type: oracledb.DB_TYPE_NUMBER },
P_CLIENTID: { val: body.P_CLIENTCONTACTID, type: oracledb.DB_TYPE_NUMBER }, P_CLIENTCONTACTID: { val: body.P_CLIENTCONTACTID, type: oracledb.DB_TYPE_NUMBER },
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR }, P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT } P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
}, },

View File

@ -9,6 +9,7 @@ import {
EMAIL_DTO, USERID_DTO, EMAIL_DTO, USERID_DTO,
CreateClientLoginsDTO, CreateSPLoginsDTO, CreateUSCIBLoginsDTO, SPID_CLIENTID_DTO, SPID_EMAIL_DTO CreateClientLoginsDTO, CreateSPLoginsDTO, CreateUSCIBLoginsDTO, SPID_CLIENTID_DTO, SPID_EMAIL_DTO
} from 'src/dto/property.dto'; } from 'src/dto/property.dto';
import { BadRequestException } from 'src/exceptions/badRequest.exception';
interface RoleDetail { [key: string]: any; } interface RoleDetail { [key: string]: any; }
@ -172,9 +173,15 @@ export class UserMaintenanceService {
throw new InternalServerException("Incomplete data received from the database."); throw new InternalServerException("Incomplete data received from the database.");
} }
return { const fres: any = await fetchCursor(outBinds.P_CURSOR, UserMaintenanceService.name);
data: await fetchCursor(outBinds.P_CURSOR),
}; if (fres.length > 0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return { statusCode: 201, message: "Created successfully", ...fres[0] };
} catch (error) { } catch (error) {
handleError(error, UserMaintenanceService.name) handleError(error, UserMaintenanceService.name)
} finally { } finally {
@ -250,7 +257,15 @@ export class UserMaintenanceService {
throw new InternalServerException("Incomplete data received from the database."); throw new InternalServerException("Incomplete data received from the database.");
} }
return await fetchCursor(outBinds.P_CURSOR, UserMaintenanceService.name); const fres: any = await fetchCursor(outBinds.P_CURSOR, UserMaintenanceService.name);
if (fres.length > 0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return { statusCode: 201, message: "Created successfully", ...fres[0] };
} catch (error) { } catch (error) {
handleError(error, UserMaintenanceService.name) handleError(error, UserMaintenanceService.name)
} finally { } finally {
@ -359,7 +374,15 @@ export class UserMaintenanceService {
throw new InternalServerException("Incomplete data received from the database."); throw new InternalServerException("Incomplete data received from the database.");
} }
return await fetchCursor(outBinds.P_CURSOR, UserMaintenanceService.name); const fres: any = await fetchCursor(outBinds.P_CURSOR, UserMaintenanceService.name);
if (fres.length > 0 && fres[0].ERRORMESG) {
this.logger.warn(fres[0].ERRORMESG);
throw new BadRequestException(fres[0].ERRORMESG)
}
return { statusCode: 201, message: "Created successfully", ...fres[0] };
} catch (error) { } catch (error) {
handleError(error, UserMaintenanceService.name) handleError(error, UserMaintenanceService.name)
} finally { } finally {