{
	"info": {
		"_postman_id": "8b2a7e5c-1234-4567-8901-abcdefabcdef",
		"name": "Maintenance Visit Completion (US-013)",
		"description": "Postman collection for the Maintenance Visit Completion Certificate and Data Locking feature.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Get Completion Certificate Data",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{baseUrl}}/api/maintenance/visits/{{visit_id}}/completion-certificate",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"api",
						"maintenance",
						"visits",
						"{{visit_id}}",
						"completion-certificate"
					]
				},
				"description": "Retrieves completion certificate data (if exists) and a summary of all installed parts for the visit to be reviewed by the client."
			},
			"response": []
		},
		{
			"name": "Submit Completion Certificate",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "signed_by_name",
							"value": "John Doe",
							"description": "Name of the client representative who signed the document",
							"type": "text"
						},
						{
							"key": "client_notes",
							"value": "The work was completed to satisfaction. All parts were shown.",
							"description": "Optional notes from the client",
							"type": "text"
						},
						{
							"key": "replaced_parts_acknowledged",
							"value": "1",
							"description": "Boolean (1/0) indicating client acknowledged replaced parts",
							"type": "text"
						},
						{
							"key": "signature_lat",
							"value": "24.7136",
							"description": "Latitude at the time of signing",
							"type": "text"
						},
						{
							"key": "signature_lng",
							"value": "46.6753",
							"description": "Longitude at the time of signing",
							"type": "text"
						},
						{
							"key": "document",
							"type": "file",
							"src": "",
							"description": "The signed completion certificate document (PDF/JPG/PNG)"
						}
					]
				},
				"url": {
					"raw": "{{baseUrl}}/api/maintenance/visits/{{visit_id}}/completion-certificate",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"api",
						"maintenance",
						"visits",
						"{{visit_id}}",
						"completion-certificate"
					]
				},
				"description": "Submits the completion certificate, uploads the signed document, transitions the visit to AWAITING_INVOICING status, and LOCKS the visit data (daily logs and parts)."
			},
			"response": []
		}
	],
	"variable": [
		{
			"key": "baseUrl",
			"value": "http://localhost:8000"
		},
		{
			"key": "visit_id",
			"value": "1"
		}
	]
}
