"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.UpdateDriverDto = exports.CreateDriverDto = void 0;
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const status_enum_1 = require("../../common/columntype/status.enum");
const IsValidPhoneNumber_1 = require("../../validators/IsValidPhoneNumber");
const user_entity_1 = require("../../appapi/user/user.entity");
const typeorm_1 = require("typeorm");
class CreateDriverDto {
}
exports.CreateDriverDto = CreateDriverDto;
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'John', description: 'First name of the user' }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'Doe', description: 'Last name of the user' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "lastName", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'john.doe@example.com', description: 'Email address of the user' }),
    (0, class_validator_1.IsEmail)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "email", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '1990-01-01', description: 'Date of birth of the user', type: 'string', format: 'date', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsDateString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "dateOfBirth", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'American', description: 'Nationality of the user' }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "nationality", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'en', description: 'Preferred language', default: 'en' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "preferredLanguage", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'male', description: 'Gender of the user' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "gender", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        example: 'DRV12345',
        description: 'Unique identifier of the driver',
    }),
    (0, class_validator_1.IsString)({ message: 'driverId must be a string' }),
    (0, class_validator_1.IsNotEmpty)({ message: 'driverId is required' }),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "driverId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '+1234567890', description: 'Mobile number of the user' }),
    (0, class_validator_1.IsString)(),
    (0, IsValidPhoneNumber_1.IsValidPhoneNumber)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "mobileNumber", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'strongpassword', description: 'Password for the user account' }),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "password", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'https://example.com/photo.jpg', description: 'User profile photo', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "userPhoto", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '123 Street, City, Country', description: 'User address', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "userAddress", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 1, description: 'Vendor ID' }),
    (0, class_validator_1.IsNotEmpty)(),
    (0, class_validator_1.IsNumber)(),
    __metadata("design:type", Number)
], CreateDriverDto.prototype, "vendorId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 2, description: 'Shop ID' }),
    (0, class_validator_1.IsNotEmpty)(),
    (0, class_validator_1.IsNumber)(),
    __metadata("design:type", Number)
], CreateDriverDto.prototype, "shopId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'vehicle.jpg', description: 'Vehicle Photo', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "vehicle_photo", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'ABC-1234', description: 'Name Plate', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "name_plate", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'ABC-987789-1234', description: 'DL Number', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "dl_number", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '2030-01-01', description: 'DL expiry date', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "dl_expiry_date", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'vehicle_name', description: 'Vehicle name', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "vehicle_name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'vehicle_color', description: 'Vehicle color', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "vehicle_color", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '12', description: 'driver experience', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "experience", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: ['towing', 'battery'], description: 'Services offered' }),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsString)({ each: true }),
    __metadata("design:type", Array)
], CreateDriverDto.prototype, "services", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        example: [{ name: 'License', image: 'license.jpg' }],
        description: 'Documents',
        required: false,
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsObject)({ each: true }),
    __metadata("design:type", Array)
], CreateDriverDto.prototype, "documents", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ enum: status_enum_1.Status, example: status_enum_1.Status.ACTIVE }),
    (0, class_validator_1.IsEnum)(status_enum_1.Status, { message: "Status must be one of: active, inactive" }),
    __metadata("design:type", String)
], CreateDriverDto.prototype, "status", void 0);
__decorate([
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsEnum)(user_entity_1.UserRole, { each: true }),
    (0, typeorm_1.Column)({ type: 'text', array: true, default: [user_entity_1.UserRole.DRIVER] }),
    __metadata("design:type", Array)
], CreateDriverDto.prototype, "roles", void 0);
class UpdateDriverDto {
}
exports.UpdateDriverDto = UpdateDriverDto;
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'John', description: 'First name of the user' }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'Doe', description: 'Last name of the user' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "lastName", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'john.doe@example.com', description: 'Email address of the user' }),
    (0, class_validator_1.IsEmail)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "email", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '1990-01-01', description: 'Date of birth of the user', type: 'string', format: 'date', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsDateString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "dateOfBirth", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'American', description: 'Nationality of the user' }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsOptional)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "nationality", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'en', description: 'Preferred language', default: 'en' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "preferredLanguage", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'male', description: 'Gender of the user' }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "gender", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        example: 'DRV12345',
        description: 'Unique identifier of the driver',
    }),
    (0, class_validator_1.IsString)({ message: 'driverId must be a string' }),
    (0, class_validator_1.IsNotEmpty)({ message: 'driverId is required' }),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "driverId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '+1234567890', description: 'Mobile number of the user' }),
    (0, class_validator_1.IsString)(),
    (0, IsValidPhoneNumber_1.IsValidPhoneNumber)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "mobileNumber", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'strongpassword', description: 'Password for the user account' }),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "password", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'https://example.com/photo.jpg', description: 'User profile photo', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "userPhoto", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '123 Street, City, Country', description: 'User address', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "userAddress", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 1, description: 'Vendor ID', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsNumber)(),
    __metadata("design:type", Number)
], UpdateDriverDto.prototype, "vendorId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 2, description: 'Shop ID', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsNumber)(),
    __metadata("design:type", Number)
], UpdateDriverDto.prototype, "shopId", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'vehicle.jpg', description: 'Vehicle Photo', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "vehicle_photo", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'ABC-1234', description: 'Name Plate', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "name_plate", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'ABC-987789-1234', description: 'DL Number', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "dl_number", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '2030-01-01', description: 'DL expiry date', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "dl_expiry_date", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'vehicle_name', description: 'Vehicle name', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "vehicle_name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: 'vehicle_color', description: 'Vehicle color', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "vehicle_color", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: '12', description: 'driver experience', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "experience", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ example: ['towing', 'battery'], description: 'Services offered', required: false }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsString)({ each: true }),
    __metadata("design:type", Array)
], UpdateDriverDto.prototype, "services", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        example: [{ name: 'License', image: 'license.jpg' }],
        description: 'Documents',
        required: false,
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsObject)({ each: true }),
    __metadata("design:type", Array)
], UpdateDriverDto.prototype, "documents", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ enum: status_enum_1.Status, example: status_enum_1.Status.ACTIVE }),
    (0, class_validator_1.IsEnum)(status_enum_1.Status, { message: "Status must be one of: active, inactive" }),
    __metadata("design:type", String)
], UpdateDriverDto.prototype, "status", void 0);
__decorate([
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsEnum)(user_entity_1.UserRole, { each: true }),
    (0, typeorm_1.Column)({ type: 'text', array: true, default: [user_entity_1.UserRole.DRIVER] }),
    __metadata("design:type", Array)
], UpdateDriverDto.prototype, "roles", void 0);
//# sourceMappingURL=driver.dto.js.map