ddex_core/models/graph/
deal.rs

1// core/src/models/graph/deal.rs
2//! Deal types
3
4use crate::models::common::{Price, ValidityPeriod};
5use chrono::{DateTime, Utc};
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct Deal {
10    pub deal_reference: Option<String>,
11    pub deal_release_reference: Vec<String>,
12    pub deal_terms: DealTerms,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct DealTerms {
17    pub validity_period: Option<ValidityPeriod>,
18    pub start_date: Option<DateTime<Utc>>,
19    pub end_date: Option<DateTime<Utc>>,
20    pub territory_code: Vec<String>,
21    pub excluded_territory_code: Vec<String>,
22    pub distribution_channel: Vec<DistributionChannel>,
23    pub excluded_distribution_channel: Vec<DistributionChannel>,
24    pub commercial_model_type: Vec<CommercialModelType>,
25    pub use_type: Vec<UseType>,
26    pub price_information: Vec<PriceInformation>,
27    pub wholesale_price: Vec<Price>,
28    pub suggested_retail_price: Vec<Price>,
29    pub pre_order_date: Option<DateTime<Utc>>,
30    pub pre_order_preview_date: Option<DateTime<Utc>>,
31    pub instant_gratification_date: Option<DateTime<Utc>>,
32    pub takedown_date: Option<DateTime<Utc>>,
33}
34
35#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
36pub enum DistributionChannel {
37    Download,
38    Stream,
39    Physical,
40    Other(String),
41}
42
43#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
44pub enum CommercialModelType {
45    PayAsYouGoModel,
46    SubscriptionModel,
47    AdSupportedModel,
48    Other(String),
49}
50
51#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
52pub enum UseType {
53    Stream,
54    Download,
55    OnDemandStream,
56    NonInteractiveStream,
57    Other(String),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
61pub struct PriceInformation {
62    pub price_type: String,
63    pub price: Price,
64    pub price_tier: Option<String>,
65}