# TQM API Document
## Approve API
### `Get /Approve/GetFilter`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require) | AccessToken | string |
**Parameter**
| Name | Description | Schema |
| -------- | -------- | -------- |
| staffId (require) | user id for filter | int |
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "string",
"errors": [
"string"
],
"responseObject": {
"dataApproveType": [
{
"id": "0",
"title": "string"
}
],
"dataDateType": [
{
"id": "0",
"title": "string"
}
],
"dataAction": [
{
"id": "0",
"title": "string"
}
],
"dataRegion": [
{
"id": "0",
"title": "string"
}
],
"dataArea": [
{
"id": "0",
"regionId": "string",
"title": "string"
}
],
"dataBranch": [
{
"id": "0",
"areaId": "string",
"title": "string"
}
],
"dataPreiod": [
{
"id": "0",
"title": "string",
"startDate": "2023-11-16T04:23:51.6063779Z",
"endDate": "2023-11-30T04:23:51.6063779Z",
}
],
}
}
```
### `Post Approve/List`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require) | AccessToken | string |
**Body**
| Name | Description | Schema |
| -------- | -------- | -------- |
| approveType (require) | approve เรื่องอะไร | int |
| dateType (require) | date เรื่องอะไร (วันกิดเอกสาร) | int |
| startDate (require) | start date | datetime |
| endDate (require) | end date | datetime |
| regionId (optional) | region for filter | string |
| areaId (optional) | area for filter | string |
| page (require) | initial 1 | int |
| size (require) | | int |
#### Example Request
```json
{
"approveType": 0,
"dateType": 0,
"startDate": "2023-10-20T04:23:51.6063779Z",
"endDate": "2023-10-20T04:23:51.6063779Z",
"regionId": "N2",
"areaId": "NLK",
"page": 1,
"size": 10
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "string",
"errors": [
"string"
],
"responseObject": {
"dataBatch": [
{
"region": "N",
"area": null,
"brach": null,
"batchAmout": 580,
"batchStatus": 1,
"batch": [
{
"batchId": 166,
"batchName": "รายงานสรุปภาค N วันที่ 21-11-2023",
"batchAmount": 340,
"batchEmployee": 10,
"region": "N",
"area": null,
"branch": null,
"batchType": 1,
"batchStatus": 4,
"batchRank": 1,
"remark": null,
"batchCode": "B-21112023-166"
},
{
"batchId": 169,
"batchName": "รายงานสรุปภาค N วันที่ 21-11-2023",
"batchAmount": 240,
"batchEmployee": 10,
"region": "N",
"area": null,
"branch": null,
"batchType": 1,
"batchStatus": 1,
"batchRank": 1,
"remark": null,
"batchCode": "B-21112023-169"
}
]
},
{
"region": "S",
"area": null,
"brach": null,
"batchAmout": 500000,
"batchStatus": 2,
"batch": [
{
"batchId": 176,
"batchName": "รายงานสรุปภาค S วันที่ 21-11-2023",
"batchAmount": 200000,
"batchEmployee": 10,
"region": "S",
"area": null,
"branch": null,
"batchType": 1,
"batchStatus": 2,
"batchRank": 1,
"remark": null,
"batchCode": "B-11122023"
},
{
"batchId": 177,
"batchName": "รายงานสรุปภาค S วันที่ 21-11-2023",
"batchAmount": 300000,
"batchEmployee": 10,
"region": "S",
"area": "S3",
"branch": null,
"batchType": 1,
"batchStatus": 2,
"batchRank": 1,
"remark": null,
"batchCode": "B-11122023"
}
]
}
],
"batchRank": 1
}
}
```
### `Post Approve/ApproveOrReject`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Body**
| Name | Description | Schema |
| -------- | -------- | -------- |
| actionType (require) | approve/reject/send | int |
| batchType (require) | messenger | int |
| staffId (require) | StaffId actor | int |
| batchId (optional) | list batch | array int |
#### Example Request
```json
{
"actionType": 1,//approve = 2/send = 4
"batchType": 1,//messenger = 1
"staffId": 0,
"batchId": [0,1,2,3,4,5,6],
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "string",
"errors": [
"string"
],
"responseObject": {
"batchId": 0,
"batchName": "string"
}
}
```
### `Get Approve/GetRole`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Parameter**
| Name | Description | Schema |
| -------- | -------- | -------- |
| staffId (require) | user id for filter | int |
| batchId (optional) | batchType for filter | int |
| approveType (require) | type messenger = 1 | int |
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "string",
"errors": [
"string"
],
"responseObject": {
"isBranch": true,//boolean
"batchRank": 4,//HQ = 1, REGION = 2, AREA = 3, BRANCH = 4
"batchRankName": "ฺBRANCH",
"staffRole": 1,//HQ = 1, REGION = 2, AREA = 3, BRANCH = 4
"staffRoleName": "HQ"
}
}
```
### `Get Approve/Detail`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Parameter**
| Name | Description | Schema |
| -------- | -------- | -------- |
| staffId (require) | user id for filter | int |
| batchId (require) | batch id for filter | int |
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "string",
"errors": [
"string"
],
"responseObject": {
"batchId": 1200,
"batchName": "name",
"batchAmount": 54000.55,
"batchDate": "2023-10-20T04:23:51.6063779Z",
"batchStatus": 1,// Wait = 1, Approve = 2, Reject = 3, Send = 4
"batchItem": [
{
"batchId": 123,
"batchName": "name",
"batchAmount": 54000.55,
"batchDate": "2023-10-20T04:23:51.6063779Z",
"batchStatus": 1,// Wait = 1, Approve = 2, Reject = 3, Send = 4
"batchRank": 4,//HQ = 1, REGION = 2, AREA = 3, BRANCH = 4
"batchType": 1 //MESSENGER = 1
"sender": 1254,
"branchCode": "BKK",
"area": "CUU",
"region": "CU",
"batchCode": "B-000-5554",
"batchParentId": 5554
},
{
"batchId": 123,
"batchName": "name",
"batchAmount": 54000.55,
"batchDate": "2023-10-20T04:23:51.6063779Z",
"batchStatus": 1,// Wait = 1, Approve = 2, Reject = 3, Send = 4
"batchRank": 4,//HQ = 1, REGION = 2, AREA = 3, BRANCH = 4
"batchType": 1 //MESSENGER = 1
"sender": 1254,
"branchCode": "BKK",
"area": "CUU",
"region": "CU",
"batchCode": "B-000-5554",
"batchParentId": 5554
},
]
}
}
```
### `Post Approve/BranchList`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
#### Example Request
```json
{
"request": {
"routeType": 2, //fixed 2
"dateType": "1",//fixed 1
"startDate": "2021-11-17",//filter date
"endDate": "2021-11-17",//filter date
"productType": "ALL",//fixed ALL
"area": null,//ใส่ null เพราะเราสนใจแค่ branchcode
"branchCode": "CBR",
"staffId": 6444
}
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "Success",
"errors": [],
"responseObject": {
"jobDateFrom": "17-11-2021",
"jobDateTo": "17-11-2021",
"dataBranch": [
{
"batchId": 41,
"batchName": "รายงานนัดหมายการส่งงานและคำนวณรายได้พนักงานประจำวันที่ 07-11-2023",
"batchType": 3,
"status": 2,
"approver": 0,
"batchAmount": 0,
"batchCode": "B-000-5554",
"batchParentId"5554,
"routeId": null,
"routeGroup": "CBR",
"route": "CBR:ชลบุรี",
"jobDate": "2021-11-17T00:00:00",
"manageUserId": 76113,
"manageUser": "ศิริพร พ้นทุกข์(CBR)",
"jobUserId": 23661,
"jobUsername": "รุจิวัย วิถีธรรมศักดิ์ CBR",
"sumJob": 9,
"sumSuccess": 8,
"sumUnSuccess": 1,
"sumAmountSalePayment": 58792.71,
"sumAmountAllInOne": 30322.97,
"sumAmountReceive": 29769.03,
"managerCheck": "",
"managerApprove": "",
"affiliation": "รับชิ้นงาน",
"jobId": 5735702
},
{
"batchId": 42,
"batchName": "รายงานนัดหมายการส่งงานและคำนวณรายได้พนักงานประจำวันที่ 07-11-2023",
"batchType": 3,
"status": 2,
"approver": 0,
"batchAmount": 0,
"batchCode": "B-000-5554",
"batchParentId": 5554,
"routeId": null,
"routeGroup": "CBR",
"route": "CBR:ชลบุรี",
"jobDate": "2021-11-17T00:00:00",
"manageUserId": 76113,
"manageUser": "ศิริพร พ้นทุกข์(CBR)",
"jobUserId": 23661,
"jobUsername": "รุจิวัย วิถีธรรมศักดิ์ CBR",
"sumJob": 9,
"sumSuccess": 8,
"sumUnSuccess": 1,
"sumAmountSalePayment": 58792.71,
"sumAmountAllInOne": 30322.97,
"sumAmountReceive": 29769.03,
"managerCheck": "",
"managerApprove": "",
"affiliation": "รับชิ้นงาน",
"jobId": 5735702
}
]
}
}
```
### `Get Approve/HistoryRemark`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**parameter**
| Name | Description | Schema |
| -------- | -------- | -------- |
| branchCode (require) | | string |
| batchDate (require) | | datetime |
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "Success",
"errors": [],
"responseObject": [
{
"remarkType": 100,
"remark": "แก้ไขให้ถูกต้อง",
"staffId": 5541,
"staffName": "นาย .....",
"remarkDate": "2021-11-17T00:00:00",
"batchDate": "2021-11-17T00:00:00",
"branchName": "น่าน",
"branchCode": "NAN",
"rejectBy": "นาย.... ",
"rejectStaffId": 55547
},
{
"remarkType": 100,
"remark": "แก้ไขให้ถูกต้อง",
"staffId": 5541,
"staffName": "นาย .....",
"remarkDate": "2021-11-17T00:00:00",
"batchDate": "2021-11-17T00:00:00",
"branchName": "น่าน",
"branchCode": "NAN",
"rejectBy": "นาย.... ",
"rejectStaffId": 55547
}
]
}
```
### `Post Approve/Remark`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Body**
| Name | Description | Schema |
| -------- | -------- | -------- |
| branchCode (require) | branch code | string |
| rejectMessage (require) | message | string |
| rejectDate (require) | batch date | datetime |
| staffId (require) | id staff (remarker) | int |
| jobUserId (require) | id staff (messenger) | int |
| issueType (require) | type issue | int |
| jobId (require) | list int | array (int) |
#### Example Request
```json
{
"request": {
"branchCode": "string",
"rejectMessage": "string",
"rejectDate": "2024-01-18T02:55:44.550Z",
"staffId": 0,
"jobUserId": 0,
"issueType": 0,
"jobId": [
0
]
}
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "Success",
"errors": [],
"responseObject": true
}
```
### `Post Approve/ListBranches`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Body**
| Name | Description | Schema |
| -------- | -------- | -------- |
| period (optional) | ex 2024-02-2 | string |
| startDate (require) | startdate | datetime |
| endDate (require) | enddate | datetime |
| staffId (require) | id staff (remarker) | int |
#### Example Request
```json
{
"request": {
"staffId": 0,
"period": "2024-02-2",
"startDate": "2024-02-16T08:34:19.771Z",
"endDate": "2024-02-16T08:34:19.771Z"
}
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "Success",
"errors": [],
"responseObject": [
{
"branchCode": "AYT",
"branch": "AYT:พระนครศรีอยุธยา",
"staffCounts": 0,
"point": 0,
"batchId": 123321,
"listBatchId": [2212]
},
]
}
```
### `Post Approve/ListBranchHQ`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Body**
| Name | Description | Schema |
| -------- | -------- | -------- |
| period (optional) | ex 2024-02-2 | string |
| startDate (require) | startdate | datetime |
| endDate (require) | enddate | datetime |
| staffId (require) | id staff (remarker) | int |
#### Example Request
```json
{
"request": {
"staffId": 0,
"period": null,
"startDate": "2024-02-16T08:34:19.771Z",
"endDate": "2024-02-16T08:34:19.771Z"
}
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "Success",
"errors": [],
"responseObject": [
{
"branchBatchId": 0,
"branchStatus": 0,
"branchDate": null,
"areaBatchId": 0,
"area": "MU1",
"areaStatus": 0,
"areaDate": null,
"regionBatchId": 0,
"region": "MU",
"regionStatus": 0,
"regionDate": null,
"branchCode": "AYT",
"branch": "AYT:พระนครศรีอยุธยา",
"staffCounts": 0,
"point": 0,
"batchId": null,
"listBatchId": [2221]
},
]
}
```
### `Post Approve/GetRemarkdate`
**Header**
| Name | Description | Schema |
| -------- | -------- | -------- |
| Authorization (require)| AccessToken | string |
**Body**
| Name | Description | Schema |
| -------- | -------- | -------- |
| branchCode (require) | ex LBR | string |
| startDate (require) | startdate | datetime |
| endDate (require) | enddate | datetime |
| staffId (require) | id staff (remarker) | int |
#### Example Request
```json
{
"request": {
"startDate": "2024-03-21T07:51:49.095Z",
"endDate": "2024-03-21T07:51:49.095Z",
"staffId": 0,
"branchCode": "string"
}
}
```
#### Example Response
```json
{
"id": 0,
"success": true,
"message": "Success",
"errors": [],
"responseObject": [
"2024-03-21T00:00:00Z",
"2024-03-20T00:00:00Z"
]
}
```