michangarrito/apps/backend/dist/modules/inventory/entities/stock-alert.entity.js
rckrdmrd 48dea7a5d0 feat: Initial commit - michangarrito
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>
2026-01-07 04:41:02 -06:00

82 lines
3.5 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.StockAlert = exports.AlertStatus = exports.AlertType = void 0;
const typeorm_1 = require("typeorm");
const product_entity_1 = require("../../products/entities/product.entity");
var AlertType;
(function (AlertType) {
AlertType["LOW_STOCK"] = "low_stock";
AlertType["OUT_OF_STOCK"] = "out_of_stock";
AlertType["EXPIRING"] = "expiring";
})(AlertType || (exports.AlertType = AlertType = {}));
var AlertStatus;
(function (AlertStatus) {
AlertStatus["ACTIVE"] = "active";
AlertStatus["RESOLVED"] = "resolved";
AlertStatus["DISMISSED"] = "dismissed";
})(AlertStatus || (exports.AlertStatus = AlertStatus = {}));
let StockAlert = class StockAlert {
};
exports.StockAlert = StockAlert;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], StockAlert.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tenant_id' }),
__metadata("design:type", String)
], StockAlert.prototype, "tenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'product_id' }),
__metadata("design:type", String)
], StockAlert.prototype, "productId", void 0);
__decorate([
(0, typeorm_1.Column)({
name: 'alert_type',
type: 'varchar',
length: 20,
}),
__metadata("design:type", String)
], StockAlert.prototype, "alertType", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'varchar',
length: 20,
default: AlertStatus.ACTIVE,
}),
__metadata("design:type", String)
], StockAlert.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'current_stock', type: 'decimal', precision: 10, scale: 3 }),
__metadata("design:type", Number)
], StockAlert.prototype, "currentStock", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'threshold', type: 'decimal', precision: 10, scale: 3 }),
__metadata("design:type", Number)
], StockAlert.prototype, "threshold", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'resolved_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], StockAlert.prototype, "resolvedAt", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
__metadata("design:type", Date)
], StockAlert.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => product_entity_1.Product),
(0, typeorm_1.JoinColumn)({ name: 'product_id' }),
__metadata("design:type", product_entity_1.Product)
], StockAlert.prototype, "product", void 0);
exports.StockAlert = StockAlert = __decorate([
(0, typeorm_1.Entity)({ schema: 'inventory', name: 'stock_alerts' })
], StockAlert);
//# sourceMappingURL=stock-alert.entity.js.map