Skip to content

Complete Deal Type Examples

Overview

This document provides complete state machine examples for each deal type supported by the touring system. Each example shows:

  • Static variables required
  • States and their calculations
  • Inputs needed
  • Clause structure with triggers and calculations

Part 1: Flat Guarantee

Description

Artist receives a fixed amount regardless of ticket sales. Simplest deal structure.

Example: $5,000 Flat Guarantee

javascript
{
  clause_block_id: "cb_flat_guarantee",
  clause_block_ref: "CB_FLAT_GUARANTEE",
  name: "Indie Band - The Fonda - Flat Guarantee",
  
  static_variables: {
    v_guarantee: 5000
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: true,
      status: "C",
      calculation: "SHOW_DATE_INPUT.value.date < today() && SHOW_DATE_INPUT.value.status == 'confirmed'"
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      input_type: "object",
      name: "Show Confirmation",
      value: {
        date: "2025-12-15",
        status: "confirmed"
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_guarantee",
      name: "Flat Guarantee Payment",
      amount: 5000,
      trigger: "SHOW_STATE.value == true",
      calculation: "v_guarantee",
      start_date: "2025-11-01",
      end_date: "2025-12-31",
      payment_terms: [
        {
          payment_term_id: "pt_guarantee_lump",
          payment_term_name: "Full Guarantee Payment",
          status: "scheduled",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "absolute", value: "2025-12-15" }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Show played: TRUE
// Trigger: TRUE
// Amount: v_guarantee = $5,000

Part 2: Percentage of Gross Box Office

Description

Artist receives a percentage of total ticket revenue (gross box office) without any deductions.

Example: 70% of Gross

javascript
{
  clause_block_id: "cb_pct_gross",
  clause_block_ref: "CB_PCT_GROSS",
  name: "Jazz Trio - Blue Note - Percentage of Gross",
  
  static_variables: {
    v_artist_percentage: 70
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: true,
      status: "C",
      calculation: "SHOW_DATE_INPUT.value.status == 'confirmed'"
    },
    {
      state_key: "BOX_OFFICE_STATE",
      state_type: "object",
      name: "Box Office Data",
      value: {
        gross_box_office: 45000
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          gross_box_office: "TICKET_DETAIL_INPUT.value.total_amount"
        }
      }
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      input_type: "object",
      name: "Show Confirmation",
      value: { date: "2025-12-20", status: "confirmed" },
      status: "C"
    },
    {
      input_key: "TICKET_DETAIL_INPUT",
      input_type: "object",
      name: "Ticket Sales",
      value: {
        quantity: 450,
        price_per_ticket: 100.00,
        total_amount: 45000.00
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_pct_gross",
      name: "Percentage of Gross Payment",
      amount: 31500,
      trigger: "SHOW_STATE.value == true",
      calculation: "BOX_OFFICE_STATE.value.gross_box_office * v_artist_percentage / 100",
      calculation_metadata: {
        gross_box_office: 45000,
        percentage: 70,
        artist_payment: 31500,
        calculation_summary: "$45,000 (Gross) × 70% = $31,500"
      },
      payment_terms: [
        {
          payment_term_id: "pt_pct_gross",
          payment_term_name: "Settlement Payment",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "relative", trigger: "SHOW_SETTLED.status == 'C'", offset_days: 0 }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Gross Box Office: $45,000
// Artist %: 70%
// Payment: $45,000 × 70% = $31,500

Part 3: Percentage of Net (After Expenses)

Description

Artist receives a percentage after deducting agreed expenses from gross revenue.

Example: 80% of Net After $8,000 Expenses

javascript
{
  clause_block_id: "cb_pct_net",
  clause_block_ref: "CB_PCT_NET",
  name: "Rock Band - Venue X - Percentage of Net",
  
  static_variables: {
    v_artist_percentage: 80,
    v_tax_rate: 0.0825
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: true,
      status: "C"
    },
    {
      state_key: "NET_REVENUE_STATE",
      state_type: "object",
      name: "Net Revenue Calculation",
      value: {
        gross_box_office: 50000,
        sales_tax: 3807.69,
        facility_fees: 2500,
        expenses: 8000,
        net_after_expenses: 35692.31
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          gross_box_office: "TICKET_DETAIL_INPUT.value.total_amount",
          sales_tax: "this.gross_box_office * v_tax_rate / (1 + v_tax_rate)",
          facility_fees: "FACILITY_FEE_INPUT.value.total_amount",
          expenses: "EXPENSE_INPUT.value.total",
          net_after_expenses: "this.gross_box_office - this.sales_tax - this.facility_fees - this.expenses"
        }
      }
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      value: { date: "2025-12-22", status: "confirmed" },
      status: "C"
    },
    {
      input_key: "TICKET_DETAIL_INPUT",
      value: {
        quantity: 1000,
        price_per_ticket: 50.00,
        total_amount: 50000.00
      },
      status: "C"
    },
    {
      input_key: "FACILITY_FEE_INPUT",
      value: {
        amount_per_ticket: 2.50,
        total_amount: 2500
      },
      status: "C"
    },
    {
      input_key: "EXPENSE_INPUT",
      input_type: "object",
      name: "Show Expenses",
      value: {
        total: 8000,
        breakdown: [
          { category: "Sound", amount: 3000 },
          { category: "Lighting", amount: 2500 },
          { category: "Security", amount: 1500 },
          { category: "Catering", amount: 1000 }
        ]
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_pct_net",
      name: "Percentage of Net Payment",
      amount: 28553.85,
      trigger: "SHOW_STATE.value == true",
      calculation: "NET_REVENUE_STATE.value.net_after_expenses * v_artist_percentage / 100",
      calculation_metadata: {
        gross: 50000,
        deductions: 14307.69,
        net: 35692.31,
        artist_percentage: 80,
        artist_payment: 28553.85,
        calculation_summary: "$35,692.31 (Net) × 80% = $28,553.85"
      },
      payment_terms: [
        {
          payment_term_id: "pt_pct_net",
          payment_term_name: "Settlement Payment",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "relative", trigger: "SHOW_SETTLED.status == 'C'", offset_days: 0 }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Gross Box Office: $50,000
// - Sales Tax (8.25%): $3,807.69
// - Facility Fees: $2,500
// - Expenses: $8,000
// = Net: $35,692.31
// Artist Payment: $35,692.31 × 80% = $28,553.85

Part 4: Guarantee vs. Percentage of NBOR

Description

Artist receives the GREATER of: (A) fixed guarantee, or (B) percentage of net box office receipts.

Example: $15,000 Guarantee vs 85% NBOR

javascript
{
  clause_block_id: "cb_gvn",
  clause_block_ref: "CB_GVN",
  name: "Pop Artist - The Greek - Guarantee vs NBOR",
  
  static_variables: {
    v_guarantee: 15000,
    v_artist_percentage: 85,
    v_tax_rate: 0.0925
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: true,
      status: "C"
    },
    {
      state_key: "SHOW_SETTLED",
      state_type: "object",
      name: "Show Settlement",
      value: {
        gross_box_office: 125000,
        sales_tax_collected: 10587.53,
        facility_fees: 7500,
        net_box_office_receipts: 106912.47
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          gross_box_office: "TICKET_DETAIL_INPUT.value.total_amount",
          sales_tax_collected: "this.gross_box_office * v_tax_rate / (1 + v_tax_rate)",
          facility_fees: "FACILITY_FEE_INPUT.value.amount_per_ticket * TICKET_DETAIL_INPUT.value.quantity",
          net_box_office_receipts: "this.gross_box_office - this.sales_tax_collected - this.facility_fees"
        }
      }
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      value: { date: "2025-12-25", status: "confirmed" },
      status: "C"
    },
    {
      input_key: "TICKET_DETAIL_INPUT",
      value: {
        quantity: 2500,
        price_per_ticket: 50.00,
        total_amount: 125000.00
      },
      status: "C"
    },
    {
      input_key: "FACILITY_FEE_INPUT",
      value: {
        amount_per_ticket: 3.00,
        breakdown: [
          { description: "Venue fee", amount_per_ticket: 2.00 },
          { description: "Processing", amount_per_ticket: 1.00 }
        ]
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_gvn",
      name: "Guarantee vs NBOR",
      amount: 90875.60,
      trigger: "SHOW_SETTLED.status == 'C'",
      calculation: "MAX((SHOW_SETTLED.value.net_box_office_receipts * v_artist_percentage / 100), v_guarantee)",
      calculation_metadata: {
        guarantee_component: 15000,
        percentage_component: 90875.60,
        winning_path: "percentage",
        nbor: 106912.47,
        artist_percentage: 85,
        calculation_summary: "MAX($15,000, $106,912.47 (NBOR) × 85%) = $90,875.60"
      },
      payment_terms: [
        {
          payment_term_id: "pt_deposit",
          payment_term_name: "10% Deposit",
          status: "paid",
          payment_type: "lump_sum",
          amount: { type: "fixed", value: 1500 },
          due_date: { type: "absolute", value: "2025-10-01" }
        },
        {
          payment_term_id: "pt_balance",
          payment_term_name: "Balance Payment",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "calculated", calculation: "clause.amount - 1500" },
          due_date: { type: "relative", trigger: "SHOW_SETTLED.status == 'C'", offset_days: 0 }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Gross Box Office: $125,000
// - Sales Tax (9.25%): $10,587.53
// - Facility Fees: $7,500
// = NBOR: $106,912.47
//
// Option A (Guarantee): $15,000
// Option B (85% NBOR): $106,912.47 × 85% = $90,875.60
//
// MAX($15,000, $90,875.60) = $90,875.60 (percentage wins)

Part 5: Guarantee Plus Bonus

Description

Artist receives guaranteed amount PLUS additional bonus based on performance thresholds.

Example: $10,000 Guarantee + $2,000 Bonus if >1,000 Tickets

javascript
{
  clause_block_id: "cb_guarantee_plus_bonus",
  clause_block_ref: "CB_GUARANTEE_BONUS",
  name: "Comedian - Comedy Club - Guarantee Plus Bonus",
  
  static_variables: {
    v_guarantee: 10000,
    v_bonus_amount: 2000,
    v_bonus_threshold: 1000
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: true,
      status: "C"
    },
    {
      state_key: "TICKET_COUNT_STATE",
      state_type: "number",
      name: "Total Tickets Sold",
      value: 1250,
      status: "C",
      calculation: "TICKET_DETAIL_INPUT.value.quantity"
    },
    {
      state_key: "BONUS_QUALIFIED_STATE",
      state_type: "boolean",
      name: "Bonus Qualified",
      value: true,
      status: "C",
      calculation: "TICKET_COUNT_STATE.value > v_bonus_threshold"
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      value: { date: "2025-12-28", status: "confirmed" },
      status: "C"
    },
    {
      input_key: "TICKET_DETAIL_INPUT",
      value: {
        quantity: 1250,
        price_per_ticket: 35.00,
        total_amount: 43750.00
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_guarantee",
      name: "Base Guarantee",
      amount: 10000,
      trigger: "SHOW_STATE.value == true",
      calculation: "v_guarantee",
      payment_terms: [
        {
          payment_term_id: "pt_guarantee",
          payment_term_name: "Guarantee Payment",
          status: "scheduled",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "absolute", value: "2025-12-28" }
        }
      ]
    },
    {
      clause_id: "clause_bonus",
      name: "Bonus Payment",
      amount: 2000,
      trigger: "BONUS_QUALIFIED_STATE.value == true",
      calculation: "v_bonus_amount",
      pre_condition: "SHOW_STATE.value == true",
      payment_terms: [
        {
          payment_term_id: "pt_bonus",
          payment_term_name: "Bonus Payment",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "relative", trigger: "SHOW_SETTLED.status == 'C'", offset_days: 0 }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Tickets Sold: 1,250
// Bonus Threshold: 1,000
// Bonus Qualified: TRUE (1,250 > 1,000)
//
// Guarantee: $10,000
// Bonus: $2,000
// Total: $12,000

Part 6: Split Point Deal

Description

Complex deal with guarantee, expenses, promoter profit, and backend percentage for artist.

Example: $20,000 Guarantee + 15% Promoter Profit + 85% Backend

javascript
{
  clause_block_id: "cb_split_point",
  clause_block_ref: "CB_SPLIT_POINT",
  name: "Major Artist - Arena - Split Point Deal",
  
  static_variables: {
    v_guarantee: 20000,
    v_promoter_profit_percentage: 15,
    v_artist_backend_percentage: 85,
    v_tax_rate: 0.0825
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: true,
      status: "C"
    },
    {
      state_key: "NBOR_STATE",
      state_type: "object",
      name: "Net Box Office",
      value: {
        gross_box_office: 500000,
        sales_tax: 38248.85,
        facility_fees: 30000,
        net_box_office: 431751.15
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          gross_box_office: "TICKET_DETAIL_INPUT.value.total_amount",
          sales_tax: "this.gross_box_office * v_tax_rate / (1 + v_tax_rate)",
          facility_fees: "FACILITY_FEE_INPUT.value.total_amount",
          net_box_office: "this.gross_box_office - this.sales_tax - this.facility_fees"
        }
      }
    },
    {
      state_key: "SPLIT_POINT_STATE",
      state_type: "object",
      name: "Split Point Calculation",
      value: {
        guarantee: 20000,
        total_expenses: 50000,
        promoter_profit: 7500,
        split_point: 77500,
        overage: 354251.15,
        artist_backend: 301113.48
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          guarantee: "v_guarantee",
          total_expenses: "EXPENSE_INPUT.value.total",
          promoter_profit: "this.total_expenses * v_promoter_profit_percentage / 100",
          split_point: "this.guarantee + this.total_expenses + this.promoter_profit",
          overage: "MAX(0, NBOR_STATE.value.net_box_office - this.split_point)",
          artist_backend: "this.overage * v_artist_backend_percentage / 100"
        }
      }
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      value: { date: "2025-12-30", status: "confirmed" },
      status: "C"
    },
    {
      input_key: "TICKET_DETAIL_INPUT",
      value: {
        quantity: 10000,
        price_per_ticket: 50.00,
        total_amount: 500000.00
      },
      status: "C"
    },
    {
      input_key: "FACILITY_FEE_INPUT",
      value: {
        amount_per_ticket: 3.00,
        total_amount: 30000
      },
      status: "C"
    },
    {
      input_key: "EXPENSE_INPUT",
      input_type: "object",
      name: "Show Expenses",
      value: {
        total: 50000,
        breakdown: [
          { category: "Sound & Lighting", amount: 20000, is_variable: false },
          { category: "Security", amount: 10000, is_variable: true },
          { category: "Stagehands", amount: 8000, is_variable: false },
          { category: "Catering", amount: 5000, is_variable: false },
          { category: "Marketing", amount: 7000, is_variable: false }
        ]
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_split_point",
      name: "Split Point Artist Payment",
      amount: 321113.48,
      trigger: "SHOW_STATE.value == true && SPLIT_POINT_STATE.status != 'D'",
      calculation: "v_guarantee + SPLIT_POINT_STATE.value.artist_backend",
      calculation_metadata: {
        guarantee: 20000,
        backend: 301113.48,
        total_payment: 321113.48,
        split_point: 77500,
        nbor: 431751.15,
        overage: 354251.15,
        calculation_summary: "$20,000 (Guar) + $301,113.48 (Backend) = $321,113.48"
      },
      payment_terms: [
        {
          payment_term_id: "pt_split_point",
          payment_term_name: "Settlement Payment",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "relative", trigger: "SHOW_SETTLED.status == 'C'", offset_days: 0 }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Gross Box Office: $500,000
// - Sales Tax (8.25%): $38,248.85
// - Facility Fees: $30,000
// = NBOR: $431,751.15
//
// Split Point Calculation:
// Guarantee: $20,000
// + Expenses: $50,000
// + Promoter Profit (15% of expenses): $7,500
// = Split Point: $77,500
//
// Overage: $431,751.15 - $77,500 = $354,251.15
// Artist Backend (85%): $354,251.15 × 85% = $301,113.48
//
// Total Artist Payment: $20,000 + $301,113.48 = $321,113.48

Part 7: Merchandise Split

Description

Separate clause block for merchandise revenue sharing, typically referenced alongside show performance.

Example: 80/20 Merch Split (Artist/Promoter)

javascript
{
  clause_block_id: "cb_merch_split",
  clause_block_ref: "CB_MERCH_SPLIT",
  name: "Artist Merchandise - The Venue",
  clause_block_type: "merchandise_split",
  
  metadata: {
    show_id: "show_venue_dec15",
    venue: "The Venue",
    date: "2025-12-15"
  },
  
  static_variables: {
    v_artist_percentage: 80,
    v_hall_fee_percentage: 20
  },
  
  states: [
    {
      state_key: "MERCH_STATE",
      state_type: "object",
      name: "Merchandise Data",
      value: {
        gross_merch_sales: 15000,
        hall_fee: 3000,
        net_merch: 12000
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          gross_merch_sales: "MERCH_DATA_INPUT.value.gross_sales",
          hall_fee: "this.gross_merch_sales * v_hall_fee_percentage / 100",
          net_merch: "this.gross_merch_sales - this.hall_fee"
        }
      }
    }
  ],
  
  inputs: [
    {
      input_key: "MERCH_DATA_INPUT",
      input_type: "object",
      name: "Merchandise Sales Data",
      value: {
        gross_sales: 15000,
        items_sold: {
          tshirts: { quantity: 200, unit_price: 35, total: 7000 },
          posters: { quantity: 150, unit_price: 20, total: 3000 },
          vinyl: { quantity: 100, unit_price: 30, total: 3000 },
          other: { quantity: 100, unit_price: 20, total: 2000 }
        }
      },
      status: "C"
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_merch_artist",
      name: "Merchandise Artist Payment",
      amount: 9600,
      trigger: "EXISTS(MERCH_STATE)",
      calculation: "MERCH_STATE.value.net_merch * v_artist_percentage / 100",
      calculation_metadata: {
        gross_sales: 15000,
        hall_fee: 3000,
        net_merch: 12000,
        artist_percentage: 80,
        artist_payment: 9600,
        calculation_summary: "$12,000 (Net Merch) × 80% = $9,600"
      },
      payment_terms: [
        {
          payment_term_id: "pt_merch",
          payment_term_name: "Merch Settlement",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "relative", trigger: "MERCH_STATE.status == 'C'", offset_days: 0 }
        }
      ]
    }
  ]
}

// Calculation Breakdown:
// Gross Merch Sales: $15,000
// - Hall Fee (20%): $3,000
// = Net Merch: $12,000
// Artist Payment (80% of net): $9,600

Part 8: Tour Summary (Aggregation)

Description

Aggregates multiple show clause_blocks for tour-level totals.

Example: 3-Show Tour Summary

javascript
{
  clause_block_id: "cb_tour_summary",
  clause_block_ref: "CB_TOUR_SUMMARY",
  name: "West Coast Tour 2025 - Summary",
  clause_block_type: "tour_summary",
  
  static_variables: {},
  
  states: [
    {
      state_key: "TOUR_TOTALS_STATE",
      state_type: "object",
      name: "Tour Totals",
      value: {
        total_shows: 3,
        shows_completed: 3,
        total_gross: 675000,
        total_nbor: 538663.62,
        total_artist_payment: 457864.08
      },
      status: "C",
      calculation: {
        type: "aggregate",
        fields: {
          total_shows: "3",
          shows_completed: "SUM(1 for cb in [CB_SHOW_1, CB_SHOW_2, CB_SHOW_3] where cb.states.SHOW_STATE.value == true)",
          total_gross: "SUM(cb.states.NBOR_STATE.value.gross_box_office for cb in [CB_SHOW_1, CB_SHOW_2, CB_SHOW_3])",
          total_nbor: "SUM(cb.states.NBOR_STATE.value.net_box_office for cb in [CB_SHOW_1, CB_SHOW_2, CB_SHOW_3])",
          total_artist_payment: "SUM(cb.financial_clauses[0].amount for cb in [CB_SHOW_1, CB_SHOW_2, CB_SHOW_3] where cb.financial_clauses[0].trigger == true)"
        }
      }
    }
  ],
  
  inputs: [],

  financial_clauses: [
    {
      clause_id: "clause_tour_total",
      name: "Total Tour Payment",
      amount: 457864.08,
      trigger: "true",
      calculation: "TOUR_TOTALS_STATE.value.total_artist_payment",
      calculation_metadata: {
        show_1_payment: 15300,
        show_2_payment: 210800,
        show_3_payment: 231764.08,
        tour_total: 457864.08,
        calculation_summary: "$15,300 + $210,800 + $231,764.08 = $457,864.08"
      },
      payment_terms: [
        {
          payment_term_id: "pt_tour_total",
          payment_term_name: "Tour Settlement",
          status: "pending",
          payment_type: "lump_sum",
          amount: { type: "percentage", value: 100 },
          due_date: { type: "relative", trigger: "TOUR_TOTALS_STATE.status == 'C'", offset_days: 10 }
        }
      ]
    }
  ]
}

// Referenced Clause Blocks (in same version):
// CB_SHOW_1: The Fonda - $15,300 artist payment
// CB_SHOW_2: The Greek - $210,800 artist payment
// CB_SHOW_3: Hollywood Bowl - $231,764.08 artist payment
//
// Tour Total: $15,300 + $210,800 + $231,764.08 = $457,864.08

Part 9: Show Cancellation Example

Description

When a show is cancelled, the SHOW_STATE becomes false and clause amount becomes 0.

Example: Cancelled Show in Tour

javascript
{
  clause_block_id: "cb_show_cancelled",
  clause_block_ref: "CB_SHOW_CANCELLED",
  name: "Cancelled Show - Weather Event",
  
  static_variables: {
    v_guarantee: 25000,
    v_artist_percentage: 85
  },
  
  states: [
    {
      state_key: "SHOW_STATE",
      state_type: "boolean",
      name: "Show Played",
      value: false,
      status: "C",  // Confirmed: show definitely did NOT happen
      calculation: "SHOW_DATE_INPUT.value.status == 'confirmed'"
    },
    {
      state_key: "SHOW_SETTLED",
      state_type: "object",
      name: "Show Settlement",
      value: null,  // No settlement data for cancelled show
      status: "X",  // Not required
      calculation: "..."
    }
  ],
  
  inputs: [
    {
      input_key: "SHOW_DATE_INPUT",
      value: {
        date: "2025-12-18",
        status: "cancelled",  // Show was cancelled
        cancellation_reason: "Weather event - venue closed"
      },
      status: "C"
    },
    {
      input_key: "TICKET_DETAIL_INPUT",
      value: null,  // No ticket sales
      status: "X"   // Not required for cancelled show
    }
  ],

  financial_clauses: [
    {
      clause_id: "clause_gvn",
      name: "Guarantee vs NBOR",
      amount: 0,  // Zero because show didn't happen
      trigger: "SHOW_STATE.value == true",  // FALSE - show not played
      calculation: "MAX((SHOW_SETTLED.value.net_box_office_receipts * v_artist_percentage / 100), v_guarantee)",
      calculation_metadata: {
        trigger_evaluated: false,
        reason: "Show cancelled - trigger condition not met"
      }
    }
  ]
}

// Calculation Breakdown:
// Show Status: CANCELLED
// SHOW_STATE: FALSE
// Trigger: SHOW_STATE.value == true → FALSE
// Amount: $0 (trigger not met)
//
// Note: The clause_block remains in the deal for audit purposes.
// The artist payment is $0 for this show.
// Tour totals will exclude this show's payment.

Part 10: What-If Scenario Example

Description

Multiple versions of same deal with different assumptions.

Example: Optimistic vs. Pessimistic Forecast

javascript
// Version: Optimistic Forecast
{
  version_id: "v_working_optimistic",
  status: "working",
  clause_blocks: [
    {
      clause_block_id: "cb_show_1",
      name: "Show 1 - Optimistic Scenario",
      
      static_variables: {
        v_guarantee: 15000,
        v_artist_percentage: 85
      },
      
      states: [
        {
          state_key: "SHOW_SETTLED",
          value: {
            gross_box_office: 150000,  // Optimistic: sellout
            net_box_office_receipts: 127500
          },
          status: "F"  // Forecast
        }
      ],
      
      inputs: [
        {
          input_key: "TICKET_DETAIL_INPUT",
          value: {
            quantity: 3000,  // Full capacity
            price_per_ticket: 50.00,
            total_amount: 150000.00
          },
          status: "F"  // Forecast estimate
        }
      ],

      financial_clauses: [
        {
          clause_id: "clause_gvn",
          amount: 108375,  // 85% of $127,500
          calculation_metadata: {
            scenario: "optimistic",
            assumption: "Sellout show at full capacity"
          }
        }
      ]
    }
  ]
}

// Version: Pessimistic Forecast
{
  version_id: "v_working_pessimistic",
  status: "working",
  clause_blocks: [
    {
      clause_block_id: "cb_show_1",
      name: "Show 1 - Pessimistic Scenario",
      
      static_variables: {
        v_guarantee: 15000,
        v_artist_percentage: 85
      },
      
      states: [
        {
          state_key: "SHOW_SETTLED",
          value: {
            gross_box_office: 75000,  // Pessimistic: 50% capacity
            net_box_office_receipts: 63750
          },
          status: "F"
        }
      ],
      
      inputs: [
        {
          input_key: "TICKET_DETAIL_INPUT",
          value: {
            quantity: 1500,  // 50% capacity
            price_per_ticket: 50.00,
            total_amount: 75000.00
          },
          status: "F"
        }
      ],

      financial_clauses: [
        {
          clause_id: "clause_gvn",
          amount: 54187.50,  // 85% of $63,750
          calculation_metadata: {
            scenario: "pessimistic",
            assumption: "50% capacity - weak ticket sales"
          }
        }
      ]
    }
  ]
}

// Comparison:
// Optimistic: $108,375 artist payment (sellout)
// Pessimistic: $54,187.50 artist payment (50% capacity)
// Difference: $54,187.50

Summary Table

Deal TypeKey VariablesMain Calculation
Flat Guaranteev_guaranteeIF show_played THEN guarantee
% of Grossv_artist_percentageGBOR × percentage
% of Netv_artist_percentage(GBOR - tax - fees - expenses) × percentage
Guarantee vs NBORv_guarantee, v_artist_percentageMAX(guarantee, NBOR × percentage)
Guarantee + Bonusv_guarantee, v_bonus, v_thresholdguarantee + IF(tickets > threshold, bonus, 0)
Split Pointv_guarantee, v_promoter_profit%, v_artist_backend%guarantee + MAX(0, NBOR - split_point) × backend%
Merchandisev_artist_percentage, v_hall_fee%(gross_merch - hall_fee) × artist%

This completes the deal type examples, providing a comprehensive reference for implementing each structure in the state machine model.

Confidential. For internal use only.