mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-02 19:43:39 +00:00
feat(bookings): enhance booking filtering and pagination
- Added createdFrom and createdTo filters to BookingListFilterOptions and FilterBookingDto for date range filtering. - Updated BookingsService and BookingsRepository to handle pagination metadata in responses. - Enhanced BookingsController to return pagination metadata when no company is linked. - Introduced ModeIndicator component to display current operational mode across various pages. - Added ContainersCard and KeyFactsStrip components for detailed booking views. - Implemented CargoModeCell, BookingTypeBadge, and PaymentBadge for consistent display of booking attributes. - Updated MyBookings and ContractsList pages to include new filters and display enhancements.
This commit is contained in:
@@ -132,7 +132,22 @@ export class BookingsController {
|
||||
const companyId =
|
||||
await this.bookingsService.resolveCustomerCompanyId(userId);
|
||||
// No linked company yet → no bookings to show (avoids leaking all bookings).
|
||||
if (!companyId) return { items: [], total: 0 };
|
||||
if (!companyId) {
|
||||
const page = filter.page ?? 1;
|
||||
const pageSize = filter.pageSize ?? 20;
|
||||
return {
|
||||
items: [],
|
||||
total: 0,
|
||||
meta: {
|
||||
page,
|
||||
pageSize,
|
||||
total: 0,
|
||||
totalPages: 0,
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
// Scope to the active operational profile (importer/exporter) when one
|
||||
// resolves; otherwise fall back to company-level scoping.
|
||||
const companyProfileId =
|
||||
|
||||
Reference in New Issue
Block a user