{
  "openapi": "3.0.3",
  "info": {
    "title": "CampNow – Admin Campsite CRUD",
    "description": "Full CRUD API for managing campsites from the admin panel. Covers owner contact details, campsite profile, membership document upload, and profile-completeness logic.\n\n**Auth:** All endpoints require `Authorization: Bearer <token>` (admin JWT).",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "{{baseUrl}}",
      "description": "Environment base URL (set in APIdog environment)"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "Location": {
        "type": "object",
        "properties": {
          "address": { "type": "string",  "example": "Musterstraße 1" },
          "city":    { "type": "string",  "example": "Munich" },
          "country": { "type": "string",  "example": "Germany" },
          "lat":     { "type": "number",  "example": 48.1351 },
          "lng":     { "type": "number",  "example": 11.582 }
        }
      },
      "Completeness": {
        "type": "object",
        "properties": {
          "isProfileComplete":    { "type": "boolean", "example": false },
          "completionPercentage": { "type": "integer", "example": 40 },
          "missingFields": {
            "type": "array",
            "items": { "type": "string" },
            "example": ["description", "coverImageUrl", "location.city", "location.country"]
          },
          "redirectBehaviour": {
            "type": "string",
            "enum": ["detail-page", "external-website", "hidden"],
            "example": "hidden"
          },
          "websiteLink": { "type": "string", "nullable": true, "example": null }
        }
      },
      "CampsiteDetail": {
        "type": "object",
        "properties": {
          "id":                   { "type": "string",  "example": "664f1a2b3c4d5e6f7a8b9c0d" },
          "ownerFirstName":       { "type": "string",  "example": "John" },
          "ownerLastName":        { "type": "string",  "example": "Doe" },
          "ownerEmail":           { "type": "string",  "example": "john.doe@campsite.de" },
          "ownerPhone":           { "type": "string",  "nullable": true, "example": "+49 170 1234567" },
          "membershipDocument":   { "type": "string",  "nullable": true, "example": "https://assets.campnow.de/public/media/campsites/documents/1714123456789-membership.pdf" },
          "name":                 { "type": "string",  "nullable": true, "example": "Lakeside Campground" },
          "description":          { "type": "string",  "nullable": true, "example": "A beautiful campsite by the lake." },
          "location":             { "$ref": "#/components/schemas/Location" },
          "coverImageUrl":        { "type": "string",  "nullable": true, "example": "https://cdn.example.com/cover.jpg" },
          "websiteUrl":           { "type": "string",  "nullable": true, "example": "https://lakeside-campground.de" },
          "bookingUrl":           { "type": "string",  "nullable": true, "example": "https://booking.lakeside-campground.de" },
          "showOnMap":            { "type": "boolean", "example": true },
          "category":             { "type": "string",  "nullable": true, "example": "664f1a2b3c4d5e6f7a8b9c01" },
          "isActive":             { "type": "boolean", "example": false },
          "completeness":         { "$ref": "#/components/schemas/Completeness" },
          "createdAt":            { "type": "string",  "format": "date-time" },
          "updatedAt":            { "type": "string",  "format": "date-time" }
        }
      },
      "PaginationMeta": {
        "type": "object",
        "properties": {
          "total":       { "type": "integer", "example": 42 },
          "totalPages":  { "type": "integer", "example": 5 },
          "currentPage": { "type": "integer", "example": 1 },
          "perPage":     { "type": "integer", "example": 10 },
          "hasNextPage": { "type": "boolean", "example": true },
          "hasPrevPage": { "type": "boolean", "example": false }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": false },
          "message": { "type": "string",  "example": "Error message" },
          "data":    { "type": "object",  "nullable": true, "example": null },
          "errors":  { "type": "object",  "nullable": true, "example": null }
        }
      },
      "ValidationErrorResponse": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "example": false },
          "message": { "type": "string",  "example": "Validation Error" },
          "data":    { "type": "object",  "nullable": true, "example": null },
          "errors": {
            "type": "array",
            "items": { "type": "string" },
            "example": ["Owner first name is required.", "Owner email must be a valid email address."]
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid JWT token",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ErrorResponse" },
            "example": {
              "success": false,
              "message": "Unauthorized",
              "data":    null,
              "errors":  null
            }
          }
        }
      },
      "NotFound": {
        "description": "Campsite not found",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ErrorResponse" },
            "example": {
              "success": false,
              "message": "Campsite not found",
              "data":    null,
              "errors":  null
            }
          }
        }
      },
      "ServerError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ErrorResponse" },
            "example": {
              "success": false,
              "message": "Server Error",
              "data":    null,
              "errors":  null
            }
          }
        }
      }
    }
  },
  "security": [{ "bearerAuth": [] }],
  "paths": {
    "/admin/campsites": {
      "get": {
        "tags": ["Admin – Campsites"],
        "summary": "List all campsites (paginated)",
        "operationId": "adminListCampsites",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": { "type": "integer", "default": 1, "minimum": 1 },
            "example": 1
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page (default: 10, max: 100)",
            "schema": { "type": "integer", "default": 10, "minimum": 1, "maximum": 100 },
            "example": 10
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search by campsite name, owner first/last name or email",
            "schema": { "type": "string" },
            "example": "lakeside"
          },
          {
            "name": "isActive",
            "in": "query",
            "description": "Filter by active status",
            "schema": { "type": "string", "enum": ["true", "false"] },
            "example": "true"
          },
          {
            "name": "showOnMap",
            "in": "query",
            "description": "Filter by map visibility",
            "schema": { "type": "string", "enum": ["true", "false"] },
            "example": "true"
          }
        ],
        "responses": {
          "200": {
            "description": "Campsites retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success":  { "type": "boolean", "example": true },
                    "message":  { "type": "string",  "example": "Campsites retrieved successfully" },
                    "data": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/CampsiteDetail" }
                    },
                    "metadata": { "$ref": "#/components/schemas/PaginationMeta" }
                  }
                },
                "examples": {
                  "success_with_data": {
                    "summary": "200 – list with results",
                    "value": {
                      "success": true,
                      "message": "Campsites retrieved successfully",
                      "data": [
                        {
                          "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                          "ownerFirstName": "John",
                          "ownerLastName":  "Doe",
                          "ownerEmail":     "john.doe@campsite.de",
                          "ownerPhone":     "+49 170 1234567",
                          "membershipDocument": null,
                          "name":           "Lakeside Campground",
                          "description":    null,
                          "location":       { "address": "Musterstraße 1", "city": "Munich", "country": "Germany", "lat": 48.1351, "lng": 11.582 },
                          "coverImageUrl":  null,
                          "websiteUrl":     "https://lakeside-campground.de",
                          "bookingUrl":     null,
                          "showOnMap":      false,
                          "category":       null,
                          "isActive":       false,
                          "completeness": {
                            "isProfileComplete":    false,
                            "completionPercentage": 33,
                            "missingFields":        ["description", "coverImageUrl", "location.city", "location.country"],
                            "redirectBehaviour":    "external-website",
                            "websiteLink":          "https://lakeside-campground.de"
                          },
                          "createdAt": "2025-04-20T10:00:00.000Z",
                          "updatedAt": "2025-04-20T10:00:00.000Z"
                        }
                      ],
                      "metadata": {
                        "total":       1,
                        "totalPages":  1,
                        "currentPage": 1,
                        "perPage":     10,
                        "hasNextPage": false,
                        "hasPrevPage": false
                      }
                    }
                  },
                  "success_empty": {
                    "summary": "200 – empty list",
                    "value": {
                      "success": true,
                      "message": "Campsites retrieved successfully",
                      "data":    [],
                      "metadata": {
                        "total": 0, "totalPages": 0, "currentPage": 1,
                        "perPage": 10, "hasNextPage": false, "hasPrevPage": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "422": {
            "description": "Query validation error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" },
                "example": {
                  "success": false,
                  "message": "Validation Error",
                  "data":    null,
                  "errors":  ["page must be a number"]
                }
              }
            }
          },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "tags": ["Admin – Campsites"],
        "summary": "Create a new campsite",
        "operationId": "adminCreateCampsite",
        "description": "Creates a campsite record. Owner contact fields are required; campsite profile fields (name, description, location, etc.) are optional and can be filled later by the operator.\n\n`membershipDocument` must be a PDF ≤ 5 MB.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["ownerFirstName", "ownerLastName", "ownerEmail"],
                "properties": {
                  "ownerFirstName":     { "type": "string",  "example": "John",                       "description": "Required. Operator first name." },
                  "ownerLastName":      { "type": "string",  "example": "Doe",                        "description": "Required. Operator last name." },
                  "ownerEmail":         { "type": "string",  "example": "john.doe@campsite.de",       "description": "Required. Must be unique across campsites." },
                  "ownerPhone":         { "type": "string",  "example": "+49 170 1234567",            "description": "Optional." },
                  "membershipDocument": { "type": "string",  "format": "binary",                      "description": "Optional. PDF only, max 5 MB." },
                  "siteStatus":         { "type": "boolean", "example": false,                        "description": "Optional. true = enable access immediately." },
                  "name":               { "type": "string",  "example": "Lakeside Campground",        "description": "Optional. Campsite name." },
                  "description":        { "type": "string",  "example": "A beautiful lake campsite.", "description": "Optional. Rich text supported." },
                  "location[address]":  { "type": "string",  "example": "Musterstraße 1" },
                  "location[city]":     { "type": "string",  "example": "Munich" },
                  "location[country]":  { "type": "string",  "example": "Germany" },
                  "location[lat]":      { "type": "number",  "example": 48.1351 },
                  "location[lng]":      { "type": "number",  "example": 11.582 },
                  "coverImageUrl":      { "type": "string",  "example": "https://cdn.example.com/cover.jpg" },
                  "websiteUrl":         { "type": "string",  "example": "https://lakeside-campground.de" },
                  "bookingUrl":         { "type": "string",  "example": "https://booking.lakeside-campground.de" },
                  "showOnMap":          { "type": "boolean", "example": false },
                  "category":           { "type": "string",  "example": "664f1a2b3c4d5e6f7a8b9c01", "description": "Optional. SuperCategory ObjectId." }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Campsite created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "message": { "type": "string",  "example": "Campsite created successfully" },
                    "data":    { "$ref": "#/components/schemas/CampsiteDetail" }
                  }
                },
                "examples": {
                  "created_minimal": {
                    "summary": "201 – owner-only creation (no profile fields)",
                    "value": {
                      "success": true,
                      "message": "Campsite created successfully",
                      "data": {
                        "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                        "ownerFirstName": "John",
                        "ownerLastName":  "Doe",
                        "ownerEmail":     "john.doe@campsite.de",
                        "ownerPhone":     "+49 170 1234567",
                        "membershipDocument": null,
                        "name":           null,
                        "description":    null,
                        "location":       { "address": null, "city": null, "country": null, "lat": null, "lng": null },
                        "coverImageUrl":  null,
                        "websiteUrl":     null,
                        "bookingUrl":     null,
                        "showOnMap":      false,
                        "category":       null,
                        "isActive":       false,
                        "completeness": {
                          "isProfileComplete":    false,
                          "completionPercentage": 0,
                          "missingFields":        ["name", "description", "coverImageUrl", "location.address", "location.city", "location.country"],
                          "redirectBehaviour":    "hidden",
                          "websiteLink":          null
                        },
                        "createdAt": "2025-04-20T10:00:00.000Z",
                        "updatedAt": "2025-04-20T10:00:00.000Z"
                      }
                    }
                  },
                  "created_full": {
                    "summary": "201 – full creation with profile",
                    "value": {
                      "success": true,
                      "message": "Campsite created successfully",
                      "data": {
                        "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                        "ownerFirstName": "John",
                        "ownerLastName":  "Doe",
                        "ownerEmail":     "john.doe@campsite.de",
                        "ownerPhone":     "+49 170 1234567",
                        "membershipDocument": "https://assets.campnow.de/public/media/campsites/documents/1714123456789-membership.pdf",
                        "name":           "Lakeside Campground",
                        "description":    "A beautiful campsite by the lake.",
                        "location":       { "address": "Musterstraße 1", "city": "Munich", "country": "Germany", "lat": 48.1351, "lng": 11.582 },
                        "coverImageUrl":  "https://cdn.example.com/cover.jpg",
                        "websiteUrl":     "https://lakeside-campground.de",
                        "bookingUrl":     "https://booking.lakeside-campground.de",
                        "showOnMap":      true,
                        "category":       "664f1a2b3c4d5e6f7a8b9c01",
                        "isActive":       true,
                        "completeness": {
                          "isProfileComplete":    true,
                          "completionPercentage": 100,
                          "missingFields":        [],
                          "redirectBehaviour":    "detail-page",
                          "websiteLink":          "https://lakeside-campground.de"
                        },
                        "createdAt": "2025-04-20T10:00:00.000Z",
                        "updatedAt": "2025-04-20T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "409": {
            "description": "Owner email already exists on another campsite",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" },
                "example": {
                  "success": false,
                  "message": "A campsite with this owner email already exists",
                  "data":    null,
                  "errors":  null
                }
              }
            }
          },
          "422": {
            "description": "Request body validation error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" },
                "examples": {
                  "missing_required": {
                    "summary": "422 – missing required fields",
                    "value": {
                      "success": false,
                      "message": "Validation Error",
                      "data":    null,
                      "errors":  ["Owner first name is required.", "Owner email is required."]
                    }
                  },
                  "invalid_email": {
                    "summary": "422 – invalid email format",
                    "value": {
                      "success": false,
                      "message": "Validation Error",
                      "data":    null,
                      "errors":  ["Owner email must be a valid email address."]
                    }
                  },
                  "invalid_pdf": {
                    "summary": "422 – wrong file type for membership document",
                    "value": {
                      "success": false,
                      "message": "Only PDF files are allowed",
                      "data":    null,
                      "errors":  null
                    }
                  },
                  "invalid_url": {
                    "summary": "422 – bad URL format",
                    "value": {
                      "success": false,
                      "message": "Validation Error",
                      "data":    null,
                      "errors":  ["\"websiteUrl\" must be a valid uri"]
                    }
                  }
                }
              }
            }
          },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/admin/campsites/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Campsite MongoDB ObjectId",
          "schema": { "type": "string", "example": "664f1a2b3c4d5e6f7a8b9c0d" }
        }
      ],
      "get": {
        "tags": ["Admin – Campsites"],
        "summary": "Get campsite detail",
        "operationId": "adminGetCampsite",
        "responses": {
          "200": {
            "description": "Campsite retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "message": { "type": "string",  "example": "Campsite retrieved successfully" },
                    "data":    { "$ref": "#/components/schemas/CampsiteDetail" }
                  }
                },
                "examples": {
                  "incomplete_profile": {
                    "summary": "200 – incomplete profile (hidden)",
                    "value": {
                      "success": true,
                      "message": "Campsite retrieved successfully",
                      "data": {
                        "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                        "ownerFirstName": "John",
                        "ownerLastName":  "Doe",
                        "ownerEmail":     "john.doe@campsite.de",
                        "ownerPhone":     null,
                        "membershipDocument": null,
                        "name":           "Lakeside Campground",
                        "description":    null,
                        "location":       { "address": null, "city": null, "country": null, "lat": null, "lng": null },
                        "coverImageUrl":  null,
                        "websiteUrl":     null,
                        "bookingUrl":     null,
                        "showOnMap":      false,
                        "category":       null,
                        "isActive":       false,
                        "completeness": {
                          "isProfileComplete":    false,
                          "completionPercentage": 17,
                          "missingFields":        ["description", "coverImageUrl", "location.address", "location.city", "location.country"],
                          "redirectBehaviour":    "hidden",
                          "websiteLink":          null
                        },
                        "createdAt": "2025-04-20T10:00:00.000Z",
                        "updatedAt": "2025-04-20T10:00:00.000Z"
                      }
                    }
                  },
                  "has_website_no_profile": {
                    "summary": "200 – has website URL but profile incomplete (external-website)",
                    "value": {
                      "success": true,
                      "message": "Campsite retrieved successfully",
                      "data": {
                        "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                        "ownerFirstName": "Jane",
                        "ownerLastName":  "Smith",
                        "ownerEmail":     "jane.smith@campsite.de",
                        "ownerPhone":     "+49 160 9876543",
                        "membershipDocument": null,
                        "name":           "Forest Camp",
                        "description":    null,
                        "location":       { "address": null, "city": null, "country": null, "lat": null, "lng": null },
                        "coverImageUrl":  null,
                        "websiteUrl":     "https://forest-camp.de",
                        "bookingUrl":     null,
                        "showOnMap":      false,
                        "category":       null,
                        "isActive":       false,
                        "completeness": {
                          "isProfileComplete":    false,
                          "completionPercentage": 17,
                          "missingFields":        ["description", "coverImageUrl", "location.address", "location.city", "location.country"],
                          "redirectBehaviour":    "external-website",
                          "websiteLink":          "https://forest-camp.de"
                        },
                        "createdAt": "2025-04-20T10:00:00.000Z",
                        "updatedAt": "2025-04-20T10:00:00.000Z"
                      }
                    }
                  },
                  "complete_profile": {
                    "summary": "200 – complete profile (detail-page)",
                    "value": {
                      "success": true,
                      "message": "Campsite retrieved successfully",
                      "data": {
                        "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                        "ownerFirstName": "Klaus",
                        "ownerLastName":  "Müller",
                        "ownerEmail":     "k.mueller@campsite.de",
                        "ownerPhone":     "+49 151 55443322",
                        "membershipDocument": "https://assets.campnow.de/public/media/campsites/documents/1714123456789-membership.pdf",
                        "name":           "Alpine Retreat",
                        "description":    "Stunning alpine camping experience.",
                        "location":       { "address": "Bergweg 3", "city": "Garmisch", "country": "Germany", "lat": 47.4929, "lng": 11.0958 },
                        "coverImageUrl":  "https://cdn.example.com/alpine-cover.jpg",
                        "websiteUrl":     "https://alpine-retreat.de",
                        "bookingUrl":     "https://booking.alpine-retreat.de",
                        "showOnMap":      true,
                        "category":       "664f1a2b3c4d5e6f7a8b9c01",
                        "isActive":       true,
                        "completeness": {
                          "isProfileComplete":    true,
                          "completionPercentage": 100,
                          "missingFields":        [],
                          "redirectBehaviour":    "detail-page",
                          "websiteLink":          "https://alpine-retreat.de"
                        },
                        "createdAt": "2025-04-18T08:00:00.000Z",
                        "updatedAt": "2025-04-20T12:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "put": {
        "tags": ["Admin – Campsites"],
        "summary": "Update campsite (full update)",
        "operationId": "adminUpdateCampsite",
        "description": "Updates any subset of campsite fields. All body fields are optional — only provided fields are updated.\n\n`membershipDocument` replaces the existing PDF if provided.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "ownerFirstName":     { "type": "string",  "example": "John" },
                  "ownerLastName":      { "type": "string",  "example": "Doe" },
                  "ownerEmail":         { "type": "string",  "example": "john.doe@campsite.de" },
                  "ownerPhone":         { "type": "string",  "example": "+49 170 1234567" },
                  "membershipDocument": { "type": "string",  "format": "binary", "description": "PDF only, max 5 MB. Replaces existing." },
                  "siteStatus":         { "type": "boolean", "example": true,    "description": "true = enable access." },
                  "name":               { "type": "string",  "example": "Updated Campground Name" },
                  "description":        { "type": "string",  "example": "Updated description." },
                  "location[address]":  { "type": "string",  "example": "Neustraße 5" },
                  "location[city]":     { "type": "string",  "example": "Berlin" },
                  "location[country]":  { "type": "string",  "example": "Germany" },
                  "location[lat]":      { "type": "number",  "example": 52.52 },
                  "location[lng]":      { "type": "number",  "example": 13.405 },
                  "coverImageUrl":      { "type": "string",  "example": "https://cdn.example.com/new-cover.jpg" },
                  "websiteUrl":         { "type": "string",  "example": "https://updated-campground.de" },
                  "bookingUrl":         { "type": "string",  "example": "https://booking.updated-campground.de" },
                  "showOnMap":          { "type": "boolean", "example": true },
                  "category":           { "type": "string",  "example": "664f1a2b3c4d5e6f7a8b9c01" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campsite updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "message": { "type": "string",  "example": "Campsite updated successfully" },
                    "data":    { "$ref": "#/components/schemas/CampsiteDetail" }
                  }
                },
                "examples": {
                  "profile_now_complete": {
                    "summary": "200 – profile became complete after update",
                    "value": {
                      "success": true,
                      "message": "Campsite updated successfully",
                      "data": {
                        "id":             "664f1a2b3c4d5e6f7a8b9c0d",
                        "ownerFirstName": "John",
                        "ownerLastName":  "Doe",
                        "ownerEmail":     "john.doe@campsite.de",
                        "ownerPhone":     "+49 170 1234567",
                        "membershipDocument": "https://assets.campnow.de/public/media/campsites/documents/1714999999999-membership.pdf",
                        "name":           "Lakeside Campground",
                        "description":    "A beautiful campsite by the lake.",
                        "location":       { "address": "Musterstraße 1", "city": "Munich", "country": "Germany", "lat": 48.1351, "lng": 11.582 },
                        "coverImageUrl":  "https://cdn.example.com/cover.jpg",
                        "websiteUrl":     "https://lakeside-campground.de",
                        "bookingUrl":     "https://booking.lakeside-campground.de",
                        "showOnMap":      true,
                        "category":       null,
                        "isActive":       true,
                        "completeness": {
                          "isProfileComplete":    true,
                          "completionPercentage": 100,
                          "missingFields":        [],
                          "redirectBehaviour":    "detail-page",
                          "websiteLink":          "https://lakeside-campground.de"
                        },
                        "createdAt": "2025-04-20T10:00:00.000Z",
                        "updatedAt": "2025-04-20T14:30:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": {
            "description": "Owner email already used by another campsite",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" },
                "example": {
                  "success": false,
                  "message": "A campsite with this owner email already exists",
                  "data":    null,
                  "errors":  null
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" },
                "examples": {
                  "bad_email": {
                    "summary": "422 – invalid email",
                    "value": {
                      "success": false,
                      "message": "Validation Error",
                      "data":    null,
                      "errors":  ["\"ownerEmail\" must be a valid email"]
                    }
                  },
                  "bad_pdf": {
                    "summary": "422 – non-PDF file uploaded",
                    "value": {
                      "success": false,
                      "message": "Only PDF files are allowed",
                      "data":    null,
                      "errors":  null
                    }
                  }
                }
              }
            }
          },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "delete": {
        "tags": ["Admin – Campsites"],
        "summary": "Delete (soft-delete) a campsite",
        "operationId": "adminDeleteCampsite",
        "description": "Soft-deletes the campsite (sets `isDeleted: true`, `isActive: false`). Requires `confirmed: true` in the request body as a safeguard.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["confirmed"],
                "properties": {
                  "confirmed": {
                    "type": "boolean",
                    "enum": [true],
                    "example": true,
                    "description": "Must be true. Acts as a deletion confirmation guard."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campsite deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean", "example": true },
                    "message": { "type": "string",  "example": "Campsite deleted successfully" },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deletedId": { "type": "string", "example": "664f1a2b3c4d5e6f7a8b9c0d" }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Campsite deleted successfully",
                  "data":    { "deletedId": "664f1a2b3c4d5e6f7a8b9c0d" }
                }
              }
            }
          },
          "400": {
            "description": "confirmed flag not set to true",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" },
                "example": {
                  "success": false,
                  "message": "Please set confirmed: true to delete this campsite",
                  "data":    null,
                  "errors":  null
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "422": {
            "description": "Validation error – confirmed field missing or wrong value",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ValidationErrorResponse" },
                "example": {
                  "success": false,
                  "message": "Validation Error",
                  "data":    null,
                  "errors":  ["confirmed must be true.", "confirmed is required."]
                }
              }
            }
          },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Admin – Campsites",
      "description": "Admin-only campsite management endpoints. All require Bearer JWT with admin role."
    }
  ]
}
