@alba-cars/common-modules
Version:
A package containing DTOs, validation classes and common modules and interfaces for Alba Cars
74 lines (73 loc) • 3.25 kB
JavaScript
;
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.UpdateUserDocumentDto = exports.UserDocumentResponseDto = exports.CreateUserDocumentDto = void 0;
const class_validator_1 = require("class-validator");
// DTO for creating a new UserDocument
class CreateUserDocumentDto {
}
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateUserDocumentDto.prototype, "url", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateUserDocumentDto.prototype, "fileName", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateUserDocumentDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.IsEnum)(['image', 'pdf', 'unknown']),
__metadata("design:type", String)
], CreateUserDocumentDto.prototype, "fileType", void 0);
__decorate([
(0, class_validator_1.IsNotEmpty)(),
(0, class_validator_1.IsUUID)(),
__metadata("design:type", String)
], CreateUserDocumentDto.prototype, "ownerId", void 0);
exports.CreateUserDocumentDto = CreateUserDocumentDto;
// DTO for returning UserDocument data
class UserDocumentResponseDto {
constructor(partial) {
Object.assign(this, partial);
}
}
exports.UserDocumentResponseDto = UserDocumentResponseDto;
// DTO for updating a UserDocument
class UpdateUserDocumentDto {
}
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateUserDocumentDto.prototype, "url", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateUserDocumentDto.prototype, "fileName", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], UpdateUserDocumentDto.prototype, "description", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEnum)(['image', 'pdf', 'unknown']),
__metadata("design:type", String)
], UpdateUserDocumentDto.prototype, "fileType", void 0);
exports.UpdateUserDocumentDto = UpdateUserDocumentDto;