{
	"info": {
		"_postman_id": "4d7a8e9b-1234-4567-890a-bcdef1234567",
		"name": "Maintenance - Contract Lifecycle Automation",
		"description": "Endpoints for Maintenance Contract lifecycle management: Early Termination and Renewal Flows.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Contracts",
			"item": [
				{
					"name": "Terminate Contract",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"reason\": \"Manual termination requested by the Technical Manager.\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/maintenance/contracts/:id/terminate",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"maintenance",
								"contracts",
								":id",
								"terminate"
							],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "The ID of the maintenance contract to terminate"
								}
							]
						},
						"description": "Terminates a maintenance contract. This action is irreversible, cancels all PLANNED/SCHEDULED visits, and notifies the relevant roles. Restricted to R-08 Technical Manager."
					},
					"response": []
				},
				{
					"name": "Renew Contract",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/maintenance/contracts/:id/renew",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"maintenance",
								"contracts",
								":id",
								"renew"
							],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "The ID of the maintenance contract to renew"
								}
							]
						},
						"description": "Clones the current contract into a new DRAFT contract, incrementing dates and linking back to the original via renewed_from_contract_id."
					},
					"response": []
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost:8000/api/v1",
			"type": "string"
		}
	]
}
