Skip to content

Commit

Permalink
Add testing endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Beckyrose200 committed Oct 21, 2024
1 parent ba655eb commit cb1fb17
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/controllers/data.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @module DataController
*/

const DetermineSupplementaryBillingFlagsService = require('../services/import/determine-supplementary-billing-flags.service.js')
const LoadService = require('../services/data/load/load.service.js')
const SeedService = require('../services/data/seed/seed.service.js')
const SubmitDeduplicateService = require('../services/data/deduplicate/submit-deduplicate.service.js')
Expand All @@ -17,6 +18,20 @@ async function deduplicate (_request, h) {
})
}

async function flagForBilling (request, h) {
const { licenceId, expiredDate, lapsedDate, revokedDate } = request.payload

const transformedLicence = {
expiredDate,
lapsedDate,
revokedDate
}

DetermineSupplementaryBillingFlagsService.go(transformedLicence, licenceId)

return h.response().code(204)
}

async function load (request, h) {
const result = await LoadService.go(request.payload)

Expand Down Expand Up @@ -51,6 +66,7 @@ async function tearDown (_request, h) {

module.exports = {
deduplicate,
flagForBilling,
load,
seed,
submitDeduplicate,
Expand Down
15 changes: 15 additions & 0 deletions app/routes/data.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ const routes = [
}
}
},
{
method: 'POST',
path: '/data/flag-for-billing',
options: {
handler: DataController.flagForBilling,
app: {
excludeFromProd: true,
plainOutput: true
},
auth: false,
plugins: {
crumb: false
}
}
},
{
method: 'POST',
path: '/data/load',
Expand Down

0 comments on commit cb1fb17

Please sign in to comment.