Implements the facility-classes-booking-dashboard plan (backend):
- Facility.BookingMode (single Scheduled/AdHoc choice) replaced with
independent SupportsClasses/SupportsBooking flags, so one facility
can run a class and accept walk-in bookings; a running class now
blocks walk-in booking for its window on both create and reschedule.
- CustomerPlan.GrantsGymAccess + CustomerPlanClass join table let a
customer hold one gym-access plan plus any number of class-only
plans. Replaced the old single-subscription resolution
(GetActiveSubscriptionByCustomerId/HasAnyActiveSubscriptionAsync)
with gym-access-aware and class-aware resolvers across booking
creation/cancellation, plan assignment, and customer self-service.
Fixed ChangeMembershipPlan/renewal plan-changes, which resolved "the
subscription to replace" by most-recent-created and would have
deactivated a member's class subscription instead of their gym one.
- New FacilityClass model: recurring class definitions (Daily/Weekly/
Monthly/Custom) with lazy occurrence generation (8-week horizon,
race-safe via a unique index) and proper unlimited-capacity handling.
"Mark not held" replaces the old bare-cancel: cascades to cancel and
refund every confirmed booking on the occurrence through the same
core CancelBooking uses, and frees the slot for walk-in booking.
Scheduling conflicts (a walk-in booking now overlapping a class) are
surfaced for staff to resolve via the existing Reschedule flow.
- Renamed the pre-existing "AdHoc" booking-mode terminology to
"WalkIn" throughout (routes, methods, DTOs, the stored BookingMode
value) for a clearer, simpler name.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds GET /client/inventory/stock-movements, a unified read-only ledger
flattening every GRN line, sale line and return across all products
into one shape for the new Stock Tracking tab's table.
- Implement Sale and SaleItem models for tracking sales transactions.
- Create StockReturn model to manage stock adjustments for various reasons.
- Introduce Supplier model to represent suppliers of products.
- Develop InventoryRepository for CRUD operations on products, suppliers, sales, and stock returns.
- Implement InventoryService to handle business logic for inventory management.
- Update TenantDbContext to include new models and relationships.
- Enhance ProfitLossRepository to account for sales, purchases, and stock returns in profit and loss calculations.
- Modify Program.cs to register new inventory-related services.
- Added customerId to guest booking requests for better identification.
- Implemented new endpoints for managing booking invoices and dashboard summaries.
- Created BookingInvoice and BookingDashboardSummary DTOs to support new features.
- Updated Booking and BookingInvoice models to include payment method and timestamps.
- Enhanced BookingService to handle invoice creation upon payment confirmation.
- Modified BookingRepository to support CRUD operations for BookingInvoice.
- Updated TenantDbContext to include BookingInvoice DbSet and relevant configurations.
- Improved error handling and validation for booking completion and payment processes.
- Updated CustomerPlanService to replace references to PlaceRepo with FacilityRepository for managing customer plans and associated facilities.
- Removed PlaceService and its related methods, consolidating functionality into FacilityService.
- Added RfidTagService for managing RFID tags, including methods for creating, updating, and setting statuses of tags.
- Updated TenantDbContext to include new DbSet for RfidTags and CustomerPlanFacilities, and adjusted model configurations accordingly.
- Enhanced FacilityService to support new booking modes and validation for facility creation and updates.