{
  "info": {
    "_postman_id": "e4150c98-0d1c-4c69-9e61-71b8294100dd",
  "name": "ContractShield API (Preview)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
  "description": "Starter collection for the ContractShield public API. Update the host variables once production URLs are finalized."
  },
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Sign in",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"{{testEmail}}\",\n  \"password\": \"{{testPassword}}\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/auth/sign-in",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "sign-in"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Refresh session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refresh_token\": \"{{refreshToken}}\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/auth/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "refresh"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Projects",
      "item": [
        {
          "name": "List projects",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{accessToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/projects",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "projects"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Create project",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{accessToken}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Downtown Renovation\",\n  \"budget\": 250000,\n  \"due_date\": \"2025-01-31\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/projects",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "projects"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Payments",
      "item": [
        {
          "name": "Record payment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{accessToken}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"project_id\": \"{{projectId}}\",\n  \"amount\": 12500,\n  \"currency\": \"USD\",\n  \"status\": \"posted\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/payments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "payments"
              ]
            }
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:3000/api",
      "type": "string"
    },
    {
      "key": "testEmail",
      "value": "contractor@example.com",
      "type": "string"
    },
    {
      "key": "testPassword",
      "value": "Passw0rd!",
      "type": "string"
    },
    {
      "key": "accessToken",
      "value": "",
      "type": "string"
    },
    {
      "key": "refreshToken",
      "value": "",
      "type": "string"
    },
    {
      "key": "projectId",
      "value": "",
      "type": "string"
    }
  ]
}
