← ERP rendszer építők adatlapja
Nézd meg, miben segít
Verziózott árszámítás
Hatályos dátumú, változatlan díjtáblából számol költséget, elkülönítve a belső ráfordítást az ügyfélterheléstől.
versioned-pricing-cost-calculation
Ezt a skillt használó csapattagok
Mikor hasznos?
Akkor használd, ha ár változik, de régi használat elszámolási alapját megőriznéd.
Miben segít neked?
- Tárolja az árverziót és minden számításhoz alkalmazott díjat.
- Kifejezetten kezeli a dimenziót, sávot és pontos pénzegységet.
- Elválasztja az újraárazási szimulációt a jóváhagyott elszámolási korrekciótól.
Például ezt kérheted
Számolj árváltást átfogó használatot, új díjas összehasonlítással a régi terhelések átírása nélkül. Hatálybalépésnél bontsd a használatot, és őrizd az alkalmazott árakat. A feltételezett megtakarítás külön legyen, a régi számla egyezzen eredeti számításával.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
Versioned Pricing & Cost Calculation
Provider rates and custom enterprise contracts change over time. Changing a price table today must never retroactively alter closed accounting periods unless an explicit repricing simulation or backfill is requested.
Workflow
- Model effective-dated, immutable rate cards:
- Represent every rate entry with
(provider, service, metricUnit, region, tier, effectiveFrom, effectiveTo, rateVersionId):effectiveFrom(inclusive UTC timestamp) andeffectiveTo(exclusive UTC timestamp,NULLfor active rate).- Prevent overlapping intervals for the same
(provider, service, metricUnit, region, tier)key via constraints or validation tests.
- Support workspace-specific rate overrides (negotiated enterprise discounts or BYOK zero-markup passthrough) separate from upstream provider list prices.
- Represent every rate entry with
- Distinguish internal COGS from customer billable rates:
- Calculate and store internal provider cost (COGS) separately from external billable amount (managed by the billing specialist):
providerCostMicros: What the platform pays the upstream cloud/LLM provider.listCostMicros: Standard list-price valuation (useful when running on pre-purchased commitments or credits).
- Stamp each rated ledger entry with
rateVersionId,unitPriceNumeric, andpricedAtso every row records the exact rate formula used.
- Calculate and store internal provider cost (COGS) separately from external billable amount (managed by the billing specialist):
- Support multi-dimensional and tiered pricing:
- Per-unit linear rates: e.g.,
$3.00 / 1,000,000 input_tokens. - Context-length or processing tiers: e.g., higher per-token rates above
200kcontext tokens, or priority vs. batch/flex discounts (0.5x). - Graduated vs. volume tiers: Implement graduated tiers (first $N$ units at rate A, additional units at rate B) vs. volume tiers (entire volume repriced above threshold).
- Per-unit linear rates: e.g.,
- Controlled repricing and simulation:
- Match
event.occurredAt(neverrecordedAtorNOW()) against[effectiveFrom, effectiveTo). - Provide a non-destructive simulation mode that evaluates historical usage against a candidate
rateCardIdwithout overwriting committed ledger entries.
- Match
Anti-Patterns to Avoid
- Hardcoding model prices in code constants: Scattering
const MODEL_PRICE = 0.03makes rate updates require deploys and corrupts history. - Joining current price tables without
occurredAtbounds: Computing last quarter's cost with today's price hides historical spend. - Silent fallback to
$0on unknown SKUs: Flag unknown models aspricingStatus: 'unpriced_sku'and alert rather than recording$0.00.
Csomagban lévő fájlok 1
SKILL.md
