Skip to content

Commit

Permalink
fix(acbs): (#2944)
Browse files Browse the repository at this point in the history
Co-authored-by: Abhi Markan <amarkan@ukexportfinance.gov.uk>
  • Loading branch information
abhi-markan and abhi-markan authored Mar 27, 2024
1 parent 1877394 commit 1df56b9
Show file tree
Hide file tree
Showing 37 changed files with 287 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ module.exports = df.orchestrator(function* Facility(context) {
console.error('No input specified');
} catch (error) {
console.error('Error amending facility loan record: %o', error);
throw new Error('Error amending facility loan record', { cause: error });
throw new Error(`Error amending facility loan record ${error}`);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ module.exports = df.orchestrator(function* Facility(context) {
console.error('No input specified');
} catch (error) {
console.error('Error amending facility master record: %o', error);
throw new Error('Error amending facility master record', { cause: error });
throw new Error(`Error amending facility master record ${error}`);
}
});
2 changes: 1 addition & 1 deletion azure-functions/acbs-function/acbs-amend-facility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = df.orchestrator(function* amendACBSFacility(context) {
let facilityLoanRecord;

if (facilityId.includes(DEAL.UKEF_ID.PENDING) || facilityId.includes(DEAL.UKEF_ID.TEST)) {
throw new Error('Invalid facility ID %s', facilityId);
throw new Error(`Invalid facility ID ${facilityId}`);
}

// 1. DAF : activity-get-facility-master: Retrieve ACBS `Facility Master Record` with eTag
Expand Down
2 changes: 1 addition & 1 deletion azure-functions/acbs-function/acbs-facility-bond/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ module.exports = df.orchestrator(function* createACBSfacilityBond(context) {
};
} catch (error) {
console.error('Error creating facility bond record: %o', error);
throw new Error('Error creating facility bond record', { cause: error });
throw new Error(`Error creating facility bond record ${error}`);
}
});
2 changes: 1 addition & 1 deletion azure-functions/acbs-function/acbs-facility-loan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ module.exports = df.orchestrator(function* createACBSfacilityBond(context) {
return response;
} catch (error) {
console.error('Error creating facility loan record: %o', error);
throw new Error('Error creating facility loan record', { cause: error });
throw new Error(`Error creating facility loan record ${error}`);
}
});
4 changes: 2 additions & 2 deletions azure-functions/acbs-function/acbs-facility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = df.orchestrator(function* createACBSfacility(context) {
const { facilityIdentifier } = acbsFacilityMasterInput;

if (facilityIdentifier.includes(CONSTANTS.DEAL.UKEF_ID.PENDING) || facilityIdentifier.includes(CONSTANTS.DEAL.UKEF_ID.TEST)) {
throw new Error('Invalid facility ID %s', facilityIdentifier);
throw new Error(`Invalid facility ID ${facilityIdentifier}`);
}

const facilityMaster = yield context.df.callActivityWithRetry('activity-create-facility-master', retryOptions, { acbsFacilityMasterInput });
Expand Down Expand Up @@ -122,6 +122,6 @@ module.exports = df.orchestrator(function* createACBSfacility(context) {
};
} catch (error) {
console.error('Error creating facility records: %o', error);
throw new Error('Error creating facility record', { cause: error });
throw new Error(`Error creating facility record ${error}`);
}
});
4 changes: 2 additions & 2 deletions azure-functions/acbs-function/acbs-issue-facility/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = df.orchestrator(function* updateACBSfacility(context) {
const { facilityId, facility, deal } = context.df.getInput();

if (facilityId.includes(CONSTANTS.DEAL.UKEF_ID.PENDING) || facilityId.includes(CONSTANTS.DEAL.UKEF_ID.TEST)) {
throw new Error('Invalid facility ID %s', facilityId);
throw new Error(`Invalid facility ID ${facilityId}`);
}

let facilityFee;
Expand Down Expand Up @@ -111,6 +111,6 @@ module.exports = df.orchestrator(function* updateACBSfacility(context) {
throw new Error('Invalid argument set');
} catch (error) {
console.error('Error processing facility issuance: %o', error);
throw new Error('Error processing facility issuance', { cause: error });
throw new Error(`Error processing facility issuance ${error}`);
}
});
2 changes: 1 addition & 1 deletion azure-functions/acbs-function/acbs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ module.exports = df.orchestrator(function* HDeal(context) {
const { dealIdentifier } = acbsDealInput;

if (dealIdentifier.includes(CONSTANTS.DEAL.UKEF_ID.PENDING) || dealIdentifier.includes(CONSTANTS.DEAL.UKEF_ID.TEST)) {
throw new Error('Invalid deal ID %s', dealIdentifier);
throw new Error(`Invalid deal ID ${dealIdentifier}`);
}

const dealRecord = yield context.df.callActivityWithRetry('activity-create-deal', retryOptions, { deal: acbsDealInput });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const createCodeValueTransaction = async (context) => {
};
} catch (error) {
console.error('Error creating facility code value transaction record: %o', error);
throw new Error('Error creating facility code value transaction record', { cause: error });
throw new Error(`Error creating facility code value transaction record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const createDealGuarantee = async (context) => {
};
} catch (error) {
console.error('Unable to create deal guarantee record. %o', error);
throw new Error('Unable to create deal guarantee record', { cause: error });
throw new Error(`Unable to create deal guarantee record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const createDealInvestor = async (context) => {
};
} catch (error) {
console.error('Unable to create deal investor record. %o', error);
throw new Error('Unable to create deal investor record', { cause: error });
throw new Error(`Unable to create deal investor record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const createDeal = async (context) => {
};
} catch (error) {
console.error('Unable to create deal master record. %o', error);
throw new Error('Unable to create deal master record', { cause: error });
throw new Error(`Unable to create deal master record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const createFacilityCovenant = async (context) => {
};
} catch (error) {
console.error('Unable to create facility covenant record. %o', error);
throw new Error('Unable to create facility covenant record', { cause: error });
throw new Error(`Unable to create facility covenant record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const createFacilityFee = async (context) => {
};
} catch (error) {
console.error('Unable to create facility fee record. %o', error);
throw new Error('Unable to create facility fee record', { cause: error });
throw new Error(`Unable to create facility fee record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const createFacilityGuarantee = async (context) => {
};
} catch (error) {
console.error('Unable to create facility guarantee record. %o', error);
throw new Error('Unable to create facility guarantee record', { cause: error });
throw new Error(`Unable to create facility guarantee record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const createFacilityInvestor = async (context) => {
};
} catch (error) {
console.error('Unable to create facility investor record. %o', error);
throw new Error('Unable to create facility investor record', { cause: error });
throw new Error(`Unable to create facility investor record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const createFacilityLoan = async (context) => {
};
} catch (error) {
console.error('Unable to create facility loan record. %o', error);
throw new Error('Unable to create facility loan record', { cause: error });
throw new Error(`Unable to create facility loan record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const createFacilityMaster = async (context) => {
};
} catch (error) {
console.error('Unable to create facility master record. %o', error);
throw new Error('Unable to create facility master record', { cause: error });
throw new Error(`Unable to create facility master record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const createParty = async (context) => {
return {};
} catch (error) {
console.error('Unable to create party record. %o', error);
throw new Error('Unable to create party record', { cause: error });
throw new Error(`Unable to create party record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getAcbsCountryCode = async (context) => {
return status === 200 && data.length > 1 ? data[0].isoCode : CONSTANTS.DEAL.COUNTRY.DEFAULT;
} catch (error) {
console.error('Error getting ACBS country code %o', error);
throw new Error('Error getting ACBS country code', { cause: error });
throw new Error(`Error getting ACBS country code ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getAcbsIndustrySector = async (context) => {
return status === 200 && data.length > 0 ? data[0].acbsIndustryId : '1001';
} catch (error) {
console.error('Error getting ACBS industry sector: %o', error);
throw new Error('Error getting ACBS industry sector', { cause: error });
throw new Error(`Error getting ACBS industry sector ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const getFacilityMaster = async (context) => {
throw new Error('Invalid argument set');
} catch (error) {
console.error('Error getting facility master record: %o', error);
throw new Error('Error getting facility master record', { cause: error });
throw new Error(`Error getting facility master record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const getLoanId = async (context) => {
return null;
} catch (error) {
console.error('Error getting loan id for facility: %o', error);
throw new Error('Error getting loan id for facility', { cause: error });
throw new Error(`Error getting loan id for facility ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const updateFacilityLoanAmount = async (context) => {
};
} catch (error) {
console.error('Error amending facility loan amount: %o', error);
throw new Error('Error amending facility loan amount', { cause: error });
throw new Error(`Error amending facility loan amount ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const updateFacilityLoan = async (context) => {
};
} catch (error) {
console.error('Error amending facility loan record: %o', error);
throw new Error('Error amending facility loan record', { cause: error });
throw new Error(`Error amending facility loan record ${error}`);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const updateFacilityMaster = async (context) => {
};
} catch (error) {
console.error('Error updating facility master record: %o', error);
throw new Error('Error updating facility master record', { cause: error });
throw new Error(`Error updating facility master record ${error}`);
}
};

Expand Down
2 changes: 1 addition & 1 deletion dtfs-central-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"node-mocks-http": "^1.14.1",
"supertest": "6.3.3",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"engines": {
"node": ">=20",
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"bson": "^6.5.0",
"chance": "^1.1.11",
"cypress": "^13.7.0",
"cypress": "^13.7.1",
"cypress-file-upload": "^5.0.8",
"cypress-plugin-tab": "^1.0.5",
"cypress-v10-preserve-cookie": "^1.2.1",
Expand Down
2 changes: 1 addition & 1 deletion external-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"swagger-ui-express": "^4.6.3",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typescript": "^5.4.2",
"typescript": "^5.4.3",
"validator": "^13.11.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions gef-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"nunjucks": "3.2.4",
"path": "0.12.7",
"redis": "^3.1.2",
"sanitize-html": "^2.12.1",
"sanitize-html": "^2.13.0",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"validator": "^13.11.0"
Expand Down Expand Up @@ -96,7 +96,7 @@
"supertest": "^6.3.4",
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "^29.1.2",
"webpack": "^5.90.3",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion libs/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint": "^8.57.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"typescript": "^5.4.2"
"typescript": "^5.4.3"
},
"engines": {
"node": ">=20",
Expand Down
Loading

0 comments on commit 1df56b9

Please sign in to comment.