{
  "info": {
    "_postman_id": "recruitment-departments-simple",
    "name": "Recruitment Departments API",
    "description": "Recruitment Departments CRUD Endpoints",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{access_token}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Get All Departments",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments"
          ],
          "query": [
            {
              "key": "page",
              "value": "1",
              "disabled": true
            },
            {
              "key": "per_page",
              "value": "15",
              "disabled": true
            }
          ]
        }
      },
      "response": []
    },
    {
      "name": "Get Active Departments",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments/active",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments",
            "active"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Get Department by ID",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments/1",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments",
            "1"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Create Department",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "if (pm.response.code === 201) {",
              "    const data = pm.response.json();",
              "    pm.environment.set('department_id', data.data.id);",
              "}"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"name\": \"IT Department\",\n    \"code\": \"IT-001\",\n    \"description\": \"Information Technology Department\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Update Department",
      "request": {
        "method": "PUT",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"name\": \"IT Department Updated\",\n    \"code\": \"IT-001\",\n    \"description\": \"Updated Information Technology Department\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments/1",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments",
            "1"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Delete Department",
      "request": {
        "method": "DELETE",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments/1",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments",
            "1"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Activate Department",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"is_active\": true\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments/1/activate",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments",
            "1",
            "activate"
          ]
        }
      },
      "response": []
    },
    {
      "name": "Deactivate Department",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"is_active\": false\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/recruitment/departments/1/deactivate",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "recruitment",
            "departments",
            "1",
            "deactivate"
          ]
        }
      },
      "response": []
    }
  ],
  "variable": [
    {
      "key": "BASE_URL",
      "value": "http://localhost:8000/api/v1",
      "type": "string"
    },
    {
      "key": "auth_token",
      "value": "",
      "type": "string"
    },
    {
      "key": "department_id",
      "value": "",
      "type": "string"
    }
  ]
}
