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.

OxygenDispatch uses a relational MySQL/MariaDB schema managed entirely through Laravel migrations. The schema is structured around a central tank_units table (one row per physical cylinder), radiating outward to procurement records (batches, technical_receptions), logistics records (inventory_movements, dispatches, dispatch_lines), and a set of lookup/catalog tables (gas_types, cylinder_capacities, warehouse_areas, technical_statuses, catalog_products). The sections below document every table in the final migrated state — that is, including all ALTER TABLE changes applied by subsequent migration files.

Tables

Stores authenticated system users. The role and is_active columns were added in a subsequent migration (2026_02_06_224521).
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
namevarchar(255)NOT NULL
emailvarchar(255)NOT NULL, UNIQUE
email_verified_attimestampnullable
passwordvarchar(255)NOT NULLBcrypt hash
rolevarchar(30)NOT NULL, default 'ENCARGADO'Maps to AppRole enum values
is_activebooleanNOT NULL, default trueSoft-disable a user without deletion
remember_tokenvarchar(100)nullableLaravel remember-me token
created_attimestampnullable
updated_attimestampnullable
Lookup table for gas type classifications (e.g., medical oxygen, nitrogen).
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
namevarchar(120)NOT NULL, UNIQUE
created_attimestampnullable
updated_attimestampnullable
Lookup table for cylinder volumetric capacity definitions.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
namevarchar(120)NOT NULL, UNIQUE
m3decimal(10,2)nullableVolume in cubic metres
created_attimestampnullable
updated_attimestampnullable
Lookup table for named physical zones within the warehouse.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
namevarchar(120)NOT NULL, UNIQUEe.g., Cuarentena, Productos aprobados, Baja
created_attimestampnullable
updated_attimestampnullable
Lookup table for technical inspection status labels.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
namevarchar(120)NOT NULL, UNIQUEe.g., Aprobado, Rechazado, En revisión
created_attimestampnullable
updated_attimestampnullable
Stores the receiving clients for cylinder dispatches. The entity_type column was added in migration 2026_03_14_150130.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
namevarchar(200)NOT NULL
entity_typetinyint unsignednullableMaps to EntityType enum (1/2/3)
documentvarchar(50)nullableID or RUC document number
phonevarchar(50)nullable
emailvarchar(120)nullable
addressvarchar(255)nullable
created_attimestampnullable
updated_attimestampnullable
Records an incoming shipment of cylinders from a supplier. gas_type_id and capacity_id were made nullable by migrations 2026_02_08_203714 and 2026_02_08_200840 respectively.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
batch_numbervarchar(100)NOT NULL, UNIQUE
gas_type_idbigint unsignednullable, FK → gas_types.id
capacity_idbigint unsignednullable, FK → cylinder_capacities.id
received_atdatetimeNOT NULL
document_numbervarchar(100)nullableShared with technical_receptions.document_number
supplier_namevarchar(200)nullable
supplier_codevarchar(100)nullable
voucher_typevarchar(50)nullable
voucher_numbervarchar(100)nullable
voucher_datedatenullable
sanitary_registryvarchar(100)nullable
manufactured_atdatenullable
expires_atdatenullable
notestextnullable
created_by_user_emailvarchar(150)NOT NULL
created_attimestampnullable
updated_attimestampnullable
The central table — one row per physical cylinder. Uses a UUID primary key. product_id was added after batch_id in migration 2026_02_08_200742; serial_prefix and serial_number were added after product_id in migration 2026_02_08_204831; updated_at was added in migration 2026_02_08_214456.
ColumnTypeConstraintsNotes
iduuid (char 36)PKAuto-generated UUID
serialvarchar(120)NOT NULL, UNIQUEFull serial string
batch_idbigint unsignedNOT NULL, FK → batches.id CASCADE DELETE
product_idbigint unsignednullable, FK → catalog_products.idAdded by migration 2026_02_08_200742
serial_prefixvarchar(10)nullableAlphabetic prefix of the serial; added by migration 2026_02_08_204831
serial_numberbigint unsignednullableNumeric portion of the serial; added by migration 2026_02_08_204831
gas_type_idbigint unsignedNOT NULL, FK → gas_types.id
capacity_idbigint unsignedNOT NULL, FK → cylinder_capacities.id
warehouse_area_idbigint unsignedNOT NULL, FK → warehouse_areas.id
technical_status_idbigint unsignedNOT NULL, FK → technical_statuses.id
sanitary_registryvarchar(100)nullable
manufactured_atdatenullable
expires_atdatenullable
statustinyint unsignedNOT NULL, default 1Maps to TankStatus enum (1 = DISPONIBLE)
created_atdatetimenullable
dispatched_atdatetimenullableSet when status changes to DESPACHADO
updated_attimestampnullableAdded by migration 2026_02_08_214456
Append-only audit log for all cylinder state changes. Has no updated_at — movements are immutable.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
typetinyint unsignedNOT NULLMaps to MovementType enum (1–4)
occurred_atdatetimeNOT NULLWhen the movement occurred
tank_unit_iduuid (char 36)NOT NULL, FK → tank_units.id CASCADE DELETE
from_area_idbigint unsignednullable, FK → warehouse_areas.idSource area (null for ENTRADA)
to_area_idbigint unsignednullable, FK → warehouse_areas.idDestination area (null for SALIDA)
batch_idbigint unsignednullable, FK → batches.id SET NULL ON DELETE
reference_documentvarchar(150)nullable
performed_by_user_emailvarchar(150)NOT NULL
notesvarchar(500)nullable
Records a completed outbound delivery event. client_id is set to null if the client is deleted (preserving historical dispatch data).
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
client_idbigint unsignednullable, FK → clients.id SET NULL ON DELETE
dispatched_atdatetimeNOT NULL
document_numbervarchar(100)nullable
entity_typetinyint unsignednullableMaps to EntityType enum (1/2/3)
remission_platevarchar(50)nullableVehicle plate for the remission
performed_by_user_emailvarchar(150)NOT NULL
voucher_typevarchar(50)nullable
voucher_numbervarchar(100)nullable
remission_numbervarchar(100)nullable
notestextnullable
created_attimestampnullable
updated_attimestampnullable
Join table linking dispatches to individual tank units. Has no timestamps. A composite unique constraint prevents the same cylinder from appearing twice in one dispatch.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
dispatch_idbigint unsignedNOT NULL, FK → dispatches.id CASCADE DELETE
tank_unit_iduuid (char 36)NOT NULL, FK → tank_units.id RESTRICT DELETE
Unique constraint: (dispatch_id, tank_unit_id)
Formal quality-control document for a received batch. signed_pdf_path, signed_pdf_uploaded_at, and signed_pdf_uploaded_by were added by migration 2026_06_07_015834.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
document_numbervarchar(100)NOT NULL, UNIQUEShared with batches.document_number
reception_datedatetimenullable
invoice_numbervarchar(100)nullable
remission_guide_numbervarchar(100)nullable
supplier_namevarchar(200)nullable
manufacturer_namevarchar(200)nullable
delivered_byvarchar(200)nullableName of delivery person
received_byvarchar(200)nullableName of receiving person
storage_conditionstextnullable
quantity_receivedint unsignedNOT NULL, default 0
documentation_compliesbooleannullable
final_resultvarchar(20)NOT NULL, default 'pendiente''pendiente', 'aprobado', or 'rechazado'
responsible_namevarchar(200)nullable
responsible_positionvarchar(200)nullable
responsible_observationtextnullable
signed_pdf_pathvarchar(255)nullableStorage path to the signed PDF file
signed_pdf_uploaded_attimestampnullable
signed_pdf_uploaded_byvarchar(255)nullableEmail of uploader
created_by_user_emailvarchar(150)nullable
created_attimestampnullable
updated_attimestampnullable
Indexes: (document_number, final_result)
Checklist rows belonging to a TechnicalReception. Rows cascade-delete when the parent reception is removed.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
technical_reception_idbigint unsignedNOT NULL, FK → technical_receptions.id CASCADE DELETE
sectionvarchar(120)NOT NULLChecklist section name
labeltextNOT NULLHuman-readable checklist item description
compliesbooleannullablenull = not yet evaluated
observationtextnullable
sort_ordersmallint unsignedNOT NULL, default 0Display order within section
created_attimestampnullable
updated_attimestampnullable
Indexes: (technical_reception_id, section)
Records the per-cylinder outcome of a technical inspection within a reception event.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
tank_unit_iduuid (char 36)NOT NULL, FK → tank_units.id CASCADE DELETE
technical_reception_idbigint unsignednullable, FK → technical_receptions.id SET NULL ON DELETE
resultvarchar(20)NOT NULL'approved' or 'rejected'
anomaly_typevarchar(120)nullablePopulated only when result = 'rejected'
observationtextnullable
reviewed_by_user_emailvarchar(150)NOT NULL
reviewed_atdatetimeNOT NULL
created_attimestampnullable
updated_attimestampnullable
Indexes:
  • (tank_unit_id, result, reviewed_at)
  • (technical_reception_id, result)
Officially registered product definitions combining gas type, capacity, and sanitary registry.
ColumnTypeConstraintsNotes
idbigint unsignedPK, auto-increment
codevarchar(50)NOT NULL, UNIQUEe.g., OMG-1, 00AC
detailvarchar(255)NOT NULLe.g., OXÍGENO MEDICINAL GAS 1 m³
gas_type_idbigint unsignedNOT NULL, FK → gas_types.id
capacity_idbigint unsignednullable, FK → cylinder_capacities.id
sanitary_registryvarchar(80)nullable
created_attimestampnullable
updated_attimestampnullable

Relationship Map

The following describes every significant foreign-key and logical relationship in the schema. Database-enforced foreign keys are marked FK; logical relationships (matched by value, not a database constraint) are marked logical. Catalog / Lookup references
  • batches.gas_type_idgas_types.id (FK, nullable)
  • batches.capacity_idcylinder_capacities.id (FK, nullable)
  • tank_units.gas_type_idgas_types.id (FK)
  • tank_units.capacity_idcylinder_capacities.id (FK)
  • tank_units.warehouse_area_idwarehouse_areas.id (FK)
  • tank_units.technical_status_idtechnical_statuses.id (FK)
  • catalog_products.gas_type_idgas_types.id (FK)
  • catalog_products.capacity_idcylinder_capacities.id (FK, nullable)
Batch → TankUnit
  • tank_units.batch_idbatches.id (FK, CASCADE DELETE) — each cylinder belongs to exactly one batch
Batch ↔ TechnicalReception
  • batches.document_numbertechnical_receptions.document_number (logical) — the reception document is matched to its batch by the shared document number, not a database foreign key
TankUnit → CatalogProduct
  • tank_units.product_idcatalog_products.id (FK, nullable) — optionally links a unit to a registered catalog product
TankUnit → InventoryMovement
  • inventory_movements.tank_unit_idtank_units.id (FK, CASCADE DELETE) — all movements for a unit are deleted when the unit is deleted
InventoryMovement → WarehouseArea (×2)
  • inventory_movements.from_area_idwarehouse_areas.id (FK, nullable)
  • inventory_movements.to_area_idwarehouse_areas.id (FK, nullable)
InventoryMovement → Batch
  • inventory_movements.batch_idbatches.id (FK, SET NULL ON DELETE)
Dispatch → Client
  • dispatches.client_idclients.id (FK, SET NULL ON DELETE) — preserves historical dispatch records when a client is removed
Dispatch → DispatchLine → TankUnit
  • dispatch_lines.dispatch_iddispatches.id (FK, CASCADE DELETE)
  • dispatch_lines.tank_unit_idtank_units.id (FK, RESTRICT DELETE) — a cylinder cannot be deleted while it is referenced in a dispatch line
TechnicalReception → TechnicalReceptionItem
  • technical_reception_items.technical_reception_idtechnical_receptions.id (FK, CASCADE DELETE)
TankTechnicalReview → TankUnit
  • tank_technical_reviews.tank_unit_idtank_units.id (FK, CASCADE DELETE)
TankTechnicalReview → TechnicalReception
  • tank_technical_reviews.technical_reception_idtechnical_receptions.id (FK, SET NULL ON DELETE)

Build docs developers (and LLMs) love