polymorphic-line-items

Community

Design mixed product/service line items for sales systems

Authorfreedomw1987
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill solves the challenge of designing quotation and invoice line item schemas that support both physical products (with fields like SKU, stock quantity) and services (with fields like man-day breakdowns, SOW) without nullable field sprawl, data integrity issues, or accounting inconsistencies from price changes.

Core Features & Use Cases

  • Recommended Option A Schema: Separate Product and Service catalogue tables with a dual-FK polymorphic QuotationItem model, avoiding the pitfalls of single-table inheritance or unified nullable tables.
  • Immutable Snapshot Pricing: Freezes product and service pricing at quotation creation time to ensure historical quotes remain accurate even if catalogue prices change later.
  • End-to-End Implementation Guidance: Includes Prisma schema design, Postgres migration steps, Elysia backend route patterns, React frontend editor patterns, and guardrails for SENT status locking and gross profit tracking.
  • Real-World Pitfall Avoidance: Covers common issues like Prisma enum vs String discriminator drift, quick-create modal parity, and wire-format naming mismatches between frontend and backend.
  • Use Case: B2B sales teams building CRM or quoting platforms that need to add both physical goods (e.g. hardware, accessories) and consultancy services to the same quotation or invoice.

Quick Start

Use the polymorphic-line-items skill to implement a mixed product and service line item system for your sales quoting platform, following the recommended Option A schema design, migration steps, and backend route patterns.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: polymorphic-line-items
Download link: https://github.com/freedomw1987/tree_monstor/archive/main.zip#polymorphic-line-items

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 536,000+ vetted skills library on demand.