Skip to content

Feat/workspace form actions purchase - #7

Open
smritisystems wants to merge 1009 commits into
mainfrom
feat/workspace-form-actions-purchase
Open

smritisystems wants to merge 1009 commits into
mainfrom
feat/workspace-form-actions-purchase

Conversation

@smritisystems

Copy link
Copy Markdown
Owner

Pull Request Description

Purpose

Scope

Files Changed

Database Impact

API Impact

Performance Impact

Security Impact

Rollback Plan

Testing Evidence

Walkthrough

Screenshots / Recordings


AI Agent Validation (If applicable)

Confidence Level: [High / Medium / Low]
Assumptions Made:
Potential Risks & Side Effects:
Human Review Required Areas:

Jawahar Ramkripal Mallah added 30 commits August 3, 2026 01:36
…(ITE), Declarative Location Capabilities, Enterprise Territory, Node KPIs, and Event-Driven Inventory Bus v1.0

- Introduce Inventory Topology Engine (ITE) to manage network graph relationships (Supplies, Replenishes, ProducesTo)
- Introduce Declarative Location Capabilities (CAN_SELL, CAN_RECEIVE, CAN_DISPATCH, CAN_MANUFACTURE, CAN_REPAIR, CAN_HOLD_CONSIGNMENT, CAN_FULFILL_MARKETPLACE, CAN_ACCEPT_RETURNS)
- Introduce Enterprise Inventory Territory (Global -> Country -> Region -> State -> City -> Location)
- Expose Standardized Location KPIs & Metrics (DaysOfCover, InventoryValue, Accuracy, LastCountDate)
- Add Event-Driven Inventory Bus (StockReceived, StockIssued, StockReserved, StockReleased, StockAdjusted, StockTransferred)
- Permanent freeze of Level 1 Inventory Kernel 6-Engine Architecture (ILE, ITE, IVE, IAE, IRE, IPE)
…e, Location Roles, Master vs Runtime Isolation, and Generic Event Bus v1.0

- Define Three-Tier Engine Structure: Core Engines (Movement, ILE, ITE, Reservation, Availability), Service Engines (IVE, IAE, IRE, IPE), Platform Services (Replay, Audit, Valuation, Event Bus)
- Define Additive Location Roles (DISTRIBUTION, FULFILLMENT, SALES, REPLENISHMENT, SERVICE, RETURNS, PRODUCTION)
- Enforce Master Data vs Runtime State Isolation for offline operation & clean caching
- Define Generic Inventory Event Bus (InventoryReceived, InventoryIssued, InventoryTransferred, InventoryReserved, etc.)
- Permanent Architecture Freeze of Level 1 Inventory Kernel
…work Engine (INE) Name, Platform Facades, and Standard Inventory Documents v1.0

- Restore name Inventory Network Engine (INE): manages network graph topology, routing, supply paths, and parent/child dependencies
- Define Public Platform Inventory Facades: InventoryCommandFacade (moveInventory, transferInventory, reserveInventory, releaseReservation, adjustInventory, countInventory, replenishInventory) and InventoryQueryFacade (getStock, getAvailable, getNetworkStock, getLocationStock, getInventoryHistory, getInventoryKPIs)
- Define Standard Business Inventory Documents: TransferOrder, TransferReceipt, Reservation, Allocation, StockCount, StockAdjustment, ReplenishmentRequest, ReplenishmentSuggestion
- Lock in 4-Layer Kernel Classification: Core Engines (Movement, ILE, INE, Reservation, Availability), Service Engines (IVE, IAE, IRE, IPE), Platform APIs (Command & Query Facades), Platform Services (Replay, Audit, Valuation, Event Bus)
- Create docs/architecture/INVENTORY_KERNEL_ARCHITECTURE_V1.md as the master authoritative specification for the entire Inventory Kernel
- Add Inventory Transaction Engine (ITEX) as single entry orchestrator sitting above Movement Engine
- Add Inventory Costing Engine (ICE) for FIFO, Moving Average, Weighted Average, Standard Cost, Specific Identification, and Replacement Cost
- Add Inventory Compliance Engine (ICOMP) for regulatory Expiry, Batch/Serial tracking, Cold Chain, Drug License, Hazard storage, Import/Export, GST compliance
- Define v2 Future Capability: Inventory Forecast Engine (IFE)
- Finalize Master Engine Classification: 6 Core Engines, 6 Service Engines, 2 Platform APIs, 4 Platform Infrastructure Services
…Identity Engine (IIE), Complete Execution Pipeline, Business vs Technical Event Bus, and Public API Versioning v1.0.0

- Add Inventory Identity Engine (IIE) as 7th Core Engine for centralized identity resolution (SKU, Batch, Serial, Lot, Size/Color, Packaging, Barcode, RFID, Expiry)
- Define Complete Execution Pipeline: Transaction -> ITEX -> IIE -> Movement -> ILE -> Availability -> Allocation -> Costing -> Valuation -> Accounting
- Separate Event Bus into Business Events (GoodsReceived, GoodsIssued, GoodsTransferred, GoodsSold, GoodsReturned, GoodsDamaged, GoodsExpired) and Technical Events (InventoryReserved, InventoryReleased, AllocationCreated, CountCompleted, CostCalculated, ValuationUpdated)
- Version Public Platform APIs as InventoryCommandFacade v1, InventoryQueryFacade v1, InventoryEvent v1, InventoryDocument v1, InventoryMovement v1
- Final freeze of Level 1 Inventory Kernel Master Architecture v1.0.0
… Five Architectural Rules and Engine Boundary Enforcement Matrix

- Add Rule 1: ITEX Single Entry Rule (only ITEX creates inventory movements)
- Add Rule 2: Single Balance Mutator Rule (only Movement Engine changes physical stock balances)
- Add Rule 3: Derived Availability Rule (ATP is ALWAYS dynamically derived, never stored)
- Add Rule 4: Derived Network Aggregation Rule (Network Stock is ALWAYS dynamically calculated across locations)
- Add Rule 5: Valuation & Costing Isolation Rule (Quantity x Unit Cost = Inventory Value; Valuation never owns quantity)
- Add Engine Boundary Enforcement Matrix (ITEX, IIE, Movement Engine, ICE, Valuation Engine, IPE, ICOMP)
- Lock in Level 1 Inventory Kernel Master Architecture v1.0.0
…ase Implementation Roadmap and IK001..IK008 Implementation Certification Gates

- Add Six-Phase Implementation Roadmap: Phase 1 Core Data Model -> Phase 2 Public APIs v1 -> Phase 3 Core Engines -> Phase 4 Service Engines -> Phase 5 Infrastructure -> Phase 6 Consumer Migration
- Add Implementation Certification Gates IK001..IK008 (Facade Entry, Single Balance Mutator, Derived Availability, Network Stock Aggregation, Event Publication, Replay Determinism, Costing Isolation, Engine Boundary Rules)
- Permanent Architectural Freeze of Level 1 Inventory Kernel Specification v1.0.0
- Add docs/sdk/INVENTORY_KERNEL_SDK_V1.md defining public contracts, DTOs, and event signatures
- Define Kernel Maturity Model (IK-L0 Architecture -> IK-L1 Data Model -> IK-L2 Core Engine -> IK-L3 Public APIs -> IK-L4 Certified -> IK-L5 Production)
- Bind all consumer business domains (Sales, Purchase, POS, WMS, Marketplace, Manufacturing, Mobile, AI) to IKSDK v1.0.0
… IDE, IWE, IRULE Engines, Refined Physical Compliance Scope, and 10-Step Execution Sequence

- Add Inventory Document Engine (IDE) to manage document lifecycles (TransferOrder, TransferReceipt, StockCount, StockAdjustment, etc.)
- Add Inventory Workflow Engine (IWE) for configurable document state transitions (Draft -> Approved -> Picking -> In Transit -> Completed)
- Add Inventory Rules Engine (IRULE) for configurable allocation & packaging rules
- Narrow Inventory Compliance Engine (ICOMP) to physical inventory compliance (Batch, Serial, Expiry, Quarantine, Cold Chain, Hazard Storage), leaving tax/GST compliance to Accounting/Sales layers
- Formalize 10-Step Execution Sequence for platform implementation
… Immutable Ledger, Snapshots, Cost Layer Ledger, Posting Profiles, Projections, and Service Namespace Layout

- Add Immutable InventoryLedger: Movement Engine appends entries to an append-only ledger; balances are projections
- Add InventorySnapshot: DailySnapshot/MonthlySnapshot for high-speed queries and instant deterministic replay
- Add CostLayerLedger: Dedicated cost layer ledger for FIFO, Moving Average, and batch valuation auditing
- Add Declarative DocumentPostingProfiles: Document-to-movement profile mappings
- Add Dynamic Projections (getProjectedStock): On Hand - Reserved + Incoming PO + Transfer In - Transfer Out
- Define Internal Service Namespace Layout under backend/app/services/inventory/ to avoid microservice over-segmentation
- Permanent Architecture Freeze of Level 1 Inventory Kernel v1.0.0
… Rule 6 Ledger Immutability, Inventory Ledger Engine (ILE-L), Read-Only Snapshots, and IK009 Certification Gate

- Add Rule 6: Ledger Immutability Rule (ledger entries are append-only; corrections via compensating reversal movements)
- Rename Movement Engine -> Inventory Ledger Engine (ILE-L) to emphasize ownership of InventoryLedger and balance projections
- Document Read-Only Invariant for InventorySnapshot caches
- Add IK009 Ledger Replay Integrity Gate (every balance is 100% reproducible by replaying InventoryLedger from latest snapshot)
- Permanent Architecture Freeze of Level 1 Inventory Kernel v1.0.0
… ILG Engine Name, Rule 7 Identity Immutability, ReservationLedger, and InventoryProjectionEngine (IPROJ)

- Disambiguate engine abbreviation: Inventory Ledger Engine -> ILG to prevent overlap with Inventory Location Engine (ILE)
- Add Rule 7: Identity Immutability Rule (once created, identity attributes are immutable; corrections require replacement/supersession)
- Add ReservationLedger: Append-only reservation ledger for deterministic ATP replay
- Add InventoryProjectionEngine (IPROJ): Async projection engine for InventoryBalanceProjection, InventoryAvailabilityProjection, InventoryNetworkProjection, and InventoryKPIProjection
- Permanent Architecture Freeze of Level 1 Inventory Kernel v1.0.0
…mprehensive architectural documentation and project status reporting.
…ionNode, InventoryIdentityRecord, InventoryLedgerEntry, ReservationLedgerEntry, CostLayerLedgerEntry, InventorySnapshotRecord, DocumentPostingProfileRecord

- Implement InventoryLocationNode (tree_path, depth, roles, capabilities, territory_path, kpis)
- Implement InventoryIdentityRecord (sku, batch_no, serial_no, lot_no, variant_attributes, uom, packaging_profile, expiry_date)
- Implement InventoryLedgerEntry (immutable append-only physical stock ledger with compensating reversal support)
- Implement ReservationLedgerEntry (immutable append-only ATP reservation ledger)
- Implement CostLayerLedgerEntry (cost layers for FIFO, Moving Average, batch costing)
- Implement InventorySnapshotRecord (read-only cached projections for fast replay)
- Implement DocumentPostingProfileRecord (declarative document-to-movement profile mappings)
- Milestone Maturity: IK-L1 Data Model Completed
…ommandFacade v1, InventoryQueryFacade v1, and Automated IK001..IK009 Certification Suite

- Implement InventoryLedgerEngine (ILG) owning append-only InventoryLedger, compensating reversals, and dynamic balance calculations
- Implement InventoryTransactionEngine (ITEX) as single entry orchestrator converting commercial transactions to ledger directives
- Update InventoryCommandFacade v1 and InventoryQueryFacade v1 exposing public APIs (move_inventory, get_stock, get_available, get_network_stock, get_projected_stock)
- Add automated certification test suite verifying IK001 (Facade Entry), IK002 (Single Balance Mutator), IK003 (Derived Availability), IK004 (Network Stock Aggregation), IK006 (Replay Determinism), and IK009 (Ledger Replay Integrity)
- Milestone Maturity: IK-L4 Certified Completed
…rites through InventoryCommandFacade ITEX ILG. rebalancing_service.py: Replace 2 direct StockMovement writes with transfer_out and transfer_in via facade. inventory.py InventoryService.update_stock: Replace StockMovement write with move_inventory via ITEX ILG. All 6 certification gates passing.
…y Kernel tables

Creates 7 Level 1 Inventory Kernel tables:
- inventory_location_nodes (hierarchical network graph, tree_path, depth, roles, capabilities)
- inventory_identity_records (SKU, Batch, Serial, Lot, Barcode, RFID, Expiry)
- inventory_ledger_entries (immutable append-only with fn_inventory_ledger_immutability_guard trigger)
- reservation_ledger_entries (ATP reservation append-only ledger)
- cost_layer_ledger_entries (FIFO, Moving Average, Batch costing layers)
- inventory_snapshot_records (read-only periodic cached projections)
- document_posting_profiles (declarative document-to-movement profile mappings + 10 seed profiles)

alembic/env.py: registers InventoryKernel models and 7 table names in include_object()
Chain: v900_replenishment_reorder -> v1000_inventory_kernel_v1
…c2_inventory_kernel with v1000_inventory_kernel_v1 into single head
…ls for asyncpg compatibility (trigger DDL + seed INSERTs)
Jawahar Ramkripal Mallah added 29 commits August 4, 2026 03:00
…mriti-api, smriti-worker, smriti-redis, smriti-db) per Platform OS v4.2 & DDS v1.0
…g artifacts from AdaptiveWorkspaceHeader, NotificationCenter, and WorkspaceTimeline
…mbic migration from app.main, and restore UADHP header
…l OS

- Introduced MobileWidgetStack component for rendering dashboard widgets in a mobile-first layout.
- Created reusable WidgetCard component for adaptive dashboard cards.
- Added WorkspaceLayoutSelector for managing saved dashboard layouts.
- Implemented WorkspaceActionBar, WorkspaceBottomSheet, WorkspaceCard, WorkspaceEmptyState, WorkspaceErrorState, WorkspaceHeader, WorkspaceLoadingState, WorkspaceSection, and WorkspaceToolbar components for enhanced workspace functionality.
- Established WorkspaceCardRegistry for widget rendering and registration.
- Developed WorkspaceEngine for managing workspace card states and layouts.
- Introduced design tokens for brand, component, spacing, typography, shadow, radius, motion, and z-index to standardize styling across the application.
…umentation

- Introduced SMRITI UX Governance document outlining approval criteria and release gates for UX certification.
- Added SPK Experience Runtime Mapping document detailing the architecture and components of the SPK runtime.
- Implemented new POS components including POSBillSummary, POSBillingCard, POSCustomerCard, and others for enhanced billing reference functionality.
- Created a UX review checklist and a JSON manifest for the SMRITI_POS_REFERENCE_v1 to standardize UI tokens and components.
- Established CSS tokens for light and dark themes specific to the POS reference screen.
…ts with new background colors for improved UI consistency
…proved styling and remove unused theme resolution

feat: Add SMRITI Architecture Audit Report for design-system migration guidance
…omponents

- Updated ESLint rules to disallow raw Tailwind color utilities and hardcoded colors in JSX className and style attributes.
- Refactored CustomerMasterTab, FieldExplorerTab, ItemMasterTab, PurchaseOperationsStudio, and SalesBillingStudio components to use semantic token classes instead of raw colors.
- Added a new test suite to ensure compliance with theme governance by checking for banned color patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant