{
	"info": {
		"_postman_id": "8b482050-d18e-418b-b2df-f2e2b082eb2a",
		"name": "TMF-Demo",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "12955180"
	},
	"item": [
		{
			"name": "Create Product Spec (by provider)",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"PRODUCT_SPEC_ID\", jsonData.id)"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{provider_employee_token}}",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"name\": \"Packet Delivery Premium Service Spec\",\n    \"productSpecCharacteristic\": [\n        {\n            \"name\": \"Service Endpoint\",\n            \"valueType\": \"string\",\n            \"productSpecCharacteristicValue\": [\n                {\n                    \"valueType\": \"string\",\n                    \"value\": \"https://<provider_NGSI-LD_endpoint>\"\n                }\n            ]\n        }\n    ]\n}"
				},
				"url": {
					"raw": "{{tmf_url}}/tmf-api/productCatalogManagement/v4/productSpecification",
					"host": [
						"{{tmf_url}}"
					],
					"path": [
						"tmf-api",
						"productCatalogManagement",
						"v4",
						"productSpecification"
					]
				}
			},
			"response": []
		},
		{
			"name": "Create Product Offering (by provider)",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"PRODUCT_OFFERING_ID\", jsonData.id)"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{provider_employee_token}}",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"description\": \"My Offering description\",\n    \"isBundle\": false,\n    \"isSellable\": true,\n    \"lifecycleStatus\": \"Active\",\n    \"name\": \"Packet Delivery Premium Service\",\n    \"productSpecification\": {\n        \"id\": \"{{PRODUCT_SPEC_ID}}\",\n        \"name\": \"Packet Delivery Premium Service Spec\"\n    }\n}"
				},
				"url": {
					"raw": "{{tmf_url}}/tmf-api/productCatalogManagement/v4/productOffering",
					"host": [
						"{{tmf_url}}"
					],
					"path": [
						"tmf-api",
						"productCatalogManagement",
						"v4",
						"productOffering"
					]
				}
			},
			"response": []
		},
		{
			"name": "Create Organization (by consumer)",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"postman.setEnvironmentVariable(\"ORGANIZATION_ID\", jsonData.id)"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{lear_token}}",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"name\": \"HappyPets\",\n    \"tradingName\": \"HappyPets\",\n    \"partyCharacteristic\": [\n        {\n            \"name\": \"did\",\n            \"valueType\": \"string\",\n            \"value\": \"{{DID}}\"\n        }\n    ]\n}"
				},
				"url": {
					"raw": "{{tmf_url}}/tmf-api/party/v4/organization",
					"host": [
						"{{tmf_url}}"
					],
					"path": [
						"tmf-api",
						"party",
						"v4",
						"organization"
					]
				}
			},
			"response": []
		},
		{
			"name": "Get Product Offerings (by Consumer)",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{buyer_token}}",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{tmf_url}}/tmf-api/productCatalogManagement/v4/productOffering",
					"host": [
						"{{tmf_url}}"
					],
					"path": [
						"tmf-api",
						"productCatalogManagement",
						"v4",
						"productOffering"
					]
				}
			},
			"response": []
		},
		{
			"name": "Create Product Order (by consumer)",
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"exec": [
							"var uuid = require('uuid')",
							"",
							"pm.environment.set(\"PRODUCT_ORDER_ID\", uuid.v4());",
							""
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{buyer_token}}",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"productOrderItem\": [\n        {\n      \"id\": \"{{PRODUCT_ORDER_ID}}\",      \"action\": \"add\",\n            \"productOffering\": {\n                \"id\": \"{{PRODUCT_OFFERING_ID}}\",\n                \"name\": \"Packet Delivery Premium Service\"\n            }\n        }\n    ],\n    \"relatedParty\": [\n        {\n            \"id\": \"{{ORGANIZATION_ID}}\",\n            \"name\": \"HappyPets\"\n        }\n    ]\n}"
				},
				"url": {
					"raw": "{{tmf_url}}/tmf-api/productOrderingManagement/v4/productOrder",
					"host": [
						"{{tmf_url}}"
					],
					"path": [
						"tmf-api",
						"productOrderingManagement",
						"v4",
						"productOrder"
					]
				}
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "tmf_url",
			"value": "https://tmf-url.com",
			"type": "string"
		},
		{
			"key": "lear_token",
			"value": "<my-lear-token>",
			"type": "string"
		},
		{
			"key": "buyer_token",
			"value": "<my_buyer_token>",
			"type": "string"
		},
		{
			"key": "provider_employee_token",
			"value": "<my_provider_employee_token>",
			"type": "string"
		},
		{
			"key": "DID",
			"value": "<my_buyer_organization_did>",
			"type": "string"
		},
		{
			"key": "ORGANIZATION_ID",
			"value": "",
			"type": "string"
		},
		{
			"key": "PRODUCT_OFFERING_ID",
			"value": "",
			"type": "string"
		},
		{
			"key": "PRODUCT_SPEC_ID",
			"value": "",
			"type": "string"
		}
	]
}