Documentation for serviceOrder_lu.ts
This file defines several lookup tables and their relationships using drizzle-orm for managing service orders and their related entities in a PostgreSQL database.
Tables
serviceOrderCategoryLU
The serviceOrderCategoryLU table stores the categories of service orders.
| Column | Data Type | Description |
|---|---|---|
| id | serial | Unique identifier for the category. Primary key. |
| name | varchar | Name of the category. |
| description | varchar | Description of the category. |
| createdAt | timestamp | Timestamp when the category was created. Default is the current time. |
| updatedAt | timestamp | Timestamp when the category was last updated. Updates automatically. |
| isActive | boolean | Indicates if the category is active. Default is true. |
| createdById | text | Identifier of the user who created the category. References user.id. |
| updatedById | text | Identifier of the user who last updated the category. References user.id. |
fareTypeLU
The fareTypeLU table stores the types of fares.
| Column | Data Type | Description |
|---|---|---|
| id | serial | Unique identifier for the fare type. Primary key. |
| name | varchar | Name of the fare type. |
| description | varchar | Description of the fare type. |
| createdAt | timestamp | Timestamp when the fare type was created. Default is the current time. |
| updatedAt | timestamp | Timestamp when the fare type was last updated. Updates automatically. |
| isActive | boolean | Indicates if the fare type is active. Default is true. |
| createdById | text | Identifier of the user who created the fare type. References user.id. |
| updatedById | text | Identifier of the user who last updated the fare type. References user.id. |
fare
The fare table stores information about fares.
| Column | Data Type | Description |
|---|---|---|
| id | varchar | Unique identifier for the fare. Primary key. |
| name | varchar | Name of the fare. |
| slug | text | Slug for the fare. |
| typeId | integer | Identifier of the fare type. References fareTypeLU.id. |
| costPerKm | double | Cost per kilometer. |
| initialCost | double | Initial cost. |
| organizationId | varchar | Identifier of the organization. References organization.id. |
| assistId | integer | Identifier of the assist. References assist.id. |
| createdAt | timestamp | Timestamp when the fare was created. Default is the current time. |
| updatedAt | timestamp | Timestamp when the fare was last updated. Updates automatically. |
| isActive | boolean | Indicates if the fare is active. Default is true. |
| createdById | text | Identifier of the user who created the fare. References user.id. |
| updatedById | text | Identifier of the user who last updated the fare. References user.id. |
serviceOrderLogActionLU
The serviceOrderLogActionLU table stores the actions that can be logged for service orders.
| Column | Data Type | Description |
|---|---|---|
| id | serial | Unique identifier for the log action. Primary key. |
| name | varchar | Name of the log action. |
| displayName | varchar | Display name of the log action. |
| createdAt | timestamp | Timestamp when the log action was created. Default is the current time. |
| updatedAt | timestamp | Timestamp when the log action was last updated. Updates automatically. |
| isActive | boolean | Indicates if the log action is active. Default is true. |
| createdById | text | Identifier of the user who created the log action. References user.id. |
| updatedById | text | Identifier of the user who last updated the log action. References user.id. |
damageTypeLU
The damageTypeLU table stores the types of damages.
| Column | Data Type | Description |
|---|---|---|
| id | serial | Unique identifier for the damage type. Primary key. |
| name | varchar | Name of the damage type. |
| createdAt | timestamp | Timestamp when the damage type was created. Default is the current time. |
| updatedAt | timestamp | Timestamp when the damage type was last updated. Updates automatically. |
| isActive | boolean | Indicates if the damage type is active. Default is true. |
| createdById | text | Identifier of the user who created the damage type. References user.id. |
| updatedById | text | Identifier of the user who last updated the damage type. References user.id. |
serviceOrderTypeLU
The serviceOrderTypeLU table stores the types of service orders.
| Column | Data Type | Description |
|---|---|---|
| id | serial | Unique identifier for the service order type. Primary key. |
| name | varchar | Name of the service order type. |
| description | varchar | Description of the service order type. |
| createdAt | timestamp | Timestamp when the service order type was created. Default is the current time. |
| updatedAt | timestamp | Timestamp when the service order type was last updated. Updates automatically. |
| isActive | boolean | Indicates if the service order type is active. Default is true. |
| createdById | text | Identifier of the user who created the service order type. References user.id. |
| updatedById | text | Identifier of the user who last updated the service order type. References user.id. |
Last updated on