# README

## Overview

The Product Management module serves as the Product Information Management (PIM) layer of the ERP system. It manages products, attributes, and variant generation. A product defines the commercial representation of a product — its name, description, attributes, and category classification. Variants are generated from attribute value combinations (e.g., Color × Size) and materialize as Items in the item-management module.

## Key Features

- **[Product Lifecycle](docs/feature/product-lifecycle.md)**: Create, update, and manage products with lifecycle state machine (DRAFT → ACTIVE ↔ ARCHIVED). Products define the commercial view of a product and serve as the parent entity for variant generation
- **[Attribute Management](docs/feature/attribute-management.md)**: Define attributes and their values. All attributes are variant axes that drive variant generation
- **[Variant Generation](docs/feature/variant-generation.md)**: Generate product variants from attribute value combinations on a product. Each generated variant creates an Item in item-management with auto-generated SKU and inherited properties
- **[Product Category](docs/feature/product-category.md)**: Hierarchical category tree for product classification (many-to-many). Separate from item-management's taxonomy — categories organize the commercial/marketing view of products

## Module Scope

### In Scope

- Product master data management (create, update, delete, status transitions)
- Product lifecycle state machine (DRAFT → ACTIVE ↔ ARCHIVED)
- Attribute definitions with predefined values
- Variant generation from attribute value combinations
- Item creation in item-management upon variant generation
- Hierarchical product category management
- Product-to-category classification (many-to-many)

### Out of Scope

- SKU-level item management and item lifecycle (item-management module)
- Unit of measure definitions (primitives module)
- Sales pricing, price lists, and discount rules (pricing module)
- Channel/marketplace definitions and listing management (sales-channel module)
- Inventory tracking and stock levels (inventory module)
- Product images and digital asset management
- Supplier-specific product information (business-partner module)
- Bill of Materials (manufacturing module)

### Scope Decision Rationale

This module focuses on the **commercial definition** of products — the "what we sell" perspective — while delegating operational concerns to specialized modules. Product-management owns the template layer (attributes, variants, categories) because these define the product's identity and structure before it enters any operational workflow.

SKU-level management belongs to item-management because items have their own lifecycle and are the transactional entity referenced by sales, purchasing, and inventory. Variant generation bridges the two: product-management defines the combinations, but the resulting items live in item-management. This separation ensures that changes to product templates don't directly affect in-flight transactions.

Pricing is excluded because prices are context-dependent — they vary by customer segment, quantity tier, date range, and promotional rules. A single product can have dozens of price points that change frequently, while the product definition itself is stable. Embedding pricing here would force product-management to understand sales contexts it shouldn't own. A dedicated pricing module can attach price lists to items independently and evolve its discount/tier logic without touching the product catalog.

Channel/marketplace management is excluded because listing a product on a sales channel involves channel-specific data (listing status, channel fees, fulfillment rules, channel-specific descriptions) that are not part of the product's core identity. A product's definition is channel-agnostic — the same product may be listed differently on each channel. Coupling channels to product-management would create a dependency on external marketplace APIs and business rules that change per channel integration.

Inventory and supplier data are similarly excluded because they follow independent business rules and change at different rates than product definitions.

## Module Dependencies

- [item-management](../item-management/README.md) — Variant generation creates Items via item-management commands
- [primitives](../primitives/README.md) — UoM definitions inherited by generated Items
