Commit Graph

42 Commits

Author SHA1 Message Date
Adrian Flores Cortes
6f0548bc5b [RBAC-003] test: Add RBAC middleware and cache service unit tests
Phase 4 testing implementation:
- rbac.middleware.test.ts: Tests for requirePerm, requireAnyPerm,
  requireAllPerms, requireAccess, requirePermOrOwner
- permission-cache.service.test.ts: Tests for cache operations,
  Redis unavailable fallback, tenant-wide invalidation

Test scenarios covered:
- User with/without permission (403)
- Super admin bypass
- Cache hit/miss
- Redis unavailable fallback
- Hybrid access control (role + permission)
- Owner-based access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 01:56:52 -06:00
Adrian Flores Cortes
98fc0cf944 [RBAC-002] feat: Migrate all routes from requireRoles to requireAccess
Phase 2 of RBAC propagation - migrates 18 route files to use hybrid
requireAccess() middleware for permission-based authorization:

P1 Routes (auth/billing):
- users.routes.ts (11 occurrences)
- roles.routes.ts (11 occurrences)
- permissions.routes.ts (8 occurrences)
- invoices.routes.ts (9 occurrences)
- financial.routes.ts (42 occurrences)

P2 Routes (business):
- partners.routes.ts (16 occurrences)
- sales.routes.ts (32 occurrences)
- purchases.routes.ts (21 occurrences)

P3 Routes (operations):
- inventory.routes.ts (28 occurrences)
- hr.routes.ts (28 occurrences)
- crm.routes.ts (23 occurrences)
- core.routes.ts (21 occurrences)
- tenants.routes.ts (12 occurrences)
- companies.routes.ts (9 occurrences)
- warehouses.routes.ts (6 occurrences)
- products.routes.ts (6 occurrences)
- projects.routes.ts (6 occurrences)
- system.routes.ts (2 occurrences)

Total: ~271 route protections migrated to permission-based access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 01:43:05 -06:00
Adrian Flores Cortes
a9abe0876f [RBAC-001] feat: Complete RBAC middleware with permission caching
- Add permission-cache.service.ts for Redis-based permission caching (5min TTL)
- Complete requirePermission middleware with cache check and DB fallback
- Add rbac.middleware.ts with requirePerm, requireAnyPerm, requireAllPerms, requireAccess
- Export new service from shared/services/index.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 00:11:52 -06:00
Adrian Flores Cortes
01c5d98c54 [TASK-010] test: Add projects integration and unit tests
- projects-flow.integration.test.ts: Full project lifecycle tests
- timesheets.service.test.ts: Timesheet unit tests
- Coverage: Project -> Tasks -> Time registration, billing, progress

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 19:25:22 -06:00
Adrian Flores Cortes
6c6ce41343 [TASK-005] feat: Implement reports backend module (entities, services, controllers)
- Add 12 TypeORM entities matching DDL 31-reports.sql:
  - ReportDefinition, ReportExecution, ReportSchedule
  - ReportRecipient, ScheduleExecution
  - Dashboard, DashboardWidget, WidgetQuery
  - CustomReport, DataModelEntity, DataModelField, DataModelRelationship
- Add enums: ReportType, ExecutionStatus, ExportFormat, DeliveryMethod, WidgetType, ParamType, FilterOperator
- Add DTOs for CRUD operations and filtering
- Add services:
  - ReportsService: definitions, schedules, recipients, custom reports
  - ReportExecutionService: execute reports, history, cancellation
  - ReportSchedulerService: scheduled execution, delivery
  - DashboardsService: dashboards, widgets, queries
- Add controllers:
  - ReportsController: full CRUD for definitions, schedules, executions
  - DashboardsController: dashboards, widgets, widget queries
- Update module and routes with new structure
- Maintain backwards compatibility with legacy service

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:51:51 -06:00
Adrian Flores Cortes
5ee2023428 [TASK-009] test: Add CRM integration and unit tests
- Add crm-flow.integration.test.ts with complete CRM workflow tests:
  - Lead creation and qualification flow
  - Lead to opportunity conversion
  - Opportunity pipeline stage progression
  - Opportunity won/lost handling
  - Activities and follow-up tracking
  - Edge cases and error handling

- Add activities.service.test.ts with unit tests for:
  - CRUD operations for activities
  - Activity status transitions (scheduled/done/cancelled)
  - Resource linking (leads, opportunities, partners)
  - Activity summary and overdue tracking
  - Follow-up scheduling

- Update helpers.ts with createMockActivity factory

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:51:26 -06:00
Adrian Flores Cortes
23631d3b9b [TASK-008] test: Add purchases integration and unit tests
Add comprehensive test coverage for the purchases module:

- purchases-flow.integration.test.ts: Tests complete flow including
  RFQ to PO conversion, partial/complete receipts, supplier invoicing,
  returns handling, and cost variance detection
- receipts.service.test.ts: Unit tests for receipt creation,
  confirmation, quantity validation, quality control, lot tracking,
  and warehouse location assignment

Tests cover 128 scenarios across the purchases module including
success cases, error handling, and edge cases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:47:43 -06:00
Adrian Flores Cortes
968b64c773 [TASK-007] test: Add sales integration and unit tests
Add comprehensive test coverage for the Sales module:
- pricelists.service.test.ts: Unit tests for pricelist CRUD and pricing
- sales-flow.integration.test.ts: Integration tests for Order-to-Cash flow

Test scenarios cover:
1. Quotation -> Approval -> Sales Order conversion
2. Sales Order -> Picking -> Delivery confirmation
3. Delivery -> Invoice generation
4. Order cancellation and stock release
5. Pricelist application and discounts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:46:01 -06:00
Adrian Flores Cortes
56f5663583 [TASK-006] feat: Add HR entities and DTOs
Add TypeORM entities for the HR module:
- Department: Organizational departments with hierarchy
- JobPosition: Job titles/positions
- Employee: Employee records with manager self-reference
- Contract: Employment contracts
- LeaveType: Configurable leave types
- LeaveAllocation: Employee leave allocations
- Leave: Leave requests

Add DTOs with class-validator:
- CreateEmployeeDto, UpdateEmployeeDto
- CreateContractDto, UpdateContractDto, ActivateContractDto, TerminateContractDto
- CreateLeaveDto, UpdateLeaveDto, ApproveLeaveDto, RejectLeaveDto
- Filter DTOs for all entities
- HrPaginationDto

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 18:45:27 -06:00
Adrian Flores Cortes
8565056de3 feat(settings): Add complete backend Settings module
- Entities: SystemSetting, PlanSetting, TenantSetting, UserPreference
- Services: SystemSettingsService, TenantSettingsService, UserPreferencesService
- Controllers: system-settings, tenant-settings, user-preferences
- DTOs: update-system-setting, update-tenant-setting, update-user-preference, settings-filters
- Module and routes registration

Implements RF-SETTINGS-001, RF-SETTINGS-002, RF-SETTINGS-003

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:33:55 -06:00
Adrian Flores Cortes
b937d39464 test(hr): Add unit tests for departments, contracts and leaves services
- departments.service.test.ts: 43 test cases covering CRUD, job positions, and validation errors
- contracts.service.test.ts: 40 test cases covering lifecycle (draft->active->terminated), cancellation, and validation
- leaves.service.test.ts: 66 test cases covering leave types and leave requests with status transitions

Coverage results: departments 100%, contracts 100%, leaves 96.1%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:23:15 -06:00
Adrian Flores Cortes
cf3d560cdc docs: Add README.md for 8 backend modules
Added documentation for:
- ai: 9 entities, 25+ endpoints for AI integration
- mcp: 2 entities, 8 tool providers for MCP Server
- webhooks: 6 entities for outbound webhooks
- whatsapp: 10 entities for WhatsApp Business
- storage: 7 entities for file storage (S3/R2)
- feature-flags: 3 entities for feature toggles
- biometrics: 4 entities for biometric auth
- geolocation: placeholder for planned module

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 03:47:00 -06:00
Adrian Flores Cortes
b0f6347485 chore: Update package-lock.json 2026-01-25 02:27:27 -06:00
Adrian Flores Cortes
3bfa564d43 [TASK-2026-01-25-ERP-INTEGRACIONES] feat(mcp): Add ERP-specific MCP tools
- Add SalesToolsService with 7 tools (sales summary, reports, top products/customers)
- Add FinancialToolsService with 5 tools (reports, accounts receivable/payable, cash flow, KPIs)
- Add BranchToolsService with 6 tools (branch info, reports, team performance, schedules)
- Register new tool providers in MCP module
- Total: 18 new MCP tools for ERP operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 01:49:11 -06:00
Adrian Flores Cortes
fd8a0a508e [TASK-2026-01-25-ERP-INTEGRACIONES] feat: Add payment terminals + AI role-based access
Payment Terminals (MercadoPago + Clip):
- TenantTerminalConfig, TerminalPayment, TerminalWebhookEvent entities
- MercadoPagoService: payments, refunds, links, webhooks
- ClipService: payments, refunds, links, webhooks
- Controllers for authenticated and webhook endpoints
- Retry with exponential backoff
- Multi-tenant credential management

AI Role-Based Access:
- ERPRole config: ADMIN, SUPERVISOR, OPERATOR, CUSTOMER
- 70+ tools mapped to roles
- System prompts per role (admin, supervisor, operator, customer)
- RoleBasedAIService with tool filtering
- OpenRouter integration
- Rate limiting per role

Based on: michangarrito INT-004, INT-005, MCH-012, MCH-013

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 01:32:32 -06:00
Adrian Flores Cortes
2d2a562274 [TASK-028] security: Add tenant_id validation to uniqueness checks
- warehouses.service.ts: Add code uniqueness check with tenantId
- products.service.ts: Add SKU/barcode uniqueness checks with tenantId
- accounts.service.ts: Add tenantId to code and parent validation

Fixes 5 RLS gaps in backend services for multi-tenant isolation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 22:22:59 -06:00
Adrian Flores Cortes
7ae745e509 [SYNC] test: Add service unit tests
- billing-usage: invoices.service.spec.ts, subscriptions.service.spec.ts
- financial: payments.service.spec.ts
- inventory: warehouses-new.service.spec.ts
- partners: partners.service.spec.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 18:13:32 -06:00
Adrian Flores Cortes
7d3ad15968 [TASK-2026-01-24-GAPS] feat: Add new entities for products/partners + health module
Changes:
- Add ProductAttribute, ProductAttributeValue, ProductVariant entities
- Add PartnerTaxInfo, PartnerSegment entities
- Add Health module (service, controller, module)
- Update index.ts and module.ts files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 07:27:28 -06:00
8d201c5b58 [TASK-2026-01-20-005] feat: Add multi-tenancy to UOM entities
EPIC-P2-005: UOM Multi-tenancy Sync
- Add tenant_id field to Uom entity
- Add tenant_id field to UomCategory entity
- Add Tenant relation to both entities
- Add UpdateDateColumn for updated_at
- Update indexes for tenant-based unique constraints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:32:10 -06:00
24b6ba9b38 [PROJECTS] feat: Add Timesheet entity and DTOs
Add TypeORM entity and DTOs for Projects timesheets feature:
- TimesheetEntity with all fields matching DDL schema
- Extended DTOs for bulk operations (submit, approve, reject)
- Summary types for reporting (by project, user, task)
- Updated module exports to include new files

Complements existing timesheets.service.ts implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:28:19 -06:00
b25afada28 [TASK-2026-01-20-004] feat: Add auth entities and fix tests
EPIC-P1-002: Auth entities
- Add user-profile.entity.ts
- Add profile-tool.entity.ts
- Add profile-module.entity.ts
- Add user-profile-assignment.entity.ts
- Add device.entity.ts
- Update auth entities index

EPIC-P1-003: DDL-Entity sync
- Add isSuperadmin, mfaEnabled, mfaSecretEncrypted fields to User
- Add mfaBackupCodes, oauthProvider, oauthProviderId fields to User

EPIC-P1-005: Fix test compilation errors
- Fix accounts.service.spec.ts
- Fix products.service.spec.ts
- Fix warehouses.service.spec.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:06:26 -06:00
af3cc5a25d [TASK-2026-01-20-003] feat: Add bank reconciliation and 3-way matching
Bank Reconciliation (financial module):
- Entities: BankStatement, BankStatementLine, BankReconciliationRule
- Service: BankReconciliationService with auto-reconcile
- DTOs: CreateBankStatement, ReconcileLine

3-Way Matching (purchases module):
- Entities: PurchaseOrderMatching, PurchaseMatchingLine, MatchingException
- Service: ThreeWayMatchingService with tolerance validation
- DTOs: MatchingStatus, ResolveException

Tolerances:
- Quantity: 0.5%
- Price: 2%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 03:47:19 -06:00
f63c17df5c test: Add unit tests for Financial and Inventory services
- accounts.service.spec.ts: Tests for account CRUD, account types, chart of accounts
- products.service.spec.ts: Tests for product CRUD, stock levels, validation
- warehouses.service.spec.ts: Tests for warehouse CRUD, locations management

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 10:45:46 -06:00
5357311953 feat(inventory): Register all inventory entities in TypeORM config
Added missing entity registrations for:
- Inventory: StockLevel, StockMovement, InventoryCount, InventoryCountLine,
  InventoryAdjustment, InventoryAdjustmentLine, TransferOrder, TransferOrderLine,
  StockValuationLayer
- Fiscal: TaxCategory, FiscalRegime, CfdiUse, PaymentMethod, PaymentType, WithholdingType
- Core: CurrencyRate, State

This enables TypeORM to properly manage these entities for the inventory module.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 09:54:43 -06:00
5fa451e09f feat(fiscal): Add fiscal module with catalogs (MGN-005)
- Add fiscal entities:
  - TaxCategory, FiscalRegime, CfdiUse
  - PaymentMethod, PaymentType, WithholdingType
- Add fiscal services with filtering capabilities
- Add fiscal controller with REST endpoints
- Add fiscal routes at /api/v1/fiscal
- Register fiscal routes in app.ts

Endpoints:
- GET /fiscal/tax-categories
- GET /fiscal/fiscal-regimes
- GET /fiscal/cfdi-uses
- GET /fiscal/payment-methods
- GET /fiscal/payment-types
- GET /fiscal/withholding-types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 09:31:47 -06:00
6b7ea745d8 test(core): Add comprehensive tests for core catalog services
- Add tests for countries.service.ts (findAll, findById, create, update)
- Add tests for currencies.service.ts (CRUD, rates, conversion)
- Add tests for states.service.ts (CRUD, country filtering)
- Add tests for uom.service.ts (CRUD, conversion, categories)
- Add mock factories for core entities (Country, State, Currency, etc.)
- Fix Jest config for proper CJS/TS interop
- All 592 tests passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 09:21:22 -06:00
d809e23b5c feat(core): Add States, CurrencyRates, and UoM conversion (MGN-005)
- State entity and service with CRUD operations
- CurrencyRate entity and service with conversion support
- UoM conversion methods (convertQuantity, getConversionTable)
- New API endpoints for states, currency rates, UoM conversions
- Updated controller and routes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 08:57:21 -06:00
028c037160 test(billing-usage): Add comprehensive service tests (184 tests)
- subscription-plans.service.test.ts: 24 tests for CRUD, filters, comparisons
- subscriptions.service.test.ts: 34 tests for lifecycle, payments, renewals
- usage-tracking.service.test.ts: 20 tests for metrics, limits, reports
- invoices.service.test.ts: 42 tests for billing, payments, refunds

Coverage improved from ~30% to 80%+ for billing-usage module.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 08:34:59 -06:00
b194f59599 feat(billing-usage): Add services, middleware and tests for FASE 4
- Add CouponsService for discount coupon management
- Add PlanLimitsService for plan limit validation
- Add StripeWebhookService for Stripe event processing
- Add plan-enforcement middleware (requireLimit, requireFeature, planBasedRateLimit)
- Add 68 unit tests for all billing-usage services
- Update TenantSubscription entity with Stripe integration fields
- Export new services from module index

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 08:03:57 -06:00
0bdb2eed65 [FASE 4] feat: Add SaaS billing entities and fix unit tests
- Add PlanLimit entity for plan limits tracking
- Add Coupon entity for discount coupons
- Add CouponRedemption entity for coupon usage
- Add StripeEvent entity for webhook processing
- Fix purchases.service tests (mock sequencesService)
- Fix orders.service tests (mock stockReservation)
- Add partners.controller tests (13 new tests)

Test Results: 361 tests passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 07:47:24 -06:00
edadaf3180 [FASE 3-4] feat: Complete Financial, Inventory, CRM, and Projects modules
EPIC-005 - Financial Module:
- Add AccountMapping entity for GL account configuration
- Create GLPostingService for automatic journal entries
- Integrate GL posting with invoice validation
- Fix tax calculation in invoice lines

EPIC-006 - Inventory Automation:
- Integrate FIFO valuation with pickings
- Create ReorderAlertsService for stock monitoring
- Add lot validation for tracked products
- Integrate valuation with inventory adjustments

EPIC-007 - CRM Improvements:
- Create ActivitiesService for activity management
- Create ForecastingService for pipeline analytics
- Add win/loss reporting and user performance metrics

EPIC-008 - Project Billing:
- Create BillingService with billing rate management
- Add getUnbilledTimesheets and createInvoiceFromTimesheets
- Support grouping options for invoice generation

EPIC-009 - HR-Projects Integration:
- Create HRIntegrationService for employee-user linking
- Add employee cost rate management
- Implement project profitability calculations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 05:49:20 -06:00
6054102774 [BACKEND] feat: EPIC-001 & EPIC-002 - Core module completion and entity consolidation
EPIC-001: Complete Core Module
- Add PaymentTerm entity with multi-line support (30/60/90 days, early payment discounts)
- Add PaymentTerms service with calculateDueDate() functionality
- Add DiscountRule entity with volume/time-based conditions
- Add DiscountRules service with applyDiscounts() and rule combination logic
- Add REST endpoints for payment-terms and discount-rules in core module
- Register new entities in TypeORM configuration

EPIC-002: Entity Consolidation
- Add inventoryProductId FK to products.products for linking to inventory module
- Consolidate Warehouse entity in warehouses module as canonical source
- Add companyId and Location relation to canonical Warehouse
- Update inventory module to re-export Warehouse from warehouses module
- Remove deprecated warehouse.entity.ts from inventory module
- Update inventory/warehouses.service.ts to use canonical Warehouse

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 05:13:34 -06:00
a7bf403367 test(fase3): Add unit tests for business modules
Add comprehensive unit tests for FASE 3 modules:
- Sales: quotations.service (15 tests), orders.service (27 tests)
- Purchases: purchases.service (21 tests), rfqs.service (39 tests)
- CRM: leads.service (25 tests), opportunities.service (23 tests), stages.service (19 tests)
- Projects: projects.service (15 tests), tasks.service (19 tests)

Updated helpers.ts with factory functions for all new entity types.
Total: 203 new tests (348 tests total, all passing)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:36:21 -06:00
301628f759 test(fase2): Add unit tests for FASE 2 modules
Add comprehensive unit tests for Business Core modules:
- Partners: 22 tests (CRUD, filters, tenant isolation)
- Products: 23 tests (CRUD, categories, search)
- Invoices: 31 tests (CRUD, payments, state transitions)
- Warehouses: 24 tests (CRUD, locations, default handling)
- HR Employees: 24 tests (CRUD, terminate/reactivate, subordinates)

Test infrastructure:
- jest.config.js with ts-jest and ESM support
- setup.ts with mocks for AppDataSource and database
- helpers.ts with factory functions for test data

Total: 114 tests passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 04:18:40 -06:00
a127a4a424 feat(routes): Add independent routes for Invoices, Products, Warehouses modules
- Create invoices.controller.ts and invoices.routes.ts with singleton service
- Create products.service.ts, products.controller.ts, products.routes.ts
- Create warehouses.service.ts, warehouses.controller.ts, warehouses.routes.ts
- Register all routes in app.ts
- Use Zod validation schemas in all controllers
- Apply multi-tenant isolation via tenantId
- Update invoices.module.ts to use singleton pattern

All business modules now have API routes registered and build passes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 03:43:43 -06:00
d456ad4aca docs(entities): Document Warehouse/Product duplications and domain separation
- Add deprecation notice to inventory/warehouse.entity.ts
  - Duplicated with warehouses/warehouse.entity.ts (same table)
  - Plan unification in warehouses module with all fields and relations

- Document that Product entities are NOT duplicates
  - products.products: Commerce/retail focused (SAT, pricing, dimensions)
  - inventory.products: Warehouse management focused (Odoo-style, valuation)
  - Intentionally separate by domain
2026-01-18 02:50:13 -06:00
d9778eb632 feat(invoices): Unify billing and commercial Invoice entities
- Create unified Invoice entity in invoices module with all fields:
  - Commercial fields: salesOrderId, purchaseOrderId, partnerId
  - SaaS fields: subscriptionId, periodStart, periodEnd
  - Context discriminator: invoiceContext ('commercial' | 'saas')
- Mark billing-usage/invoice.entity.ts as deprecated, re-export from invoices
- Update billing-usage/services/invoices.service.ts for unified entity
- Add missing InvoiceStatus values (validated, cancelled, voided)
- Export types from both modules for backward compatibility

Note: financial/invoice.entity.ts remains separate (different schema)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:36:06 -06:00
ffd5ffe56a fix: Resolve remaining TypeScript build errors (19→0)
- Fix api keys controller scope type handling
- Fix billing-usage invoices/subscriptions undefined assignments
- Fix branches service type casting
- Fix financial controller Zod schemas (accounts camelCase, journals snake_case)
- Fix inventory controller with type assertions for enums
- Fix valuation controller meta type
- Fix notifications service channel type casting
- Fix payment-terminals transactions service undefined assignments
- Fix CircuitBreaker constructor signature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:33:43 -06:00
d616370440 fix: Resolve entity/service field mismatches and build errors (84→19)
- Add class-validator and class-transformer dependencies
- Fix inventory entities index.ts exports
- Add ConflictError to shared types
- Fix ai.service.ts quota field names
- Fix audit.service.ts field names and remove missing methods
- Fix storage.service.ts bucket and file field names
- Rewrite partners.service.ts/controller.ts to match entity
- Fix product.entity.ts computed column syntax
- Fix inventory-adjustment-line.entity.ts computed column
- Fix webhooks.service.ts field names
- Fix whatsapp.service.ts order field names
- Fix swagger.config.ts import.meta.url issue

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 02:27:03 -06:00
e846b715c1 feat: Add billing and feature-flags entities
- Added plan-feature entity for billing
- Added flag-evaluation entity for feature flags
- Updated module configurations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:13:18 -06:00
ca07b4268d feat: Add complete module structure for ERP backend
- Add modules: ai, audit, billing-usage, biometrics, branches, dashboard,
  feature-flags, invoices, mcp, mobile, notifications, partners,
  payment-terminals, products, profiles, purchases, reports, sales,
  storage, warehouses, webhooks, whatsapp
- Add controllers, DTOs, entities, and services for each module
- Add shared services and utilities

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 00:40:54 -06:00
12fb6eeee8 Initial commit - erp-core-backend 2026-01-04 06:40:14 -06:00