{
  "info": {
    "name": "Viață la Țară API",
    "description": "REST API for the Viață la Țară backend.\n\n## Setup\n1. Start the server locally (default `http://localhost:3838`).\n2. Run **Auth > Register** or **Auth > Login** — the test script auto-saves `accessToken` and `refreshToken` into collection variables.\n3. All protected requests inherit `Authorization: Bearer {{accessToken}}` from the collection.\n\n## Variables\n- `baseUrl` — API base (default `http://localhost:3838`)\n- `accessToken` / `refreshToken` — populated by login/register/refresh\n- `categoryId`, `productId`, `producerId`, `bookingPlaceId`, `threadId` — set these (or let list requests capture them) before running dependent calls.\n\nEnvelope for every response is `{ data, error }`.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{accessToken}}", "type": "string" }]
  },
  "variable": [
    { "key": "baseUrl", "value": "http://localhost:3838" },
    { "key": "accessToken", "value": "" },
    { "key": "refreshToken", "value": "" },
    { "key": "categoryId", "value": "" },
    { "key": "productId", "value": "" },
    { "key": "producerId", "value": "" },
    { "key": "bookingPlaceId", "value": "" },
    { "key": "threadId", "value": "" },
    { "key": "uploadedUrl", "value": "" },
    { "key": "uploadedFilename", "value": "" }
  ],
  "item": [
    {
      "name": "Health",
      "item": [
        {
          "name": "GET /health",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/health", "host": ["{{baseUrl}}"], "path": ["health"] }
          }
        }
      ]
    },
    {
      "name": "Auth",
      "item": [
        {
          "name": "POST /api/auth/register",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.accessToken) {",
                  "  pm.collectionVariables.set('accessToken', res.data.accessToken);",
                  "  pm.collectionVariables.set('refreshToken', res.data.refreshToken);",
                  "  console.log('Saved tokens for', res.data.user.email);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"tester@example.com\",\n  \"password\": \"password123\",\n  \"name\": \"Tester\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/auth/register", "host": ["{{baseUrl}}"], "path": ["api", "auth", "register"] }
          }
        },
        {
          "name": "POST /api/auth/login",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.accessToken) {",
                  "  pm.collectionVariables.set('accessToken', res.data.accessToken);",
                  "  pm.collectionVariables.set('refreshToken', res.data.refreshToken);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"tester@example.com\",\n  \"password\": \"password123\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/auth/login", "host": ["{{baseUrl}}"], "path": ["api", "auth", "login"] }
          }
        },
        {
          "name": "POST /api/auth/refresh",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.accessToken) {",
                  "  pm.collectionVariables.set('accessToken', res.data.accessToken);",
                  "  pm.collectionVariables.set('refreshToken', res.data.refreshToken);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/auth/refresh", "host": ["{{baseUrl}}"], "path": ["api", "auth", "refresh"] }
          }
        },
        {
          "name": "POST /api/auth/logout",
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"{{refreshToken}}\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/auth/logout", "host": ["{{baseUrl}}"], "path": ["api", "auth", "logout"] }
          }
        },
        {
          "name": "POST /api/auth/social (Firebase ID token)",
          "request": {
            "auth": { "type": "noauth" },
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"idToken\": \"<firebase-id-token>\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/auth/social", "host": ["{{baseUrl}}"], "path": ["api", "auth", "social"] }
          }
        }
      ]
    },
    {
      "name": "Users",
      "item": [
        {
          "name": "GET /api/users/me",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/users/me", "host": ["{{baseUrl}}"], "path": ["api", "users", "me"] }
          }
        },
        {
          "name": "PUT /api/users/me",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Tester Updated\",\n  \"phone\": \"+40712345678\",\n  \"avatarUrl\": \"https://example.com/avatar.png\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/users/me", "host": ["{{baseUrl}}"], "path": ["api", "users", "me"] }
          }
        },
        {
          "name": "PUT /api/users/me/password",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"currentPassword\": \"password123\",\n  \"newPassword\": \"password456\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/users/me/password", "host": ["{{baseUrl}}"], "path": ["api", "users", "me", "password"] }
          }
        }
      ]
    },
    {
      "name": "Categories",
      "item": [
        {
          "name": "GET /api/categories",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.length) {",
                  "  pm.collectionVariables.set('categoryId', res.data[0].id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/categories", "host": ["{{baseUrl}}"], "path": ["api", "categories"] }
          }
        }
      ]
    },
    {
      "name": "Products",
      "item": [
        {
          "name": "GET /api/products",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.items && res.data.items.length) {",
                  "  pm.collectionVariables.set('productId', res.data.items[0].id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/products?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "products"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "categoryId", "value": "{{categoryId}}", "disabled": true },
                { "key": "producerId", "value": "{{producerId}}", "disabled": true },
                { "key": "search", "value": "miere", "disabled": true },
                { "key": "minPrice", "value": "0", "disabled": true },
                { "key": "maxPrice", "value": "100", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/products/:id",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/products/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "products", "{{productId}}"] }
          }
        }
      ]
    },
    {
      "name": "Producers",
      "item": [
        {
          "name": "GET /api/producers",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.items && res.data.items.length) {",
                  "  pm.collectionVariables.set('producerId', res.data.items[0].id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/producers?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "producers"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "categoryId", "value": "{{categoryId}}", "disabled": true },
                { "key": "search", "value": "ferma", "disabled": true },
                { "key": "verified", "value": "true", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/producers/:id",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/producers/{{producerId}}", "host": ["{{baseUrl}}"], "path": ["api", "producers", "{{producerId}}"] }
          }
        }
      ]
    },
    {
      "name": "Booking Places",
      "item": [
        {
          "name": "GET /api/booking-places",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.items && res.data.items.length) {",
                  "  pm.collectionVariables.set('bookingPlaceId', res.data.items[0].id);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/booking-places?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "booking-places"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "search", "value": "cabana", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/booking-places/:id",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/booking-places/{{bookingPlaceId}}", "host": ["{{baseUrl}}"], "path": ["api", "booking-places", "{{bookingPlaceId}}"] }
          }
        }
      ]
    },
    {
      "name": "Reviews",
      "item": [
        {
          "name": "GET /api/reviews",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/reviews?targetType=product&targetId={{productId}}&page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "reviews"],
              "query": [
                { "key": "targetType", "value": "product" },
                { "key": "targetId", "value": "{{productId}}" },
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" }
              ]
            }
          }
        },
        {
          "name": "POST /api/reviews",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"targetType\": \"product\",\n  \"targetId\": \"{{productId}}\",\n  \"rating\": 5,\n  \"comment\": \"Excelent!\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/reviews", "host": ["{{baseUrl}}"], "path": ["api", "reviews"] }
          }
        }
      ]
    },
    {
      "name": "Favorites",
      "item": [
        {
          "name": "GET /api/favorites",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/favorites?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "favorites"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "targetType", "value": "product", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "POST /api/favorites",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"targetType\": \"product\",\n  \"targetId\": \"{{productId}}\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/favorites", "host": ["{{baseUrl}}"], "path": ["api", "favorites"] }
          }
        },
        {
          "name": "DELETE /api/favorites/:id",
          "request": {
            "method": "DELETE",
            "url": { "raw": "{{baseUrl}}/api/favorites/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "favorites", "{{productId}}"] }
          }
        }
      ]
    },
    {
      "name": "Cart",
      "item": [
        {
          "name": "GET /api/cart",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/cart", "host": ["{{baseUrl}}"], "path": ["api", "cart"] }
          }
        },
        {
          "name": "POST /api/cart",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"productId\": \"{{productId}}\",\n  \"quantity\": 2\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/cart", "host": ["{{baseUrl}}"], "path": ["api", "cart"] }
          }
        },
        {
          "name": "PUT /api/cart/:productId",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"quantity\": 3\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/cart/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "cart", "{{productId}}"] }
          }
        },
        {
          "name": "DELETE /api/cart/:productId",
          "request": {
            "method": "DELETE",
            "url": { "raw": "{{baseUrl}}/api/cart/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "cart", "{{productId}}"] }
          }
        },
        {
          "name": "DELETE /api/cart (clear)",
          "request": {
            "method": "DELETE",
            "url": { "raw": "{{baseUrl}}/api/cart", "host": ["{{baseUrl}}"], "path": ["api", "cart"] }
          }
        }
      ]
    },
    {
      "name": "Devices",
      "item": [
        {
          "name": "POST /api/devices",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"token\": \"<fcm-device-token>\",\n  \"platform\": \"android\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/devices", "host": ["{{baseUrl}}"], "path": ["api", "devices"] }
          }
        },
        {
          "name": "DELETE /api/devices/:token",
          "request": {
            "method": "DELETE",
            "url": { "raw": "{{baseUrl}}/api/devices/<fcm-device-token>", "host": ["{{baseUrl}}"], "path": ["api", "devices", "<fcm-device-token>"] }
          }
        }
      ]
    },
    {
      "name": "Uploads",
      "description": "Server-side image compression. Upload raw images (multipart, field name `files`); the API resizes + re-encodes to WebP and returns hosted URLs to store in photos[] / avatarUrl. Uploading requires a token; viewing the returned URL is public.",
      "item": [
        {
          "name": "POST /api/uploads",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Response `data` is always an ARRAY, even for one file.",
                  "const res = pm.response.json();",
                  "if (res.data && res.data.length) {",
                  "  pm.collectionVariables.set('uploadedUrl', res.data[0].url);",
                  "  pm.collectionVariables.set('uploadedFilename', res.data[0].filename);",
                  "  console.log('Uploaded:', res.data[0].url, '(' + res.data[0].width + 'x' + res.data[0].height + ', ' + res.data[0].size + ' bytes)');",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "description": "Select one or more image files under the `files` key (Body tab → form-data → click the value cell → 'Select Files'). Max 10 files, 10 MB each. Accepted: jpeg, png, webp, gif, avif, heic, heif. Do NOT set a Content-Type header manually — Postman sets the multipart boundary for you.",
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "files", "type": "file", "src": [], "description": "Pick 1+ image files. Add more rows with the same key `files` for multiple." }
              ]
            },
            "url": { "raw": "{{baseUrl}}/api/uploads", "host": ["{{baseUrl}}"], "path": ["api", "uploads"] }
          }
        },
        {
          "name": "GET /uploads/:filename (public, no auth)",
          "request": {
            "auth": { "type": "noauth" },
            "method": "GET",
            "description": "Fetch a compressed image. Public — no token needed. Note the path is /uploads (not /api/uploads).",
            "url": { "raw": "{{baseUrl}}/uploads/{{uploadedFilename}}", "host": ["{{baseUrl}}"], "path": ["uploads", "{{uploadedFilename}}"] }
          }
        },
        {
          "name": "DELETE /api/uploads/:filename",
          "request": {
            "method": "DELETE",
            "description": "Remove a stored image. Any logged-in user may delete any file (files aren't owner-scoped).",
            "url": { "raw": "{{baseUrl}}/api/uploads/{{uploadedFilename}}", "host": ["{{baseUrl}}"], "path": ["api", "uploads", "{{uploadedFilename}}"] }
          }
        }
      ]
    },
    {
      "name": "Partner",
      "item": [
        {
          "name": "POST /api/partner/apply",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"businessName\": \"Ferma Bunicii\",\n  \"description\": \"Produse naturale de la ferma noastra de familie.\",\n  \"website\": \"https://ferma-bunicii.ro\",\n  \"phone\": \"+40712345678\",\n  \"address\": \"Str. Principala 10, Sat Bucovina\",\n  \"categories\": [\"{{categoryId}}\"]\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/partner/apply", "host": ["{{baseUrl}}"], "path": ["api", "partner", "apply"] }
          }
        },
        {
          "name": "GET /api/partner/application",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/partner/application", "host": ["{{baseUrl}}"], "path": ["api", "partner", "application"] }
          }
        }
      ]
    },
    {
      "name": "Shop (business role)",
      "item": [
        {
          "name": "GET /api/shop/producer",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/shop/producer", "host": ["{{baseUrl}}"], "path": ["api", "shop", "producer"] }
          }
        },
        {
          "name": "POST /api/shop/producer",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"businessName\": \"Ferma Bunicii\",\n  \"description\": \"Produse naturale de la ferma noastra de familie.\",\n  \"website\": \"https://ferma-bunicii.ro\",\n  \"phone\": \"+40712345678\",\n  \"address\": \"Str. Principala 10, Sat Bucovina\",\n  \"categories\": [\"{{categoryId}}\"],\n  \"photos\": []\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/shop/producer", "host": ["{{baseUrl}}"], "path": ["api", "shop", "producer"] }
          }
        },
        {
          "name": "PUT /api/shop/producer",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Descriere actualizata a fermei noastre de familie.\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/shop/producer", "host": ["{{baseUrl}}"], "path": ["api", "shop", "producer"] }
          }
        },
        {
          "name": "GET /api/shop/products",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/shop/products?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "shop", "products"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "status", "value": "pending", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "POST /api/shop/products",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Miere de salcam\",\n  \"description\": \"Miere naturala de salcam, borcan 500g.\",\n  \"price\": 25,\n  \"unit\": \"piece\",\n  \"stock\": 100,\n  \"photos\": [],\n  \"categoryId\": \"{{categoryId}}\",\n  \"available\": true\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/shop/products", "host": ["{{baseUrl}}"], "path": ["api", "shop", "products"] }
          }
        },
        {
          "name": "PUT /api/shop/products/:id",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"price\": 28,\n  \"stock\": 80\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/shop/products/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "shop", "products", "{{productId}}"] }
          }
        },
        {
          "name": "DELETE /api/shop/products/:id",
          "request": {
            "method": "DELETE",
            "url": { "raw": "{{baseUrl}}/api/shop/products/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "shop", "products", "{{productId}}"] }
          }
        }
      ]
    },
    {
      "name": "My Locations (business role)",
      "item": [
        {
          "name": "GET /api/my-locations",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/my-locations", "host": ["{{baseUrl}}"], "path": ["api", "my-locations"] }
          }
        },
        {
          "name": "POST /api/my-locations",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Cabana la Munte\",\n  \"description\": \"Cabana confortabila cu priveliste spre munte.\",\n  \"address\": \"Sat Fundata, jud. Brasov\",\n  \"locality\": \"Fundata\",\n  \"county\": \"Brasov\",\n  \"latitude\": 45.4523,\n  \"longitude\": 25.2634,\n  \"capacity\": 6,\n  \"pricePerNight\": 350,\n  \"photos\": [],\n  \"amenities\": [\"wifi\", \"parcare\", \"gratar\"]\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/my-locations", "host": ["{{baseUrl}}"], "path": ["api", "my-locations"] }
          }
        },
        {
          "name": "PUT /api/my-locations/:id",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pricePerNight\": 400\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/my-locations/{{bookingPlaceId}}", "host": ["{{baseUrl}}"], "path": ["api", "my-locations", "{{bookingPlaceId}}"] }
          }
        },
        {
          "name": "DELETE /api/my-locations/:id",
          "request": {
            "method": "DELETE",
            "url": { "raw": "{{baseUrl}}/api/my-locations/{{bookingPlaceId}}", "host": ["{{baseUrl}}"], "path": ["api", "my-locations", "{{bookingPlaceId}}"] }
          }
        }
      ]
    },
    {
      "name": "Chat",
      "item": [
        {
          "name": "GET /api/chat/threads",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/chat/threads", "host": ["{{baseUrl}}"], "path": ["api", "chat", "threads"] }
          }
        },
        {
          "name": "POST /api/chat/threads",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const res = pm.response.json();",
                  "if (res.data && res.data.id) { pm.collectionVariables.set('threadId', res.data.id); }"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"participantId\": \"{{producerId}}\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/chat/threads", "host": ["{{baseUrl}}"], "path": ["api", "chat", "threads"] }
          }
        },
        {
          "name": "GET /api/chat/threads/:id/messages",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/chat/threads/{{threadId}}/messages?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "chat", "threads", "{{threadId}}", "messages"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" }
              ]
            }
          }
        },
        {
          "name": "POST /api/chat/threads/:id/messages",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"Buna ziua! Aveti miere disponibila?\"\n}"
            },
            "url": { "raw": "{{baseUrl}}/api/chat/threads/{{threadId}}/messages", "host": ["{{baseUrl}}"], "path": ["api", "chat", "threads", "{{threadId}}", "messages"] }
          }
        },
        {
          "name": "POST /api/chat/threads/:id/read",
          "request": {
            "method": "POST",
            "url": { "raw": "{{baseUrl}}/api/chat/threads/{{threadId}}/read", "host": ["{{baseUrl}}"], "path": ["api", "chat", "threads", "{{threadId}}", "read"] }
          }
        }
      ]
    },
    {
      "name": "Admin (admin role)",
      "item": [
        {
          "name": "GET /api/admin/products",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/admin/products?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "products"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "status", "value": "pending", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/admin/products/:id",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/admin/products/{{productId}}", "host": ["{{baseUrl}}"], "path": ["api", "admin", "products", "{{productId}}"] }
          }
        },
        {
          "name": "PATCH /api/admin/products/:id/approve",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{baseUrl}}/api/admin/products/{{productId}}/approve", "host": ["{{baseUrl}}"], "path": ["api", "admin", "products", "{{productId}}", "approve"] }
          }
        },
        {
          "name": "PATCH /api/admin/products/:id/reject",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"reason\": \"Foto neclare\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/products/{{productId}}/reject", "host": ["{{baseUrl}}"], "path": ["api", "admin", "products", "{{productId}}", "reject"] }
          }
        },
        {
          "name": "PATCH /api/admin/products/:id/request-info",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"note\": \"Va rugam adaugati mai multe detalii.\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/products/{{productId}}/request-info", "host": ["{{baseUrl}}"], "path": ["api", "admin", "products", "{{productId}}", "request-info"] }
          }
        },
        {
          "name": "PATCH /api/admin/products/:id/sections/:section",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"action\": \"approve\",\n  \"note\": \"OK\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/products/{{productId}}/sections/description", "host": ["{{baseUrl}}"], "path": ["api", "admin", "products", "{{productId}}", "sections", "description"] }
          }
        },
        {
          "name": "GET /api/admin/producers",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/admin/producers?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "producers"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "status", "value": "pending", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/admin/producers/:id",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/admin/producers/{{producerId}}", "host": ["{{baseUrl}}"], "path": ["api", "admin", "producers", "{{producerId}}"] }
          }
        },
        {
          "name": "PATCH /api/admin/producers/:id/approve",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{baseUrl}}/api/admin/producers/{{producerId}}/approve", "host": ["{{baseUrl}}"], "path": ["api", "admin", "producers", "{{producerId}}", "approve"] }
          }
        },
        {
          "name": "PATCH /api/admin/producers/:id/reject",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"reason\": \"Date incomplete\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/producers/{{producerId}}/reject", "host": ["{{baseUrl}}"], "path": ["api", "admin", "producers", "{{producerId}}", "reject"] }
          }
        },
        {
          "name": "PATCH /api/admin/producers/:id/request-info",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"note\": \"Trimiteti documente suplimentare.\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/producers/{{producerId}}/request-info", "host": ["{{baseUrl}}"], "path": ["api", "admin", "producers", "{{producerId}}", "request-info"] }
          }
        },
        {
          "name": "PATCH /api/admin/producers/:id/verify",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{baseUrl}}/api/admin/producers/{{producerId}}/verify", "host": ["{{baseUrl}}"], "path": ["api", "admin", "producers", "{{producerId}}", "verify"] }
          }
        },
        {
          "name": "GET /api/admin/applications",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/admin/applications?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "applications"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "status", "value": "pending", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/admin/applications/:id",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/admin/applications/{{producerId}}", "host": ["{{baseUrl}}"], "path": ["api", "admin", "applications", "{{producerId}}"] }
          }
        },
        {
          "name": "PATCH /api/admin/applications/:id/approve",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{baseUrl}}/api/admin/applications/{{producerId}}/approve", "host": ["{{baseUrl}}"], "path": ["api", "admin", "applications", "{{producerId}}", "approve"] }
          }
        },
        {
          "name": "PATCH /api/admin/applications/:id/reject",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"reason\": \"Nu indeplineste criteriile\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/applications/{{producerId}}/reject", "host": ["{{baseUrl}}"], "path": ["api", "admin", "applications", "{{producerId}}", "reject"] }
          }
        },
        {
          "name": "GET /api/admin/booking-places",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{baseUrl}}/api/admin/booking-places?page=1&size=20",
              "host": ["{{baseUrl}}"],
              "path": ["api", "admin", "booking-places"],
              "query": [
                { "key": "page", "value": "1" },
                { "key": "size", "value": "20" },
                { "key": "status", "value": "pending", "disabled": true }
              ]
            }
          }
        },
        {
          "name": "GET /api/admin/booking-places/:id",
          "request": {
            "method": "GET",
            "url": { "raw": "{{baseUrl}}/api/admin/booking-places/{{bookingPlaceId}}", "host": ["{{baseUrl}}"], "path": ["api", "admin", "booking-places", "{{bookingPlaceId}}"] }
          }
        },
        {
          "name": "PATCH /api/admin/booking-places/:id/approve",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{baseUrl}}/api/admin/booking-places/{{bookingPlaceId}}/approve", "host": ["{{baseUrl}}"], "path": ["api", "admin", "booking-places", "{{bookingPlaceId}}", "approve"] }
          }
        },
        {
          "name": "PATCH /api/admin/booking-places/:id/reject",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"reason\": \"Poze insuficiente\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/booking-places/{{bookingPlaceId}}/reject", "host": ["{{baseUrl}}"], "path": ["api", "admin", "booking-places", "{{bookingPlaceId}}", "reject"] }
          }
        },
        {
          "name": "PATCH /api/admin/booking-places/:id/request-info",
          "request": {
            "method": "PATCH",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"note\": \"Adaugati regulile casei.\"\n}" },
            "url": { "raw": "{{baseUrl}}/api/admin/booking-places/{{bookingPlaceId}}/request-info", "host": ["{{baseUrl}}"], "path": ["api", "admin", "booking-places", "{{bookingPlaceId}}", "request-info"] }
          }
        }
      ]
    }
  ]
}
