Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
136 lines
6.2 KiB
JavaScript
136 lines
6.2 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.UpdateOrderStatusDto = exports.CreateOrderDto = exports.OrderItemDto = void 0;
|
|
const swagger_1 = require("@nestjs/swagger");
|
|
const class_validator_1 = require("class-validator");
|
|
const class_transformer_1 = require("class-transformer");
|
|
const order_entity_1 = require("../entities/order.entity");
|
|
class OrderItemDto {
|
|
}
|
|
exports.OrderItemDto = OrderItemDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'ID del producto' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsUUID)(),
|
|
__metadata("design:type", String)
|
|
], OrderItemDto.prototype, "productId", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Nombre del producto' }),
|
|
(0, class_validator_1.IsString)(),
|
|
(0, class_validator_1.MaxLength)(100),
|
|
__metadata("design:type", String)
|
|
], OrderItemDto.prototype, "productName", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Cantidad', example: 2 }),
|
|
(0, class_validator_1.IsNumber)(),
|
|
(0, class_validator_1.Min)(0.001),
|
|
__metadata("design:type", Number)
|
|
], OrderItemDto.prototype, "quantity", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ description: 'Precio unitario', example: 25.5 }),
|
|
(0, class_validator_1.IsNumber)(),
|
|
(0, class_validator_1.Min)(0),
|
|
__metadata("design:type", Number)
|
|
], OrderItemDto.prototype, "unitPrice", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Notas del item' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], OrderItemDto.prototype, "notes", void 0);
|
|
class CreateOrderDto {
|
|
}
|
|
exports.CreateOrderDto = CreateOrderDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'ID del cliente' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsUUID)(),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "customerId", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ enum: order_entity_1.OrderChannel, default: order_entity_1.OrderChannel.WHATSAPP }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsEnum)(order_entity_1.OrderChannel),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "channel", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ enum: order_entity_1.OrderType, default: order_entity_1.OrderType.PICKUP }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsEnum)(order_entity_1.OrderType),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "orderType", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ type: [OrderItemDto], description: 'Items del pedido' }),
|
|
(0, class_validator_1.IsArray)(),
|
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
(0, class_transformer_1.Type)(() => OrderItemDto),
|
|
__metadata("design:type", Array)
|
|
], CreateOrderDto.prototype, "items", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Cargo por delivery', default: 0 }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsNumber)(),
|
|
(0, class_validator_1.Min)(0),
|
|
__metadata("design:type", Number)
|
|
], CreateOrderDto.prototype, "deliveryFee", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Descuento', default: 0 }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsNumber)(),
|
|
(0, class_validator_1.Min)(0),
|
|
__metadata("design:type", Number)
|
|
], CreateOrderDto.prototype, "discountAmount", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Dirección de entrega' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "deliveryAddress", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Notas de entrega' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "deliveryNotes", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Notas del cliente' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "customerNotes", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Método de pago' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], CreateOrderDto.prototype, "paymentMethod", void 0);
|
|
class UpdateOrderStatusDto {
|
|
}
|
|
exports.UpdateOrderStatusDto = UpdateOrderStatusDto;
|
|
__decorate([
|
|
(0, swagger_1.ApiProperty)({ enum: order_entity_1.OrderStatus, description: 'Nuevo estado' }),
|
|
(0, class_validator_1.IsEnum)(order_entity_1.OrderStatus),
|
|
__metadata("design:type", String)
|
|
], UpdateOrderStatusDto.prototype, "status", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Razón (para cancelación)' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], UpdateOrderStatusDto.prototype, "reason", void 0);
|
|
__decorate([
|
|
(0, swagger_1.ApiPropertyOptional)({ description: 'Notas internas' }),
|
|
(0, class_validator_1.IsOptional)(),
|
|
(0, class_validator_1.IsString)(),
|
|
__metadata("design:type", String)
|
|
], UpdateOrderStatusDto.prototype, "internalNotes", void 0);
|
|
//# sourceMappingURL=order.dto.js.map
|