Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DEFRA/ffc-ahwr-backoffice
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.1.0
Choose a base ref
...
head repository: DEFRA/ffc-ahwr-backoffice
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jun 22, 2022

  1. fix: remove duplicated helm chart (#8)

    * fix: remove duplicated helm chart
    
    * chore: increment version
    st3v3nhunt authored Jun 22, 2022
    Copy the full SHA
    c4efb08 View commit details

Commits on Jun 27, 2022

  1. Feature/vvahwr 318 (#10)

    * Application reference search & cosmetic bugs
    govTechSatish authored Jun 27, 2022
    Copy the full SHA
    9e2a700 View commit details

Commits on Jun 28, 2022

  1. Feature/vvahwr 312 (#11)

    * upgraded govuk frontend, added pagination
    govTechSatish authored Jun 28, 2022
    Copy the full SHA
    15f61f7 View commit details
  2. Integrate with Active directory auth (#6)

    * feat: add auth plugin, implement AD auth
    
    * fix: linting
    
    * feat: add login, logout, authenticate routes
    
    * feat: update compose file
    
    * feat: update container secrets
    
    * feat: rename env variable for azure identity
    
    * feat: add tests
    
    * bump: version
    
    * feat: add AADAR values so they can be override in k8s env
    
    * fix: correct quoting of values
    
    * feat: rename auth enabled env var to match AADAR values
    
    * fix: true needs to be a string
    
    * feat: fix broken unit tests
    
    * fix: code smell
    
    * feat: add more tests
    
    * feat: add more tests
    
    * feat: make it clear redirectUrl is for AAD app
    
    * fix: correct path to values value
    
    * resolve: conflicts
    
    * feat: change port to 3002
    
    Co-authored-by: Steve Hunt <st3v3nhunt@users.noreply.github.com>
    shivanshuit914 and st3v3nhunt authored Jun 28, 2022
    Copy the full SHA
    b17c8dc View commit details
  3. fix: map auth enabled to config map (#13)

    * fix: ensure auth enabled value is mapped into config
    
    * chore: increment version
    st3v3nhunt authored Jun 28, 2022
    Copy the full SHA
    0694da5 View commit details

Commits on Jun 29, 2022

  1. feat: change scope and permissions for auth (#14)

    * feat: change scope and permissions for auth
    
    * fix: remaining mapping for new roles
    
    * fix: syntax error
    shivanshuit914 authored Jun 29, 2022
    Copy the full SHA
    b7ca7c7 View commit details
  2. Fixed next page issue. (#12)

    * Fixed next page issue. Updated text for Back link
    * fixed error page 500 path
    govTechSatish authored Jun 29, 2022
    Copy the full SHA
    380a488 View commit details

Commits on Jul 4, 2022

  1. Feature/refactor view application (#16)

    * feat: remove placeholders data
    
    * feat: remove placeholders data
    
    * feat: remove static content
    
    * fix: linting, add constant for the dynamic species
    
    * feat: refactor view application
    shivanshuit914 authored Jul 4, 2022
    Copy the full SHA
    fa39ac0 View commit details
  2. Feature/app status (#15)

    * Update application status
    govTechSatish authored Jul 4, 2022
    Copy the full SHA
    c107793 View commit details
  3. Feature content changes (#17)

    * feat: change page title and texts changes
    
    * feat: remove change link on view page
    
    * feat: fix typo
    shivanshuit914 authored Jul 4, 2022
    Copy the full SHA
    5ec9e5f View commit details

Commits on Jul 5, 2022

  1. Copy the full SHA
    bdb3dc3 View commit details

Commits on Jul 11, 2022

  1. Feature tabs (#19)

    * feat: add tab in for vet
    
    * feat: add data to payment tab
    
    * feat: add more info to vet visit tab
    
    * fix: linting
    
    * feat: refactor view application, add checks for object properties
    
    * fix: unit tests and linting
    
    * feat: add view application test
    
    * feat: add more tests to cover tabs data
    
    * feat: more tests for view tabs
    shivanshuit914 authored Jul 11, 2022
    Copy the full SHA
    942cef2 View commit details

Commits on Jul 13, 2022

  1. Feature/api (#20)

    consuming API from application service
    govTechSatish authored Jul 13, 2022
    Copy the full SHA
    0b85eff View commit details

Commits on Jul 15, 2022

  1. feat: add currency icon for amount (#21)

    * feat: add currency icon for amount
    
    * feat: bump version
    
    * feat: convert amount to float currency format
    shivanshuit914 authored Jul 15, 2022
    Copy the full SHA
    c12f207 View commit details

Commits on Jul 21, 2022

  1. Feature/filter (#22)

    * added status filter search
    govTechSatish authored Jul 21, 2022
    Copy the full SHA
    e3159f1 View commit details

Commits on Jul 26, 2022

  1. Feature/application fraud check (#23)

    * feat: add api integration for fraud check
    shivanshuit914 authored Jul 26, 2022
    Copy the full SHA
    bd3fbf3 View commit details

Commits on Jul 27, 2022

  1. Revert "Feature/application fraud check (#23)" (#25)

    This reverts commit bd3fbf3.
    shivanshuit914 authored Jul 27, 2022
    Copy the full SHA
    379dad3 View commit details

Commits on Aug 8, 2022

  1. Feature/mojui (#24)

    Application sort facility using moj frontend
    govTechSatish authored Aug 8, 2022
    Copy the full SHA
    792d297 View commit details
  2. fix: showing correct data for sheep (#26)

    * fix: showing correct data for sheep
    
    * fix: linting
    
    * refactor: sheep data
    
    * refactor: sheep data
    
    * fix: tests
    
    * refactor: view application data rows
    
    * feat: bump version
    shivanshuit914 authored Aug 8, 2022
    Copy the full SHA
    7aa9699 View commit details

Commits on Aug 10, 2022

  1. remove cookie banner (#28)

    * removed unwanted files
    govTechSatish authored Aug 10, 2022
    Copy the full SHA
    a5c1e9a View commit details
  2. feat: extract out auth config to separate file (#30)

    * feat: extract out auth config to separate file
    
    * bump: version
    
    * fix: linting
    
    * feat: add tests
    shivanshuit914 authored Aug 10, 2022
    Copy the full SHA
    bf73fee View commit details
  3. Copy the full SHA
    9429555 View commit details

Commits on Aug 12, 2022

  1. Feature/filter button (#33)

    * added show filter button.
    govTechSatish authored Aug 12, 2022
    Copy the full SHA
    3afcbba View commit details

Commits on Aug 17, 2022

  1. feat: refactor view application route (#34)

    * feat: refactor view application route
    
    * fix: linting
    
    * feat: refactor applications route
    
    * feat: refactor applications route
    
    * skip: sonar codesmell
    
    * fix: missing filter
    shivanshuit914 authored Aug 17, 2022
    Copy the full SHA
    db8e9f5 View commit details

Commits on Aug 18, 2022

  1. Bugfix/vvahwr 524 (#35)

    * added page link in url
    govTechSatish authored Aug 18, 2022
    Copy the full SHA
    1f70b2a View commit details

Commits on Aug 22, 2022

  1. Add ./scripts/start to ffc-ahwr-backoffice

    * Add ./scripts/start
    steve-dickinson authored Aug 22, 2022
    Copy the full SHA
    49cafa6 View commit details
  2. Feature/view macros (#37)

    * feat: create macros for the application tab and table
    
    * fix: broken view mode
    
    * bump: version
    shivanshuit914 authored Aug 22, 2022
    Copy the full SHA
    d3738e8 View commit details

Commits on Aug 23, 2022

  1. initial draft (#36)

    Added Sort from Server
    govTechSatish authored Aug 23, 2022
    Copy the full SHA
    f72f792 View commit details

Commits on Oct 14, 2022

  1. remove: vet tab (#40)

    * remove: vet tab
    
    * bump: version
    
    * fix: linting, remove vet tabs unit tests
    shivanshuit914 authored Oct 14, 2022
    Copy the full SHA
    f5d068e View commit details

Commits on Nov 8, 2022

  1. Refactor/view applications (#41)

    * remove: payment tab
    
    * feat: add claim tab data
    
    * remove: payment tests
    
    * bump: version
    
    * feat: refactor tests
    
    * fix: unit tests
    shivanshuit914 authored Nov 8, 2022
    Copy the full SHA
    0363182 View commit details
  2. Copy the full SHA
    3bc5fce View commit details

Commits on Nov 11, 2022

  1. content changes (#44)

    * feat: change view application page and status
    
    * feat: bump version
    
    * fix: tests
    
    * fix: content and test
    shivanshuit914 authored Nov 11, 2022
    Copy the full SHA
    38d5eb9 View commit details

Commits on Nov 12, 2022

  1. Feat/status content (#45)

    * feat: status content changes
    
    * bump: version
    
    * fix: linting
    
    * feat: improve tests
    shivanshuit914 authored Nov 12, 2022
    Copy the full SHA
    be093cc View commit details

Commits on Nov 18, 2022

  1. fix: search by reference number and status (#49)

    * fix: search by reference number and status
    
    * bump: version
    shivanshuit914 authored Nov 18, 2022
    Copy the full SHA
    5d752e4 View commit details

Commits on Nov 21, 2022

  1. feat: change application details tabs content (#50)

    * feat: change application details tabs content
    
    * bump: version
    
    * fix: linting
    
    * feat: fix broken tests
    
    * feat: fix broken tests
    
    * feat: change eligible test
    
    * fix: error message text
    shivanshuit914 authored Nov 21, 2022
    Copy the full SHA
    7245a90 View commit details

Commits on Nov 22, 2022

  1. Fix org search (#51)

    * fix: organisation name search and content changes
    
    * fix: tests
    
    * bump: version
    shivanshuit914 authored Nov 22, 2022
    Copy the full SHA
    a4aabfd View commit details

Commits on Dec 1, 2022

  1. feat: add search status (#52)

    * feat: add search status
    
    * bump: version
    shivanshuit914 authored Dec 1, 2022
    Copy the full SHA
    070746f View commit details

Commits on Dec 8, 2022

  1. feat: add in check tab data (#53)

    * feat: add in check tab data
    
    * bump: version
    shivanshuit914 authored Dec 8, 2022
    Copy the full SHA
    17390f6 View commit details

Commits on Dec 15, 2022

  1. feat: add status color code (#55)

    * feat: add status color code
    
    * feat: bump version
    shivanshuit914 authored Dec 15, 2022
    Copy the full SHA
    55d9e87 View commit details

Commits on Dec 19, 2022

  1. feat: change claim tab content (#56)

    * feat: change claim tab content
    
    * bump: version
    
    * fix: tests
    shivanshuit914 authored Dec 19, 2022
    Copy the full SHA
    90fc289 View commit details

Commits on Dec 20, 2022

  1. fix: missing content changes (#57)

    * fix: missing content changes
    
    * bump: version
    shivanshuit914 authored Dec 20, 2022
    Copy the full SHA
    1dd19c5 View commit details

Commits on Jan 3, 2023

  1. Fix wave error (#58)

    * fix: wave errors
    
    * fix: npm audit
    
    * feat: overrise jsonwebtoken
    
    * feat: generate new lock file
    
    * bump: azure version
    shivanshuit914 authored Jan 3, 2023
    Copy the full SHA
    227e58b View commit details

Commits on Feb 1, 2023

  1. feat: add withdraw link (#59)

    * feat: add withdraw link
    
    * bump: version
    
    * feat: add form to confirm withdraw application
    
    * fix: linting
    
    * feat: integrate with withdraw application API
    
    * feat: add unit tests
    
    * fix: linting
    shivanshuit914 authored Feb 1, 2023
    Copy the full SHA
    8be893e View commit details

Commits on Feb 7, 2023

  1. Copy the full SHA
    440966f View commit details

Commits on Feb 10, 2023

  1. feat: remove in check status for withdraw link (#62)

    * feat: remove in check status for withdraw link
    
    * bump: verion
    
    * fix: audit
    
    * fix: test
    shivanshuit914 authored Feb 10, 2023
    Copy the full SHA
    e924d7d View commit details

Commits on Feb 16, 2023

  1. feat: add process application claim form (#60)

    * feat: add process application claim form
    
    * bump: version
    
    * feat: add unit tests
    
    * New page components and flow added
    
    * Additional updates to new layout for authoriser
    
    * Fix package-lock issue
    
    * package lock file returned to previous state
    
    ---------
    
    Co-authored-by: chrissmKainos <christophersm@kainos.com>
    shivanshuit914 and chrissmKainos authored Feb 16, 2023
    Copy the full SHA
    1d6b869 View commit details

Commits on Feb 20, 2023

  1. 156118: Feature toggle added for the withdraw link (#63)

    * 156118: Feature toggle added for the withdraw link
    
    * 156118: Minor changes to helm files
    chrissmKainos authored Feb 20, 2023
    Copy the full SHA
    d51e0ee View commit details
  2. Copy the full SHA
    64a31d7 View commit details

Commits on Feb 21, 2023

  1. Copy the full SHA
    304bcce View commit details

Commits on Feb 22, 2023

  1. 157531: Account page (placeholder) (#66)

    * 157531: Account page (placeholder)
    
    * 157531: Update for PR comment to remove auth from route
    chrissmKainos authored Feb 22, 2023
    Copy the full SHA
    373d1f8 View commit details
Showing with 42,842 additions and 14,899 deletions.
  1. +13 −4 .secrets.baseline
  2. +8 −2 .snyk
  3. +1 −1 Dockerfile
  4. +1 −1 Jenkinsfile
  5. +2 −32 README.md
  6. +8 −0 __mocks__/applicationinsights.js
  7. +104 −0 app/api/applications.js
  8. +60 −0 app/api/claims.js
  9. +53 −0 app/api/contact-history.js
  10. +38 −0 app/api/gov-holiday.js
  11. +67 −0 app/auth/azure-auth.js
  12. +34 −0 app/auth/dev-auth.js
  13. +8 −0 app/auth/get-user.js
  14. +10 −0 app/auth/index.js
  15. +8 −0 app/auth/is-in-role.js
  16. +16 −0 app/auth/map-auth.js
  17. +9 −0 app/auth/permissions.js
  18. +25 −0 app/config/auth.js
  19. +35 −44 app/config/index.js
  20. +4 −0 app/config/routes.js
  21. +15 −0 app/constants/application-status.js
  22. +12 −0 app/constants/claim.js
  23. +13 −0 app/constants/contact-history.js
  24. +129 −0 app/constants/sheep-test-types.js
  25. +6 −0 app/constants/species-numbers.js
  26. +79 −0 app/constants/status.js
  27. +0 −29 app/cookies.js
  28. +64 −0 app/crons/process-on-hold/process.js
  29. +40 −0 app/crons/process-on-hold/scheduler.js
  30. +28 −4 app/frontend/src/css/application.scss
  31. +9 −0 app/frontend/src/css/update-form.scss
  32. +19 −0 app/frontend/src/entry.js
  33. +16 −0 app/frontend/src/js/handleDuplicateFormSubmissions.js
  34. +1 −0 app/index.js
  35. +49 −0 app/lib/display-helper.js
  36. +19 −0 app/lib/get-livestock-types.js
  37. +12 −0 app/lib/get-review-type.js
  38. +87 −0 app/lib/search-validation.js
  39. +0 −17 app/messaging/applications.js
  40. +0 −10 app/messaging/create-message.js
  41. +0 −7 app/messaging/index.js
  42. +0 −16 app/messaging/receive-message.js
  43. +0 −11 app/messaging/send-message.js
  44. +28 −16 app/pagination.js
  45. +34 −0 app/plugins/auth.js
  46. +4 −6 app/plugins/cookies.js
  47. +8 −7 app/plugins/error-pages.js
  48. +14 −0 app/plugins/header.js
  49. +52 −0 app/plugins/logger.js
  50. +0 −11 app/plugins/logging.js
  51. +17 −3 app/plugins/router.js
  52. +13 −3 app/plugins/views.js
  53. +13 −0 app/routes/account.js
  54. +102 −0 app/routes/agreement.js
  55. +108 −0 app/routes/agreements.js
  56. +0 −104 app/routes/applications.js
  57. +67 −0 app/routes/approve-application-claim.js
  58. +1 −1 app/routes/assets.js
  59. +19 −0 app/routes/authenticate.js
  60. +96 −0 app/routes/claims.js
  61. +0 −37 app/routes/cookies.js
  62. +18 −0 app/routes/dev-auth.js
  63. +3 −2 app/routes/home.js
  64. +18 −0 app/routes/login.js
  65. +16 −0 app/routes/logout.js
  66. +21 −0 app/routes/models/account.js
  67. +42 −0 app/routes/models/application-claim.js
  68. +18 −0 app/routes/models/application-details.js
  69. +78 −0 app/routes/models/application-history.js
  70. +173 −0 app/routes/models/application-list.js
  71. +101 −0 app/routes/models/claim-list.js
  72. +0 −28 app/routes/models/cookies-policy.js
  73. +11 −0 app/routes/models/organisation-details.js
  74. +67 −0 app/routes/move-to-in-check.js
  75. +66 −0 app/routes/recommend-to-pay.js
  76. +65 −0 app/routes/recommend-to-reject.js
  77. +68 −0 app/routes/reject-application-claim.js
  78. +77 −0 app/routes/update-status.js
  79. +21 −0 app/routes/utils/crumb-cache.js
  80. +12 −0 app/routes/utils/date-converter.js
  81. +13 −0 app/routes/utils/encode-errors-for-ui.js
  82. +106 −0 app/routes/utils/get-claim-view-states.js
  83. +16 −0 app/routes/utils/get-current-status-event.js
  84. +9 −0 app/routes/utils/get-error-messages-by-key.js
  85. +20 −0 app/routes/utils/parse-data.js
  86. +19 −0 app/routes/utils/pre-submission-handler.js
  87. +14 −0 app/routes/utils/regex-checker.js
  88. +144 −0 app/routes/view-agreement.js
  89. +0 −31 app/routes/view-application.js
  90. +327 −0 app/routes/view-claim.js
  91. +52 −0 app/routes/withdraw-agreement.js
  92. +40 −5 app/server.js
  93. +16 −5 app/session/index.js
  94. +7 −1 app/session/keys.js
  95. +1 −1 app/views/accessibility.njk
  96. +28 −0 app/views/account.njk
  97. +61 −0 app/views/agreement.njk
  98. +66 −0 app/views/agreements.njk
  99. +0 −103 app/views/applications.njk
  100. +64 −0 app/views/claims.njk
  101. +5 −32 app/views/cookies/cookie-banner.njk
  102. +1 −71 app/views/cookies/cookie-policy.njk
  103. +9 −7 app/views/error-pages/4xx.njk
  104. +9 −7 app/views/error-pages/500.njk
  105. +0 −20 app/views/home.njk
  106. +46 −0 app/views/includes/application-tabs.njk
  107. +14 −0 app/views/includes/authorise-action.njk
  108. +38 −0 app/views/includes/authorise-form.njk
  109. +11 −0 app/views/includes/move-to-in-check-action.njk
  110. +39 −0 app/views/includes/move-to-in-check-form.njk
  111. +9 −0 app/views/includes/recommend-action.njk
  112. +38 −0 app/views/includes/recommend-to-pay-form.njk
  113. +38 −0 app/views/includes/recommend-to-reject-form.njk
  114. +14 −0 app/views/includes/reject-action.njk
  115. +38 −0 app/views/includes/reject-form.njk
  116. +39 −0 app/views/includes/update-status-form.njk
  117. +7 −0 app/views/includes/withdraw-action.njk
  118. +38 −0 app/views/includes/withdraw-form.njk
  119. +57 −64 app/views/layouts/_layout.njk
  120. +63 −0 app/views/layouts/header.njk
  121. +7 −51 app/views/macros/pagination.njk
  122. +1 −1 app/views/privacy-policy.njk
  123. +90 −0 app/views/view-agreement.njk
  124. +0 −257 app/views/view-application.njk
  125. +102 −0 app/views/view-claim.njk
  126. +1 −0 appconfig/common.yaml
  127. +1 −0 appconfig/dev.yaml
  128. +1 −0 appconfig/post-deployment-test.yaml
  129. +1 −0 appconfig/prd.yaml
  130. +1 −0 appconfig/pre.yaml
  131. +1 −0 appconfig/snd2.yaml
  132. +1 −0 appconfig/test.yaml
  133. +2 −0 docker-compose.override.yaml
  134. +5 −0 docker-compose.test.yaml
  135. +12 −6 docker-compose.yaml
  136. +21 −0 docker-compose.zap.yaml
  137. +26 −0 helm/ffc-ahwr-backoffice/.helmignore
  138. +2 −2 helm/ffc-ahwr-backoffice/Chart.yaml
  139. +2 −2 helm/ffc-ahwr-backoffice/templates/_container.yaml
  140. +0 −5 helm/ffc-ahwr-backoffice/templates/azure-identity-binding.yaml
  141. +0 −5 helm/ffc-ahwr-backoffice/templates/azure-identity.yaml
  142. +8 −5 helm/ffc-ahwr-backoffice/templates/config-map.yaml
  143. +7 −2 helm/ffc-ahwr-backoffice/templates/container-secret.yaml
  144. +3 −0 helm/ffc-ahwr-backoffice/templates/service-account.yaml
  145. +15 −4 helm/ffc-ahwr-backoffice/values.yaml
  146. +0 −9 helm/ffc-template-node/Chart.yaml
  147. +0 −6 helm/ffc-template-node/templates/_container.yaml
  148. +0 −3 helm/ffc-template-node/templates/cluster-ip-service.yaml
  149. +0 −7 helm/ffc-template-node/templates/config-map.yaml
  150. +0 −7 helm/ffc-template-node/templates/container-secret.yaml
  151. +0 −8 helm/ffc-template-node/templates/deployment.yaml
  152. +0 −45 helm/ffc-template-node/values.yaml
  153. +3 −1 jsconfig.json
  154. +5,176 −12,887 package-lock.json
  155. +32 −25 package.json
  156. +2 −0 provision.azure.yaml
  157. +0 −132 rename.js
  158. +27 −0 scripts/start
  159. +22 −3 scripts/test
  160. +1 −0 sonar-project.properties
  161. +7 −0 test/acceptance/.gitignore
  162. +13 −0 test/acceptance/Dockerfile
  163. +125 −0 test/acceptance/README.md
  164. +12 −0 test/acceptance/babel.config.js
  165. +4 −0 test/acceptance/docker-compose.debug.yaml
  166. +18 −0 test/acceptance/docker-compose.override.yaml
  167. +28 −0 test/acceptance/docker-compose.yaml
  168. +110 −0 test/acceptance/features/288276-substatuses-backOffice.feature
  169. +130 −0 test/acceptance/features/backOffice.feature
  170. +41 −0 test/acceptance/features/multiple-business.feature
  171. +70 −0 test/acceptance/features/search-functionality-subStatuses.feature
  172. +44 −0 test/acceptance/features/single-business.feature
  173. +85 −0 test/acceptance/features/substatuses-backOffice.feature
  174. +23,967 −0 test/acceptance/package-lock.json
  175. +88 −0 test/acceptance/package.json
  176. +137 −0 test/acceptance/pages/back-office-page.js
  177. +57 −0 test/acceptance/pages/common-actions.js
  178. +100 −0 test/acceptance/steps/back-office-steps.js
  179. +81 −0 test/acceptance/steps/select-business-step.js
  180. +307 −0 test/acceptance/wdio.bs.config.js
  181. +416 −0 test/acceptance/wdio.config.js
  182. +20 −0 test/data/application-events.json
  183. +19 −0 test/data/application-history.json
  184. +230 −0 test/data/applications.json
  185. +84 −0 test/data/claims.json
  186. +32 −0 test/data/contact-history.json
  187. +312 −0 test/data/view-applications.json
  188. +51 −0 test/integration/narrow/routes/account.test.js
  189. +193 −0 test/integration/narrow/routes/agreement.test.js
  190. +302 −0 test/integration/narrow/routes/agreements.test.js
  191. +146 −0 test/integration/narrow/routes/applications.filter.test.js
  192. +0 −244 test/integration/narrow/routes/applications.test.js
  193. +185 −0 test/integration/narrow/routes/approve-application-claim.test.js
  194. +43 −0 test/integration/narrow/routes/authenticate.test.js
  195. +91 −0 test/integration/narrow/routes/claims.test.js
  196. +0 −95 test/integration/narrow/routes/cookies.test.js
  197. +39 −0 test/integration/narrow/routes/dev-auth.test.js
  198. +22 −10 test/integration/narrow/routes/home.test.js
  199. +49 −0 test/integration/narrow/routes/login.test.js
  200. +37 −0 test/integration/narrow/routes/logout.test.js
  201. +101 −0 test/integration/narrow/routes/models/application-claim.test.js
  202. +168 −0 test/integration/narrow/routes/models/application-history.test.js
  203. +71 −0 test/integration/narrow/routes/models/application-list.test.js
  204. +86 −0 test/integration/narrow/routes/models/claim-list.test.js
  205. +264 −0 test/integration/narrow/routes/move-to-in-check.test.js
  206. +187 −0 test/integration/narrow/routes/recommend-to-pay.test.js
  207. +190 −0 test/integration/narrow/routes/recommend-to-reject.test.js
  208. +197 −0 test/integration/narrow/routes/reject-application-claim.test.js
  209. +173 −0 test/integration/narrow/routes/update-status.test.js
  210. +10 −0 test/integration/narrow/routes/utils/date-converter.test.js
  211. +622 −0 test/integration/narrow/routes/view-agreement.test.js
  212. +121 −0 test/integration/narrow/routes/view-application-date-of-testing.test.js
  213. +0 −74 test/integration/narrow/routes/view-application.test.js
  214. +460 −0 test/integration/narrow/routes/view-claim.test.js
  215. +139 −0 test/integration/narrow/routes/withdraw-agreement.test.js
  216. +49 −0 test/lib/search-validation.test.js
  217. +12 −0 test/mocks/config.js
  218. +3 −0 test/setup.js
  219. +0 −1 test/teardown.js
  220. +276 −0 test/unit/api/applications.test.js
  221. +109 −0 test/unit/api/claim.test.js
  222. +89 −0 test/unit/api/contact-history.test.js
  223. +131 −0 test/unit/api/gov-holiday.test.js
  224. +24 −0 test/unit/auth/dev-auth.test.js
  225. +10 −0 test/unit/auth/get-user.test.js
  226. +12 −0 test/unit/auth/is-in-role.test.js
  227. +24 −0 test/unit/auth/map-auth.test.js
  228. +27 −0 test/unit/config/auth.test.js
  229. +0 −28 test/unit/config/messaging.test.js
  230. +0 −66 test/unit/cookies.test.js
  231. +180 −0 test/unit/crons/process-on-hold-apps-scheduler.test.js
  232. +114 −0 test/unit/crons/process-on-hold-apps.test.js
  233. +98 −0 test/unit/crons/process-on-hold-claims.test.js
  234. +64 −0 test/unit/lib/display-helper.test.js
  235. +44 −0 test/unit/lib/get-livestock-types.test.js
  236. +21 −0 test/unit/lib/get-review-type.test.js
  237. +0 −23 test/unit/messaging/applications.test.js
  238. +0 −17 test/unit/messaging/create-message.test.js
  239. +0 −44 test/unit/messaging/receive-message.test.js
  240. +0 −30 test/unit/messaging/send-message.test.js
  241. +28 −11 test/unit/pagination.test.js
  242. +25 −0 test/unit/plugins/headers.test.js
  243. +1,167 −0 test/unit/routes/utils/get-claim-view-states.test.js
  244. +48 −0 test/unit/routes/utils/parse-data.test.js
  245. +44 −0 test/unit/routes/utils/regex-checker.test.js
  246. +52 −38 test/unit/session.test.js
  247. +1 −1 test/utils/get-crumbs.js
  248. +1 −1 test/utils/phase-banner-expect.js
  249. +63 −0 zap/zap.conf
17 changes: 13 additions & 4 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -105,13 +105,22 @@
}
],
"results": {
"docker-compose.test.yaml": [
{
"type": "Secret Keyword",
"filename": "docker-compose.test.yaml",
"hashed_secret": "10f38898af083f58af3e236b345843571ea5b3d4",
"is_verified": false,
"line_number": 13
}
],
"docker-compose.yaml": [
{
"type": "Secret Keyword",
"filename": "docker-compose.yaml",
"hashed_secret": "5301b0b64604e377783a16f7feb7a8a3d1512697",
"is_verified": false,
"line_number": 15
"line_number": 20
}
],
"helm/ffc-ahwr-backoffice/values.yaml": [
@@ -120,16 +129,16 @@
"filename": "helm/ffc-ahwr-backoffice/values.yaml",
"hashed_secret": "5301b0b64604e377783a16f7feb7a8a3d1512697",
"is_verified": false,
"line_number": 28
"line_number": 35
},
{
"type": "Secret Keyword",
"filename": "helm/ffc-ahwr-backoffice/values.yaml",
"hashed_secret": "b840fc02d524045429941cc15f59e41cb7be6c52",
"is_verified": false,
"line_number": 38
"line_number": 45
}
]
},
"generated_at": "2022-06-14T11:03:59Z"
"generated_at": "2022-06-23T10:01:48Z"
}
10 changes: 8 additions & 2 deletions .snyk
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.19.0
ignore: {}
version: v1.22.1
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-AZUREMSALNODE-7246761:
- "*":
reason: None given
expires: "2025-03-01T00:00:00.000Z"
created: "2024-12-12T00:00:00.000Z"
patch: {}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PARENT_VERSION=1.2.15-node16.14.0
ARG PARENT_VERSION=2.3.0-node20.15.0
ARG PORT=3000
ARG PORT_DEBUG=9229

2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@Library('defra-library@v-9') _
@Library('defra-library@v-10') _

buildNodeJs()
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,6 @@
# FFC Template Node
# FFC AHWR Backoffice

Template to support rapid delivery of microservices for FFC Platform. It contains the configuration needed to deploy a simple Hapi Node server to the Azure Kubernetes Platform.

## Usage

Create a new repository from this template and run `./rename.js` specifying the new name of the project and the description to use e.g.
```
./rename.js ffc-demo-web "Web frontend for demo workstream"
```

The script will update the following:

* `package.json`: update `name`, `description`, `homepage`
* `docker-compose.yaml`: update the service name, `image` and `container_name`
* `docker-compose.test.yaml`: update the service name, `image` and `container_name`
* `docker-compose.override.yaml`: update the service name, `image` and `container_name`
* Rename `helm/ffc-ahwr-backoffice`
* `helm/ffc-ahwr-backoffice/Chart.yaml`: update `description` and `name`
* `helm/ffc-ahwr-backoffice/values.yaml`: update `name`, `namespace`, `workstream`, `image`, `containerConfigMap.name`
* `helm/ffc-ahwr-backoffice/templates/_container.yaml`: update the template name
* `helm/ffc-ahwr-backoffice/templates/cluster-ip-service.yaml`: update the template name and list parameter of include
* `helm/ffc-ahwr-backoffice/templates/config-map.yaml`: update the template name and list parameter of include
* `helm/ffc-ahwr-backoffice/templates/deployment.yaml`: update the template name, list parameter of deployment and container includes

### Notes on automated rename

* The Helm chart deployment values in `helm/ffc-ahwr-backoffice/values.yaml` may need updating depending on the resource needs of your microservice
* The rename is a one-way operation i.e. currently it doesn't allow the name being changed from to be specified
* There is some validation on the input to try and ensure the rename is successful, however, it is unlikely to stand up to malicious entry
* Once the rename has been performed the script can be removed from the repo
* Should the rename go awry the changes can be reverted via `git clean -df && git checkout -- .`
Backoffice application for Animal Health and Welfare Review

## Prerequisites

@@ -53,7 +24,6 @@ Container images are built using Docker Compose, with the same images used to ru
When using the Docker Compose files in development the local `app` folder will
be mounted on top of the `app` folder within the Docker container, hiding the CSS files that were generated during the Docker build. For the site to render correctly locally `npm run build` must be run on the host system.


By default, the start script will build (or rebuild) images so there will
rarely be a need to build images manually. However, this can be achieved
through the Docker Compose
8 changes: 8 additions & 0 deletions __mocks__/applicationinsights.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const appInsights = {
defaultClient: {
trackEvent: jest.fn(),
trackException: jest.fn()
}
}

module.exports = appInsights
104 changes: 104 additions & 0 deletions app/api/applications.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
const wreck = require('@hapi/wreck')
const { applicationApiUri } = require('../config')

async function getApplication (applicationReference, logger) {
const endpoint = `${applicationApiUri}/application/get/${applicationReference}`
try {
const { payload } = await wreck.get(endpoint, { json: true })
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function getApplications (searchType, searchText, limit, offset, filterStatus, sort, logger) {
const endpoint = `${applicationApiUri}/application/search`
const options = {
payload: {
search: { text: searchText, type: searchType },
limit,
offset,
filter: filterStatus,
sort
},
json: true
}
try {
const { payload } = await wreck.post(endpoint, options)
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function processApplicationClaim (reference, user, approved, logger, note) {
const endpoint = `${applicationApiUri}/application/claim`
const options = {
payload: {
reference,
user,
approved,
note
},
json: true
}
try {
const { payload } = await wreck.post(endpoint, options)
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function updateApplicationStatus (reference, user, status, logger, note) {
const endpoint = `${applicationApiUri}/application/${reference}`
const options = {
payload: {
user,
status,
note
},
json: true
}
try {
const { payload } = await wreck.put(endpoint, options)
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function getApplicationHistory (reference, logger) {
const endpoint = `${applicationApiUri}/application/history/${reference}`
try {
const { payload } = await wreck.get(endpoint, { json: true })
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function getApplicationEvents (reference, logger) {
const endpoint = `${applicationApiUri}/application/events/${reference}`
try {
const { payload } = await wreck.get(endpoint, { json: true })
return payload
} catch (err) {
logger.setBindings({ err })
throw err
}
}

module.exports = {
getApplications,
getApplication,
processApplicationClaim,
getApplicationHistory,
getApplicationEvents,
updateApplicationStatus
}
60 changes: 60 additions & 0 deletions app/api/claims.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const wreck = require('@hapi/wreck')
const { applicationApiUri } = require('../config')

async function getClaim (reference, logger) {
const endpoint = `${applicationApiUri}/claim/get-by-reference/${reference}`
try {
const { payload } = await wreck.get(endpoint, { json: true })
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function getClaims (searchType, searchText, filter, limit, offset, sort, logger) {
const endpoint = `${applicationApiUri}/claim/search`
const options = {
payload: {
search: { text: searchText, type: searchType },
filter,
limit,
offset,
sort
},
json: true
}
try {
const { payload } = await wreck.post(endpoint, options)
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

async function updateClaimStatus (reference, user, status, logger, note) {
const endpoint = `${applicationApiUri}/claim/update-by-reference`
const options = {
payload: {
reference,
status,
user,
note
},
json: true
}
try {
const { payload } = await wreck.put(endpoint, options)
return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

module.exports = {
getClaim,
getClaims,
updateClaimStatus
}
53 changes: 53 additions & 0 deletions app/api/contact-history.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const wreck = require('@hapi/wreck')
const { applicationApiUri } = require('../config')
const { fieldsNames, labels, notAvailable } = require('./../constants/contact-history')

async function getContactHistory (reference, logger) {
const endpoint = `${applicationApiUri}/application/contact-history/${reference}`
try {
const { payload } = await wreck.get(endpoint, { json: true })

return payload
} catch (err) {
logger.setBindings({ err, endpoint })
throw err
}
}

const getContactFieldData = (contactHistoryData, field) => {
const filteredData = contactHistoryData.filter(contact => contact.data?.field === field)

if (filteredData.length === 0) {
return 'NA'
}

const [firstUpdate] = filteredData.sort((a, b) =>
new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()
)

return `${labels[field]} ${firstUpdate.data.oldValue}`
}

const displayContactHistory = (contactHistory) => {
if (contactHistory) {
const orgEmail = getContactFieldData(contactHistory, fieldsNames.orgEmail)
const email = getContactFieldData(contactHistory, fieldsNames.email)
const address = getContactFieldData(contactHistory, fieldsNames.address)
return {
orgEmail,
email,
address
}
} else {
return {
orgEmail: notAvailable,
email: notAvailable,
address: notAvailable
}
}
}

module.exports = {
getContactHistory,
displayContactHistory
}
38 changes: 38 additions & 0 deletions app/api/gov-holiday.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const wreck = require('@hapi/wreck')

async function getHolidayCalendarForEngland () {
const endpoint = 'https://www.gov.uk/bank-holidays.json'
const { payload } = await wreck.get(endpoint, { json: true })
if (!(payload?.['england-and-wales']?.events)) {
throw new Error('bank holidays response missing events')
}
return payload['england-and-wales'].events // Returns only the events for England and Wales
}

async function isTodayCustomHoliday () {
const url = `${process.env.APPLICATION_API_URI}/holidays/isTodayHoliday`
try {
await wreck.get(url)
return true
} catch (err) {
if (err.output.statusCode === 404) {
return false
} else {
throw err
}
}
}

async function isTodayHoliday () {
const holidays = await module.exports.getHolidayCalendarForEngland()
const today = new Date().toISOString().split('T')[0] // Format today's date as YYYY-MM-DD
let isHoliday = holidays?.some(holiday => holiday.date === today)
if (!isHoliday) isHoliday = await module.exports.isTodayCustomHoliday()
return isHoliday
}

module.exports = {
isTodayHoliday,
getHolidayCalendarForEngland,
isTodayCustomHoliday
}
Loading