added update shipping details API
This commit is contained in:
parent
0d4ac3e636
commit
d90c79fd67
@ -24,9 +24,8 @@ export class AuthController {
|
||||
if (k.access_token) {
|
||||
res.cookie('access_token', k.access_token, {
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: 'none',
|
||||
maxAge: 8 * 60 * 60 * 1000,
|
||||
secure: true,
|
||||
sameSite: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
@ -34,8 +33,7 @@ export class AuthController {
|
||||
res.cookie('refresh_token', k.refresh_token, {
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: 'none',
|
||||
maxAge: 8 * 60 * 60 * 1000,
|
||||
sameSite: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
@ -55,8 +53,16 @@ export class AuthController {
|
||||
const refreshToken = req.user?.refreshToken;
|
||||
let rst: any = await this.authService.logoutUser(refreshToken);
|
||||
if (rst.statusCode === 200) {
|
||||
res.clearCookie('access_token');
|
||||
res.clearCookie('refresh_token');
|
||||
res.clearCookie('access_token', {
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: 'none'
|
||||
});
|
||||
res.clearCookie('refresh_token', {
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: 'none'
|
||||
});
|
||||
}
|
||||
res.json({ ...rst })
|
||||
}
|
||||
|
||||
@ -266,11 +266,9 @@ export class AuthService {
|
||||
|
||||
try {
|
||||
const userSession = await this.getUserSession(username)
|
||||
|
||||
|
||||
|
||||
if (access_token && refresh_token && userSession.length > 0) {
|
||||
|
||||
|
||||
|
||||
const getSub: any = jwt.decode(refresh_token, { complete: true })
|
||||
|
||||
const user: any = await this.getUserDetailsById(getSub?.payload.sub)
|
||||
@ -348,15 +346,10 @@ export class AuthService {
|
||||
});
|
||||
|
||||
if (userResponse.status !== 200 || !Array.isArray(userResponse.data)) {
|
||||
console.log("userResponse : ", userResponse);
|
||||
console.log("userResponse status : ", userResponse.status);
|
||||
|
||||
throw new UnauthorizedException("Authentication failed");
|
||||
}
|
||||
|
||||
console.log("user response : ", userResponse);
|
||||
|
||||
|
||||
return userResponse.data;
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@ -180,6 +180,24 @@ export class ITEMNO_DTO{
|
||||
P_ITEMNO: number;
|
||||
}
|
||||
|
||||
export class SHIPCONTACTID_DTO{
|
||||
@ApiProperty({ required: true })
|
||||
@Max(99999, { message: 'Property P_SHIPCONTACTID must not exceed 99999' })
|
||||
@Min(0, { message: 'Property P_SHIPCONTACTID must be at least 0 or more' })
|
||||
@IsInt({ message: 'Property P_SHIPCONTACTID allows only whole numbers' })
|
||||
@Transform(({ value }) => Number(value))
|
||||
@IsNumber({}, { message: 'Property P_SHIPCONTACTID must be a number' })
|
||||
@IsDefined({ message: 'Property P_SHIPCONTACTID is required' })
|
||||
P_SHIPCONTACTID: number;
|
||||
}
|
||||
|
||||
export class SHIPNAME_DTO {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString({ message: 'Property P_SHIPNAME must be a string' })
|
||||
@IsDefined({ message: 'Property P_SHIPNAME is required' })
|
||||
P_SHIPNAME: string;
|
||||
}
|
||||
|
||||
export class USSETS_DTO {
|
||||
@ApiProperty({ required: true })
|
||||
// @Max(99999, { message: 'Property P_USSETS must not exceed 99999' })
|
||||
|
||||
@ -5,14 +5,15 @@ import {
|
||||
COUNTRYTABLE_DTO, CUSTCOURIERNO_DTO, DELIVERYMETHOD_DTO, DELIVERYTYPE_DTO,
|
||||
EXIBITIONS_FAIR_FLAG_DTO, FORMOFSECURITY_DTO, GLTABLE_DTO, HEADERID_DTO,
|
||||
HORSE_FLAG_DTO, INSPROTECTION_DTO, ITEMNO_DTO, LDIPROTECTION_DTO, ORDERTYPE_DTO, PAYMENTMETHOD_DTO,
|
||||
PROF_EQUIPMENT_FLAG_DTO, REFNO_DTO, SHIPADDRID_DTO, SHIPTOTYPE_DTO, USSETS_DTO
|
||||
PROF_EQUIPMENT_FLAG_DTO, REFNO_DTO, SHIPADDRID_DTO, SHIPCONTACTID_DTO, SHIPNAME_DTO, SHIPTOTYPE_DTO, USSETS_DTO
|
||||
} from "./carnet-application-property.dto";
|
||||
|
||||
import { NOTES_DTO, SPID_DTO, USERID_DTO } from "../uscib-managed-sp/sp/sp-property.dto";
|
||||
import { ADDRESS1_DTO, ADDRESS2_DTO, CITY_DTO, COUNTRY_DTO, NOTES_DTO, SPID_DTO, STATE_DTO, USERID_DTO, ZIP_DTO } from "../uscib-managed-sp/sp/sp-property.dto";
|
||||
|
||||
import { CLIENTID_DTO } from "../manage-clients/manage-clients-property.dto";
|
||||
|
||||
import { HOLDERID_DTO, LOCATIONID_DTO } from "../manage-holders/manage-holders-property.dto";
|
||||
import { EMAIL_ADDRESS_DTO, FAX_NO_DTO, FIRSTNAME_DTO, LASTNAME_DTO, MIDDLE_INITIAL_DTO, MOBILE_NO_DTO, PHONE_NO_DTO, TITLE_DTO } from "../property.dto";
|
||||
|
||||
|
||||
export class SaveCarnetApplicationDTO extends IntersectionType(
|
||||
@ -74,16 +75,21 @@ export class AddGenerallistItemsDTO extends IntersectionType(
|
||||
|
||||
export class DeleteGenerallistItemsDTO extends IntersectionType(
|
||||
HEADERID_DTO, ITEMNO_DTO, USERID_DTO
|
||||
){}
|
||||
) { }
|
||||
|
||||
export class AddCountriesDTO extends IntersectionType(
|
||||
HEADERID_DTO, USSETS_DTO, COUNTRYTABLE_DTO, USERID_DTO
|
||||
) { }
|
||||
|
||||
export class UpdateShippingDetailsDTO extends IntersectionType(
|
||||
HEADERID_DTO, SHIPTOTYPE_DTO, SHIPADDRID_DTO, FORMOFSECURITY_DTO,
|
||||
INSPROTECTION_DTO, LDIPROTECTION_DTO, DELIVERYTYPE_DTO, DELIVERYMETHOD_DTO,
|
||||
PAYMENTMETHOD_DTO, CUSTCOURIERNO_DTO, REFNO_DTO, NOTES_DTO, USERID_DTO
|
||||
HEADERID_DTO,
|
||||
PartialType(SHIPTOTYPE_DTO), PartialType(SHIPCONTACTID_DTO), PartialType(SHIPNAME_DTO),
|
||||
PartialType(ADDRESS1_DTO), PartialType(ADDRESS2_DTO), PartialType(CITY_DTO), PartialType(STATE_DTO), PartialType(ZIP_DTO), PartialType(COUNTRY_DTO),
|
||||
PartialType(FIRSTNAME_DTO), PartialType(LASTNAME_DTO), PartialType(TITLE_DTO), PartialType(PHONE_NO_DTO), PartialType(MOBILE_NO_DTO), PartialType(FAX_NO_DTO), PartialType(EMAIL_ADDRESS_DTO), PartialType(MIDDLE_INITIAL_DTO),
|
||||
PartialType(FORMOFSECURITY_DTO), PartialType(INSPROTECTION_DTO), PartialType(LDIPROTECTION_DTO),
|
||||
PartialType(DELIVERYTYPE_DTO), PartialType(DELIVERYMETHOD_DTO), PartialType(PAYMENTMETHOD_DTO),
|
||||
PartialType(CUSTCOURIERNO_DTO), PartialType(REFNO_DTO), PartialType(NOTES_DTO),
|
||||
USERID_DTO
|
||||
) { }
|
||||
|
||||
export class GetCarnetControlCenterDTO extends IntersectionType(
|
||||
|
||||
@ -621,15 +621,35 @@ export class CarnetApplicationService {
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
CARNETAPPLICATION_PKG.UpdateShippingDetails(
|
||||
:P_HEADERID, :P_SHIPTOTYPE, :P_SHIPADDRID, :P_FORMOFSECURITY, :P_INSPROTECTION,
|
||||
:P_LDIPROTECTION, :P_DELIVERYTYPE, :P_DELIVERYMETHOD, :P_PAYMENTMETHOD,
|
||||
:P_CUSTCOURIERNO, :P_REFNO, :P_NOTES, :P_USERID, :P_CURSOR
|
||||
:P_HEADERID,
|
||||
:P_SHIPTOTYPE,:P_SHIPCONTACTID,:P_SHIPNAME,
|
||||
:P_ADDRESS1,:P_ADDRESS2,:P_CITY,:P_STATE,:P_ZIP,:P_COUNTRY,
|
||||
:P_FIRSTNAME,:P_LASTNAME,:P_TITLE,:P_PHONENO,:P_MOBILENO,:P_FAXNO,:P_EMAILADDRESS,:P_MIDDLEINITIAL,
|
||||
:P_FORMOFSECURITY,:P_INSPROTECTION,:P_LDIPROTECTION,
|
||||
:P_DELIVERYTYPE,:P_DELIVERYMETHOD,:P_PAYMENTMETHOD,
|
||||
:P_CUSTCOURIERNO,:P_REFNO,:P_NOTES,:P_USERID,
|
||||
:P_CURSOR
|
||||
);
|
||||
END;`,
|
||||
{
|
||||
P_HEADERID: { val: body.P_HEADERID, type: oracledb.DB_TYPE_NUMBER },
|
||||
P_SHIPTOTYPE: { val: body.P_SHIPTOTYPE, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_SHIPADDRID: { val: body.P_SHIPADDRID, type: oracledb.DB_TYPE_NUMBER },
|
||||
P_SHIPCONTACTID: { val: body.P_SHIPCONTACTID, type: oracledb.DB_TYPE_NUMBER },
|
||||
P_SHIPNAME: { val: body.P_SHIPNAME, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_ADDRESS1: { val: body.P_ADDRESS1, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_ADDRESS2: { val: body.P_ADDRESS2, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_CITY: { val: body.P_CITY, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_STATE: { val: body.P_STATE, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_ZIP: { val: body.P_ZIP, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_COUNTRY: { val: body.P_COUNTRY, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_FIRSTNAME: { val: body.P_FIRSTNAME, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_LASTNAME: { val: body.P_LASTNAME, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_TITLE: { val: body.P_TITLE, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_PHONENO: { val: body.P_PHONENO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_MOBILENO: { val: body.P_MOBILENO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_FAXNO: { val: body.P_FAXNO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_EMAILADDRESS: { val: body.P_EMAILADDRESS, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_MIDDLEINITIAL: { val: body.P_MIDDLEINITIAL, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_FORMOFSECURITY: { val: body.P_FORMOFSECURITY, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_INSPROTECTION: { val: body.P_INSPROTECTION, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_LDIPROTECTION: { val: body.P_LDIPROTECTION, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
@ -640,7 +660,6 @@ export class CarnetApplicationService {
|
||||
P_REFNO: { val: body.P_REFNO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_NOTES: { val: body.P_NOTES, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
P_USERID: { val: body.P_USERID, type: oracledb.DB_TYPE_NVARCHAR },
|
||||
// P_ERRORMESG: { dir: oracledb.BIND_OUT, type: oracledb.CURSOR },
|
||||
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
||||
},
|
||||
{ outFormat: oracledb.OUT_FORMAT_OBJECT }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user