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

Chore/1815 removed unused audits amend #678

Draft
wants to merge 75 commits into
base: chore/1815-remove-unused-audit
Choose a base branch
from

Conversation

jenbutongit
Copy link
Contributor

No description provided.

…eController functions to handle rendering of start and countries pages for lawyers and funeral directors

chore(start.njk): fix template inheritance path
chore(which-country-list-do-you-want-to-be-added-to.njk): add template for which-country-list-do-you-want-to-be-added-to page for funeral directors
…tPageController, postCountrySelectPageController and getStopPage functions to handle rendering start page for different service types

refactor(router.ts): import Routes and Controllers modules for better organization and readability
refactor(routes.ts): add routes for lawyers and funeralDirectors service types to improve code readability and maintainability
…or template files and routes in getCountrySelectPageController

chore(router.ts): update routes for Funeral Directors to use constants for better maintainability and consistency with Lawyers routes
chore(router.ts): rename getStopPage to getStopPageController for consistency
…le to be passed to the start page template

chore(controllers.ts): add support for backLink variable to be passed to the country select page template
…y and semantics

chore(funeral-directors.json): add backLinkFallback to handle fallback URL when navigating back
chore(router.ts): update route path to include funeral-directors service type in applyRouter
…gnups for different service types

test(prevent-signups.feature): add scenario outline for preventing jumping to form pages without answering initial question
test(prevent-signups.feature): add scenario outline for preventing changing country answer and skipping to form pages
test(prevent-signups.feature): add scenario outline for testing back link functionality
chore(checkCountryQuestionAnswered.ts): convert service type to camel case before checking list existence
…mprove readability

chore(prevent-signups.feature): update example values in table to match the expected titles for better test clarity
…-country-list-do-you-want-to-be-added-to" for better user experience

chore(controllers.ts): update route paths and backLink values to match the new route structure for better maintainability and readability
chore(router.ts): remove unused import and update route paths to match the new route structure
chore(start.njk): update href value to "which-country-list-do-you-want-to-be-added-to" for better consistency
chore(views): rename "which-list-of-lawyers.njk" to "which-country-list-do-you-want-to-be-added-to.njk" to match the new route structure
…lude dynamic service title for better user experience
…ed page paths for lawyers application

chore(helpers.ts): add serviceTypeSchema validation schema for serviceType parameter in controllers
…op pages in the applyRouter

- Added a new file `handlers.ts` in the `proxyMiddleware` directory to define the handlers for the start, countrySelect, and stop pages.
- In `handlers.ts`, defined the `getStartPage`, `getCountrySelectPage`, `postCountrySelectPage`, and `getStopPage` functions to handle the corresponding requests.
- Updated the `router.ts` file in the `proxyMiddleware` directory to import the `handlers` object from `handlers.ts`.
- Replaced the existing controller functions with the corresponding handlers in the `applyRouter` routes.
- Removed the `Controllers` import statement from `router.ts`.

The changes were made to improve the code structure and make it more modular by separating the handler functions from the router file. This will make it easier to maintain and test the code.
…' for better readability and semantics

chore(handlers.ts): update render path to use 'serviceType' variable instead of 'value.serviceType'
chore(helpers.ts): update serviceTypeSchema to use Joi.string type with valid values "lawyers" and "funeral-directors"
- Added a new file `countrySelect.ts` in the `handlers` directory to handle the GET and POST requests for country selection.
- The `get` function renders the `apply/which-country-list-do-you-want-to-be-added-to` view with the countries list, the previously selected answer, and a back link.
- The `post` function handles the form submission and validates the selected country. If the country is not valid, an error message is flashed and the user is redirected back to the country selection page. Otherwise, the selected country is stored in the session and the existence of the list for the selected country and service type is checked. If the list does not exist, the user is redirected to the "not-currently-accepting" page. Otherwise, the user is redirected to the next page based on the service type.
- Added `countrySelect` export in the `handlers/index.ts` file to export the `get` and `post` functions.
- Updated the `router.ts` file to import the `handlers` module using the `* as` syntax to include all exported functions from the `handlers` directory.
…xist

Feat/1846 prevent list signup funeral directors
…ion type of "lawyers", "funeralDirectors", and "translatorsInterpreters" to improve type safety and readability

chore(router.ts): add support for translatorsInterpreters service type in applyRouter
chore(start.njk): create a new template for the start page of the translatorsInterpreters service type application
… service type to include closing parenthesis after the service type
chore(router.ts): add new routes for country selection page and update existing routes for translators-interpreters service
…tter readability

chore(prevent-signups.feature): add support for translators-interpreters service type in examples
… and interpreters service type

chore(router.ts): remove outdated todo comment
…ntroller to use a dynamic URL based on the serviceType

chore(not-accepting-currently.njk): update the page title to include the serviceTitle variable in the correct format
chore(start.njk): update the href value in the govukButton to use a static URL instead of a dynamic one
…readability

chore(prevent-signups.feature): add support for translators and interpreters to apply for the 'Find an English-speaking translator or interpreter abroad' service
…ervice type in the nextPagePath object to handle a new route

chore(router.ts): add support for "translators-interpreters" service type in the applyRouter routes to handle a new route
chore: add country prop to deserialisers
return false;
}
/**
* This query uses postgres enums. Enums in postgres are ordered so `>` operator can be used.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lmk if this is clear enough

Squashed commits:
[f21dd86] docs, tidy
[c25983e] add composeKeyDatesForDate tests
[4957b51] add eventName: "startAnnualReview" and fix tests
[351d3d1] check oneDayBeforeUnpublish
[047ab92] lint
[a119939] also insert annual review data into audit.
[4ce950f] tidying
[10e57ce] fixing tests
[89bc9cf] fix: use getNotifyClient for sendUnpublishReminder. Change query to look for `weeklyUnpublish`
[0c4474a] fix test
[3886463] do not record video
[6a5f159] fix lint
[7e83b12] return
[efe56d0] tiding
[1751542] video: true
[692bde8] debug
[2e23ffa] return
[6c9506f] tidy
[488cdc6] refactor: tidy processListsBeforeAndDuringStart
[d59f2ee] fix smoke test query
[4d3c364] fix migration
[33a1ef6] tidy
[bd1b07b] order by time desc
[d2024ce] docs, tidy
[47582a1] fix tests
[c90f6c2] tidy comment
[280f21c] tidy
[fc79284] lint
[cf9bf90] remove unused types
[76f9cfa] tidy types
[225c978] tidy
[1016f20] add reference param
[4ba68a0] tidying
[721f12e] refactor: use type from prisma client.
[75f137a] refactor: use ListAnnualReviewPostReminderType for sendAnnualReviewPostEmails
[6f4688f] migration
[0fc9081] clean up
[b93d915] simplifying annualReviewProviderType enums
[db83234] change send**postEmail to just name of the email. change order of enums
[d636907] shouldSend logs and docs
[52b7d7f] change emailType to annualReviewEmailType
[04762cf] migrations
[289005a] chore(ingestPutController.ts): fix import path for EventCreate type from "server/models/listItem/listItemEvent" to "shared/listItemEvent" to resolve import error
[63ae40c] chore(listItemEvent.ts): refactor the [ListItemEvent.EDITED] event creation function to accept additional options for different types of edits
[53e947d] chore(worker.feature): update scenario names to be more descriptive
chore(the_string_key_date_email_will_be_sent_to_post.js): simplify the where clause in the query to improve readability and maintainability
[8f2d179] chore: add emailType to prisma queries
[eb7f672] chore(migration.sql): add migration script to add emailType columns to Audit and Event tables
chore(schema.prisma): add emailType fields to Audit and Event models
[ea961bc] chore: fix issues with unit tests
[1a998c7] chore: address issues raised in PR
[f603ecb] chore(migration.sql): delete unused audits for list items
[2068e78] chore(migration.sql): update migration to delete only listItem audits with auditEvent set to 'REMINDER'
refactor(listItemEvent.ts): remove unnecessary check for "id" in response
[3097a16] chore(migration.sql): Remove unused enum values from `AuditEvent` enum
[1dd6326] chore(migrations): add migration to delete unused audits and update audit enum

chore(migrations): add migration to delete unused audits

chore(migrations): add migration to update audit enum
[25e066d] chore: include start of annual review date when getting reminder events
refactor: rename function names that didn't make sense
[2bb242d] chore: fix issue with failing smoke test by...
chore(an_email_for_the_string_key_date_is_sent_to_eligible_providers.js): add array to test instead of string
chore(audit.ts): add missing export statement for findReminderAuditEvents function
chore(govukNotify.ts): update return value of sendAnnualReviewProviderEmail and sendAnnualReviewPostEmail functions
chore(helpers.ts): update parameter type of isEmailSentBefore function
chore(main.ts): update import statements for Audit and Event types
[53c0ad0] chore: fix issue with smoke test failing
[9316919] chore(resetAnnualReviewForList.ts): uncomment code to add audit event for endAnnualReview
[ef22446] chore: fix type related issues
[a42e5e5] chore(types.ts): remove NotifyResult interface
chore(govuk-notify.ts): change return value of sendAuthenticationEmail, sendApplicationConfirmationEmail, sendDataPublishedEmail, and sendEditDetailsEmail to check for "id" in result and result.id !== undefined
chore(notifications-node-client.ts): change statusText to id in mockResolvedValue
[1969ccc] refactor: remove depreciated recordListItemEvent function and all references to it
[76272f2] change funeral director to lawyer
[0105e4e] remove button import
[75781a4] mimic apply footer
[6b5f40e] smoke tests
[cc36e82] skip if /session/* route
[2cd89f7] replay answer
[472d5b3] fix smoke tests
[ca7dfce] e2e tests
[463e0c4] add backLinkFallback
[e362daf] chore: fix issues with unit tests
[31b0424] chore: fix issues with cookies not working
[91212a9] chore(proxyMiddleware): add lawyersPostController to handle POST request for /application/lawyers/which-list-of-lawyers route
chore(proxyMiddleware): update route handlers in applyRouter to use lawyersPostController instead of postLawyers
chore(listItemCreateInputFromWebhook): update countryName parameter to use addressCountry property from deserialised data
[d9895c1] add back pro-bono skip for prt
[eebe79d] refactor(express-session.ts): add application object to SessionData interface to store application related data
refactor(applyController.ts): add postLawyers function to handle POST request for lawyers application
[ed587ab] add back can you offer pro-bono services to british nationals
[e58541c] fix logic
[f897fbf] allow /application/session routes to pass through without country check
[e1d3d9b] remove unused
[1f8320c] tidy
[5dec6af] wip
[1f6de9f] wip
[5a61d06] feat: move "which list of lawyers do you want to be added to" into lists so we can serve the "We are not currently accepting online applications" page dynamically
@jenbutongit jenbutongit force-pushed the chore/1815-removed-unused-audits-amend branch from 8c2bf75 to 774679a Compare September 29, 2023 11:00
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.

2 participants