Module: LoyverseApi::Endpoints::Employees

Included in:
Client
Defined in:
lib/loyverse_api/endpoints/employees.rb

Instance Method Summary collapse

Instance Method Details

#get_employee(employee_id) ⇒ Hash

Get a specific employee by ID

Parameters:

  • employee_id (String) —

    UUID of the employee

Returns:

  • (Hash) —

    Employee details



9
10
11
# File 'lib/loyverse_api/endpoints/employees.rb', line 9

def get_employee(employee_id)
  get("employees/#{employee_id}")
end

#list_employees(limit: 250, cursor: nil, updated_at_min: nil, updated_at_max: nil) ⇒ Hash

List employees

Parameters:

  • limit (Integer) (defaults to: 250) —

    Maximum number of results per page (default: 250)

  • cursor (String) (defaults to: nil) —

    Pagination cursor for next page

  • updated_at_min (String, Time) (defaults to: nil) —

    Filter by minimum update time (ISO 8601)

  • updated_at_max (String, Time) (defaults to: nil) —

    Filter by maximum update time (ISO 8601)

Returns:

  • (Hash) —

    Response with employees array



19
20
21
22
23
24
25
26
27
28
# File 'lib/loyverse_api/endpoints/employees.rb', line 19

def list_employees(limit: 250, cursor: nil, updated_at_min: nil, updated_at_max: nil)
  params = {
    limit: limit,
    cursor: cursor,
    updated_at_min: format_time(updated_at_min),
    updated_at_max: format_time(updated_at_max)
  }.compact

  get("employees", params: params)
end