# frozen_string_literal: true module Alula # HelixUser records are present for anything older than XiP # There might be records for XiP as well, but DeviceUser should be used instead class HelixUser < Alula::RestResource extend Alula::ResourceAttributes extend Alula::RelationshipAttributes extend Alula::ApiOperations::Request extend Alula::ApiOperations::List extend Alula::ApiOperations::Save resource_path 'helix/users' type 'helix-users' relationship :device, type: 'devices', cardinality: 'To-one' relationship :user, type: 'users', cardinality: 'To-one' relationship :revisions, type: 'revisions', cardinality: 'To-many' field :id, type: :string, sortable: false, filterable: false field :device_id, type: :string, sortable: false, filterable: true field :user_id, type: :string, sortable: false, filterable: true field :number, type: :number, sortable: true, filterable: false field :pin, type: :string, patchable_by: %i[system station dealer technician user] field :auth_master, type: :boolean, patchable_by: %i[system station dealer technician user] field :auth_installer, type: :boolean, patchable_by: %i[system station dealer technician user] field :auth_dealer, type: :boolean, patchable_by: %i[system station dealer technician user] field :auth_system_test, type: :boolean, patchable_by: %i[system station dealer technician user] field :auth_edit_user_credentials, type: :boolean, patchable_by: %i[system station dealer technician user] field :auth_bypass_zones, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_disarm, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_stay, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_night, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_away, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_all_off, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level1, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level2, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level3, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level4, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level5, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level6, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level7, type: :boolean, patchable_by: %i[system station dealer technician user] field :allow_level8, type: :boolean, patchable_by: %i[system station dealer technician user] field :sync_needed, type: :boolean field :is_new, type: :boolean end end