use crate::commands::{Cli, Result};
use clap::{Parser, Subcommand};

mod export_invoice;

use export_invoice::ExportInvoice;

/// Export database entities
#[derive(Parser)]
pub(crate) struct Export {
    #[command(subcommand)]
    pub(crate) command: ExportCommand,
}

#[derive(Subcommand)]
pub(crate) enum ExportCommand {
    Invoice(ExportInvoice),
}

impl Export {
    pub(crate) fn run(&self, cli: &Cli) -> Result<()> {
        match &self.command {
            ExportCommand::Invoice(export) => export.run(cli),
        }
    }
}
