# CMS Treatment Types API

## List All Treatment Types

`GET /api/cms-treatment-types`

Get all treatment types.

### Headers

| Header | Value |
|--------|-------|
| Content-Type | application/json |

### Response

```json
{
  "success": true,
  "message": "Read Treatment Types Successfully.",
  "data": [
    {
      "_id": "...",
      "name": "Whitening",
      "image": "https://cherryk.s3.ap-southeast-1.amazonaws.com/treatmentType/1712345678900-whitening.jpg",
      "description": "Professional teeth whitening treatment",
      "isDeleted": false
    }
  ]
}
```

### Errors

- `500` — Server error

---

## Create Treatment Type

`POST /api/cms-treatment-types`

Create a new treatment type with S3 image upload.

### Headers

| Header | Value |
|--------|-------|
| Content-Type | multipart/form-data |

### Body (multipart/form-data)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| treatmentType | file | No | Treatment type image (max 1). Allowed: png, jpg, jpeg, gif, webp, avif. Max 10MB |
| name | string | Yes | Treatment type name |
| description | string | No | Description text |

### Response

```json
{
  "success": true,
  "message": "Created Treatment Type Successfully.",
  "data": {
    "_id": "...",
    "name": "Whitening",
    "image": "https://cherryk.s3.ap-southeast-1.amazonaws.com/treatmentType/1712345678900-whitening.jpg",
    "description": "Professional teeth whitening treatment",
    "isDeleted": false
  }
}
```

### Errors

- `400` — Validation error
- `413` — File too large (exceeds 10MB)
- `500` — Server error

---

## Get Treatment Type By ID

`GET /api/cms-treatment-type/:id`

Get a specific treatment type by its ID.

### Headers

| Header | Value |
|--------|-------|
| Content-Type | application/json |

### Parameters

| Param | Type | Required | Description |
|-------|------|----------|-------------|
| id | string | Yes | Treatment type MongoDB ObjectID |

### Response

```json
{
  "success": true,
  "message": "Read Treatment Type By Id Successfully.",
  "data": {
    "_id": "...",
    "name": "Whitening",
    "image": "https://cherryk.s3.ap-southeast-1.amazonaws.com/treatmentType/1712345678900-whitening.jpg",
    "description": "Professional teeth whitening treatment",
    "isDeleted": false
  }
}
```

### Errors

- `500` — Server error

---

## Update Treatment Type

`PUT /api/cms-treatment-type/:id`

Update a treatment type with new image and/or information.

### Headers

| Header | Value |
|--------|-------|
| Content-Type | multipart/form-data |

### Parameters

| Param | Type | Required | Description |
|-------|------|----------|-------------|
| id | string | Yes | Treatment type MongoDB ObjectID |

### Body (multipart/form-data)

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| treatmentType | file | No | New treatment type image (replaces existing). Allowed: png, jpg, jpeg, gif, webp, avif. Max 10MB |
| name | string | No | New name |
| description | string | No | New description |

### Response

```json
{
  "success": true,
  "message": "Updated Treatment Type By Id Successfully.",
  "data": {
    "_id": "...",
    "name": "Advanced Whitening",
    "image": "https://cherryk.s3.ap-southeast-1.amazonaws.com/treatmentType/1712345678901-new-whitening.jpg",
    "description": "Advanced professional teeth whitening treatment",
    "isDeleted": false
  }
}
```

### Errors

- `400` — Validation error
- `404` — Treatment type not found
- `413` — File too large (exceeds 10MB)
- `500` — Server error

---

## Delete Treatment Type

`DELETE /api/cms-treatment-type/:id`

Soft delete a treatment type (sets `isDeleted` to `true`).

### Headers

| Header | Value |
|--------|-------|
| Content-Type | application/json |

### Parameters

| Param | Type | Required | Description |
|-------|------|----------|-------------|
| id | string | Yes | Treatment type MongoDB ObjectID |

### Response

```json
{
  "success": true,
  "message": "Deleted Treatment Type By Id Successfully.",
  "data": {
    "_id": "...",
    "name": "Whitening",
    "image": "https://cherryk.s3.ap-southeast-1.amazonaws.com/treatmentType/1712345678900-whitening.jpg",
    "description": "Professional teeth whitening treatment",
    "isDeleted": true
  }
}
```

### Errors

- `400` — Invalid ID format
- `404` — Treatment type not found
- `500` — Server error
