{
	"info": {
		"_postman_id": "8f7c9a2d-5e4b-4c1f-9e2a-1b3c4d5f6g7h",
		"name": "Supply Domain - Alternative Items API",
		"description": "Complete API collection for Supply Domain Alternative Item Selection Management with full request/response examples",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "50681087"
	},
	"item": [
		{
			"name": "Supply Order Item Alternatives",
			"item": [
				{
					"name": "Propose Alternative Item",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"alternative_item_name\": \"Generic Substitute Product\",\n  \"alternative_price\": 125.50,\n  \"alternative_item_id\": 456,\n  \"manufacturer\": \"Substitute Mfg Co\",\n  \"notes\": \"Available in stock, 10% cheaper, delivery within 2 days\"\n}"
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/items/123/alternatives/propose",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"items",
								"123",
								"alternatives",
								"propose"
							]
						},
						"description": "Agent proposes an alternative/substitute item for a supply order item"
					},
					"response": [
						{
							"name": "Propose Alternative - Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									},
									{
										"key": "Content-Type",
										"value": "application/json",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"alternative_item_name\": \"Generic Substitute Product\",\n  \"alternative_price\": 125.50,\n  \"alternative_item_id\": 456,\n  \"manufacturer\": \"Substitute Mfg Co\",\n  \"notes\": \"Available in stock, 10% cheaper, delivery within 2 days\"\n}"
								},
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/items/123/alternatives/propose",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"items",
										"123",
										"alternatives",
										"propose"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Alternative item proposed successfully\", \"result\": {\"id\": 1, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Generic Substitute Product\", \"alternative_item_id\": 456, \"original_price\": 150.00, \"alternative_price\": 125.50, \"manufacturer\": \"Substitute Mfg Co\", \"notes\": \"Available in stock, 10% cheaper, delivery within 2 days\", \"status\": \"proposed\", \"is_proposed\": true, \"proposer\": {\"id\": 5, \"name\": \"Agent Name\", \"email\": \"agent@example.com\"}, \"proposed_at\": \"2026-01-01T10:00:00.000000Z\"}}"
						}
					]
				},
				{
					"name": "Get Item Alternatives",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/items/123/alternatives",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"items",
								"123",
								"alternatives"
							]
						},
						"description": "Retrieve all alternative items proposed for a specific supply order item"
					},
					"response": [
						{
							"name": "Get Alternatives - Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									}
								],
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/items/123/alternatives",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"items",
										"123",
										"alternatives"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Alternatives retrieved successfully\", \"result\": [{\"id\": 1, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Generic Substitute Product\", \"alternative_price\": 125.50, \"original_price\": 150.00, \"status\": \"proposed\", \"proposer\": {\"id\": 5, \"name\": \"Agent\", \"email\": \"agent@example.com\"}}, {\"id\": 2, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Premium Alternative\", \"alternative_price\": 140.00, \"original_price\": 150.00, \"status\": \"proposed\", \"proposer\": {\"id\": 5, \"name\": \"Agent\", \"email\": \"agent@example.com\"}}]}"
						}
					]
				},
				{
					"name": "Compare Alternatives",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/items/123/alternatives/compare",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"items",
								"123",
								"alternatives",
								"compare"
							]
						},
						"description": "Get detailed comparison of all alternatives with original item"
					},
					"response": [
						{
							"name": "Compare Alternatives - Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									}
								],
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/items/123/alternatives/compare",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"items",
										"123",
										"alternatives",
										"compare"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Comparison retrieved successfully\", \"result\": {\"original\": {\"id\": 123, \"name\": \"Original Product\", \"price\": 150.00}, \"alternatives\": [{\"id\": 1, \"name\": \"Generic Substitute Product\", \"price\": 125.50, \"savings\": 24.50, \"savings_percentage\": 16.33, \"status\": \"proposed\"}, {\"id\": 2, \"name\": \"Premium Alternative\", \"price\": 140.00, \"savings\": 10.00, \"savings_percentage\": 6.67, \"status\": \"proposed\"}]}}"
						}
					]
				},
				{
					"name": "Get Pending Alternatives",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/alternatives/pending",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"alternatives",
								"pending"
							]
						},
						"description": "Admin retrieves all alternatives pending approval"
					},
					"response": [
						{
							"name": "Get Pending - Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									}
								],
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/alternatives/pending",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"alternatives",
										"pending"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Pending alternatives retrieved successfully\", \"result\": [{\"id\": 1, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Generic Substitute Product\", \"alternative_price\": 125.50, \"original_price\": 150.00, \"status\": \"pending_approval\", \"proposer\": {\"id\": 5, \"name\": \"Agent Name\", \"email\": \"agent@example.com\"}, \"proposed_at\": \"2026-01-01T10:00:00.000000Z\"}]}"
						}
					]
				},
				{
					"name": "Approve Alternative",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"notes\": \"Alternative meets all quality and price requirements\"\n}"
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/alternatives/1/approve",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"alternatives",
								"1",
								"approve"
							]
						},
						"description": "Admin approves an alternative item proposal"
					},
					"response": [
						{
							"name": "Approve Alternative - Success",
							"originalRequest": {
								"method": "PATCH",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									},
									{
										"key": "Content-Type",
										"value": "application/json",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"notes\": \"Alternative meets all quality and price requirements\"\n}"
								},
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/alternatives/1/approve",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"alternatives",
										"1",
										"approve"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Alternative approved successfully\", \"result\": {\"id\": 1, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Generic Substitute Product\", \"alternative_price\": 125.50, \"original_price\": 150.00, \"status\": \"approved\", \"is_approved\": true, \"reviewer\": {\"id\": 2, \"name\": \"Admin User\", \"email\": \"admin@example.com\"}, \"approved_at\": \"2026-01-15T14:30:00.000000Z\", \"notes\": \"Alternative meets all quality and price requirements\", \"supply_order_item\": {\"id\": 123, \"alternative_status\": \"alternative_approved\", \"updated_price\": 125.50}}}"
						}
					]
				},
				{
					"name": "Reject Alternative",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"rejection_reason\": \"Product does not meet quality standards\"\n}"
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/alternatives/1/reject",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"alternatives",
								"1",
								"reject"
							]
						},
						"description": "Admin rejects an alternative item proposal"
					},
					"response": [
						{
							"name": "Reject Alternative - Success",
							"originalRequest": {
								"method": "PATCH",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									},
									{
										"key": "Content-Type",
										"value": "application/json",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"rejection_reason\": \"Product does not meet quality standards\"\n}"
								},
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/alternatives/1/reject",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"alternatives",
										"1",
										"reject"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Alternative rejected successfully\", \"result\": {\"id\": 1, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Generic Substitute Product\", \"alternative_price\": 125.50, \"original_price\": 150.00, \"status\": \"rejected\", \"is_rejected\": true, \"rejection_reason\": \"Product does not meet quality standards. Test results show inconsistent performance\", \"reviewer\": {\"id\": 2, \"name\": \"Admin User\", \"email\": \"admin@example.com\"}, \"rejected_at\": \"2026-01-15T15:45:00.000000Z\", \"supply_order_item\": {\"id\": 123, \"alternative_status\": \"alternative_rejected\"}}}"
						}
					]
				},
				{
					"name": "Send Alternative for Approval",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/alternatives/1/send-for-approval",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [
								"supply",
								"alternatives",
								"1",
								"send-for-approval"
							]
						},
						"description": "Agent submits a proposed alternative to admin for approval review"
					},
					"response": [
						{
							"name": "Send for Approval - Success",
							"originalRequest": {
								"method": "PATCH",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer token",
										"type": "text"
									}
								],
								"url": {
									"raw": "http://localhost:8000/api/v1/supply/alternatives/1/send-for-approval",
									"protocol": "http",
									"host": [
										"localhost"
									],
									"port": "8000",
									"path": [
										"api",
										"v1",
										"supply",
										"alternatives",
										"1",
										"send-for-approval"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [],
							"cookie": [],
							"body": "{\"success\": true, \"code\": 200, \"message\": \"Alternative sent for approval successfully\", \"result\": {\"id\": 1, \"status\": \"pending_approval\", \"is_pending\": true, \"supply_order_item_id\": 123, \"alternative_item_name\": \"Generic Substitute Product\", \"alternative_price\": 125.50, \"original_price\": 150.00, \"price_difference\": -24.50, \"proposer\": {\"id\": 5, \"name\": \"Ahmed Mohamed\", \"email\": \"ahmed@example.com\"}, \"supply_order_item\": {\"id\": 123, \"alternative_status\": \"alternative_pending_approval\"}}}"
						}
					]
				}
			]
		}
	],
	"variable": [
		{
			"key": "BASE_URL",
			"value": "http://localhost:8000/api/v1",
			"type": "string"
		},
		{
			"key": "access_token",
			"value": "your_bearer_token_here",
			"type": "string"
		}
	]
}
