mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 20:38:17 +00:00
fix(clearance): flag bookings with documents still awaiting GL approval
This commit is contained in:
@@ -1175,6 +1175,19 @@ export class BookingClearanceService {
|
||||
);
|
||||
filtered.push(b);
|
||||
}
|
||||
|
||||
// A document added after clearance was finalized lands as PENDING without
|
||||
// moving the booking's status — the row would otherwise still read
|
||||
// "Clearance ready" while GL has something waiting. Ad-hoc documents are
|
||||
// tracked by no milestone, so this reads the review rows directly.
|
||||
const pending = await this.bookingsRepository.findBookingsWithUnreviewedDocuments(
|
||||
filtered.map((b) => b.id),
|
||||
);
|
||||
for (const b of filtered) {
|
||||
(b as Booking & { hasDocumentsAwaitingReview?: boolean })
|
||||
.hasDocumentsAwaitingReview = pending.has(b.id);
|
||||
}
|
||||
|
||||
const rows = await this.attachContractSummary(filtered);
|
||||
return this.narrowToYardScope(rows, user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user