{
  "info": {
    "name": "Pryojon Backend API",
    "_postman_id": "pryojon-backend-collection",
    "description": "REST endpoints for the Pryojon Node/Express + Prisma backend. Set `baseUrl` to http://localhost:4000 for local runs. Login auto-stores the JWT into `token`.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "baseUrl", "value": "http://localhost:4000" },
    { "key": "token", "value": "" }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{token}}", "type": "string" }]
  },
  "item": [
    {
      "name": "Health",
      "item": [
        { "name": "GET /api/health", "request": { "method": "GET", "url": "{{baseUrl}}/api/health" } }
      ]
    },
    {
      "name": "Auth",
      "item": [
        {
          "name": "POST /api/auth/signup",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"email\": \"test@pryojon.local\",\n  \"password\": \"test1234\",\n  \"display_name\": \"Tester\"\n}" },
            "url": "{{baseUrl}}/api/auth/signup"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const r = pm.response.json();",
                  "if (r.access_token) pm.collectionVariables.set('token', r.access_token);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        {
          "name": "POST /api/auth/login",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"email\": \"test@pryojon.local\",\n  \"password\": \"test1234\"\n}" },
            "url": "{{baseUrl}}/api/auth/login"
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const r = pm.response.json();",
                  "if (r.access_token) pm.collectionVariables.set('token', r.access_token);"
                ],
                "type": "text/javascript"
              }
            }
          ]
        },
        { "name": "GET /api/auth/me", "request": { "method": "GET", "url": "{{baseUrl}}/api/auth/me" } },
        { "name": "POST /api/auth/logout", "request": { "method": "POST", "url": "{{baseUrl}}/api/auth/logout" } },
        {
          "name": "POST /api/auth/forgot-password",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{ \"email\": \"test@pryojon.local\" }" },
            "url": "{{baseUrl}}/api/auth/forgot-password"
          }
        },
        {
          "name": "POST /api/auth/reset-password",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{ \"token\": \"<paste-from-email>\", \"password\": \"newpass123\" }" },
            "url": "{{baseUrl}}/api/auth/reset-password"
          }
        }
      ]
    },
    {
      "name": "Categories",
      "item": [
        { "name": "GET /api/categories", "request": { "method": "GET", "url": "{{baseUrl}}/api/categories" } },
        { "name": "GET /api/categories/:id", "request": { "method": "GET", "url": "{{baseUrl}}/api/categories/:id" } },
        { "name": "POST /api/categories (admin)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"name\": \"Doctors\", \"slug\": \"doctors\", \"icon\": \"stethoscope\" }" }, "url": "{{baseUrl}}/api/categories" } },
        { "name": "PATCH /api/categories/:id (admin)", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"isActive\": true }" }, "url": "{{baseUrl}}/api/categories/:id" } },
        { "name": "DELETE /api/categories/:id (admin)", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/categories/:id" } }
      ]
    },
    {
      "name": "Services",
      "item": [
        { "name": "GET /api/services", "request": { "method": "GET", "url": "{{baseUrl}}/api/services?page=1&limit=20" } },
        { "name": "GET /api/services/:id", "request": { "method": "GET", "url": "{{baseUrl}}/api/services/:id" } },
        { "name": "POST /api/services (seller)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{\n  \"title\": \"Home tutor — Math\",\n  \"description\": \"...\",\n  \"categoryId\": \"<uuid>\",\n  \"districtId\": \"<uuid>\",\n  \"thanaId\": \"<uuid>\",\n  \"price\": 500,\n  \"packageId\": \"<uuid>\"\n}" }, "url": "{{baseUrl}}/api/services" } },
        { "name": "PATCH /api/services/:id", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"price\": 600 }" }, "url": "{{baseUrl}}/api/services/:id" } },
        { "name": "POST /api/services/:id/increment-views", "request": { "method": "POST", "url": "{{baseUrl}}/api/services/:id/increment-views" } },
        { "name": "DELETE /api/services/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/services/:id" } }
      ]
    },
    {
      "name": "Service Images",
      "item": [
        { "name": "GET /api/service-images?serviceId=", "request": { "method": "GET", "url": "{{baseUrl}}/api/service-images?serviceId=:id" } },
        { "name": "POST /api/service-images", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"serviceId\": \"<uuid>\", \"url\": \"http://localhost:4000/uploads/service-images/abc.jpg\" }" }, "url": "{{baseUrl}}/api/service-images" } },
        { "name": "DELETE /api/service-images/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/service-images/:id" } }
      ]
    },
    {
      "name": "Sellers",
      "item": [
        { "name": "GET /api/sellers (admin)", "request": { "method": "GET", "url": "{{baseUrl}}/api/sellers" } },
        { "name": "GET /api/sellers/me", "request": { "method": "GET", "url": "{{baseUrl}}/api/sellers/me" } },
        { "name": "GET /api/sellers/:id", "request": { "method": "GET", "url": "{{baseUrl}}/api/sellers/:id" } },
        { "name": "POST /api/sellers", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"businessName\": \"Acme\", \"nidNumber\": \"123\", \"address\": \"Dhaka\", \"districtId\": \"<uuid>\", \"thanaId\": \"<uuid>\" }" }, "url": "{{baseUrl}}/api/sellers" } },
        { "name": "PATCH /api/sellers/:id", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"approvalStatus\": \"approved\" }" }, "url": "{{baseUrl}}/api/sellers/:id" } }
      ]
    },
    {
      "name": "Seller Documents",
      "item": [
        { "name": "GET /api/seller-documents?sellerId=", "request": { "method": "GET", "url": "{{baseUrl}}/api/seller-documents?sellerId=:id" } },
        { "name": "POST /api/seller-documents", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"sellerId\": \"<uuid>\", \"docType\": \"nid\", \"url\": \"...\" }" }, "url": "{{baseUrl}}/api/seller-documents" } },
        { "name": "PATCH /api/seller-documents/:id", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"status\": \"approved\" }" }, "url": "{{baseUrl}}/api/seller-documents/:id" } },
        { "name": "DELETE /api/seller-documents/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/seller-documents/:id" } }
      ]
    },
    {
      "name": "Packages",
      "item": [
        { "name": "GET /api/packages", "request": { "method": "GET", "url": "{{baseUrl}}/api/packages?active=true" } },
        { "name": "POST /api/packages (admin)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"name\": \"30 days\", \"durationDays\": 30, \"price\": 199, \"features\": [\"Top placement\"] }" }, "url": "{{baseUrl}}/api/packages" } },
        { "name": "PATCH /api/packages/:id", "request": { "method": "PATCH", "url": "{{baseUrl}}/api/packages/:id" } },
        { "name": "DELETE /api/packages/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/packages/:id" } }
      ]
    },
    {
      "name": "Category Pricing",
      "item": [
        { "name": "GET /api/category-pricing", "request": { "method": "GET", "url": "{{baseUrl}}/api/category-pricing?categoryId=:id" } },
        { "name": "POST /api/category-pricing", "request": { "method": "POST", "url": "{{baseUrl}}/api/category-pricing" } },
        { "name": "PATCH /api/category-pricing/:id", "request": { "method": "PATCH", "url": "{{baseUrl}}/api/category-pricing/:id" } },
        { "name": "DELETE /api/category-pricing/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/category-pricing/:id" } }
      ]
    },
    {
      "name": "Payments",
      "item": [
        { "name": "GET /api/payments", "request": { "method": "GET", "url": "{{baseUrl}}/api/payments" } },
        { "name": "POST /api/payments", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"serviceId\": \"<uuid>\", \"packageId\": \"<uuid>\", \"amount\": 199, \"method\": \"bkash\", \"txnRef\": \"TX1234\" }" }, "url": "{{baseUrl}}/api/payments" } },
        { "name": "PATCH /api/payments/:id (admin)", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"status\": \"approved\" }" }, "url": "{{baseUrl}}/api/payments/:id" } }
      ]
    },
    {
      "name": "Reviews",
      "item": [
        { "name": "GET /api/reviews", "request": { "method": "GET", "url": "{{baseUrl}}/api/reviews?serviceId=:id" } },
        { "name": "POST /api/reviews", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"serviceId\": \"<uuid>\", \"rating\": 5, \"comment\": \"Great!\", \"reviewerName\": \"Anon\" }" }, "url": "{{baseUrl}}/api/reviews" } },
        { "name": "PATCH /api/reviews/:id", "request": { "method": "PATCH", "url": "{{baseUrl}}/api/reviews/:id" } },
        { "name": "DELETE /api/reviews/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/reviews/:id" } }
      ]
    },
    {
      "name": "Banners",
      "item": [
        { "name": "GET /api/banners", "request": { "method": "GET", "url": "{{baseUrl}}/api/banners?slot=home_hero" } },
        { "name": "POST /api/banners", "request": { "method": "POST", "url": "{{baseUrl}}/api/banners" } },
        { "name": "PATCH /api/banners/:id", "request": { "method": "PATCH", "url": "{{baseUrl}}/api/banners/:id" } },
        { "name": "DELETE /api/banners/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/banners/:id" } }
      ]
    },
    {
      "name": "Site Pages",
      "item": [
        { "name": "GET /api/site-pages", "request": { "method": "GET", "url": "{{baseUrl}}/api/site-pages" } },
        { "name": "GET /api/site-pages/:slug", "request": { "method": "GET", "url": "{{baseUrl}}/api/site-pages/:slug" } },
        { "name": "POST /api/site-pages", "request": { "method": "POST", "url": "{{baseUrl}}/api/site-pages" } },
        { "name": "PATCH /api/site-pages/:id", "request": { "method": "PATCH", "url": "{{baseUrl}}/api/site-pages/:id" } },
        { "name": "DELETE /api/site-pages/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/site-pages/:id" } }
      ]
    },
    {
      "name": "Locations",
      "item": [
        { "name": "GET /api/districts", "request": { "method": "GET", "url": "{{baseUrl}}/api/districts" } },
        { "name": "GET /api/thanas?districtId=", "request": { "method": "GET", "url": "{{baseUrl}}/api/thanas?districtId=:id" } }
      ]
    },
    {
      "name": "Profiles",
      "item": [
        { "name": "GET /api/profiles/:id", "request": { "method": "GET", "url": "{{baseUrl}}/api/profiles/:id" } },
        { "name": "PATCH /api/profiles/:id", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"displayName\": \"New Name\" }" }, "url": "{{baseUrl}}/api/profiles/:id" } }
      ]
    },
    {
      "name": "User Roles",
      "item": [
        { "name": "GET /api/user-roles", "request": { "method": "GET", "url": "{{baseUrl}}/api/user-roles" } },
        { "name": "POST /api/user-roles (admin)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "body": { "mode": "raw", "raw": "{ \"userId\": \"<uuid>\", \"role\": \"seller\" }" }, "url": "{{baseUrl}}/api/user-roles" } },
        { "name": "DELETE /api/user-roles/:id", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/user-roles/:id" } },
        { "name": "POST /api/user-roles/claim-first-admin", "request": { "method": "POST", "url": "{{baseUrl}}/api/user-roles/claim-first-admin" } }
      ]
    },
    {
      "name": "Uploads",
      "item": [
        {
          "name": "POST /api/uploads/:bucket",
          "request": {
            "method": "POST",
            "url": "{{baseUrl}}/api/uploads/service-images",
            "body": {
              "mode": "formdata",
              "formdata": [{ "key": "file", "type": "file", "src": [] }]
            }
          }
        },
        { "name": "DELETE /api/uploads/:bucket/:filename", "request": { "method": "DELETE", "url": "{{baseUrl}}/api/uploads/service-images/:filename" } }
      ]
    }
  ]
}
