154 lines
4.6 KiB
Markdown
154 lines
4.6 KiB
Markdown
# Entities Catalog - MiInventario
|
|
|
|
**Alias:** @PROJ_DEF_ENTITIES
|
|
**Version:** 1.0.0
|
|
**Ultima actualizacion:** 2026-01-16
|
|
|
|
---
|
|
|
|
## 1. RESUMEN
|
|
|
|
| Metrica | Valor |
|
|
|---------|-------|
|
|
| **Total Entities** | 21 |
|
|
| **Por Modulo** | Ver seccion 2 |
|
|
|
|
---
|
|
|
|
## 2. ENTITIES POR MODULO
|
|
|
|
### 2.1 Modulo: Auth
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Otp | `auth/entities/otp.entity.ts` | otps | Codigos OTP para verificacion |
|
|
| RefreshToken | `auth/entities/refresh-token.entity.ts` | refresh_tokens | Tokens de refresco JWT |
|
|
|
|
### 2.2 Modulo: Users
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| User | `users/entities/user.entity.ts` | users | Usuarios del sistema |
|
|
|
|
### 2.3 Modulo: Stores
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Store | `stores/entities/store.entity.ts` | stores | Tiendas de usuarios |
|
|
| StoreUser | `stores/entities/store-user.entity.ts` | store_users | Relacion usuarios-tiendas |
|
|
|
|
### 2.4 Modulo: Inventory
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| InventoryItem | `inventory/entities/inventory-item.entity.ts` | inventory_items | Items de inventario detectados |
|
|
|
|
### 2.5 Modulo: Videos
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Video | `videos/entities/video.entity.ts` | videos | Videos subidos para procesamiento |
|
|
|
|
### 2.6 Modulo: Credits
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| CreditBalance | `credits/entities/credit-balance.entity.ts` | credit_balances | Saldos de creditos |
|
|
| CreditPackage | `credits/entities/credit-package.entity.ts` | credit_packages | Paquetes disponibles |
|
|
| CreditTransaction | `credits/entities/credit-transaction.entity.ts` | credit_transactions | Transacciones |
|
|
|
|
### 2.7 Modulo: Payments
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Payment | `payments/entities/payment.entity.ts` | payments | Pagos de usuarios |
|
|
|
|
### 2.8 Modulo: Referrals
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Referral | `referrals/entities/referral.entity.ts` | referrals | Sistema de referidos |
|
|
|
|
### 2.9 Modulo: Notifications
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Notification | `notifications/entities/notification.entity.ts` | notifications | Notificaciones |
|
|
|
|
### 2.10 Modulo: Admin
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| AuditLog | `admin/entities/audit-log.entity.ts` | audit_logs | Registros de auditoria |
|
|
| Promotion | `admin/entities/promotion.entity.ts` | promotions | Promociones |
|
|
| IaProvider | `admin/entities/ia-provider.entity.ts` | ia_providers | Proveedores de IA |
|
|
|
|
### 2.11 Modulo: Feedback
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| Correction | `feedback/entities/correction.entity.ts` | corrections | Correcciones de usuarios |
|
|
| GroundTruth | `feedback/entities/ground-truth.entity.ts` | ground_truth | Datos verificados |
|
|
| ProductSubmission | `feedback/entities/product-submission.entity.ts` | product_submissions | Productos enviados |
|
|
|
|
### 2.12 Modulo: Validations
|
|
|
|
| Entity | Archivo | Tabla BD | Descripcion |
|
|
|--------|---------|----------|-------------|
|
|
| ValidationRequest | `validations/entities/validation-request.entity.ts` | validation_requests | Solicitudes de validacion |
|
|
| ValidationResponse | `validations/entities/validation-response.entity.ts` | validation_responses | Respuestas de validacion |
|
|
|
|
---
|
|
|
|
## 3. RELACIONES ENTRE ENTITIES
|
|
|
|
```yaml
|
|
relaciones:
|
|
User:
|
|
has_many: [RefreshToken, Store, StoreUser, Video, CreditTransaction, Payment, Referral, Notification, Correction, AuditLog]
|
|
has_one: [CreditBalance]
|
|
|
|
Store:
|
|
belongs_to: [User]
|
|
has_many: [StoreUser, Video, InventoryItem]
|
|
|
|
Video:
|
|
belongs_to: [Store, User]
|
|
has_many: [InventoryItem]
|
|
|
|
InventoryItem:
|
|
belongs_to: [Store, Video]
|
|
has_many: [Correction]
|
|
|
|
CreditBalance:
|
|
belongs_to: [User]
|
|
|
|
CreditTransaction:
|
|
belongs_to: [User]
|
|
|
|
Payment:
|
|
belongs_to: [User, CreditPackage]
|
|
|
|
Referral:
|
|
belongs_to: [User (referrer), User (referred)]
|
|
|
|
ValidationRequest:
|
|
belongs_to: [Video, InventoryItem]
|
|
has_many: [ValidationResponse]
|
|
|
|
ValidationResponse:
|
|
belongs_to: [ValidationRequest, IaProvider]
|
|
```
|
|
|
|
---
|
|
|
|
## 4. REFERENCIAS
|
|
|
|
- Database Schema: @PROJ_DEF_DB
|
|
- Services: @PROJ_DEF_SERVICES
|
|
- Ubicacion: `apps/backend/src/modules/*/entities/`
|
|
|
|
---
|
|
|
|
*Generado: 2026-01-16*
|