michangarrito/apps/backend/dist/modules/invoices/dto/create-invoice.dto.js
rckrdmrd 97f407c661 [MIGRATION-V2] feat: Migrar michangarrito a estructura v2
- Prefijo v2: MCH
- TRACEABILITY-MASTER.yml creado
- Listo para integracion como submodulo

Workspace: v2.0.0 | SIMCO: v4.0.0
2026-01-10 11:28:54 -06:00

142 lines
6.8 KiB
JavaScript

"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.CreateInvoiceDto = exports.InvoiceItemDto = void 0;
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const class_transformer_1 = require("class-transformer");
class InvoiceItemDto {
}
exports.InvoiceItemDto = InvoiceItemDto;
__decorate([
(0, swagger_1.ApiProperty)({ example: '50202301', description: 'Clave producto/servicio SAT' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(8, 8),
__metadata("design:type", String)
], InvoiceItemDto.prototype, "claveProdServ", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'Coca-Cola 600ml', description: 'Descripcion del producto' }),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], InvoiceItemDto.prototype, "descripcion", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 2, description: 'Cantidad' }),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(0.000001),
__metadata("design:type", Number)
], InvoiceItemDto.prototype, "cantidad", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'H87', description: 'Clave unidad SAT' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 3),
__metadata("design:type", String)
], InvoiceItemDto.prototype, "claveUnidad", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'Pieza', description: 'Descripcion de la unidad', required: false }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], InvoiceItemDto.prototype, "unidad", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 18.00, description: 'Valor unitario' }),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.Min)(0),
__metadata("design:type", Number)
], InvoiceItemDto.prototype, "valorUnitario", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 0, description: 'Descuento', required: false }),
(0, class_validator_1.IsNumber)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", Number)
], InvoiceItemDto.prototype, "descuento", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'product-uuid', description: 'ID del producto', required: false }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], InvoiceItemDto.prototype, "productId", void 0);
class CreateInvoiceDto {
}
exports.CreateInvoiceDto = CreateInvoiceDto;
__decorate([
(0, swagger_1.ApiProperty)({ example: 'sale-uuid', description: 'ID de la venta asociada', required: false }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "saleId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'XAXX010101000', description: 'RFC del receptor' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(12, 13),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "receptorRfc", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'Juan Perez', description: 'Nombre o razon social' }),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "receptorNombre", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: '601', description: 'Regimen fiscal del receptor', required: false }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.Length)(3, 3),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "receptorRegimenFiscal", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: '06600', description: 'Codigo postal del receptor' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(5, 5),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "receptorCodigoPostal", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'G03', description: 'Uso del CFDI' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(3, 4),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "receptorUsoCfdi", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'cliente@email.com', description: 'Email para envio', required: false }),
(0, class_validator_1.IsEmail)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "receptorEmail", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: '01', description: 'Forma de pago SAT (01=Efectivo, 04=Tarjeta)' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(2, 2),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "formaPago", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'PUE', description: 'Metodo de pago (PUE=Una sola exhibicion)' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.Length)(3, 3),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "metodoPago", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ example: 'Contado', description: 'Condiciones de pago', required: false }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "condicionesPago", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ type: [InvoiceItemDto], description: 'Conceptos de la factura' }),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.ValidateNested)({ each: true }),
(0, class_transformer_1.Type)(() => InvoiceItemDto),
__metadata("design:type", Array)
], CreateInvoiceDto.prototype, "items", void 0);
__decorate([
(0, swagger_1.ApiProperty)({ description: 'Notas adicionales', required: false }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], CreateInvoiceDto.prototype, "notes", void 0);
//# sourceMappingURL=create-invoice.dto.js.map