"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdminUpdatePermissionDto = exports.AdminCreatePermissionDto = void 0;
const class_validator_1 = require("class-validator");
const swagger_1 = require("@nestjs/swagger");
class AdminCreatePermissionDto {
    name;
    guard;
    description;
    category;
    metadata;
}
exports.AdminCreatePermissionDto = AdminCreatePermissionDto;
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Permission name (must be unique per guard)',
        example: 'users.create',
        minLength: 1,
        maxLength: 255,
    }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    (0, class_validator_1.MinLength)(1),
    (0, class_validator_1.MaxLength)(255),
    __metadata("design:type", String)
], AdminCreatePermissionDto.prototype, "name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Guard name (defaults to "web" if not provided)',
        required: false,
        example: 'web',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], AdminCreatePermissionDto.prototype, "guard", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Optional description of what this permission allows',
        required: false,
        example: 'Allows creating new user accounts',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], AdminCreatePermissionDto.prototype, "description", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Optional category to group permissions (e.g., "users", "posts", "admin")',
        required: false,
        example: 'users',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], AdminCreatePermissionDto.prototype, "category", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Optional metadata for additional permission information',
        required: false,
        example: { level: 'write', resource: 'users' },
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsObject)(),
    __metadata("design:type", Object)
], AdminCreatePermissionDto.prototype, "metadata", void 0);
class AdminUpdatePermissionDto {
    name;
    guard;
    updateInRoles;
    description;
    category;
    metadata;
}
exports.AdminUpdatePermissionDto = AdminUpdatePermissionDto;
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Permission name (must be unique per guard if changed). If changed, can optionally update in all roles.',
        required: false,
        example: 'users.create',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.MinLength)(1),
    (0, class_validator_1.MaxLength)(255),
    __metadata("design:type", String)
], AdminUpdatePermissionDto.prototype, "name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Guard name',
        required: false,
        example: 'web',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], AdminUpdatePermissionDto.prototype, "guard", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Whether to update permission name in all roles that use it (only if name is being changed)',
        required: false,
        default: false,
    }),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", Boolean)
], AdminUpdatePermissionDto.prototype, "updateInRoles", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Optional description of what this permission allows',
        required: false,
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], AdminUpdatePermissionDto.prototype, "description", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Optional category to group permissions',
        required: false,
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], AdminUpdatePermissionDto.prototype, "category", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Optional metadata',
        required: false,
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsObject)(),
    __metadata("design:type", Object)
], AdminUpdatePermissionDto.prototype, "metadata", void 0);
//# sourceMappingURL=admin-permission.dto.js.map