use serde::Serialize;

use crate::BillingProvider;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BillingDialectRightDescriptor {
    pub provider: BillingProvider,
    pub vendor_key: &'static str,
    pub canonical_key: &'static str,
    pub resource: &'static str,
    pub action: &'static str,
    pub description: &'static str,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BillingTranslatedRightProviderBinding {
    pub provider: BillingProvider,
    pub vendor_key: String,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BillingTranslatedRightDescriptor {
    pub key: String,
    pub resource: String,
    pub action: String,
    pub description: String,
    pub providers: Vec<BillingTranslatedRightProviderBinding>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BillingDialectRightGroup {
    pub provider: BillingProvider,
    pub rights: Vec<BillingDialectRightDescriptor>,
}
