//! This code was AUTOGENERATED using the Codama library.

use super::FluxbeamAccount;

pub struct FluxbeamAccountsMigration;

impl sqlx_migrator::Migration<sqlx::Postgres> for FluxbeamAccountsMigration {
    fn app(&self) -> &str {
        "fluxbeam"
    }

    fn name(&self) -> &str {
        "fluxbeam_accounts"
    }

    fn operations(&self) -> Vec<Box<dyn sqlx_migrator::Operation<sqlx::Postgres>>> {
        vec![]
    }

    fn parents(&self) -> Vec<Box<dyn sqlx_migrator::Migration<sqlx::Postgres>>> {
        vec![]
    }
}

pub struct FluxbeamAccountWithMetadata(
    pub FluxbeamAccount,
    pub carbon_core::account::AccountMetadata,
);

impl From<(FluxbeamAccount, carbon_core::account::AccountMetadata)>
    for FluxbeamAccountWithMetadata
{
    fn from(value: (FluxbeamAccount, carbon_core::account::AccountMetadata)) -> Self {
        FluxbeamAccountWithMetadata(value.0, value.1)
    }
}

#[async_trait::async_trait]
impl carbon_core::postgres::operations::Insert for FluxbeamAccountWithMetadata {
    async fn insert(&self, _pool: &sqlx::PgPool) -> carbon_core::error::CarbonResult<()> {
        unreachable!("No accounts to decode")
    }
}

#[async_trait::async_trait]
impl carbon_core::postgres::operations::Upsert for FluxbeamAccountWithMetadata {
    async fn upsert(&self, _pool: &sqlx::PgPool) -> carbon_core::error::CarbonResult<()> {
        unreachable!("No accounts to decode")
    }
}
