{
  "openapi": "3.0.3",
  "info": {
    "title": "DC City Sanctuary public rental API",
    "version": "1.0.0",
    "description": "Read-only rental facts and inquiry availability. Does not send email, reserve dates, accept payments or sign leases.",
    "contact": {
      "email": "dccitysanctuary@gmail.com"
    },
    "termsOfService": "https://dc-city-sanctuary.pages.dev/terms.html"
  },
  "servers": [
    {
      "url": "https://dc-city-sanctuary.pages.dev"
    }
  ],
  "security": [],
  "paths": {
    "/property.json": {
      "get": {
        "operationId": "getRentalDetails",
        "summary": "Read public rental facts, charges and rules",
        "description": "Read-only. No authentication or tenant information. Charges are advertised terms, subject to an agreed lease.",
        "responses": {
          "200": {
            "description": "Public rental facts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "rent",
                    "fees",
                    "booking"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/check-availability": {
      "get": {
        "operationId": "checkRentalAvailability",
        "summary": "Check a proposed monthly stay",
        "description": "Read-only. Treats move-out as occupied, enforces a two-month minimum and two full cleaning days after departure and before a later booking. Stale (48h), review and uncovered snapshots require confirmation. open_for_inquiry is not a reservation.",
        "parameters": [
          {
            "name": "moveIn",
            "in": "query",
            "required": true,
            "description": "Local date in America/New_York; YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          },
          {
            "name": "moveOut",
            "in": "query",
            "required": true,
            "description": "Local date in America/New_York; YYYY-MM-DD.",
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Availability assessment, with timestamp and owner confirmation requirement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailabilityAssessment"
                }
              }
            }
          },
          "400": {
            "description": "Missing, duplicate, unknown or malformed query parameters"
          },
          "405": {
            "description": "Only GET is supported"
          },
          "503": {
            "description": "Invalid calendar snapshot; confirmation required"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AvailabilityAssessment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "moveIn",
          "moveOut",
          "timeZone",
          "minimumStayMonths",
          "fullCleaningDays",
          "checkedAt",
          "ownerConfirmationRequired",
          "reservationCreated",
          "status",
          "reason",
          "source"
        ],
        "properties": {
          "moveIn": {
            "type": "string",
            "format": "date"
          },
          "moveOut": {
            "type": "string",
            "format": "date"
          },
          "timeZone": {
            "type": "string",
            "enum": [
              "America/New_York"
            ]
          },
          "minimumStayMonths": {
            "type": "integer",
            "enum": [
              2
            ]
          },
          "fullCleaningDays": {
            "type": "integer",
            "enum": [
              2
            ]
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "ownerConfirmationRequired": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "reservationCreated": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open_for_inquiry",
              "unavailable",
              "invalid_dates",
              "confirmation_required"
            ]
          },
          "reason": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
