dim_discount_campaign_discount_period


Description

Defines the discount amounts and effective periods for discount campaigns. Covers all three campaign scope types — main contract rate bundle (RATE_BUNDLE), flat-fee bundle (FLAT_FEE), and optional add-on module (MODULE) — in a single table.

Each row represents one discount tier (position) for one campaign scope entry. Multiple tiers per scope entry are possible (e.g. position 0: 100% off for 3 months, position 1: 50% off for the following 3 months).

Join to dim_discount_campaign_scope on discount_campaign_scope_id to determine which rate bundles or terms the discount applies to.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
discount_campaign_discount_period_id int8 19 null

Unique identifier for this discount tier.

scope_type varchar 256 null

The type of price component this discount period targets.

One of: * RATE_BUNDLE: Discount on the main contract rate bundle price. * FLAT_FEE: Discount on a flat-fee rate bundle price. * MODULE: Discount on an optional add-on module price.

discount_campaign_scope_id varchar 256 null
dim_discount_campaign_scope.discount_campaign_scope_id dim_discount_campaign_discount_period_discount_campaign_scope_id_fkey R

References the campaign scope entry (rate bundle, flat-fee bundle, or module) that this discount period belongs to.

discount_campaign_id int8 19 null

The discount campaign this discount period belongs to.

discount_position int8 19 null

The order of this discount tier within the campaign scope entry. Lower positions apply first.

discount_type varchar 256 null

The method by which the discount value is applied: ABSOLUTE (fixed euro amount) or PERCENTAGE (percentage of price).

discount_absolute_amount numeric 19,2 null

The fixed monetary amount deducted from the price when discount_type is ABSOLUTE. Zero when discount_type is PERCENTAGE.

discount_percentage numeric 19,2 null

The percentage of the price deducted when discount_type is PERCENTAGE (e.g. 100.00 for fully free). Zero when discount_type is ABSOLUTE.

price_override numeric 19,2 null

When set, replaces the computed discount with a fixed price. Takes precedence over discount_type. NULL in most cases.

effective_period varchar 256 null

How long this discount tier is active.

One of: * UNLIMITED: The discount applies for the entire duration of the contract. * INITIAL_TERM: The discount applies only during the initial contract term. * TIME_BASED: The discount applies for a fixed duration set by effective_period_time_based_term_value and effective_period_time_based_term_unit.

effective_period_time_based_term_value int4 10 null

The numeric duration of the time-based effective period (e.g. 3 for 3 months). Only set when effective_period is TIME_BASED.

effective_period_time_based_term_unit varchar 256 null

The time unit for the time-based effective period. Only set when effective_period is TIME_BASED.

One of: * DAY: Duration in calendar days. * WEEK: Duration in calendar weeks. * MONTH: Duration in calendar months. * YEAR: Duration in calendar years.

last_updated timestamptz 35 null

System column. UTC Timestamp at which entry was calculated (lags shortly behind source system).

Relationships