-
Notifications
You must be signed in to change notification settings - Fork 3
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
[DRAFT][FOR-REFERENCE-ONLY]: Save sold-land-filter
option to database
#1454
base: main
Are you sure you want to change the base?
[DRAFT][FOR-REFERENCE-ONLY]: Save sold-land-filter
option to database
#1454
Conversation
…DIS_removal flag is turned on
…ing or updating an overseas entity
…tity when saving OE name
0ab0482
to
5c3d9a3
Compare
@@ -29,9 +32,9 @@ export const postTransaction = async (req: Request, session: Session): Promise<s | |||
); | |||
|
|||
if (!response.httpStatusCode || response.httpStatusCode >= 400) { | |||
throw createAndLogErrorRequest(req, `'postTransaction' for company number '${companyNumber}' with name '${companyName}' returned HTTP status code ${response.httpStatusCode}`); | |||
throw createAndLogErrorRequest(req, `'>>error:>>>>>>>>postTransaction' for company number '${companyNumber}' with name '${companyName}' returned HTTP status code ${response.httpStatusCode}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The >>error:>>>>>>>>
text here and below will need to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will get rid of these. The new PR doesn't have them.
import { isActiveFeature } from "./feature.flag"; | ||
import { getOverseasEntity } from "../service/overseas.entities.service"; | ||
|
||
export const getApplicationData = async (session: Session | undefined, req?: Request): Promise<ApplicationData> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume at some point this function will no longer take a session
as parameter? Retrieval will always be based on a transaction and submission id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely. When we have an entirely REDIS-free journey, this method will need not have this parameter.
src/utils/application.data.ts
Outdated
import { getOverseasEntity } from "../service/overseas.entities.service"; | ||
|
||
export const getApplicationData = async (session: Session | undefined, req?: Request): Promise<ApplicationData> => { | ||
if (typeof req === "undefined" || !isActiveFeature(FEATURE_FLAG_ENABLE_REDIS_REMOVAL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, perhaps in the future, when work is nearer complete, if the request is undefined
I think this should be an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
const submissionId: string = req.params[ROUTE_PARAM_SUBMISSION_ID] ?? ""; | ||
|
||
if (transactionId === "" && submissionId === "") { | ||
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine if Redis cache removal isn't switched on, but if it is, is this an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specifically for the landing page of the journey where we have no transactionID
and no submissionID
, so it shouldn't error but should return an empty object.
return {}; | ||
} | ||
|
||
const appData = await getOverseasEntity(req, transactionId, submissionId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are tests around this changed functionality to follow later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these were to follow later, but the revised implementation means they will now be part of a future PR.
logger.debugRequest(req, `POST ${config.SOLD_LAND_FILTER_PAGE}`); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see any tests for this changed functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now in the new PR here.
if (hasSoldLand !== '0') { | ||
nextPageUrl = config.CANNOT_USE_URL; | ||
} else { | ||
if (!appData[Transactionkey]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting this change in behaviour to be feature flagged but it's not. That might be ok, but we need to discuss. Relates to this comment on the API change:
https://github.com/companieshouse/overseas-entities-api/pull/404/files#r1673848116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, it makes sense to put this behind the Redis feature flag as it's a fundamental change to the behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Feature flag added to new PR here.
sold-land-filter
option to databasesold-land-filter
option to database
sold-land-filter
option to databasesold-land-filter
option to database
sold-land-filter
option to databasesold-land-filter
option to database
JIRA link
https://companieshouse.atlassian.net/browse/ROE-2559
Change description
sold-land-filter
option to the APIgetApplicationData
method to fetch data from APIWork checklist