{
	"info": {
		"_postman_id": "6d4032fa-9c0c-4715-88cc-196e87bbd778",
		"name": "CP API Interop",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "15606988"
	},
	"item": [
		{
			"name": "Authentication - no project",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonDataString = JSON.parse(responseBody);",
							"console.log(jsonDataString);",
							"console.log(jsonDataString.newToken);",
							"pm.environment.set(\"token\", jsonDataString.newToken);"
						],
						"type": "text/javascript"
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"let uname = pm.environment.get('username');\r",
							"let pword = pm.environment.get('password');\r",
							"let authObject = {\"Username\": uname, \"Password\": Buffer.from(pword,'utf8').toString('base64')};\r",
							"pm.environment.set(\"authInfo\", JSON.stringify(authObject));\r",
							"\r",
							"console.log(JSON.stringify(authObject));"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{{authInfo}}"
				},
				"url": {
					"raw": "{{APIURL}}/api/Account/Authenticate",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Account",
						"Authenticate"
					]
				}
			},
			"response": []
		},
		{
			"name": "GetProject",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Account/GetProjects",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Account",
						"GetProjects"
					]
				}
			},
			"response": []
		},
		{
			"name": "Authentication - project",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonDataString = JSON.parse(responseBody);",
							"console.log(jsonDataString);",
							"console.log(jsonDataString.newToken);",
							"pm.environment.set(\"token\", jsonDataString.newToken);"
						],
						"type": "text/javascript"
					}
				},
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"let uname = pm.environment.get('username');\r",
							"let pword = pm.environment.get('password');\r",
							"let projectId = pm.environment.get('projectId');\r",
							"console.log(\"ProjectId: \" + projectId);\r",
							"let authObjectWithProject = {\"Username\": uname, \"Password\": Buffer.from(pword,'utf8').toString('base64'), \"ProjectId\": projectId};\r",
							"pm.environment.set(\"authInfo\", JSON.stringify(authObjectWithProject));\r",
							"\r",
							"console.log(JSON.stringify(authObjectWithProject));"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{{authInfo}}"
				},
				"url": {
					"raw": "{{APIURL}}/api/Account/Authenticate",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Account",
						"Authenticate"
					]
				}
			},
			"response": []
		},
		{
			"name": "Change Project",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\"ProjectId\":15}"
				},
				"url": {
					"raw": "{{APIURL}}/api/Account/ChangeProject",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Account",
						"ChangeProject"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Lot Statistics - Current Project",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Lots/GetLotStats?UserId=-1&OpenLong=60&cutOffDate=2023-12-28T05:29:43.271Z",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Lots",
						"GetLotStats"
					],
					"query": [
						{
							"key": "UserId",
							"value": "-1"
						},
						{
							"key": "OpenLong",
							"value": "60"
						},
						{
							"key": "cutOffDate",
							"value": "2023-12-28T05:29:43.271Z"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Lot Statistics - Diff Project",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Lots/GetLotStats?UserId=-1&OpenLong=60&cutOffDate=2023-12-28T05:29:43.271Z&qryProjectId=27",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Lots",
						"GetLotStats"
					],
					"query": [
						{
							"key": "UserId",
							"value": "-1"
						},
						{
							"key": "OpenLong",
							"value": "60"
						},
						{
							"key": "cutOffDate",
							"value": "2023-12-28T05:29:43.271Z"
						},
						{
							"key": "qryProjectId",
							"value": "27"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get lots",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Lots?skip=0&take=20",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Lots"
					],
					"query": [
						{
							"key": "skip",
							"value": "0"
						},
						{
							"key": "take",
							"value": "20"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get lots conf",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Lots?skip=0&take=20&filter=[\"LotStatus\",\"=\",\"conformed\"]",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Lots"
					],
					"query": [
						{
							"key": "skip",
							"value": "0"
						},
						{
							"key": "take",
							"value": "20"
						},
						{
							"key": "filter",
							"value": "[\"LotStatus\",\"=\",\"conformed\"]"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get lots open",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Lots?skip=0&take=20&filter=[\"LotStatus\",\"=\",\"open\"]",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Lots"
					],
					"query": [
						{
							"key": "skip",
							"value": "0"
						},
						{
							"key": "take",
							"value": "20"
						},
						{
							"key": "filter",
							"value": "[\"LotStatus\",\"=\",\"open\"]"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get itpdetails",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/LotItpDetails?skip=0&take=20&filter=[\"LotItpId\",\"=\",1]",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"LotItpDetails"
					],
					"query": [
						{
							"key": "skip",
							"value": "0"
						},
						{
							"key": "take",
							"value": "20"
						},
						{
							"key": "filter",
							"value": "[\"LotItpId\",\"=\",1]"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Get lots diff project",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{APIURL}}/api/Lots?skip=0&take=20&qryProjectId=27",
					"host": [
						"{{APIURL}}"
					],
					"path": [
						"api",
						"Lots"
					],
					"query": [
						{
							"key": "skip",
							"value": "0"
						},
						{
							"key": "take",
							"value": "20"
						},
						{
							"key": "qryProjectId",
							"value": "27"
						}
					]
				}
			},
			"response": []
		}
	]
}