PO-2656 add history and notes tab to major creditor - #2914
PO-2656 add history and notes tab to major creditor#2914GarethLangley1 wants to merge 10 commits into
Conversation
Arnabsubedi233
left a comment
There was a problem hiding this comment.
Just one small comment, the rest looks good
There was a problem hiding this comment.
I dont think we have to convert to timestamp for the dates well atleast we should not do, because we are not capturing time ,only dates, so we should just be sending a date object not datetime. I think if you look at how fines-acc-defendant-history-and-notes transformation has been built, it should be similar to that when it comes to the dates.
There was a problem hiding this comment.
I'm aware this wasn't your change, but I'm wondering if this could use the date service instead via the common-ui-lib 🤔
[P1]: Shared date handling
Problem: This adds custom frontend date parsing and UTC timestamp conversion infinesAccDateToRfc3339UtcTimestamp.
Why: We are trying to keep date parsing/formatting rules inside the shared date service/lib so timezone, validation, and formatting behaviour stays consistent across OPAL.
Fix: Replace the manualsplit('/'),Date.UTC, andtoISOString()logic with the sharedDateService/lib date conversion helper, or add the missing helper there if it does not already exist.
Suggestion:
const parsedDate = this.dateService.getFromFormat(date, 'dd/MM/yyyy');
if (!this.dateService.isValidDate(parsedDate)) {
// handle invalid date consistently
}
return parsedDate
.setZone('utc', { keepLocalTime: true })
.startOf('day')
.toISO();
| export interface IFinesAccMajorCreditorDetailsHistoryAndNotesFilterPayload { | ||
| dateFrom?: string; | ||
| dateTo?: string; | ||
| } |
There was a problem hiding this comment.
| export interface IFinesAccMajorCreditorDetailsHistoryAndNotesFilterPayload { | |
| dateFrom?: string; | |
| dateTo?: string; | |
| } | |
| export interface IFinesAccMajorCreditorDetailsHistoryAndNotesFilterPayload { | |
| dateFrom: string | null; | |
| dateTo: string| null; | |
| } |
| const options: { | ||
| observe: 'response'; | ||
| params?: Record<string, string>; | ||
| } = { observe: 'response' }; |
There was a problem hiding this comment.
[P2]: Safe read retry policy
Problem: The new major-creditor history GET builds its HTTP options inline and does not use the existing safe-read retry wrapper.
Why: Other account-detail GETs usewithRetrySafeReadOptions, so this endpoint will behave differently on transient timeout/gateway failures.
Fix: Initialise the options withthis.withRetrySafeReadOptions({ observe: 'response' as const }), matching the minor-creditor history endpoint.
Could we extract the following into a private method and call it from these methods to reduce duplication?
const options: {
observe: 'response';
params?: Record<string, string>;
} = this.withRetrySafeReadOptions({ observe: 'response' as const });
Jira link
See PO-2656
Change description
/major-creditor-accounts/{id}/historyfor the current account.Testing done
Security Vulnerability Assessment
CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?
Checklist