# Specification: Unified Product Inventory and Pricing System

## Goal
To unify the product inventory and pricing logic across the platform, replacing any fragmented or duplicated management systems. This will ensure consistent data across different sales channels, improve stock tracking accuracy, and simplify future pricing updates.

## Core Features
1. **Unified Schema:** Create a single source of truth for product inventory (stock levels, thresholds) and pricing (base price, discounted price, tax rates).
2. **Repository Pattern:** Implement repositories for inventory and pricing management, enforcing strict Zod validation.
3. **Server Actions:** Create server actions using the `createServerAction` wrapper for all inventory and pricing updates.
4. **Consistency Enforcement:** Ensure that inventory and pricing updates are atomic and consistently applied.

## Success Criteria
- [ ] Centralized schema implemented for product inventory and pricing.
- [ ] Repositories for inventory and pricing pass all tests (100% coverage).
- [ ] Server actions for inventory and pricing management pass all tests (100% coverage).
- [ ] End-to-end verification of unified stock and price updates.

## Technical Details
- **Database:** PostgreSQL (managed through existing repositories).
- **Validation:** Zod schemas for all data structures.
- **Server Actions:** Standardized via `@/lib/actions`.
- **Testing:** Vitest for unit and integration tests (Anti-Mocking).
