mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 21:50:57 +00:00
Merge pull request #1364 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
This commit is contained in:
@@ -66,6 +66,12 @@ export interface BookingClearanceView {
|
||||
}>;
|
||||
allApproved: boolean;
|
||||
documentsOpen: boolean;
|
||||
docRequests: Array<{
|
||||
id: string;
|
||||
note: string;
|
||||
byName: string | null;
|
||||
at: string;
|
||||
}>;
|
||||
phase?: string | null;
|
||||
milestones?: Array<{
|
||||
id: string;
|
||||
@@ -206,9 +212,14 @@ export class BookingClearanceService {
|
||||
bookingId,
|
||||
'CHANGES_REQUESTED',
|
||||
);
|
||||
const docRequestNotes = await this.bookingsRepository.findReviewNotes(
|
||||
bookingId,
|
||||
'ADDITIONAL_DOC_REQUEST',
|
||||
);
|
||||
const reviewerNames = await this.bookingsRepository.resolveStaffNames([
|
||||
...reviews.map((r) => r.reviewedByStaffId),
|
||||
...queryNotes.map((n) => n.authorId),
|
||||
...docRequestNotes.map((n) => n.authorId),
|
||||
]);
|
||||
|
||||
const documents: BookingClearanceView['documents'] = [];
|
||||
@@ -357,6 +368,12 @@ export class BookingClearanceService {
|
||||
documents,
|
||||
allApproved,
|
||||
documentsOpen: clearanceDocumentsOpen(booking),
|
||||
docRequests: docRequestNotes.map((n) => ({
|
||||
id: n.id,
|
||||
note: n.note,
|
||||
byName: n.authorId ? (reviewerNames.get(n.authorId) ?? null) : null,
|
||||
at: n.createdAt.toISOString(),
|
||||
})),
|
||||
phase,
|
||||
milestones: milestones.map((m) => ({
|
||||
id: m.id,
|
||||
|
||||
Reference in New Issue
Block a user