"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VISIT_SESSION_ID_EXAMPLE = exports.VISITOR_PASS_ID_EXAMPLE = exports.VISITOR_ID_EXAMPLE = exports.RESIDENT_ID_EXAMPLE = exports.GUARD_ID_EXAMPLE = exports.USER_ID_EXAMPLE = exports.ESTATE_ID_EXAMPLE = void 0;
exports.ApiProtectedEndpoint = ApiProtectedEndpoint;
exports.ApiValidationError = ApiValidationError;
exports.ApiNotFoundError = ApiNotFoundError;
exports.ApiAuthThrottleError = ApiAuthThrottleError;
const common_1 = require("@nestjs/common");
const swagger_1 = require("@nestjs/swagger");
exports.ESTATE_ID_EXAMPLE = '00000000-0000-4000-8000-000000000001';
exports.USER_ID_EXAMPLE = 'user-uuid';
exports.GUARD_ID_EXAMPLE = 'guard-uuid';
exports.RESIDENT_ID_EXAMPLE = 'resident-uuid';
exports.VISITOR_ID_EXAMPLE = 'visitor-uuid';
exports.VISITOR_PASS_ID_EXAMPLE = 'visitor-pass-uuid';
exports.VISIT_SESSION_ID_EXAMPLE = 'visit-session-uuid';
const errorSchema = (statusCode, error, message) => ({
    example: {
        statusCode,
        message,
        error
    }
});
function ApiProtectedEndpoint() {
    return (0, common_1.applyDecorators)((0, swagger_1.ApiBearerAuth)('bearer'), (0, swagger_1.ApiUnauthorizedResponse)({
        description: 'Missing, expired, or invalid access token.',
        schema: errorSchema(401, 'Unauthorized', 'Bearer token is required')
    }), (0, swagger_1.ApiForbiddenResponse)({
        description: 'Authenticated user does not have the required role or estate scope.',
        schema: errorSchema(403, 'Forbidden', 'Cross-estate access is not allowed')
    }));
}
function ApiValidationError() {
    return (0, swagger_1.ApiBadRequestResponse)({
        description: 'Request body, query, or route parameter failed validation.',
        schema: errorSchema(400, 'Bad Request', ['estateId must be a string'])
    });
}
function ApiNotFoundError(resource) {
    return (0, swagger_1.ApiNotFoundResponse)({
        description: `${resource} was not found or is not visible in this estate.`,
        schema: errorSchema(404, 'Not Found', `${resource} not found`)
    });
}
function ApiAuthThrottleError() {
    return (0, swagger_1.ApiTooManyRequestsResponse)({
        description: 'Authentication rate limit exceeded. Wait for the throttling window to reset.',
        schema: errorSchema(429, 'Too Many Requests', 'Too many requests')
    });
}
//# sourceMappingURL=swagger-docs.js.map