VoileLockerLuggage.Lockers (VoileLockerLuggage v0.2.2)

Copy Markdown View Source

Context module for locker management operations.

Summary

Functions

Assign a locker to a visitor. Automatically picks the first available locker if no locker_id given.

Count lockers by status for a node.

Count lockers by status for a location.

Create a new locker.

Delete a locker. Only allowed if no active sessions.

Get the active session for a specific locker.

Get the active session for a visitor (if any) in a node.

Get location config for a specific location, returns nil if not found.

Get a single locker by id.

Get a locker by node_id and locker_number.

Get node config for a specific node, returns nil if not found.

Get a session by id with locker preloaded.

List all active sessions for a node.

List active sessions for a node with pagination.

List all active sessions for a location (non-paginated).

List active sessions for a location with pagination.

Get available lockers for a node.

Get available lockers for a location.

List all location configs for a node.

List all lockers for a node.

List lockers for a node filtered by status.

List all lockers for a location.

List all node configs.

List session history for a node with optional date filter.

List session history for a node with optional date filter and pagination.

List session history for a location with optional date filter and pagination.

Check if a location has locker system enabled.

Check if a node has locker system enabled.

Release a locker session.

Release a visitor's active locker session in a node.

Bulk-create lockers for a specific location. Locker numbers are padded integers: "001", "002", ... Only creates lockers that don't already exist for that location.

Bulk-create lockers for a node based on total count. Locker numbers are generated as padded integers: "001", "002", ... Only creates lockers that don't already exist.

Update a locker.

Create or update location config.

Create or update node config.

Functions

assign_locker(node_id, visitor_identifier, visitor_name \\ nil, opts \\ [])

Assign a locker to a visitor. Automatically picks the first available locker if no locker_id given.

count_lockers_by_status(node_id)

Count lockers by status for a node.

count_lockers_by_status_for_location(location_id)

Count lockers by status for a location.

create_locker(attrs)

Create a new locker.

delete_locker(locker)

Delete a locker. Only allowed if no active sessions.

get_active_session_for_locker(locker_id)

Get the active session for a specific locker.

get_active_session_for_visitor(node_id, visitor_identifier)

Get the active session for a visitor (if any) in a node.

get_location_config(location_id)

Get location config for a specific location, returns nil if not found.

get_locker!(id)

Get a single locker by id.

get_locker_by_number(node_id, locker_number)

Get a locker by node_id and locker_number.

get_node_config(node_id)

Get node config for a specific node, returns nil if not found.

get_session!(id)

Get a session by id with locker preloaded.

list_active_sessions(node_id)

List all active sessions for a node.

list_active_sessions(node_id, page, per_page)

List active sessions for a node with pagination.

list_active_sessions_for_location(location_id)

List all active sessions for a location (non-paginated).

list_active_sessions_for_location(location_id, page, per_page)

List active sessions for a location with pagination.

list_available_lockers(node_id)

Get available lockers for a node.

list_available_lockers_for_location(location_id)

Get available lockers for a location.

list_location_configs(node_id)

List all location configs for a node.

list_lockers(node_id)

List all lockers for a node.

list_lockers(node_id, status)

List lockers for a node filtered by status.

list_lockers_for_location(location_id)

List all lockers for a location.

list_node_configs()

List all node configs.

list_sessions(node_id, opts \\ [])

List session history for a node with optional date filter.

list_sessions(node_id, date, page, per_page)

List session history for a node with optional date filter and pagination.

list_sessions_for_location(location_id, date, page, per_page)

List session history for a location with optional date filter and pagination.

location_enabled?(location_id)

Check if a location has locker system enabled.

node_enabled?(node_id)

Check if a node has locker system enabled.

release_locker(session_id, opts \\ [])

Release a locker session.

release_locker_for_visitor(node_id, visitor_identifier, opts \\ [])

Release a visitor's active locker session in a node.

sync_lockers_for_location(location_id, node_id, total_count)

Bulk-create lockers for a specific location. Locker numbers are padded integers: "001", "002", ... Only creates lockers that don't already exist for that location.

sync_lockers_for_node(node_id, total_count)

Bulk-create lockers for a node based on total count. Locker numbers are generated as padded integers: "001", "002", ... Only creates lockers that don't already exist.

update_locker(locker, attrs)

Update a locker.

upsert_location_config(location_id, node_id, attrs)

Create or update location config.

upsert_node_config(node_id, attrs)

Create or update node config.