use backbone_core::write_hooks::DeclaredEvent;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AccountingPostPosted {
pub post_id: serde_json::Value,
pub journal_id: serde_json::Value,
pub company_id: serde_json::Value,
pub source_type: serde_json::Value,
pub source_id: serde_json::Value,
pub total_debit: serde_json::Value,
pub total_credit: serde_json::Value,
pub posted_at: serde_json::Value,
}
impl DeclaredEvent for AccountingPostPosted {
const NAME: &'static str = "AccountingPostPosted";
const VERSION: i32 = 1;
const AGGREGATE: &'static str = "";
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AccountingPostFailed {
pub company_id: serde_json::Value,
pub source_type: serde_json::Value,
pub source_id: serde_json::Value,
pub error_code: serde_json::Value,
pub error_message: serde_json::Value,
pub failed_at: serde_json::Value,
}
impl DeclaredEvent for AccountingPostFailed {
const NAME: &'static str = "AccountingPostFailed";
const VERSION: i32 = 1;
const AGGREGATE: &'static str = "";
}
pub const OUTBOX_SCHEMAS: &[&str] = &[];
pub async fn migrate_outbox(pool: &backbone_orm::PgPool) -> anyhow::Result<()> {
for schema in OUTBOX_SCHEMAS {
backbone_core::write_hooks::migrate_outbox(pool, schema).await?;
}
Ok(())
}