Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Janblack07/OxygenDispatch/llms.txt

Use this file to discover all available pages before exploring further.

Tank units are the atomic record in OxygenDispatch — one row per physical cylinder in your facility. Every tank carries a unique serial number, knows which batch it came from, which product it represents, where it is located, its technical approval state, and its operational status. All actions performed on a tank (intake, transfer, status change, dispatch, decommission) are recorded as inventory movements, giving you a complete, tamper-evident audit trail.
Tank unit IDs are UUIDs, not auto-incrementing integers. Always use the UUID when referencing a tank in URLs or API calls (e.g. GET /tanks/018f4c2a-3b1e-7000-9c3d-d2e1f4a5b6c7).

Tank unit fields

The following fields are stored on every tank unit record:
FieldTypeDescription
idUUIDPrimary key. Globally unique identifier for this cylinder.
serialstringFull serial string, e.g. OXI-000042. Unique across the entire system.
serial_prefixstringThe alphabetic/numeric prefix portion, e.g. OXI.
serial_numberbigIntegerThe numeric counter portion used for ordering within a prefix. Stored as unsignedBigInteger in the database.
batch_idintegerForeign key to the batches table.
product_idintegerForeign key to catalog_products.
gas_type_idintegerInherited from the product at generation time.
capacity_idintegerInherited from the product at generation time.
warehouse_area_idintegerThe area where the cylinder is currently located.
technical_status_idintegerThe current technical approval status from the catalog.
sanitary_registrystring|nullSanitary registry code, when available.
manufactured_atdate|nullManufacture date.
expires_atdate|nullExpiry date of the cylinder.
statusTankStatus enumOperational status: DISPONIBLE (1), DESPACHADO (2), or BAJA (3).
dispatched_atdatetime|nullTimestamp of when the tank was dispatched, if applicable.

Viewing tanks

GET /tanks returns a paginated list of all tank units (20 per page), ordered by creation date descending, with related batch, product, gas type, capacity, warehouse area, and technical status eager-loaded. Apply any combination of the following query string filters:
ParameterTypeBehaviour
batch_numberstringPartial match on the linked batch’s batch_number field
statusintegerExact match on TankStatus value: 1 = DISPONIBLE, 2 = DESPACHADO, 3 = BAJA
gas_type_idintegerExact match on gas type
capacity_idintegerExact match on cylinder capacity
warehouse_area_idintegerExact match on current warehouse area
technical_status_idintegerExact match on current technical status
serialstringPartial match on the full serial string (case-insensitive LIKE)
Example — find all available tanks in the approved products area for a specific gas type:
GET /tanks?status=1&gas_type_id=2&warehouse_area_id=5

Tank detail

GET /tanks/{tank} loads the full detail view for a single tank unit. The page displays:
  • Linked batch, gas type, capacity, warehouse area, and technical status
  • The last 50 inventory movements for this tank, with from/to area details for each movement
  • Quick-action forms for transferring the tank, changing its technical status, and decommissioning it

Transferring a tank

Submit POST /tanks/{tank}/transfer to move a tank from its current warehouse area to another. A TRASLADO inventory movement is recorded automatically, capturing both the origin and destination areas.
to_area_id
integer
required
The destination warehouse area (warehouse_areas.id). Must exist in the catalog.
notes
string
Optional free-text notes about the reason for the transfer. Maximum 500 characters.
The movement records the tank’s previous warehouse_area_id as from_area_id and the new area as to_area_id. The tank’s warehouse_area_id is updated atomically inside a database transaction.

Changing technical status

Submit POST /tanks/{tank}/technical-status to update the technical approval state of a tank. A CAMBIO_ESTADO_TECNICO inventory movement is recorded automatically.
technical_status_id
integer
required
The new technical status (technical_statuses.id). Must exist in the catalog.
notes
string
Optional notes describing the reason for or outcome of the status change. Maximum 500 characters.
This action updates technical_status_id on the tank record and records the event in the movement log. It does not automatically move the tank to a different warehouse area — use the transfer endpoint for that separately if required.

Decommissioning a tank

Submit POST /tanks/{tank}/decommission to permanently mark a cylinder as out of service. This sets the tank’s status to BAJA (value 3) and records a CAMBIO_ESTADO_TECNICO inventory movement. The movement’s notes field is always prefixed with [BAJA].
notes
string
Optional explanation for the decommission (damage, expiry, regulatory recall, etc.). Maximum 500 characters. If provided, stored as [BAJA] <your notes>; if omitted, stored as [BAJA].
A decommissioned tank remains in the database with a full movement history. Its status=BAJA makes it ineligible for dispatch or transfer in normal workflows.

Dispatch eligibility

A tank can only be selected for dispatch when all three of the following conditions are simultaneously true:
ConditionRequired value
statusDISPONIBLE (1)
technicalStatus.nameAprobado
warehouseArea.nameProductos aprobados
This rule is enforced in two places in the codebase:
  • isAvailableForDispatch() — an instance method on TankUnit that performs the check against the loaded relations and returns a boolean.
  • scopeDispatchable() — an Eloquent query scope on TankUnit that applies all three conditions as WHERE clauses, used when building dispatch order lists.
// Check a single tank
if ($tank->isAvailableForDispatch()) {
    // safe to dispatch
}

// Query all dispatchable tanks
$eligible = TankUnit::dispatchable()->get();
A tank that has the right technical status but has not yet been moved to the “Productos aprobados” area will not appear in dispatch lists. The typical flow is: receive → review → approve (technical status change) → transfer to “Productos aprobados” → available for dispatch.

Build docs developers (and LLMs) love