-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor supplementary test code (#68)
https://eaflood.atlassian.net/browse/WATER-3854 We are about to [Update "create bill run" endpoint to create a bill run](#56). Currently, everything is happening in the controller whereas our convention is to do everything in a service and keep our controllers ['skinny'](https://blog.makersacademy.com/forget-fat-models-its-time-for-skinny-controllers-and-skinny-models-a9b84ec481b7). So, we need a service, something like `SupplementaryService`. But oh no! It already exists. This change is about refactoring the code currently in `SupplementaryService` to a more explicit testing version so we can free up the namespace. Whilst we're at it we also rename the `/test` path to `check/` as everyone was getting confused by seeing `test/` folders in various places in the code 😁
- Loading branch information
1 parent
a95dc35
commit dcf09a5
Showing
9 changed files
with
43 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/presenters/supplementary.presenter.js → ...ers/check/supplementary-data.presenter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict' | ||
|
||
const SupplementaryController = require('../controllers/check/supplementary.controller.js') | ||
|
||
const routes = [ | ||
{ | ||
method: 'GET', | ||
path: '/check/supplementary', | ||
handler: SupplementaryController.index, | ||
options: { | ||
description: 'Used by the delivery team to check the SROC supplementary billing logic' | ||
} | ||
} | ||
] | ||
|
||
module.exports = routes |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters