-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, we will only be showing domainEvents when "accommodation is required from" or the "Release date" has been updated.
- Loading branch information
Showing
4 changed files
with
206 additions
and
5 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
29 changes: 29 additions & 0 deletions
29
server/testutils/factories/referralHistoryDomainEventNote.ts
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,29 @@ | ||
import type { | ||
Check failure on line 1 in server/testutils/factories/referralHistoryDomainEventNote.ts GitHub Actions / Linting 🔎
|
||
ReferralHistoryDomainEventNote, | ||
ReferralHistoryNoteMessageDetails, | ||
} from '@approved-premises/api' | ||
import { fakerEN_GB as faker } from '@faker-js/faker' | ||
import { Factory } from 'fishery' | ||
import { DateFormats } from '../../utils/dateUtils' | ||
|
||
export default Factory.define<ReferralHistoryDomainEventNote>(() => ({ | ||
id: faker.string.uuid(), | ||
createdByUserName: faker.person.fullName(), | ||
createdAt: DateFormats.dateObjToIsoDate(faker.date.past()), | ||
message: '', | ||
messageDetails: { | ||
domainEvent: { | ||
id: faker.string.uuid(), | ||
eventType: 'accommodation.cas3.assessment.updated', | ||
timestamp: DateFormats.dateObjToIsoDate(faker.date.past()), | ||
updatedFields: [ | ||
{ | ||
fieldName: 'releaseDate', | ||
updatedTo: '2025-09-02', | ||
updatedFrom: '2123-09-02', | ||
}, | ||
], | ||
}, | ||
} as ReferralHistoryNoteMessageDetails, | ||
type: 'domainEvent', | ||
})) |
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