Registering LockSystem module keys

HORES LockSystem module keep track of issued key-cards for each room.

When key-card is created outside HORES Desktop, it can be registered using registerLockSystemKey mutation.

Following conditions must be met:

  1. LockSystem module must be enabled in HORES

  2. Card must be registered for checked-in room only, you cannot register card for room before checkin

  3. Card validity must fall within selected room’s checkin/checkout dates

Example request:

mutation registerKey {
  registerLockSystemKey(key: {
    duplicate: false
    room_id: 111
    current_room_id: 6874
    valid_from: "2023-03-12T12:00:00"
    valid_to: "2023-03-14T10:00:00"
    serial_number: "2255987445896"
  }) {
    ok,
    key {
      group_id
    }}
}

serial_number: field has no predefined format

group_id: In HORES, each set of valid keys for given room has same group_id value. Only set of keys with highest group_id value for given room is considered valid. When registering only single key for room, group_id can be left empty and will be automatically generated.

When registering multiple valid keys for given room (multiple copies of same key or multiple simultaneously valid keys for multiple guests on same room), all keys must have same group_id. You can either register first key, read it’s group_id returned in response and use this same group_id for other keys, or you can get new group_id number from sequence using newLockSystemKeyGroup() and use it for all keys withing same room.