{
	"info": {
		"_postman_id": "21821360-85f1-4219-bc02-5d4c09bb9de9",
		"name": "CSG Integration API Tests - W1 2024",
		"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
		"_exporter_id": "3052964"
	},
	"item": [
		{
			"name": "auth",
			"item": [
				{
					"name": "Auth",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"const r = pm.response.json();",
									"pm.globals.set(\"token\", r.accessToken,);",
									"//pm.globals.set(\"baseUrl\",\"https://integration-api-rest.s000000.poc.eu1.platform.overit.cloud/integration-api-rest/api\")",
									"",
									"/**",
									"var url =  pm.request.url.toString();",
									"const pos = url.lastIndexOf(\"/api/\");",
									"url = url.substr(0, Number.parseInt(pos));",
									"url = url.concat(\"/api/core/r4\");",
									"pm.environment.set(\"contextPath\",url);",
									"*/",
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript",
								"packages": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disabledSystemHeaders": {}
					},
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"username\": \"RT@wfm\",\n  \"password\": \"RT\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": "{{host}}/api/configurations/identity/r1/tokens"
					},
					"response": []
				}
			]
		},
		{
			"name": "WorkOrder",
			"item": [
				{
					"name": "WorkOrder",
					"item": [
						{
							"name": "get",
							"item": [
								{
									"name": "WorkOrder get - simple with code",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders?code=170504429185700051&externalSystemCode=SAP",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"work-orders",
												"r1",
												"work-orders"
											],
											"query": [
												{
													"key": "code",
													"value": "170504429185700051"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "WorkOrder get - simple with fields filter",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'address'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('address');",
													"});",
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders?code=170504429185700047&externalSystemCode=SAP&_fields=address",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"work-orders",
												"r1",
												"work-orders"
											],
											"query": [
												{
													"key": "code",
													"value": "170504429185700047"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "_fields",
													"value": "address"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "WorkOrder get - simple with fields filter nested",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'address'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('address');",
													"});",
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders?code=170504429185700047&externalSystemCode=SAP&_fields=id,address.countryIsoAlphaCode,operationCenter.description",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"work-orders",
												"r1",
												"work-orders"
											],
											"query": [
												{
													"key": "code",
													"value": "170504429185700047"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "_fields",
													"value": "id,address.countryIsoAlphaCode,operationCenter.description"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "WorkOrder get - simple with externalCode",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders?externalCode=TEST_WO_AC_20243118325846&externalSystemCode=SAP",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"work-orders",
												"r1",
												"work-orders"
											],
											"query": [
												{
													"key": "externalCode",
													"value": "TEST_WO_AC_20243118325846"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "WorkOrder get - simple with externalCode and typeCode",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders?externalCode=TEST_WO_AC_20243118325846&externalSystemCode=SAP&typeCode=1708510864133",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"work-orders",
												"r1",
												"work-orders"
											],
											"query": [
												{
													"key": "externalCode",
													"value": "TEST_WO_AC_20243118325846"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "typeCode",
													"value": "1708510864133"
												}
											]
										}
									},
									"response": []
								}
							]
						},
						{
							"name": "create",
							"item": [
								{
									"name": "With Account creation",
									"item": [
										{
											"name": "WorkOrder creationwithaccount - OK - AGGREGATED simple create",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);",
															"",
															"const accountCodeGenerator = \"test_account_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"accountCodeGenerator\",accountCodeGenerator);",
															"",
															"const serialNumber1 = \"sn1_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"",
															"pm.collectionVariables.set(\"serialNumber1\",serialNumber1);",
															"",
															"const serialNumber2 = \"sn2_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"",
															"pm.collectionVariables.set(\"serialNumber2\",serialNumber2);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 201\", function () {",
															"  pm.expect(pm.response.code).to.equal(201);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'id'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('id');",
															"});",
															"",
															"",
															"pm.test(\"Id is a non-zero integer\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
															"  pm.expect(responseData.id).to.be.above(0);",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"string\"\n    },\n    \"operations\": [\n        {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ],\n    \"account\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": \"{{accountCodeGenerator}}\",\n        \"typeCode\": \"1711382128688\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"description\": \"asdfasdf\",\n        \"fiscalCode\": \"23423fg\",\n        \"note\": \"asdffdsfdssa\",\n        \"birthDate\": \"2024-03-28T15:01:22.494Z\",\n        \"phoneNumberCode\": \"333556676\",\n        \"phoneNumberContact\": \"gigi\"\n    },\n    \"address\": {\n        \"countryIsoAlphaCode\": \"IT\",\n        \"districtAcronym\": \"UD\",\n        \"municipality\": \"UDINE\",\n        \"municipalityCode\": \"UD\",\n        \"locality\": \"UDINE\",\n        \"postalCode\": \"33100\",\n        \"toponym\": \"string\",\n        \"street\": \"VIA PUINTAT\",\n        \"streetNumber\": 2,\n        \"streetNumberExtension\": \"A\",\n        \"floor\": \"1\",\n        \"lot\": \"2\",\n        \"staircase\": \"string\",\n        \"apartment\": \"string\",\n        \"directions\": \"string\",\n        \"description\": \"desccc\",\n        \"yCoordinate\": 46.0948035,\n        \"xCoordinate\": 13.2298188\n    },\n    \"contacts\": [\n        {\n            \"typeCode\": \"EMAIL\",\n            \"code\": \"aaa@test.it\",\n            \"contact\": \"aaa\"\n        }\n    ],\n    \"meters\": [\n        {\n            \"typeCode\": \"T1\",\n            \"brandCode\": \"WB\",\n            \"locationCode\": \"1705048811158\",\n            \"classCode\": \"1705252270484\",\n            \"productionYear\": \"2023\",\n            \"serialNumber\": \"{{serialNumber1}}\",\n            \"digitNumber\": 0,\n            \"acronym\": \"string\",\n            \"note\": \"string\",\n            \"minReading\": 0,\n            \"maxReading\": 0,\n            \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n            \"lastReading\": 0,\n            \"active\": true\n        },\n        {\n            \"typeCode\": \"2\",\n            \"brandCode\": \"WB\",\n            \"locationCode\": \"1705048811158\",\n            \"classCode\": \"1705252270484\",\n            \"productionYear\": \"2023\",\n            \"serialNumber\": \"{{serialNumber2}}\",\n            \"digitNumber\": 0,\n            \"acronym\": \"string\",\n            \"note\": \"string\",\n            \"minReading\": 0,\n            \"maxReading\": 0,\n            \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n            \"lastReading\": 0,\n            \"active\": true\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creationwithaccount - KO - account and asset present at same time",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);",
															"",
															"const accountCodeGenerator = \"test_account_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"accountCodeGenerator\",accountCodeGenerator);",
															"",
															"const serialNumber1 = \"sn1_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"",
															"pm.collectionVariables.set(\"serialNumber1\",serialNumber1);",
															"",
															"const serialNumber2 = \"sn2_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"",
															"pm.collectionVariables.set(\"serialNumber2\",serialNumber2);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail as message: Unexpected presence of account.code and asset.code at the same time\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Unexpected presence of account.code and asset.code at the same time');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"string\"\n    },\n    \"operations\": [\n        {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ],\n    \"asset\": {\n        \"code\": \"asdfasd\"\n    },\n    \"account\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": \"{{accountCodeGenerator}}\",\n        \"typeCode\": \"1711382128688\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"description\": \"asdfasdf\",\n        \"fiscalCode\": \"23423fg\",\n        \"note\": \"asdffdsfdssa\",\n        \"birthDate\": \"2024-03-28T15:01:22.494Z\",\n        \"phoneNumberCode\": \"333556676\",\n        \"phoneNumberContact\": \"gigi\"\n    },\n    \"address\": {\n        \"countryIsoAlphaCode\": \"IT\",\n        \"districtAcronym\": \"UD\",\n        \"municipality\": \"UDINE\",\n        \"municipalityCode\": \"UD\",\n        \"locality\": \"UDINE\",\n        \"postalCode\": \"33100\",\n        \"toponym\": \"string\",\n        \"street\": \"VIA PUINTAT\",\n        \"streetNumber\": 2,\n        \"streetNumberExtension\": \"A\",\n        \"floor\": \"1\",\n        \"lot\": \"2\",\n        \"staircase\": \"string\",\n        \"apartment\": \"string\",\n        \"directions\": \"string\",\n        \"description\": \"desccc\",\n        \"yCoordinate\": 46.0948035,\n        \"xCoordinate\": 13.2298188\n    },\n    \"contacts\": [\n        {\n            \"typeCode\": \"EMAIL\",\n            \"code\": \"aaa@test.it\",\n            \"contact\": \"aaa\"\n        }\n    ],\n    \"meters\": [\n        {\n            \"typeCode\": \"T1\",\n            \"brandCode\": \"WB\",\n            \"locationCode\": \"1705048811158\",\n            \"classCode\": \"1705252270484\",\n            \"productionYear\": \"2023\",\n            \"serialNumber\": \"{{serialNumber1}}\",\n            \"digitNumber\": 0,\n            \"acronym\": \"string\",\n            \"note\": \"string\",\n            \"minReading\": 0,\n            \"maxReading\": 0,\n            \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n            \"lastReading\": 0,\n            \"active\": true\n        },\n        {\n            \"typeCode\": \"2\",\n            \"brandCode\": \"WB\",\n            \"locationCode\": \"1705048811158\",\n            \"classCode\": \"1705252270484\",\n            \"productionYear\": \"2023\",\n            \"serialNumber\": \"{{serialNumber2}}\",\n            \"digitNumber\": 0,\n            \"acronym\": \"string\",\n            \"note\": \"string\",\n            \"minReading\": 0,\n            \"maxReading\": 0,\n            \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n            \"lastReading\": 0,\n            \"active\": true\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										}
									]
								},
								{
									"name": "By Asset",
									"item": [
										{
											"name": "WorkOrder creation by asset - OK - AGGREGATED simple create",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 201\", function () {",
															"  pm.expect(pm.response.code).to.equal(201);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'id'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('id');",
															"});",
															"",
															"",
															"pm.test(\"Id is a non-zero integer\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
															"  pm.expect(responseData.id).to.be.above(0);",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"string\"\n    },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n    \"operations\": [\n        {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by asset - OK - DISTINCT simple create",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 201\", function () {",
															"  pm.expect(pm.response.code).to.equal(201);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'id'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('id');",
															"});",
															"",
															"",
															"pm.test(\"Id is a non-zero integer\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
															"  pm.expect(responseData.id).to.be.above(0);",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by asset - OK - DISTINCT simple create with multiple operations",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator1 = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator1\",operationCodeGenerator1);",
															"",
															"const operationCodeGenerator2 = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator2\",operationCodeGenerator2);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 201\", function () {",
															"  pm.expect(pm.response.code).to.equal(201);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'id'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('id');",
															"});",
															"",
															"",
															"pm.test(\"Id is a non-zero integer\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
															"  pm.expect(responseData.id).to.be.above(0);",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator1}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        },\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 1,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator2}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by asset - KO - DISTINCT when woa existing",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Work Order creation denied because Work Order code TEST_WO_AC_202435104159545 is already been used with the external system SAP');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"TEST_WO_AC_202435104159545\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by asset - KO - DISTINCT execution order repeted",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Execution order 0 repeated in more than one Work Order operation');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        },\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by asset - KO - AGGREGATED and cardinality missing",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() + nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail as message: Missing cardinality code in Work Order header\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Missing cardinality code in Work Order header');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n\"workOrder\": {\n    \"externalSystemCode\": \"SAP\",\n    \"externalCode\": \"{{externalCodeGenerator}}\",\n    \"typeCode\": \"1708510864133\",\n    \"urgencyCode\": \"1704904707425\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"workCenterCode\": \"string\",\n    \"startDate\": \"2024-04-08T14:46:17.605Z\",\n    \"endDate\": \"2024-05-08T14:46:17.605Z\",\n    \"description\": \"string\",\n    \"operationsAssignment\": \"AGGREGATED\",\n    \"aggregateDuration\": 1,\n    \"aggregateResidualDuration\": 10,\n    \"notes\": \"string\"\n  },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n  \"operations\": [\n    {\n      \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n      \"defaultDuration\": 0,\n      \"executionOrder\": 0,\n      \"description\": \"descddd\",\n      \"currentDuration\": 0,\n      \"code\": \"test_op_202404081647\",\n      \"startDate\": \"2024-04-08T13:48:37.527Z\",\n      \"endDate\": \"2024-04-08T13:48:37.527Z\",\n      \"note\": \"notesss\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by asset - KO - DISTINC and cardinality missing",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() + nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail as message: Missing cardinality code in one or more Work Order operations\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Missing cardinality code in one or more Work Order operations');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n\"workOrder\": {\n    \"externalSystemCode\": \"SAP\",\n    \"externalCode\": \"{{externalCodeGenerator}}\",\n    \"typeCode\": \"1708510864133\",\n    \"urgencyCode\": \"1704904707425\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"workCenterCode\": \"string\",\n    \"startDate\": \"2024-04-08T14:46:17.605Z\",\n    \"endDate\": \"2024-05-08T14:46:17.605Z\",\n    \"description\": \"string\",\n    \"operationsAssignment\": \"DISTINCT\",\n    \"aggregateDuration\": 1,\n    \"aggregateResidualDuration\": 10,\n    \"notes\": \"string\"\n  },\n    \"asset\": {\n        \"code\": \"1711016432380\"\n    },\n  \"operations\": [\n    {\n      \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n      \"defaultDuration\": 0,\n      \"executionOrder\": 0,\n      \"description\": \"descddd\",\n      \"currentDuration\": 0,\n      \"code\": \"test_op_202404081647\",\n      \"startDate\": \"2024-04-08T13:48:37.527Z\",\n      \"endDate\": \"2024-04-08T13:48:37.527Z\",\n      \"note\": \"notesss\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										}
									]
								},
								{
									"name": "By Account",
									"item": [
										{
											"name": "WorkOrder creation by account - OK - AGGREGATED simple create",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 201\", function () {",
															"  pm.expect(pm.response.code).to.equal(201);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'id'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('id');",
															"});",
															"",
															"",
															"pm.test(\"Id is a non-zero integer\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
															"  pm.expect(responseData.id).to.be.above(0);",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"string\"\n    },\n    \"account\": {\n        \"code\": \"test20240328_5\"\n    },\n    \"operations\": [\n        {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by account - OK - DISTINCT simple create",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 201\", function () {",
															"  pm.expect(pm.response.code).to.equal(201);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'id'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('id');",
															"});",
															"",
															"",
															"pm.test(\"Id is a non-zero integer\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
															"  pm.expect(responseData.id).to.be.above(0);",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"account\": {\n        \"code\": \"test20240328_5\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by account - KO - DISTINCT when woa existing",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Work Order creation denied because Work Order code TEST_WO_AC_202431172053977 is already been used with the external system SAP');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"TEST_WO_AC_202431172053977\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"account\": {\n        \"code\": \"test20240328_5\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by account - KO - DISTINCT execution order repeted",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() ;",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Execution order 0 repeated in more than one Work Order operation');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"externalCode\": \"{{externalCodeGenerator}}\",\n        \"typeCode\": \"1708510864133\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"DISTINCT\",\n        \"notes\": \"string\"\n    },\n    \"account\": {\n        \"code\": \"test20240328_5\"\n    },\n    \"operations\": [\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        },\n        {\n            \"cardinalityCode\": \"1\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"{{operationCodeGenerator}}\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"notesss\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by account - KO - AGGREGATED and cardinality missing",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() + nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail as message: Missing cardinality code in Work Order header\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Missing cardinality code in Work Order header');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n\"workOrder\": {\n    \"externalSystemCode\": \"SAP\",\n    \"externalCode\": \"{{externalCodeGenerator}}\",\n    \"typeCode\": \"1708510864133\",\n    \"urgencyCode\": \"1704904707425\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"workCenterCode\": \"string\",\n    \"startDate\": \"2024-04-08T14:46:17.605Z\",\n    \"endDate\": \"2024-05-08T14:46:17.605Z\",\n    \"description\": \"string\",\n    \"operationsAssignment\": \"AGGREGATED\",\n    \"aggregateDuration\": 1,\n    \"aggregateResidualDuration\": 10,\n    \"notes\": \"string\"\n  },\n    \"account\": {\n        \"code\": \"test20240328_5\"\n    },\n  \"operations\": [\n    {\n      \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n      \"defaultDuration\": 0,\n      \"executionOrder\": 0,\n      \"description\": \"descddd\",\n      \"currentDuration\": 0,\n      \"code\": \"test_op_202404081647\",\n      \"startDate\": \"2024-04-08T13:48:37.527Z\",\n      \"endDate\": \"2024-04-08T13:48:37.527Z\",\n      \"note\": \"notesss\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder creation by account - KO - DISTINC and cardinality missing",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const externalCodeGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"externalCodeGenerator\",externalCodeGenerator);",
															"",
															"const operationCodeGenerator = \"test_op_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString() + nowDT.getSeconds().toString() + nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"operationCodeGenerator\",operationCodeGenerator);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail as message: Missing cardinality code in one or more Work Order operations\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Missing cardinality code in one or more Work Order operations');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n\"workOrder\": {\n    \"externalSystemCode\": \"SAP\",\n    \"externalCode\": \"{{externalCodeGenerator}}\",\n    \"typeCode\": \"1708510864133\",\n    \"urgencyCode\": \"1704904707425\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"workCenterCode\": \"string\",\n    \"startDate\": \"2024-04-08T14:46:17.605Z\",\n    \"endDate\": \"2024-05-08T14:46:17.605Z\",\n    \"description\": \"string\",\n    \"operationsAssignment\": \"DISTINCT\",\n    \"aggregateDuration\": 1,\n    \"aggregateResidualDuration\": 10,\n    \"notes\": \"string\"\n  },\n    \"account\": {\n        \"code\": \"test20240328_5\"\n    },\n  \"operations\": [\n    {\n      \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n      \"defaultDuration\": 0,\n      \"executionOrder\": 0,\n      \"description\": \"descddd\",\n      \"currentDuration\": 0,\n      \"code\": \"test_op_202404081647\",\n      \"startDate\": \"2024-04-08T13:48:37.527Z\",\n      \"endDate\": \"2024-04-08T13:48:37.527Z\",\n      \"note\": \"notesss\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										}
									]
								}
							]
						},
						{
							"name": "update",
							"item": [
								{
									"name": "By Asset",
									"item": [
										{
											"name": "WorkOrder update by asset - simple update",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const updatedNotes = \"notes_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"updatedNotes\",updatedNotes);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test('Response status code is 204', function () {",
															"    pm.expect(pm.response.code).to.equal(204);",
															"})",
															"",
															"",
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "PATCH",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": 170504429185700049,\n        \"typeCode\": \"1708510864133\",\n        \"customerCode\": \"test20240328_5\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"{{updatedNotes}}\"\n    },\n    \"operations\": [\n        {\n            \"assetCode\": \"1711016432380\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291857\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder update by asset - update with operations creation",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const updatedNotes = \"notes_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"updatedNotes\",updatedNotes);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test('Response status code is 204', function () {",
															"    pm.expect(pm.response.code).to.equal(204);",
															"})",
															"",
															"",
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "PATCH",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": 170504429185700051,\n        \"typeCode\": \"1708510864133\",\n        \"customerCode\": \"test20240328_5\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"{{updatedNotes}}\"\n    },\n    \"operations\": [\n        {\n            \"assetCode\": \"1711016432380\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291857\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        },\n         {\n            \"assetCode\": \"1711016432380\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 1,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291859\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										}
									]
								},
								{
									"name": "By Account",
									"item": [
										{
											"name": "WorkOrder update by account - simple update",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const updatedNotes = \"notes_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"updatedNotes\",updatedNotes);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test('Response status code is 204', function () {",
															"    pm.expect(pm.response.code).to.equal(204);",
															"})",
															"",
															"",
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "PATCH",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": 170504429185700047,\n        \"typeCode\": \"1708510864133\",\n        \"customerCode\": \"test20240328_5\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"{{updatedNotes}}\"\n    },\n    \"operations\": [\n        {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291857\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										},
										{
											"name": "WorkOrder update by account - update with operations creation",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const updatedNotes = \"notes_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"updatedNotes\",updatedNotes);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test('Response status code is 204', function () {",
															"    pm.expect(pm.response.code).to.equal(204);",
															"})",
															"",
															"",
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "PATCH",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": 170504429185700048,\n        \"typeCode\": \"1708510864133\",\n        \"customerCode\": \"test20240328_5\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"{{updatedNotes}}\"\n    },\n    \"operations\": [\n        {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291857\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        },\n         {\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 1,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291859\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										}
									]
								},
								{
									"name": "Error Case",
									"item": [
										{
											"name": "WorkOrder update - asset and account code present at same time",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const updatedNotes = \"notes_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
															"pm.collectionVariables.set(\"updatedNotes\",updatedNotes);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"  pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail as message: Unexpected presence of account.code and asset.code at the same time\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Unexpected presence of account.code and asset.code at the same time');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "PATCH",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"workOrder\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": 170504429185700048,\n        \"typeCode\": \"1708510864133\",\n        \"customerCode\": \"test20240328_5\",\n        \"urgencyCode\": \"1704904707425\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"workCenterCode\": \"string\",\n        \"aggregateCardinalityCode\": \"1\",\n        \"startDate\": \"2024-04-08T14:46:17.605Z\",\n        \"endDate\": \"2024-05-08T14:46:17.605Z\",\n        \"description\": \"string\",\n        \"operationsAssignment\": \"AGGREGATED\",\n        \"aggregateDuration\": 1,\n        \"aggregateResidualDuration\": 10,\n        \"notes\": \"{{updatedNotes}}\"\n    },\n    \"operations\": [\n        {\n            \"assetCode\": \"1711016432380\",\n            \"accountCode\": \"1711016432380\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 0,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291857\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        },\n         {\n            \"assetCode\": \"1711016432380\",\n            \"typeCode\": \"GEN-INT-HYDR-EPOM\",\n            \"defaultDuration\": 0,\n            \"executionOrder\": 1,\n            \"description\": \"descddd\",\n            \"currentDuration\": 0,\n            \"code\": \"1705044291859\",\n            \"startDate\": \"2024-04-08T13:48:37.527Z\",\n            \"endDate\": \"2024-04-08T13:48:37.527Z\",\n            \"note\": \"{{updatedNotes}}\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/work-orders/r1/work-orders"
											},
											"response": []
										}
									]
								}
							]
						}
					]
				}
			]
		},
		{
			"name": "Configurations",
			"item": [
				{
					"name": "asset",
					"item": [
						{
							"name": "characteristics",
							"item": [
								{
									"name": "type",
									"item": [
										{
											"name": "upsert",
											"item": [
												{
													"name": "UpsertCharacteristicsType - Update",
													"event": [
														{
															"listen": "prerequest",
															"script": {
																"exec": [
																	"var nowDT = new Date(Date.now());",
																	"const valueGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
																	"pm.collectionVariables.set(\"valueGenerator\",valueGenerator);"
																],
																"type": "text/javascript",
																"packages": {}
															}
														},
														{
															"listen": "test",
															"script": {
																"exec": [
																	"pm.test('Response status code is 204', function () {",
																	"    pm.expect(pm.response.code).to.equal(204);",
																	"})"
																],
																"type": "text/javascript",
																"packages": {}
															}
														}
													],
													"request": {
														"method": "POST",
														"header": [],
														"body": {
															"mode": "raw",
															"raw": "{\n  \"characteristics\": [\n    {\n      \"classCode\": \"GENE\",\n      \"code\": \"BRAND\",\n      \"value\": \"{{valueGenerator}}\",\n      \"mandatory\": false,\n      \"readOnly\": true,\n      \"order\": 0\n    }\n  ],\n  \"assetType\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"1709199625981\"\n  }\n}",
															"options": {
																"raw": {
																	"language": "json"
																}
															}
														},
														"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/asset-type-characteristics"
													},
													"response": []
												},
												{
													"name": "UpsertCharacteristicsType - Create",
													"event": [
														{
															"listen": "prerequest",
															"script": {
																"exec": [
																	"var nowDT = new Date(Date.now());",
																	"const valueGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
																	"pm.collectionVariables.set(\"valueGenerator\",valueGenerator);"
																],
																"type": "text/javascript",
																"packages": {}
															}
														},
														{
															"listen": "test",
															"script": {
																"exec": [
																	"pm.test('Response status code is 204', function () {",
																	"    pm.expect(pm.response.code).to.equal(204);",
																	"})"
																],
																"type": "text/javascript",
																"packages": {}
															}
														}
													],
													"request": {
														"method": "POST",
														"header": [],
														"body": {
															"mode": "raw",
															"raw": "{\n  \"characteristics\": [\n    {\n      \"classCode\": \"GENE\",\n      \"code\": \"BRAND\",\n      \"value\": \"{{valueGenerator}}\",\n      \"mandatory\": false,\n      \"readOnly\": true,\n      \"order\": 0\n    }\n  ],\n  \"assetType\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"1705333586829\" // to manual edit\n  }\n}",
															"options": {
																"raw": {
																	"language": "json"
																}
															}
														},
														"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/asset-type-characteristics"
													},
													"response": []
												}
											]
										}
									]
								},
								{
									"name": "value",
									"item": [
										{
											"name": "upsert",
											"item": [
												{
													"name": "UpsertCharacteristicsValue - Update",
													"event": [
														{
															"listen": "prerequest",
															"script": {
																"exec": [
																	"var nowDT = new Date(Date.now());",
																	"const valueGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
																	"pm.collectionVariables.set(\"valueGenerator\",valueGenerator);"
																],
																"type": "text/javascript",
																"packages": {}
															}
														},
														{
															"listen": "test",
															"script": {
																"exec": [
																	"pm.test('Response status code is 204', function () {",
																	"    pm.expect(pm.response.code).to.equal(204);",
																	"})"
																],
																"type": "text/javascript",
																"packages": {}
															}
														}
													],
													"request": {
														"method": "POST",
														"header": [],
														"body": {
															"mode": "raw",
															"raw": "{\n  \"characteristics\": [\n    {\n      \"classCode\": \"GENE\",\n      \"code\": \"BRAND\",\n      \"value\": \"{{valueGenerator}}\"\n    }\n  ],\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"1711016432380\"\n  }\n}",
															"options": {
																"raw": {
																	"language": "json"
																}
															}
														},
														"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/asset-characteristics-value"
													},
													"response": []
												},
												{
													"name": "UpsertCharacteristicsValue - Create",
													"event": [
														{
															"listen": "prerequest",
															"script": {
																"exec": [
																	"var nowDT = new Date(Date.now());",
																	"const valueGenerator = \"TEST_WO_AC_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
																	"pm.collectionVariables.set(\"valueGenerator\",valueGenerator);"
																],
																"type": "text/javascript",
																"packages": {}
															}
														},
														{
															"listen": "test",
															"script": {
																"exec": [
																	"pm.test('Response status code is 204', function () {",
																	"    pm.expect(pm.response.code).to.equal(204);",
																	"})"
																],
																"type": "text/javascript",
																"packages": {}
															}
														}
													],
													"request": {
														"method": "POST",
														"header": [],
														"body": {
															"mode": "raw",
															"raw": "{\n  \"characteristics\": [\n    {\n      \"classCode\": \"GENE\",\n      \"code\": \"BRAND\",\n      \"value\": \"{{valueGenerator}}\"\n    }\n  ],\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"1709894686923\" // to manual edit\n  }\n}",
															"options": {
																"raw": {
																	"language": "json"
																}
															}
														},
														"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/asset-characteristics-value"
													},
													"response": []
												}
											]
										}
									]
								}
							]
						}
					]
				},
				{
					"name": "characteristics",
					"item": [
						{
							"name": "upsert",
							"item": [
								{
									"name": "UpsertCharacteristics - Create class and characteristics",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"var nowDT = new Date(Date.now());",
													"const characteristicCodeGenerator = \"TEST_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
													"pm.collectionVariables.set(\"characteristicCodeGenerator\",characteristicCodeGenerator);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test('Response status code is 201', function () {",
													"    pm.expect(pm.response.code).to.equal(201);",
													"})",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"characteristic\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{characteristicCodeGenerator}}\",\n    \"description\": [\n      {\n        \"lang\": \"en\",\n        \"value\": \"testttt\"\n      }\n    ],\n    \"format\": null,\n    \"size\": 10,\n    \"maxLength\": 50,\n    \"notNull\": true,\n    \"active\": true,\n    \"precision\": null,\n    \"order\": 0,\n    \"meter\": false,\n    \"negativeValues\": false,\n    \"dataTypeDescription\": \"Varchar\",\n    \"valueDomainCode\": \"PostmanTest\",\n    \"measurementUnitCode\": null,\n    \"usageDescription\": \"ATTRIBUTI OGGETTI\"\n  },\n  \"characteristicClassType\": {\n    \"code\": \"IMPIANTI\"\n  },\n  \"characteristicClass\": {\n    \"code\": \"{{characteristicCodeGenerator}}\",\n    \"description\": [\n      {\n        \"lang\": \"en\",\n        \"value\": \"testttt\"\n      }\n    ],\n    \"active\": true\n  }\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/characteristics"
									},
									"response": []
								},
								{
									"name": "UpsertCharacteristics - Create only characteristic",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"var nowDT = new Date(Date.now());",
													"const characteristicCodeGenerator = \"TEST_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
													"pm.collectionVariables.set(\"characteristicCodeGenerator\",characteristicCodeGenerator);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test('Response status code is 201', function () {",
													"    pm.expect(pm.response.code).to.equal(201);",
													"})",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"characteristic\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{characteristicCodeGenerator}}\",\n    \"description\": [\n      {\n        \"lang\": \"en\",\n        \"value\": \"testttt\"\n      }\n    ],\n    \"format\": null,\n    \"size\": 10,\n    \"maxLength\": 50,\n    \"notNull\": true,\n    \"active\": true,\n    \"precision\": null,\n    \"order\": 0,\n    \"meter\": false,\n    \"negativeValues\": false,\n    \"dataTypeDescription\": \"Varchar\",\n    \"valueDomainCode\": \"PostmanTest\",\n    \"measurementUnitCode\": null,\n    \"usageDescription\": \"ATTRIBUTI OGGETTI\"\n  },\n  \"characteristicClassType\": {\n    \"code\": \"IMPIANTI\"\n  },\n  \"characteristicClass\": {\n    \"code\": \"TEST_202434104242383\",\n    \"description\": [\n      {\n        \"lang\": \"en\",\n        \"value\": \"testttt\"\n      }\n    ],\n    \"active\": true\n  }\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/characteristics"
									},
									"response": []
								},
								{
									"name": "UpsertCharacteristics - Update all",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"var nowDT = new Date(Date.now());",
													"const characteristicCodeGenerator = \"TEST_\" + nowDT.getFullYear().toString() + nowDT.getMonth().toString() + nowDT.getDay().toString() + nowDT.getHours().toString() + nowDT.getMinutes().toString()  + nowDT.getSeconds().toString() +  nowDT.getMilliseconds().toString();",
													"pm.collectionVariables.set(\"characteristicCodeGenerator\",characteristicCodeGenerator);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test('Response status code is 204', function () {",
													"    pm.expect(pm.response.code).to.equal(204);",
													"})"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"characteristic\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"TEST_20243410448646\",\n    \"description\": [\n      {\n        \"lang\": \"en\",\n        \"value\": \"testttt\"\n      }\n    ],\n    \"format\": null,\n    \"size\": 10,\n    \"maxLength\": 50,\n    \"notNull\": true,\n    \"active\": true,\n    \"precision\": null,\n    \"order\": 0,\n    \"meter\": false,\n    \"negativeValues\": false,\n    \"dataTypeDescription\": \"Varchar\",\n    \"valueDomainCode\": \"PostmanTest\",\n    \"measurementUnitCode\": null,\n    \"usageDescription\": \"ATTRIBUTI OGGETTI\"\n  },\n  \"characteristicClassType\": {\n    \"code\": \"IMPIANTI\"\n  },\n  \"characteristicClass\": {\n    \"code\": \"TEST_202434104242383\",\n    \"description\": [\n      {\n        \"lang\": \"en\",\n        \"value\": \"testttt\"\n      }\n    ],\n    \"active\": true\n  }\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/configurations/r1/characteristics"
									},
									"response": []
								}
							]
						}
					]
				}
			]
		},
		{
			"name": "Assets",
			"item": [
				{
					"name": "account",
					"item": [
						{
							"name": "get",
							"item": [
								{
									"name": "error",
									"item": [
										{
											"name": "Accounts get - Wrong External System",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "GET",
												"header": [],
												"url": {
													"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts?code=test_account_20243516243&externalSystemCode=NOSAP_EXTERNAL",
													"host": [
														"{{integration-api-url}}"
													],
													"path": [
														"{{context-path}}",
														"api",
														"integration",
														"assets",
														"r1",
														"accounts"
													],
													"query": [
														{
															"key": "code",
															"value": "test_account_20243516243"
														},
														{
															"key": "externalSystemCode",
															"value": "NOSAP_EXTERNAL"
														}
													]
												}
											},
											"response": []
										},
										{
											"name": "Accounts get - Wrong Asset Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "GET",
												"header": [],
												"url": {
													"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts?code=UNKNOWN_ACCOUNT_CODE_PROVIDED&externalSystemCode=SAP",
													"host": [
														"{{integration-api-url}}"
													],
													"path": [
														"{{context-path}}",
														"api",
														"integration",
														"assets",
														"r1",
														"accounts"
													],
													"query": [
														{
															"key": "code",
															"value": "UNKNOWN_ACCOUNT_CODE_PROVIDED"
														},
														{
															"key": "externalSystemCode",
															"value": "SAP"
														}
													]
												}
											},
											"response": []
										}
									]
								},
								{
									"name": "Accounts get - simple with code",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts?code=test_account_20243516243&externalSystemCode=SAP",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"assets",
												"r1",
												"accounts"
											],
											"query": [
												{
													"key": "code",
													"value": "test_account_20243516243"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "Accounts get - simple with fields filter",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'fiscalCode'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('fiscalCode');",
													"});",
													"",
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts?code=test_account_20243516243&externalSystemCode=SAP&_fields=fiscalCode",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"assets",
												"r1",
												"accounts"
											],
											"query": [
												{
													"key": "code",
													"value": "test_account_20243516243"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "_fields",
													"value": "fiscalCode"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "Accounts get - simple with fields filter nested",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'fiscalCode'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('fiscalCode');",
													"});",
													"",
													"pm.test(\"Response has the required field 'type'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('type');",
													"});",
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts?code=test_account_20243516243&externalSystemCode=SAP&_fields=fiscalCode,type.code",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"assets",
												"r1",
												"accounts"
											],
											"query": [
												{
													"key": "code",
													"value": "test_account_20243516243"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "_fields",
													"value": "fiscalCode,type.code"
												}
											]
										}
									},
									"response": []
								}
							]
						},
						{
							"name": "upsert",
							"item": [
								{
									"name": "error",
									"item": [
										{
											"name": "Account upsert - Multiple Meters with same SerialNumber Error",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const accountIdentifier = \"TEST_ACCOUNT_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.collectionVariables.set(\"accountIdentifier\",accountIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Serial number sameSerialNumber repeated in more than one meter');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"account\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{accountIdentifier}}\",\n    \"typeCode\": \"1711382128688\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"description\": \"asdfasdf\",\n    \"fiscalCode\": \"23423fg\",\n    \"note\": \"asdffdsfdssa\",\n    \"birthDate\": \"2024-03-28T15:01:22.494Z\",\n    \"phoneNumberCode\": \"333556676\",\n    \"phoneNumberContact\": \"gigi\"\n  },\n  \"address\": {\n    \"countryIsoAlphaCode\": \"IT\",\n    \"districtAcronym\": \"UD\",\n    \"municipality\": \"UDINE\",\n    \"municipalityCode\": \"UD\",\n    \"locality\": \"UDINE\",\n    \"postalCode\": \"33100\",\n    \"toponym\": \"string\",\n    \"street\": \"VIA PUINTAT\",\n    \"streetNumber\": 2,\n    \"streetNumberExtension\": \"A\",\n    \"floor\": \"1\",\n    \"lot\": \"2\",\n    \"staircase\": \"string\",\n    \"apartment\": \"string\",\n    \"directions\": \"string\",\n    \"description\": \"desccc\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  },\n  \"contacts\": [{\n      \"typeCode\": \"EMAIL\",\n      \"code\": \"aaa@test.it\",\n      \"contact\": \"aaa\"\n    }\n  ],\n  \"meters\": [\n    {\n      \"typeCode\": \"T1\",\n      \"brandCode\": \"WB\",\n      \"locationCode\": \"1705048811158\",\n      \"classCode\": \"1705252270484\",\n      \"productionYear\": \"2023\",\n      \"serialNumber\": \"sameSerialNumber\",\n      \"digitNumber\": 0,\n      \"acronym\": \"string\",\n      \"note\": \"string\",\n      \"minReading\": 0,\n      \"maxReading\": 0,\n      \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n      \"lastReading\": 0,\n      \"active\": true\n    },\n    {\n      \"typeCode\": \"2\",\n      \"brandCode\": \"WB\",\n      \"locationCode\": \"1705048811158\",\n      \"classCode\": \"1705252270484\",\n      \"productionYear\": \"2023\",\n      \"serialNumber\": \"sameSerialNumber\",\n      \"digitNumber\": 0,\n      \"acronym\": \"string\",\n      \"note\": \"string\",\n      \"minReading\": 0,\n      \"maxReading\": 0,\n      \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n      \"lastReading\": 0,\n      \"active\": true\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts"
											},
											"response": []
										},
										{
											"name": "Account upsert - Multiple Contacts with same TypeCode",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const accountIdentifier = \"TEST_ACCOUNT_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.collectionVariables.set(\"accountIdentifier\",accountIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Contact type EMAIL repeated in more than one contact');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"account\": {\n        \"externalSystemCode\": \"SAP\",\n        \"code\": \"{{accountIdentifier}}\",\n        \"typeCode\": \"1711382128688\",\n        \"operationCenterCode\": \"1705044291857\",\n        \"description\": \"asdfasdf\",\n        \"fiscalCode\": \"23423fg\",\n        \"note\": \"asdffdsfdssa\",\n        \"birthDate\": \"2024-03-28T15:01:22.494Z\",\n        \"phoneNumberCode\": \"333556676\",\n        \"phoneNumberContact\": \"gigi\"\n    },\n    \"address\": {\n        \"countryIsoAlphaCode\": \"IT\",\n        \"districtAcronym\": \"UD\",\n        \"municipality\": \"UDINE\",\n        \"municipalityCode\": \"UD\",\n        \"locality\": \"UDINE\",\n        \"postalCode\": \"33100\",\n        \"toponym\": \"string\",\n        \"street\": \"VIA PUINTAT\",\n        \"streetNumber\": 2,\n        \"streetNumberExtension\": \"A\",\n        \"floor\": \"1\",\n        \"lot\": \"2\",\n        \"staircase\": \"string\",\n        \"apartment\": \"string\",\n        \"directions\": \"string\",\n        \"description\": \"desccc\",\n        \"yCoordinate\": 46.0948035,\n        \"xCoordinate\": 13.2298188\n    },\n    \"contacts\": [\n        {\n            \"typeCode\": \"EMAIL\",\n            \"code\": \"aaa@test.it\",\n            \"contact\": \"aaa\"\n        },\n        {\n            \"typeCode\": \"EMAIL\",\n            \"code\": \"aaa@test.it\",\n            \"contact\": \"aaa\"\n        }\n    ],\n    \"meters\": [\n        {\n            \"typeCode\": \"T1\",\n            \"brandCode\": \"WB\",\n            \"locationCode\": \"1705048811158\",\n            \"classCode\": \"1705252270484\",\n            \"productionYear\": \"2023\",\n            \"serialNumber\": \"s1\",\n            \"digitNumber\": 0,\n            \"acronym\": \"string\",\n            \"note\": \"string\",\n            \"minReading\": 0,\n            \"maxReading\": 0,\n            \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n            \"lastReading\": 0,\n            \"active\": true\n        },\n        {\n            \"typeCode\": \"2\",\n            \"brandCode\": \"WB\",\n            \"locationCode\": \"1705048811158\",\n            \"classCode\": \"1705252270484\",\n            \"productionYear\": \"2023\",\n            \"serialNumber\": \"s2\",\n            \"digitNumber\": 0,\n            \"acronym\": \"string\",\n            \"note\": \"string\",\n            \"minReading\": 0,\n            \"maxReading\": 0,\n            \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n            \"lastReading\": 0,\n            \"active\": true\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts"
											},
											"response": []
										},
										{
											"name": "Account upsert - SerialNumber Already used",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"",
															"var nowDT = new Date(Date.now());",
															"const accountIdentifier = \"TEST_ACCOUNT_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.collectionVariables.set(\"accountIdentifier\",accountIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Meter creation denied because meter sn1_20243516243 has already been used');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"account\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{accountIdentifier}}\",\n    \"typeCode\": \"1711382128688\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"description\": \"asdfasdf\",\n    \"fiscalCode\": \"23423fg\",\n    \"note\": \"asdffdsfdssa\",\n    \"birthDate\": \"2024-03-28T15:01:22.494Z\",\n    \"phoneNumberCode\": \"333556676\",\n    \"phoneNumberContact\": \"gigi\"\n  },\n  \"address\": {\n    \"countryIsoAlphaCode\": \"IT\",\n    \"districtAcronym\": \"UD\",\n    \"municipality\": \"UDINE\",\n    \"municipalityCode\": \"UD\",\n    \"locality\": \"UDINE\",\n    \"postalCode\": \"33100\",\n    \"toponym\": \"string\",\n    \"street\": \"VIA PUINTAT\",\n    \"streetNumber\": 2,\n    \"streetNumberExtension\": \"A\",\n    \"floor\": \"1\",\n    \"lot\": \"2\",\n    \"staircase\": \"string\",\n    \"apartment\": \"string\",\n    \"directions\": \"string\",\n    \"description\": \"desccc\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  },\n  \"contacts\": [{\n      \"typeCode\": \"EMAIL\",\n      \"code\": \"aaa@test.it\",\n      \"contact\": \"aaa\"\n    }\n  ],\n  \"meters\": [\n    {\n      \"typeCode\": \"T1\",\n      \"brandCode\": \"WB\",\n      \"locationCode\": \"1705048811158\",\n      \"classCode\": \"1705252270484\",\n      \"productionYear\": \"2023\",\n      \"serialNumber\": \"sn1_20243516243\",\n      \"digitNumber\": 0,\n      \"acronym\": \"string\",\n      \"note\": \"string\",\n      \"minReading\": 0,\n      \"maxReading\": 0,\n      \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n      \"lastReading\": 0,\n      \"active\": true\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts"
											},
											"response": []
										}
									]
								},
								{
									"name": "Account upsert - Simple working scenario - CREATION",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"",
													"var nowDT = new Date(Date.now());",
													"const accountIdentifier = \"TEST_ACCOUNT_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
													"pm.collectionVariables.set(\"accountIdentifier\",accountIdentifier);",
													"",
													"const serialNumberIdentifier = \"SN\" + nowDT.getFullYear() + (nowDT.getMonth()+1) + nowDT.getDay().toString() + nowDT.getHours() + nowDT.getMinutes() + nowDT.getSeconds() + nowDT.getMilliseconds();",
													"",
													"pm.collectionVariables.set(\"serialNumberIdentifier\",serialNumberIdentifier);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 201\", function () {",
													"  pm.expect(pm.response.code).to.equal(201);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"account\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{accountIdentifier}}\",\n    \"typeCode\": \"1711382128688\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"description\": \"DESCRIZIONE-{{accountIdentifier}}\",\n    \"fiscalCode\": \"23423fg\",\n    \"note\": \"NOTE-{{accountIdentifier}}\",\n    \"birthDate\": \"2024-03-28T15:01:22.494Z\",\n    \"phoneNumberCode\": \"333556676\",\n    \"phoneNumberContact\": \"gigi\"\n  },\n  \"address\": {\n    \"countryIsoAlphaCode\": \"IT\",\n    \"districtAcronym\": \"UD\",\n    \"municipality\": \"UDINE\",\n    \"municipalityCode\": \"UD\",\n    \"locality\": \"UDINE\",\n    \"postalCode\": \"33100\",\n    \"toponym\": \"string\",\n    \"street\": \"VIA PUINTAT\",\n    \"streetNumber\": 2,\n    \"streetNumberExtension\": \"A\",\n    \"floor\": \"1\",\n    \"lot\": \"2\",\n    \"staircase\": \"string\",\n    \"apartment\": \"string\",\n    \"directions\": \"string\",\n    \"description\": \"desccc\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  },\n  \"contacts\": [{\n      \"typeCode\": \"EMAIL\",\n      \"code\": \"aaa@test.it\",\n      \"contact\": \"aaa\"\n    }\n  ],\n  \"meters\": [\n    {\n      \"typeCode\": \"T1\",\n      \"brandCode\": \"WB\",\n      \"locationCode\": \"1705048811158\",\n      \"classCode\": \"1705252270484\",\n      \"productionYear\": \"2023\",\n      \"serialNumber\": \"{{serialNumberIdentifier}}\",\n      \"digitNumber\": 0,\n      \"acronym\": \"string\",\n      \"note\": \"string\",\n      \"minReading\": 0,\n      \"maxReading\": 0,\n      \"lastReadingDate\": \"2024-03-28T15:01:22.495Z\",\n      \"lastReading\": 0,\n      \"active\": true\n    }\n  ]\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts"
									},
									"response": []
								},
								{
									"name": "Account upsert - Simple working scenario - UPDATE",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"",
													"var nowDT = new Date(Date.now());",
													"const accountIdentifier = \"TEST_ACCOUNT_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
													"pm.collectionVariables.set(\"accountIdentifier\",accountIdentifier);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is No Content\", function () {",
													"  pm.expect(pm.response.code).to.equal(204);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"account\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"test_account_20243516243\",\n    \"typeCode\": \"1711382128688\",\n    \"operationCenterCode\": \"1705044291857\",\n    \"description\": \"DESCRIZIONE-{{accountIdentifier}}\",\n    \"fiscalCode\": \"23423fg\",\n    \"note\": \"NOTE-{{accountIdentifier}}\",\n    \"birthDate\": \"2024-03-28T15:01:22.494Z\"\n  },\n  \"address\": {\n    \"countryIsoAlphaCode\": \"IT\",\n    \"districtAcronym\": \"UD\",\n    \"municipality\": \"UDINE\",\n    \"municipalityCode\": \"UD\",\n    \"locality\": \"UDINE\",\n    \"postalCode\": \"33100\",\n    \"toponym\": \"string\",\n    \"street\": \"VIA PUINTAT\",\n    \"streetNumber\": 2,\n    \"streetNumberExtension\": \"A\",\n    \"floor\": \"1\",\n    \"lot\": \"2\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  },\n  \"contacts\": [],\n  \"meters\": []\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/accounts"
									},
									"response": []
								}
							]
						}
					]
				},
				{
					"name": "asset",
					"item": [
						{
							"name": "upsert",
							"item": [
								{
									"name": "error",
									"item": [
										{
											"name": "Asset upsert - Wrong External System",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"123\",\n    \"code\": \"202404051259-test\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"{{assetIdentifier}} - Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"{{assetIdentifier}} - Testing API Asset-Creation Integration API V1\"\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										},
										{
											"name": "Asset upsert - Wrong Operation Center",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENWXX123\",\n    \"description\": \"Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"Testing API Asset-Creation Integration API V1\",\n    \"invertible\": true\n  },\n    \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										},
										{
											"name": "Asset upsert - Wrong AssetStatusCode",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"CILL\",\n    \"operationCenterCode\": \"1606\",\n    \"description\": \"Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP123\",\n    \"parentAssetCode\": null,\n    \"note\": \"Testing API Asset-Creation Integration API V1\",\n    \"invertible\": true\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										},
										{
											"name": "Asset upsert - Non-Existing Country Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"Testing API Asset-Creation Integration API V1\",\n    \"invertible\": true\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"ITU\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										},
										{
											"name": "Asset upsert - Invalid Country Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"Testing API Asset-Creation Integration API V1\",\n    \"invertible\": true\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"MC\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										},
										{
											"name": "Asset upsert - Invalid District Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"Testing API Asset-Creation Integration API V1\",\n    \"invertible\": true\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UDA\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										},
										{
											"name": "Asset upsert - Wrong AssetTypeCode",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.variables.set(\"assetIdentifier\",assetIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"protocolProfileBehavior": {
												"disabledSystemHeaders": {
													"accept-encoding": true,
													"connection": true,
													"user-agent": true
												}
											},
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"API\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"PLANT123\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"Testing API Asset-Creation Integration API V1\",\n    \"invertible\": true\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
											},
											"response": []
										}
									]
								},
								{
									"name": "Asset upsert - Simple working Scenario - CREATE",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"var nowDT = new Date(Date.now());",
													"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
													"pm.collectionVariables.set(\"assetIdentifier\",assetIdentifier);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response Status is Created\", function () {",
													"    pm.expect(pm.response.code = 201);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"protocolProfileBehavior": {
										"disabledSystemHeaders": {
											"accept-encoding": true,
											"connection": true,
											"user-agent": true
										}
									},
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"{{assetIdentifier}}\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"{{assetIdentifier}} - Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"{{assetIdentifier}} - Testing API Asset-Creation Integration API V1\"\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
									},
									"response": []
								},
								{
									"name": "Asset upsert - Simple working Scenario - UPDATE",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"var nowDT = new Date(Date.now());",
													"const assetIdentifier = \"TEST_ASSET_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
													"pm.collectionVariables.set(\"assetIdentifier\",assetIdentifier);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response Status is No Content\", function () {",
													"    pm.expect(pm.response.code = 204);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"protocolProfileBehavior": {
										"disabledSystemHeaders": {
											"accept-encoding": true,
											"connection": true,
											"user-agent": true
										}
									},
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"asset\": {\n    \"externalSystemCode\": \"SAP\",\n    \"code\": \"202404051259-test\",\n    \"typeCode\": \"1709199625981\",\n    \"operationCenterCode\": \"OCENW\",\n    \"description\": \"{{assetIdentifier}} - Plant in Texas for Energy generation\",\n    \"statusCode\": \"OP\",\n    \"note\": \"{{assetIdentifier}} - Testing API Asset-Creation Integration API V1\"\n  },\n   \"address\": {\n    \"streetNumber\": 2,\n    \"street\": \"VIA PUINTAT\",\n    \"countryIsoAlphaCode\": \"IT\",\n    \"postalCode\": \"33100\",\n    \"municipality\": \"UDINE\",\n    \"districtAcronym\": \"UD\",\n    \"yCoordinate\": 46.0948035,\n    \"xCoordinate\": 13.2298188\n  }\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets"
									},
									"response": []
								}
							]
						},
						{
							"name": "get",
							"item": [
								{
									"name": "error",
									"item": [
										{
											"name": "Assets get - Wrong External System",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "GET",
												"header": [],
												"url": {
													"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets?code=202404051259-test&externalSystemCode=NOSAP_EXTERNAL",
													"host": [
														"{{integration-api-url}}"
													],
													"path": [
														"{{context-path}}",
														"api",
														"integration",
														"assets",
														"r1",
														"assets"
													],
													"query": [
														{
															"key": "code",
															"value": "202404051259-test"
														},
														{
															"key": "externalSystemCode",
															"value": "NOSAP_EXTERNAL"
														}
													]
												}
											},
											"response": []
										},
										{
											"name": "Assets get - Wrong Asset Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "GET",
												"header": [],
												"url": {
													"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets?code=UNKNOWN_ASSET_CODE_PROVIDED&externalSystemCode=SAP",
													"host": [
														"{{integration-api-url}}"
													],
													"path": [
														"{{context-path}}",
														"api",
														"integration",
														"assets",
														"r1",
														"assets"
													],
													"query": [
														{
															"key": "code",
															"value": "UNKNOWN_ASSET_CODE_PROVIDED"
														},
														{
															"key": "externalSystemCode",
															"value": "SAP"
														}
													]
												}
											},
											"response": []
										}
									]
								},
								{
									"name": "Assets get - simple with code",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets?code=202404051259-test&externalSystemCode=SAP",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"assets",
												"r1",
												"assets"
											],
											"query": [
												{
													"key": "code",
													"value": "202404051259-test"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "Assets get - simple with fields filter",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'address'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('address');",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets?code=202404051259-test&externalSystemCode=SAP&_fields=address",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"assets",
												"r1",
												"assets"
											],
											"query": [
												{
													"key": "code",
													"value": "202404051259-test"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "_fields",
													"value": "address"
												}
											]
										}
									},
									"response": []
								},
								{
									"name": "Assets get - simple with fields filter nested",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 200\", function () {",
													"  pm.expect(pm.response.code).to.equal(200);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'address'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('address');",
													"});",
													"",
													"pm.test(\"Response has the required field 'operationCenter'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('operationCenter');",
													"});",
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "GET",
										"header": [],
										"url": {
											"raw": "{{integration-api-url}}/{{context-path}}/api/integration/assets/r1/assets?code=202404051259-test&externalSystemCode=SAP&_fields=id,address.municipality,operationCenter.description",
											"host": [
												"{{integration-api-url}}"
											],
											"path": [
												"{{context-path}}",
												"api",
												"integration",
												"assets",
												"r1",
												"assets"
											],
											"query": [
												{
													"key": "code",
													"value": "202404051259-test"
												},
												{
													"key": "externalSystemCode",
													"value": "SAP"
												},
												{
													"key": "_fields",
													"value": "id,address.municipality,operationCenter.description"
												}
											]
										}
									},
									"response": []
								}
							]
						}
					]
				}
			]
		},
		{
			"name": "Workforce",
			"item": [
				{
					"name": "resources",
					"item": [
						{
							"name": "skillsupsert",
							"item": [
								{
									"name": "error",
									"item": [
										{
											"name": "SkillsUpdate - Wrong External System",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"resource\": {\n    \"externalSystemCode\": \"NO_SAP_EXTERNAL_SYSTEM\",\n    \"identificationNumber\": \"stMI0018\"\n  },\n  \"skills\": [\n    {\n      \"code\": \"TECH\",\n      \"levelCode\": \"1\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resource-skills"
											},
											"response": []
										},
										{
											"name": "SkillsUpdate - Unknown Resource Identification Number",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const resourceIdentifier = \"TEST_RESOURCE_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.collectionVariables.set(\"resourceIdentifier\",resourceIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"resource\": {\n    \"externalSystemCode\": \"SAP\",\n    \"identificationNumber\": \"{{resourceIdentifier}}\"\n  },\n  \"skills\": [\n    {\n      \"code\": \"TECH\",\n      \"levelCode\": \"1\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resource-skills"
											},
											"response": []
										},
										{
											"name": "SkillsUpdate - Unknown Skill Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															"var nowDT = new Date(Date.now());",
															"const resourceIdentifier = \"TEST_RESOURCE_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
															"pm.collectionVariables.set(\"resourceIdentifier\",resourceIdentifier);"
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"",
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n  \"resource\": {\n    \"externalSystemCode\": \"SAP\",\n    \"identificationNumber\": \"stMI0018\"\n  },\n  \"skills\": [\n    {\n      \"code\": \"{{resourceIdentifier}}\",\n      \"levelCode\": \"1\"\n    }\n  ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resource-skills"
											},
											"response": []
										}
									]
								},
								{
									"name": "SkillsUpsert - Simple working scenario",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is No Content\", function () {",
													"  pm.expect(pm.response.code).to.equal(204);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n  \"resource\": {\n    \"externalSystemCode\": \"SAP\",\n    \"identificationNumber\": \"stMI0018\"\n  },\n  \"skills\": [\n    {\n      \"code\": \"TECH\",\n      \"levelCode\": \"3\"\n    }\n  ]\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resource-skills"
									},
									"response": []
								}
							]
						},
						{
							"name": "upsert",
							"item": [
								{
									"name": "error",
									"item": [
										{
											"name": "Resource Upsert - Wrong External System",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"NO_SAP_EXTERNAL_SYSTEM\",\n        \"surname\": \"string\",\n        \"name\": \"string\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"string\",\n        \"mobilePhone\": \"string\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"string\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"HOUSE99\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test\",\n            \"streetNumber\": 3,\n            \"street\": \"VIA NUOVA\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"00119\",\n            \"municipality\": \"ROMA\",\n            \"districtAcronym\": \"RM\",\n            \"yCoordinate\": 46.0948040,\n            \"xCoordinate\": 13.2298190\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - AddressTargetId Valued Error",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"NO_SAP_EXTERNAL_SYSTEM\",\n        \"surname\": \"string\",\n        \"name\": \"string\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"string\",\n        \"mobilePhone\": \"string\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"string\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"HOUSE99\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test\",\n            \"streetNumber\": 3,\n            \"street\": \"VIA NUOVA\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"00119\",\n            \"municipality\": \"ROMA\",\n            \"districtAcronym\": \"RM\",\n            \"yCoordinate\": 46.0948040,\n            \"xCoordinate\": 13.2298190\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - Operation Ceneter Addresses Validation Error (Main Address Error)",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Operation center OCENW does not have a main address or it has more than one main address');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"surname1\",\n        \"name\": \"name1\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"a.b@test2024.com\",\n        \"mobilePhone\": \"123459999\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"red\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENW\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"test\",\n        \"endAddressCode\": \"test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test20240415\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"districtAcronym\": \"UD\",\n            \"municipality\": \"UDINE\",\n            \"municipalityCode\": \"UD\",\n            \"locality\": \"UDINE\",\n            \"postalCode\": \"33100\",\n            \"toponym\": \"string\",\n            \"street\": \"VIA PUINTAT\",\n            \"streetNumber\": 2,\n            \"streetNumberExtension\": \"A\",\n            \"floor\": \"1\",\n            \"lot\": \"2\",\n            \"staircase\": \"string\",\n            \"apartment\": \"string\",\n            \"directions\": \"string\",\n            \"description\": \"desccc\",\n            \"yCoordinate\": 46.0948035,\n            \"xCoordinate\": 13.2298188,\n            \"resourceAddressDescription\": \"description\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - StartAddressCode Validation Error (ThrowIfStartAddressCodeNotSpecifiedAndNotDeductedByOperationCenter)",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Specify start address by code or by operation center');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"surname1\",\n        \"name\": \"name1\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"a.b@test2024.com\",\n        \"mobilePhone\": \"123459999\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"red\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"endAddressCode\": \"test\",\n        \"startAddressFromOperationCenter\": false,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test20240415\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"districtAcronym\": \"UD\",\n            \"municipality\": \"UDINE\",\n            \"municipalityCode\": \"UD\",\n            \"locality\": \"UDINE\",\n            \"postalCode\": \"33100\",\n            \"toponym\": \"string\",\n            \"street\": \"VIA PUINTAT\",\n            \"streetNumber\": 2,\n            \"streetNumberExtension\": \"A\",\n            \"floor\": \"1\",\n            \"lot\": \"2\",\n            \"staircase\": \"string\",\n            \"apartment\": \"string\",\n            \"directions\": \"string\",\n            \"description\": \"desccc\",\n            \"yCoordinate\": 46.0948035,\n            \"xCoordinate\": 13.2298188,\n            \"resourceAddressDescription\": \"description\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - OperationCenter Validation Error (ThrowIfOperationCenterNotSpecifiedButAddressesAreRequired)",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Operation center is mandatory to set start or end address');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"surname1\",\n        \"name\": \"name1\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"a.b@test2024.com\",\n        \"mobilePhone\": \"123459999\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"red\",\n        \"order\": 0,\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"test\",\n        \"endAddressCode\": \"test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test20240415\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"districtAcronym\": \"UD\",\n            \"municipality\": \"UDINE\",\n            \"municipalityCode\": \"UD\",\n            \"locality\": \"UDINE\",\n            \"postalCode\": \"33100\",\n            \"toponym\": \"string\",\n            \"street\": \"VIA PUINTAT\",\n            \"streetNumber\": 2,\n            \"streetNumberExtension\": \"A\",\n            \"floor\": \"1\",\n            \"lot\": \"2\",\n            \"staircase\": \"string\",\n            \"apartment\": \"string\",\n            \"directions\": \"string\",\n            \"description\": \"desccc\",\n            \"yCoordinate\": 46.0948035,\n            \"xCoordinate\": 13.2298188,\n            \"resourceAddressDescription\": \"description\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - EndAddressCode Validation Error (ThrowIfStartAddressCodeNotSpecifiedAndNotDeductedByOperationCenter)",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 400\", function () {",
															"    pm.expect(pm.response.code).to.equal(400);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});",
															"",
															"",
															"pm.test(\"detail message value\", function () {",
															"  const responseData = pm.response.json();",
															"",
															"  pm.expect(responseData).to.be.an('object');",
															"  pm.expect(responseData.detail).to.be.equal('Specify end address by code or by operation center');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"surname1\",\n        \"name\": \"name1\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"a.b@test2024.com\",\n        \"mobilePhone\": \"123459999\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"red\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": false\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test20240415\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"districtAcronym\": \"UD\",\n            \"municipality\": \"UDINE\",\n            \"municipalityCode\": \"UD\",\n            \"locality\": \"UDINE\",\n            \"postalCode\": \"33100\",\n            \"toponym\": \"string\",\n            \"street\": \"VIA PUINTAT\",\n            \"streetNumber\": 2,\n            \"streetNumberExtension\": \"A\",\n            \"floor\": \"1\",\n            \"lot\": \"2\",\n            \"staircase\": \"string\",\n            \"apartment\": \"string\",\n            \"directions\": \"string\",\n            \"description\": \"desccc\",\n            \"yCoordinate\": 46.0948035,\n            \"xCoordinate\": 13.2298188,\n            \"resourceAddressDescription\": \"description\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - Wrong Work Center Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"NO_SAP_EXTERNAL_SYSTEM\",\n        \"surname\": \"string\",\n        \"name\": \"string\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"string\",\n        \"mobilePhone\": \"string\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"string\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"1705056780968_unknown_wo_code\",\n        \"startAddressCode\": \"HOUSE99\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test\",\n            \"streetNumber\": 3,\n            \"street\": \"VIA NUOVA\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"00119\",\n            \"municipality\": \"ROMA\",\n            \"districtAcronym\": \"RM\",\n            \"yCoordinate\": 46.0948040,\n            \"xCoordinate\": 13.2298190\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - Wrong Vehicle Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"string\",\n        \"name\": \"string\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"string\",\n        \"mobilePhone\": \"string\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"string\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true,\n        \"vehicleCode\": \"VE1000_UNKNOWN\"\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test\",\n            \"streetNumber\": 3,\n            \"street\": \"VIA NUOVA\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"00119\",\n            \"municipality\": \"ROMA\",\n            \"districtAcronym\": \"RM\",\n            \"yCoordinate\": 46.0948040,\n            \"xCoordinate\": 13.2298190,\n            \"resourceAddressDescription\": \"description\"\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - Wrong Type Code",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"string\",\n        \"name\": \"string\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"string\",\n        \"mobilePhone\": \"string\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT_12345678900000\",\n        \"color\": \"string\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test\",\n            \"streetNumber\": 3,\n            \"street\": \"VIA NUOVA\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"00119\",\n            \"municipality\": \"ROMA\",\n            \"districtAcronym\": \"RM\",\n            \"yCoordinate\": 46.0948040,\n            \"xCoordinate\": 13.2298190\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										},
										{
											"name": "Resource Upsert - Wrong Operation Center",
											"event": [
												{
													"listen": "prerequest",
													"script": {
														"exec": [
															""
														],
														"type": "text/javascript",
														"packages": {}
													}
												},
												{
													"listen": "test",
													"script": {
														"exec": [
															"pm.test(\"Response status code is 404\", function () {",
															"    pm.expect(pm.response.code).to.equal(404);",
															"});",
															"",
															"",
															"pm.test(\"Content-Type header is application/problem+json\", function () {",
															"    pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/problem+json\");",
															"});",
															"",
															"",
															"pm.test(\"Type is a non-empty string\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.be.an('object');",
															"    pm.expect(responseData.type).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Type should not be empty\");",
															"});",
															"",
															"",
															"pm.test(\"Response has the required field 'detail'\", function () {",
															"    const responseData = pm.response.json();",
															"    ",
															"    pm.expect(responseData).to.have.property('detail');",
															"});"
														],
														"type": "text/javascript",
														"packages": {}
													}
												}
											],
											"request": {
												"method": "POST",
												"header": [],
												"body": {
													"mode": "raw",
													"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"string\",\n        \"name\": \"string\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"string\",\n        \"mobilePhone\": \"string\",\n        \"identificationNumber\": \"stMI0018\",\n        \"typeCode\": \"INT\",\n        \"color\": \"string\",\n        \"order\": 0,\n        \"operationCenterCode\": \"UNKNOWN_OP_CENTER_OCENE\",\n        \"workCenterCode\": \"MECH\",\n        \"startAddressCode\": \"HOUSE99\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"test\",\n            \"streetNumber\": 3,\n            \"street\": \"VIA NUOVA\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"00119\",\n            \"municipality\": \"ROMA\",\n            \"districtAcronym\": \"RM\",\n            \"yCoordinate\": 46.0948040,\n            \"xCoordinate\": 13.2298190\n        }\n    ]\n}",
													"options": {
														"raw": {
															"language": "json"
														}
													}
												},
												"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
											},
											"response": []
										}
									]
								},
								{
									"name": "Resource Upsert - Simple working scenario - UPDATE",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													""
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is No Content\", function () {",
													"  pm.expect(pm.response.code).to.equal(204);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"B\",\n        \"name\": \"A\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"a.b@test.com\",\n        \"mobilePhone\": \"123456\",\n        \"identificationNumber\": \"test-202404151255\",\n        \"typeCode\": \"INT\",\n        \"color\": \"red\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"startAddressCode\": \"5510caa960f6-test\",\n        \"endAddressCode\": \"5510caa960f6-test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"5510caa960f6-test\",\n            \"streetNumber\": 2,\n            \"street\": \"VIA PUINTAT\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"33100\",\n            \"municipality\": \"UDINE\",\n            \"districtAcronym\": \"UD\",\n            \"yCoordinate\": 46.0948035,\n            \"xCoordinate\": 13.2298188,\n            \"resourceAddressDescription\": \"resourceAddressDescription 111\"\n        }\n    ]\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
									},
									"response": []
								},
								{
									"name": "Resource Upsert - Simple working scenario - CREATE",
									"event": [
										{
											"listen": "prerequest",
											"script": {
												"exec": [
													"var nowDT = new Date(Date.now());",
													"const resourceIdentifier = \"TEST_RESOURCE_\" + nowDT.getFullYear() + \"_\" + (nowDT.getMonth()+1) + \"_\"+ nowDT.getDay().toString() + \"_\" + nowDT.getHours() + \"_\" + + nowDT.getMinutes() + \"_\" + nowDT.getSeconds() + \"_\" + nowDT.getMilliseconds();",
													"pm.collectionVariables.set(\"resourceIdentifier\",resourceIdentifier);"
												],
												"type": "text/javascript",
												"packages": {}
											}
										},
										{
											"listen": "test",
											"script": {
												"exec": [
													"pm.test(\"Response status code is 201\", function () {",
													"  pm.expect(pm.response.code).to.equal(201);",
													"});",
													"",
													"",
													"pm.test(\"Response has the required field 'id'\", function () {",
													"    const responseData = pm.response.json();",
													"    ",
													"    pm.expect(responseData).to.have.property('id');",
													"});",
													"",
													"",
													"pm.test(\"Id is a non-zero integer\", function () {",
													"  const responseData = pm.response.json();",
													"",
													"  pm.expect(responseData).to.be.an('object');",
													"  pm.expect(responseData.id).to.exist.and.to.be.a('number');",
													"  pm.expect(responseData.id).to.be.above(0);",
													"});"
												],
												"type": "text/javascript",
												"packages": {}
											}
										}
									],
									"request": {
										"method": "POST",
										"header": [],
										"body": {
											"mode": "raw",
											"raw": "{\n    \"resource\": {\n        \"externalSystemCode\": \"SAP\",\n        \"surname\": \"{{resourceIdentifier}}\",\n        \"name\": \"{{resourceIdentifier}}\",\n        \"birthDate\": \"2024-04-15T09:38:00.931Z\",\n        \"email\": \"a.b@test.com\",\n        \"mobilePhone\": \"123456\",\n        \"identificationNumber\": \"{{resourceIdentifier}}\",\n        \"typeCode\": \"INT\",\n        \"color\": \"red\",\n        \"order\": 0,\n        \"operationCenterCode\": \"OCENE\",\n        \"startAddressCode\": \"5510caa960f6-test\",\n        \"endAddressCode\": \"5510caa960f6-test\",\n        \"startAddressFromOperationCenter\": true,\n        \"endAddressFromOperationCenter\": true\n    },\n    \"addresses\": [\n        {\n            \"code\": \"5510caa960f6-test\",\n            \"streetNumber\": 2,\n            \"street\": \"VIA PUINTAT\",\n            \"countryIsoAlphaCode\": \"IT\",\n            \"postalCode\": \"33100\",\n            \"municipality\": \"UDINE\",\n            \"districtAcronym\": \"UD\",\n            \"yCoordinate\": 46.0948035,\n            \"xCoordinate\": 13.2298188,\n            \"resourceAddressDescription\": \"resourceAddressDescription 111\"\n        }\n    ]\n}",
											"options": {
												"raw": {
													"language": "json"
												}
											}
										},
										"url": "{{integration-api-url}}/{{context-path}}/api/integration/workforce/r1/resources"
									},
									"response": []
								}
							]
						}
					]
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "host",
			"value": "https://platform.fsm-dev.overit.cloud/fsmqa",
			"disabled": true
		},
		{
			"key": "IntAPIHost",
			"value": "https://integration-api-rest.s000000.dev.eu1.platform.overit.cloud/integration-api-rest/api/",
			"disabled": true
		},
		{
			"key": "assetCodeGenerator",
			"value": "\"TEST_ASSET\"",
			"type": "string"
		},
		{
			"key": "externalCodeGenerator",
			"value": "\"TEST_WORKORDER\"",
			"type": "string"
		},
		{
			"key": "serialNumber1",
			"value": ""
		},
		{
			"key": "serialNumber2",
			"value": ""
		},
		{
			"key": "operationCodeGenerator",
			"value": ""
		},
		{
			"key": "operationCodeGenerator1",
			"value": ""
		},
		{
			"key": "operationCodeGenerator2",
			"value": ""
		},
		{
			"key": "accountCodeGenerator",
			"value": ""
		},
		{
			"key": "updatedNotes",
			"value": ""
		},
		{
			"key": "valueGenerator",
			"value": ""
		},
		{
			"key": "characteristicCodeGenerator",
			"value": ""
		},
		{
			"key": "accountIdentifier",
			"value": ""
		},
		{
			"key": "serialNumberIdentifier",
			"value": ""
		},
		{
			"key": "assetIdentifier",
			"value": ""
		},
		{
			"key": "resourceIdentifier",
			"value": ""
		},
		{
			"key": "WorkShiftExceptionTypeIdentifier",
			"value": ""
		},
		{
			"key": "workShiftIdentifier",
			"value": ""
		},
		{
			"key": "host",
			"value": "https://platform.fsm-dev.overit.cloud/fsmdev1",
			"type": "string"
		},
		{
			"key": "workShiftTypeIdentifier",
			"value": ""
		},
		{
			"key": "workShiftTypeDescriptionUpdated",
			"value": ""
		},
		{
			"key": "startTime",
			"value": ""
		},
		{
			"key": "endTime",
			"value": ""
		},
		{
			"key": "context-path",
			"value": "integration-api-rest",
			"type": "string"
		}
	]
}