# Job Type Management

| | |
|---|---|
| **Nav ID** | `job-type-management` |
| **Component** | `AdminJobTypeManagementPage.jsx` |
| **Service** | `jobTypesApi.js` → `ptw_job_type` CRUD |

---

## Endpoints

Base path: `/api/ptw/ptw_job_type` — see prior endpoint docs.

---

## SQL queries

All queries use the **generic CRUD router** on table `ptw_job_type`.

### List job types

```sql
SELECT * FROM `ptw_job_type`;
```

### Get one

```sql
SELECT * FROM `ptw_job_type` WHERE `job_type_id` = ? LIMIT 1;
```

### Create

```sql
INSERT INTO `ptw_job_type` (`job_type_name`, `job_colour_code`)
VALUES (?, ?);
```

Example:

```sql
INSERT INTO `ptw_job_type` (`job_type_name`, `job_colour_code`)
VALUES ('Hot Work', '#ff6600');
```

### Update

```sql
UPDATE `ptw_job_type`
SET `job_type_name` = ?, `job_colour_code` = ?
WHERE `job_type_id` = ?;
```

### Delete (API only; not used in UI)

```sql
DELETE FROM `ptw_job_type` WHERE `job_type_id` = ?;
```

**Backend:** `masterRoutes.js` → `createCrudRouter("ptw_job_type", ["job_type_id"])`
