"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.LoginRequestDto = void 0;
const class_validator_1 = require("class-validator");
const swagger_1 = require("@nestjs/swagger");
const email_credentials_dto_1 = require("../credentials/email-credentials.dto");
const phone_credentials_dto_1 = require("../credentials/phone-credentials.dto");
const social_credentials_dto_1 = require("../credentials/social-credentials.dto");
let LoginRequestDto = class LoginRequestDto {
    providerName;
    credentials;
    tenantId;
    createUserIfNotExists;
};
exports.LoginRequestDto = LoginRequestDto;
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Authentication provider name',
        example: 'email',
        enum: ['email', 'phone', 'google', 'facebook', 'apple', 'github'],
        default: 'email',
    }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", String)
], LoginRequestDto.prototype, "providerName", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Login credentials - type varies by provider',
        required: false,
        examples: {
            emailLogin: {
                summary: 'Email Login',
                value: { email: 'user@example.com', password: 'SecurePass123!' },
            },
            phoneLogin: {
                summary: 'Phone Login',
                value: { phone: '+1234567890', password: 'SecurePass123!' },
            },
            socialLogin: {
                summary: 'Social Login (Google/Facebook/etc)',
                value: { token: 'ya29.a0AfH6SMBx...' },
            },
        },
        oneOf: [
            { $ref: (0, swagger_1.getSchemaPath)(email_credentials_dto_1.EmailCredentialsDto) },
            { $ref: (0, swagger_1.getSchemaPath)(phone_credentials_dto_1.PhoneCredentialsDto) },
            { $ref: (0, swagger_1.getSchemaPath)(social_credentials_dto_1.SocialCredentialsDto) },
        ],
    }),
    (0, class_validator_1.IsObject)(),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", Object)
], LoginRequestDto.prototype, "credentials", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Tenant ID for multi-tenant applications',
        example: '123e4567-e89b-12d3-a456-426614174000',
    }),
    (0, class_validator_1.IsUUID)(),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", String)
], LoginRequestDto.prototype, "tenantId", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Auto-create user if not exists (for social auth)',
        default: false,
    }),
    (0, class_validator_1.IsBoolean)(),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", Boolean)
], LoginRequestDto.prototype, "createUserIfNotExists", void 0);
exports.LoginRequestDto = LoginRequestDto = __decorate([
    (0, swagger_1.ApiExtraModels)(email_credentials_dto_1.EmailCredentialsDto, phone_credentials_dto_1.PhoneCredentialsDto, social_credentials_dto_1.SocialCredentialsDto)
], LoginRequestDto);
//# sourceMappingURL=login.request.dto.js.map