Vehicle Management
This page is auto-generated from cmd/web/routes.go.
Endpoint List
| Method | Path | Handler | Request |
|---|---|---|---|
| Post | /api/modules/create-bulk-vehicle | handlers.Repo.CreateMultiVehicle | VehicleRequest.MultiVehicleCreateRequest |
| Post | /api/modules/create-vehicle | handlers.Repo.CreateVehicle | VehicleRequest.VehicleCreateRequest |
| Post | /api/modules/create-vehicle-assignment | handlers.Repo.CreateVehicleAssignment | VehicleRequest.VehicleAssignmentCreateRequest |
| Post | /api/modules/delete-vehicle | handlers.Repo.DeleteVehicle | VehicleRequest.VehicleDeleteRequest |
| Post | /api/modules/delete-vehicle-assignment | handlers.Repo.DeleteVehicleAssignment | requests.DeleteBulkRequest |
| Post | /api/modules/list-vehicle | handlers.Repo.ListVehicle | requests.ListRequest |
| Post | /api/modules/list-vehicle-assignment | handlers.Repo.ListVehicleAssignment | requests.ListRequest |
| Post | /api/modules/list-vehicle-document-analyze | handlers.Repo.ListVehicleDocumentAnalyze | requests.ListRequest |
| Post | /api/modules/read-vehicle | handlers.Repo.ReadVehicle | requests.ReadRequest |
| Post | /api/modules/read-vehicle-assignment | handlers.Repo.ReadVehicleAssignment | requests.ReadRequest |
| Post | /api/modules/report-vehicle | handlers.Repo.ReportVehicle | - |
| Post | /api/modules/update-vehicle | handlers.Repo.UpdateVehicle | VehicleRequest.VehicleUpdateRequest |
| Post | /api/modules/update-vehicle-assignment | handlers.Repo.UpdateVehicleAssignment | VehicleRequest.VehicleAssignmentUpdateRequest |
Request Example: VehicleRequest.MultiVehicleCreateRequest
{
"vehicles": {}
}Fields:
| Field | Type | Required |
|---|---|---|
vehicles | []VehicleCreateRequest | yes |
Request Example: VehicleRequest.VehicleCreateRequest
{
"picture_file_id": 0,
"customer_id": 0,
"vehicle_type_id": 0,
"vehicle": "string",
"fuel_type_id": 0,
"status_id": 0,
"max_load_weight": 0,
"net_weight": 0,
"model_id": 0,
"device_id": "string",
"license_serial_no": "string",
"chassis_no": "string",
"registration_date": 0,
"model": "string",
"authentication_no": "string"
}Fields:
| Field | Type | Required |
|---|---|---|
picture_file_id | *int | no |
customer_id | int | yes |
vehicle_type_id | int | yes |
vehicle | string | yes |
fuel_type_id | *int | no |
status_id | *int | yes |
max_load_weight | *int | no |
net_weight | *int | no |
model_id | *int | no |
device_id | *string | no |
license_serial_no | *string | no |
chassis_no | *string | no |
registration_date | *int | no |
model | *string | no |
authentication_no | *string | no |
Request Example: VehicleRequest.VehicleAssignmentCreateRequest
{
"vehicle1_id": 0,
"vehicle": "string",
"vehicle2_id": 0,
"vehicle2": "string",
"personal_id": 0,
"identification_number": "string"
}Fields:
| Field | Type | Required |
|---|---|---|
vehicle1_id | *int64 | no |
vehicle | *string | no |
vehicle2_id | *int64 | no |
vehicle2 | *string | no |
personal_id | *int64 | no |
identification_number | *string | no |
Request Example: VehicleRequest.VehicleDeleteRequest
{
"id": 0
}Fields:
| Field | Type | Required |
|---|---|---|
id | int | yes |
Request Example: requests.DeleteBulkRequest
{
"ids": [
0
]
}Fields:
| Field | Type | Required |
|---|---|---|
ids | []int | yes |
Request Example: requests.ListRequest
{
"per_page": 0,
"page": 0,
"sort_column": "string",
"sort_order": "string"
}Fields:
| Field | Type | Required |
|---|---|---|
per_page | int | yes |
page | int | yes |
sort_column | string | no |
sort_order | string | no |
Request Example: requests.ReadRequest
{
"id": 0
}Fields:
| Field | Type | Required |
|---|---|---|
id | int | yes |
Request Example: VehicleRequest.VehicleUpdateRequest
{
"id": 0,
"picture_file_id": 0,
"customer_id": 0,
"vehicle_type_id": 0,
"vehicle": "string",
"status_id": 0,
"max_load_weight": 0,
"net_weight": 0,
"model_id": 0,
"fuel_type_id": 0,
"device_id": "string",
"license_serial_no": "string",
"chassis_no": "string",
"registration_date": 0,
"is_deleted": 0,
"model": "string",
"authentication_no": "string"
}Fields:
| Field | Type | Required |
|---|---|---|
id | int | yes |
picture_file_id | int64 | no |
customer_id | int | yes |
vehicle_type_id | int | yes |
vehicle | string | yes |
status_id | int | yes |
max_load_weight | *int | no |
net_weight | *int | no |
model_id | *int | no |
fuel_type_id | *int | no |
device_id | *string | no |
license_serial_no | *string | no |
chassis_no | *string | no |
registration_date | *int | no |
is_deleted | *int | no |
model | *string | no |
authentication_no | *string | no |
Request Example: VehicleRequest.VehicleAssignmentUpdateRequest
{
"id": 0,
"vehicle1_id": 0,
"vehicle": "string",
"vehicle2_id": 0,
"vehicle2": "string",
"personal_id": 0,
"identification_number": "string",
"started_at": 0,
"finished_at": 0
}Fields:
| Field | Type | Required |
|---|---|---|
id | int64 | no |
vehicle1_id | int64 | no |
vehicle | string | no |
vehicle2_id | int64 | no |
vehicle2 | string | no |
personal_id | int64 | no |
identification_number | string | no |
started_at | int64 | no |
finished_at | int64 | no |
Response Examples
Create:
{
"status": "succeeded",
"message": "record created successfully",
"id": 1
}Delete:
{
"status": "succeeded",
"message": "deleted successfully"
}List:
{
"status": "succeeded",
"data": [ ],
"totalPage": 1,
"currentPage": 1,
"perPage": 10
}Read:
{
"status": "succeeded",
"data": { }
}Update:
{
"status": "succeeded",
"message": "updated successfully"
}Error (example):
{
"status": "invalid_request",
"message": "validation failed",
"errors": [ ]
}Last updated on