# PJM E-Catalog API in Billoader
## Commom response model
> เป็น model ที่นำไปใช้ในการตอบกลับของทุกๆ API และจะละเว้นการอธิบาย model นี้ในทุกๆ API ต่อไป
| Parameter | Description | Schema |
| --------- | -------------------------------------- |-------------|
| Data | ค่าที่ตอบกลับจากการทำงานของAPI นั้นๆ (ไม่มีการตอบกลับอนุญาติให้เป็น null) | Object |
| Status | สถานะการทำงานของ API นั้นๆ โดยหมวด 2xx คือทำงานปกติ 4xx คือข้อมูลบ้างอย่างไม่ถูกต้อง และ 5xx เป็นการทำงานผิดปกติของทาง API โดยถ้าได้รับ status หมวด 5xx สามารถแจ้งทีมงานเพื่อตรวจสอบได้ | Integer |
| Message | คำอธิบายขยายความของ Status เบื้องต้น โดยหมวด 2xx จะเป็น success 4xx ส่วนใหญ่จะเป็นข้อบงชี้ของข้อมูลที่ไม่ถูกต้อง และ 5xx จะเป็น error ของตัวระบบ | String |
## Request for Quotation List page
### `POST /api/v1/ECatalog/RFQ/Get`

**Body Request**
| Parameter | Description | Schema |
| ---------------------------------- | ------------------------------------------ | ------------------------ |
| Page (*required*) | | integer |
| PerPage (*required*) | | integer |
| OrderBy (*required*) | | enum int |
| OrderType (*required*) | asc = 1 , desc = 2 | enum int |
| DocumentStatus (*option*) | | enum int |
| DocumentLength (*option*) | | int |
| ProjectName (*option*) | | string |
**Body Response**
| Parameter | Description | Schema |
| ---------------------------------- | ------------------------------------------ | ------------------------ |
| TotalItem | | integer |
| DataList | | Array of object |
**DataList Response**
| Parameter | Description | Schema |
| ---------------------------------- | ------------------------------------------ | ------------------------ |
| RFQId | | Guid |
| RFQCode | | String |
| CreateDate | | DateTime |
| DueDate | | DateTime |
| ProjectName | | String |
| PublicAution | | Boolean |
| VendorCount | | Integer |
| InterestedCount | | Integer |
| ResponseCount | | Integer |
| Status | | Integer |
#### Example Request #1
```json
{
"Page": 1,
"PerPage": 15,
"OrderBy": 1,
"OrderType": 1
}
```
#### Example Response #1
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"TotalItem": 122,
"DataList": [
{
"RFQId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"RFQCode":"TESTRFQ-00001",
"CreateDate":"2021-05-19T06:11:16.3929186Z",
"DueDate":"2021-05-19T06:11:16.3929186Z",
"ProjectName":"Testing",
"PublicAution":false,
"VendorCount":2,
"InterestedCount":1,
"ResponseCount":1,
"Status":1
},
{
"RFQId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"RFQCode":"TESTRFQ-00002",
"CreateDate":"2021-05-19T06:11:16.3929186Z",
"DueDate":"2021-05-19T06:11:16.3929186Z",
"ProjectName":"Testing",
"PublicAution":true,
"VendorCount":3,
"InterestedCount":2,
"ResponseCount":1,
"Status":1
},
...
]
}
}
```
#### Example Request #2
```json
{
"Page": 1,
"PerPage": 15,
"OrderBy": 1,
"OrderType": 1,
"DocumentStatus": 2,
"DocumentLength": 7,
"ProjectName": ""
}
```
#### Example Response #2
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"TotalItem": 2,
"DataList": [
{
"RFQId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"RFQCode":"TESTRFQ-00001",
"CreateDate":"2021-05-19T06:11:16.3929186Z",
"DueDate":"2021-05-19T06:11:16.3929186Z",
"ProjectName":"Testing",
"PublicAution":false,
"VendorCount":2,
"InterestedCount":1,
"ResponseCount":1,
"Status":2
},
{
"RFQId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"RFQCode":"TESTRFQ-00002",
"CreateDate":"2021-05-19T06:11:16.3929186Z",
"DueDate":"2021-05-19T06:11:16.3929186Z",
"ProjectName":"Testing",
"PublicAution":true,
"VendorCount":3,
"InterestedCount":2,
"ResponseCount":1,
"Status":2
}
]
}
}
```
## Detail Request for Quotation page
### `GET /api/v1/ECatalog/RFQ/GetProjectList`

**Body Response**
| Parameter | Description | Schema |
| ---------------------------------- | ------------------------------------------ | ------------------------ |
| TotalItem | | integer |
| DataList | | Array of object |
**DataList Response**
| Parameter | Description | Schema |
| ---------------------------------- | ------------------------------------------ | ------------------------ |
| ProjectId | | Guid |
| ProjectCode | | String |
| ProjectName | | String |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"TotalItem": 10,
"DataList": [
{
"ProjectId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"ProjectCode":"Progo-00001",
"ProjectName":"ProjectTest0001Limited"
},
{
"ProjectId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"ProjectCode":"Progo-00002",
"ProjectName":"ProjectTest0002Limited"
}
]
}
}
```
### `GET /api/v1/ECatalog/RFQ/GetPRList`

**Query Parameter Request**
| Parameter | Description | Schema |
| --------- | ----------- | ------ |
| ProjectId | | Guid |
**Body Response**
| Parameter | Description | Schema |
| --------- | ----------- | --------------- |
| TotalItem | | integer |
| DataList | | Array of object |
**DataList Response**
| Parameter | Description | Schema |
| --------- | ----------- | ------ |
| PRId | | Guid |
| PRCode | | String |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"TotalItem": 10,
"DataList": [
{
"PRId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"PRCode":"PR-00001"
},
{
"PRId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"PRCode":"PR-00002"
}
]
}
}
```
### `POST /api/v1/ECatalog/RFQ/GetPRDetail`

**Body Request**
| Parameter | Description | Schema |
| --------- | ----------- | ------ |
| PRId | | Array of Guid |
**Body Response**
| Parameter | Description | Schema |
| --------- | ----------- | --------------- |
| TotalItem | | integer |
| DataList | | Array of object |
**DataList Response**
| Parameter | Description | Schema |
| -------------- | ----------- | ------- |
| PRItemId | | Guid |
| PRId | | Guid |
| ItemNo | | Integer |
| catagoriesId | | String |
| catagoriesCode | | String |
| catagoriesName | | String |
| ItemId | | String |
| ItemCode | | String |
| ItemName | | String |
| Quality | | Integer |
| Unit | | String |
#### Example Request
```json
{
"PRId": [
"000bfcb9-8218-4c39-8c24-100788b973ca",
"f3bc09ac-9bde-46c1-adfb-dfd5c0071403",
"6fb445d1-3a8d-4fa2-ad88-35605c5ae665"
]
}
```
#### Example Request
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"TotalItem": 10,
"DataList": [
{
"PRItemId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"PRId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"ItemNo":1,
"catagoriesId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"catagoriesCode":"CAT-00001",
"catagoriesName":"material",
"ItemId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"ItemCode":"ITC-001",
"ItemName":"mithril",
"Quality":99,
"Unit":"oz",
},
{
"PRItemId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"PRId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"ItemNo":1,
"catagoriesId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"catagoriesCode":"CAT-00001",
"catagoriesName":"material",
"ItemId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"ItemCode":"ITC-002",
"ItemName":"holyhalugon",
"Quality":112,
"Unit":"oz",
}
]
}
}
```
### `GET /api/v1/ECatalog/RFQ/GetVendorList`

**Body Response**
| Parameter | Description | Schema |
| --------- | ----------- | --------------- |
| TotalItem | | integer |
| DataList | | Array of object |
**DataList Response**
| Parameter | Description | Schema |
| --------- | ----------- | ------ |
| VendorId | | Guid |
| VendorName | | String |
| VendorPhone | | String |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"TotalItem": 10,
"DataList": [
{
"VendorId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"VendorName":"Yamahaaa",
"VendorPhone":"0810001001"
},
{
"VendorId":"a20309ba-e75c-4cc5-bf0b-731fd5232549",
"VendorName":"HonDiooooooooo",
"VendorPhone":"025255255"
}
]
}
}
```
### `POST /api/v1/ECatalog/RFQ/UploadAttechment`

**Formbody Request**
| Parameter | Description | Schema |
| --------- | ----------- | --------------- |
| File | | IFormFile |
**Body Response**
| Parameter | Description | Schema |
| --------- | ----------- | --------------- |
| FilePath | | String |
#### Example Request
```json
{
"File":FILE
}
```
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"FilePath": "path/to/file"
}
}
```
### `POST /api/v1/ECatalog/RFQ/Save`

**Body Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RfqId | | Guid |
| OrgId | | Guid |
| ProjectId | | Guid |
| ProjectName | | String |
| PaymentMethodType | | Integer |
| PaymentCreditDay | | Integer |
| SubDistrictId | | Integer |
| DistrictId | | Integer |
| ProvinceId | | Integer |
| PostCode | | String |
| DueDate | | Date |
| Remark | | String |
| CreateUserId | | Guid |
| PublicAuction | | Boolean |
| VendorList | | Array of object |
| ItemList | | Array of object |
| AttachmentList | | Array of String |
**VendorList Object**
| Parameter | Description | Schema |
| ------------ | ----------- | ------ |
| OrgId | | Guid |
| OrgName | | String |
| ContactName | | String |
| ContactPhone | | String |
| ContactEmail | | String |
**ItemList Object**
| Parameter | Description | Schema |
| -------------- | ----------- | ------- |
| PRItemId | | Guid |
| PRId | | String |
| PRCode | | String |
| CategoriesId | | String |
| CategoriesCode | | String |
| CategoriesName | | String |
| ItemNo | | String |
| ItemId | | String |
| ItemCode | | String |
| ItemName | | String |
| Quantity | | Integer |
| Unit | | String |
**Body Response**
| Parameter | Description | Schema |
| --------- | ----------- | ------- |
| RFQId | | Guid |
#### Example Request
```json
{
"RFQId": null,
"OrgId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"ProjectId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"ProjectName":"Test naja",
"PaymentMethodType":1,
"PaymentCreditDay":0,
"SubDistrictId":5652,
"DistrictId":356,
"ProvinceId":45,
"PostCode":10100,
"DueDate":"2021-05-19T06:11:16.3929186Z",
"Remark":"....",
"CreateUserId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"PublicAuction":false,
"VendorList":[
{
"OrgId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"OrgName":"Test 007 ltd.",
"ContactName":"Test naja",
"ContactPhone":"0822212210",
"ContactEmail":"test@email.com",
}
],
"ItemList":[
{
"PRItemId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"PRId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"PRCode":"PR-008",
"CategoriesId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"CategoriesCode":"CAT-001",
"CategoriesName":"material",
"ItemNo":1,
"ItemId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"ItemCode":"ITC-001",
"ItemName":"holyhalugon",
"Quantity":112,
"Unit":"oz",
}
],
"AttachmentList":[
"path/to/file"
]
}
```
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"RFQId" : "6fb445d1-3a8d-4fa2-ad88-35605c5ae665"
}
}
```
### `POST /api/v1/ECatalog/RFQ/Cancel`

**Body Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RFQId | | Guid |
| CancelReasons | | String |
#### Example Request
```json
{
"RFQId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"CancelReasons":"No Money",
}
```
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : true
}
```
### `POST /api/v1/ECatalog/RFQ/SendToVendor`

**Body Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RFQId | | Guid |
#### Example Request
```json
{
"RFQId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
}
```
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : true
}
```
### `GET /api/v1/ECatalog/RFQ/GetDetail/{RFQId}`

**Query parameter Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RFQId | | Guid |
**Body Response**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RfqId | | Guid |
| OrgName | | Guid |
| ProjectName | | String |
| PaymentMethodType | | Integer |
| PaymentCreditDay | | Integer |
| SubDistrictId | | Integer |
| DistrictId | | Integer |
| ProvinceId | | Integer |
| PostCode | | String |
| DueDate | | Date |
| Remark | | String |
| PublicAuction | | Boolean |
| VendorList | | Array of object |
| ItemList | | Array of object |
| AttachmentList | | Array of String |
**VendorList Object**
| Parameter | Description | Schema |
| ------------ | ----------- | ------ |
| OrgName | | String |
| ContactName | | String |
| ContactPhone | | String |
| ContactEmail | | String |
**ItemList Object**
| Parameter | Description | Schema |
| -------------- | ----------- | ------- |
| PRCode | | String |
| CategoriesCode | | String |
| CategoriesName | | String |
| ItemNo | | String |
| ItemCode | | String |
| ItemName | | String |
| Quantity | | Integer |
| Unit | | String |
#### Example Response
```json
{
"RFQId": "6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"OrgName": "Test naja ltd",
"ProjectName":"Test naja",
"PaymentMethodType":1,
"PaymentCreditDay":0,
"SubDistrictId":5652,
"DistrictId":356,
"ProvinceId":45,
"PostCode":10100,
"DueDate":"2021-05-19T06:11:16.3929186Z",
"Remark":"....",
"CreateUserId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"PublicAuction":false,
"VendorList":[
{
"OrgName":"Test 007 ltd.",
"ContactName":"Test naja",
"ContactPhone":"0822212210",
"ContactEmail":"test@email.com"
}
],
"ItemList":[
{
"PRCode":"PR-008",
"CategoriesCode":"CAT-001",
"CategoriesName":"material",
"ItemNo":1,
"ItemCode":"ITC-001",
"ItemName":"holyhalugon",
"Quantity":112,
"Unit":"oz"
}
],
"AttachmentList":[
"path/to/file"
]
}
}
```
### `GET /api/v1/ECatalog/RFQ/GetHistoryLog/{RFQId}`

**Query parameter Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RFQId | | Guid |
**Body Response**
| Parameter | Description | Schema |
| ------------ | ----------- | -------- |
| LogCount | | Integer |
| LogList | | Array of object |
**LogList Response**
| Parameter | Description | Schema |
| ------------ | ----------- | -------- |
| LogId | | Guid |
| ActionType | | Integer |
| ActionByName | | String |
| LogNote | | String |
| LogDateTime | | DateTime |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"LogCount": 3,
"LogList": [
{
"LogId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"ActionType":1,
"ActionByName":"AliceOO",
"LogNote":"...",
"LogDateTime":"2021-05-19T06:11:16.3929186Z"
}.
]
}
}
```
### `GET /api/v1/ECatalog/RFQ/GetItem/{RFQId}`

**Query parameter Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RFQId | | Guid |
**Body Response**
| Parameter | Description | Schema |
| ------------ | ----------- | -------- |
| GroupCount | | Integer |
| GroupList | | Array of object |
**GroupList Object**
| Parameter | Description | Schema |
| -------------- | ----------- | --------------- |
| CategoriesCode | | String |
| CategoriesName | | String |
| Items | | Array of object |
| ItemCount | | Integer |
**Items Object**
| Parameter | Description | Schema |
| -------------- | ----------- | ------- |
| PRCode | | String |
| ItemNo | | String |
| ItemCode | | String |
| ItemName | | String |
| Quantity | | Integer |
| Unit | | String |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"GroupCount": 3,
"GroupList": [
{
"CategoriesCode":"CAT-001",
"CategoriesName":"material",
"ItemCount": 3 ,
"Items":[
{
"PRCode":"PR-008",
"ItemNo":1,
"ItemCode":"ITC-001",
"ItemName":"holyhalugon",
"Quantity":112,
"Unit":"oz"
}
]
}
]
}
}
```
### `GET /api/v1/ECatalog/RFQ/GetQuotationVendorItem/{RFQId}`

**Query parameter Request**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| RFQId | | Guid |
**Body Response**
| Parameter | Description | Schema |
| ------------ | ----------- | -------- |
| VendorCount | | Integer |
| VendorList | | Array of object |
**VendorList Object**
| Parameter | Description | Schema |
| ----------------- | ----------- | --------------- |
| QuotationId | | Guid |
| VendorName | | String |
| PaymentMethodType | | Integer |
| ItemCount | | Integer |
| DueDate | | DateTime |
| GroupCount | | Integer |
| GroupList | | Array of object |
**GroupList Object**
| Parameter | Description | Schema |
| -------------- | ----------- | --------------- |
| CategoriesCode | | String |
| CategoriesName | | String |
| ItemVendor | | Array of object |
| ItemCount | | Integer |
**ItemVendor Object**
| Parameter | Description | Schema |
| --------- | ----------- | ------- |
| ItemId | | String |
| Price | | Integer |
| LastPrice | | Integer |
| Quantity | | Integer |
| Note | | String |
| IsLower | | String |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : {
"VendorCount": 3,
"VendorList": [
{
"QuotationId":"d106d559-5f3a-43a9-8048-3867262e0213",
"VendorName":"ADA",
"PaymentMethodType":1,
"ItemCount":1,
"DueDate":"2021-05-19T06:11:16.3929186Z",
"GroupCount":1,
"GroupList":[
{
"CategoriesCode":"CAT-001",
"CategoriesName":"material",
"ItemCount": 3 ,
"ItemVendor":[
{
"ItemId":"d106d559-5f3a-43a9-8048-3867262e0213",
"Price":99,
"LastPrice":109,
"Quantity":99,
"IsLower":false,
"Note":"....",
}
]
}
]
}
]
}
}
```
### `POST /api/v1/ECatalog/RFQ/RequestRevise`

**Body Request**
| Parameter | Description | Schema |
| ----------- | ----------- | ------------- |
| QuotationId | | Guid |
| ItemList | | Array of Guid |
| Note | | String |
#### Example Request
```json
{
"QuotationId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"Note":"...",
"ItemList" : [
"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
]
}
```
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : true
}
```
### `POST /api/v1/ECatalog/RFQ/ApproveQuotationWinner`

**Body Request**
| Parameter | Description | Schema |
| ----------- | ----------- | ------------- |
| RFQId | | Guid |
| QuotationId | | Guid |
| Reasons | | String |
#### Example Request
```json
{
"RFQId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"QuotationId":"6fb445d1-3a8d-4fa2-ad88-35605c5ae665",
"Reasons":"...",
}
```
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : true
}
```
### `GET /api/v1/ECatalog/RFQ/ExportCompareSheets/{Type}/{RFQId}`

**Query param Request**
| Parameter | Description | Schema |
| ----------- | ----------- | ------------- |
| Type | | String |
| RFQId | | Guid |
#### Example Response
```json
{
"Status":200,
"Message":"Success",
"Data" : IFormFile
}
```