# task ## Purpose The **task** table stores operational tasks assigned within the facility. It is used to manage internal workflows such as research assignments, maintenance operations, containment procedures and administrative duties. Each task has a lifecycle defined by its status, timestamps and associated personnel responsible for its creation. ## Columns | Field | Type | Description |-------------|-------------|-----------------------------------------------------------------------| | id_tas | MEDIUMINT | Unique task identifier (PK, AUTO_INCREMENT) | type | VARCHAR(100)| Category or type of task | status | ENUM | Current lifecycle status of the task | id_loc | SMALLINT | Optional location assignment for the task (FK, NULLABLE) | description | VARCHAR(255)| Optional detailed description of the task | created_at | DATETIME | Timestamp when the task was created | ended_at | DATETIME | Timestamp when the task was completed (NULLABLE) | created_by | MEDIUMINT | Personnel identifier of task creator (FK) |---------------------------------------------------------------------------------------------------| ### ENUM values - status = ('pending','active','done') ## Relationships - References **location.id_loc** through **id_loc** to optionally assign a task to a location within the facility. - References **personnel.id_per** through **created_by** to identify the personnel member who created the task. ## Rules - Tasks must follow a linear lifecycle from pending → active → done. ## Example output ### pending +--------+------------+---------+--------+-------------------------------------------------------+---------------------+----------+------------+ | id_tas | type | status | id_loc | description | created_at | ended_at | created_by | +--------+------------+---------+--------+-------------------------------------------------------+---------------------+----------+------------+ | 1 | inspection | pending | 8 | Inspect structural integrity and reinforcement points | 2026-06-27 13:47:44 | NULL | 1 | +--------+------------+---------+--------+-------------------------------------------------------+---------------------+----------+------------+ ### active +--------+------------+--------+--------+-------------------------------------------------------+---------------------+----------+------------+ | id_tas | type | status | id_loc | description | created_at | ended_at | created_by | +--------+------------+--------+--------+-------------------------------------------------------+---------------------+----------+------------+ | 1 | inspection | active | 8 | Inspect structural integrity and reinforcement points | 2026-06-27 13:47:44 | NULL | 1 | +--------+------------+--------+--------+-------------------------------------------------------+---------------------+----------+------------+ ### done +--------+------------+--------+--------+-------------------------------------------------------+---------------------+------------------------------------+ | id_tas | type | status | id_loc | description | created_at | ended_at | created_by | +--------+------------+--------+--------+-------------------------------------------------------+---------------------+-----------------------+------------| | 1 | inspection | done | 8 | Inspect structural integrity and reinforcement points | 2026-06-27 13:47:44 | 2026-06-27 16:59:01 | 1 | +--------+------------+--------+--------+-------------------------------------------------------+---------------------+-----------------------+------------|