{
    "info": {
        "name": "Family Tree API — شجرة العائلة",
        "description": "**Family Tree API v1** — Laravel backend for the Flutter app of one family: its full tree, the profile of every member (alive or deceased) and the family news.\n\n1. Import this collection and the environment `FamilyTree.local.postman_environment.json`, then select the environment.\n2. Run **0. Quick start** in the Collection Runner: it logs in as the admin, adds a father with sons and daughters, publishes a post, then a staff member adds a son that the admin approves.\n3. Change `{{locale}}` to `en` or `ar` to switch the language of data, labels and error messages.\n\n**Who can do what**\n- Everyone (no account): browse the family, the graph, every profile and the news.\n- Member (registered): comment and like, where the post allows it.\n- Staff: add and edit the tree and the news. Without `persons.direct` / `posts.direct` the call returns **202** with a change request for the admin.\n- Admin: everything, plus staff permissions and approvals. Notified of every staff action.\n\n- Errors always look like `{ \"message\", \"code\", \"errors\"? }`. `code` never changes with the language.\n- Translatable fields accept `{\"ar\": \"...\", \"en\": \"...\"}`, or a plain string with `Content-Language`.\n- Accounts (`password123`): `demo@tree.test` admin, `staff@tree.test` staff, `admin@tree.test` developer.",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{token}}",
                "type": "string"
            }
        ]
    },
    "item": [
        {
            "name": "0. Quick start — سيناريو كامل",
            "description": "شغّل هذا المجلد بالترتيب في Collection Runner: دخول المدير ← أب وأبناء وبنات ← وفاة ← الرسم ← خبر نعي ← موظف يضيف ابناً فينتظر الموافقة ← المدير يوافق.",
            "item": [
                {
                    "name": "Login as admin (demo)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/login",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "login"
                            ],
                            "query": []
                        },
                        "description": "The family admin. Saves {{token}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{email}}\",\n    \"password\": \"{{password}}\",\n    \"device_name\": \"postman\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.token'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('token', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Family details (public)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/family",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "family"
                            ],
                            "query": []
                        },
                        "description": "No token needed: the whole app is public to browse.",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Create person (father)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons"
                            ],
                            "query": []
                        },
                        "description": "Saves {{person_id}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"title\": {\n        \"ar\": \"الحاج\",\n        \"en\": \"Hajj\"\n    },\n    \"first_name\": {\n        \"ar\": \"أحمد\",\n        \"en\": \"Ahmad\"\n    },\n    \"last_name\": {\n        \"ar\": \"الخضري\",\n        \"en\": \"Al-Khudari\"\n    },\n    \"gender\": \"male\",\n    \"birth_date\": \"1950-05-01\",\n    \"kunya\": {\n        \"ar\": \"أبو محمد\",\n        \"en\": \"Abu Mohammed\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 201', () => pm.response.to.have.status(201));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('person_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Add daughter (+) — 1981",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "Entered before her elder brother on purpose: the order is still by birth date. Saves {{daughter_id}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"daughter\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"زينب\",\n            \"en\": \"Zainab\"\n        },\n        \"birth_date\": \"1981-09-20\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 201', () => pm.response.to.have.status(201));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.person.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('daughter_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Add son (+) — 1975",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "Saves {{child_id}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"son\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"محمد\",\n            \"en\": \"Mohammed\"\n        },\n        \"birth_date\": \"1975-01-10\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 201', () => pm.response.to.have.status(201));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.person.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('child_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Add son (+) — 1985",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"son\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"عمر\",\n            \"en\": \"Omar\"\n        },\n        \"birth_date\": \"1985-11-30\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 201', () => pm.response.to.have.status(201));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Family — father and children",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/family",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "family"
                            ],
                            "query": []
                        },
                        "description": "Sons and daughters together, eldest first. `meta` counts sons and daughters.",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Daughter passed away",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{daughter_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{daughter_id}}"
                            ],
                            "query": []
                        },
                        "description": "Her profile now shows the death date and burial place.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"life_status\": \"deceased\",\n    \"death_date\": \"2010-12-01\",\n    \"burial_place\": {\n        \"ar\": \"دمشق\",\n        \"en\": \"Damascus\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Graph (canvas, public)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/graph",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "graph"
                            ],
                            "query": []
                        },
                        "description": "nodes + families (each father with his children, eldest first). Keep the ETag and send If-None-Match next time → 304.",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));",
                                    "pm.environment.set('graph_etag', pm.response.headers.get('ETag'));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Person card (bottom sheet, public)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{daughter_id}}/card",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{daughter_id}}",
                                "card"
                            ],
                            "query": []
                        },
                        "description": "`death` holds the date, place and burial place.",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Publish an obituary about her",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": []
                        },
                        "description": "Saves {{post_id}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"type\": \"obituary\",\n    \"title\": {\n        \"ar\": \"انتقلت إلى رحمة الله زينب\",\n        \"en\": \"Zainab has passed away\"\n    },\n    \"body\": {\n        \"ar\": \"إنا لله وإنا إليه راجعون\",\n        \"en\": \"To God we belong and to Him we return\"\n    },\n    \"person_ids\": [\n        \"{{daughter_id}}\"\n    ],\n    \"allow_comments\": true,\n    \"allow_likes\": false\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 201', () => pm.response.to.have.status(201));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('post_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Login as staff",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/login",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "login"
                            ],
                            "query": []
                        },
                        "description": "Saves {{staff_token}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{staff_email}}\",\n    \"password\": \"{{password}}\",\n    \"device_name\": \"postman\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.token'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('staff_token', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Staff adds a son → 202 waiting for approval",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "Staff without `persons.direct`: nothing is saved yet. Saves {{change_request_id}}; the admin gets a notification.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"son\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"يوسف\",\n            \"en\": \"Yousef\"\n        },\n        \"birth_date\": \"1990-03-12\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 202', () => pm.response.to.have.status(202));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.change_request.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('change_request_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Admin: notifications",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications"
                            ],
                            "query": []
                        },
                        "description": ""
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Admin: approve the request",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests/{{change_request_id}}/approve",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests",
                                "{{change_request_id}}",
                                "approve"
                            ],
                            "query": []
                        },
                        "description": "The son is added now, as if the staff member saved it. The staff member is notified."
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "News feed (public)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 200', () => pm.response.to.have.status(200));"
                                ]
                            }
                        }
                    ]
                }
            ]
        },
        {
            "name": "1. Auth — المصادقة",
            "description": "Accounts: admin `demo@tree.test`, staff `staff@tree.test`, developer `admin@tree.test` (all `password123`). Registering creates a member account (comments and likes).",
            "item": [
                {
                    "name": "Register (member)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/register",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "register"
                            ],
                            "query": []
                        },
                        "description": "Saves {{member_token}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"محمد\",\n    \"email\": \"new.member@tree.test\",\n    \"password\": \"password123\",\n    \"password_confirmation\": \"password123\",\n    \"locale\": \"ar\",\n    \"device_name\": \"postman\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.token'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('member_token', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Login as admin",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/login",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "login"
                            ],
                            "query": []
                        },
                        "description": "Saves {{token}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{email}}\",\n    \"password\": \"{{password}}\",\n    \"device_name\": \"postman\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.token'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('token', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Login as staff",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/login",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "login"
                            ],
                            "query": []
                        },
                        "description": "Saves {{staff_token}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{staff_email}}\",\n    \"password\": \"{{password}}\",\n    \"device_name\": \"postman\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.token'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('staff_token', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Login as member",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/login",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "login"
                            ],
                            "query": []
                        },
                        "description": "Saves {{member_token}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"new.member@tree.test\",\n    \"password\": \"{{password}}\",\n    \"device_name\": \"postman\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.token'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('member_token', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Me (profile, roles, permissions)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/me",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "me"
                            ],
                            "query": []
                        },
                        "description": "The app shows the add / edit buttons from `permissions`. Without `persons.direct` / `posts.direct` the staff member's changes need approval."
                    }
                },
                {
                    "name": "Update profile",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/me",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "me"
                            ],
                            "query": []
                        },
                        "description": "`locale` is used when no Accept-Language header is sent.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"مدير العائلة\",\n    \"locale\": \"ar\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Change password",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/me/password",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "me",
                                "password"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"current_password\": \"{{password}}\",\n    \"password\": \"password123\",\n    \"password_confirmation\": \"password123\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Forgot password",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/forgot-password",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "forgot-password"
                            ],
                            "query": []
                        },
                        "description": "With MAIL_MAILER=log the link is in storage/logs.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"email\": \"{{email}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Reset password",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/reset-password",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "reset-password"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"token\": \"TOKEN_FROM_EMAIL\",\n    \"email\": \"{{email}}\",\n    \"password\": \"password123\",\n    \"password_confirmation\": \"password123\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Logout (this device)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/logout",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "logout"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Logout (all devices)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/logout-all",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "logout-all"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Delete my account",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/auth/me",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "auth",
                                "me"
                            ],
                            "query": []
                        },
                        "description": "Careful: deletes the account.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"password\": \"{{password}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{member_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                }
            ]
        },
        {
            "name": "2. Meta — بيانات عامة",
            "description": "Public data for the app (no token).",
            "item": [
                {
                    "name": "Languages",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/meta/languages",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "meta",
                                "languages"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Enums with translated labels",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/meta/enums",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "meta",
                                "enums"
                            ],
                            "query": []
                        },
                        "description": "Gender, life status, post types… Gendered Arabic labels: `label` (male) and `label_female`.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Public settings",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/meta/settings",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "meta",
                                "settings"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                }
            ]
        },
        {
            "name": "3. Family — العائلة",
            "description": "The app shows one family. Everything under it has no tree id in the URL.",
            "item": [
                {
                    "name": "Family details",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/family",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "family"
                            ],
                            "query": []
                        },
                        "description": "Name, root person, settings, counters.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Family statistics",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/family/stats",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "family",
                                "stats"
                            ],
                            "query": []
                        },
                        "description": "Persons, males / females, alive / deceased, generations, top names.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Update family (admin)",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/family",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "family"
                            ],
                            "query": []
                        },
                        "description": "`family.update` (admin). `lineage_depth` / `lineage_format` shape the lineage name: \"محمد بن أحمد بن علي الخضري\".",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": {\n        \"ar\": \"عائلة الخضري\",\n        \"en\": \"Al-Khudari Family\"\n    },\n    \"description\": {\n        \"ar\": \"شجرة عائلة الخضري وأخبارها\",\n        \"en\": \"The Al-Khudari family tree and news\"\n    },\n    \"root_person_id\": \"{{person_id}}\",\n    \"settings\": {\n        \"lineage_depth\": 4,\n        \"lineage_format\": \"bin\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "4. Persons — الأفراد",
            "description": "Reading is public and shows the full profile, alive or deceased. Writing: admin, or staff (→ 202 change request without `persons.direct`).",
            "item": [
                {
                    "name": "List persons (filters)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons?filter[gender]=male&filter[life_status]=deceased&sort=birth_date&per_page=25",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons"
                            ],
                            "query": [
                                {
                                    "key": "filter[gender]",
                                    "value": "male"
                                },
                                {
                                    "key": "filter[life_status]",
                                    "value": "deceased"
                                },
                                {
                                    "key": "sort",
                                    "value": "birth_date"
                                },
                                {
                                    "key": "per_page",
                                    "value": "25"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Quick search (all languages)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/search?q=احمد",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "search"
                            ],
                            "query": [
                                {
                                    "key": "q",
                                    "value": "احمد"
                                }
                            ]
                        },
                        "description": "\"احمد\" finds \"أحمد\"; \"Ahmad\" works too.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Search by reference number",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/search?q=784",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "search"
                            ],
                            "query": [
                                {
                                    "key": "q",
                                    "value": "784"
                                }
                            ]
                        },
                        "description": "A number finds the person with that `ref_no` (the family spreadsheet number).",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Person profile",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}"
                            ],
                            "query": []
                        },
                        "description": "Every field, including death date, place, cause and burial place.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Person profile (all translations, for edit forms)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}?all_translations=1",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}"
                            ],
                            "query": [
                                {
                                    "key": "all_translations",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Person card (bottom sheet)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/card",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "card"
                            ],
                            "query": []
                        },
                        "description": "`can` lists the buttons for the current user; `can.needs_review` = their changes go to the admin.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "News about a person",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{daughter_id}}/posts",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{daughter_id}}",
                                "posts"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Create person",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"ref_no\": 1190,\n    \"title\": {\n        \"ar\": \"الحاج\",\n        \"en\": \"Hajj\"\n    },\n    \"first_name\": {\n        \"ar\": \"علي\",\n        \"en\": \"Ali\"\n    },\n    \"last_name\": {\n        \"ar\": \"الخضري\",\n        \"en\": \"Al-Khudari\"\n    },\n    \"gender\": \"male\",\n    \"birth_date\": \"1920-01-01\",\n    \"birth_date_precision\": \"year\",\n    \"life_status\": \"deceased\",\n    \"death_date\": \"1990-03-10\",\n    \"death_place\": {\n        \"ar\": \"دمشق\",\n        \"en\": \"Damascus\"\n    },\n    \"burial_place\": {\n        \"ar\": \"مقبرة الباب الصغير\",\n        \"en\": \"Bab al-Saghir cemetery\"\n    },\n    \"tribe\": {\n        \"ar\": \"بني فلان\",\n        \"en\": \"Bani X\"\n    },\n    \"occupation\": {\n        \"ar\": \"تاجر\",\n        \"en\": \"Merchant\"\n    },\n    \"bio\": {\n        \"ar\": \"نبذة عن حياته\",\n        \"en\": \"About his life\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Update person",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"occupation\": {\n        \"ar\": \"مهندس مدني\",\n        \"en\": \"Civil engineer\"\n    },\n    \"bio\": {\n        \"ar\": \"نبذة قصيرة\",\n        \"en\": \"Short bio\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Update one language only (plain string)",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Language",
                                "value": "en"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}"
                            ],
                            "query": []
                        },
                        "description": "Only the `en` value changes because of the Content-Language header.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"nickname\": \"The Engineer\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Mark as deceased",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}"
                            ],
                            "query": []
                        },
                        "description": "The profile and card show the death date and place.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"life_status\": \"deceased\",\n    \"death_date\": \"2020-01-01\",\n    \"death_place\": {\n        \"ar\": \"عمّان\",\n        \"en\": \"Amman\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Set father",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/father",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "father"
                            ],
                            "query": []
                        },
                        "description": "Moves a person under another father (or `null` to clear). Lineage rules apply: male, older, no cycles.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"father_id\": \"{{person_id}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Upload photo",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/photo",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "photo"
                            ],
                            "query": []
                        },
                        "description": "multipart/form-data — choose a jpg/png/webp file for the `photo` field.",
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "photo",
                                    "type": "file",
                                    "src": []
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Delete photo",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/photo",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "photo"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Delete person (soft)",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}"
                            ],
                            "query": []
                        },
                        "description": "`persons.delete`."
                    }
                },
                {
                    "name": "Trash",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/trash/persons",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "trash",
                                "persons"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Restore person",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/restore",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "restore"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Delete permanently (admin)",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/force",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "force"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                }
            ]
        },
        {
            "name": "5. Family relations — الأسرة",
            "description": "Lineage goes through the father: sons and daughters together, eldest first.",
            "item": [
                {
                    "name": "Family (father and children)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/family",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "family"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Children",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/children",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "children"
                            ],
                            "query": []
                        },
                        "description": "`meta` counts sons and daughters.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Relatives (father, grandfather, siblings, children, uncles and aunts)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Ancestors (father line)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/ancestors?depth=6",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "ancestors"
                            ],
                            "query": [
                                {
                                    "key": "depth",
                                    "value": "6"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Relationship between two people",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/relationship/{{person_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "relationship",
                                "{{person_id}}"
                            ],
                            "query": []
                        },
                        "description": "Closest shared ancestor through the father line: `label` (e.g. عم، بنت عم), `relation_code`, `common_ancestor` and the distance of each side.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Descendants",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/descendants?depth=3",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "descendants"
                            ],
                            "query": [
                                {
                                    "key": "depth",
                                    "value": "3"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Reorder children (twins / unknown dates)",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/children/order",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "children",
                                "order"
                            ],
                            "query": []
                        },
                        "description": "Send every child of this father, eldest first.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"order\": [\n        \"CHILD_ID_1\",\n        \"CHILD_ID_2\"\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add relative — son",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"son\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"يوسف\",\n            \"en\": \"Yousef\"\n        },\n        \"birth_date\": \"1990-03-12\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add relative — daughter",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "Children are added to men only (PARENT_GENDER_MISMATCH otherwise).",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"daughter\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"مريم\",\n            \"en\": \"Maryam\"\n        }\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add relative — father",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "Only when the person has no father yet (PARENT_ALREADY_SET).",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"father\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"علي\",\n            \"en\": \"Ali\"\n        },\n        \"life_status\": \"deceased\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add relative — brother",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "Same father. Needs the father (PARENTS_REQUIRED_FOR_SIBLING).",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"brother\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"سالم\",\n            \"en\": \"Salem\"\n        }\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add relative — sister",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{child_id}}/relatives",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{child_id}}",
                                "relatives"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"relation\": \"sister\",\n    \"person\": {\n        \"first_name\": {\n            \"ar\": \"سارة\",\n            \"en\": \"Sara\"\n        }\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "6. Graph — رسم الشجرة",
            "description": "For the Flutter canvas. Public.",
            "item": [
                {
                    "name": "Graph",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/graph?depth_up=2&depth_down=3&max_nodes=300",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "graph"
                            ],
                            "query": [
                                {
                                    "key": "depth_up",
                                    "value": "2"
                                },
                                {
                                    "key": "depth_down",
                                    "value": "3"
                                },
                                {
                                    "key": "max_nodes",
                                    "value": "300"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Graph — the whole family",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/graph?depth_down=12&max_nodes=2000",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "graph"
                            ],
                            "query": [
                                {
                                    "key": "depth_down",
                                    "value": "12"
                                },
                                {
                                    "key": "max_nodes",
                                    "value": "2000"
                                }
                            ]
                        },
                        "description": "All generations at once (up to 2000 nodes).",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Graph centered on a person",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/graph?root={{child_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "graph"
                            ],
                            "query": [
                                {
                                    "key": "root",
                                    "value": "{{child_id}}"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Graph — If-None-Match (304)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "If-None-Match",
                                "value": "{{graph_etag}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/graph",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "graph"
                            ],
                            "query": []
                        },
                        "description": "Returns 304 if nothing changed since {{graph_etag}}.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Expand a node",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/graph/expand/{{child_id}}?direction=down&depth=2",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "graph",
                                "expand",
                                "{{child_id}}"
                            ],
                            "query": [
                                {
                                    "key": "direction",
                                    "value": "down"
                                },
                                {
                                    "key": "depth",
                                    "value": "2"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                }
            ]
        },
        {
            "name": "7. News — أخبار العائلة",
            "description": "Reading is public. Writing: admin, or staff (→ 202 change request without `posts.direct`). Types: news, obituary, wedding, birth, event, announcement.",
            "item": [
                {
                    "name": "News feed",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts?per_page=20",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": [
                                {
                                    "key": "per_page",
                                    "value": "20"
                                }
                            ]
                        },
                        "description": "Pinned first, then newest.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "News feed — filter by type",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts?type=obituary",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": [
                                {
                                    "key": "type",
                                    "value": "obituary"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "News feed — search titles",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts?q=زفاف",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": [
                                {
                                    "key": "q",
                                    "value": "زفاف"
                                }
                            ]
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Drafts (writers)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts?status=draft",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": [
                                {
                                    "key": "status",
                                    "value": "draft"
                                }
                            ]
                        },
                        "description": "Users with `posts.create` can list drafts and scheduled posts."
                    }
                },
                {
                    "name": "Post details",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Create post (JSON)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": []
                        },
                        "description": "Saves {{post_id}}. `status=draft` keeps it hidden; a future `published_at` schedules it.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"type\": \"wedding\",\n    \"title\": {\n        \"ar\": \"زفاف محمد أحمد الخضري\",\n        \"en\": \"The wedding of Mohammed Al-Khudari\"\n    },\n    \"body\": {\n        \"ar\": \"يسرّ عائلة الخضري دعوتكم لحضور حفل الزفاف.\",\n        \"en\": \"The Al-Khudari family invites you to the wedding.\"\n    },\n    \"person_ids\": [\n        \"{{child_id}}\"\n    ],\n    \"is_pinned\": false,\n    \"allow_comments\": true,\n    \"allow_likes\": true,\n    \"status\": \"published\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('post_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Create post with images (multipart)",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": []
                        },
                        "description": "multipart/form-data: `title[ar]`, `type`, and up to 10 `images[]` files.",
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "title[ar]",
                                    "value": "صور من لقاء العائلة",
                                    "type": "text"
                                },
                                {
                                    "key": "title[en]",
                                    "value": "Family gathering photos",
                                    "type": "text"
                                },
                                {
                                    "key": "type",
                                    "value": "event",
                                    "type": "text"
                                },
                                {
                                    "key": "images[]",
                                    "type": "file",
                                    "src": []
                                },
                                {
                                    "key": "images[]",
                                    "type": "file",
                                    "src": []
                                }
                            ]
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('post_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Update post (settings)",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}"
                            ],
                            "query": []
                        },
                        "description": "Comments and likes are switched per post.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"is_pinned\": true,\n    \"allow_comments\": false,\n    \"allow_likes\": true\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Add images",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/images",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "images"
                            ],
                            "query": []
                        },
                        "description": "multipart/form-data, `images[]`. Saves the first image as {{image_id}}.",
                        "body": {
                            "mode": "formdata",
                            "formdata": [
                                {
                                    "key": "images[]",
                                    "type": "file",
                                    "src": []
                                }
                            ]
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.images.0.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('image_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Delete image",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/images/{{image_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "images",
                                "{{image_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Delete post",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                }
            ]
        },
        {
            "name": "8. Comments & likes — التعليقات والإعجابات",
            "description": "Any account (run \"Login as member\" first). Each works only when enabled on the post.",
            "item": [
                {
                    "name": "Comments of a post",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/comments",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "comments"
                            ],
                            "query": []
                        },
                        "description": "`meta.comments_enabled`.",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                },
                {
                    "name": "Add comment",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/comments",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "comments"
                            ],
                            "query": []
                        },
                        "description": "Saves {{comment_id}}. Comments off → COMMENTS_DISABLED.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"body\": \"ألف مبروك\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{member_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('comment_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Delete comment",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/comments/{{comment_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "comments",
                                "{{comment_id}}"
                            ],
                            "query": []
                        },
                        "description": "The author, or `comments.moderate`.",
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{member_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Like",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/like",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "like"
                            ],
                            "query": []
                        },
                        "description": "Likes off → LIKES_DISABLED.",
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{member_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Unlike",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/like",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "like"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{member_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Who liked",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts/{{post_id}}/likes",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts",
                                "{{post_id}}",
                                "likes"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "noauth"
                        }
                    }
                }
            ]
        },
        {
            "name": "9. Staff approvals — طلبات الموظفين",
            "description": "A staff write without `persons.direct` / `posts.direct` returns 202 with a change request. The admin approves (the call is applied as the staff member) or rejects with a note. Both sides are notified.",
            "item": [
                {
                    "name": "Staff: add person → 202",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons"
                            ],
                            "query": []
                        },
                        "description": "Invalid data still fails right away (422). Saves {{change_request_id}}.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"first_name\": {\n        \"ar\": \"سعيد\",\n        \"en\": \"Saeed\"\n    },\n    \"gender\": \"male\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "pm.test('status 202', () => pm.response.to.have.status(202));",
                                    "const j = pm.response.json();",
                                    "const v = 'data.change_request.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('change_request_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Staff: edit person → 202",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/persons/{{person_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "persons",
                                "{{person_id}}"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"occupation\": {\n        \"ar\": \"طبيب\",\n        \"en\": \"Doctor\"\n    }\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Staff: publish post → 202",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/posts",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "posts"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"title\": {\n        \"ar\": \"مولود جديد\",\n        \"en\": \"A new baby\"\n    },\n    \"type\": \"birth\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Staff: my requests",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests"
                            ],
                            "query": []
                        },
                        "description": "Staff see their own requests.",
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Staff: cancel my request",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests/{{change_request_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests",
                                "{{change_request_id}}"
                            ],
                            "query": []
                        },
                        "description": "Only while pending.",
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                },
                {
                    "name": "Admin: pending requests",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests?status=pending",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests"
                            ],
                            "query": [
                                {
                                    "key": "status",
                                    "value": "pending"
                                }
                            ]
                        },
                        "description": "`preview` shows the record as it will look. `meta.pending_count` for the badge."
                    }
                },
                {
                    "name": "Admin: request details",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests/{{change_request_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests",
                                "{{change_request_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Admin: approve",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests/{{change_request_id}}/approve",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests",
                                "{{change_request_id}}",
                                "approve"
                            ],
                            "query": []
                        },
                        "description": "If the tree changed and the call now fails → 409 CHANGE_REQUEST_FAILED with the reason; the request stays pending."
                    }
                },
                {
                    "name": "Admin: reject",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/change-requests/{{change_request_id}}/reject",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "change-requests",
                                "{{change_request_id}}",
                                "reject"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"note\": \"تاريخ الميلاد غير صحيح\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        },
        {
            "name": "10. Notifications — الإشعارات",
            "description": "The admin is notified of every staff action; staff are notified when a request is reviewed.",
            "item": [
                {
                    "name": "My notifications",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications"
                            ],
                            "query": []
                        },
                        "description": "Saves the first as {{notification_id}}."
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.0.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('notification_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Unread only",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications?unread=1",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications"
                            ],
                            "query": [
                                {
                                    "key": "unread",
                                    "value": "1"
                                }
                            ]
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Unread count (badge)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications/unread-count",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications",
                                "unread-count"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Mark as read",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications/{{notification_id}}/read",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications",
                                "{{notification_id}}",
                                "read"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Mark all as read",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications/read-all",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications",
                                "read-all"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Delete notification",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications/{{notification_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications",
                                "{{notification_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Staff: my notifications",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/notifications",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "notifications"
                            ],
                            "query": []
                        },
                        "description": "",
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{staff_token}}",
                                    "type": "string"
                                }
                            ]
                        }
                    }
                }
            ]
        },
        {
            "name": "11. Admin — الإدارة من التطبيق",
            "description": "Users, staff and their permissions, languages and settings. No web panel: the admin does this from the app.",
            "item": [
                {
                    "name": "Statistics",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/stats",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "stats"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Users",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users?filter[search]=&filter[role]=staff",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users"
                            ],
                            "query": [
                                {
                                    "key": "filter[search]",
                                    "value": ""
                                },
                                {
                                    "key": "filter[role]",
                                    "value": "staff"
                                }
                            ]
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Create staff member",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users"
                            ],
                            "query": []
                        },
                        "description": "Saves {{staff_id}}. By default staff changes need approval.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"موظف جديد\",\n    \"email\": \"new.staff@tree.test\",\n    \"password\": \"password123\",\n    \"roles\": [\n        \"staff\"\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('staff_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "User details (with permissions)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Permissions (with labels)",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/permissions",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "permissions"
                            ],
                            "query": []
                        },
                        "description": "`grantable` = can be given to staff."
                    }
                },
                {
                    "name": "Set staff permissions",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}/permissions",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}",
                                "permissions"
                            ],
                            "query": []
                        },
                        "description": "Here the staff member saves tree changes directly (persons.direct), but news still need approval.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"permissions\": [\n        \"persons.create\",\n        \"persons.update\",\n        \"persons.direct\",\n        \"posts.create\",\n        \"posts.update\"\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Update user",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"name\": \"موظف الأرشيف\",\n    \"locale\": \"ar\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Set roles",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}/roles",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}",
                                "roles"
                            ],
                            "query": []
                        },
                        "description": "admin can grant staff / user; only the developer grants admin.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"roles\": [\n        \"staff\"\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Suspend user",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}/suspend",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}",
                                "suspend"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Activate user",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}/activate",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}",
                                "activate"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Delete user",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Restore user",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/users/{{staff_id}}/restore",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "users",
                                "{{staff_id}}",
                                "restore"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Roles",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/roles",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "roles"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Languages",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/languages",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "languages"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Add language",
                    "request": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/languages",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "languages"
                            ],
                            "query": []
                        },
                        "description": "Saves {{language_id}}. Then \"tr\" is accepted in every translatable field.",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"code\": \"tr\",\n    \"name\": \"Turkish\",\n    \"native_name\": \"Türkçe\",\n    \"direction\": \"ltr\",\n    \"is_active\": true,\n    \"sort_order\": 3\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const j = pm.response.json();",
                                    "const v = 'data.id'.split('.').reduce((o, k) => o && o[k], j);",
                                    "if (v) pm.environment.set('language_id', v);"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Enable / disable language",
                    "request": {
                        "method": "PATCH",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/languages/{{language_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "languages",
                                "{{language_id}}"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"is_active\": false\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                },
                {
                    "name": "Delete language",
                    "request": {
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/languages/{{language_id}}",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "languages",
                                "{{language_id}}"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Settings",
                    "request": {
                        "method": "GET",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/settings",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "settings"
                            ],
                            "query": []
                        },
                        "description": ""
                    }
                },
                {
                    "name": "Update settings",
                    "request": {
                        "method": "PUT",
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Accept-Language",
                                "value": "{{locale}}"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "url": {
                            "raw": "{{base_url}}/admin/settings",
                            "host": [
                                "{{base_url}}"
                            ],
                            "path": [
                                "admin",
                                "settings"
                            ],
                            "query": []
                        },
                        "description": "",
                        "body": {
                            "mode": "raw",
                            "raw": "{\n    \"settings\": [\n        {\n            \"key\": \"app.name\",\n            \"value\": {\n                \"ar\": \"شجرة العائلة\",\n                \"en\": \"Family Tree\"\n            },\n            \"group\": \"general\",\n            \"is_public\": true\n        }\n    ]\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        }
                    }
                }
            ]
        }
    ]
}