Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feat/wdfGrantLetter #4771

Open
wants to merge 31 commits into
base: test
Choose a base branch
from
Open

WIP: Feat/wdfGrantLetter #4771

wants to merge 31 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 29, 2022

Work done

  • Adds helper functions for interacting with Adobe Sign for creation and querying of agreements
  • Creates endpoints for these interactions
  • Creates new db tables for storing the agreement interactions.

Tests

Does this PR include tests for the changes introduced?

  • Yes
  • No, I found it difficult to test
  • No, they are not required for this change

const adobeSignBaseUrl = config.get('adobeSign.apiBaseUrl');
const adobeApiKey = config.get('adobeSign.apiKey');

module.exports.createAgreement = async (claimData, isNationalOrg) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createAgreement has 72 lines of code (exceeds 25 allowed). Consider refactoring.

@@ -0,0 +1,50 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 45 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Mar 29, 2022

This pull request fixes 1 alert when merging 6bb9663 into 676edf2 - view on LGTM.com

fixed alerts:

  • 1 for Duplicate property

@lgtm-com
Copy link

lgtm-com bot commented Mar 29, 2022

This pull request fixes 1 alert when merging bcf617d into 676edf2 - view on LGTM.com

fixed alerts:

  • 1 for Duplicate property

@codecov
Copy link

codecov bot commented Mar 29, 2022

Codecov Report

Merging #4771 (0e58b43) into test (e4b2475) will decrease coverage by 8.16%.
The diff coverage is 64.51%.

@@            Coverage Diff             @@
##             test    #4771      +/-   ##
==========================================
- Coverage   51.66%   43.49%   -8.17%     
==========================================
  Files         975      409     -566     
  Lines       38308    17407   -20901     
  Branches     4561        0    -4561     
==========================================
- Hits        19793     7572   -12221     
+ Misses      14510     9835    -4675     
+ Partials     4005        0    -4005     
Impacted Files Coverage Δ
server/config/config.js 59.57% <ø> (ø)
...ver/routes/establishments/wdfClaims/grantLetter.js 0.00% <0.00%> (ø)
server/routes/establishments/wdfClaims/index.js 0.00% <ø> (ø)
server/models/establishment.js 45.52% <50.00%> (+0.07%) ⬆️
...ts/wdfClaims/generateDevelopmentFundGrantLetter.js 58.06% <58.06%> (ø)
server/models/developmentFundGrants.js 66.66% <66.66%> (ø)
server/utils/adobeSign/index.js 100.00% <100.00%> (ø)
server/utils/wdfEligibilityDate.js 83.33% <0.00%> (ø)
...andatory-training/add-mandatory-training.module.ts
...rc/app/core/breadcrumb/journey.benchmark_metric.ts
... and 568 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4b2475...0e58b43. Read the comment docs.

const adobeSignBaseUrl = config.get('adobeSign.apiBaseUrl');
const adobeApiKey = config.get('adobeSign.apiKey');

module.exports.createAgreement = async (claimData) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createAgreement has 64 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Mar 30, 2022

This pull request introduces 1 alert and fixes 1 when merging b4d4bb6 into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

@@ -0,0 +1,54 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 49 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Mar 31, 2022

This pull request introduces 1 alert and fixes 1 when merging 21bfebc into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

Co-authored-by: M Daley <[email protected]>
@@ -0,0 +1,57 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 52 lines of code (exceeds 25 allowed). Consider refactoring.

const DevelopmentFundGrants = require('../../../models/developmentFundGrants');
const { createAgreement, queryAgreementStatus } = require('./adobeSign');

const generateDevelopmentFundGrantLetter = async (req, res, next) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generateDevelopmentFundGrantLetter has 32 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Mar 31, 2022

This pull request introduces 1 alert and fixes 1 when merging 027798b into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

@@ -0,0 +1,68 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 62 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Mar 31, 2022

This pull request introduces 1 alert and fixes 1 when merging 0cda855 into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 1 alert and fixes 1 when merging 200c139 into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

@@ -0,0 +1,88 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 82 lines of code (exceeds 25 allowed). Consider refactoring.

const models = require('../../../models');
const { createAgreement, queryAgreementStatus } = require('./adobeSign');

const generateDevelopmentFundGrantLetter = async (req, res, next) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generateDevelopmentFundGrantLetter has 28 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 1 alert and fixes 1 when merging 700b7b5 into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

Co-authored-by: M Daley <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 2 alerts and fixes 1 when merging b89076d into 676edf2 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class
  • 1 for Server-side request forgery

fixed alerts:

  • 1 for Duplicate property

const adobeSignBaseUrl = config.get('adobeSign.apiBaseUrl');
const adobeApiKey = config.get('adobeSign.apiKey');

module.exports.createAgreement = async (claimData) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createAgreement has 64 lines of code (exceeds 25 allowed). Consider refactoring.

const models = require('../../../models');
const { createAgreement, queryAgreementStatus } = require('../../../utils/adobeSign');

const generateDevelopmentFundGrantLetter = async (req, res, next) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generateDevelopmentFundGrantLetter has 28 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 2 alerts and fixes 1 when merging 0e8c872 into 676edf2 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

fixed alerts:

  • 1 for Duplicate property

@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 2 alerts and fixes 1 when merging 9edd46d into 676edf2 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

fixed alerts:

  • 1 for Duplicate property

@@ -0,0 +1,83 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 77 lines of code (exceeds 25 allowed). Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2022

This pull request introduces 2 alerts and fixes 1 when merging 763a0ec into 676edf2 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

fixed alerts:

  • 1 for Duplicate property

@lgtm-com
Copy link

lgtm-com bot commented Apr 4, 2022

This pull request introduces 2 alerts and fixes 1 when merging 38b8551 into 676edf2 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

fixed alerts:

  • 1 for Duplicate property

@@ -0,0 +1,105 @@
'use strict';

module.exports = function (sequelize, DataTypes) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exports has 97 lines of code (exceeds 25 allowed). Consider refactoring.

const models = require('../../../models');
const { createAgreement, queryAgreementStatus } = require('../../../utils/adobeSign');

const generateDevelopmentFundGrantLetter = async (req, res, next) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function generateDevelopmentFundGrantLetter has 27 lines of code (exceeds 25 allowed). Consider refactoring.

});
};

DevelopmentFundGrants.updateStatus = async function (establishmentId, status) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@lgtm-com
Copy link

lgtm-com bot commented Apr 4, 2022

This pull request introduces 2 alerts and fixes 1 when merging 52235ff into 676edf2 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

fixed alerts:

  • 1 for Duplicate property

@codeclimate
Copy link

codeclimate bot commented Apr 4, 2022

Code Climate has analyzed commit 0e58b43 and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Duplication 1

View more on Code Climate.

@lgtm-com
Copy link

lgtm-com bot commented Apr 4, 2022

This pull request introduces 2 alerts and fixes 1 when merging 0e58b43 into 676edf2 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

fixed alerts:

  • 1 for Duplicate property

@ghost ghost assigned Zuhal-Ayob Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant