{
  "info": {
    "name": "ERPFlow API",
    "description": "ERPFlow nwidart migration baseline collection",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "http://localhost:8010/api/v1" },
    { "key": "token", "value": "" },
    { "key": "company_uuid", "value": "" }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Login (Admin)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Accept", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"admin@erpflow.local\",\n  \"password\": \"password\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": "{{base_url}}/auth/login"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const json = pm.response.json();",
                  "pm.collectionVariables.set('token', json.data.access_token);",
                  "pm.collectionVariables.set('company_uuid', json.data.companies[0].uuid);"
                ]
              }
            }
          ]
        },
        {
          "name": "Login (Employee)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Accept", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"employee@erpflow.local\",\n  \"password\": \"password\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": "{{base_url}}/auth/login"
          }
        }
      ]
    },
    {
      "name": "Permissions",
      "item": [
        {
          "name": "GET /me/permissions",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "X-Company-Id", "value": "{{company_uuid}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/me/permissions"
          }
        }
      ]
    },
    {
      "name": "Configuration",
      "item": [
        {
          "name": "GET /configuration/health",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "X-Company-Id", "value": "{{company_uuid}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/configuration/health"
          }
        },
        {
          "name": "GET /configuration/employee",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "X-Company-Id", "value": "{{company_uuid}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/configuration/employee"
          }
        },
        {
          "name": "GET /configuration/employee-configs",
          "request": {
            "method": "GET",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "X-Company-Id", "value": "{{company_uuid}}" },
              { "key": "Accept", "value": "application/json" }
            ],
            "url": "{{base_url}}/configuration/employee-configs"
          }
        },
        {
          "name": "POST /configuration/employee-configs",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}" },
              { "key": "X-Company-Id", "value": "{{company_uuid}}" },
              { "key": "Accept", "value": "application/json" },
              { "key": "Content-Type", "value": "application/json" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Default Shift Policy\"\n}",
              "options": { "raw": { "language": "json" } }
            },
            "url": "{{base_url}}/configuration/employee-configs"
          }
        }
      ]
    }
  ]
}
