Class Equipment

java.lang.Object
com.equipmentrental.equipment_rental_system.model.Equipment

@Entity public class Equipment extends Object
Represents a physical equipment item available for booking. This is the central entity in the system: it is categorised, booked and tracked.

Each item belongs to exactly one Category (BR-04) and can have multiple Booking records. The EquipmentStatus reflects the current availability and is updated automatically when bookings are created or cancelled (BR-08).

Equipment with active bookings cannot be deleted (BR-07). Items in MAINTENANCE or UNAVAILABLE status cannot be booked (BR-01).

See Also:
  • Constructor Details

    • Equipment

      public Equipment(String name, String description, String location, String condition, EquipmentStatus status, LocalDate purchaseDate, BigDecimal costPerDay, Category category)
      Creates a new equipment item with all fields.
      Parameters:
      name - display name of the item
      description - brief description
      location - physical storage location
      condition - current physical condition (e.g. Good, Fair, Excellent)
      status - availability status
      purchaseDate - date the item was acquired
      costPerDay - daily booking cost in pounds sterling
      category - the category this item belongs to
  • Method Details

    • isAvailable

      public boolean isAvailable()
      Checks whether this equipment item has AVAILABLE status.
      Returns:
      true if the status is EquipmentStatus.AVAILABLE
    • updateStatus

      public void updateStatus(EquipmentStatus newStatus)
      Updates the equipment status to the specified value.
      Parameters:
      newStatus - the new status to set