# Truck serveice api docs v1 ## API documentation for truck service v1 <span style="color:red">`base_url`</span>: `https://api-dev.loopfreight.io/lf-booking/api/v1` # Module: Licence alphabet, license city, truck brand, truck category, truck type, truck ## 1. Module: Licence alphabet ### 1.1 License alphabet create by admin * **Description:** Only "admin" can create license alphabets for truck number plate. * **Permission role**: admin * **Method**:`POST` * **Api path**:`/license-alpha/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `label`: `string`| `Gw` |`true`| | `labelBn`: `string` | `āĻ—` |`true`| | `value`: `string` | `Gw` |`true`| * **Request Body**: ```json= { "label": "Gw", "labelBn": "āĻ—", "value": "Gw" } ``` * **Response**: ```status_code: 201``` ```json= { "status": 201, "success": true, "message": "License alpha created successfully.", "data": { "id": 26, "label": "Gw", "labelBn": "āĻ—", "value": "Gw", "status": "active", "createdAt": "2022-01-16T04:53:03.584Z" } } ``` ### 1.2 Get license alphabet list by admin * **Description:** "admin", "kam" and "vendor" can get all license alphabets for truck number plate. * **Permission role**: admin, kam and vendor * **Method**:`GET` * **Api path**:`/license-alpha/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License alpha list get successfully.", "count": 2, "data": [ { "id": 26, "label": "Gw", "labelBn": "āĻ—", "value": "Gw", "status": "active", "createdAt": "2022-01-16T04:53:03.584Z" }, { "id": 25, "label": "SHA", "labelBn": "āĻļ", "value": "SHA", "status": "active", "createdAt": "2021-12-29T07:22:15.710Z" } ] } ``` ### 1.3 Delete license alphabet by admin * **Description:** Only "admin" can delete a specific license alphabet for truck number plate. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/license-alpha/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License alpha delete data successfully.", "data": { "id": 26, "label": "Gw", "labelBn": "āĻ—", "value": "Gw", "status": "inactive", "createdAt": "2022-01-16T04:53:03.584Z" } } ``` ### 1.4 Update specific license alphabet details by admin * **Description:** Only "admin" can update license alphabets for truck number plate. * **Permission role**: admin * **Method**:`PUT` * **Api path**:`/license-alpha/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `label`: `string`| `Gw` |`false`| | `labelBn`: `string` | `āĻ—` |`false`| | `Value`: `string` | `Gw` |`false`| * **Request Body**: ```json= { "label": "e", "labelBn": "āχ", "value": "E" } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License alpha update Data successfully.", "data": { "id": 17, "label": "e", "labelBn": "āχ", "value": "E", "status": "active", "createdAt": "2021-12-29T07:22:15.681Z" } } ``` ### 1.5 Get license alphabet list using specific id with secret-key * **Description:** Anybody gets specifics license alphabets using ids for truck number plate. * **Permission role**: secret key * **Method**:`GET` * **Api path**:`/license-alpha/` * **Headers**: `secret-key`:`Bearer {secret key}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `ids`: `number[]`| `17,16,..` |`true`| * **Request Body**: ```json= { "ids":[17,16] } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License alpha get successfully.", "data": [ { "id": 16, "label": "AW", "labelBn": "āĻ…", "value": "AW", "status": "active", "createdAt": "2021-12-29T07:22:15.669Z" }, { "id": 17, "label": "e", "labelBn": "āχ", "value": "E", "status": "active", "createdAt": "2021-12-29T07:22:15.681Z" } ] } ``` ## 2. Module: Licence city ### 2.1 Create License city create by admin * **Description:** Only "admin" can create license cities for truck number plate. * **Permission role**: admin * **Method**:`POST` * **Api path**:`/license-city/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `label`: `string`| `Rajshahi Metro` |`true`| | `labelBn`: `string` | `āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋` |`true`| | `Value`: `string` | `RM` |`true`| * **Request Body**: ```json= { "label": "Rajshahi Metro", "labelBn": "āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋ ", "value": "RM" } ``` * **Response**: ```status_code: 201``` ```json= { "status": 201, "success": true, "message": "License city created successfully.", "data": { "id": 71, "label": "Rajshahi Metro", "labelBn": "āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋ ", "value": "RM", "status": "active", "createdAt": "2022-01-16T05:47:35.383Z" } } ``` ### 2.2 Get license city list by admin and vendor * **Description:** Two roles "admin", "kam" and vendor can get all license cities for truck number plate. * **Permission role**: admin, kam and vendor * **Method**:`GET` * **Api path**:`/license-city/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License city list get successfully.", "count": 2, "data": [ { "id": 71, "label": "Rajshahi Metro", "labelBn": "āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋ ", "value": "RM", "status": "active", "createdAt": "2022-01-16T05:47:35.383Z" }, { "id": 70, "label": "Thakurgaon", "labelBn": "āĻ āĻžāϕ⧁āϰāĻ—āĻžāρāĻ“", "value": "THAKURGAON", "status": "active", "createdAt": "2021-12-29T07:14:57.123Z" } ] } ``` ### 2.3 Delete License city by admin * **Description:** Only "admin" can delete a specific license city for truck number plate. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/license-city/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License city deleted successfully.", "data": { "id": 58, "label": "Raj. Metro", "labelBn": "āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋", "value": "RAJMETRO", "status": "inactive", "createdAt": "2021-12-29T07:14:57.071Z" } } ``` ### 2.4 Get License city list by admin * **Description:** Two roles "admin" and "kam" can update license cities for truck number plate. * **Permission role**: admin and kam * **Method**:`PUT` * **Api path**:`/license-city/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `label`: `string`| `Rajshahi Metro` |`false`| | `labelBn`: `string` | `āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋` |`false`| | `Value`: `string` | `RM` |`false`| * **Request Body**: ```json= { "label": "Rajshahi Metro", "labelBn": "āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋ ", "value": "RM" } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License city updated successfully.", "data": { "id": 71, "label": "Rajshahi Metro", "labelBn": "āϰāĻžāϜāĻļāĻžāĻšā§€ āĻŽā§‡āĻŸā§āϰ⧋ ", "value": "RM", "status": "active", "createdAt": "2022-01-16T05:47:35.383Z" } } ``` ### 2.5 Get License city list using specific * **Description:** Anybody get specific license cites using ids for truck number plate with secret key. * **Permission role**: admin and kam * **Method**:`GET` * **Api path**:`/secret/license-city` * **Headers**: `secret-key` : `Bearer {secret_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `ids`: `number[]`| `2,4,..` |`true`| * **Request Body**: ```json= { "ids":[2,4] } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "License city get successfully.", "data": [ { "id": 2, "label": "Dhaka Metro", "labelBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋", "value": "DM", "status": "active", "createdAt": "2021-12-29T07:14:56.887Z" }, { "id": 4, "label": "Brahmanbaria", "labelBn": "āĻŦā§āϰāĻžāĻšā§āĻŽāĻŖāĻŦāĻžāĻĄāĻŧāĻŋāϝāĻŧāĻž", "value": "BBARIA", "status": "active", "createdAt": "2021-12-29T07:14:56.904Z" } ] } ``` ## 3. Module: Truck Brand ### 3.1 Create Truck brand by admin * **Description:** Only admin can create truck brand for truck. * **Permission role**: admin * **Method**:`POST` * **Api path**:`/truck-brand/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `brand`: `string`| `Toyota` |`true`| | `brandBn`: `string` | `āĻŸā§Ÿā§‹āϟāĻž` |`true`| * **Request Body**: ```json= { "brand" : "Toyota", "brandBn": "āĻŸā§Ÿā§‹āϟāĻž" } ``` * **Response**: ```status_code: 201``` ```json= { "status": 201, "success": true, "message": "Truck brand created successfully.", "data": { "id": 7, "brand": "Toyota", "brandBn": "āĻŸā§Ÿā§‹āϟāĻž", "status": "active", "createdAt": "2022-01-16T09:26:53.201Z" } } ``` ### 3.2 Get truck brand list by admin * **Description:** "Admin", "vendor" and "kam" can get all truck brand for truck number plate. * **Permission role**: admin, vendor and kam * **Method**:`GET` * **Api path**:`/truck-brand/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck brand list get successfully.", "count": 1, "data": [ { "id": 7, "brand": "Toyota", "brandBn": "Toyota", "status": "active", "createdAt": "2022-01-16T09:26:53.201Z" } ] } ``` ### 3.3 Delete Truck Brand by admin * **Description:** Only "admin" can delete a specific truck brand from the list. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/truck-brand/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck brand deleted successfully", "data": { "id": 7, "brand": "Toyota", "brandBn": "āĻŸā§Ÿā§‹āϟāĻž", "status": "inactive", "createdAt": "2022-01-16T09:26:53.201Z" } } ``` ### 3.4 Update truck brand details by specific id list by admin * **Description:** Two roles "admin" and "kam" can get all license alphabets for truck number plate. * **Permission role**: admin and kam * **Method**:`PUT` * **Api path**:`/truck-brand/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `brand`: `string`| `Toyota` |`false`| | `brandBn`: `string` | `āĻŸā§Ÿā§‹āϟāĻž` |`false`| * **Request Body**: ```json= { "brand": "Toyota", "brandBn": "āĻŸā§Ÿā§‹āϟāĻž" } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck brand updated successfully.", "data": { "id": 7, "brand": "Toyota", "brandBn": "āĻŸā§Ÿā§‹āϟāĻž", "status": "active", "createdAt": "2022-01-16T09:26:53.201Z" } } ``` ### 3.5 Get truck brand list using specific id * **Description:** Anybody gets specific truck brand using ids for truck number plate with secret key. * **Permission role**: secret key * **Method**:`GET` * **Api path**:`/secret/truck-brand` * **Headers**: `Authorization` : `Bearer {access_token}`, `secret-key` : `Bearer {secret_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `ids`: `number[]`| `2,4,..` |`true`| * **Request Body**: ```json= { "ids":[7] } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck brand updated successfully.", "data": { "id": 7, "brand": "Toyota", "brandBn": "āĻŸā§Ÿā§‹āϟāĻž", "status": "active", "createdAt": "2022-01-16T09:26:53.201Z" } } ``` ## 4. Module: Truck Category ### 4.1 Truck category create by admin * **Description:** Only admin and kam can create truck category for truck. * **Permission role**: admin and kam * **Method**:`POST` * **Api path**:`/truck-category/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `truckCategoryEn`: `string`| `Trailer` |`true`| | `truckCategoryBn`: `string` | `āĻŸā§āϰ⧇āχāϞāĻžāϰ` |`true`| * **Request Body**: ```json= { "truckCategoryEn": "Trailer", "truckCategoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ" } ``` * **Response**: ```status_code: 201``` ```json= { "status": 200, "success": true, "message": "Truck category list get successfully!", "count": 1, "data": [ { "id": 5, "truckCategoryEn": "Freezer van", "truckCategoryBn": "āĻĢā§āϰ⧀āϜāĻžāϰ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-13T03:56:46.116Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.svg" } } ] } ``` ### 4.2 Get truck categories list by admin and vendor * **Description:** "Admin", "vendor" and "kam" can get all truck categories for truck number plate. * **Permission role**: admin, vendor, shipper and kam * **Method**:`GET` * **Api path**:`/truck-category/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Query Name | Sample Data | | -------- | -------- | | `id`: `number` | `1` | | `truckCategoryEn`: `string` | `Trailer` | | `truckCategoryBn`: `string`| `āĻŸā§āϰ⧇āχāϞāĻžāϰ`| | `status`: `string`| `active`, `inactive`, `archived` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck category list get successfully!", "count": 2, "data": [ { "id": 5, "truckCategoryEn": "Freezer van", "truckCategoryBn": "āĻĢā§āϰ⧀āϜāĻžāϰ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-13T03:56:46.116Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.svg" } } ] } ``` ### 4.3 Get truck categories with type list by admin kam shipper * **Description:** "Admin", "vendor" and "kam" can get all truck categories with their comparative types for truck number plate. * **Permission role**: admin, vendor, shipper and kam * **Method**:`GET` * **Api path**:`/truck-category/types` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Query Name | Sample Data | | -------- | -------- | | `id`: `number` | `1` | | `truckCategoryEn`: `string` | `Trailer` | | `truckCategoryBn`: `string`| `āĻŸā§āϰ⧇āχāϞāĻžāϰ`| | `status`: `string`| `active`, `inactive`, `archived` | | `` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck category list get successfully!", "count": 2, "data": [ { "id": 5, "truckCategoryEn": "Freezer van", "truckCategoryBn": "āĻĢā§āϰ⧀āϜāĻžāϰ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-13T03:56:46.116Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.svg" } } ] } ``` ### 4.4 Truck category delete by admin * **Description:** Only "admin" can delete a specific truck category from the list. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/truck-category/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck category deleted successfully", "data": { "id": 7, "truckCategoryEn": "Trailer", "truckCategoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ", "status": "inactive", "createdAt": "2022-01-16T09:26:53.201Z" } } ``` ### 4.5 Update truck category details by specific id list by admin * **Description:** Two roles "admin" and "kam" can update truck category details by specific id for truck number plate. * **Permission role**: admin and kam * **Method**:`PUT` * **Api path**:`/truck-category/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `truckCategoryEn`: `string`| `Trailer` |`false`| | `truckCategoryBn`: `string` | `āĻŸā§āϰ⧇āχāϞāĻžāϰ` |`false`| * **Request Body**: ```json= { "truckCategoryEn": "Trailer", "truckCategoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ" } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck category deleted successfully!", "data": [ { "id": 5, "truckCategoryEn": "Freezer van", "truckCategoryBn": "āĻĢā§āϰ⧀āϜāĻžāϰ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-13T03:56:46.116Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/fv-black.svg" } } ] } ``` ### 4.6 Get truck category list using specific id * **Description:** Anybody can get specific truck category using ids for truck number plate with secret key. * **Permission role**: any * **Method**:`GET` * **Api path**:`/secret/truck-category` * **Headers**: `Authorization` : `Bearer {access_token}`, `secret-key` : `Bearer {secret_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `ids`: `number[]`| `2,4,..` |`true`| * **Request Body**: ```json= { "ids": [1,2] } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck category get successfully.", "data": [ { "id": 2, "truckCategoryEn": "Open Truck", "truckCategoryBn": "āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-10T05:07:17.890Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/ot-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/ot-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/ot-black.svg" } }, { "id": 1, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-10T05:03:20.273Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.svg" } } ] } ``` ## 5. Module: Truck type ### 5.1 Create Truck type by admin * **Description:** Only admin and kam can create truck type for truck. * **Permission role**: admin and kam * **Method**:`POST` * **Api path**:`/admin/truck-type/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `truckTypeEn`: `string`| `7.5t-23ft` |`true`| | `truckTypeBn`: `string` | `ā§­.ā§Ģāϟāύ-ā§¨ā§Š āĻĢāĻŋāϟ` |`true`| | `truckCategoryId`: `number`| `4` |`true`| * **Request Body**: ```json= { "truckTypeEn": "7.5t-23ft", "truckTypeBn": "ā§­.ā§Ģāϟāύ-ā§¨ā§Š āĻĢāĻŋāϟ", "truckCategoryId": 4 } ``` * **Response**: ```status_code: 201``` ```json= { "status": 201, "success": true, "message": "Truck type created successfully!", "data": { "id": 72, "truckTypeEn": "7.5t-23ft", "truckTypeBn": "ā§­.ā§Ģāϟāύ-ā§¨ā§Š āĻĢāĻŋāϟ", "status": "active", "createdAt": "2022-01-17T06:01:01.095Z", "truckCategory": { "id": 4, "truckCategoryEn": "Covered Van", "truckCategoryBn": "āĻ•āĻžāĻ­āĻžāĻ°ā§āĻĄ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-10T05:07:47.787Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/cv-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/cv-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/cv-black.svg" } } } } ``` ### 5.2 Get truck type list * **Description:** "Admin", "vendor" and "kam" can get all truck types for truck number plate. * **Permission role**: admin, vendor, shipper and kam * **Method**:`GET` * **Api path**:`/truck-type/` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Query Name | Sample Data | | -------- | -------- | | `id`: `number` | `1` | | `truckCategoryEn`: `string` | `Trailer` | | `truckCategoryBn`: `string`| `āĻŸā§āϰ⧇āχāϞāĻžāϰ`| | `status`: `string`| `active`, `inactive`, `archived` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck type list get successfully!", "count": 34, "data": [ { "id": 71, "truckTypeEn": "7FT Covered Van", "truckTypeBn": "ā§­ āĻĢ⧁āϟ āĻ•āĻžāĻ­āĻžāĻ°ā§āĻĄ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-29T07:19:46.963Z" }, ] } ``` ### 5.3 Truck type delete by admin * **Description:** Only "admin" can delete a specific truck type from the list. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/admin/truck-type/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck type deleted successfully!", "data": { "id": 72, "truckTypeEn": "7.5t-23ft", "truckTypeBn": "ā§­.ā§Ģāϟāύ-ā§¨ā§Š āĻĢāĻŋāϟ", "status": "inactive", "createdAt": "2022-01-17T06:01:01.095Z" } } ``` ### 5.4 Update truck category details by specific id list by admin * **Description:** Two roles "admin" and "kam" can update truck category details by specific id for truck number plate. * **Permission role**: admin and kam * **Method**:`PUT` * **Api path**:`/admin/truck-type/{id}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `truckTypeEn`: `string` | `7.5t-23ft` |`false`| | `truckTypeBn`: `string` | `ā§­.ā§Ģāϟāύ-ā§¨ā§ŠāĻĢāĻŋāϟ` |`false`| * **Request Body**: ```json= { "truckTypeBn": "ā§­.ā§Ģāϟāύ-ā§¨ā§Š āĻĢāĻŋāϟ" } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck type updated successfully!", "data": { "id": 72, "truckTypeEn": "7.5t-23ft", "truckTypeBn": "ā§­.ā§Ģāϟāύ-ā§¨ā§ŠāĻĢāĻŋāϟ", "status": "active", "createdAt": "2022-01-17T06:01:01.095Z" } } ``` ### 5.5 Get truck type list using specific id by admin * **Description:** Only admin can get specific truck type using ids for truck number plate with secret key. * **Permission role**: admin and kam * **Method**:`GET` * **Api path**:`/secret/truck-type/` * **Headers**: `Authorization` : `Bearer {access_token}`, `secret-key` : `Bearer {secret_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- |--------| | `ids`: `number[]`| `2,4,..` |`true`| * **Request Body**: ```json= { "ids":[72,67] } ``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck type get successfully.", "data": [ { "id": 67, "truckTypeEn": "12FT Covered Van", "truckTypeBn": "⧧⧍ āĻĢ⧁āϟ āĻ•āĻžāĻ­āĻžāĻ°ā§āĻĄ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2021-12-29T07:19:46.947Z" }, { "id": 72, "truckTypeEn": "7.5t-23ft", "truckTypeBn": "ā§­.ā§Ģāϟāύ-ā§¨ā§Š āĻĢāĻŋāϟ", "status": "inactive", "createdAt": "2022-01-17T06:01:01.095Z" } ] } ``` ## 6. Module: Truck ### 6.1 Truck for admin and kam #### 6.1.1 Create Truck by admin for a vendor * **Description:** Admin and kam can create truck. * **Permission role**: admin and kam * **Method**:`POST` * **Api path**:`/admin/vendor/truck` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `licenseCityId`: `number`| `2` |`true`| | `licenseAlphaId`: `number`| `16` |`true`| | `truckBrandId`: `number`| `2` |`false`| | `licensePlateNoEn`: `number`| `349063` |`true`| | `truckTypeId`: `number`| `38` |`true`| | `vendorId`: `string`| `01FRDWX8G34X17AVEDV884PD0H` |`true`| * **Request Body**: ```json= { "licenseCityId": 2, "licenseAlphaId": 16, "licensePlateNoEn": "349063", "truckTypeId": 38, "vendorId": "01FRDWX8G34X17AVEDV884PD0H" } ``` * **Response**: ```status_code: 201``` ```json= { "message": "Truck created successfully!", "data": { "id": 26, "createdAt": "2022-01-04T11:27:20.402Z", "updatedAt": "2022-01-04T11:27:20.646Z", "licensePlateNoEn": "Dhaka Metro AW - āĻ… 347660", "truckModelNo": null, "licensePlateNoTextEn": "Dhaka Metro - AW - āĻ… - 347660", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āĻ… - AW ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āĻ… - AW - ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "status": "active", "truckAvailability": "available", "licenseCity": { "id": 2, "createdAt": "2021-12-29T07:14:56.887Z", "updatedAt": "2021-12-29T07:14:56.887Z", "label": "Dhaka Metro", "labelBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋", "labelText": "Dhaka Metro - āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋", "value": "DM", "status": "active" }, "licenseAlpha": { "id": 16, "createdAt": "2021-12-29T07:22:15.669Z", "updatedAt": "2021-12-29T07:22:15.669Z", "label": "AW - āĻ…", "labelBn": "āĻ… - AW", "labelText": "āĻ… - AW - AW - āĻ…", "value": "AW", "status": "active" }, "truckType": { "id": 38, "createdAt": "2021-12-29T07:14:01.598Z", "updatedAt": "2021-12-29T07:14:01.598Z", "truckTypeEn": "20FT Open Truck", "truckTypeBn": "⧍ā§Ļ āĻĢ⧁āϟ āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active" }, "truckCategory": { "id": 1, "createdAt": "2021-12-10T05:03:20.273Z", "updatedAt": "2022-01-05T11:28:42.731Z", "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.svg" }, "status": "active" } } } ``` #### 6.1.2 Get trucks list by admin * **Description:** admin and kam can get all truck. * **Permission role**: admin * **Method**:`GET` * **Api path**:`/truck` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Query Name | Sample Data | | -------- | -------- | | `licensePlateNoEn`: `string` | `347660` | | `licensePlateNoEn`: `string` | `ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ` | | `truckCategory`: `string` | `Trailer`, `Dump Truck`, `Freezer van`, `Open Truck`, `Covered Van` | | `truckModelNo`: `string`| `Toyota`| | `truckAvailability`: `string`| `available`, `inactive`, `in_trip`| | `status`: `string`| `active`, `inactive`, `archived` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck list get successfully!", "count": 1, "data": [ { "id": 52, "licensePlateNoEn": "Dhaka Metro e 347660", "truckModelNo": null, "truckBrand": null, "status": "active", "createdAt": "2022-01-17T06:36:48.059Z", "licensePlateNoTextEn": "Dhaka Metro - e - 347660", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āχ - ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āχ ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "truckType": { "id": 38, "truckTypeEn": "20FT Open Truck", "truckTypeBn": "⧍ā§Ļ āĻĢ⧁āϟ āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-29T07:14:01.598Z" }, "truckCategory": { "id": 3, "truckCategoryEn": "Trailer", "truckCategoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ", "status": "active", "createdAt": "2021-12-10T05:07:28.701Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/tv-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/tv-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/tv-black.svg" } }, "truckAvailability": "available" } ] } ``` #### 6.1.3 Single truck details by admin * **Description:** admin and kam can get single truck details by truckId. * **Permission role**: admin * **Method**:`GET` * **Api path**:`/truck/{truckId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck details get successfully!", "data": { "id": 1, "licensePlateNoEn": "Dhaka Metro AW 783882", "truckModelNo": null, "status": "active", "createdAt": "2021-12-29T18:29:55.996Z", "licensePlateNoTextEn": "Dhaka Metro - AW - āĻ… - 312157", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āĻ… - AW - ā§Šā§§ā§¨ā§§ā§Ģā§­", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āĻ…", "truckType": { "id": 38, "truckTypeEn": "20FT Open Truck", "truckTypeBn": "⧍ā§Ļ āĻĢ⧁āϟ āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-29T07:14:01.598Z" }, "truckCategory": { "id": 1, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-10T05:03:20.273Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.svg" } }, "truckAvailability": "available" } } ``` #### 6.1.4 Delete truck by admin * **Description:** admin and kam can delete single truck by truckId. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/truck/{truckId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck deleted successfully!", "data": { "id": 52, "licensePlateNoEn": "Dhaka Metro e 347660", "truckModelNo": null, "status": "inactive", "createdAt": "2022-01-17T06:36:48.059Z", "licensePlateNoTextEn": "Dhaka Metro - e - 347660", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āχ - ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āχ ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "truckAvailability": "available" } } ``` ### 6.2 Driver for admin and kam #### 6.2.1 Driver create by admin for a vendor * **Description:** Admin and kam can create driver. * **Permission role**: admin and kam * **Method**:`POST` * **Api path**:`/admin/vendor/driver` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `fullName`: `number`| `2` |`true`| | `phone`: `number`| `16` |`true`| | `nickName`: `number`| `2` |`true`| | `vendorId`: `string`| `01FRDWX8G34X17AVEDV884PD0H` |`true`| * **Request Body**: ```json= { "fullName": "Noone", "phone": "+8801783573470", "nickName": "Noone", "vendorUserId": "01FRDWX8G34X17AVEDV884PD0H" } ``` * **Response**: ```status_code: 201``` ```json= { "message": "Driver created successfully!", "data": { "id": 16, "createdAt": "2022-01-05T06:48:28.305Z", "updatedAt": "2022-01-05T06:48:28.305Z", "fullName": "Noone", "phone": "+8801783573470", "status": "active", "driverAvailability": "available" } } ``` #### 6.2.2 Get drivers list by admin * **Description:** admin and kam can get all drivers list. * **Permission role**: admin * **Method**:`GET` * **Api path**:`/driver` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Query Name | Sample Data | | -------- | -------- | | `fullName`: `string` | `347660` | | `phone`: `string` | `ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ` | | `driverAvailability`: `string` | `available`, `inactive`, `in_trip`| | `page`: `number` | `1` | | `limit`: `number` | `10` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck driver list get successfully!", "count": 12, "data": [ { "id": 16, "fullName": "Noone", "phone": "+8801783573470", "driverAvailability": "available", "status": "active", "createdAt": "2022-01-05T06:48:28.305Z" }, ] } ``` #### 6.2.3 Single driver details by admin * **Description:** admin and kam can get single driver details by driverId. * **Permission role**: admin * **Method**:`GET` * **Api path**:`/driver/{driverId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck driver details get successfully!", "data": { "id": 16, "fullName": "Noone", "phone": "+8801783573470", "driverAvailability": "available", "status": "active", "createdAt": "2022-01-05T06:48:28.305Z" } } ``` #### 6.2.4 Delete driver by admin * **Description:** admin and kam can delete single driver by driverId. * **Permission role**: admin * **Method**:`DELETE` * **Api path**:`/driver/{driverId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Driver deleted successfully!", "data": { "id": 16, "fullName": "Noone", "phone": "+8801783573470", "driverAvailability": "available", "status": "inactive", "createdAt": "2022-01-05T06:48:28.305Z" } } ``` ### 6.3 Vendor - admin #### 6.3.1 Vendor list by admin and kam * **Description:** Admin and KAM can see total vendor list. * **Permission role**: Admin * **Method**:`GET` * **Api path**:`/admin/vendor` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ``` No response body``` * **Response**: ```status_code: 201``` ```json= { "status": 200, "success": true, "message": "Vendor lists get successfully.", "count": 22, "data": [ { "id": 44, "userId": "01FS12H0QMTQP8XB7FA13VVFFM", "fullName": "eee", "phone": "+8801681442229", "email": null }, { "id": 43, "userId": "01FRYMJ7ZE6P5S1J7HDM5Q7QKN", "fullName": "syed ", "phone": "+8801681442230", "email": null } ] } ``` #### 6.3.2 Vendor's details by admin and kam * **Description:** Admin and KAM can see a vendor's profile with vendor userId. * **Permission role**: Admin * **Method**:`GET` * **Api path**:`/admin/vendor/{userId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ``` No response body``` * **Response**: ```status_code: 201``` ```json= { "status": 200, "success": true, "message": "Vendor details get successfully.", "data": { "id": 30, "userId": "01FRDWX8G34X17AVEDV884PD0H", "fullName": "syed musa tazim", "phone": "+8801696678831", "email": null, "districtPreferences": [ { "id": 63, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Comilla", "nameBn": "āϕ⧁āĻŽāĻŋāĻ˛ā§āϞāĻž", "status": "active", "districtId": 6 }, { "id": 64, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Feni", "nameBn": "āĻĢ⧇āύ⧀", "status": "active", "districtId": 7 }, { "id": 65, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Rangamati", "nameBn": "āϰāĻžāĻ™ā§āĻ—āĻžāĻŽāĻžāϟāĻŋ", "status": "active", "districtId": 9 } ], "vendorTruckCategories": [ { "id": 22, "truckCategoryEn": "Open Truck", "truckCategoryBn": "āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-02T17:20:35.623Z" }, { "id": 21, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-02T17:20:35.623Z" } ] } } ``` ### 6.4 Vendor personal details #### 6.4.1 Create a vendor * **Description:** Vendor can create a vendor. * **Permission role**: Vendor * **Method**:`POST` * **Api path**:`/vendor` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `userId`: `string`| `091599` |`true`| | `fullName`: `string`| `Abc` |`true`| | `email`: `string`| `noone@gmail.com` |`false`| | `origin`: `number`| `1` |`true`| | `tln`: `string`| `11234` |`false`| | `phone`: `string`| `1983745908` |`true`| | `districtPreferences`: `number[]`| `[ 1, 2, 3 ]` |`true`| | `truckCategories`: `number[]`| `[ 1, 2, 3 ]` |`true`| * **Request Body**: ```json= { "userId": "091599", "fullName": "Abc", "email": "312157", "phone": "1983745908430", "originDistrict": { "id": 60, "nameBn": "āϞāĻžāϞāĻŽāύāĻŋāϰāĻšāĻžāϟ", "nameEn": "Lalmonirhat", "status": "active" }, "tln" : "11234", "districtPreference": [ 1, 2, 3 ], "truckCategories": [ 1, 2, 3 ] } ``` * **Response**: ```status_code: 201``` ```json= { "status": 201, "success": true, "message": "Vendor created successfully.", "data": { "id": 30, "userId": "01FRDWX8G34X17AVEDV884PD0H", "fullName": "syed musa tazim", "phone": "+8801696678831", "email": null, "districtPreferences": [ { "id": 63, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Comilla", "nameBn": "āϕ⧁āĻŽāĻŋāĻ˛ā§āϞāĻž", "status": "active", "districtId": 6 }, { "id": 64, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Feni", "nameBn": "āĻĢ⧇āύ⧀", "status": "active", "districtId": 7 }, { "id": 65, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Rangamati", "nameBn": "āϰāĻžāĻ™ā§āĻ—āĻžāĻŽāĻžāϟāĻŋ", "status": "active", "districtId": 9 } ], "vendorTruckCategories": [ { "id": 22, "truckCategoryEn": "Open Truck", "truckCategoryBn": "āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-02T17:20:35.623Z" }, { "id": 21, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-02T17:20:35.623Z" } ] } } ``` #### 6.4.2 Vendor's profile * **Description:** Vendor can his profile. * **Permission role**: vendor * **Method**:`GET` * **Api path**:`/vendor` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```no resposnse body``` * **Response**: ```json= { "status": 200, "success": true, "message": "Vendor details get successfully!", "data": { "id": 30, "userId": "01FRDWX8G34X17AVEDV884PD0H", "fullName": "syed musa tazim", "phone": "+8801696678831", "email": null, "districtPreferences": [ { "id": 63, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Comilla", "nameBn": "āϕ⧁āĻŽāĻŋāĻ˛ā§āϞāĻž", "status": "active", "districtId": 6 }, { "id": 64, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Feni", "nameBn": "āĻĢ⧇āύ⧀", "status": "active", "districtId": 7 }, { "id": 65, "createdAt": "2022-01-02T17:20:35.623Z", "nameEn": "Rangamati", "nameBn": "āϰāĻžāĻ™ā§āĻ—āĻžāĻŽāĻžāϟāĻŋ", "status": "active", "districtId": 9 } ], "vendorTruckCategories": [ { "id": 22, "truckCategoryEn": "Open Truck", "truckCategoryBn": "āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-02T17:20:35.623Z" }, { "id": 21, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-02T17:20:35.623Z" } ] } } ``` #### 6.4.3 Update a vendor's profile * **Description:** Vendor can update his profile. * **Permission role**: Vendor * **Method**:`PUT` * **Api path**:`/vendor` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | | -------- | -------- | | `fullName`: `string`| `Abc` | | `email`: `string`| `noone@gmail.com` | | `phone`: `string`| `11234` | | `districtPreferences`: `number[]`| `[ 1, 2, 3 ]` | | `truckCategories`: `number[]`| `[ 1, 2, 3 ]` | * **Request Body**: ```json= { "fullName": "Abc", "email": "312157", "phone": "1983745908430", "originD": 1, "phone" : "+880167011234", "districtPreferences": [ 1, 2, 3 ], "truckCategories": [ 1, 2, 3 ] } ``` * **Response**: ```status_code: 201``` ```json= { "status": 200, "success": true, "message": "Vendor details updated successfully!", "data": { "id": 32, "userId": "01FRFQ7J6ME8VDHDD222D4RDXJ", "fullName": "syed musa 1tazim", "phone": "+8801876554440", "email": "kasjjapgj@kkjn.com", "districtPreferences": [ { "id": 75, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Brahmanbaria", "nameBn": "āĻŦā§āϰāĻžāĻšā§āĻŽāĻŖāĻŦāĻžāĻĄāĻŧāĻŋāϝāĻŧāĻž", "status": "inactive", "districtId": 8 }, { "id": 77, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Noakhali", "nameBn": "āύ⧋āϝāĻŧāĻžāĻ–āĻžāϞ⧀", "status": "inactive", "districtId": 10 }, { "id": 78, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Chandpur", "nameBn": "āϚāĻžāρāĻĻāĻĒ⧁āϰ", "status": "inactive", "districtId": 11 }, { "id": 79, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Lakshmipur", "nameBn": "āϞāĻ•ā§āĻˇā§āĻŽā§€āĻĒ⧁āϰ", "status": "inactive", "districtId": 12 }, { "id": 73, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Comilla", "nameBn": "āϕ⧁āĻŽāĻŋāĻ˛ā§āϞāĻž", "status": "active", "districtId": 6 }, { "id": 74, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Feni", "nameBn": "āĻĢ⧇āύ⧀", "status": "active", "districtId": 7 }, { "id": 76, "createdAt": "2022-01-03T10:19:49.847Z", "nameEn": "Rangamati", "nameBn": "āϰāĻžāĻ™ā§āĻ—āĻžāĻŽāĻžāϟāĻŋ", "status": "active", "districtId": 9 } ], "vendorTruckCategories": [ { "id": 27, "truckCategoryEn": "Open Truck", "truckCategoryBn": "āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "inactive", "createdAt": "2022-01-03T10:19:49.847Z" }, { "id": 58, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2022-01-09T07:26:47.010Z" }, { "id": 26, "truckCategoryEn": "Trailer", "truckCategoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ", "status": "inactive", "createdAt": "2022-01-03T10:19:49.847Z" }, { "id": 28, "truckCategoryEn": "Covered Van", "truckCategoryBn": "āĻ•āĻžāĻ­āĻžāĻ°ā§āĻĄ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2022-01-03T10:19:49.847Z" }, { "id": 59, "truckCategoryEn": "Freezer van", "truckCategoryBn": "āĻĢā§āϰ⧀āϜāĻžāϰ āĻ­ā§āϝāĻžāύ", "status": "active", "createdAt": "2022-01-09T08:10:07.385Z" } ] } } ``` ### 6.5 Truck vendor #### 6.5.1 Truck create by a vendor * **Description:** vendor can create truck. * **Permission role**: vendor * **Method**:`POST` * **Api path**:`/truck` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `licenseCityId`: `number`| `2` |`true`| | `licenseAlphaId`: `number`| `16` |`true`| | `truckBrandId`: `number`| `2` |`false`| | `licensePlateNoEn`: `number`| `349063` |`true`| | `truckTypeId`: `number`| `38` |`true`| * **Request Body**: ```json= { "licenseCityId": 2, "licenseAlphaId": 16, "licensePlateNoEn": "349063", "truckTypeId": 38, } ``` * **Response**: ```status_code: 201``` ```json= { "message": "Truck created successfully!", "data": { "id": 26, "createdAt": "2022-01-04T11:27:20.402Z", "updatedAt": "2022-01-04T11:27:20.646Z", "licensePlateNoEn": "Dhaka Metro AW - āĻ… 347660", "truckModelNo": null, "licensePlateNoTextEn": "Dhaka Metro - AW - āĻ… - 347660", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āĻ… - AW ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āĻ… - AW - ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "status": "active", "truckAvailability": "available", "licenseCity": { "id": 2, "createdAt": "2021-12-29T07:14:56.887Z", "updatedAt": "2021-12-29T07:14:56.887Z", "label": "Dhaka Metro", "labelBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋", "labelText": "Dhaka Metro - āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋", "value": "DM", "status": "active" }, "licenseAlpha": { "id": 16, "createdAt": "2021-12-29T07:22:15.669Z", "updatedAt": "2021-12-29T07:22:15.669Z", "label": "AW - āĻ…", "labelBn": "āĻ… - AW", "labelText": "āĻ… - AW - AW - āĻ…", "value": "AW", "status": "active" }, "truckType": { "id": 38, "createdAt": "2021-12-29T07:14:01.598Z", "updatedAt": "2021-12-29T07:14:01.598Z", "truckTypeEn": "20FT Open Truck", "truckTypeBn": "⧍ā§Ļ āĻĢ⧁āϟ āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active" }, "truckCategory": { "id": 1, "createdAt": "2021-12-10T05:03:20.273Z", "updatedAt": "2022-01-05T11:28:42.731Z", "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.svg" }, "status": "active" } } } ``` #### 6.5.2 Get trucks list by vendor * **Description:** "vendor" can get all truck for vendor. * **Permission role**: vendor * **Method**:`GET` * **Api path**:`/vendor/trucks` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Field Name | Sample Data | | -------- | -------- | | `licensePlateNoEn`: `number`| `349063` | | `truckAvailability`: `string`| `inactive`, `available`, `in_trip` | | `truckCategory`: `string`| `Dump Truck`, `Trailer`, `Freezer van`, `Open Truck`, `Covered Van` | | `page`: `number` | `1` | | `limit`: `number` | `10` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck list get successfully!", "count": 2, "data": [ { "id": 31, "createdAt": "2022-01-11T12:08:18.656Z", "licensePlateNoEn": "Chandpur AW 417661", "truckAvailability": "available" }, { "id": 32, "createdAt": "2022-01-11T12:08:23.678Z", "licensePlateNoEn": "Chandpur AW 427661", "truckAvailability": "available" } ] } ``` #### 6.5.3 Single truck details by vendor * **Description:** vendor can get single truck details by truckId. * **Permission role**: vendor * **Method**:`GET` * **Api path**:`/truck/{truckId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck details get successfully!", "data": { "id": 1, "licensePlateNoEn": "Dhaka Metro AW 783882", "truckModelNo": null, "status": "active", "createdAt": "2021-12-29T18:29:55.996Z", "licensePlateNoTextEn": "Dhaka Metro - AW - āĻ… - 312157", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āĻ… - AW - ā§Šā§§ā§¨ā§§ā§Ģā§­", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āĻ…", "truckType": { "id": 38, "truckTypeEn": "20FT Open Truck", "truckTypeBn": "⧍ā§Ļ āĻĢ⧁āϟ āĻ–ā§‹āϞāĻž āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-29T07:14:01.598Z" }, "truckCategory": { "id": 1, "truckCategoryEn": "Dump Truck", "truckCategoryBn": "āĻĄāĻžāĻŽā§āĻĒ āĻŸā§āϰāĻžāĻ•", "status": "active", "createdAt": "2021-12-10T05:03:20.273Z", "image": { "black": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.png", "white": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-white.png", "blackSvg": "https://dev-loopfreight.sgp1.digitaloceanspaces.com/public/dt-black.svg" } }, "truckAvailability": "available" } } ``` #### 6.5.4 Delete truck by vendor * **Description:** vendor can delete single truck by truckId. * **Permission role**: vendor * **Method**:`DELETE` * **Api path**:`/truck/{truckId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck deleted successfully!", "data": { "id": 52, "licensePlateNoEn": "Dhaka Metro e 347660", "truckModelNo": null, "status": "inactive", "createdAt": "2022-01-17T06:36:48.059Z", "licensePlateNoTextEn": "Dhaka Metro - e - 347660", "licensePlateNoTextBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ - āχ - ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "licensePlateNoBn": "āĻĸāĻžāĻ•āĻž āĻŽā§‡āĻŸā§āϰ⧋ āχ ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ", "truckAvailability": "available" } } ``` ### 6.6 Driver vendors #### 6.6.1 Driver create from a vendor * **Description:** Vendor can create driver. * **Permission role**: vendor * **Method**:`POST` * **Api path**:`/driver` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `fullName`: `number`| `2` |`true`| | `phone`: `number`| `16` |`true`| | `nickName`: `number`| `2` |`true`| * **Request Body**: ```json= { "fullName": "Noone", "phone": "+8801783573470", "nickName": "Noone", } ``` * **Response**: ```status_code: 201``` ```json= { "message": "Driver created successfully!", "data": { "id": 16, "createdAt": "2022-01-05T06:48:28.305Z", "updatedAt": "2022-01-05T06:48:28.305Z", "fullName": "Noone", "phone": "+8801783573470", "status": "active", "driverAvailability": "available" } } ``` #### 6.6.2 Get drivers list by vendor * **Description:** vendor gets all drivers list. * **Permission role**: vendor * **Method**:`GET` * **Api path**:`/vendor/drivers` * **Headers**: `Authorization` : `Bearer {access_token}` * **Input Query**: | Query Name | Sample Data | | -------- | -------- | | `fullName`: `string` | `Mahbub` | | `phone`: `string` | `ā§Šā§Ēā§­ā§Ŧā§Ŧā§Ļ` | | `driverAvailability`: `string` | `available`, `inactive`, `in_trip`| | `page`: `number` | `1` | | `limit`: `number` | `10` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck driver list get successfully!", "count": 12, "data": [ { "id": 16, "fullName": "Noone", "phone": "+8801783573470", "driverAvailability": "available", "status": "active", "createdAt": "2022-01-05T06:48:28.305Z" }, ] } ``` #### 6.6.3 Single driver details by vendor * **Description:** vendor can get single driver details by driverId. * **Permission role**: vendor * **Method**:`GET` * **Api path**:`/driver/{driverId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Truck driver details get successfully!", "data": { "id": 16, "fullName": "Noone", "phone": "+8801783573470", "driverAvailability": "available", "status": "active", "createdAt": "2022-01-05T06:48:28.305Z" } } ``` #### 6.6.4 Delete driver by vendor * **Description:** vendor can delete single driver by driverId. * **Permission role**: vendor * **Method**:`DELETE` * **Api path**:`/driver/{driverId}` * **Headers**: `Authorization` : `Bearer {access_token}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Driver deleted successfully!", "data": { "id": 16, "fullName": "Noone", "phone": "+8801783573470", "driverAvailability": "available", "status": "inactive", "createdAt": "2022-01-05T06:48:28.305Z" } } ``` ### 6.7 Secret-key access #### 6.7.1 Vendor-truck blending list * **Description:** Searching vendor and truck for any specific location and truck category with secret key. * **Permission role**: any with secret key * **Method**:`POST` * **Api path**:`/secret/truck/vendor-blending/` * **Headers**: `Authorization` : `Bearer {secret_key}` * **Input Fields**: | Field Name | Sample Data | Required| | -------- | -------- | -------- | | `fromDistrict`: `object`| `{"address": "Bagerhat, Khulna, Bangladesh", "latitude": 22.651568, "longitude": 89.785938, "addressLocale": { "bn": "āĻŦāĻžāϗ⧇āϰāĻšāĻžāϟ", "en": "brahmanbaria" } },` |`true`| | `toDistrict`: `object`| `{ "address": "Jessore, Khulna, Bangladesh", "latitude": 23.16643, "longitude": 89.2081126, "addressLocale": { "bn": "āϝāĻļā§‹āϰ", "en": "Dhaka" } },` |`true`| | `truckCategory`: `object`| ` { "id": 3, "status": "active", "categoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ", "categoryEn": "XCV" }` |`true`| * **Request Body**: ```json= { "fromDistrict": { "address": "Bagerhat, Khulna, Bangladesh", "latitude": 22.651568, "longitude": 89.785938, "addressLocale": { "bn": "āĻŦāĻžāϗ⧇āϰāĻšāĻžāϟ", "en": "brahmanbaria" } }, "toDistrict": { "address": "Jessore, Khulna, Bangladesh", "latitude": 23.16643, "longitude": 89.2081126, "addressLocale": { "bn": "āϝāĻļā§‹āϰ", "en": "Dhaka" } }, "truckCategory": { "id": 3, "status": "active", "truckCategoryBn": "āĻŸā§āϰ⧇āχāϞāĻžāϰ", "truckCategoryEn": "XCV" } } ``` * **Response**: ```status_code: 201``` ```json= { "status": 201, "success": true, "message": "Vendor list get successfully.", "count": 1, "data": [ { "id": 19, "userId": "3666", "fullName": "Abc", "phone": "+8801696678334", "email": "312157" } ] } ``` #### 6.7.2 Vendor company list with secret key * **Description:** See vendor's company with secret key. * **Permission role**: any with secret key * **Method**:`GET` * **Api path**:`/secret/truck/vendor-company/{vendorId}` * **Headers**: `Authorization` : `Bearer {secret_key}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Vendor details get successfully.", "data": { "companyName": "test" } } ``` #### 6.7.3 Vendor origin district and district preferences with secret key by vendor's user id * **Description:** To get specific vendor's origin district and district preference with secret key. * **Permission role**: any with secret key * **Method**:`GET` * **Api path**:`/secret/truck/vendor-details/{vendorId}` * **Headers**: `Authorization` : `Bearer {secret_key}` * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Vendor details get successfully.", "data": { "originDistrict": { "id": 52, "nameEn": "Dhaka", "nameBn": "āĻĸāĻžāĻ•āĻž", "status": "active" }, "districtPreferences": [ { "nameEn": "Comilla" }, { "nameEn": "Feni" } ] } } ``` #### 6.7.4 Get all Vendors with origin district and district preferences with secret key * **Description:** To get specific vendor's origin district and district preference with secret key. * **Permission role**: any with secret key * **Method**:`GET` * **Api path**:`/secret/truck/vendor-details/{vendorId}` * **Headers**: `Authorization` : `Bearer {secret_key}` * **Import Query** | Query Name | Sample Data | | -------- | -------- | | `districtPreference`: `string` | `Dhaka` | | `originDistrict`: `string` | `Feni`| | `page`: `number` | `1` | | `limit`: `number` | `10` | * **Request Body**: ```No response body``` * **Response**: ```status_code: 200``` ```json= { "status": 200, "success": true, "message": "Vendor details get successfully.", "count": 2, "data": [ { "id": 30, "userId": "01FRDWX8G34X17AVEDV884PD0H", "fullName": "syed musa tazim", "phone": "+8801696678831", "email": null, "companyName": null }, { "id": 45, "userId": "01FSP5XNHEN9WH06Z320YSE416", "fullName": "tazim", "phone": "+8801676553344", "email": null, "companyName": "Karim traders" } ] } ```