# Asset Part Type API

API for managing asset part types

**Version:** 1.0.0

## Overview

### Base URLs

- **Production server**: `https://sv.api.repzo.me`

- **Staging server**: `https://staging.sv.api.repzo.me`

### API Categories

- **Asset Part Type**: Operations related to asset part type management

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/asset-part-type`

#### GET /asset-part-type

**Summary:** Get all asset part types

**Description:** Retrieve a list of all asset part types with optional filtering and pagination

**Tags:** Asset Part Type

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `limit` | query | integer | No | Maximum number of records to return |

| `offset` | query | integer | No | Number of records to skip for pagination |

| `sort` | query | string | No | Field to sort by |

| `order` | query | string | No | Sort order (asc or desc) |

| `filter` | query | string | No | Filter conditions in JSON format |

| `search` | query | string | No | Search term for text fields |

##### Responses

**200** - List of asset part types retrieved successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

#### POST /asset-part-type

**Summary:** Create a new asset part type

**Description:** Create a new asset part type with the provided data

**Tags:** Asset Part Type

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Asset part type created successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

### `/asset-part-type/{id}`

#### GET /asset-part-type/{id}

**Summary:** Get asset part type by ID

**Description:** Retrieve a specific asset part type by its ID

**Tags:** Asset Part Type

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset part type ID |

##### Responses

**200** - Asset part type retrieved successfully

Content-Type: `application/json`

**404** - Asset part type not found

**401** - Unauthorized

**500** - Internal server error

---

#### PUT /asset-part-type/{id}

**Summary:** Update asset part type

**Description:** Update an existing asset part type with new data

**Tags:** Asset Part Type

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset part type ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Asset part type updated successfully

Content-Type: `application/json`

**400** - Bad request

**404** - Asset part type not found

**401** - Unauthorized

**500** - Internal server error

---

#### DELETE /asset-part-type/{id}

**Summary:** Delete asset part type

**Description:** Delete an existing asset part type

**Tags:** Asset Part Type

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset part type ID |

##### Responses

**200** - Asset part type deleted successfully

Content-Type: `application/json`

**404** - Asset part type not found

**401** - Unauthorized

**500** - Internal server error

---

## Data Models

### AssetPartType

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `_id` | string | No | Unique identifier for the asset part type |

| `name` | string | Yes | Name of the asset part type |

| `description` | string | No | Description of the asset part type |

| `category` | string | Yes | Category of the asset part type |

| `subcategory` | string | No | Subcategory of the asset part type |

| `specifications` | object | No | Technical specifications |

| `compatibleAssetTypes` | array | No | List of compatible asset type IDs |

| `maintenanceSchedule` | object | No | No description |

| `warrantPeriod` | integer | No | Warranty period in days |

| `supplier` | string | No | Default supplier ID |

| `standardCost` | number | No | Standard cost of the part |

| `isActive` | boolean | No | Whether the part type is active |

| `metadata` | object | No | Additional metadata |

| `createdAt` | string | No | Record creation timestamp |

| `updatedAt` | string | No | Record last update timestamp |

### AssetPartTypeInput

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `name` | string | Yes | Name of the asset part type |

| `description` | string | No | Description of the asset part type |

| `category` | string | Yes | Category of the asset part type |

| `subcategory` | string | No | Subcategory of the asset part type |

| `specifications` | object | No | Technical specifications |

| `compatibleAssetTypes` | array | No | List of compatible asset type IDs |

| `maintenanceSchedule` | object | No | No description |

| `warrantPeriod` | integer | No | Warranty period in days |

| `supplier` | string | No | Default supplier ID |

| `standardCost` | number | No | Standard cost of the part |

| `isActive` | boolean | No | Whether the part type is active |

| `metadata` | object | No | Additional metadata |

## TypeScript Usage

See [asset-part-type-examples.md](./asset-part-type-examples.md) for detailed TypeScript usage examples.
