Skip to content

Issue #14 — Backend: Booking Entity & Module Scaffold #712

@yusuftomilola

Description

@yusuftomilola

Location: backend/src/bookings/

Description

ManageHub needs a Bookings module to handle workspace reservations made by members. A booking represents a member's intent to use a specific workspace for a defined period under a chosen pricing plan. This issue covers the foundational setup — the database entity, the NestJS module, and the bare service/controller stubs that subsequent issues will build on.

The platform uses NestJS with TypeORM and PostgreSQL (synchronize: true is active). All monetary values must be stored in kobo as integers.

Acceptance Criteria

  • A Booking entity is created at backend/src/bookings/entities/booking.entity.ts with the following fields:
    • id — UUID, primary key, auto-generated
    • planType — enum: HOURLY, DAILY, MONTHLY
    • startDate — timestamp, required
    • endDate — timestamp, required
    • seatCount — integer, default 1
    • totalAmountKobo — integer, required
    • status — enum: PENDING, CONFIRMED, COMPLETED, CANCELLED — default PENDING
    • notes — text, nullable
    • userId — UUID, foreign key referencing users
    • workspaceId — UUID, foreign key referencing workspaces
    • user@ManyToOne relation to User entity
    • workspace@ManyToOne relation to Workspace entity
    • createdAt / updatedAt — auto timestamps
  • A BookingStatus enum is created at backend/src/bookings/enums/booking-status.enum.ts
  • A PlanType enum is created at backend/src/bookings/enums/plan-type.enum.ts
  • A BookingsModule is created at backend/src/bookings/bookings.module.ts with TypeOrmModule.forFeature([Booking]) registered
  • A BookingsService stub is created at backend/src/bookings/providers/bookings.service.ts
  • A BookingsController stub is created at backend/src/bookings/bookings.controller.ts with the @Controller('bookings') decorator
  • BookingsModule is imported into backend/src/app.module.ts
  • npx tsc --noEmit passes with no errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions