module rentals base <https://example.org/v/rentals> is

  import [ dc skos xsd ]

  ;; This is actually a US VIN
  import cids:VehicleIdentificationNumber

  @dc:version = 2

  datatype UniqueId <- string is
    @xsd:pattern = "[A-Za-z0-9_-]{22}"
  end

  union RentalClass of
    Compact
    UtilityVehicle
    Luxury
  end

  enum CustomerLevel of
    Basic
    Silver
    Gold
  end

  entity Vehicle is
    @skos:prefLabel = "Vehicle"@en

    identity vin -> VehicleIdentificationNumber

    information -> VehicleInformation
    rentalClass -> RentalClass
  end

  structure VehicleInformation is
    make -> string
    model -> string
    year -> integer is
      @xsd:minValue = 2000
      @xsd:maxValue = 3000
    end
  end

  entity Location

  entity Customer 

  entity Booking is
    identity bookingCode -> unknown

    customer -> {1} Customer

    pickup_date -> xsd:date
    pickup_location -> Location
    dropoff_date -> xsd:date
    dropoff_location -> Location

    bookingClass -> {1} RentalClass
    vehicle -> {0..1} Vehicle
  end

  event VehicleAssigned source Booking is
    vehicle -> VehicleIdentificationNumber
  end

end
