Catalog & Dynamic Pricing Engine

Multi-tier price books, dynamic rate quoting, promotional discount matrices, and jurisdictional tax compliance.

The Catalog & Pricing module serves as the central commercial engine for SCRIPE. It models offerings, physical/digital items, memberships, and rentals, with an extensible multi-tier pricing resolution pipeline capable of evaluating price books, negotiated customer agreements, stackable discounts, and automated tax calculations.

Commercial Architecture

Designed to power both simple retail checkouts and complex multi-facility corporate agreements with sub-millisecond calculation speeds.

  • Unified Offering Catalog

    Polymorphic catalog modeling services, court rentals, coaching sessions, tournament fees, and retail packages.

  • Versioned Price Books

    Effective-date controlled price lists supporting seasonal rate changes, holiday surcharges, and branch-specific variations.

  • Dynamic Rate Engine

    Time-of-day, peak vs. off-peak, and day-of-week rate multipliers calculated on the fly during slot selection.

  • Stackable Discount Rules

    Volume-based tiered discounts, promotional coupon codes, and bundle incentives with priority resolution.

  • Price Quotes & Freezing

    Pre-checkout quotation pipeline that calculates line items, adjustments, and taxes with explicit expiration timestamps.

  • Corporate Customer Agreements

    Dedicated contract rates, enterprise volume discounts, and negotiated override schedules linked to specific Parties.

Domain Aggregate Root: PriceQuote

The PriceQuote aggregate encapsulates quoted items, applied discount matrices, customer agreement rates, and tax calculations before freezing into an order.

src/Modules/CatalogPricing/CatalogPricing.Domain/Entities/PriceQuote.csC#
public sealed class PriceQuote : TenantAggregateRoot
{
    public Guid OfferingId { get; private set; }
    public Guid PriceBookVersionId { get; private set; }
    public string Currency { get; private set; } = "USD";
    public decimal SubtotalAmount { get; private set; }
    public decimal TotalDiscountAmount { get; private set; }
    public decimal TotalTaxAmount { get; private set; }
    public decimal GrandTotalAmount { get; private set; }
    public PriceQuoteStatus Status { get; private set; }
    public DateTimeOffset ExpiresAtUtc { get; private set; }
    public List<PriceQuoteLine> Lines { get; private set; } = new();

    public void ApplyCustomerAgreement(CustomerAgreementRate agreement)
    {
        // Custom negotiated rate calculation logic
        GrandTotalAmount = agreement.CalculateNegotiatedTotal(SubtotalAmount);
        RaiseDomainEvent(new PriceQuoteRecalculatedDomainEvent(Id, TenantId, GrandTotalAmount));
    }
}

Multi-Tier Pricing Resolution Engine

How SCRIPE resolves final item prices across price books, negotiated rates, discounts, and regional taxes:

Quotation Requested with Target Offerings & Quantity
Check Customer Agreement Rate overrides (VIP / Negotiated)
Locate Active Price Book Version by Effective Date & Currency
Calculate Base Item Subtotals & Rental Multipliers
Evaluate Stackable Discount Rules & Promotional Coupons
Compute Jurisdictional Taxes via Tax Categories
Freeze PriceSnapshot with Immutable Line Item Hash

Reservation Snapshot Capture and Retries

CatalogPricing captures a still-valid quote and its line items as one pending snapshot for a reservation. The capture key is trimmed and unique within the tenant. Retrying the same key with the same reservation, quote, resource, payer, quantity, and time interval returns the existing snapshot; reusing it with different intent conflicts. The snapshot and all lines are saved together. The booking workflow marks the snapshot bound and converts the quote only after reservation confirmation succeeds.

Primary API Endpoints

Key endpoints exposed by CatalogPricingControllers for catalog browsing, price book management, and quotation calculation.

MethodEndpointDescriptionAuth
GET/api/v1/catalog-pricing/catalog-itemsRetrieve catalog items and offerings by category and branch🔒 Required
POST/api/v1/catalog-pricing/catalog-itemsRegister a new service, rental asset, or retail product🔒 Required
GET/api/v1/catalog-pricing/offeringsList bookable offerings with base rates and requirements🔒 Required
GET/api/v1/catalog-pricing/price-booksFetch active and scheduled price books with version details🔒 Required
POST/api/v1/catalog-pricing/price-quotes/calculateCalculate and persist a price quote. Reuse the same Idempotency-Key for retries to receive the original quote; reusing the key with changed input conflicts.🔒 Required
POST/api/v1/catalog-pricing/price-quotesGenerate and persist an official price quote with expiration TTL🔒 Required