updating holder API
This commit is contained in:
parent
c4f9f29208
commit
04b89682ed
@ -44,6 +44,7 @@ export class HOLDERID_DTO {
|
|||||||
@Min(0, { message: 'Property P_HOLDERID must be at least 0 or more' })
|
@Min(0, { message: 'Property P_HOLDERID must be at least 0 or more' })
|
||||||
@IsInt({ message: 'Property P_HOLDERID allows only whole numbers' })
|
@IsInt({ message: 'Property P_HOLDERID allows only whole numbers' })
|
||||||
@IsNumber({}, { message: 'Property P_HOLDERID must be a number' })
|
@IsNumber({}, { message: 'Property P_HOLDERID must be a number' })
|
||||||
|
@Transform(({ value }) => Number(value))
|
||||||
@IsDefined({ message: 'Property P_HOLDERID is required' })
|
@IsDefined({ message: 'Property P_HOLDERID is required' })
|
||||||
P_HOLDERID: number;
|
P_HOLDERID: number;
|
||||||
}
|
}
|
||||||
@ -115,6 +116,7 @@ export class HOLDERCONTACTID_DTO {
|
|||||||
@Min(0, { message: 'Property P_HOLDERCONTACTID must be at least 0 or more' })
|
@Min(0, { message: 'Property P_HOLDERCONTACTID must be at least 0 or more' })
|
||||||
@IsInt({ message: 'Property P_HOLDERCONTACTID allows only whole numbers' })
|
@IsInt({ message: 'Property P_HOLDERCONTACTID allows only whole numbers' })
|
||||||
@IsNumber({}, { message: 'Property P_HOLDERCONTACTID must be a number' })
|
@IsNumber({}, { message: 'Property P_HOLDERCONTACTID must be a number' })
|
||||||
|
@Transform(({ value }) => Number(value))
|
||||||
@IsDefined({ message: 'Property P_HOLDERCONTACTID is required' })
|
@IsDefined({ message: 'Property P_HOLDERCONTACTID is required' })
|
||||||
P_HOLDERCONTACTID: number;
|
P_HOLDERCONTACTID: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -230,24 +230,24 @@ export class ManageHoldersService {
|
|||||||
);
|
);
|
||||||
END;`,
|
END;`,
|
||||||
{
|
{
|
||||||
P_HOLDERID: { VAL: finalBody.P_HOLDERID, TYPE: oracledb.DB_TYPE_NUMBER },
|
P_HOLDERID: { val: finalBody.P_HOLDERID, type: oracledb.DB_TYPE_NUMBER },
|
||||||
P_SPID: { VAL: finalBody.P_SPID, TYPE: oracledb.DB_TYPE_NUMBER },
|
P_SPID: { val: finalBody.P_SPID, type: oracledb.DB_TYPE_NUMBER },
|
||||||
P_LOCATIONID: { VAL: finalBody.P_LOCATIONID, TYPE: oracledb.DB_TYPE_NUMBER },
|
P_LOCATIONID: { val: finalBody.P_LOCATIONID, type: oracledb.DB_TYPE_NUMBER },
|
||||||
P_HOLDERNO: { VAL: finalBody.P_HOLDERNO, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_HOLDERNO: { val: finalBody.P_HOLDERNO, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_HOLDERTYPE: { VAL: finalBody.P_HOLDERTYPE, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_HOLDERTYPE: { val: finalBody.P_HOLDERTYPE, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_USCIBMEMBERFLAG: { VAL: finalBody.P_USCIBMEMBERFLAG, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_USCIBMEMBERFLAG: { val: finalBody.P_USCIBMEMBERFLAG, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_GOVAGENCYFLAG: { VAL: finalBody.P_GOVAGENCYFLAG, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_GOVAGENCYFLAG: { val: finalBody.P_GOVAGENCYFLAG, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_HOLDERNAME: { VAL: finalBody.P_HOLDERNAME, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_HOLDERNAME: { val: finalBody.P_HOLDERNAME, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_NAMEQUALIFIER: { VAL: finalBody.P_NAMEQUALIFIER, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_NAMEQUALIFIER: { val: finalBody.P_NAMEQUALIFIER, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_ADDLNAME: { VAL: finalBody.P_ADDLNAME, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_ADDLNAME: { val: finalBody.P_ADDLNAME, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_ADDRESS1: { VAL: finalBody.P_ADDRESS1, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_ADDRESS1: { val: finalBody.P_ADDRESS1, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_ADDRESS2: { VAL: finalBody.P_ADDRESS2, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_ADDRESS2: { val: finalBody.P_ADDRESS2, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_CITY: { VAL: finalBody.P_CITY, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_CITY: { val: finalBody.P_CITY, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_STATE: { VAL: finalBody.P_STATE, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_STATE: { val: finalBody.P_STATE, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_ZIP: { VAL: finalBody.P_ZIP, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_ZIP: { val: finalBody.P_ZIP, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_COUNTRY: { VAL: finalBody.P_COUNTRY, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_COUNTRY: { val: finalBody.P_COUNTRY, type: oracledb.DB_TYPE_NVARCHAR },
|
||||||
P_USERID: { VAL: finalBody.P_USERID, TYPE: oracledb.DB_TYPE_NVARCHAR },
|
P_USERID: { val: finalBody.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 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
outFormat: oracledb.OUT_FORMAT_OBJECT,
|
outFormat: oracledb.OUT_FORMAT_OBJECT,
|
||||||
@ -292,9 +292,9 @@ export class ManageHoldersService {
|
|||||||
);
|
);
|
||||||
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_HOLDERID: { VAL: body.P_HOLDERID, TYPE: oracledb.DB_TYPE_NUMBER },
|
P_HOLDERID: { val: body.P_HOLDERID, type: oracledb.DB_TYPE_NUMBER },
|
||||||
P_CURSOR: { TYPE: oracledb.CURSOR, DIR: oracledb.BIND_OUT }
|
P_CURSOR: { type: oracledb.CURSOR, dir: oracledb.BIND_OUT }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
outFormat: oracledb.OUT_FORMAT_OBJECT,
|
outFormat: oracledb.OUT_FORMAT_OBJECT,
|
||||||
@ -302,6 +302,7 @@ export class ManageHoldersService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const outBinds: any = result.outBinds;
|
const outBinds: any = result.outBinds;
|
||||||
|
|
||||||
if (!outBinds?.P_CURSOR) {
|
if (!outBinds?.P_CURSOR) {
|
||||||
this.logger.error('One or more expected cursors are missing from stored procedure output.');
|
this.logger.error('One or more expected cursors are missing from stored procedure output.');
|
||||||
throw new InternalServerException("Incomplete data received from the database.");
|
throw new InternalServerException("Incomplete data received from the database.");
|
||||||
@ -314,7 +315,7 @@ export class ManageHoldersService {
|
|||||||
throw new BadRequestException(fres[0].ERRORMESG)
|
throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { P_CURSOR: fres };
|
return fres;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageHoldersService.name)
|
handleError(error, ManageHoldersService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -437,7 +438,7 @@ export class ManageHoldersService {
|
|||||||
throw new BadRequestException(fres[0].ERRORMESG)
|
throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { P_CURSOR: fres };
|
return fres;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageHoldersService.name)
|
handleError(error, ManageHoldersService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -483,7 +484,7 @@ export class ManageHoldersService {
|
|||||||
throw new BadRequestException(fres[0].ERRORMESG)
|
throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { P_CURSOR: fres };
|
return { statusCode: 200, message: 'Reactivated holder successfully' };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageHoldersService.name)
|
handleError(error, ManageHoldersService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -529,7 +530,7 @@ export class ManageHoldersService {
|
|||||||
throw new BadRequestException(fres[0].ERRORMESG)
|
throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { P_CURSOR: fres };
|
return { statusCode: 200, message: 'Reactivated holder successfully' };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageHoldersService.name)
|
handleError(error, ManageHoldersService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -575,7 +576,7 @@ export class ManageHoldersService {
|
|||||||
throw new BadRequestException(fres[0].ERRORMESG)
|
throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { P_CURSOR: fres };
|
return { statusCode: 200, message: 'Inactivated holder contact successfully' };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageHoldersService.name)
|
handleError(error, ManageHoldersService.name)
|
||||||
} finally {
|
} finally {
|
||||||
@ -621,7 +622,7 @@ export class ManageHoldersService {
|
|||||||
throw new BadRequestException(fres[0].ERRORMESG)
|
throw new BadRequestException(fres[0].ERRORMESG)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { P_CURSOR: fres };
|
return { statusCode: 200, message: 'Reactivated holder contact successfully' };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, ManageHoldersService.name)
|
handleError(error, ManageHoldersService.name)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user