{
  "info": {
    "name": "Jisr Attendance Automation",
    "_postman_id": "7f4c72b0-1010-4ef2-b8e5-23e2c251aa23",
    "description": "Automates Jisr login and geofencing attendance (checkin/checkout).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Jisr Login",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Accept", "value": "application/json" },
          { "key": "User-Agent", "value": "JisrApp/7.9 CFNetwork/3860.100.1 Darwin/25.0.0" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"login\": \"amolood@icloud.com\",\n  \"password\": \"Mulfi@2019@@\",\n  \"slug\": \"unistep\",\n  \"type\": \"ios\"\n}"
        },
        "url": {
          "raw": "https://mobile.jisr.net/v2/sessions?slug=unistep",
          "protocol": "https",
          "host": ["mobile", "jisr", "net"],
          "path": ["v2", "sessions"],
          "query": [{ "key": "slug", "value": "unistep" }]
        }
      },
      "response": [],
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "let res = pm.response.json();",
              "if (res.data && res.data.access_token) {",
              "    pm.collectionVariables.set('jisr_access_token', res.data.access_token);",
              "    console.log('✅ Access token saved to collection variables');",
              "    postman.setNextRequest('Jisr Geofencing Log');",
              "} else {",
              "    console.error('❌ Login failed or token missing');",
              "}"
            ],
            "type": "text/javascript"
          }
        }
      ]
    },
    {
      "name": "Jisr Geofencing Log",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Accept", "value": "application/json" },
          { "key": "locale", "value": "ar" },
          { "key": "x-api-key", "value": "shrU9aKcVc2O1CPVmY0qs16EDSZorwXF3H1LmgTN" },
          { "key": "access-token", "value": "{{jisr_access_token}}" },
          { "key": "x-app-version", "value": "ios::8.0.79" },
          { "key": "env", "value": "aws" },
          { "key": "User-Agent", "value": "JisrApp/7.9 CFNetwork/3860.100.1 Darwin/25.0.0" },
          { "key": "Cookie", "value": "access_token={{jisr_access_token}}" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"device_brand\": \"Apple\",\n  \"device_identifier\": \"1F7DA57C-D5A1-48BF-8904-A389060B58FA\",\n  \"device_version\": \"iPhone\",\n  \"employee_identifier\": \"12\",\n  \"identifier\": 15073,\n  \"latitude\": 21.521529,\n  \"location_id\": 71561,\n  \"longitude\": 39.180747,\n  \"operating_system\": \"ios\",\n  \"os_version\": \"26.0\",\n  \"serial_number\": \"1F7DA57C-D5A1-48BF-8904-A389060B58FA\",\n  \"timezone\": 10800\n}"
        },
        "url": {
          "raw": "https://geofencing.jisr.net/aws/geofencing_logs?slug=unistep",
          "protocol": "https",
          "host": ["geofencing", "jisr", "net"],
          "path": ["aws", "geofencing_logs"],
          "query": [{ "key": "slug", "value": "unistep" }]
        }
      },
      "response": []
    }
  ],
  "variable": [
    {
      "key": "jisr_access_token",
      "value": ""
    }
  ]
}
