{
  "openapi": "3.0.0",
  "info": {
    "title": "ScaperWeb API",
    "version": "1.0.0",
    "description": "Simple API documentation for authentication and OTP endpoints."
  },
  "servers": [
    {
      "url": "https://scaperweb.com/api/",
      "description": "UAT server"
    }
  ],
  "paths": {
    "/api/auth/register": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Register customer user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 6
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "vendor",
                      "admin"
                    ]
                  }
                },
                "required": [
                  "name",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User registered successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "409": {
            "description": "Email already registered"
          }
        }
      }
    },
    "/api/auth/provider/register": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Register provider (vendor) user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 6
                  }
                },
                "required": [
                  "name",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Provider registered successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "409": {
            "description": "Email already registered"
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Login user",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Login successful"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Invalid credentials"
          }
        }
      }
    },
    "/api/auth/me": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Get current authenticated user",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "User information"
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/auth/send-otp": {
      "post": {
        "tags": [
          "OTP"
        ],
        "summary": "Send OTP to email or phone",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "login",
                      "register",
                      "reset_password",
                      "verify_email",
                      "verify_phone"
                    ]
                  },
                  "user_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP sent successfully"
          },
          "400": {
            "description": "Validation failed"
          }
        }
      }
    },
    "/api/auth/verify-otp": {
      "post": {
        "tags": [
          "OTP"
        ],
        "summary": "Verify OTP code",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "otp_code": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": "string"
                  }
                },
                "required": [
                  "otp_code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OTP verified successfully"
          },
          "400": {
            "description": "Invalid or expired OTP"
          }
        }
      }
    },
    "/api/auth/reset-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Reset password using OTP",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "otp_code": {
                    "type": "string"
                  },
                  "new_password": {
                    "type": "string",
                    "minLength": 6
                  }
                },
                "required": [
                  "email",
                  "otp_code",
                  "new_password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password reset successfully"
          },
          "400": {
            "description": "Validation failed or invalid/expired OTP"
          },
          "404": {
            "description": "User not found"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/vendor/profile": {
      "get": {
        "tags": [
          "Vendor"
        ],
        "summary": "Get vendor business profile",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Vendor business profile"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "404": {
            "description": "Profile not found"
          }
        }
      },
      "post": {
        "tags": [
          "Vendor"
        ],
        "summary": "Create vendor business profile",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service_areas": {
                    "type": "string"
                  },
                  "services_offered": {
                    "type": "string"
                  },
                  "years_experience": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "team_size": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "company_description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Profile created"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "409": {
            "description": "Profile already exists"
          }
        }
      }
    },
    "/api/vendor/profile/{id}": {
      "put": {
        "tags": [
          "Vendor"
        ],
        "summary": "Update vendor business profile",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Profile ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service_areas": {
                    "type": "string"
                  },
                  "services_offered": {
                    "type": "string"
                  },
                  "years_experience": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "team_size": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "company_description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile updated"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "404": {
            "description": "Profile not found"
          }
        }
      }
    },
    "/api/vendor/proposals": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "Get all vendor proposals",
        "description": "Retrieves all proposals submitted by the authenticated vendor. Optional query parameters: service_request_id, status",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "service_request_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Filter by service request ID"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "accepted",
                "rejected",
                "withdrawn"
              ]
            },
            "description": "Filter by proposal status"
          }
        ],
        "responses": {
          "200": {
            "description": "Proposals retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          }
        }
      },
      "post": {
        "tags": [
          "Proposals"
        ],
        "summary": "Create a new proposal",
        "description": "Submit a proposal/bid for a service request",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "service_request_id",
                  "bid_amount"
                ],
                "properties": {
                  "service_request_id": {
                    "type": "integer",
                    "description": "ID of the service request"
                  },
                  "scope_of_work": {
                    "type": "string",
                    "description": "Detailed description of services to be provided"
                  },
                  "service_timeline": {
                    "type": "string",
                    "description": "When the service will be performed (e.g., \"Next Monday at 9AM\")"
                  },
                  "bid_amount": {
                    "type": "number",
                    "minimum": 0,
                    "description": "Bid amount in dollars"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Proposal created successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "404": {
            "description": "Service request not found"
          },
          "409": {
            "description": "Proposal already exists for this service request"
          }
        }
      }
    },
    "/api/vendor/proposals/{id}": {
      "get": {
        "tags": [
          "Proposals"
        ],
        "summary": "Get proposal by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Proposal ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Proposal retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "404": {
            "description": "Proposal not found"
          }
        }
      },
      "put": {
        "tags": [
          "Proposals"
        ],
        "summary": "Update proposal by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Proposal ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scope_of_work": {
                    "type": "string"
                  },
                  "service_timeline": {
                    "type": "string"
                  },
                  "bid_amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "withdrawn"
                    ],
                    "description": "Vendors can only update status to pending or withdrawn"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proposal updated successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "404": {
            "description": "Proposal not found"
          }
        }
      },
      "delete": {
        "tags": [
          "Proposals"
        ],
        "summary": "Delete proposal by ID",
        "description": "Delete a proposal. Only pending proposals can be deleted.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Proposal ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Proposal deleted successfully"
          },
          "400": {
            "description": "Cannot delete proposal (not pending status)"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a vendor"
          },
          "404": {
            "description": "Proposal not found"
          }
        }
      }
    },
    "/api/vendor/service-requests": {
      "get": {
        "tags": [
          "Vendor",
          "Service Requests"
        ],
        "summary": "Browse available service requests (Job Marketplace)",
        "description": "Get all posted service requests that vendors can bid on. Includes property location information for distance calculation.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "one_time",
                "weekly",
                "bi_weekly",
                "monthly"
              ]
            },
            "description": "Filter by service frequency"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search in service title and description"
          }
        ],
        "responses": {
          "200": {
            "description": "Service requests retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "requests": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "count": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/customer/profile": {
      "get": {
        "tags": [
          "Customer"
        ],
        "summary": "Get customer profile",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Customer profile"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Profile not found"
          }
        }
      },
      "post": {
        "tags": [
          "Customer"
        ],
        "summary": "Create customer profile",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "street_address": {
                    "type": "string"
                  },
                  "unit_apt": {
                    "type": "string"
                  },
                  "zip_code": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "property_type": {
                    "type": "string",
                    "enum": [
                      "home",
                      "apartment",
                      "commercial"
                    ]
                  },
                  "area_size": {
                    "type": "string"
                  },
                  "preferred_services": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Profile created"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "409": {
            "description": "Profile already exists"
          }
        }
      }
    },
    "/api/customer/profile/{id}": {
      "put": {
        "tags": [
          "Customer"
        ],
        "summary": "Update customer profile",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Profile ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "street_address": {
                    "type": "string"
                  },
                  "unit_apt": {
                    "type": "string"
                  },
                  "zip_code": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "property_type": {
                    "type": "string",
                    "enum": [
                      "home",
                      "apartment",
                      "commercial"
                    ]
                  },
                  "area_size": {
                    "type": "string"
                  },
                  "preferred_services": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Profile updated"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Profile not found"
          }
        }
      }
    },
    "/api/customer/properties": {
      "get": {
        "tags": [
          "Properties"
        ],
        "summary": "Get all customer properties",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Properties retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          }
        }
      },
      "post": {
        "tags": [
          "Properties"
        ],
        "summary": "Create a new property",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "street_address": {
                    "type": "string"
                  },
                  "unit_apt": {
                    "type": "string"
                  },
                  "zip_code": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "property_type": {
                    "type": "string",
                    "enum": [
                      "home",
                      "apartment",
                      "commercial"
                    ]
                  },
                  "area_size": {
                    "type": "string"
                  },
                  "preferred_services": {
                    "type": "string"
                  },
                  "is_primary": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Property created successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          }
        }
      }
    },
    "/api/customer/properties/{user_id}": {
      "get": {
        "tags": [
          "Properties"
        ],
        "summary": "Get properties by user ID",
        "description": "Retrieves all properties for a specific user. Accepts user_id (UUID format) or property ID (integer). If numeric, returns a single property by ID.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "User ID (UUID format) to get properties for, or property ID (integer) to get a specific property"
          }
        ],
        "responses": {
          "200": {
            "description": "Properties retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "user_id": {
                          "type": "string"
                        },
                        "properties": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Properties not found"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/customer/properties/{id}": {
      "get": {
        "tags": [
          "Properties"
        ],
        "summary": "Get property by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Property ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Property retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Property not found"
          }
        }
      },
      "put": {
        "tags": [
          "Properties"
        ],
        "summary": "Update property by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Property ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "street_address": {
                    "type": "string"
                  },
                  "unit_apt": {
                    "type": "string"
                  },
                  "zip_code": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "property_type": {
                    "type": "string",
                    "enum": [
                      "home",
                      "apartment",
                      "commercial"
                    ]
                  },
                  "area_size": {
                    "type": "string"
                  },
                  "preferred_services": {
                    "type": "string"
                  },
                  "is_primary": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Property updated successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Property not found"
          }
        }
      }
    },
    "/api/customer/service-requests": {
      "get": {
        "tags": [
          "Service Requests"
        ],
        "summary": "Get all customer service requests",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Service requests retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          }
        }
      },
      "post": {
        "tags": [
          "Service Requests"
        ],
        "summary": "Create a new service request",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service_title": {
                    "type": "string"
                  },
                  "detailed_context": {
                    "type": "string"
                  },
                  "categories": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "one_time",
                      "weekly",
                      "bi_weekly",
                      "monthly"
                    ]
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "budget": {
                    "type": "number"
                  },
                  "property_id": {
                    "type": "integer"
                  },
                  "access_notes": {
                    "type": "string"
                  },
                  "photos": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "open",
                      "posted",
                      "cancelled",
                      "completed"
                    ]
                  }
                },
                "required": [
                  "service_title"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Service request created successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          }
        }
      }
    },
    "/api/customer/service-requests/{id}": {
      "get": {
        "tags": [
          "Service Requests"
        ],
        "summary": "Get a service request by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Service request ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Service request retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Service request not found"
          }
        }
      },
      "put": {
        "tags": [
          "Service Requests"
        ],
        "summary": "Update a service request by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Service request ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service_title": {
                    "type": "string"
                  },
                  "detailed_context": {
                    "type": "string"
                  },
                  "categories": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "one_time",
                      "weekly",
                      "bi_weekly",
                      "monthly"
                    ]
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "budget": {
                    "type": "number"
                  },
                  "property_id": {
                    "type": "integer"
                  },
                  "access_notes": {
                    "type": "string"
                  },
                  "photos": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "draft",
                      "open",
                      "posted",
                      "cancelled",
                      "completed"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Service request updated successfully"
          },
          "400": {
            "description": "Validation failed"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Service request not found"
          }
        }
      },
      "delete": {
        "tags": [
          "Service Requests"
        ],
        "summary": "Delete a service request by ID",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Service request ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Service request deleted successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Service request not found"
          }
        }
      }
    },
    "/api/customer/proposals": {
      "get": {
        "tags": [
          "Proposals",
          "Customer"
        ],
        "summary": "Get proposals received for customer service requests",
        "description": "Retrieves all proposals received for service requests owned by the authenticated customer. Shows vendor information and proposal details.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "service_request_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Filter by specific service request ID"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "accepted",
                "rejected",
                "withdrawn"
              ]
            },
            "description": "Filter by proposal status"
          }
        ],
        "responses": {
          "200": {
            "description": "Proposals retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "proposals": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "count": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "500": {
            "description": "Server error"
          }
        }
      }
    },
    "/api/customer/proposals/{id}": {
      "get": {
        "tags": [
          "Proposals",
          "Customer"
        ],
        "summary": "Get proposal by ID (received proposals)",
        "description": "Get details of a specific proposal received for one of the customer's service requests. Includes vendor profile information.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Proposal ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Proposal retrieved successfully"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden - not a customer"
          },
          "404": {
            "description": "Proposal not found"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
