Skip to content

Commit

Permalink
fix: pr issues
Browse files Browse the repository at this point in the history
Co-authored-by: Alan Cruikshanks <[email protected]>
  • Loading branch information
jonathangoulding and Cruikshanks committed May 22, 2024
1 parent 065c3f8 commit 74b1ce3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
16 changes: 8 additions & 8 deletions app/presenters/licences/licence-set-up.presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ function _chargeInformation (chargeVersions, workflows, auth) {
]
}

function _chargeVersions (licenceSetUp) {
return licenceSetUp.map((chargeInformation) => {
function _chargeVersions (chargeVersions) {
return chargeVersions.map((chargeVersion) => {
return {
id: chargeInformation.id,
startDate: chargeInformation.startDate ? formatLongDate(chargeInformation.startDate) : '-',
endDate: chargeInformation.endDate ? formatLongDate(chargeInformation.endDate) : '-',
status: _status(chargeInformation.status),
reason: chargeInformation.changeReason?.description,
id: chargeVersion.id,
startDate: chargeVersion.startDate ? formatLongDate(chargeVersion.startDate) : '-',
endDate: chargeVersion.endDate ? formatLongDate(chargeVersion.endDate) : '-',
status: _status(chargeVersion.status),
reason: chargeVersion.changeReason?.description,
action: [
{
text: 'View',
link: `/licences/${chargeInformation.licenceId}/charge-information/${chargeInformation.id}/view`
link: `/licences/${chargeVersion.licenceId}/charge-information/${chargeVersion.id}/view`
}
]
}
Expand Down
8 changes: 3 additions & 5 deletions app/services/licences/fetch-workflows.service.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
'use strict'

/**
* Fetches data needed for the view '/licences/{id}/licence-set-up` page
* Fetches workflow data needed for the view '/licences/{id}/set-up` page
* @module FetchWorkflowsService
*/

const WorkflowModel = require('../../models/workflow.model.js')

/**
* Fetch the matching licence and return data needed for the view licence set up page
* Fetches charge version data needed for the view '/licences/{id}/set-up` page
*
* Was built to provide the data needed for the '/licences/{id}/licence-set-up' page
*
* @param {string} licenceId The string for the licence to fetch
* @param {string} licenceId - The UUID for the licence to fetch workflow data for
*
* @returns {Promise<Object>} the data needed to populate the view licence page's set up tab
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ChangeReasonHelper = require('../../support/helpers/change-reason.helper.j
const FetchChargeVersionsService =
require('../../../app/services/licences/fetch-charge-versions.service.js')

describe('Fetch charge versions for a licence', () => {
describe('Fetch Charge Versions service', () => {
let testRecord

beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/services/licences/fetch-workflows.service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const WorkflowHelper = require('../../support/helpers/workflow.helper.js')
const FetchWorkflowsService =
require('../../../app/services/licences/fetch-workflows.service.js')

describe('Fetch workflows for a licence', () => {
describe('Fetch Workflows service', () => {
let testRecord

beforeEach(async () => {
Expand Down

0 comments on commit 74b1ce3

Please sign in to comment.