From 4181bcd59fdf0b1dc4e61892cde1ef331059b08c Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 5 Dec 2024 14:02:55 +0100 Subject: [PATCH 01/24] chore(core-deposit): DepositAccount boilerplate --- Cargo.lock | 278 +++++++++++++++++- Cargo.toml | 2 + core/deposit/Cargo.toml | 24 ++ core/deposit/src/account/entity.rs | 67 +++++ core/deposit/src/account/error.rs | 13 + core/deposit/src/account/mod.rs | 6 + core/deposit/src/account/repo.rs | 24 ++ core/deposit/src/error.rs | 11 + core/deposit/src/event.rs | 7 + core/deposit/src/lib.rs | 95 ++++++ core/deposit/src/main.rs | 3 + core/deposit/src/primitives.rs | 98 ++++++ .../20231208110808_cala_ledger_setup.sql | 254 ++++++++++++++++ .../migrations/20240517074612_core_setup.sql | 15 + 14 files changed, 892 insertions(+), 5 deletions(-) create mode 100644 core/deposit/Cargo.toml create mode 100644 core/deposit/src/account/entity.rs create mode 100644 core/deposit/src/account/error.rs create mode 100644 core/deposit/src/account/mod.rs create mode 100644 core/deposit/src/account/repo.rs create mode 100644 core/deposit/src/error.rs create mode 100644 core/deposit/src/event.rs create mode 100644 core/deposit/src/lib.rs create mode 100644 core/deposit/src/main.rs create mode 100644 core/deposit/src/primitives.rs create mode 100644 lana/app/migrations/20231208110808_cala_ledger_setup.sql diff --git a/Cargo.lock b/Cargo.lock index f29c24910..c3d2868f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -363,6 +363,15 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "autotools" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf" +dependencies = [ + "cc", +] + [[package]] name = "axum" version = "0.7.9" @@ -617,6 +626,24 @@ dependencies = [ "serde", ] +[[package]] +name = "cached" +version = "0.51.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0feb64151eed3da6107fddd2d717a6ca4b9dbd74e43784c55c841d1abfe5a295" +dependencies = [ + "ahash 0.8.11", + "async-trait", + "cached_proc_macro 0.21.0", + "cached_proc_macro_types", + "futures", + "hashbrown 0.14.5", + "instant", + "once_cell", + "thiserror", + "tokio", +] + [[package]] name = "cached" version = "0.53.1" @@ -625,7 +652,7 @@ checksum = "b4d73155ae6b28cf5de4cfc29aeb02b8a1c6dab883cb015d15cd514e42766846" dependencies = [ "ahash 0.8.11", "async-trait", - "cached_proc_macro", + "cached_proc_macro 0.23.0", "cached_proc_macro_types", "futures", "hashbrown 0.14.5", @@ -635,6 +662,18 @@ dependencies = [ "web-time", ] +[[package]] +name = "cached_proc_macro" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771aa57f3b17da6c8bcacb187bb9ec9bc81c8160e72342e67c329e0e1651a669" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "cached_proc_macro" version = "0.23.0" @@ -659,7 +698,23 @@ version = "0.2.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a82cb4666abbe0fadc8511e5a60b904d37ca9dacc7b65d1c06e962dbc8ed1374" dependencies = [ - "cala-cel-parser", + "cala-cel-parser 0.2.44", + "chrono", + "lazy_static", + "rust_decimal", + "serde", + "serde_json", + "thiserror", + "uuid", +] + +[[package]] +name = "cala-cel-interpreter" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb633ce00ca7246885b17091a95228169d2fa3be4d48d1392f87974f3d42f8c9" +dependencies = [ + "cala-cel-parser 0.3.1", "chrono", "lazy_static", "rust_decimal", @@ -679,13 +734,74 @@ dependencies = [ "lalrpop-util", ] +[[package]] +name = "cala-cel-parser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8fd69da0ccc13cc45cf6086f01792816562eb646d00e892a241d3c909ac959e" +dependencies = [ + "lalrpop", + "lalrpop-util", +] + +[[package]] +name = "cala-ledger" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0bdc7e8b6436920b49f0e3b0464d00ffcceb9ffc4405516e1e95d8938c9b993" +dependencies = [ + "cached 0.51.4", + "cala-cel-interpreter 0.3.1", + "cala-ledger-core-types 0.3.1", + "cala-tracing", + "chrono", + "derive_builder", + "es-entity", + "futures", + "opentelemetry", + "prost", + "prost-wkt-types", + "protobuf-src", + "rust_decimal", + "serde", + "serde_json", + "sqlx", + "thiserror", + "tokio", + "tokio-stream", + "tonic", + "tonic-build", + "tonic-health", + "tracing", + "tracing-opentelemetry", + "uuid", +] + [[package]] name = "cala-ledger-core-types" version = "0.2.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e246bce7bf428886c00eabce22428513bb7794e6143819bbcf34522459518536" dependencies = [ - "cala-cel-interpreter", + "cala-cel-interpreter 0.2.44", + "chrono", + "derive_builder", + "rust_decimal", + "rusty-money", + "serde", + "serde_json", + "sqlx", + "thiserror", + "uuid", +] + +[[package]] +name = "cala-ledger-core-types" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8fb08fd15c491fb2ed2cab45c19ef85946ce7d89ecb5c0e510a4e20d2462f7" +dependencies = [ + "cala-cel-interpreter 0.3.1", "chrono", "derive_builder", "rust_decimal", @@ -697,6 +813,26 @@ dependencies = [ "uuid", ] +[[package]] +name = "cala-tracing" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54925107e2dcf62b5ef688804c98eb0f459bf3f0e8e460548a61d42396394516" +dependencies = [ + "anyhow", + "axum-extra", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "opentelemetry_sdk", + "serde", + "serde_json", + "tonic", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", +] + [[package]] name = "casbin" version = "2.5.0" @@ -1058,6 +1194,23 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "deposit" +version = "0.1.0" +dependencies = [ + "audit", + "authz", + "cala-ledger", + "derive_builder", + "es-entity", + "outbox", + "serde", + "sqlx", + "strum", + "thiserror", + "tracing", +] + [[package]] name = "der" version = "0.7.9" @@ -1205,6 +1358,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" version = "0.3.9" @@ -2147,6 +2310,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "inventory" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" + [[package]] name = "ipnet" version = "2.10.1" @@ -2299,8 +2468,8 @@ dependencies = [ "axum", "axum-extra", "base64 0.22.1", - "cached", - "cala-ledger-core-types", + "cached 0.53.1", + "cala-ledger-core-types 0.2.44", "chrono", "clap", "cloud-storage", @@ -3109,6 +3278,62 @@ dependencies = [ "prost", ] +[[package]] +name = "prost-wkt" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d84e2bee181b04c2bac339f2bfe818c46a99750488cc6728ce4181d5aa8299" +dependencies = [ + "chrono", + "inventory", + "prost", + "serde", + "serde_derive", + "serde_json", + "typetag", +] + +[[package]] +name = "prost-wkt-build" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a669d5acbe719010c6f62a64e6d7d88fdedc1fe46e419747949ecb6312e9b14" +dependencies = [ + "heck 0.5.0", + "prost", + "prost-build", + "prost-types", + "quote", +] + +[[package]] +name = "prost-wkt-types" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ef068e9b82e654614b22e6b13699bd545b6c0e2e721736008b00b38aeb4f64" +dependencies = [ + "chrono", + "prost", + "prost-build", + "prost-types", + "prost-wkt", + "prost-wkt-build", + "protobuf-src", + "regex", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "protobuf-src" +version = "1.1.0+21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" +dependencies = [ + "autotools", +] + [[package]] name = "ptr_meta" version = "0.1.4" @@ -4710,6 +4935,19 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "tonic-health" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1eaf34ddb812120f5c601162d5429933c9b527d901ab0e7f930d3147e33a09b2" +dependencies = [ + "async-stream", + "prost", + "tokio", + "tokio-stream", + "tonic", +] + [[package]] name = "tower" version = "0.4.13" @@ -4922,12 +5160,42 @@ dependencies = [ "utf-8", ] +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "typetag" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba3b6e86ffe0054b2c44f2d86407388b933b16cb0a70eea3929420db1d9bbe" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ucd-trie" version = "0.1.7" diff --git a/Cargo.toml b/Cargo.toml index d0dc14de1..8c3a838cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ members = [ "core/user", "core/governance", "core/money", + "core/deposit", "lib/authz", "lib/audit", @@ -24,6 +25,7 @@ members = [ [workspace.dependencies] es-entity = "0.3.1" sim-time = "0.3.1" +cala-ledger = "0.3.1" anyhow = "1.0.92" async-graphql = { version = "7.0.11", default-features = false, features = ["dataloader", "tracing", "chrono", "playground"] } diff --git a/core/deposit/Cargo.toml b/core/deposit/Cargo.toml new file mode 100644 index 000000000..ce0ba2601 --- /dev/null +++ b/core/deposit/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "deposit" +version = "0.1.0" +edition = "2021" + +[features] + +fail-on-warnings = [] +graphql = ["es-entity/graphql"] + +[dependencies] +audit = { path = "../../lib/audit" } +authz = { path = "../../lib/authz" } +outbox = { path = "../../lib/outbox" } + +cala-ledger = { workspace = true } +es-entity = { workspace = true } +sqlx = { workspace = true } + +strum = { workspace = true } +serde = { workspace = true } +thiserror = { workspace = true } +tracing = { workspace = true } +derive_builder = { workspace = true } diff --git a/core/deposit/src/account/entity.rs b/core/deposit/src/account/entity.rs new file mode 100644 index 000000000..b93241cdc --- /dev/null +++ b/core/deposit/src/account/entity.rs @@ -0,0 +1,67 @@ +use derive_builder::Builder; +use serde::{Deserialize, Serialize}; + +use es_entity::*; + +use audit::AuditInfo; + +use crate::primitives::*; + +#[derive(EsEvent, Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "type", rename_all = "snake_case")] +#[es_event(id = "DepositAccountId")] +pub enum DepositAccountEvent { + Initialized { + id: DepositAccountId, + account_holder_id: AccountHolderId, + audit_info: AuditInfo, + }, +} + +#[derive(EsEntity, Builder)] +#[builder(pattern = "owned", build_fn(error = "EsEntityError"))] +pub struct DepositAccount { + pub id: DepositAccountId, + pub(super) events: EntityEvents, +} + +impl TryFromEvents for DepositAccount { + fn try_from_events(events: EntityEvents) -> Result { + let mut builder = DepositAccountBuilder::default(); + for event in events.iter_all() { + match event { + DepositAccountEvent::Initialized { id, .. } => builder = builder.id(*id), + } + } + builder.events(events).build() + } +} + +#[derive(Debug, Builder)] +pub struct NewDepositAccount { + #[builder(setter(into))] + pub(super) id: DepositAccountId, + #[builder(setter(into))] + pub(super) account_holder_id: AccountHolderId, + #[builder(setter(into))] + pub audit_info: AuditInfo, +} + +impl NewDepositAccount { + pub fn builder() -> NewDepositAccountBuilder { + NewDepositAccountBuilder::default() + } +} + +impl IntoEvents for NewDepositAccount { + fn into_events(self) -> EntityEvents { + EntityEvents::init( + self.id, + [DepositAccountEvent::Initialized { + id: self.id, + account_holder_id: self.account_holder_id, + audit_info: self.audit_info, + }], + ) + } +} diff --git a/core/deposit/src/account/error.rs b/core/deposit/src/account/error.rs new file mode 100644 index 000000000..f519b6e43 --- /dev/null +++ b/core/deposit/src/account/error.rs @@ -0,0 +1,13 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum DepositAccountError { + #[error("CommitteeError - Sqlx: {0}")] + Sqlx(#[from] sqlx::Error), + #[error("CommitteeError - EsEntityError: {0}")] + EsEntityError(es_entity::EsEntityError), + #[error("CommitteeError - CursorDestructureError: {0}")] + CursorDestructureError(#[from] es_entity::CursorDestructureError), +} + +es_entity::from_es_entity_error!(DepositAccountError); diff --git a/core/deposit/src/account/mod.rs b/core/deposit/src/account/mod.rs new file mode 100644 index 000000000..14499942d --- /dev/null +++ b/core/deposit/src/account/mod.rs @@ -0,0 +1,6 @@ +mod entity; +pub mod error; +mod repo; + +pub(super) use entity::*; +pub(super) use repo::*; diff --git a/core/deposit/src/account/repo.rs b/core/deposit/src/account/repo.rs new file mode 100644 index 000000000..eb3cea3d3 --- /dev/null +++ b/core/deposit/src/account/repo.rs @@ -0,0 +1,24 @@ +use sqlx::PgPool; + +use es_entity::*; + +use crate::primitives::{AccountHolderId, DepositAccountId}; + +use super::{entity::*, error::*}; + +#[derive(EsRepo, Clone)] +#[es_repo( + entity = "DepositAccount", + err = "DepositAccountError", + columns(account_holder_id(ty = "AccountHolderId", list_for, update(persist = false))) +)] +pub struct DepositAccountRepo { + #[allow(dead_code)] + pool: PgPool, +} + +impl DepositAccountRepo { + pub fn new(pool: &PgPool) -> Self { + Self { pool: pool.clone() } + } +} diff --git a/core/deposit/src/error.rs b/core/deposit/src/error.rs new file mode 100644 index 000000000..1ffd6b1fb --- /dev/null +++ b/core/deposit/src/error.rs @@ -0,0 +1,11 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum CoreDepositError { + #[error("CoreDepositError - Sqlx: {0}")] + Sqlx(#[from] sqlx::Error), + #[error("CoreDepositError - AuthorizationError: {0}")] + AuthorizationError(#[from] authz::error::AuthorizationError), + #[error("CoreDepositError - CommitteeError: {0}")] + DepositAccountError(#[from] crate::account::error::DepositAccountError), +} diff --git a/core/deposit/src/event.rs b/core/deposit/src/event.rs new file mode 100644 index 000000000..4d3e2bfed --- /dev/null +++ b/core/deposit/src/event.rs @@ -0,0 +1,7 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum CoreDepositEvent { + DepositAccountCreated, +} diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs new file mode 100644 index 000000000..dd2e4c6ac --- /dev/null +++ b/core/deposit/src/lib.rs @@ -0,0 +1,95 @@ +#![cfg_attr(feature = "fail-on-warnings", deny(warnings))] +#![cfg_attr(feature = "fail-on-warnings", deny(clippy::all))] + +mod account; +pub mod error; +mod event; +mod primitives; + +use tracing::instrument; + +use audit::AuditSvc; +use authz::PermissionCheck; +use outbox::{Outbox, OutboxEventMarker}; + +use account::*; +use error::*; +pub use event::*; +pub use primitives::*; + +// account +// deposit +// +// customer + +pub struct CoreDeposit +where + Perms: PermissionCheck, + E: OutboxEventMarker, +{ + accounts: DepositAccountRepo, + authz: Perms, + outbox: Outbox, +} + +impl Clone for CoreDeposit +where + Perms: PermissionCheck, + E: OutboxEventMarker, +{ + fn clone(&self) -> Self { + Self { + accounts: self.accounts.clone(), + authz: self.authz.clone(), + outbox: self.outbox.clone(), + } + } +} + +impl CoreDeposit +where + Perms: PermissionCheck, + <::Audit as AuditSvc>::Action: From, + <::Audit as AuditSvc>::Object: From, + E: OutboxEventMarker, +{ + pub async fn init( + pool: &sqlx::PgPool, + authz: &Perms, + outbox: &Outbox, + ) -> Result { + let accounts = DepositAccountRepo::new(pool); + let res = Self { + accounts, + authz: authz.clone(), + outbox: outbox.clone(), + }; + Ok(res) + } + + #[instrument(name = "deposit.create_account", skip(self))] + pub async fn create_account( + &self, + sub: &<::Audit as AuditSvc>::Subject, + holder_id: impl Into + std::fmt::Debug, + ) -> Result { + let audit_info = self + .authz + .enforce_permission( + sub, + CoreDepositObject::all_deposit_accounts(), + CoreDepositAction::DEPOSIT_ACCOUNT_CREATE, + ) + .await?; + + let new_account = NewDepositAccount::builder() + .id(DepositAccountId::new()) + .account_holder_id(holder_id) + .audit_info(audit_info) + .build() + .expect("Could not build new committee"); + + let account = self.accounts.create(new_account).await?; + Ok(account) + } +} diff --git a/core/deposit/src/main.rs b/core/deposit/src/main.rs new file mode 100644 index 000000000..e7a11a969 --- /dev/null +++ b/core/deposit/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs new file mode 100644 index 000000000..164d1df6c --- /dev/null +++ b/core/deposit/src/primitives.rs @@ -0,0 +1,98 @@ +use std::{fmt::Display, str::FromStr}; + +use authz::AllOrOne; +es_entity::entity_id! { AccountHolderId, DepositAccountId } + +pub type DepositAccountAllOrOne = AllOrOne; + +#[derive(Clone, Copy, Debug, PartialEq, strum::EnumDiscriminants)] +#[strum_discriminants(derive(strum::Display, strum::EnumString))] +#[strum_discriminants(strum(serialize_all = "kebab-case"))] +pub enum CoreDepositObject { + DepositAccount(DepositAccountAllOrOne), +} + +impl CoreDepositObject { + pub fn all_deposit_accounts() -> Self { + CoreDepositObject::DepositAccount(AllOrOne::All) + } + + pub fn deposit_account(id: DepositAccountId) -> Self { + CoreDepositObject::DepositAccount(AllOrOne::ById(id)) + } +} + +impl Display for CoreDepositObject { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let discriminant = CoreDepositObjectDiscriminants::from(self); + use CoreDepositObject::*; + match self { + DepositAccount(obj_ref) => write!(f, "{}/{}", discriminant, obj_ref), + } + } +} + +impl FromStr for CoreDepositObject { + type Err = &'static str; + + fn from_str(s: &str) -> Result { + let (entity, id) = s.split_once('/').expect("missing slash"); + use CoreDepositObjectDiscriminants::*; + let res = match entity.parse().expect("invalid entity") { + DepositAccount => { + let obj_ref = id + .parse() + .map_err(|_| "could not parse CoreDepositObject")?; + CoreDepositObject::DepositAccount(obj_ref) + } + }; + Ok(res) + } +} + +#[derive(Clone, Copy, Debug, PartialEq, strum::EnumDiscriminants)] +#[strum_discriminants(derive(strum::Display, strum::EnumString))] +#[strum_discriminants(strum(serialize_all = "kebab-case"))] +pub enum CoreDepositAction { + DepositAccount(DepositAccountAction), +} + +impl CoreDepositAction { + pub const DEPOSIT_ACCOUNT_CREATE: Self = + CoreDepositAction::DepositAccount(DepositAccountAction::Create); +} + +impl Display for CoreDepositAction { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}:", CoreDepositActionDiscriminants::from(self))?; + use CoreDepositAction::*; + match self { + DepositAccount(action) => action.fmt(f), + } + } +} + +impl FromStr for CoreDepositAction { + type Err = strum::ParseError; + + fn from_str(s: &str) -> Result { + let (entity, action) = s.split_once(':').expect("missing colon"); + use CoreDepositActionDiscriminants::*; + let res = match entity.parse()? { + DepositAccount => CoreDepositAction::from(action.parse::()?), + }; + Ok(res) + } +} + +#[derive(PartialEq, Clone, Copy, Debug, strum::Display, strum::EnumString)] +#[strum(serialize_all = "kebab-case")] +pub enum DepositAccountAction { + Create, +} + +impl From for CoreDepositAction { + fn from(action: DepositAccountAction) -> Self { + CoreDepositAction::DepositAccount(action) + } +} diff --git a/lana/app/migrations/20231208110808_cala_ledger_setup.sql b/lana/app/migrations/20231208110808_cala_ledger_setup.sql new file mode 100644 index 000000000..4cf7d1e21 --- /dev/null +++ b/lana/app/migrations/20231208110808_cala_ledger_setup.sql @@ -0,0 +1,254 @@ +CREATE TYPE DebitOrCredit AS ENUM ('debit', 'credit'); +CREATE TYPE Status AS ENUM ('active', 'locked'); +CREATE TYPE Layer AS ENUM ('settled', 'pending', 'encumbrance'); + +CREATE TABLE cala_accounts ( + id UUID PRIMARY KEY, + code VARCHAR UNIQUE NOT NULL, + name VARCHAR NOT NULL, + external_id VARCHAR UNIQUE, + data_source_id UUID NOT NULL, + normal_balance_type DebitOrCredit NOT NULL, -- For quick lookup when querying balances + eventually_consistent BOOLEAN NOT NULL, -- For balance locking + latest_values JSONB NOT NULL, -- Cached for quicker velocity enforcement + created_at TIMESTAMPTZ NOT NULL +); +CREATE INDEX idx_cala_accounts_name ON cala_accounts (name); + +CREATE TABLE cala_account_events ( + id UUID NOT NULL REFERENCES cala_accounts(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence) +); + +CREATE TABLE cala_journals ( + id UUID PRIMARY KEY, + name VARCHAR NOT NULL, + data_source_id UUID NOT NULL, + created_at TIMESTAMPTZ NOT NULL +); +CREATE INDEX idx_cala_journals_name ON cala_journals (name); + +CREATE TABLE cala_journal_events ( + id UUID NOT NULL REFERENCES cala_journals(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL, + UNIQUE(id, sequence) +); + +CREATE TABLE cala_account_sets ( + id UUID PRIMARY KEY REFERENCES cala_accounts(id), + journal_id UUID NOT NULL REFERENCES cala_journals(id), + name VARCHAR NOT NULL, + data_source_id UUID NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); +CREATE INDEX idx_cala_account_sets_name ON cala_account_sets (name); + + +CREATE TABLE cala_account_set_events ( + id UUID NOT NULL REFERENCES cala_account_sets(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence) +); + +CREATE TABLE cala_account_set_member_accounts ( + account_set_id UUID NOT NULL REFERENCES cala_account_sets(id), + member_account_id UUID NOT NULL REFERENCES cala_accounts(id), + transitive BOOLEAN NOT NULL DEFAULT FALSE, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(account_set_id, member_account_id) +); + +CREATE TABLE cala_account_set_member_account_sets ( + account_set_id UUID NOT NULL REFERENCES cala_account_sets(id), + member_account_set_id UUID NOT NULL REFERENCES cala_account_sets(id), + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(account_set_id, member_account_set_id) +); + +CREATE TABLE cala_tx_templates ( + id UUID PRIMARY KEY, + data_source_id UUID NOT NULL, + code VARCHAR NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE TABLE cala_tx_template_events ( + id UUID NOT NULL, + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence), + FOREIGN KEY (id) REFERENCES cala_tx_templates(id) +); + +CREATE TABLE cala_transactions ( + id UUID PRIMARY KEY, + data_source_id UUID NOT NULL, + journal_id UUID NOT NULL, + tx_template_id UUID NOT NULL, + external_id VARCHAR DEFAULT NULL, + correlation_id VARCHAR NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + FOREIGN KEY (journal_id) REFERENCES cala_journals(id), + FOREIGN KEY (tx_template_id) REFERENCES cala_tx_templates(id) +); + +CREATE TABLE cala_transaction_events ( + id UUID NOT NULL REFERENCES cala_transactions(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence) +); + +CREATE TABLE cala_entries ( + id UUID PRIMARY KEY, + journal_id UUID NOT NULL REFERENCES cala_journals(id), + account_id UUID NOT NULL REFERENCES cala_accounts(id), + transaction_id UUID NOT NULL, + data_source_id UUID NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); +CREATE INDEX idx_cala_entries_transaction_id ON cala_entries (transaction_id); + +CREATE TABLE cala_entry_events ( + id UUID NOT NULL REFERENCES cala_entries(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence) +); + +CREATE TABLE cala_current_balances ( + journal_id UUID NOT NULL REFERENCES cala_journals(id), + account_id UUID NOT NULL REFERENCES cala_accounts(id), + currency VARCHAR NOT NULL, + latest_version INT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(journal_id, account_id, currency) +); + +CREATE TABLE cala_balance_history ( + journal_id UUID NOT NULL, + account_id UUID NOT NULL, + latest_entry_id UUID NOT NULL REFERENCES cala_entries(id), + currency VARCHAR NOT NULL, + version INT NOT NULL, + values JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(journal_id, account_id, currency, version), + FOREIGN KEY (journal_id, account_id, currency) REFERENCES cala_current_balances(journal_id, account_id, currency) +); +CREATE INDEX idx_cala_balance_history_recorded_at ON cala_balance_history (recorded_at); + +CREATE TABLE cala_velocity_limits ( + id UUID PRIMARY KEY, + name VARCHAR NOT NULL, + data_source_id UUID NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); +CREATE INDEX idx_cala_velocity_limits_name ON cala_velocity_limits (name); + + +CREATE TABLE cala_velocity_limit_events ( + id UUID NOT NULL REFERENCES cala_velocity_limits(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence) +); + +CREATE TABLE cala_velocity_controls ( + id UUID PRIMARY KEY, + name VARCHAR NOT NULL, + data_source_id UUID NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); +CREATE INDEX idx_cala_velocity_controls_name ON cala_velocity_controls (name); + + +CREATE TABLE cala_velocity_control_events ( + id UUID NOT NULL REFERENCES cala_velocity_controls(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(id, sequence) +); + +CREATE TABLE cala_velocity_control_limits ( + velocity_control_id UUID NOT NULL REFERENCES cala_velocity_controls(id), + velocity_limit_id UUID NOT NULL REFERENCES cala_velocity_limits(id), + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(velocity_control_id, velocity_limit_id) +); + +CREATE TABLE cala_velocity_account_controls ( + account_id UUID NOT NULL REFERENCES cala_accounts(id), + velocity_control_id UUID NOT NULL REFERENCES cala_velocity_controls(id), + values JSONB NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(account_id, velocity_control_id) +); + +CREATE TABLE cala_velocity_current_balances ( + journal_id UUID NOT NULL REFERENCES cala_journals(id), + account_id UUID NOT NULL REFERENCES cala_accounts(id), + currency VARCHAR NOT NULL, + velocity_control_id UUID NOT NULL REFERENCES cala_velocity_controls(id), + velocity_limit_id UUID NOT NULL REFERENCES cala_velocity_limits(id), + partition_window JSONB NOT NULL, + latest_version INT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(partition_window, currency, journal_id, account_id, velocity_limit_id, velocity_control_id) +); + +CREATE TABLE cala_velocity_balance_history ( + journal_id UUID NOT NULL, + account_id UUID NOT NULL, + currency VARCHAR NOT NULL, + velocity_control_id UUID NOT NULL, + velocity_limit_id UUID NOT NULL, + partition_window JSONB NOT NULL, + latest_entry_id UUID NOT NULL REFERENCES cala_entries(id), + version INT NOT NULL, + values JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + UNIQUE(partition_window, currency, journal_id, account_id, velocity_limit_id, velocity_control_id, version), + FOREIGN KEY (partition_window, currency, journal_id, account_id, velocity_limit_id, velocity_control_id) REFERENCES cala_velocity_current_balances(partition_window, currency, journal_id, account_id, velocity_limit_id, velocity_control_id) +); + +CREATE TABLE cala_outbox_events ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + sequence BIGSERIAL UNIQUE, + payload JSONB, + recorded_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + seen_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +CREATE FUNCTION notify_cala_outbox_events() RETURNS TRIGGER AS $$ +DECLARE + payload TEXT; +BEGIN + payload := row_to_json(NEW); + PERFORM pg_notify('cala_outbox_events', payload); + RETURN NULL; +END; +$$ LANGUAGE plpgsql; + +CREATE TRIGGER cala_outbox_events AFTER INSERT ON cala_outbox_events + FOR EACH ROW EXECUTE FUNCTION notify_cala_outbox_events(); diff --git a/lana/app/migrations/20240517074612_core_setup.sql b/lana/app/migrations/20240517074612_core_setup.sql index 5326d9117..2a8995296 100644 --- a/lana/app/migrations/20240517074612_core_setup.sql +++ b/lana/app/migrations/20240517074612_core_setup.sql @@ -46,6 +46,21 @@ CREATE TABLE approval_process_events ( UNIQUE(id, sequence) ); +CREATE TABLE deposit_accounts ( + id UUID PRIMARY KEY, + account_holder_id VARCHAR NOT NULL, + created_at TIMESTAMPTZ NOT NULL +); + +CREATE TABLE deposit_account_events ( + id UUID NOT NULL REFERENCES deposit_accounts(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL, + UNIQUE(id, sequence) +); + CREATE TABLE customers ( id UUID PRIMARY KEY, email VARCHAR NOT NULL UNIQUE, From 44a0b7df79f9d868fad50084fa0e0f4a13691625 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 6 Dec 2024 10:24:07 +0100 Subject: [PATCH 02/24] chore(deposit): deposit entity --- Cargo.lock | 1 + core/deposit/Cargo.toml | 1 + core/deposit/src/deposit/entity.rs | 90 ++++++++++ core/deposit/src/deposit/error.rs | 13 ++ core/deposit/src/deposit/mod.rs | 161 ++++++++++++++++++ core/deposit/src/deposit/repo.rs | 27 +++ core/deposit/src/error.rs | 4 +- core/deposit/src/lib.rs | 39 ++++- core/deposit/src/primitives.rs | 32 +++- .../migrations/20240517074612_core_setup.sql | 16 ++ 10 files changed, 377 insertions(+), 7 deletions(-) create mode 100644 core/deposit/src/deposit/entity.rs create mode 100644 core/deposit/src/deposit/error.rs create mode 100644 core/deposit/src/deposit/mod.rs create mode 100644 core/deposit/src/deposit/repo.rs diff --git a/Cargo.lock b/Cargo.lock index c3d2868f2..d42838fb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1201,6 +1201,7 @@ dependencies = [ "audit", "authz", "cala-ledger", + "chrono", "derive_builder", "es-entity", "outbox", diff --git a/core/deposit/Cargo.toml b/core/deposit/Cargo.toml index ce0ba2601..bca375168 100644 --- a/core/deposit/Cargo.toml +++ b/core/deposit/Cargo.toml @@ -18,6 +18,7 @@ es-entity = { workspace = true } sqlx = { workspace = true } strum = { workspace = true } +chrono = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } diff --git a/core/deposit/src/deposit/entity.rs b/core/deposit/src/deposit/entity.rs new file mode 100644 index 000000000..1cd26ccd7 --- /dev/null +++ b/core/deposit/src/deposit/entity.rs @@ -0,0 +1,90 @@ +use derive_builder::Builder; +use serde::{Deserialize, Serialize}; + +use es_entity::*; + +use audit::AuditInfo; + +use crate::primitives::{DepositAccountId, DepositId}; + +#[derive(EsEvent, Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "type", rename_all = "snake_case")] +#[es_event(id = "DepositId")] +pub enum DepositEvent { + Initialized { + id: DepositId, + deposit_account_id: DepositAccountId, + reference: String, + audit_info: AuditInfo, + }, +} + +#[derive(EsEntity, Builder)] +#[builder(pattern = "owned", build_fn(error = "EsEntityError"))] +pub struct Deposit { + pub id: DepositId, + pub deposit_account_id: DepositAccountId, + pub reference: String, + pub(super) events: EntityEvents, +} + +impl Deposit { + pub fn created_at(&self) -> chrono::DateTime { + self.events + .entity_first_persisted_at() + .expect("No events for deposit") + } +} + +impl TryFromEvents for Deposit { + fn try_from_events(events: EntityEvents) -> Result { + let mut builder = DepositBuilder::default(); + for event in events.iter_all() { + match event { + DepositEvent::Initialized { id, reference, .. } => { + builder = builder.id(*id).reference(reference.clone()); + } + } + } + builder.events(events).build() + } +} + +#[derive(Debug, Builder)] +pub struct NewDeposit { + #[builder(setter(into))] + pub(super) id: DepositId, + #[builder(setter(into))] + pub(super) deposit_account_id: DepositAccountId, + reference: Option, + #[builder(setter(into))] + pub audit_info: AuditInfo, +} + +impl NewDeposit { + pub fn builder() -> NewDepositBuilder { + NewDepositBuilder::default() + } + + pub(super) fn reference(&self) -> String { + match self.reference.as_deref() { + None => self.id.to_string(), + Some("") => self.id.to_string(), + Some(reference) => reference.to_string(), + } + } +} + +impl IntoEvents for NewDeposit { + fn into_events(self) -> EntityEvents { + EntityEvents::init( + self.id, + [DepositEvent::Initialized { + reference: self.reference(), + id: self.id, + deposit_account_id: self.deposit_account_id, + audit_info: self.audit_info, + }], + ) + } +} diff --git a/core/deposit/src/deposit/error.rs b/core/deposit/src/deposit/error.rs new file mode 100644 index 000000000..46a7c3127 --- /dev/null +++ b/core/deposit/src/deposit/error.rs @@ -0,0 +1,13 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum DepositError { + #[error("DepositError - Sqlx: {0}")] + Sqlx(#[from] sqlx::Error), + #[error("DepositError - EsEntityError: {0}")] + EsEntityError(es_entity::EsEntityError), + #[error("DepositError - CursorDestructureError: {0}")] + CursorDestructureError(#[from] es_entity::CursorDestructureError), +} + +es_entity::from_es_entity_error!(DepositError); diff --git a/core/deposit/src/deposit/mod.rs b/core/deposit/src/deposit/mod.rs new file mode 100644 index 000000000..40a72af29 --- /dev/null +++ b/core/deposit/src/deposit/mod.rs @@ -0,0 +1,161 @@ +mod entity; +pub mod error; +mod repo; + +pub(super) use entity::*; +pub(super) use repo::*; +// use authz::PermissionCheck; + +// use crate::{ +// audit::AuditInfo, +// authorization::{Authorization, DepositAction, Object}, +// customer::Customers, +// data_export::Export, +// ledger::Ledger, +// primitives::{CustomerId, DepositId, Subject, UsdCents}, +// }; + +// pub use entity::*; +// use error::DepositError; +// pub use repo::{deposit_cursor::DepositsByCreatedAtCursor, DepositRepo}; + +// #[derive(Clone)] +// pub struct Deposits { +// repo: DepositRepo, +// customers: Customers, +// ledger: Ledger, +// authz: Authorization, +// } + +// impl Deposits { +// pub fn new( +// pool: &sqlx::PgPool, +// customers: &Customers, +// ledger: &Ledger, +// authz: &Authorization, +// export: &Export, +// ) -> Self { +// let repo = DepositRepo::new(pool, export); +// Self { +// repo, +// customers: customers.clone(), +// ledger: ledger.clone(), +// authz: authz.clone(), +// } +// } + +// pub fn repo(&self) -> &DepositRepo { +// &self.repo +// } + +// pub async fn subject_can_record( +// &self, +// sub: &Subject, +// enforce: bool, +// ) -> Result, DepositError> { +// Ok(self +// .authz +// .evaluate_permission(sub, Object::Deposit, DepositAction::Record, enforce) +// .await?) +// } + +// pub async fn record( +// &self, +// sub: &Subject, +// customer_id: impl Into, +// amount: UsdCents, +// reference: Option, +// ) -> Result { +// let audit_info = self +// .subject_can_record(sub, true) +// .await? +// .expect("audit info missing"); + +// let customer_id = customer_id.into(); +// let customer = self.customers.repo().find_by_id(customer_id).await?; +// let new_deposit = NewDeposit::builder() +// .id(DepositId::new()) +// .customer_id(customer_id) +// .amount(amount) +// .reference(reference.clone()) +// .credit_account_id(customer.account_ids.on_balance_sheet_deposit_account_id) +// .audit_info(audit_info) +// .build() +// .expect("Could not build Deposit"); + +// let mut db = self.repo.begin_op().await?; +// let deposit = self.repo.create_in_op(&mut db, new_deposit).await?; + +// self.ledger +// .record_deposit_for_customer( +// deposit.id, +// customer.account_ids, +// amount, +// deposit.reference.clone(), +// ) +// .await?; + +// db.commit().await?; + +// Ok(deposit) +// } + +// pub async fn find_by_id( +// &self, +// sub: &Subject, +// id: impl Into + std::fmt::Debug, +// ) -> Result, DepositError> { +// self.authz +// .enforce_permission(sub, Object::Deposit, DepositAction::Read) +// .await?; + +// match self.repo.find_by_id(id.into()).await { +// Ok(deposit) => Ok(Some(deposit)), +// Err(DepositError::CouldNotFindById(_)) => Ok(None), +// Err(e) => Err(e), +// } +// } + +// #[instrument(name = "deposit.list_for_customer", skip(self))] +// pub async fn list_for_customer( +// &self, +// sub: &Subject, +// customer_id: impl Into + std::fmt::Debug, +// ) -> Result, DepositError> { +// let customer_id = customer_id.into(); +// self.authz +// .enforce_permission(sub, Object::Deposit, DepositAction::List) +// .await?; + +// Ok(self +// .repo +// .list_for_customer_id_by_created_at( +// customer_id, +// Default::default(), +// es_entity::ListDirection::Descending, +// ) +// .await? +// .entities) +// } + +// pub async fn list( +// &self, +// sub: &Subject, +// query: es_entity::PaginatedQueryArgs, +// ) -> Result, DepositError> +// { +// self.authz +// .enforce_permission(sub, Object::Deposit, DepositAction::List) +// .await?; +// self.repo +// .list_by_created_at(query, es_entity::ListDirection::Descending) +// .await +// } + +// pub async fn find_all>( +// &self, +// ids: &[DepositId], +// ) -> Result, DepositError> { +// self.repo.find_all(ids).await +// } +// } diff --git a/core/deposit/src/deposit/repo.rs b/core/deposit/src/deposit/repo.rs new file mode 100644 index 000000000..c042d3fdb --- /dev/null +++ b/core/deposit/src/deposit/repo.rs @@ -0,0 +1,27 @@ +use sqlx::PgPool; + +use es_entity::*; + +use crate::primitives::{DepositAccountId, DepositId}; + +use super::{entity::*, error::*}; + +#[derive(EsRepo, Clone)] +#[es_repo( + entity = "Deposit", + err = "DepositError", + columns( + deposit_account_id(ty = "DepositAccountId", list_for, update(persist = false)), + reference(ty = "String", create(accessor = "reference()")) + ), + tbl_prefix = "core" +)] +pub struct DepositRepo { + pool: PgPool, +} + +impl DepositRepo { + pub fn new(pool: &PgPool) -> Self { + Self { pool: pool.clone() } + } +} diff --git a/core/deposit/src/error.rs b/core/deposit/src/error.rs index 1ffd6b1fb..69d05813a 100644 --- a/core/deposit/src/error.rs +++ b/core/deposit/src/error.rs @@ -6,6 +6,8 @@ pub enum CoreDepositError { Sqlx(#[from] sqlx::Error), #[error("CoreDepositError - AuthorizationError: {0}")] AuthorizationError(#[from] authz::error::AuthorizationError), - #[error("CoreDepositError - CommitteeError: {0}")] + #[error("CoreDepositError - DepositAccountError: {0}")] DepositAccountError(#[from] crate::account::error::DepositAccountError), + #[error("CoreDepositError - DepositError: {0}")] + DepositError(#[from] crate::deposit::error::DepositError), } diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index dd2e4c6ac..ebac40117 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -2,6 +2,7 @@ #![cfg_attr(feature = "fail-on-warnings", deny(clippy::all))] mod account; +mod deposit; pub mod error; mod event; mod primitives; @@ -13,21 +14,18 @@ use authz::PermissionCheck; use outbox::{Outbox, OutboxEventMarker}; use account::*; +use deposit::*; use error::*; pub use event::*; pub use primitives::*; -// account -// deposit -// -// customer - pub struct CoreDeposit where Perms: PermissionCheck, E: OutboxEventMarker, { accounts: DepositAccountRepo, + deposits: DepositRepo, authz: Perms, outbox: Outbox, } @@ -40,6 +38,7 @@ where fn clone(&self) -> Self { Self { accounts: self.accounts.clone(), + deposits: self.deposits.clone(), authz: self.authz.clone(), outbox: self.outbox.clone(), } @@ -59,8 +58,10 @@ where outbox: &Outbox, ) -> Result { let accounts = DepositAccountRepo::new(pool); + let deposits = DepositRepo::new(pool); let res = Self { accounts, + deposits, authz: authz.clone(), outbox: outbox.clone(), }; @@ -92,4 +93,32 @@ where let account = self.accounts.create(new_account).await?; Ok(account) } + + pub async fn record_deposit( + &self, + sub: &<::Audit as AuditSvc>::Subject, + deposit_account_id: DepositAccountId, + // amount: UsdCents, + reference: Option, + ) -> Result { + let audit_info = self + .authz + .enforce_permission( + sub, + CoreDepositObject::all_deposits(), + CoreDepositAction::DEPOSIT_CREATE, + ) + .await?; + + let new_deposit = NewDeposit::builder() + .id(DepositId::new()) + .deposit_account_id(deposit_account_id) + .reference(reference) + .audit_info(audit_info) + .build() + .expect("Could not build new committee"); + + let deposit = self.deposits.create(new_deposit).await?; + Ok(deposit) + } } diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index 164d1df6c..ef77da4d0 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -1,15 +1,17 @@ use std::{fmt::Display, str::FromStr}; use authz::AllOrOne; -es_entity::entity_id! { AccountHolderId, DepositAccountId } +es_entity::entity_id! { AccountHolderId, DepositAccountId, DepositId } pub type DepositAccountAllOrOne = AllOrOne; +pub type DepositAllOrOne = AllOrOne; #[derive(Clone, Copy, Debug, PartialEq, strum::EnumDiscriminants)] #[strum_discriminants(derive(strum::Display, strum::EnumString))] #[strum_discriminants(strum(serialize_all = "kebab-case"))] pub enum CoreDepositObject { DepositAccount(DepositAccountAllOrOne), + Deposit(DepositAllOrOne), } impl CoreDepositObject { @@ -17,6 +19,10 @@ impl CoreDepositObject { CoreDepositObject::DepositAccount(AllOrOne::All) } + pub fn all_deposits() -> Self { + CoreDepositObject::Deposit(AllOrOne::All) + } + pub fn deposit_account(id: DepositAccountId) -> Self { CoreDepositObject::DepositAccount(AllOrOne::ById(id)) } @@ -28,6 +34,7 @@ impl Display for CoreDepositObject { use CoreDepositObject::*; match self { DepositAccount(obj_ref) => write!(f, "{}/{}", discriminant, obj_ref), + Deposit(obj_ref) => write!(f, "{}/{}", discriminant, obj_ref), } } } @@ -45,6 +52,12 @@ impl FromStr for CoreDepositObject { .map_err(|_| "could not parse CoreDepositObject")?; CoreDepositObject::DepositAccount(obj_ref) } + Deposit => { + let obj_ref = id + .parse() + .map_err(|_| "could not parse CoreDepositObject")?; + CoreDepositObject::Deposit(obj_ref) + } }; Ok(res) } @@ -55,11 +68,14 @@ impl FromStr for CoreDepositObject { #[strum_discriminants(strum(serialize_all = "kebab-case"))] pub enum CoreDepositAction { DepositAccount(DepositAccountAction), + Deposit(DepositAction), } impl CoreDepositAction { pub const DEPOSIT_ACCOUNT_CREATE: Self = CoreDepositAction::DepositAccount(DepositAccountAction::Create); + + pub const DEPOSIT_CREATE: Self = CoreDepositAction::Deposit(DepositAction::Create); } impl Display for CoreDepositAction { @@ -68,6 +84,7 @@ impl Display for CoreDepositAction { use CoreDepositAction::*; match self { DepositAccount(action) => action.fmt(f), + Deposit(action) => action.fmt(f), } } } @@ -80,6 +97,7 @@ impl FromStr for CoreDepositAction { use CoreDepositActionDiscriminants::*; let res = match entity.parse()? { DepositAccount => CoreDepositAction::from(action.parse::()?), + Deposit => CoreDepositAction::from(action.parse::()?), }; Ok(res) } @@ -96,3 +114,15 @@ impl From for CoreDepositAction { CoreDepositAction::DepositAccount(action) } } + +#[derive(PartialEq, Clone, Copy, Debug, strum::Display, strum::EnumString)] +#[strum(serialize_all = "kebab-case")] +pub enum DepositAction { + Create, +} + +impl From for CoreDepositAction { + fn from(action: DepositAction) -> Self { + CoreDepositAction::Deposit(action) + } +} diff --git a/lana/app/migrations/20240517074612_core_setup.sql b/lana/app/migrations/20240517074612_core_setup.sql index 2a8995296..aab87a1de 100644 --- a/lana/app/migrations/20240517074612_core_setup.sql +++ b/lana/app/migrations/20240517074612_core_setup.sql @@ -61,6 +61,22 @@ CREATE TABLE deposit_account_events ( UNIQUE(id, sequence) ); +CREATE TABLE core_deposits ( + id UUID PRIMARY KEY, + deposit_account_id UUID NOT NULL REFERENCES deposit_accounts(id), + reference VARCHAR NOT NULL UNIQUE, + created_at TIMESTAMPTZ NOT NULL +); + +CREATE TABLE core_deposit_events ( + id UUID NOT NULL REFERENCES core_deposits(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL, + UNIQUE(id, sequence) +); + CREATE TABLE customers ( id UUID PRIMARY KEY, email VARCHAR NOT NULL UNIQUE, From 28c3711cdd50ee02cf9a494cb057c94143df706c Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 6 Dec 2024 11:11:01 +0100 Subject: [PATCH 03/24] test: dummy perms wip --- Cargo.lock | 2 + core/deposit/Cargo.toml | 5 ++ core/deposit/tests/deposit.rs | 15 ++++++ lib/authz/Cargo.toml | 1 + lib/authz/src/dummy.rs | 95 +++++++++++++++++++++++++++++++++++ lib/authz/src/lib.rs | 2 + 6 files changed, 120 insertions(+) create mode 100644 core/deposit/tests/deposit.rs create mode 100644 lib/authz/src/dummy.rs diff --git a/Cargo.lock b/Cargo.lock index d42838fb9..b993bb4ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1198,6 +1198,7 @@ checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" name = "deposit" version = "0.1.0" dependencies = [ + "anyhow", "audit", "authz", "cala-ledger", @@ -1209,6 +1210,7 @@ dependencies = [ "sqlx", "strum", "thiserror", + "tokio", "tracing", ] diff --git a/core/deposit/Cargo.toml b/core/deposit/Cargo.toml index bca375168..bff709750 100644 --- a/core/deposit/Cargo.toml +++ b/core/deposit/Cargo.toml @@ -23,3 +23,8 @@ serde = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } derive_builder = { workspace = true } + +[dev-dependencies] +tokio = { workspace = true } +anyhow = { workspace = true } +authz = { path = "../../lib/authz", features = ["test-dummy"] } diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs new file mode 100644 index 000000000..727f39fea --- /dev/null +++ b/core/deposit/tests/deposit.rs @@ -0,0 +1,15 @@ +use deposit::*; + +pub async fn init_pool() -> anyhow::Result { + let pg_host = std::env::var("PG_HOST").unwrap_or("localhost".to_string()); + let pg_con = format!("postgres://user:password@{pg_host}:5433/pg"); + let pool = sqlx::PgPool::connect(&pg_con).await?; + Ok(pool) +} + +#[tokio::test] +async fn deposit() -> anyhow::Result<()> { + let pool = init_pool().await?; + // let deposit = CoreDeposit::init(&pool).await?; + Ok(()) +} diff --git a/lib/authz/Cargo.toml b/lib/authz/Cargo.toml index 243e5e6d3..3f6cf595a 100644 --- a/lib/authz/Cargo.toml +++ b/lib/authz/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [features] fail-on-warnings = [] +test-dummy = [] [dependencies] audit = { path = "../audit" } diff --git a/lib/authz/src/dummy.rs b/lib/authz/src/dummy.rs new file mode 100644 index 000000000..ca7d8aef8 --- /dev/null +++ b/lib/authz/src/dummy.rs @@ -0,0 +1,95 @@ +use async_trait::async_trait; + +use std::fmt; + +use audit::{AuditInfo, AuditSvc}; + +use crate::{error::AuthorizationError, PermissionCheck}; + +#[derive(Clone)] +pub struct DummyAudit; +#[derive(Clone)] +pub struct DummyPerms { + audit: DummyAudit, +} +#[derive(Debug, Clone, Copy)] +pub struct DummyItem; +impl audit::SystemSubject for DummyItem { + fn system() -> Self { + DummyItem + } +} + +impl fmt::Display for DummyItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "item") + } +} + +impl std::str::FromStr for DummyItem { + type Err = std::convert::Infallible; + + fn from_str(_: &str) -> Result { + Ok(DummyItem) + } +} + +#[async_trait] +impl AuditSvc for DummyAudit { + type Subject = DummyItem; + type Object = DummyItem; + type Action = DummyItem; + + fn pool(&self) -> &sqlx::PgPool { + unimplemented!() + } + + async fn record_entry( + &self, + _subject: &Self::Subject, + _object: impl Into + Send, + _action: impl Into + Send, + _authorized: bool, + ) -> Result { + Ok(dummy_audit_info()) + } +} + +fn dummy_audit_info() -> audit::AuditInfo { + AuditInfo { + audit_entry_id: audit::AuditEntryId::from(1), + sub: "sub".to_string(), + } +} + +#[async_trait] +impl PermissionCheck for DummyPerms { + type Audit = DummyAudit; + + fn audit(&self) -> &Self::Audit { + &self.audit + } + + async fn enforce_permission( + &self, + _sub: &::Subject, + _object: impl Into<::Object> + std::fmt::Debug + Send, + _action: impl Into<::Action> + std::fmt::Debug + Send, + ) -> Result { + Ok(dummy_audit_info()) + } + + async fn evaluate_permission( + &self, + _sub: &::Subject, + _object: impl Into<::Object> + std::fmt::Debug + Send, + _action: impl Into<::Action> + std::fmt::Debug + Send, + enforce: bool, + ) -> Result, AuthorizationError> { + if enforce { + Ok(Some(dummy_audit_info())) + } else { + Ok(None) + } + } +} diff --git a/lib/authz/src/lib.rs b/lib/authz/src/lib.rs index a3a5d3e8f..af065c149 100644 --- a/lib/authz/src/lib.rs +++ b/lib/authz/src/lib.rs @@ -1,5 +1,7 @@ mod all_or_one; mod check_trait; +#[cfg(feature = "test-dummy")] +mod dummy; pub mod error; use async_trait::async_trait; From 0b3cb8f4dc5b5406846fdb5bc1fd43105f0b6fe7 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 6 Dec 2024 15:58:14 +0100 Subject: [PATCH 04/24] test: use DummyPerms in deposit test --- Cargo.lock | 1 + core/deposit/tests/deposit.rs | 4 +- lib/authz/Cargo.toml | 4 +- lib/authz/src/dummy.rs | 99 +++++++++++++++++++++++++++++------ lib/authz/src/lib.rs | 2 +- lib/outbox/src/event.rs | 8 +++ 6 files changed, 98 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b993bb4ae..865714206 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -349,6 +349,7 @@ dependencies = [ "anyhow", "async-trait", "audit", + "es-entity", "sqlx", "sqlx-adapter", "strum", diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs index 727f39fea..d0d861802 100644 --- a/core/deposit/tests/deposit.rs +++ b/core/deposit/tests/deposit.rs @@ -10,6 +10,8 @@ pub async fn init_pool() -> anyhow::Result { #[tokio::test] async fn deposit() -> anyhow::Result<()> { let pool = init_pool().await?; - // let deposit = CoreDeposit::init(&pool).await?; + let outbox = outbox::Outbox::::init(&pool).await?; + let authz = authz::dummy::DummyPerms::::new(); + let _deposit = CoreDeposit::init(&pool, &authz, &outbox).await?; Ok(()) } diff --git a/lib/authz/Cargo.toml b/lib/authz/Cargo.toml index 3f6cf595a..730a64b78 100644 --- a/lib/authz/Cargo.toml +++ b/lib/authz/Cargo.toml @@ -6,11 +6,13 @@ edition = "2021" [features] fail-on-warnings = [] -test-dummy = [] +test-dummy = [ "dep:es-entity" ] [dependencies] audit = { path = "../audit" } +es-entity = { workspace = true, optional = true } + sqlx-adapter = { version = "1.6.0", default-features = false, features = ["postgres", "runtime-tokio-rustls"]} async-trait = { workspace = true } diff --git a/lib/authz/src/dummy.rs b/lib/authz/src/dummy.rs index ca7d8aef8..1101f062e 100644 --- a/lib/authz/src/dummy.rs +++ b/lib/authz/src/dummy.rs @@ -2,57 +2,118 @@ use async_trait::async_trait; use std::fmt; -use audit::{AuditInfo, AuditSvc}; +use audit::{error::AuditError, AuditCursor, AuditEntry, AuditInfo, AuditSvc}; use crate::{error::AuthorizationError, PermissionCheck}; #[derive(Clone)] -pub struct DummyAudit; +pub struct DummyAudit { + _phantom: std::marker::PhantomData<(A, O)>, +} #[derive(Clone)] -pub struct DummyPerms { - audit: DummyAudit, +pub struct DummyPerms { + audit: DummyAudit, +} +impl DummyPerms { + pub fn new() -> Self { + Self { + audit: DummyAudit { + _phantom: std::marker::PhantomData, + }, + } + } } + #[derive(Debug, Clone, Copy)] -pub struct DummyItem; -impl audit::SystemSubject for DummyItem { +pub struct DummySubject; +impl audit::SystemSubject for DummySubject { fn system() -> Self { - DummyItem + DummySubject } } -impl fmt::Display for DummyItem { +impl fmt::Display for DummySubject { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "item") } } -impl std::str::FromStr for DummyItem { +impl std::str::FromStr for DummySubject { type Err = std::convert::Infallible; fn from_str(_: &str) -> Result { - Ok(DummyItem) + Ok(DummySubject) } } #[async_trait] -impl AuditSvc for DummyAudit { - type Subject = DummyItem; - type Object = DummyItem; - type Action = DummyItem; +impl AuditSvc for DummyAudit +where + A: std::str::FromStr + std::fmt::Display + std::fmt::Debug + Copy + Send + Sync, + O: std::str::FromStr + std::fmt::Display + std::fmt::Debug + Copy + Send + Sync, +{ + type Subject = DummySubject; + type Object = O; + type Action = A; fn pool(&self) -> &sqlx::PgPool { unimplemented!() } + async fn record_system_entry( + &self, + _object: impl Into + Send, + _action: impl Into + Send, + ) -> Result { + Ok(dummy_audit_info()) + } + async fn record_entry( &self, _subject: &Self::Subject, _object: impl Into + Send, _action: impl Into + Send, _authorized: bool, - ) -> Result { + ) -> Result { + Ok(dummy_audit_info()) + } + + async fn record_system_entry_in_tx( + &self, + _tx: &mut sqlx::Transaction<'_, sqlx::Postgres>, + _object: impl Into + Send, + _action: impl Into + Send, + ) -> Result { + Ok(dummy_audit_info()) + } + + async fn record_entry_in_tx( + &self, + _tx: &mut sqlx::Transaction<'_, sqlx::Postgres>, + _subject: &Self::Subject, + _object: impl Into + Send, + _action: impl Into + Send, + _authorized: bool, + ) -> Result { Ok(dummy_audit_info()) } + + async fn list( + &self, + _query: es_entity::PaginatedQueryArgs, + ) -> Result< + es_entity::PaginatedQueryRet< + AuditEntry, + AuditCursor, + >, + AuditError, + > { + Ok(es_entity::PaginatedQueryRet { + entities: vec![], + has_next_page: false, + end_cursor: None, + }) + } } fn dummy_audit_info() -> audit::AuditInfo { @@ -63,8 +124,12 @@ fn dummy_audit_info() -> audit::AuditInfo { } #[async_trait] -impl PermissionCheck for DummyPerms { - type Audit = DummyAudit; +impl PermissionCheck for DummyPerms +where + A: std::str::FromStr + std::fmt::Display + std::fmt::Debug + Copy + Clone + Send + Sync, + O: std::str::FromStr + std::fmt::Display + std::fmt::Debug + Copy + Clone + Send + Sync, +{ + type Audit = DummyAudit; fn audit(&self) -> &Self::Audit { &self.audit diff --git a/lib/authz/src/lib.rs b/lib/authz/src/lib.rs index af065c149..fe88e4b11 100644 --- a/lib/authz/src/lib.rs +++ b/lib/authz/src/lib.rs @@ -1,7 +1,7 @@ mod all_or_one; mod check_trait; #[cfg(feature = "test-dummy")] -mod dummy; +pub mod dummy; pub mod error; use async_trait::async_trait; diff --git a/lib/outbox/src/event.rs b/lib/outbox/src/event.rs index 3c0bfb30c..a50876fbd 100644 --- a/lib/outbox/src/event.rs +++ b/lib/outbox/src/event.rs @@ -9,6 +9,14 @@ pub trait OutboxEventMarker: { fn as_event(&self) -> Option<&E>; } +impl OutboxEventMarker for T +where + T: serde::de::DeserializeOwned + serde::Serialize + Send + Sync + 'static + Unpin + From, +{ + fn as_event(&self) -> Option<&T> { + Some(self) + } +} pub enum OutboxEvent

where From cc672d5077baedde3dd3ad219c760eda9e09e5b2 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 6 Dec 2024 16:10:57 +0100 Subject: [PATCH 05/24] test: account -> balance integration --- core/deposit/src/deposit/entity.rs | 12 ++++++++++-- core/deposit/src/lib.rs | 20 ++++++++++++++++++++ core/deposit/src/primitives.rs | 12 ++++++++---- core/deposit/tests/deposit.rs | 11 ++++++++++- 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/core/deposit/src/deposit/entity.rs b/core/deposit/src/deposit/entity.rs index 1cd26ccd7..358e62db8 100644 --- a/core/deposit/src/deposit/entity.rs +++ b/core/deposit/src/deposit/entity.rs @@ -41,8 +41,16 @@ impl TryFromEvents for Deposit { let mut builder = DepositBuilder::default(); for event in events.iter_all() { match event { - DepositEvent::Initialized { id, reference, .. } => { - builder = builder.id(*id).reference(reference.clone()); + DepositEvent::Initialized { + id, + reference, + deposit_account_id, + .. + } => { + builder = builder + .id(*id) + .deposit_account_id(*deposit_account_id) + .reference(reference.clone()); } } } diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index ebac40117..734799009 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -94,6 +94,7 @@ where Ok(account) } + #[instrument(name = "deposit.record_deposit", skip(self))] pub async fn record_deposit( &self, sub: &<::Audit as AuditSvc>::Subject, @@ -121,4 +122,23 @@ where let deposit = self.deposits.create(new_deposit).await?; Ok(deposit) } + + pub async fn balance( + &self, + sub: &<::Audit as AuditSvc>::Subject, + account_id: DepositAccountId, + ) -> Result<(), CoreDepositError> { + let _ = self + .authz + .enforce_permission( + sub, + CoreDepositObject::deposit_account(account_id), + CoreDepositAction::DEPOSIT_ACCOUNT_READ_BALANCE, + ) + .await?; + + // let balance = self.accounts.balance(account_id).await?; + // Ok(balance) + Ok(()) + } } diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index ef77da4d0..529007e59 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -19,13 +19,13 @@ impl CoreDepositObject { CoreDepositObject::DepositAccount(AllOrOne::All) } - pub fn all_deposits() -> Self { - CoreDepositObject::Deposit(AllOrOne::All) - } - pub fn deposit_account(id: DepositAccountId) -> Self { CoreDepositObject::DepositAccount(AllOrOne::ById(id)) } + + pub fn all_deposits() -> Self { + CoreDepositObject::Deposit(AllOrOne::All) + } } impl Display for CoreDepositObject { @@ -75,6 +75,9 @@ impl CoreDepositAction { pub const DEPOSIT_ACCOUNT_CREATE: Self = CoreDepositAction::DepositAccount(DepositAccountAction::Create); + pub const DEPOSIT_ACCOUNT_READ_BALANCE: Self = + CoreDepositAction::DepositAccount(DepositAccountAction::ReadBalance); + pub const DEPOSIT_CREATE: Self = CoreDepositAction::Deposit(DepositAction::Create); } @@ -107,6 +110,7 @@ impl FromStr for CoreDepositAction { #[strum(serialize_all = "kebab-case")] pub enum DepositAccountAction { Create, + ReadBalance, } impl From for CoreDepositAction { diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs index d0d861802..2973c562f 100644 --- a/core/deposit/tests/deposit.rs +++ b/core/deposit/tests/deposit.rs @@ -1,3 +1,4 @@ +use authz::dummy::DummySubject; use deposit::*; pub async fn init_pool() -> anyhow::Result { @@ -12,6 +13,14 @@ async fn deposit() -> anyhow::Result<()> { let pool = init_pool().await?; let outbox = outbox::Outbox::::init(&pool).await?; let authz = authz::dummy::DummyPerms::::new(); - let _deposit = CoreDeposit::init(&pool, &authz, &outbox).await?; + let deposit = CoreDeposit::init(&pool, &authz, &outbox).await?; + let account_holder_id = AccountHolderId::new(); + let account = deposit + .create_account(&DummySubject, account_holder_id) + .await?; + deposit + .record_deposit(&DummySubject, account.id, None) + .await?; + let _ = deposit.balance(&DummySubject, account.id).await?; Ok(()) } From 3ea25956a10717cae3db40e821cc62690463e1e4 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 6 Dec 2024 16:45:10 +0100 Subject: [PATCH 06/24] chore(deposit): add DepositLedger --- Cargo.lock | 48 +++++++++++++----------------- Cargo.toml | 9 ++++-- core/deposit/src/account/entity.rs | 2 ++ core/deposit/src/error.rs | 2 ++ core/deposit/src/ledger/error.rs | 11 +++++++ core/deposit/src/ledger/mod.rs | 41 +++++++++++++++++++++++++ core/deposit/src/lib.rs | 17 +++++++++-- core/deposit/src/primitives.rs | 11 ++++++- core/deposit/tests/deposit.rs | 8 ++++- 9 files changed, 114 insertions(+), 35 deletions(-) create mode 100644 core/deposit/src/ledger/error.rs create mode 100644 core/deposit/src/ledger/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 865714206..fec65b702 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -711,11 +711,10 @@ dependencies = [ [[package]] name = "cala-cel-interpreter" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb633ce00ca7246885b17091a95228169d2fa3be4d48d1392f87974f3d42f8c9" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ - "cala-cel-parser 0.3.1", + "cala-cel-parser 0.3.2-dev", "chrono", "lazy_static", "rust_decimal", @@ -737,9 +736,8 @@ dependencies = [ [[package]] name = "cala-cel-parser" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8fd69da0ccc13cc45cf6086f01792816562eb646d00e892a241d3c909ac959e" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ "lalrpop", "lalrpop-util", @@ -747,13 +745,12 @@ dependencies = [ [[package]] name = "cala-ledger" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0bdc7e8b6436920b49f0e3b0464d00ffcceb9ffc4405516e1e95d8938c9b993" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ "cached 0.51.4", - "cala-cel-interpreter 0.3.1", - "cala-ledger-core-types 0.3.1", + "cala-cel-interpreter 0.3.2-dev", + "cala-ledger-core-types 0.3.2-dev", "cala-tracing", "chrono", "derive_builder", @@ -798,11 +795,10 @@ dependencies = [ [[package]] name = "cala-ledger-core-types" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8fb08fd15c491fb2ed2cab45c19ef85946ce7d89ecb5c0e510a4e20d2462f7" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ - "cala-cel-interpreter 0.3.1", + "cala-cel-interpreter 0.3.2-dev", "chrono", "derive_builder", "rust_decimal", @@ -816,9 +812,8 @@ dependencies = [ [[package]] name = "cala-tracing" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54925107e2dcf62b5ef688804c98eb0f459bf3f0e8e460548a61d42396394516" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ "anyhow", "axum-extra", @@ -1384,9 +1379,8 @@ dependencies = [ [[package]] name = "es-entity" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af9a48b924f08bdeba3e50bc6a14ca7ff8ca94abb42f6b35157a420c71551452" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ "async-graphql", "async-trait", @@ -1404,9 +1398,8 @@ dependencies = [ [[package]] name = "es-entity-macros" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f06294b7c85dc3c31d390460fe17f8aa97723400186dff68fe43782e6df0f5c9" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ "convert_case", "darling", @@ -4167,9 +4160,8 @@ dependencies = [ [[package]] name = "sim-time" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb970973aa489a7bc2d6b81da17eef2e45a8d5abf2d185284782ee1bbbfd6bdf" +version = "0.3.2-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" dependencies = [ "chrono", "serde", diff --git a/Cargo.toml b/Cargo.toml index 8c3a838cf..6e4ec4722 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,9 +23,12 @@ members = [ ] [workspace.dependencies] -es-entity = "0.3.1" -sim-time = "0.3.1" -cala-ledger = "0.3.1" +es-entity = { git = "https://github.com/galoymoney/cala.git", branch = "main" } +sim-time = { git = "https://github.com/galoymoney/cala.git", branch = "main" } +cala-ledger = { git = "https://github.com/galoymoney/cala.git", branch = "main" } +# es-entity = "0.3.1" +# sim-time = "0.3.1" +# cala-ledger = "0.3.1" anyhow = "1.0.92" async-graphql = { version = "7.0.11", default-features = false, features = ["dataloader", "tracing", "chrono", "playground"] } diff --git a/core/deposit/src/account/entity.rs b/core/deposit/src/account/entity.rs index b93241cdc..beded7b7a 100644 --- a/core/deposit/src/account/entity.rs +++ b/core/deposit/src/account/entity.rs @@ -14,6 +14,7 @@ pub enum DepositAccountEvent { Initialized { id: DepositAccountId, account_holder_id: AccountHolderId, + ledger_account_id: LedgerAccountId, audit_info: AuditInfo, }, } @@ -60,6 +61,7 @@ impl IntoEvents for NewDepositAccount { [DepositAccountEvent::Initialized { id: self.id, account_holder_id: self.account_holder_id, + ledger_account_id: self.id.into(), audit_info: self.audit_info, }], ) diff --git a/core/deposit/src/error.rs b/core/deposit/src/error.rs index 69d05813a..dc989b594 100644 --- a/core/deposit/src/error.rs +++ b/core/deposit/src/error.rs @@ -10,4 +10,6 @@ pub enum CoreDepositError { DepositAccountError(#[from] crate::account::error::DepositAccountError), #[error("CoreDepositError - DepositError: {0}")] DepositError(#[from] crate::deposit::error::DepositError), + #[error("CoreDepositError - DepositLedgerError: {0}")] + DepositLedgerError(#[from] crate::ledger::error::DepositLedgerError), } diff --git a/core/deposit/src/ledger/error.rs b/core/deposit/src/ledger/error.rs new file mode 100644 index 000000000..17334fdf1 --- /dev/null +++ b/core/deposit/src/ledger/error.rs @@ -0,0 +1,11 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum DepositLedgerError { + #[error("DepositLedgerError - Sqlx: {0}")] + Sqlx(#[from] sqlx::Error), + #[error("DepositLedgerError - CalaLedger: {0}")] + CalaLedger(#[from] cala_ledger::error::LedgerError), + #[error("DepositLedgerError - CalaLedger: {0}")] + CalaAccount(#[from] cala_ledger::account::error::AccountError), +} diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs new file mode 100644 index 000000000..cff71b7dc --- /dev/null +++ b/core/deposit/src/ledger/mod.rs @@ -0,0 +1,41 @@ +pub mod error; + +use cala_ledger::{account::*, CalaLedger}; + +use error::*; + +#[derive(Clone)] +pub struct DepositLedger { + cala: CalaLedger, +} + +impl DepositLedger { + pub async fn init(cala: &CalaLedger) -> Result { + Ok(Self { cala: cala.clone() }) + } + + pub async fn create_account_for_deposit_account( + &self, + op: es_entity::DbOp<'_>, + id: impl Into, + code: String, + ) -> Result<(), DepositLedgerError> { + let mut op = self.cala.ledger_operation_from_db_op(op); + + let new_account = NewAccount::builder() + .id(id) + .name("Deposit Account") + .code(code) + .build() + .expect("Could not build new account"); + + self.cala + .accounts() + .create_in_op(&mut op, new_account) + .await?; + + op.commit().await?; + + Ok(()) + } +} diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index 734799009..d1b9dc7d5 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -5,18 +5,21 @@ mod account; mod deposit; pub mod error; mod event; +mod ledger; mod primitives; use tracing::instrument; use audit::AuditSvc; use authz::PermissionCheck; +use cala_ledger::CalaLedger; use outbox::{Outbox, OutboxEventMarker}; use account::*; use deposit::*; use error::*; pub use event::*; +use ledger::*; pub use primitives::*; pub struct CoreDeposit @@ -26,6 +29,7 @@ where { accounts: DepositAccountRepo, deposits: DepositRepo, + ledger: DepositLedger, authz: Perms, outbox: Outbox, } @@ -39,6 +43,7 @@ where Self { accounts: self.accounts.clone(), deposits: self.deposits.clone(), + ledger: self.ledger.clone(), authz: self.authz.clone(), outbox: self.outbox.clone(), } @@ -56,14 +61,17 @@ where pool: &sqlx::PgPool, authz: &Perms, outbox: &Outbox, + cala: &CalaLedger, ) -> Result { let accounts = DepositAccountRepo::new(pool); let deposits = DepositRepo::new(pool); + let ledger = DepositLedger::init(cala).await?; let res = Self { accounts, deposits, authz: authz.clone(), outbox: outbox.clone(), + ledger, }; Ok(res) } @@ -83,14 +91,19 @@ where ) .await?; + let account_id = DepositAccountId::new(); let new_account = NewDepositAccount::builder() - .id(DepositAccountId::new()) + .id(account_id) .account_holder_id(holder_id) .audit_info(audit_info) .build() .expect("Could not build new committee"); - let account = self.accounts.create(new_account).await?; + let mut op = self.accounts.begin_op().await?; + let account = self.accounts.create_in_op(&mut op, new_account).await?; + self.ledger + .create_account_for_deposit_account(op, account_id, account_id.to_string()) + .await?; Ok(account) } diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index 529007e59..adf85229c 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -1,7 +1,16 @@ use std::{fmt::Display, str::FromStr}; use authz::AllOrOne; -es_entity::entity_id! { AccountHolderId, DepositAccountId, DepositId } + +pub use cala_ledger::primitives::AccountId as LedgerAccountId; + +es_entity::entity_id! { + AccountHolderId, + DepositAccountId, + DepositId; + + DepositAccountId => LedgerAccountId +} pub type DepositAccountAllOrOne = AllOrOne; pub type DepositAllOrOne = AllOrOne; diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs index 2973c562f..88ea69627 100644 --- a/core/deposit/tests/deposit.rs +++ b/core/deposit/tests/deposit.rs @@ -1,4 +1,5 @@ use authz::dummy::DummySubject; +use cala_ledger::{CalaLedger, CalaLedgerConfig}; use deposit::*; pub async fn init_pool() -> anyhow::Result { @@ -13,7 +14,12 @@ async fn deposit() -> anyhow::Result<()> { let pool = init_pool().await?; let outbox = outbox::Outbox::::init(&pool).await?; let authz = authz::dummy::DummyPerms::::new(); - let deposit = CoreDeposit::init(&pool, &authz, &outbox).await?; + let cala_config = CalaLedgerConfig::builder() + .pool(pool.clone()) + .exec_migrations(false) + .build()?; + let cala = CalaLedger::init(cala_config).await?; + let deposit = CoreDeposit::init(&pool, &authz, &outbox, &cala).await?; let account_holder_id = AccountHolderId::new(); let account = deposit .create_account(&DummySubject, account_holder_id) From 7047508bb128d138d6db7778287fe8b2a7999584 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Mon, 9 Dec 2024 10:31:15 +0100 Subject: [PATCH 07/24] chore: record_deposit template --- Cargo.lock | 41 +++---- core/deposit/Cargo.toml | 1 + core/deposit/src/ledger/error.rs | 4 +- core/deposit/src/ledger/mod.rs | 2 + core/deposit/src/ledger/templates/mod.rs | 3 + .../src/ledger/templates/record_deposit.rs | 106 ++++++++++++++++++ 6 files changed, 136 insertions(+), 21 deletions(-) create mode 100644 core/deposit/src/ledger/templates/mod.rs create mode 100644 core/deposit/src/ledger/templates/record_deposit.rs diff --git a/Cargo.lock b/Cargo.lock index fec65b702..c30e4b62c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -711,10 +711,10 @@ dependencies = [ [[package]] name = "cala-cel-interpreter" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ - "cala-cel-parser 0.3.2-dev", + "cala-cel-parser 0.3.3-dev", "chrono", "lazy_static", "rust_decimal", @@ -736,8 +736,8 @@ dependencies = [ [[package]] name = "cala-cel-parser" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ "lalrpop", "lalrpop-util", @@ -745,12 +745,12 @@ dependencies = [ [[package]] name = "cala-ledger" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ "cached 0.51.4", - "cala-cel-interpreter 0.3.2-dev", - "cala-ledger-core-types 0.3.2-dev", + "cala-cel-interpreter 0.3.3-dev", + "cala-ledger-core-types 0.3.3-dev", "cala-tracing", "chrono", "derive_builder", @@ -795,10 +795,10 @@ dependencies = [ [[package]] name = "cala-ledger-core-types" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ - "cala-cel-interpreter 0.3.2-dev", + "cala-cel-interpreter 0.3.3-dev", "chrono", "derive_builder", "rust_decimal", @@ -812,8 +812,8 @@ dependencies = [ [[package]] name = "cala-tracing" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ "anyhow", "axum-extra", @@ -1202,6 +1202,7 @@ dependencies = [ "derive_builder", "es-entity", "outbox", + "rust_decimal", "serde", "sqlx", "strum", @@ -1379,8 +1380,8 @@ dependencies = [ [[package]] name = "es-entity" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ "async-graphql", "async-trait", @@ -1398,8 +1399,8 @@ dependencies = [ [[package]] name = "es-entity-macros" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ "convert_case", "darling", @@ -4160,8 +4161,8 @@ dependencies = [ [[package]] name = "sim-time" -version = "0.3.2-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#528da8898a9b763c3a513c4eb46e31b03f6e0d4d" +version = "0.3.3-dev" +source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" dependencies = [ "chrono", "serde", diff --git a/core/deposit/Cargo.toml b/core/deposit/Cargo.toml index bff709750..9392cb984 100644 --- a/core/deposit/Cargo.toml +++ b/core/deposit/Cargo.toml @@ -23,6 +23,7 @@ serde = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true } derive_builder = { workspace = true } +rust_decimal = { workspace = true } [dev-dependencies] tokio = { workspace = true } diff --git a/core/deposit/src/ledger/error.rs b/core/deposit/src/ledger/error.rs index 17334fdf1..ccb40d7b2 100644 --- a/core/deposit/src/ledger/error.rs +++ b/core/deposit/src/ledger/error.rs @@ -6,6 +6,8 @@ pub enum DepositLedgerError { Sqlx(#[from] sqlx::Error), #[error("DepositLedgerError - CalaLedger: {0}")] CalaLedger(#[from] cala_ledger::error::LedgerError), - #[error("DepositLedgerError - CalaLedger: {0}")] + #[error("DepositLedgerError - CalaAccountError: {0}")] CalaAccount(#[from] cala_ledger::account::error::AccountError), + #[error("DepositLedgerError - CalaTxTemplateError: {0}")] + CalaTxTemplate(#[from] cala_ledger::tx_template::error::TxTemplateError), } diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs index cff71b7dc..f58dbb9a7 100644 --- a/core/deposit/src/ledger/mod.rs +++ b/core/deposit/src/ledger/mod.rs @@ -1,4 +1,5 @@ pub mod error; +mod templates; use cala_ledger::{account::*, CalaLedger}; @@ -11,6 +12,7 @@ pub struct DepositLedger { impl DepositLedger { pub async fn init(cala: &CalaLedger) -> Result { + templates::RecordDeposit::init(&cala).await?; Ok(Self { cala: cala.clone() }) } diff --git a/core/deposit/src/ledger/templates/mod.rs b/core/deposit/src/ledger/templates/mod.rs new file mode 100644 index 000000000..08e57da00 --- /dev/null +++ b/core/deposit/src/ledger/templates/mod.rs @@ -0,0 +1,3 @@ +mod record_deposit; + +pub use record_deposit::*; diff --git a/core/deposit/src/ledger/templates/record_deposit.rs b/core/deposit/src/ledger/templates/record_deposit.rs new file mode 100644 index 000000000..7945703cb --- /dev/null +++ b/core/deposit/src/ledger/templates/record_deposit.rs @@ -0,0 +1,106 @@ +use rust_decimal::Decimal; +use tracing::instrument; + +use cala_ledger::{ + tx_template::{error::TxTemplateError, *}, + *, +}; + +use crate::ledger::error::*; + +const RECORD_DEPOSIT_CODE: &str = "RECORD_DEPOSIT"; + +#[derive(Debug)] +pub struct RecordDepositParams { + pub journal_id: JournalId, + pub currency: Currency, + pub amount: Decimal, + pub deposit_omnibus_account_id: AccountId, + pub credit_account_id: AccountId, +} + +impl RecordDepositParams { + pub fn defs() -> Vec { + vec![ + NewParamDefinition::builder() + .name("journal_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("currency") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("amount") + .r#type(ParamDataType::Decimal) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("deposit_amnibus_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("credit_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("effective") + .r#type(ParamDataType::Date) + .build() + .unwrap(), + ] + } +} + +pub struct RecordDeposit; + +impl RecordDeposit { + #[instrument(name = "ledger.record_deposit.init", skip_all)] + pub async fn init(ledger: &CalaLedger) -> Result<(), DepositLedgerError> { + let tx_input = NewTxTemplateTransaction::builder() + .journal_id("params.journal_id") + .effective("params.effective") + .description("'Record a deposit'") + .build() + .expect("Couldn't build TxInput"); + let entries = vec![ + NewTxTemplateEntry::builder() + .entry_type("RECORD_DEPOSIT_DR") + .currency("params.currency") + .account_id("params.deposit_omnibus_account_id") + .direction("DEBIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("RECORD_DEPOSIT_CR") + .currency("params.currency") + .account_id("params.credit_account_id") + .direction("CREDIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + ]; + + let params = RecordDepositParams::defs(); + let template = NewTxTemplate::builder() + .id(TxTemplateId::new()) + .code(RECORD_DEPOSIT_CODE) + .transaction(tx_input) + .entries(entries) + .params(params) + .build() + .expect("Couldn't build template"); + match ledger.tx_templates().create(template).await { + Err(TxTemplateError::DuplicateCode) => Ok(()), + Err(e) => Err(e.into()), + Ok(_) => Ok(()), + } + } +} From 06ea2a4540907e099ea653b66eac7c71ddab7298 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Tue, 10 Dec 2024 10:13:39 +0100 Subject: [PATCH 08/24] chore: execute record_deposit template --- Cargo.lock | 2 + core/deposit/Cargo.toml | 6 +- core/deposit/src/ledger/mod.rs | 74 ++++++++++++++++++- .../src/ledger/templates/record_deposit.rs | 26 ++++++- core/deposit/src/lib.rs | 15 +++- core/deposit/src/primitives.rs | 10 ++- core/deposit/tests/deposit.rs | 32 +++++++- 7 files changed, 150 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c30e4b62c..6e9ea7733 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1199,10 +1199,12 @@ dependencies = [ "authz", "cala-ledger", "chrono", + "core-money", "derive_builder", "es-entity", "outbox", "rust_decimal", + "rust_decimal_macros", "serde", "sqlx", "strum", diff --git a/core/deposit/Cargo.toml b/core/deposit/Cargo.toml index 9392cb984..4297ac90f 100644 --- a/core/deposit/Cargo.toml +++ b/core/deposit/Cargo.toml @@ -9,6 +9,8 @@ fail-on-warnings = [] graphql = ["es-entity/graphql"] [dependencies] +core-money = { path = "../money" } + audit = { path = "../../lib/audit" } authz = { path = "../../lib/authz" } outbox = { path = "../../lib/outbox" } @@ -26,6 +28,8 @@ derive_builder = { workspace = true } rust_decimal = { workspace = true } [dev-dependencies] +authz = { path = "../../lib/authz", features = ["test-dummy"] } + tokio = { workspace = true } anyhow = { workspace = true } -authz = { path = "../../lib/authz", features = ["test-dummy"] } +rust_decimal_macros = { workspace = true } diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs index f58dbb9a7..b383f232c 100644 --- a/core/deposit/src/ledger/mod.rs +++ b/core/deposit/src/ledger/mod.rs @@ -1,19 +1,40 @@ pub mod error; mod templates; -use cala_ledger::{account::*, CalaLedger}; +use cala_ledger::{ + account::{error::AccountError, *}, + CalaLedger, Currency, DebitOrCredit, JournalId, TransactionId, +}; + +use crate::primitives::UsdCents; use error::*; #[derive(Clone)] pub struct DepositLedger { cala: CalaLedger, + journal_id: JournalId, + deposit_omnibus_account_id: AccountId, + usd: Currency, } impl DepositLedger { - pub async fn init(cala: &CalaLedger) -> Result { + pub async fn init( + cala: &CalaLedger, + journal_id: JournalId, + omnibus_account_code: String, + ) -> Result { + let deposit_omnibus_account_id = + Self::create_deposit_omnibus_account(cala, omnibus_account_code.clone()).await?; + templates::RecordDeposit::init(&cala).await?; - Ok(Self { cala: cala.clone() }) + + Ok(Self { + cala: cala.clone(), + journal_id, + deposit_omnibus_account_id, + usd: "USD".parse().expect("Could not parse 'USD'"), + }) } pub async fn create_account_for_deposit_account( @@ -40,4 +61,51 @@ impl DepositLedger { Ok(()) } + + pub async fn record_deposit( + &self, + op: es_entity::DbOp<'_>, + tx_id: impl Into, + amount: UsdCents, + credit_account_id: impl Into, + ) -> Result<(), DepositLedgerError> { + let tx_id = tx_id.into(); + let mut op = self.cala.ledger_operation_from_db_op(op); + + let params = templates::RecordDepositParams { + journal_id: self.journal_id, + currency: self.usd, + amount: amount.to_usd(), + deposit_omnibus_account_id: self.deposit_omnibus_account_id, + credit_account_id: credit_account_id.into(), + }; + self.cala + .post_transaction_in_op(&mut op, tx_id, templates::RECORD_DEPOSIT_CODE, params) + .await?; + + op.commit().await?; + Ok(()) + } + + async fn create_deposit_omnibus_account( + cala: &CalaLedger, + code: String, + ) -> Result { + let new_account = NewAccount::builder() + .code(&code) + .id(AccountId::new()) + .name("Deposit Omnibus Account") + .description("Omnibus Account for Deposit module") + .normal_balance_type(DebitOrCredit::Debit) + .build() + .expect("Couldn't create onchain incoming account"); + match cala.accounts().create(new_account).await { + Err(AccountError::CodeAlreadyExists) => { + let account = cala.accounts().find_by_code(code).await?; + Ok(account.id) + } + Err(e) => Err(e.into()), + Ok(account) => Ok(account.id), + } + } } diff --git a/core/deposit/src/ledger/templates/record_deposit.rs b/core/deposit/src/ledger/templates/record_deposit.rs index 7945703cb..e062f7db8 100644 --- a/core/deposit/src/ledger/templates/record_deposit.rs +++ b/core/deposit/src/ledger/templates/record_deposit.rs @@ -2,13 +2,13 @@ use rust_decimal::Decimal; use tracing::instrument; use cala_ledger::{ - tx_template::{error::TxTemplateError, *}, + tx_template::{error::TxTemplateError, Params, *}, *, }; use crate::ledger::error::*; -const RECORD_DEPOSIT_CODE: &str = "RECORD_DEPOSIT"; +pub const RECORD_DEPOSIT_CODE: &str = "RECORD_DEPOSIT"; #[derive(Debug)] pub struct RecordDepositParams { @@ -38,7 +38,7 @@ impl RecordDepositParams { .build() .unwrap(), NewParamDefinition::builder() - .name("deposit_amnibus_account_id") + .name("deposit_omnibus_account_id") .r#type(ParamDataType::Uuid) .build() .unwrap(), @@ -56,6 +56,26 @@ impl RecordDepositParams { } } +impl From for Params { + fn from( + RecordDepositParams { + journal_id, + currency, + amount, + deposit_omnibus_account_id, + credit_account_id, + }: RecordDepositParams, + ) -> Self { + let mut params = Self::default(); + params.insert("journal_id", journal_id); + params.insert("currency", currency); + params.insert("amount", amount); + params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); + params.insert("credit_account_id", credit_account_id); + params + } +} + pub struct RecordDeposit; impl RecordDeposit { diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index d1b9dc7d5..8c6ec85dc 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -62,10 +62,12 @@ where authz: &Perms, outbox: &Outbox, cala: &CalaLedger, + journal_id: LedgerJournalId, + omnibus_account_code: String, ) -> Result { let accounts = DepositAccountRepo::new(pool); let deposits = DepositRepo::new(pool); - let ledger = DepositLedger::init(cala).await?; + let ledger = DepositLedger::init(cala, journal_id, omnibus_account_code).await?; let res = Self { accounts, deposits, @@ -112,7 +114,7 @@ where &self, sub: &<::Audit as AuditSvc>::Subject, deposit_account_id: DepositAccountId, - // amount: UsdCents, + amount: UsdCents, reference: Option, ) -> Result { let audit_info = self @@ -124,15 +126,20 @@ where ) .await?; + let deposit_id = DepositId::new(); let new_deposit = NewDeposit::builder() - .id(DepositId::new()) + .id(deposit_id) .deposit_account_id(deposit_account_id) .reference(reference) .audit_info(audit_info) .build() .expect("Could not build new committee"); - let deposit = self.deposits.create(new_deposit).await?; + let mut op = self.deposits.begin_op().await?; + let deposit = self.deposits.create_in_op(&mut op, new_deposit).await?; + self.ledger + .record_deposit(op, deposit_id, amount, deposit_account_id) + .await?; Ok(deposit) } diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index adf85229c..727ebe0fa 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -2,16 +2,22 @@ use std::{fmt::Display, str::FromStr}; use authz::AllOrOne; -pub use cala_ledger::primitives::AccountId as LedgerAccountId; +pub use cala_ledger::primitives::{ + AccountId as LedgerAccountId, JournalId as LedgerJournalId, + TransactionId as LedgerTransactionId, +}; es_entity::entity_id! { AccountHolderId, DepositAccountId, DepositId; - DepositAccountId => LedgerAccountId + DepositAccountId => LedgerAccountId, + DepositId => LedgerTransactionId, } +pub use core_money::UsdCents; + pub type DepositAccountAllOrOne = AllOrOne; pub type DepositAllOrOne = AllOrOne; diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs index 88ea69627..8c7cd4671 100644 --- a/core/deposit/tests/deposit.rs +++ b/core/deposit/tests/deposit.rs @@ -1,3 +1,5 @@ +use rust_decimal_macros::dec; + use authz::dummy::DummySubject; use cala_ledger::{CalaLedger, CalaLedgerConfig}; use deposit::*; @@ -9,23 +11,49 @@ pub async fn init_pool() -> anyhow::Result { Ok(pool) } +pub async fn init_journal(cala: &CalaLedger) -> anyhow::Result { + use cala_ledger::journal::*; + + let id = JournalId::new(); + let new = NewJournal::builder() + .id(id) + .name("Test journal") + .build() + .unwrap(); + let journal = cala.journals().create(new).await?; + Ok(journal.id) +} + #[tokio::test] async fn deposit() -> anyhow::Result<()> { let pool = init_pool().await?; + let outbox = outbox::Outbox::::init(&pool).await?; let authz = authz::dummy::DummyPerms::::new(); + let cala_config = CalaLedgerConfig::builder() .pool(pool.clone()) .exec_migrations(false) .build()?; let cala = CalaLedger::init(cala_config).await?; - let deposit = CoreDeposit::init(&pool, &authz, &outbox, &cala).await?; + + let journal_id = init_journal(&cala).await?; + let omnibus_code = journal_id.to_string(); + + let deposit = + CoreDeposit::init(&pool, &authz, &outbox, &cala, journal_id, omnibus_code).await?; + let account_holder_id = AccountHolderId::new(); let account = deposit .create_account(&DummySubject, account_holder_id) .await?; deposit - .record_deposit(&DummySubject, account.id, None) + .record_deposit( + &DummySubject, + account.id, + UsdCents::try_from_usd(dec!(1000000)).unwrap(), + None, + ) .await?; let _ = deposit.balance(&DummySubject, account.id).await?; Ok(()) From b0c85ef5ecafe4be08e39a8af9c947ec9a50709f Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Tue, 10 Dec 2024 15:33:14 +0530 Subject: [PATCH 09/24] chore: impl balance usecase --- core/deposit/src/ledger/error.rs | 4 ++++ core/deposit/src/ledger/mod.rs | 13 +++++++++++++ core/deposit/src/ledger/templates/record_deposit.rs | 6 ++++-- core/deposit/src/lib.rs | 7 +++---- core/deposit/tests/deposit.rs | 5 ++++- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/core/deposit/src/ledger/error.rs b/core/deposit/src/ledger/error.rs index ccb40d7b2..fbfd3dd89 100644 --- a/core/deposit/src/ledger/error.rs +++ b/core/deposit/src/ledger/error.rs @@ -10,4 +10,8 @@ pub enum DepositLedgerError { CalaAccount(#[from] cala_ledger::account::error::AccountError), #[error("DepositLedgerError - CalaTxTemplateError: {0}")] CalaTxTemplate(#[from] cala_ledger::tx_template::error::TxTemplateError), + #[error("DepositLedgerError - CalaBalanceError: {0}")] + CalaBalance(#[from] cala_ledger::balance::error::BalanceError), + #[error("DepositLedgerError - ConversionError: {0}")] + ConversionError(#[from] core_money::ConversionError), } diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs index b383f232c..9bed3c776 100644 --- a/core/deposit/src/ledger/mod.rs +++ b/core/deposit/src/ledger/mod.rs @@ -108,4 +108,17 @@ impl DepositLedger { Ok(account) => Ok(account.id), } } + + pub async fn balance( + &self, + account_id: impl Into, + ) -> Result { + let balances = self + .cala + .balances() + .find(self.journal_id, account_id.into(), self.usd) + .await?; + + Ok(UsdCents::try_from_usd(balances.settled())?) + } } diff --git a/core/deposit/src/ledger/templates/record_deposit.rs b/core/deposit/src/ledger/templates/record_deposit.rs index e062f7db8..4f2bb11f6 100644 --- a/core/deposit/src/ledger/templates/record_deposit.rs +++ b/core/deposit/src/ledger/templates/record_deposit.rs @@ -72,6 +72,8 @@ impl From for Params { params.insert("amount", amount); params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); params.insert("credit_account_id", credit_account_id); + params.insert("effective", chrono::Utc::now().date_naive()); + params } } @@ -89,7 +91,7 @@ impl RecordDeposit { .expect("Couldn't build TxInput"); let entries = vec![ NewTxTemplateEntry::builder() - .entry_type("RECORD_DEPOSIT_DR") + .entry_type("'RECORD_DEPOSIT_DR'") .currency("params.currency") .account_id("params.deposit_omnibus_account_id") .direction("DEBIT") @@ -98,7 +100,7 @@ impl RecordDeposit { .build() .expect("Couldn't build entry"), NewTxTemplateEntry::builder() - .entry_type("RECORD_DEPOSIT_CR") + .entry_type("'RECORD_DEPOSIT_CR'") .currency("params.currency") .account_id("params.credit_account_id") .direction("CREDIT") diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index 8c6ec85dc..16b4532f6 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -147,7 +147,7 @@ where &self, sub: &<::Audit as AuditSvc>::Subject, account_id: DepositAccountId, - ) -> Result<(), CoreDepositError> { + ) -> Result { let _ = self .authz .enforce_permission( @@ -157,8 +157,7 @@ where ) .await?; - // let balance = self.accounts.balance(account_id).await?; - // Ok(balance) - Ok(()) + let balance = self.ledger.balance(account_id).await?; + Ok(balance) } } diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs index 8c7cd4671..aac642615 100644 --- a/core/deposit/tests/deposit.rs +++ b/core/deposit/tests/deposit.rs @@ -55,6 +55,9 @@ async fn deposit() -> anyhow::Result<()> { None, ) .await?; - let _ = deposit.balance(&DummySubject, account.id).await?; + let balance = deposit.balance(&DummySubject, account.id).await?; + + // return zero when no deposit + assert_eq!(balance, UsdCents::try_from_usd(dec!(1000000)).unwrap()); Ok(()) } From 037ae4306656fa8c80311d2b1281f4aecabae63d Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Tue, 10 Dec 2024 16:21:15 +0530 Subject: [PATCH 10/24] chore: templates for withdraw use case --- core/deposit/src/ledger/mod.rs | 3 + .../src/ledger/templates/cancel_withdraw.rs | 147 ++++++++++++++++++ .../src/ledger/templates/confirm_withdraw.rs | 130 ++++++++++++++++ .../src/ledger/templates/initiate_withdraw.rs | 146 +++++++++++++++++ core/deposit/src/ledger/templates/mod.rs | 6 + 5 files changed, 432 insertions(+) create mode 100644 core/deposit/src/ledger/templates/cancel_withdraw.rs create mode 100644 core/deposit/src/ledger/templates/confirm_withdraw.rs create mode 100644 core/deposit/src/ledger/templates/initiate_withdraw.rs diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs index 9bed3c776..333e3c8f0 100644 --- a/core/deposit/src/ledger/mod.rs +++ b/core/deposit/src/ledger/mod.rs @@ -28,6 +28,9 @@ impl DepositLedger { Self::create_deposit_omnibus_account(cala, omnibus_account_code.clone()).await?; templates::RecordDeposit::init(&cala).await?; + templates::InitiateWithdraw::init(&cala).await?; + templates::CancelWithdraw::init(&cala).await?; + templates::ConfirmWithdraw::init(&cala).await?; Ok(Self { cala: cala.clone(), diff --git a/core/deposit/src/ledger/templates/cancel_withdraw.rs b/core/deposit/src/ledger/templates/cancel_withdraw.rs new file mode 100644 index 000000000..84fb477ea --- /dev/null +++ b/core/deposit/src/ledger/templates/cancel_withdraw.rs @@ -0,0 +1,147 @@ +use rust_decimal::Decimal; +use tracing::instrument; + +use cala_ledger::{ + tx_template::{error::TxTemplateError, Params, *}, + *, +}; + +use crate::ledger::error::*; + +pub const CANCEL_WITHDRAW_CODE: &str = "CANCEL_WITHDRAW_CODE"; + +#[derive(Debug)] +pub struct CancelWithdrawParams { + pub journal_id: JournalId, + pub currency: Currency, + pub amount: Decimal, + pub deposit_omnibus_account_id: AccountId, + pub credit_account_id: AccountId, +} + +impl CancelWithdrawParams { + pub fn defs() -> Vec { + vec![ + NewParamDefinition::builder() + .name("journal_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("currency") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("amount") + .r#type(ParamDataType::Decimal) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("deposit_omnibus_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("credit_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("effective") + .r#type(ParamDataType::Date) + .build() + .unwrap(), + ] + } +} + +impl From for Params { + fn from( + CancelWithdrawParams { + journal_id, + currency, + amount, + deposit_omnibus_account_id, + credit_account_id, + }: CancelWithdrawParams, + ) -> Self { + let mut params = Self::default(); + params.insert("journal_id", journal_id); + params.insert("currency", currency); + params.insert("amount", amount); + params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); + params.insert("credit_account_id", credit_account_id); + params.insert("effective", chrono::Utc::now().date_naive()); + + params + } +} + +pub struct CancelWithdraw; + +impl CancelWithdraw { + #[instrument(name = "ledger.cancel_withdraw.init", skip_all)] + pub async fn init(ledger: &CalaLedger) -> Result<(), DepositLedgerError> { + let tx_input = NewTxTemplateTransaction::builder() + .journal_id("params.journal_id") + .effective("params.effective") + .description("'Cancel a Withdraw'") + .build() + .expect("Couldn't build TxInput"); + let entries = vec![ + // check in graphql/cancel-withdraw the entry type + NewTxTemplateEntry::builder() + .entry_type("'CANCEL_WITHDRAW_PENDING_CR'") + .currency("params.currency") + .account_id("params.deposit_omnibus_account_id") + .direction("CREDIT") + .layer("PENDING") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'CANCEL_WITHDRAW_PENDING_DR'") + .currency("params.currency") + .account_id("params.credit_account_id") + .direction("DEBIT") + .layer("PENDING") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'CANCEL_WITHDRAW_SETTLED_DR'") + .currency("params.currency") + .account_id("params.deposit_omnibus_account_id") + .direction("DEBIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'CANCEL_WITHDRAW_SETTLED_CR'") + .currency("params.currency") + .account_id("params.credit_account_id") + .direction("CREDIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + ]; + + let params = CancelWithdrawParams::defs(); + let template = NewTxTemplate::builder() + .id(TxTemplateId::new()) + .code(CANCEL_WITHDRAW_CODE) + .transaction(tx_input) + .entries(entries) + .params(params) + .build() + .expect("Couldn't build template"); + match ledger.tx_templates().create(template).await { + Err(TxTemplateError::DuplicateCode) => Ok(()), + Err(e) => Err(e.into()), + Ok(_) => Ok(()), + } + } +} diff --git a/core/deposit/src/ledger/templates/confirm_withdraw.rs b/core/deposit/src/ledger/templates/confirm_withdraw.rs new file mode 100644 index 000000000..2164341ec --- /dev/null +++ b/core/deposit/src/ledger/templates/confirm_withdraw.rs @@ -0,0 +1,130 @@ +use rust_decimal::Decimal; + +use tracing::instrument; + +use cala_ledger::{ + tx_template::{error::TxTemplateError, Params, *}, + *, +}; + +use crate::ledger::error::*; + +pub const CONFIRM_WITHDRAW_CODE: &str = "CONFIRM_WITHDRAW_CODE"; + +#[derive(Debug)] +pub struct ConfirmWithdrawParams { + pub journal_id: JournalId, + pub currency: Currency, + pub amount: Decimal, + pub deposit_omnibus_account_id: AccountId, + pub credit_account_id: AccountId, +} + +impl ConfirmWithdrawParams { + pub fn defs() -> Vec { + vec![ + NewParamDefinition::builder() + .name("journal_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("currency") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("amount") + .r#type(ParamDataType::Decimal) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("deposit_omnibus_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("credit_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("effective") + .r#type(ParamDataType::Date) + .build() + .unwrap(), + ] + } +} + +impl From for Params { + fn from( + ConfirmWithdrawParams { + journal_id, + currency, + amount, + deposit_omnibus_account_id, + credit_account_id, + }: ConfirmWithdrawParams, + ) -> Self { + let mut params = Self::default(); + params.insert("journal_id", journal_id); + params.insert("currency", currency); + params.insert("amount", amount); + params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); + params.insert("credit_account_id", credit_account_id); + params.insert("effective", chrono::Utc::now().date_naive()); + + params + } +} + +pub struct ConfirmWithdraw; + +impl ConfirmWithdraw { + #[instrument(name = "ledger.confirm_withdraw.init", skip_all)] + pub async fn init(ledger: &CalaLedger) -> Result<(), DepositLedgerError> { + let tx_input = NewTxTemplateTransaction::builder() + .journal_id("params.journal_id") + .effective("params.effective") + .description("'Confirm a withdraw'") + .build() + .expect("Couldn't build TxInput"); + let entries = vec![ + // check in graphql/cancel-withdraw the entry type + NewTxTemplateEntry::builder() + .entry_type("'CONFIRM_WITHDRAW_PENDING_CR'") + .currency("params.currency") + .account_id("params.deposit_omnibus_account_id") + .direction("CREDIT") + .layer("PENDING") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'CONFIRM_WITHDRAW_PENDING_DR'") + .currency("params.currency") + .account_id("params.credit_account_id") + .direction("DEBIT") + .layer("PENDING") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + ]; + + let params = ConfirmWithdrawParams::defs(); + let template = NewTxTemplate::builder() + .id(TxTemplateId::new()) + .code(CONFIRM_WITHDRAW_CODE) + .transaction(tx_input) + .entries(entries) + .params(params) + .build() + .expect("Couldn't build template"); + match ledger.tx_templates().create(template).await { + Err(TxTemplateError::DuplicateCode) => Ok(()), + Err(e) => Err(e.into()), + Ok(_) => Ok(()), + } + } +} diff --git a/core/deposit/src/ledger/templates/initiate_withdraw.rs b/core/deposit/src/ledger/templates/initiate_withdraw.rs new file mode 100644 index 000000000..2e3b58dbf --- /dev/null +++ b/core/deposit/src/ledger/templates/initiate_withdraw.rs @@ -0,0 +1,146 @@ +use rust_decimal::Decimal; +use tracing::instrument; + +use cala_ledger::{ + tx_template::{error::TxTemplateError, Params, *}, + *, +}; + +use crate::ledger::error::*; + +pub const INITIATE_WITHDRAW_CODE: &str = "INITIATE_WITHDRAW_CODE"; + +#[derive(Debug)] +pub struct InitiateWithdrawParams { + pub journal_id: JournalId, + pub currency: Currency, + pub amount: Decimal, + pub deposit_omnibus_account_id: AccountId, + pub credit_account_id: AccountId, +} + +impl InitiateWithdrawParams { + pub fn defs() -> Vec { + vec![ + NewParamDefinition::builder() + .name("journal_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("currency") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("amount") + .r#type(ParamDataType::Decimal) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("deposit_omnibus_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("credit_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("effective") + .r#type(ParamDataType::Date) + .build() + .unwrap(), + ] + } +} + +impl From for Params { + fn from( + InitiateWithdrawParams { + journal_id, + currency, + amount, + deposit_omnibus_account_id, + credit_account_id, + }: InitiateWithdrawParams, + ) -> Self { + let mut params = Self::default(); + params.insert("journal_id", journal_id); + params.insert("currency", currency); + params.insert("amount", amount); + params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); + params.insert("credit_account_id", credit_account_id); + params.insert("effective", chrono::Utc::now().date_naive()); + + params + } +} + +pub struct InitiateWithdraw; + +impl InitiateWithdraw { + #[instrument(name = "ledger.initiate_withdraw.init", skip_all)] + pub async fn init(ledger: &CalaLedger) -> Result<(), DepositLedgerError> { + let tx_input = NewTxTemplateTransaction::builder() + .journal_id("params.journal_id") + .effective("params.effective") + .description("'Initiate a withdraw'") + .build() + .expect("Couldn't build TxInput"); + let entries = vec![ + NewTxTemplateEntry::builder() + .entry_type("'INITIATE_WITHDRAW_SETTLED_DR'") + .currency("params.currency") + .account_id("params.deposit_omnibus_account_id") + .direction("CREDIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'INITIATE_WITHDRAW_SETTLED_CR'") + .currency("params.currency") + .account_id("params.credit_account_id") + .direction("DEBIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'INITIATE_WITHDRAW_PENDING_DR'") + .currency("params.currency") + .account_id("params.deposit_omnibus_account_id") + .direction("DEBIT") + .layer("PENDING") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'INITIATE_WITHDRAW_PENDING_CR'") + .currency("params.currency") + .account_id("params.credit_account_id") + .direction("CREDIT") + .layer("PENDING") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + ]; + + let params = InitiateWithdrawParams::defs(); + let template = NewTxTemplate::builder() + .id(TxTemplateId::new()) + .code(INITIATE_WITHDRAW_CODE) + .transaction(tx_input) + .entries(entries) + .params(params) + .build() + .expect("Couldn't build template"); + match ledger.tx_templates().create(template).await { + Err(TxTemplateError::DuplicateCode) => Ok(()), + Err(e) => Err(e.into()), + Ok(_) => Ok(()), + } + } +} diff --git a/core/deposit/src/ledger/templates/mod.rs b/core/deposit/src/ledger/templates/mod.rs index 08e57da00..2fffe54ec 100644 --- a/core/deposit/src/ledger/templates/mod.rs +++ b/core/deposit/src/ledger/templates/mod.rs @@ -1,3 +1,9 @@ +mod cancel_withdraw; +mod confirm_withdraw; +mod initiate_withdraw; mod record_deposit; +pub use cancel_withdraw::*; +pub use confirm_withdraw::*; +pub use initiate_withdraw::*; pub use record_deposit::*; From f3374f838b3fc2b94c0eb1342f3c8a6c69c5e412 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Tue, 10 Dec 2024 16:45:29 +0530 Subject: [PATCH 11/24] chore: include deposit in sqlx-prepare --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 48cde8928..36865b461 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ sqlx-prepare: cd lib/outbox && cargo sqlx prepare cd core/governance && cargo sqlx prepare cd core/user && cargo sqlx prepare + cd core/deposit && cargo sqlx prepare cd lana/app && cargo sqlx prepare cd lana/dashboard && cargo sqlx prepare From 820f83aa78d511a8fb067aeffbd34f265f6ba316 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Tue, 10 Dec 2024 16:45:46 +0530 Subject: [PATCH 12/24] chore: run sqlx prepare --- ...372c2ef44f685337992ee50bef039f3be423d.json | 42 +++++++++++ ...a53ff041653d94f89a52ee250c93878ea2cca.json | 42 +++++++++++ ...90dbc6c00ab45e92297732f4f548426327f4b.json | 42 +++++++++++ ...7b99d81e2947c6f7e64040446e0456976a483.json | 42 +++++++++++ ...4d5354b6cdb3f1a7881c2fad4c424eebadefc.json | 53 +++++++++++++ ...3e72bd63e66f331eab8c57980e6d7e0e64cc2.json | 41 ++++++++++ ...715c4db000954e0ffb38eccf9d565e0d54c66.json | 18 +++++ ...562d3988dac58a8d3dd6448c79329fbd2bf50.json | 16 ++++ ...fe3a4b7ff59391ad86c03652dae9d0a3df5e9.json | 42 +++++++++++ ...883e4dcd306cadd5d96f3d91a50047b91a849.json | 40 ++++++++++ ...62d5c510b70336c69e74e0a0ac6b8381a5759.json | 40 ++++++++++ ...5e80026e67ee62235c9c5b2f91ea88f7fdb19.json | 42 +++++++++++ ...12c2861fb8a6ca78eeb12c99ea56e946e8fd8.json | 41 ++++++++++ ...6012ca664f55cb601a19e0ced610e5b442296.json | 43 +++++++++++ ...c64af3a98ec895e1747e2ce6a61221af8c657.json | 43 +++++++++++ ...630c3934c48c74e14bd08fd81d70880c5ae65.json | 18 +++++ ...08539202abe4dd3af28d528bedcd09b551cab.json | 17 +++++ ...c9b5067c492748febc14e8e2b40925422eea7.json | 40 ++++++++++ ...654423c0b2415cae74021b701cc3ed1a6a72c.json | 42 +++++++++++ ...bc30091a70e30b6615cd1da20f5b2ada92971.json | 41 ++++++++++ ...e56cc9e0c427d7c32e6a2e1d9e66f43231623.json | 20 +++++ ...dd7c9d0b2bbbda1f62fe3c82e5ada575f1bb6.json | 52 +++++++++++++ ...b44ec8e0639c0f896b11baf340f2092677129.json | 41 ++++++++++ ...0743f30dfbe27e5432c6587968ea0c2b73369.json | 40 ++++++++++ ...90722479c365d4760a490ec136a1ef9ebb979.json | 31 ++++++++ ...cef9cd0fbcf91128bb4e2a372a16e3b9b8c69.json | 40 ++++++++++ ...38f6931baa191d2469f30a09b76acab2bbe32.json | 15 ++++ ...02672d8159fb2bff2aa35be28a5193febea36.json | 41 ++++++++++ ...9791052da1117559c851b9c003fe2c4483c19.json | 40 ++++++++++ ...576dcdcabb95d9c559c34d62547e3d36ac2fa.json | 43 +++++++++++ ...cfbc2697554a02545749dbf398705bee034f1.json | 18 +++++ ...1050c40e68e8028cb4d118f4ad5c881e09081.json | 34 +++++++++ ...de3db5fbd5b24ad2c99a6bb4183c5c6f86d43.json | 40 ++++++++++ ...4d551f322a1d72fd2cf639685a1a2cf4cbd3f.json | 18 +++++ ...808d7bc6b8ae881c6d445bec38d79a6a032af.json | 42 +++++++++++ ...8e7dc5877a809396cc1687fb287654dfbc126.json | 43 +++++++++++ ...9f28a94eaba9cccca0d51f6d19fe435967dbb.json | 40 ++++++++++ ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- 79 files changed, 1343 insertions(+), 1038 deletions(-) create mode 100644 core/deposit/.sqlx/query-02617f65a7603c309ee825ba9be372c2ef44f685337992ee50bef039f3be423d.json create mode 100644 core/deposit/.sqlx/query-0911a137c1a3afe9f301cf1b019a53ff041653d94f89a52ee250c93878ea2cca.json create mode 100644 core/deposit/.sqlx/query-0a8086357bfd95aee2480af351f90dbc6c00ab45e92297732f4f548426327f4b.json create mode 100644 core/deposit/.sqlx/query-0e0b27fef175ac24eb757a0e45e7b99d81e2947c6f7e64040446e0456976a483.json create mode 100644 core/deposit/.sqlx/query-12c19a58f42d5ec96fd75e628a04d5354b6cdb3f1a7881c2fad4c424eebadefc.json create mode 100644 core/deposit/.sqlx/query-1885cb45c95e595339e8dc305fc3e72bd63e66f331eab8c57980e6d7e0e64cc2.json create mode 100644 core/deposit/.sqlx/query-1db91bf209069691293eef23a38715c4db000954e0ffb38eccf9d565e0d54c66.json create mode 100644 core/deposit/.sqlx/query-1f4ab93dd25d5e57350e4f9e089562d3988dac58a8d3dd6448c79329fbd2bf50.json create mode 100644 core/deposit/.sqlx/query-253f173128747ab15dfd97869fefe3a4b7ff59391ad86c03652dae9d0a3df5e9.json create mode 100644 core/deposit/.sqlx/query-427eff7cb96e2e6229ff1126596883e4dcd306cadd5d96f3d91a50047b91a849.json create mode 100644 core/deposit/.sqlx/query-43a7816dc14d728deb7d179c5e862d5c510b70336c69e74e0a0ac6b8381a5759.json create mode 100644 core/deposit/.sqlx/query-47e131061ca46b535e7610767eb5e80026e67ee62235c9c5b2f91ea88f7fdb19.json create mode 100644 core/deposit/.sqlx/query-4b6c51381b49631484d7318e49412c2861fb8a6ca78eeb12c99ea56e946e8fd8.json create mode 100644 core/deposit/.sqlx/query-56a93a89179b42b6c18ccfbd9aa6012ca664f55cb601a19e0ced610e5b442296.json create mode 100644 core/deposit/.sqlx/query-6652182373e14925412ce85f358c64af3a98ec895e1747e2ce6a61221af8c657.json create mode 100644 core/deposit/.sqlx/query-66660428ec43617b9017f0f4d08630c3934c48c74e14bd08fd81d70880c5ae65.json create mode 100644 core/deposit/.sqlx/query-697f26ecc715a804258dfb0112308539202abe4dd3af28d528bedcd09b551cab.json create mode 100644 core/deposit/.sqlx/query-75052c2b453721eae52cfaf6e65c9b5067c492748febc14e8e2b40925422eea7.json create mode 100644 core/deposit/.sqlx/query-769e2b41629abb4c12e1b195dee654423c0b2415cae74021b701cc3ed1a6a72c.json create mode 100644 core/deposit/.sqlx/query-77b298409650fb826ef92b5cbc7bc30091a70e30b6615cd1da20f5b2ada92971.json create mode 100644 core/deposit/.sqlx/query-7a03aaa2e73d95b0273bcbfac7fe56cc9e0c427d7c32e6a2e1d9e66f43231623.json create mode 100644 core/deposit/.sqlx/query-7b0d547dda8c4a6ce921025c2e8dd7c9d0b2bbbda1f62fe3c82e5ada575f1bb6.json create mode 100644 core/deposit/.sqlx/query-80de7b594db20b2c5f17d3b803fb44ec8e0639c0f896b11baf340f2092677129.json create mode 100644 core/deposit/.sqlx/query-8ea5f8d69ed4ad9113e4908cf740743f30dfbe27e5432c6587968ea0c2b73369.json create mode 100644 core/deposit/.sqlx/query-9af6eb14d4bb659fbfc6511756490722479c365d4760a490ec136a1ef9ebb979.json create mode 100644 core/deposit/.sqlx/query-a1dcaba56af024322df454768c2cef9cd0fbcf91128bb4e2a372a16e3b9b8c69.json create mode 100644 core/deposit/.sqlx/query-be503ebd92a55095d55f425717738f6931baa191d2469f30a09b76acab2bbe32.json create mode 100644 core/deposit/.sqlx/query-c231caf2cdfc7a61e91f230ee1a02672d8159fb2bff2aa35be28a5193febea36.json create mode 100644 core/deposit/.sqlx/query-cfde9407b814888676bae2c43c29791052da1117559c851b9c003fe2c4483c19.json create mode 100644 core/deposit/.sqlx/query-d17a8eecb086b7593ee3e83c3a3576dcdcabb95d9c559c34d62547e3d36ac2fa.json create mode 100644 core/deposit/.sqlx/query-d904610a418a5ac37f82313e0a1cfbc2697554a02545749dbf398705bee034f1.json create mode 100644 core/deposit/.sqlx/query-da8bde1919fb0a4471ed9bed8b81050c40e68e8028cb4d118f4ad5c881e09081.json create mode 100644 core/deposit/.sqlx/query-df0eb4298a26ac09dca4d645e42de3db5fbd5b24ad2c99a6bb4183c5c6f86d43.json create mode 100644 core/deposit/.sqlx/query-e30cab1a790ff1dfce307ae2f174d551f322a1d72fd2cf639685a1a2cf4cbd3f.json create mode 100644 core/deposit/.sqlx/query-e99ee286fc20a1957a2bcff1c70808d7bc6b8ae881c6d445bec38d79a6a032af.json create mode 100644 core/deposit/.sqlx/query-f4215515cb8b8e4823a28867e118e7dc5877a809396cc1687fb287654dfbc126.json create mode 100644 core/deposit/.sqlx/query-f7769c30ea3f8b0a4f96a3a033c9f28a94eaba9cccca0d51f6d19fe435967dbb.json delete mode 100644 core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json delete mode 100644 core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json delete mode 100644 lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json delete mode 100644 lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json diff --git a/core/deposit/.sqlx/query-02617f65a7603c309ee825ba9be372c2ef44f685337992ee50bef039f3be423d.json b/core/deposit/.sqlx/query-02617f65a7603c309ee825ba9be372c2ef44f685337992ee50bef039f3be423d.json new file mode 100644 index 000000000..88bca3d2b --- /dev/null +++ b/core/deposit/.sqlx/query-02617f65a7603c309ee825ba9be372c2ef44f685337992ee50bef039f3be423d.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, id FROM core_deposits WHERE ((deposit_account_id = $1) AND (COALESCE(id < $3, true))) ORDER BY id DESC LIMIT $2) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "02617f65a7603c309ee825ba9be372c2ef44f685337992ee50bef039f3be423d" +} diff --git a/core/deposit/.sqlx/query-0911a137c1a3afe9f301cf1b019a53ff041653d94f89a52ee250c93878ea2cca.json b/core/deposit/.sqlx/query-0911a137c1a3afe9f301cf1b019a53ff041653d94f89a52ee250c93878ea2cca.json new file mode 100644 index 000000000..37511009c --- /dev/null +++ b/core/deposit/.sqlx/query-0911a137c1a3afe9f301cf1b019a53ff041653d94f89a52ee250c93878ea2cca.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM deposit_accounts WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "0911a137c1a3afe9f301cf1b019a53ff041653d94f89a52ee250c93878ea2cca" +} diff --git a/core/deposit/.sqlx/query-0a8086357bfd95aee2480af351f90dbc6c00ab45e92297732f4f548426327f4b.json b/core/deposit/.sqlx/query-0a8086357bfd95aee2480af351f90dbc6c00ab45e92297732f4f548426327f4b.json new file mode 100644 index 000000000..887a23764 --- /dev/null +++ b/core/deposit/.sqlx/query-0a8086357bfd95aee2480af351f90dbc6c00ab45e92297732f4f548426327f4b.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM deposit_accounts WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "0a8086357bfd95aee2480af351f90dbc6c00ab45e92297732f4f548426327f4b" +} diff --git a/core/deposit/.sqlx/query-0e0b27fef175ac24eb757a0e45e7b99d81e2947c6f7e64040446e0456976a483.json b/core/deposit/.sqlx/query-0e0b27fef175ac24eb757a0e45e7b99d81e2947c6f7e64040446e0456976a483.json new file mode 100644 index 000000000..97e0681d4 --- /dev/null +++ b/core/deposit/.sqlx/query-0e0b27fef175ac24eb757a0e45e7b99d81e2947c6f7e64040446e0456976a483.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM core_deposits WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "0e0b27fef175ac24eb757a0e45e7b99d81e2947c6f7e64040446e0456976a483" +} diff --git a/core/deposit/.sqlx/query-12c19a58f42d5ec96fd75e628a04d5354b6cdb3f1a7881c2fad4c424eebadefc.json b/core/deposit/.sqlx/query-12c19a58f42d5ec96fd75e628a04d5354b6cdb3f1a7881c2fad4c424eebadefc.json new file mode 100644 index 000000000..084162b24 --- /dev/null +++ b/core/deposit/.sqlx/query-12c19a58f42d5ec96fd75e628a04d5354b6cdb3f1a7881c2fad4c424eebadefc.json @@ -0,0 +1,53 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT id AS \"id: AuditEntryId\", subject, object, action, authorized, recorded_at\n FROM audit_entries\n WHERE COALESCE(id < $1, true)\n ORDER BY id DESC\n LIMIT $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: AuditEntryId", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "subject", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "object", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "action", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "authorized", + "type_info": "Bool" + }, + { + "ordinal": 5, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "12c19a58f42d5ec96fd75e628a04d5354b6cdb3f1a7881c2fad4c424eebadefc" +} diff --git a/core/deposit/.sqlx/query-1885cb45c95e595339e8dc305fc3e72bd63e66f331eab8c57980e6d7e0e64cc2.json b/core/deposit/.sqlx/query-1885cb45c95e595339e8dc305fc3e72bd63e66f331eab8c57980e6d7e0e64cc2.json new file mode 100644 index 000000000..61bd68174 --- /dev/null +++ b/core/deposit/.sqlx/query-1885cb45c95e595339e8dc305fc3e72bd63e66f331eab8c57980e6d7e0e64cc2.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM deposit_accounts WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "1885cb45c95e595339e8dc305fc3e72bd63e66f331eab8c57980e6d7e0e64cc2" +} diff --git a/core/deposit/.sqlx/query-1db91bf209069691293eef23a38715c4db000954e0ffb38eccf9d565e0d54c66.json b/core/deposit/.sqlx/query-1db91bf209069691293eef23a38715c4db000954e0ffb38eccf9d565e0d54c66.json new file mode 100644 index 000000000..388afccf9 --- /dev/null +++ b/core/deposit/.sqlx/query-1db91bf209069691293eef23a38715c4db000954e0ffb38eccf9d565e0d54c66.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO core_deposit_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "1db91bf209069691293eef23a38715c4db000954e0ffb38eccf9d565e0d54c66" +} diff --git a/core/deposit/.sqlx/query-1f4ab93dd25d5e57350e4f9e089562d3988dac58a8d3dd6448c79329fbd2bf50.json b/core/deposit/.sqlx/query-1f4ab93dd25d5e57350e4f9e089562d3988dac58a8d3dd6448c79329fbd2bf50.json new file mode 100644 index 000000000..6110045ff --- /dev/null +++ b/core/deposit/.sqlx/query-1f4ab93dd25d5e57350e4f9e089562d3988dac58a8d3dd6448c79329fbd2bf50.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO deposit_accounts (id, account_holder_id, created_at) VALUES ($1, $2, $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "1f4ab93dd25d5e57350e4f9e089562d3988dac58a8d3dd6448c79329fbd2bf50" +} diff --git a/core/deposit/.sqlx/query-253f173128747ab15dfd97869fefe3a4b7ff59391ad86c03652dae9d0a3df5e9.json b/core/deposit/.sqlx/query-253f173128747ab15dfd97869fefe3a4b7ff59391ad86c03652dae9d0a3df5e9.json new file mode 100644 index 000000000..b137b511d --- /dev/null +++ b/core/deposit/.sqlx/query-253f173128747ab15dfd97869fefe3a4b7ff59391ad86c03652dae9d0a3df5e9.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT account_holder_id, id FROM deposit_accounts WHERE ((account_holder_id = $1) AND (COALESCE(id < $3, true))) ORDER BY id DESC LIMIT $2) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "253f173128747ab15dfd97869fefe3a4b7ff59391ad86c03652dae9d0a3df5e9" +} diff --git a/core/deposit/.sqlx/query-427eff7cb96e2e6229ff1126596883e4dcd306cadd5d96f3d91a50047b91a849.json b/core/deposit/.sqlx/query-427eff7cb96e2e6229ff1126596883e4dcd306cadd5d96f3d91a50047b91a849.json new file mode 100644 index 000000000..52f020376 --- /dev/null +++ b/core/deposit/.sqlx/query-427eff7cb96e2e6229ff1126596883e4dcd306cadd5d96f3d91a50047b91a849.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_deposits WHERE id = $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "427eff7cb96e2e6229ff1126596883e4dcd306cadd5d96f3d91a50047b91a849" +} diff --git a/core/deposit/.sqlx/query-43a7816dc14d728deb7d179c5e862d5c510b70336c69e74e0a0ac6b8381a5759.json b/core/deposit/.sqlx/query-43a7816dc14d728deb7d179c5e862d5c510b70336c69e74e0a0ac6b8381a5759.json new file mode 100644 index 000000000..e6340e31a --- /dev/null +++ b/core/deposit/.sqlx/query-43a7816dc14d728deb7d179c5e862d5c510b70336c69e74e0a0ac6b8381a5759.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: DepositId\", e.sequence, e.event, e.recorded_at FROM core_deposits i JOIN core_deposit_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "43a7816dc14d728deb7d179c5e862d5c510b70336c69e74e0a0ac6b8381a5759" +} diff --git a/core/deposit/.sqlx/query-47e131061ca46b535e7610767eb5e80026e67ee62235c9c5b2f91ea88f7fdb19.json b/core/deposit/.sqlx/query-47e131061ca46b535e7610767eb5e80026e67ee62235c9c5b2f91ea88f7fdb19.json new file mode 100644 index 000000000..bc225186e --- /dev/null +++ b/core/deposit/.sqlx/query-47e131061ca46b535e7610767eb5e80026e67ee62235c9c5b2f91ea88f7fdb19.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, id FROM core_deposits WHERE ((deposit_account_id = $1) AND (COALESCE(id > $3, true))) ORDER BY id ASC LIMIT $2) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "47e131061ca46b535e7610767eb5e80026e67ee62235c9c5b2f91ea88f7fdb19" +} diff --git a/core/deposit/.sqlx/query-4b6c51381b49631484d7318e49412c2861fb8a6ca78eeb12c99ea56e946e8fd8.json b/core/deposit/.sqlx/query-4b6c51381b49631484d7318e49412c2861fb8a6ca78eeb12c99ea56e946e8fd8.json new file mode 100644 index 000000000..e3ab47346 --- /dev/null +++ b/core/deposit/.sqlx/query-4b6c51381b49631484d7318e49412c2861fb8a6ca78eeb12c99ea56e946e8fd8.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH max_sequence AS (\n SELECT COALESCE(MAX(sequence), 0) AS max FROM persistent_outbox_events\n )\n SELECT\n g.seq AS \"sequence!: EventSequence\",\n e.id AS \"id?\",\n e.payload AS \"payload?\",\n e.recorded_at AS \"recorded_at?\"\n FROM\n generate_series(LEAST($1 + 1, (SELECT max FROM max_sequence)),\n LEAST($1 + $2, (SELECT max FROM max_sequence)))\n AS g(seq)\n LEFT JOIN\n persistent_outbox_events e ON g.seq = e.sequence\n WHERE\n g.seq > $1\n ORDER BY\n g.seq ASC\n LIMIT $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "sequence!: EventSequence", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "id?", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "payload?", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at?", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [ + null, + false, + true, + false + ] + }, + "hash": "4b6c51381b49631484d7318e49412c2861fb8a6ca78eeb12c99ea56e946e8fd8" +} diff --git a/core/deposit/.sqlx/query-56a93a89179b42b6c18ccfbd9aa6012ca664f55cb601a19e0ced610e5b442296.json b/core/deposit/.sqlx/query-56a93a89179b42b6c18ccfbd9aa6012ca664f55cb601a19e0ced610e5b442296.json new file mode 100644 index 000000000..71459709a --- /dev/null +++ b/core/deposit/.sqlx/query-56a93a89179b42b6c18ccfbd9aa6012ca664f55cb601a19e0ced610e5b442296.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, created_at, id FROM core_deposits WHERE ((deposit_account_id = $1) AND (COALESCE((created_at, id) > ($4, $3), $3 IS NULL))) ORDER BY created_at ASC, id ASC LIMIT $2) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "56a93a89179b42b6c18ccfbd9aa6012ca664f55cb601a19e0ced610e5b442296" +} diff --git a/core/deposit/.sqlx/query-6652182373e14925412ce85f358c64af3a98ec895e1747e2ce6a61221af8c657.json b/core/deposit/.sqlx/query-6652182373e14925412ce85f358c64af3a98ec895e1747e2ce6a61221af8c657.json new file mode 100644 index 000000000..08b2302b0 --- /dev/null +++ b/core/deposit/.sqlx/query-6652182373e14925412ce85f358c64af3a98ec895e1747e2ce6a61221af8c657.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, created_at, id FROM core_deposits WHERE ((deposit_account_id = $1) AND (COALESCE((created_at, id) < ($4, $3), $3 IS NULL))) ORDER BY created_at DESC, id DESC LIMIT $2) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "6652182373e14925412ce85f358c64af3a98ec895e1747e2ce6a61221af8c657" +} diff --git a/core/deposit/.sqlx/query-66660428ec43617b9017f0f4d08630c3934c48c74e14bd08fd81d70880c5ae65.json b/core/deposit/.sqlx/query-66660428ec43617b9017f0f4d08630c3934c48c74e14bd08fd81d70880c5ae65.json new file mode 100644 index 000000000..b7dbe210c --- /dev/null +++ b/core/deposit/.sqlx/query-66660428ec43617b9017f0f4d08630c3934c48c74e14bd08fd81d70880c5ae65.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO deposit_account_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "66660428ec43617b9017f0f4d08630c3934c48c74e14bd08fd81d70880c5ae65" +} diff --git a/core/deposit/.sqlx/query-697f26ecc715a804258dfb0112308539202abe4dd3af28d528bedcd09b551cab.json b/core/deposit/.sqlx/query-697f26ecc715a804258dfb0112308539202abe4dd3af28d528bedcd09b551cab.json new file mode 100644 index 000000000..c76e1cd1e --- /dev/null +++ b/core/deposit/.sqlx/query-697f26ecc715a804258dfb0112308539202abe4dd3af28d528bedcd09b551cab.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO core_deposits (id, deposit_account_id, reference, created_at) VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Varchar", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "697f26ecc715a804258dfb0112308539202abe4dd3af28d528bedcd09b551cab" +} diff --git a/core/deposit/.sqlx/query-75052c2b453721eae52cfaf6e65c9b5067c492748febc14e8e2b40925422eea7.json b/core/deposit/.sqlx/query-75052c2b453721eae52cfaf6e65c9b5067c492748febc14e8e2b40925422eea7.json new file mode 100644 index 000000000..c050398ce --- /dev/null +++ b/core/deposit/.sqlx/query-75052c2b453721eae52cfaf6e65c9b5067c492748febc14e8e2b40925422eea7.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_deposits WHERE deposit_account_id = $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "75052c2b453721eae52cfaf6e65c9b5067c492748febc14e8e2b40925422eea7" +} diff --git a/core/deposit/.sqlx/query-769e2b41629abb4c12e1b195dee654423c0b2415cae74021b701cc3ed1a6a72c.json b/core/deposit/.sqlx/query-769e2b41629abb4c12e1b195dee654423c0b2415cae74021b701cc3ed1a6a72c.json new file mode 100644 index 000000000..b22a7fa7c --- /dev/null +++ b/core/deposit/.sqlx/query-769e2b41629abb4c12e1b195dee654423c0b2415cae74021b701cc3ed1a6a72c.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM core_deposits WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "769e2b41629abb4c12e1b195dee654423c0b2415cae74021b701cc3ed1a6a72c" +} diff --git a/core/deposit/.sqlx/query-77b298409650fb826ef92b5cbc7bc30091a70e30b6615cd1da20f5b2ada92971.json b/core/deposit/.sqlx/query-77b298409650fb826ef92b5cbc7bc30091a70e30b6615cd1da20f5b2ada92971.json new file mode 100644 index 000000000..f9375e0c7 --- /dev/null +++ b/core/deposit/.sqlx/query-77b298409650fb826ef92b5cbc7bc30091a70e30b6615cd1da20f5b2ada92971.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM deposit_accounts WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "77b298409650fb826ef92b5cbc7bc30091a70e30b6615cd1da20f5b2ada92971" +} diff --git a/core/deposit/.sqlx/query-7a03aaa2e73d95b0273bcbfac7fe56cc9e0c427d7c32e6a2e1d9e66f43231623.json b/core/deposit/.sqlx/query-7a03aaa2e73d95b0273bcbfac7fe56cc9e0c427d7c32e6a2e1d9e66f43231623.json new file mode 100644 index 000000000..285f3476a --- /dev/null +++ b/core/deposit/.sqlx/query-7a03aaa2e73d95b0273bcbfac7fe56cc9e0c427d7c32e6a2e1d9e66f43231623.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT COALESCE(MAX(sequence), 0) AS \"max!\" FROM persistent_outbox_events", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "max!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "7a03aaa2e73d95b0273bcbfac7fe56cc9e0c427d7c32e6a2e1d9e66f43231623" +} diff --git a/core/deposit/.sqlx/query-7b0d547dda8c4a6ce921025c2e8dd7c9d0b2bbbda1f62fe3c82e5ada575f1bb6.json b/core/deposit/.sqlx/query-7b0d547dda8c4a6ce921025c2e8dd7c9d0b2bbbda1f62fe3c82e5ada575f1bb6.json new file mode 100644 index 000000000..b2d3f7452 --- /dev/null +++ b/core/deposit/.sqlx/query-7b0d547dda8c4a6ce921025c2e8dd7c9d0b2bbbda1f62fe3c82e5ada575f1bb6.json @@ -0,0 +1,52 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT id AS \"id: AuditEntryId\", subject, object, action, authorized, recorded_at\n FROM audit_entries\n WHERE id = ANY($1)\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: AuditEntryId", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "subject", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "object", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "action", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "authorized", + "type_info": "Bool" + }, + { + "ordinal": 5, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "7b0d547dda8c4a6ce921025c2e8dd7c9d0b2bbbda1f62fe3c82e5ada575f1bb6" +} diff --git a/core/deposit/.sqlx/query-80de7b594db20b2c5f17d3b803fb44ec8e0639c0f896b11baf340f2092677129.json b/core/deposit/.sqlx/query-80de7b594db20b2c5f17d3b803fb44ec8e0639c0f896b11baf340f2092677129.json new file mode 100644 index 000000000..c8aa136cc --- /dev/null +++ b/core/deposit/.sqlx/query-80de7b594db20b2c5f17d3b803fb44ec8e0639c0f896b11baf340f2092677129.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_deposits WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "80de7b594db20b2c5f17d3b803fb44ec8e0639c0f896b11baf340f2092677129" +} diff --git a/core/deposit/.sqlx/query-8ea5f8d69ed4ad9113e4908cf740743f30dfbe27e5432c6587968ea0c2b73369.json b/core/deposit/.sqlx/query-8ea5f8d69ed4ad9113e4908cf740743f30dfbe27e5432c6587968ea0c2b73369.json new file mode 100644 index 000000000..8c4ce1ff9 --- /dev/null +++ b/core/deposit/.sqlx/query-8ea5f8d69ed4ad9113e4908cf740743f30dfbe27e5432c6587968ea0c2b73369.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM deposit_accounts WHERE id = $1) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "8ea5f8d69ed4ad9113e4908cf740743f30dfbe27e5432c6587968ea0c2b73369" +} diff --git a/core/deposit/.sqlx/query-9af6eb14d4bb659fbfc6511756490722479c365d4760a490ec136a1ef9ebb979.json b/core/deposit/.sqlx/query-9af6eb14d4bb659fbfc6511756490722479c365d4760a490ec136a1ef9ebb979.json new file mode 100644 index 000000000..14fc40a50 --- /dev/null +++ b/core/deposit/.sqlx/query-9af6eb14d4bb659fbfc6511756490722479c365d4760a490ec136a1ef9ebb979.json @@ -0,0 +1,31 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO audit_entries (subject, object, action, authorized)\n VALUES ($1, $2, $3, $4)\n RETURNING id, subject\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "subject", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Bool" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "9af6eb14d4bb659fbfc6511756490722479c365d4760a490ec136a1ef9ebb979" +} diff --git a/core/deposit/.sqlx/query-a1dcaba56af024322df454768c2cef9cd0fbcf91128bb4e2a372a16e3b9b8c69.json b/core/deposit/.sqlx/query-a1dcaba56af024322df454768c2cef9cd0fbcf91128bb4e2a372a16e3b9b8c69.json new file mode 100644 index 000000000..49d89a244 --- /dev/null +++ b/core/deposit/.sqlx/query-a1dcaba56af024322df454768c2cef9cd0fbcf91128bb4e2a372a16e3b9b8c69.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO persistent_outbox_events (sequence)\n SELECT unnest($1::bigint[]) AS sequence\n ON CONFLICT (sequence) DO UPDATE\n SET sequence = EXCLUDED.sequence\n RETURNING id, sequence AS \"sequence!: EventSequence\", payload, recorded_at\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence!: EventSequence", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "payload", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + }, + "nullable": [ + false, + false, + true, + false + ] + }, + "hash": "a1dcaba56af024322df454768c2cef9cd0fbcf91128bb4e2a372a16e3b9b8c69" +} diff --git a/core/deposit/.sqlx/query-be503ebd92a55095d55f425717738f6931baa191d2469f30a09b76acab2bbe32.json b/core/deposit/.sqlx/query-be503ebd92a55095d55f425717738f6931baa191d2469f30a09b76acab2bbe32.json new file mode 100644 index 000000000..5122b8a19 --- /dev/null +++ b/core/deposit/.sqlx/query-be503ebd92a55095d55f425717738f6931baa191d2469f30a09b76acab2bbe32.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE core_deposits SET reference = $2 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "be503ebd92a55095d55f425717738f6931baa191d2469f30a09b76acab2bbe32" +} diff --git a/core/deposit/.sqlx/query-c231caf2cdfc7a61e91f230ee1a02672d8159fb2bff2aa35be28a5193febea36.json b/core/deposit/.sqlx/query-c231caf2cdfc7a61e91f230ee1a02672d8159fb2bff2aa35be28a5193febea36.json new file mode 100644 index 000000000..6ea7cf34e --- /dev/null +++ b/core/deposit/.sqlx/query-c231caf2cdfc7a61e91f230ee1a02672d8159fb2bff2aa35be28a5193febea36.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_deposits WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "c231caf2cdfc7a61e91f230ee1a02672d8159fb2bff2aa35be28a5193febea36" +} diff --git a/core/deposit/.sqlx/query-cfde9407b814888676bae2c43c29791052da1117559c851b9c003fe2c4483c19.json b/core/deposit/.sqlx/query-cfde9407b814888676bae2c43c29791052da1117559c851b9c003fe2c4483c19.json new file mode 100644 index 000000000..c7b6647b4 --- /dev/null +++ b/core/deposit/.sqlx/query-cfde9407b814888676bae2c43c29791052da1117559c851b9c003fe2c4483c19.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM deposit_accounts i JOIN deposit_account_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "cfde9407b814888676bae2c43c29791052da1117559c851b9c003fe2c4483c19" +} diff --git a/core/deposit/.sqlx/query-d17a8eecb086b7593ee3e83c3a3576dcdcabb95d9c559c34d62547e3d36ac2fa.json b/core/deposit/.sqlx/query-d17a8eecb086b7593ee3e83c3a3576dcdcabb95d9c559c34d62547e3d36ac2fa.json new file mode 100644 index 000000000..4645e5ed6 --- /dev/null +++ b/core/deposit/.sqlx/query-d17a8eecb086b7593ee3e83c3a3576dcdcabb95d9c559c34d62547e3d36ac2fa.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT account_holder_id, created_at, id FROM deposit_accounts WHERE ((account_holder_id = $1) AND (COALESCE((created_at, id) < ($4, $3), $3 IS NULL))) ORDER BY created_at DESC, id DESC LIMIT $2) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d17a8eecb086b7593ee3e83c3a3576dcdcabb95d9c559c34d62547e3d36ac2fa" +} diff --git a/core/deposit/.sqlx/query-d904610a418a5ac37f82313e0a1cfbc2697554a02545749dbf398705bee034f1.json b/core/deposit/.sqlx/query-d904610a418a5ac37f82313e0a1cfbc2697554a02545749dbf398705bee034f1.json new file mode 100644 index 000000000..c6454531d --- /dev/null +++ b/core/deposit/.sqlx/query-d904610a418a5ac37f82313e0a1cfbc2697554a02545749dbf398705bee034f1.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO deposit_account_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "d904610a418a5ac37f82313e0a1cfbc2697554a02545749dbf398705bee034f1" +} diff --git a/core/deposit/.sqlx/query-da8bde1919fb0a4471ed9bed8b81050c40e68e8028cb4d118f4ad5c881e09081.json b/core/deposit/.sqlx/query-da8bde1919fb0a4471ed9bed8b81050c40e68e8028cb4d118f4ad5c881e09081.json new file mode 100644 index 000000000..d0c5c79c7 --- /dev/null +++ b/core/deposit/.sqlx/query-da8bde1919fb0a4471ed9bed8b81050c40e68e8028cb4d118f4ad5c881e09081.json @@ -0,0 +1,34 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH new_events AS (\n INSERT INTO persistent_outbox_events (payload)\n SELECT unnest($1::jsonb[]) AS payload\n RETURNING id AS \"id: OutboxEventId\", sequence AS \"sequence: EventSequence\", recorded_at\n )\n SELECT * FROM new_events\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: OutboxEventId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence: EventSequence", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "JsonbArray" + ] + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "da8bde1919fb0a4471ed9bed8b81050c40e68e8028cb4d118f4ad5c881e09081" +} diff --git a/core/deposit/.sqlx/query-df0eb4298a26ac09dca4d645e42de3db5fbd5b24ad2c99a6bb4183c5c6f86d43.json b/core/deposit/.sqlx/query-df0eb4298a26ac09dca4d645e42de3db5fbd5b24ad2c99a6bb4183c5c6f86d43.json new file mode 100644 index 000000000..ea9b7f2a6 --- /dev/null +++ b/core/deposit/.sqlx/query-df0eb4298a26ac09dca4d645e42de3db5fbd5b24ad2c99a6bb4183c5c6f86d43.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM deposit_accounts WHERE account_holder_id = $1) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "df0eb4298a26ac09dca4d645e42de3db5fbd5b24ad2c99a6bb4183c5c6f86d43" +} diff --git a/core/deposit/.sqlx/query-e30cab1a790ff1dfce307ae2f174d551f322a1d72fd2cf639685a1a2cf4cbd3f.json b/core/deposit/.sqlx/query-e30cab1a790ff1dfce307ae2f174d551f322a1d72fd2cf639685a1a2cf4cbd3f.json new file mode 100644 index 000000000..480c04811 --- /dev/null +++ b/core/deposit/.sqlx/query-e30cab1a790ff1dfce307ae2f174d551f322a1d72fd2cf639685a1a2cf4cbd3f.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO core_deposit_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "e30cab1a790ff1dfce307ae2f174d551f322a1d72fd2cf639685a1a2cf4cbd3f" +} diff --git a/core/deposit/.sqlx/query-e99ee286fc20a1957a2bcff1c70808d7bc6b8ae881c6d445bec38d79a6a032af.json b/core/deposit/.sqlx/query-e99ee286fc20a1957a2bcff1c70808d7bc6b8ae881c6d445bec38d79a6a032af.json new file mode 100644 index 000000000..a6564e359 --- /dev/null +++ b/core/deposit/.sqlx/query-e99ee286fc20a1957a2bcff1c70808d7bc6b8ae881c6d445bec38d79a6a032af.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT account_holder_id, id FROM deposit_accounts WHERE ((account_holder_id = $1) AND (COALESCE(id > $3, true))) ORDER BY id ASC LIMIT $2) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e99ee286fc20a1957a2bcff1c70808d7bc6b8ae881c6d445bec38d79a6a032af" +} diff --git a/core/deposit/.sqlx/query-f4215515cb8b8e4823a28867e118e7dc5877a809396cc1687fb287654dfbc126.json b/core/deposit/.sqlx/query-f4215515cb8b8e4823a28867e118e7dc5877a809396cc1687fb287654dfbc126.json new file mode 100644 index 000000000..75085b9d9 --- /dev/null +++ b/core/deposit/.sqlx/query-f4215515cb8b8e4823a28867e118e7dc5877a809396cc1687fb287654dfbc126.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT account_holder_id, created_at, id FROM deposit_accounts WHERE ((account_holder_id = $1) AND (COALESCE((created_at, id) > ($4, $3), $3 IS NULL))) ORDER BY created_at ASC, id ASC LIMIT $2) SELECT i.id AS \"entity_id: DepositAccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN deposit_account_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositAccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f4215515cb8b8e4823a28867e118e7dc5877a809396cc1687fb287654dfbc126" +} diff --git a/core/deposit/.sqlx/query-f7769c30ea3f8b0a4f96a3a033c9f28a94eaba9cccca0d51f6d19fe435967dbb.json b/core/deposit/.sqlx/query-f7769c30ea3f8b0a4f96a3a033c9f28a94eaba9cccca0d51f6d19fe435967dbb.json new file mode 100644 index 000000000..6c590f49e --- /dev/null +++ b/core/deposit/.sqlx/query-f7769c30ea3f8b0a4f96a3a033c9f28a94eaba9cccca0d51f6d19fe435967dbb.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_deposits WHERE reference = $1) SELECT i.id AS \"entity_id: DepositId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_deposit_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: DepositId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f7769c30ea3f8b0a4f96a3a033c9f28a94eaba9cccca0d51f6d19fe435967dbb" +} diff --git a/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} From 8910ba9adc0e2d0bcbe52a4c9064176b245f006a Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Tue, 10 Dec 2024 21:50:48 +0100 Subject: [PATCH 13/24] refactor: rename AccountHolderId -> DepositAccountHolderId --- core/deposit/src/account/entity.rs | 4 ++-- core/deposit/src/account/repo.rs | 4 ++-- core/deposit/src/lib.rs | 2 +- core/deposit/src/primitives.rs | 2 +- core/deposit/tests/deposit.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/deposit/src/account/entity.rs b/core/deposit/src/account/entity.rs index beded7b7a..f1c8fafd9 100644 --- a/core/deposit/src/account/entity.rs +++ b/core/deposit/src/account/entity.rs @@ -13,7 +13,7 @@ use crate::primitives::*; pub enum DepositAccountEvent { Initialized { id: DepositAccountId, - account_holder_id: AccountHolderId, + account_holder_id: DepositAccountHolderId, ledger_account_id: LedgerAccountId, audit_info: AuditInfo, }, @@ -43,7 +43,7 @@ pub struct NewDepositAccount { #[builder(setter(into))] pub(super) id: DepositAccountId, #[builder(setter(into))] - pub(super) account_holder_id: AccountHolderId, + pub(super) account_holder_id: DepositAccountHolderId, #[builder(setter(into))] pub audit_info: AuditInfo, } diff --git a/core/deposit/src/account/repo.rs b/core/deposit/src/account/repo.rs index eb3cea3d3..d20cc35b1 100644 --- a/core/deposit/src/account/repo.rs +++ b/core/deposit/src/account/repo.rs @@ -2,7 +2,7 @@ use sqlx::PgPool; use es_entity::*; -use crate::primitives::{AccountHolderId, DepositAccountId}; +use crate::primitives::{DepositAccountHolderId, DepositAccountId}; use super::{entity::*, error::*}; @@ -10,7 +10,7 @@ use super::{entity::*, error::*}; #[es_repo( entity = "DepositAccount", err = "DepositAccountError", - columns(account_holder_id(ty = "AccountHolderId", list_for, update(persist = false))) + columns(account_holder_id(ty = "DepositAccountHolderId", list_for, update(persist = false))) )] pub struct DepositAccountRepo { #[allow(dead_code)] diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index 16b4532f6..bed0db52b 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -82,7 +82,7 @@ where pub async fn create_account( &self, sub: &<::Audit as AuditSvc>::Subject, - holder_id: impl Into + std::fmt::Debug, + holder_id: impl Into + std::fmt::Debug, ) -> Result { let audit_info = self .authz diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index 727ebe0fa..d89352289 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -8,7 +8,7 @@ pub use cala_ledger::primitives::{ }; es_entity::entity_id! { - AccountHolderId, + DepositAccountHolderId, DepositAccountId, DepositId; diff --git a/core/deposit/tests/deposit.rs b/core/deposit/tests/deposit.rs index aac642615..ee3fc793d 100644 --- a/core/deposit/tests/deposit.rs +++ b/core/deposit/tests/deposit.rs @@ -43,7 +43,7 @@ async fn deposit() -> anyhow::Result<()> { let deposit = CoreDeposit::init(&pool, &authz, &outbox, &cala, journal_id, omnibus_code).await?; - let account_holder_id = AccountHolderId::new(); + let account_holder_id = DepositAccountHolderId::new(); let account = deposit .create_account(&DummySubject, account_holder_id) .await?; From 6db5cc364ff207b28e398f57ab5e97eceb54e1c9 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Wed, 11 Dec 2024 12:35:42 +0530 Subject: [PATCH 14/24] chore: withdrawal entity in core --- Cargo.lock | 1 + core/deposit/Cargo.toml | 3 + core/deposit/src/lib.rs | 6 + core/deposit/src/primitives.rs | 5 + core/deposit/src/withdrawal/entity.rs | 129 ++++++++++++++++++ core/deposit/src/withdrawal/error.rs | 13 ++ core/deposit/src/withdrawal/mod.rs | 6 + core/deposit/src/withdrawal/repo.rs | 28 ++++ .../migrations/20240517074612_core_setup.sql | 17 +++ 9 files changed, 208 insertions(+) create mode 100644 core/deposit/src/withdrawal/entity.rs create mode 100644 core/deposit/src/withdrawal/error.rs create mode 100644 core/deposit/src/withdrawal/mod.rs create mode 100644 core/deposit/src/withdrawal/repo.rs diff --git a/Cargo.lock b/Cargo.lock index 6e9ea7733..276b03623 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1202,6 +1202,7 @@ dependencies = [ "core-money", "derive_builder", "es-entity", + "governance", "outbox", "rust_decimal", "rust_decimal_macros", diff --git a/core/deposit/Cargo.toml b/core/deposit/Cargo.toml index 4297ac90f..620d4f548 100644 --- a/core/deposit/Cargo.toml +++ b/core/deposit/Cargo.toml @@ -5,11 +5,14 @@ edition = "2021" [features] +default = ["governance"] fail-on-warnings = [] graphql = ["es-entity/graphql"] +governance = ["dep:governance"] [dependencies] core-money = { path = "../money" } +governance = { path = "../governance", optional = true } audit = { path = "../../lib/audit" } authz = { path = "../../lib/authz" } diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index bed0db52b..64f1991b2 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -7,6 +7,7 @@ pub mod error; mod event; mod ledger; mod primitives; +mod withdrawal; use tracing::instrument; @@ -21,6 +22,7 @@ use error::*; pub use event::*; use ledger::*; pub use primitives::*; +use withdrawal::*; pub struct CoreDeposit where @@ -29,6 +31,7 @@ where { accounts: DepositAccountRepo, deposits: DepositRepo, + withdrawals: WithdrawalRepo, ledger: DepositLedger, authz: Perms, outbox: Outbox, @@ -43,6 +46,7 @@ where Self { accounts: self.accounts.clone(), deposits: self.deposits.clone(), + withdrawals: self.withdrawals.clone(), ledger: self.ledger.clone(), authz: self.authz.clone(), outbox: self.outbox.clone(), @@ -67,10 +71,12 @@ where ) -> Result { let accounts = DepositAccountRepo::new(pool); let deposits = DepositRepo::new(pool); + let withdrawals = WithdrawalRepo::new(pool); let ledger = DepositLedger::init(cala, journal_id, omnibus_account_code).await?; let res = Self { accounts, deposits, + withdrawals, authz: authz.clone(), outbox: outbox.clone(), ledger, diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index d89352289..c08e3b0dd 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -7,13 +7,18 @@ pub use cala_ledger::primitives::{ TransactionId as LedgerTransactionId, }; +pub use governance::ApprovalProcessId; + es_entity::entity_id! { DepositAccountHolderId, DepositAccountId, + WithdrawalId, DepositId; DepositAccountId => LedgerAccountId, DepositId => LedgerTransactionId, + WithdrawalId => LedgerTransactionId + } pub use core_money::UsdCents; diff --git a/core/deposit/src/withdrawal/entity.rs b/core/deposit/src/withdrawal/entity.rs new file mode 100644 index 000000000..0605e9920 --- /dev/null +++ b/core/deposit/src/withdrawal/entity.rs @@ -0,0 +1,129 @@ +use derive_builder::Builder; +use serde::{Deserialize, Serialize}; + +use es_entity::*; + +use audit::AuditInfo; + +use crate::primitives::{ApprovalProcessId, DepositAccountId, LedgerTransactionId, WithdrawalId}; + +#[derive(EsEvent, Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "type", rename_all = "snake_case")] +#[es_event(id = "WithdrawalId")] +pub enum WithdrawalEvent { + Initialized { + id: WithdrawalId, + deposit_account_id: DepositAccountId, + reference: String, + audit_info: AuditInfo, + }, + ApprovalProcessStarted { + approval_process_id: ApprovalProcessId, + audit_info: AuditInfo, + }, + ApprovalProcessConcluded { + approval_process_id: ApprovalProcessId, + approved: bool, + audit_info: AuditInfo, + }, + Confirmed { + ledger_tx_id: LedgerTransactionId, + audit_info: AuditInfo, + }, + Cancelled { + ledger_tx_id: LedgerTransactionId, + audit_info: AuditInfo, + }, +} + +#[derive(EsEntity, Builder)] +#[builder(pattern = "owned", build_fn(error = "EsEntityError"))] +pub struct Withdrawal { + pub id: WithdrawalId, + pub deposit_account_id: DepositAccountId, + pub reference: String, + pub approval_process_id: ApprovalProcessId, + pub(super) events: EntityEvents, +} + +impl Withdrawal { + pub fn created_at(&self) -> chrono::DateTime { + self.events + .entity_first_persisted_at() + .expect("No events for deposit") + } +} + +impl TryFromEvents for Withdrawal { + fn try_from_events(events: EntityEvents) -> Result { + let mut builder = WithdrawalBuilder::default(); + for event in events.iter_all() { + match event { + WithdrawalEvent::Initialized { + id, + reference, + deposit_account_id, + .. + } => { + builder = builder + .id(*id) + .deposit_account_id(*deposit_account_id) + .reference(reference.clone()); + } + WithdrawalEvent::ApprovalProcessStarted { + approval_process_id, + .. + } => builder = builder.approval_process_id(*approval_process_id), + _ => {} + } + } + builder.events(events).build() + } +} + +#[derive(Debug, Builder)] +pub struct NewWithdrawal { + #[builder(setter(into))] + pub(super) id: WithdrawalId, + #[builder(setter(into))] + pub(super) deposit_account_id: DepositAccountId, + #[builder(setter(into))] + pub(super) approval_process_id: ApprovalProcessId, + reference: Option, + #[builder(setter(into))] + pub audit_info: AuditInfo, +} + +impl NewWithdrawal { + pub fn builder() -> NewWithdrawalBuilder { + NewWithdrawalBuilder::default() + } + + pub(super) fn reference(&self) -> String { + match self.reference.as_deref() { + None => self.id.to_string(), + Some("") => self.id.to_string(), + Some(reference) => reference.to_string(), + } + } +} + +impl IntoEvents for NewWithdrawal { + fn into_events(self) -> EntityEvents { + EntityEvents::init( + self.id, + [ + WithdrawalEvent::Initialized { + reference: self.reference(), + id: self.id, + deposit_account_id: self.deposit_account_id, + audit_info: self.audit_info.clone(), + }, + WithdrawalEvent::ApprovalProcessStarted { + approval_process_id: self.approval_process_id, + audit_info: self.audit_info, + }, + ], + ) + } +} diff --git a/core/deposit/src/withdrawal/error.rs b/core/deposit/src/withdrawal/error.rs new file mode 100644 index 000000000..eeaa300eb --- /dev/null +++ b/core/deposit/src/withdrawal/error.rs @@ -0,0 +1,13 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum WithdrawalError { + #[error("WithdrawalError - Sqlx: {0}")] + Sqlx(#[from] sqlx::Error), + #[error("WithdrawalError - EsEntityError: {0}")] + EsEntityError(es_entity::EsEntityError), + #[error("WithdrawalError - CursorDestructureError: {0}")] + CursorDestructureError(#[from] es_entity::CursorDestructureError), +} + +es_entity::from_es_entity_error!(WithdrawalError); diff --git a/core/deposit/src/withdrawal/mod.rs b/core/deposit/src/withdrawal/mod.rs new file mode 100644 index 000000000..14499942d --- /dev/null +++ b/core/deposit/src/withdrawal/mod.rs @@ -0,0 +1,6 @@ +mod entity; +pub mod error; +mod repo; + +pub(super) use entity::*; +pub(super) use repo::*; diff --git a/core/deposit/src/withdrawal/repo.rs b/core/deposit/src/withdrawal/repo.rs new file mode 100644 index 000000000..eef194bd6 --- /dev/null +++ b/core/deposit/src/withdrawal/repo.rs @@ -0,0 +1,28 @@ +use sqlx::PgPool; + +use es_entity::*; + +use crate::primitives::{ApprovalProcessId, DepositAccountId, WithdrawalId}; + +use super::{entity::*, error::*}; + +#[derive(EsRepo, Clone)] +#[es_repo( + entity = "Withdrawal", + err = "WithdrawalError", + columns( + deposit_account_id(ty = "DepositAccountId", list_for, update(persist = false)), + approval_process_id(ty = "ApprovalProcessId", update(persist = false)), + reference(ty = "String", create(accessor = "reference()")) + ), + tbl_prefix = "core" +)] +pub struct WithdrawalRepo { + pool: PgPool, +} + +impl WithdrawalRepo { + pub fn new(pool: &PgPool) -> Self { + Self { pool: pool.clone() } + } +} diff --git a/lana/app/migrations/20240517074612_core_setup.sql b/lana/app/migrations/20240517074612_core_setup.sql index aab87a1de..54ae3acc6 100644 --- a/lana/app/migrations/20240517074612_core_setup.sql +++ b/lana/app/migrations/20240517074612_core_setup.sql @@ -77,6 +77,23 @@ CREATE TABLE core_deposit_events ( UNIQUE(id, sequence) ); +CREATE TABLE core_withdrawals ( + id UUID PRIMARY KEY, + deposit_account_id UUID NOT NULL REFERENCES deposit_accounts(id), + approval_process_id UUID NOT NULL REFERENCES approval_processes(id), + reference VARCHAR NOT NULL UNIQUE, + created_at TIMESTAMPTZ NOT NULL +); + +CREATE TABLE core_withdrawal_events ( + id UUID NOT NULL REFERENCES core_withdrawals(id), + sequence INT NOT NULL, + event_type VARCHAR NOT NULL, + event JSONB NOT NULL, + recorded_at TIMESTAMPTZ NOT NULL, + UNIQUE(id, sequence) +); + CREATE TABLE customers ( id UUID PRIMARY KEY, email VARCHAR NOT NULL UNIQUE, From 9f01341f5f6d36ba588f3ad0c72eec6e98dd15af Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Wed, 11 Dec 2024 18:59:57 +0530 Subject: [PATCH 15/24] chore: impl withdrawal usecases --- core/deposit/src/error.rs | 2 + core/deposit/src/ledger/mod.rs | 54 ++++++++++++++ .../src/ledger/templates/confirm_withdraw.rs | 16 +++++ core/deposit/src/lib.rs | 71 +++++++++++++++++++ core/deposit/src/primitives.rs | 34 ++++++++- core/deposit/src/withdrawal/entity.rs | 60 +++++++++++++++- core/deposit/src/withdrawal/error.rs | 8 +++ .../migrations/20240517074612_core_setup.sql | 2 +- 8 files changed, 243 insertions(+), 4 deletions(-) diff --git a/core/deposit/src/error.rs b/core/deposit/src/error.rs index dc989b594..cbbef24b5 100644 --- a/core/deposit/src/error.rs +++ b/core/deposit/src/error.rs @@ -10,6 +10,8 @@ pub enum CoreDepositError { DepositAccountError(#[from] crate::account::error::DepositAccountError), #[error("CoreDepositError - DepositError: {0}")] DepositError(#[from] crate::deposit::error::DepositError), + #[error("CoreDepositError - WithdrawalError: {0}")] + WithdrawalError(#[from] crate::withdrawal::error::WithdrawalError), #[error("CoreDepositError - DepositLedgerError: {0}")] DepositLedgerError(#[from] crate::ledger::error::DepositLedgerError), } diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs index 333e3c8f0..21a1cc853 100644 --- a/core/deposit/src/ledger/mod.rs +++ b/core/deposit/src/ledger/mod.rs @@ -5,6 +5,7 @@ use cala_ledger::{ account::{error::AccountError, *}, CalaLedger, Currency, DebitOrCredit, JournalId, TransactionId, }; +use templates::CONFIRM_WITHDRAW_CODE; use crate::primitives::UsdCents; @@ -90,6 +91,59 @@ impl DepositLedger { Ok(()) } + pub async fn initiate_withdrawal( + &self, + op: es_entity::DbOp<'_>, + tx_id: impl Into, + amount: UsdCents, + credit_account_id: impl Into, + ) -> Result<(), DepositLedgerError> { + let tx_id = tx_id.into(); + let mut op = self.cala.ledger_operation_from_db_op(op); + let params = templates::InitiateWithdrawParams { + journal_id: self.journal_id, + currency: self.usd, + amount: amount.to_usd(), + deposit_omnibus_account_id: self.deposit_omnibus_account_id, + credit_account_id: credit_account_id.into(), + }; + + self.cala + .post_transaction_in_op(&mut op, tx_id, templates::INITIATE_WITHDRAW_CODE, params) + .await?; + + op.commit().await?; + Ok(()) + } + + pub async fn confirm_withdrawal( + &self, + op: es_entity::DbOp<'_>, + tx_id: impl Into, + correlation_id: impl Into, + credit_account_id: impl Into, + amount: UsdCents, + external_id: String, + ) -> Result<(), DepositLedgerError> { + let tx_id = tx_id.into(); + let mut op = self.cala.ledger_operation_from_db_op(op); + let params = templates::ConfirmWithdrawParams { + journal_id: self.journal_id, + currency: self.usd, + amount: amount.to_usd(), + deposit_omnibus_account_id: self.deposit_omnibus_account_id, + credit_account_id: credit_account_id.into(), + correlation_id: correlation_id.into(), + external_id, + }; + + self.cala + .post_transaction_in_op(&mut op, tx_id, CONFIRM_WITHDRAW_CODE, params) + .await?; + op.commit().await?; + Ok(()) + } + async fn create_deposit_omnibus_account( cala: &CalaLedger, code: String, diff --git a/core/deposit/src/ledger/templates/confirm_withdraw.rs b/core/deposit/src/ledger/templates/confirm_withdraw.rs index 2164341ec..37200f9f3 100644 --- a/core/deposit/src/ledger/templates/confirm_withdraw.rs +++ b/core/deposit/src/ledger/templates/confirm_withdraw.rs @@ -18,6 +18,8 @@ pub struct ConfirmWithdrawParams { pub amount: Decimal, pub deposit_omnibus_account_id: AccountId, pub credit_account_id: AccountId, + pub correlation_id: String, + pub external_id: String, } impl ConfirmWithdrawParams { @@ -53,6 +55,16 @@ impl ConfirmWithdrawParams { .r#type(ParamDataType::Date) .build() .unwrap(), + NewParamDefinition::builder() + .name("correlation_id") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("external_id") + .r#type(ParamDataType::String) + .build() + .unwrap(), ] } } @@ -64,6 +76,8 @@ impl From for Params { currency, amount, deposit_omnibus_account_id, + correlation_id, + external_id, credit_account_id, }: ConfirmWithdrawParams, ) -> Self { @@ -73,6 +87,8 @@ impl From for Params { params.insert("amount", amount); params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); params.insert("credit_account_id", credit_account_id); + params.insert("correlation_id", correlation_id); + params.insert("external_id", external_id); params.insert("effective", chrono::Utc::now().date_naive()); params diff --git a/core/deposit/src/lib.rs b/core/deposit/src/lib.rs index 64f1991b2..d2491418f 100644 --- a/core/deposit/src/lib.rs +++ b/core/deposit/src/lib.rs @@ -149,6 +149,77 @@ where Ok(deposit) } + pub async fn initiate_withdrawal( + &self, + sub: &<::Audit as AuditSvc>::Subject, + deposit_account_id: DepositAccountId, + amount: UsdCents, + reference: Option, + ) -> Result { + let audit_info = self + .authz + .enforce_permission( + sub, + CoreDepositObject::all_withdrawals(), + CoreDepositAction::WITHDRAWAL_INITIATE, + ) + .await?; + let withdrawal_id = WithdrawalId::new(); + let new_withdrawal = NewWithdrawal::builder() + .id(withdrawal_id) + .deposit_account_id(deposit_account_id) + .reference(reference) + .audit_info(audit_info) + .build() + .expect("Could not build new withdrawal"); + let mut op = self.withdrawals.begin_op().await?; + let withdrawal = self + .withdrawals + .create_in_op(&mut op, new_withdrawal) + .await?; + + // TODO: add approval process and check for balance + self.ledger + .initiate_withdrawal(op, withdrawal_id, amount, deposit_account_id) + .await?; + Ok(withdrawal) + } + + pub async fn confirm_withdrawal( + &self, + sub: &<::Audit as AuditSvc>::Subject, + withdrawal_id: impl Into, + ) -> Result { + let audit_info = self + .authz + .enforce_permission( + sub, + CoreDepositObject::all_withdrawals(), + CoreDepositAction::WITHDRAWAL_INITIATE, + ) + .await?; + let id = withdrawal_id.into(); + let mut withdrawal = self.withdrawals.find_by_id(id).await?; + let mut op = self.withdrawals.begin_op().await?; + let tx_id = withdrawal.confirm(audit_info)?; + self.withdrawals + .update_in_op(&mut op, &mut withdrawal) + .await?; + + self.ledger + .confirm_withdrawal( + op, + tx_id, + withdrawal.id.to_string(), + withdrawal.deposit_account_id, + UsdCents::ZERO, // TODO: use entries from initiate_withdraw to get this + format!("lana:withdraw:{}:confirm", withdrawal.id), + ) + .await?; + + Ok(withdrawal) + } + pub async fn balance( &self, sub: &<::Audit as AuditSvc>::Subject, diff --git a/core/deposit/src/primitives.rs b/core/deposit/src/primitives.rs index c08e3b0dd..c729b6634 100644 --- a/core/deposit/src/primitives.rs +++ b/core/deposit/src/primitives.rs @@ -2,13 +2,14 @@ use std::{fmt::Display, str::FromStr}; use authz::AllOrOne; +#[cfg(feature = "governance")] +pub use governance::ApprovalProcessId; + pub use cala_ledger::primitives::{ AccountId as LedgerAccountId, JournalId as LedgerJournalId, TransactionId as LedgerTransactionId, }; -pub use governance::ApprovalProcessId; - es_entity::entity_id! { DepositAccountHolderId, DepositAccountId, @@ -25,6 +26,7 @@ pub use core_money::UsdCents; pub type DepositAccountAllOrOne = AllOrOne; pub type DepositAllOrOne = AllOrOne; +pub type WithdrawalAllOrOne = AllOrOne; #[derive(Clone, Copy, Debug, PartialEq, strum::EnumDiscriminants)] #[strum_discriminants(derive(strum::Display, strum::EnumString))] @@ -32,6 +34,7 @@ pub type DepositAllOrOne = AllOrOne; pub enum CoreDepositObject { DepositAccount(DepositAccountAllOrOne), Deposit(DepositAllOrOne), + Withdrawal(WithdrawalAllOrOne), } impl CoreDepositObject { @@ -46,6 +49,10 @@ impl CoreDepositObject { pub fn all_deposits() -> Self { CoreDepositObject::Deposit(AllOrOne::All) } + + pub fn all_withdrawals() -> Self { + CoreDepositObject::Withdrawal(AllOrOne::All) + } } impl Display for CoreDepositObject { @@ -55,6 +62,7 @@ impl Display for CoreDepositObject { match self { DepositAccount(obj_ref) => write!(f, "{}/{}", discriminant, obj_ref), Deposit(obj_ref) => write!(f, "{}/{}", discriminant, obj_ref), + Withdrawal(obj_ref) => write!(f, "{}/{}", discriminant, obj_ref), } } } @@ -78,6 +86,12 @@ impl FromStr for CoreDepositObject { .map_err(|_| "could not parse CoreDepositObject")?; CoreDepositObject::Deposit(obj_ref) } + Withdrawal => { + let obj_ref = id + .parse() + .map_err(|_| "could not parse CoreDepositObject")?; + CoreDepositObject::Withdrawal(obj_ref) + } }; Ok(res) } @@ -89,6 +103,7 @@ impl FromStr for CoreDepositObject { pub enum CoreDepositAction { DepositAccount(DepositAccountAction), Deposit(DepositAction), + Withdrawal(WithdrawalAction), } impl CoreDepositAction { @@ -99,6 +114,7 @@ impl CoreDepositAction { CoreDepositAction::DepositAccount(DepositAccountAction::ReadBalance); pub const DEPOSIT_CREATE: Self = CoreDepositAction::Deposit(DepositAction::Create); + pub const WITHDRAWAL_INITIATE: Self = CoreDepositAction::Withdrawal(WithdrawalAction::Initiate); } impl Display for CoreDepositAction { @@ -108,6 +124,7 @@ impl Display for CoreDepositAction { match self { DepositAccount(action) => action.fmt(f), Deposit(action) => action.fmt(f), + Withdrawal(action) => action.fmt(f), } } } @@ -121,6 +138,7 @@ impl FromStr for CoreDepositAction { let res = match entity.parse()? { DepositAccount => CoreDepositAction::from(action.parse::()?), Deposit => CoreDepositAction::from(action.parse::()?), + Withdrawal => CoreDepositAction::from(action.parse::()?), }; Ok(res) } @@ -150,3 +168,15 @@ impl From for CoreDepositAction { CoreDepositAction::Deposit(action) } } + +#[derive(PartialEq, Clone, Copy, Debug, strum::Display, strum::EnumString)] +#[strum(serialize_all = "kebab-case")] +pub enum WithdrawalAction { + Initiate, +} + +impl From for CoreDepositAction { + fn from(action: WithdrawalAction) -> Self { + CoreDepositAction::Withdrawal(action) + } +} diff --git a/core/deposit/src/withdrawal/entity.rs b/core/deposit/src/withdrawal/entity.rs index 0605e9920..0432a93bf 100644 --- a/core/deposit/src/withdrawal/entity.rs +++ b/core/deposit/src/withdrawal/entity.rs @@ -3,9 +3,12 @@ use serde::{Deserialize, Serialize}; use es_entity::*; +#[cfg(feature = "governance")] +use crate::primitives::ApprovalProcessId; +use crate::primitives::{DepositAccountId, LedgerTransactionId, WithdrawalId}; use audit::AuditInfo; -use crate::primitives::{ApprovalProcessId, DepositAccountId, LedgerTransactionId, WithdrawalId}; +use super::error::WithdrawalError; #[derive(EsEvent, Debug, Clone, Serialize, Deserialize)] #[serde(tag = "type", rename_all = "snake_case")] @@ -17,10 +20,12 @@ pub enum WithdrawalEvent { reference: String, audit_info: AuditInfo, }, + #[cfg(feature = "governance")] ApprovalProcessStarted { approval_process_id: ApprovalProcessId, audit_info: AuditInfo, }, + #[cfg(feature = "governance")] ApprovalProcessConcluded { approval_process_id: ApprovalProcessId, approved: bool, @@ -42,6 +47,7 @@ pub struct Withdrawal { pub id: WithdrawalId, pub deposit_account_id: DepositAccountId, pub reference: String, + #[cfg(feature = "governance")] pub approval_process_id: ApprovalProcessId, pub(super) events: EntityEvents, } @@ -52,6 +58,55 @@ impl Withdrawal { .entity_first_persisted_at() .expect("No events for deposit") } + + pub fn confirm( + &mut self, + audit_info: AuditInfo, + ) -> Result { + match self.is_approved_or_denied() { + Some(false) => return Err(WithdrawalError::NotApproved(self.id)), + None => return Err(WithdrawalError::NotApproved(self.id)), + _ => (), + } + + if self.is_confirmed() { + return Err(WithdrawalError::AlreadyConfirmed(self.id)); + } + + if self.is_cancelled() { + return Err(WithdrawalError::AlreadyCancelled(self.id)); + } + + let ledger_tx_id = LedgerTransactionId::new(); + self.events.push(WithdrawalEvent::Confirmed { + ledger_tx_id, + audit_info, + }); + + Ok(ledger_tx_id) + } + + fn is_confirmed(&self) -> bool { + self.events + .iter_all() + .any(|e| matches!(e, WithdrawalEvent::Confirmed { .. })) + } + + pub(super) fn is_approved_or_denied(&self) -> Option { + self.events.iter_all().find_map(|e| { + if let WithdrawalEvent::ApprovalProcessConcluded { approved, .. } = e { + Some(*approved) + } else { + None + } + }) + } + + fn is_cancelled(&self) -> bool { + self.events + .iter_all() + .any(|e| matches!(e, WithdrawalEvent::Cancelled { .. })) + } } impl TryFromEvents for Withdrawal { @@ -70,6 +125,7 @@ impl TryFromEvents for Withdrawal { .deposit_account_id(*deposit_account_id) .reference(reference.clone()); } + #[cfg(feature = "governance")] WithdrawalEvent::ApprovalProcessStarted { approval_process_id, .. @@ -87,6 +143,7 @@ pub struct NewWithdrawal { pub(super) id: WithdrawalId, #[builder(setter(into))] pub(super) deposit_account_id: DepositAccountId, + #[cfg(feature = "governance")] #[builder(setter(into))] pub(super) approval_process_id: ApprovalProcessId, reference: Option, @@ -119,6 +176,7 @@ impl IntoEvents for NewWithdrawal { deposit_account_id: self.deposit_account_id, audit_info: self.audit_info.clone(), }, + #[cfg(feature = "governance")] WithdrawalEvent::ApprovalProcessStarted { approval_process_id: self.approval_process_id, audit_info: self.audit_info, diff --git a/core/deposit/src/withdrawal/error.rs b/core/deposit/src/withdrawal/error.rs index eeaa300eb..81e7a7103 100644 --- a/core/deposit/src/withdrawal/error.rs +++ b/core/deposit/src/withdrawal/error.rs @@ -1,5 +1,7 @@ use thiserror::Error; +use crate::primitives::WithdrawalId; + #[derive(Error, Debug)] pub enum WithdrawalError { #[error("WithdrawalError - Sqlx: {0}")] @@ -8,6 +10,12 @@ pub enum WithdrawalError { EsEntityError(es_entity::EsEntityError), #[error("WithdrawalError - CursorDestructureError: {0}")] CursorDestructureError(#[from] es_entity::CursorDestructureError), + #[error("WithdrawalError - AlreadyConfirmed: {0}")] + AlreadyConfirmed(WithdrawalId), + #[error("WithdrawalError - AlreadyCancelled: {0}")] + AlreadyCancelled(WithdrawalId), + #[error("WithdrawalError - NotApproved: {0}")] + NotApproved(WithdrawalId), } es_entity::from_es_entity_error!(WithdrawalError); diff --git a/lana/app/migrations/20240517074612_core_setup.sql b/lana/app/migrations/20240517074612_core_setup.sql index 54ae3acc6..041d09aa5 100644 --- a/lana/app/migrations/20240517074612_core_setup.sql +++ b/lana/app/migrations/20240517074612_core_setup.sql @@ -80,7 +80,7 @@ CREATE TABLE core_deposit_events ( CREATE TABLE core_withdrawals ( id UUID PRIMARY KEY, deposit_account_id UUID NOT NULL REFERENCES deposit_accounts(id), - approval_process_id UUID NOT NULL REFERENCES approval_processes(id), + approval_process_id UUID REFERENCES approval_processes(id), reference VARCHAR NOT NULL UNIQUE, created_at TIMESTAMPTZ NOT NULL ); From 1daa635680a9c7e60f2d846f8baff346d55c2b23 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 12 Dec 2024 09:18:07 +0100 Subject: [PATCH 16/24] chore: sqlx-prepare --- ...7284bdddedfb421958b14c60dca0f569def13.json | 41 ++++++++++ ...c055897a1f93023072f09fc6317bad9965240.json | 29 +++++++ ...c7a650116df7dc5c650736a8f7e0d096db6e9.json | 28 +++++++ ...803e13ab2c0c03c462bfecc72e2588ec7aa3d.json | 18 +++++ ...3fe363319ad7f0e4984df668b4a4fb524ac41.json | 41 ++++++++++ ...ee46b8f0e59f973d3755fd15e5dba7f6e84ef.json | 40 ++++++++++ ...7cb2bcbfdb27cb21575398ed79d0e5c204105.json | 40 ++++++++++ ...81d4a067e6090b58b2988b1db17f4008f251b.json | 40 ++++++++++ ...81d7b31d7da4f7aaead8d64a7e1a8840b8133.json | 40 ++++++++++ ...8d81dd413bcf8c499b9f9ead5455096975e66.json | 40 ++++++++++ ...14d6d872f3b5753d86531158e9ba854d0fe98.json | 42 +++++++++++ ...a2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json | 18 +++++ ...e1df2adda9f76e60cfc1d9a046cbda7d9b482.json | 20 +++++ ...66a01b944a298a27d8b706d5d03633a769fa8.json | 29 +++++++ ...55985652f3d4611c113b63a479dcc71ed4d06.json | 40 ++++++++++ ...57a637f216963cff3633a9523f44a46df000b.json | 41 ++++++++++ ...62dc19644b7d38c0d5f968af2160f741fe3dc.json | 40 ++++++++++ ...9078bde0a7239c6eb1f725c85ac1dfb730881.json | 40 ++++++++++ ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 +++++ ...2d9e89bc89199926d3adf361418ad501a45ed.json | 40 ++++++++++ ...bc89a052c4ee615d24efd601a0a337d631587.json | 29 +++++++ ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 +++++ ...66462c4184a00f49b745f596a9a48d2866526.json | 18 +++++ ...0c80d6a3463468c838795bdacf25d7e34c550.json | 41 ++++++++++ ...1668f041e396940292012dec1f722395723d4.json | 18 +++++ ...18b7eb04b6b3662c819d9156ca8470b6c33fa.json | 42 +++++++++++ ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 +++ ...6f5432ce8b1b9b8087a6c662ab63f635f231e.json | 18 +++++ ...db13dcc9c4e37a9819451920447983426325c.json | 41 ++++++++++ ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 +++++ ...4c489041858391f80c32e4ec225130ad4ea38.json | 43 +++++++++++ ...94c70e8d83b2c286505f993c6d050992a963a.json | 42 +++++++++++ ...987f9b3227076c7912c07ae5302de8e8983b7.json | 41 ++++++++++ ...930932876aab67e3c7233ade6238f65abae7e.json | 42 +++++++++++ ...04115c0184b6d5efb90e465281248a97035b7.json | 40 ++++++++++ ...09942d115792af4d92ebc6835a4b4dcd1b140.json | 20 +++++ ...95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json | 41 ++++++++++ ...d794d7e148bc365e6c65ddc4e5d6c5118e892.json | 16 ++++ ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 +++++++++++++++ ...9d417d4377b8d48bdf0033a059ddc9d0d845e.json | 40 ++++++++++ ...a9c6d3c24119d5159baf2de193f783aabc1cc.json | 40 ++++++++++ ...342ea95649179cce6431f20bd4436c22ec7b1.json | 40 ++++++++++ ...af293dcc9d7e02f4738c7c2c22ea2a3bb803e.json | 40 ++++++++++ ...453db63a834a9fea6ec03dc9b40b1ffab5245.json | 29 +++++++ ...505c861fe052578a1cc33fbb2c851eb1a1201.json | 16 ++++ ...8e249171ab7be68956199e39c2f97627c7960.json | 29 +++++++ ...021daba8d6c57a904f53fb2387f17c35ddb5f.json | 41 ++++++++++ ...aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json | 40 ++++++++++ ...ef197b999461df83ad615b5a9720a552a01d4.json | 42 +++++++++++ ...4eb1c8d22b885fc76559381153f00fe5d6997.json | 43 +++++++++++ ...b36cfde97707985a667a26734ddaac783bf40.json | 40 ++++++++++ ...24dc37921d5cecf6f4f36441ff106cbabf2f9.json | 42 +++++++++++ ...4505cd08522806f69fb72e5983e6aeada2819.json | 42 +++++++++++ ...40c9177fa54a3a9e310c0c6871ff6d930dd1e.json | 40 ++++++++++ ...ad01fa5cdac730283ce60b91056aadbc5a30e.json | 40 ++++++++++ ...076b61390cead90ed9009821b5754f6d062a0.json | 40 ++++++++++ ...1e78cea75c4b31b08815f29ce116f35b2bd5d.json | 40 ++++++++++ ...b9c7379e3359b0ebd2042262f4b59a5d7f942.json | 18 +++++ ...cde50de9da8caf62c5c8d8c5c54b5925144b0.json | 42 +++++++++++ ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 +++ ...209d8763a8cf017da1bb441011e272f7040c4.json | 40 ++++++++++ ...c15412a584727eb684cd18123a4d2c00929e9.json | 40 ++++++++++ ...201a7014fc209feac8338c3aa03f05e98ace9.json | 18 +++++ ...d763833cf9bbffdd372a446f8e854ce4bdf75.json | 18 +++++ ...bb3de32b627d2421414dc139e4bda879fa839.json | 41 ++++++++++ ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ++++ ...545be4621076c93c1819fe4f9fbd109bfae11.json | 42 +++++++++++ ...3f161551ad2dfc79b54ac0ad6b61ad3b48400.json | 40 ++++++++++ ...50b79c2a69f0ff5938d5e082b86346aeac6c4.json | 43 +++++++++++ ...b89853785c32a5f83cb0b25609329c760428a.json | 19 +++++ ...8695d1456fa5af698639b34dd2f5ca3c73a66.json | 18 +++++ ...560e940a06ed4311bc9a371d5c5df448f75bf.json | 42 +++++++++++ ...557a5d34b451eec43fbc2e72a0c2bba76cdf5.json | 42 +++++++++++ ...2fb599f0aa3aac3b963c50de3476e88140e4b.json | 40 ++++++++++ ...183200e6f742ca0956ed5d35e7e64b9facff5.json | 41 ++++++++++ ...fe9701c8399ef465712207af13ff313e0d798.json | 18 +++++ ...65622acc350311f428392cbe9e41071c6a939.json | 42 +++++++++++ ...aeac4e1c0e3953425a4e62acc8a8039cbe539.json | 18 +++++ ...677d009b8358ad66e72d4f9ff1b161a652000.json | 50 +++++++++++++ ...0c90508d96a54b93a795f7a6e7543c72a9377.json | 15 ++++ ...b9b87cf3ee271fcf85e55d5140b5be5f8ed50.json | 17 +++++ ...38c23990ace1716520b2de81ec58a4d8660ab.json | 41 ++++++++++ ...9c892b469fe2e630d9824372ebb58c22314f2.json | 18 +++++ ...201c27c240e12b86cfbb67142454c22ee18bc.json | 18 +++++ ...51066a70b78643536b15c52d3c48e81a3891d.json | 41 ++++++++++ ...3528db6fdc940b592734ca8dbf7276c936dc0.json | 40 ++++++++++ ...43cc28f976db4fecd622b693bb70dfc5900ec.json | 17 +++++ ...02497e84348ce53b37753b222bd94e19b72f7.json | 40 ++++++++++ ...70c7823d9f85c17f9d98862e425477387ae89.json | 41 ++++++++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ ...54c2ba5b4bbe5302423e42881f3aa551c79f1.json | 42 +++++++++++ ...f1fb9fee700a7a55f5fd658e9a7f8839ed3a2.json | 40 ++++++++++ ...33fd48abe353bbc92cb690d98dcf6f641750f.json | 42 +++++++++++ ...d017d19410792c60ffcb01edaaca1dfeae2ea.json | 41 ++++++++++ ...17cd027ae0327a4dd73a4fd2dec006421e5ad.json | 18 +++++ ...5edb8ac006bf8b55ff7a6f3844aa60ae2eebc.json | 40 ++++++++++ ...8868b00c3c0bdc73fe72a03bae7a807139c6b.json | 42 +++++++++++ ...3de214afa08a8a80cd8fea42bcfcf347dbffe.json | 40 ++++++++++ ...bced2cb50886bab09c62ee7f059b09e709b77.json | 41 ++++++++++ ...45548e54b94b3c72e26aea4ab321734f8ea66.json | 23 ++++++ ...892318fc02212d2b72257665b1fbd6a211343.json | 32 ++++++++ ...25f4f0c25add11e21ac141ba74d66d40f97e4.json | 42 +++++++++++ ...d5b68b491701d52b632de14823dafd5756cd3.json | 42 +++++++++++ ...4083b6626b5bc80d9bef48e9a654183fa7eee.json | 40 ++++++++++ ...bcb949899d97660cf2d5ec2746758b2460300.json | 40 ++++++++++ ...afc2f8698d54286b81ee552c54024b4aacba4.json | 40 ++++++++++ ...d3c9d0907d654138ba2a62cb9bee521fd4a03.json | 42 +++++++++++ ...563f8e80470035de31448f15278b48a3d6fad.json | 18 +++++ ...5eaad28a6b1c99608ba6266d5aecb2e88924a.json | 42 +++++++++++ ...1f8bd1c696138e116201513b54599727b5c74.json | 29 +++++++ ...fa5b6970a56e381e5733a67f4476916319cff.json | 15 ++++ ...48c5d9ff5640e57bfbdb898b2eda0df48519b.json | 42 +++++++++++ ...6aab8b7776927ff58875009b77754073abb64.json | 42 +++++++++++ ...ee908b0c2e2db176cdc639192d4e887ebd4a3.json | 40 ++++++++++ ...9f749f58ae1e85d4cab247dde3caafa24237e.json | 42 +++++++++++ ...f89d23e5a32ecf79d3ba24e6f545bee1931be.json | 43 +++++++++++ ...75388153d6f0cb0f91e4da0741427b00deea4.json | 40 ++++++++++ ...efd04f99f5caac2cbcb30822a660dcba106c2.json | 40 ++++++++++ ...0f665f05d8fb39a8f371b9bbdcd4d35b2280e.json | 42 +++++++++++ ...70649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json | 42 +++++++++++ ...ffd14752b73ae0496b0e552d63f242a7d0eee.json | 18 +++++ ...b51556244512f9f3a858317186423e5174e8f.json | 40 ++++++++++ ...34734050a0cde90ffca641c7b219e29818336.json | 17 +++++ ...61743e95e9d9a6ac18fd3e4fa1b2966604dce.json | 42 +++++++++++ ...dcc9d963cc033582bf2e945e8bf3a301b4247.json | 22 ++++++ ...54488b0ab7620c0df794b0140d4cd29728aba.json | 40 ++++++++++ ...d5856b23aab7bad820f5cb8ff7c9869cb02ad.json | 40 ++++++++++ ...78640d5eac3049bd61d937bd657b24601a3f0.json | 43 +++++++++++ ...1172e87f7ee5ded42f2101a404d487e4e86ea.json | 42 +++++++++++ ...455bae810c560710a00da05a8072cbc4a4444.json | 42 +++++++++++ ...1764d2ca6b3139949b6e19c42054acaf0fd85.json | 40 ++++++++++ ...a0f41f5b7c3475ca4794739e41332a36d106f.json | 15 ++++ ...0998c9da3e94af3323d749b7a6fe9fcfb7cf7.json | 18 +++++ ...7c29302c486144d4bc9793e55ecd7de75a2ea.json | 40 ++++++++++ ...f444f41b33400d31d71de019636f9fc2585a5.json | 40 ++++++++++ ...f88f89c7e55ae4c151d8f1ca0c90576d3907d.json | 40 ++++++++++ ...71d0971c7492f59cbfe94ce28a4d7d18e769e.json | 42 +++++++++++ ...b2571478925ed0183338dd0d1fdfffe5dfc65.json | 18 +++++ ...7f88a5c9be11f7687a9ab1f0629f7f46d8f5c.json | 40 ++++++++++ ...8569d51e2f96631002065e8dd8fcd05e9f5da.json | 40 ++++++++++ ...63f99416d5c3b13fa291b3f7dc01932245529.json | 40 ++++++++++ ...d7e90c5ce385892fb73b24edb16725456270d.json | 41 ++++++++++ ...bc339a06fc7ef23b23ca08209ff3c0984ff73.json | 41 ++++++++++ ...fa1691c2ca2939cb5f3556a682f6d4db2badb.json | 42 +++++++++++ ...21aa42c5879711359aa24e1de89d190303442.json | 18 +++++ ...7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json | 19 +++++ ...bf8b9d382e091a4d4bbd46bfffaccf0b47229.json | 40 ++++++++++ ...12aaf3a0cc3b6c3fdc268a2d38a558310a957.json | 16 ++++ ...0d42a80fdede540dbbcbb0bd220a26234b4ea.json | 23 ++++++ ...5c376cab226ee9072da6069e0a119ef75fc2c.json | 18 +++++ ...d8f29a27d72ec452e16e144f13c8b39828082.json | 41 ++++++++++ ...c2304a2d9a492630adae2e7c089cf02f6490a.json | 40 ++++++++++ ...dddccee12c4023ab3cd7319285f43a90d7aaf.json | 28 +++++++ ...5b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json | 40 ++++++++++ ...ca9fde3349bbdd32a78c8f69930712782b392.json | 41 ++++++++++ ...b60e33ff0b1afb748855b22cde64c19c112c3.json | 18 +++++ ...cb385ca0b8e01ce5132e5aa6f83ab4c497481.json | 40 ++++++++++ ...dd1227bc43f97be6382fa23fe08f9a1d5a585.json | 41 ++++++++++ ...00b4a97ce6d42768e64c2438f1c2d42d42d1e.json | 40 ++++++++++ ...c5a6d813ad66008c21c0a10ead263fff70f13.json | 41 ++++++++++ ...d57c54950e7ea7b81e652afb4227db389f2fe.json | 40 ++++++++++ ...1df5eef2f87e6f57403e9cf8ad809d8c6de5f.json | 42 +++++++++++ ...0619e8c6793419322a882cea05f8a12e3c7cb.json | 42 +++++++++++ ...075dd414d859b95961cd797d32565625234f1.json | 40 ++++++++++ ...698a485634eac2d60ad20fe61bce9b4b92041.json | 41 ++++++++++ ...f1b3ded0740f414586241064c580a06378367.json | 42 +++++++++++ ...e2199fa385a0b2fd7edaf775118d92c1f574e.json | 15 ++++ ...dd96a3dd7109770069959279b129a81229903.json | 18 +++++ ...613008b81814b9c099b1fa62f3885debeae42.json | 40 ++++++++++ ...88c55338536d6542829d1520af1a07bbd2d94.json | 18 +++++ ...b52cd912d85a1dce2e20ef9b16c1d7a16d60c.json | 18 +++++ ...f488c622e88a7f5471ffb590dc0a619e0a891.json | 40 ++++++++++ ...d2901f02535f7866939dad145bd912b36b759.json | 18 +++++ ...be689d2012aef602e07a00c31c774a7bf78a9.json | 42 +++++++++++ ...0256979363c88f2000f5e99fe0a215a8f06d4.json | 42 +++++++++++ ...bac04cebc2e3086e9b184dc0ca5ad75b84673.json | 40 ++++++++++ ...07c93159acfda96c25e0588584d4314b37a6f.json | 40 ++++++++++ ...1a11467a3c77483ebe8591d24758ffbaa4dd3.json | 17 +++++ ...c870090d7b176c96ec449ed4c34b5893da526.json | 40 ++++++++++ ...16adfe905e9f81ced34a875dbb3bdd5cfdc09.json | 40 ++++++++++ ...4a25dd7767f44f9f0daef9aa1d0ab6c553a0b.json | 43 +++++++++++ ...e70ff74e62037c3a84f74f8836756f610d333.json | 40 ++++++++++ ...d5de3f0e72eb1af2315ae27c5496867c3b145.json | 41 ++++++++++ ...7c4deb1dc2d3a7bda6df0bb792469748d534d.json | 40 ++++++++++ ...cc4d06192f9575c97dfe8c907d8cec41d7908.json | 41 ++++++++++ ...226ba97993ede9988a4c57d58bd066500a119.json | 20 +++++ ...9ecd1acc99957b14837f4cd747b9f26b3c02c.json | 17 +++++ ...4de0120a042eaf0bd62e239461276b12abb25.json | 15 ++++ ...2d0f81abad1b07a3d1c4587832b8ae912ae4c.json | 42 +++++++++++ ...fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json | 40 ++++++++++ ...fe97a704b71707bcc506db2feb941b5e314f3.json | 41 ++++++++++ ...5e8c3597c2a54f7f72c9a3a58be9457bd38cb.json | 60 +++++++++++++++ ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 +++++ ...f6cbce2cb9976ede2b5d1c2065f2cc47d27dc.json | 40 ++++++++++ ...4b159f065a1875dd1f02982a1f579c9558087.json | 18 +++++ ...a0cd645e51b04720d1a01a85a778a544b368f.json | 42 +++++++++++ ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ++++ ...f38df6a96e971db2139c10041ad0170cfd0a9.json | 18 +++++ ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 +++++++++++++++++++ ...062c03b1af6949138cc500b1eccd0faf495b3.json | 42 +++++++++++ ...a4c3b885a24f2af3c6e4170285551e2b6ac3c.json | 17 +++++ ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 +++++ ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 +++++ ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 +++ ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 +++++ ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 +++++++++++++++ ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 +++ ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ++++ ...b89853785c32a5f83cb0b25609329c760428a.json | 19 +++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ ...226ba97993ede9988a4c57d58bd066500a119.json | 20 +++++ ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 +++++ ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ++++ ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 +++++++++++++++++++ ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 +++++ ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 +++++ ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 +++ ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 +++++ ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 +++++++++++++++ ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 +++ ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ++++ ...b89853785c32a5f83cb0b25609329c760428a.json | 19 +++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ ...226ba97993ede9988a4c57d58bd066500a119.json | 20 +++++ ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 +++++ ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ++++ ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 +++++++++++++++++++ ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 +++++ ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 +++++ ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 +++ ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 +++++ ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 +++++++++++++++ ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 +++ ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ++++ ...b89853785c32a5f83cb0b25609329c760428a.json | 19 +++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ ...226ba97993ede9988a4c57d58bd066500a119.json | 20 +++++ ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 +++++ ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ++++ ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 +++++++++++++++++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 +++++ 243 files changed, 7891 insertions(+) create mode 100644 core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json create mode 100644 core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json create mode 100644 core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json create mode 100644 core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json create mode 100644 core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json create mode 100644 core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json create mode 100644 core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json create mode 100644 core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json create mode 100644 core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json create mode 100644 core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json create mode 100644 core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json create mode 100644 core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json create mode 100644 core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json create mode 100644 core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json create mode 100644 core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json create mode 100644 core/deposit/.sqlx/query-166f74e9bac033fe87a5db5b44357a637f216963cff3633a9523f44a46df000b.json create mode 100644 core/deposit/.sqlx/query-17f820d557424ee764e3139317d62dc19644b7d38c0d5f968af2160f741fe3dc.json create mode 100644 core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json create mode 100644 core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json create mode 100644 core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json create mode 100644 core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json create mode 100644 core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json create mode 100644 core/deposit/.sqlx/query-210062ee036b0b5c901747bb65466462c4184a00f49b745f596a9a48d2866526.json create mode 100644 core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json create mode 100644 core/deposit/.sqlx/query-22d881277f4f5ab30cfa52a8f741668f041e396940292012dec1f722395723d4.json create mode 100644 core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json create mode 100644 core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json create mode 100644 core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json create mode 100644 core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json create mode 100644 core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json create mode 100644 core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json create mode 100644 core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json create mode 100644 core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json create mode 100644 core/deposit/.sqlx/query-2b1d7fa79075434b7de969a0c05930932876aab67e3c7233ade6238f65abae7e.json create mode 100644 core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json create mode 100644 core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json create mode 100644 core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json create mode 100644 core/deposit/.sqlx/query-2fa6746fe038859c0a60b826981d794d7e148bc365e6c65ddc4e5d6c5118e892.json create mode 100644 core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json create mode 100644 core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json create mode 100644 core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json create mode 100644 core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json create mode 100644 core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json create mode 100644 core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json create mode 100644 core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json create mode 100644 core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json create mode 100644 core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json create mode 100644 core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json create mode 100644 core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json create mode 100644 core/deposit/.sqlx/query-3b700518ff9b8645bb55c8228274eb1c8d22b885fc76559381153f00fe5d6997.json create mode 100644 core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json create mode 100644 core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json create mode 100644 core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json create mode 100644 core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json create mode 100644 core/deposit/.sqlx/query-3f939eb162598958144991a18c4ad01fa5cdac730283ce60b91056aadbc5a30e.json create mode 100644 core/deposit/.sqlx/query-3faa09694d967adc67414ff65a9076b61390cead90ed9009821b5754f6d062a0.json create mode 100644 core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json create mode 100644 core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json create mode 100644 core/deposit/.sqlx/query-41c8a58184b92cb958da2fbb008cde50de9da8caf62c5c8d8c5c54b5925144b0.json create mode 100644 core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json create mode 100644 core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json create mode 100644 core/deposit/.sqlx/query-4695792a24d5b9b4f2784151b66c15412a584727eb684cd18123a4d2c00929e9.json create mode 100644 core/deposit/.sqlx/query-47ce06b9bc1c72f53524ba80b97201a7014fc209feac8338c3aa03f05e98ace9.json create mode 100644 core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json create mode 100644 core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json create mode 100644 core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json create mode 100644 core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json create mode 100644 core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json create mode 100644 core/deposit/.sqlx/query-4ddaa20ede3df1a493c3a91136250b79c2a69f0ff5938d5e082b86346aeac6c4.json create mode 100644 core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json create mode 100644 core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json create mode 100644 core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json create mode 100644 core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json create mode 100644 core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json create mode 100644 core/deposit/.sqlx/query-56298b5483f52dbc43fdee3f99d183200e6f742ca0956ed5d35e7e64b9facff5.json create mode 100644 core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json create mode 100644 core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json create mode 100644 core/deposit/.sqlx/query-5cf7924a6417fd9d6a1fc4fc373aeac4e1c0e3953425a4e62acc8a8039cbe539.json create mode 100644 core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json create mode 100644 core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json create mode 100644 core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json create mode 100644 core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json create mode 100644 core/deposit/.sqlx/query-606f56745ea686c3c98655f1ba29c892b469fe2e630d9824372ebb58c22314f2.json create mode 100644 core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json create mode 100644 core/deposit/.sqlx/query-63cc3d4239b25c639a879f8742951066a70b78643536b15c52d3c48e81a3891d.json create mode 100644 core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json create mode 100644 core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json create mode 100644 core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json create mode 100644 core/deposit/.sqlx/query-694f1dd65b5724fcf6937d56b1770c7823d9f85c17f9d98862e425477387ae89.json create mode 100644 core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json create mode 100644 core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json create mode 100644 core/deposit/.sqlx/query-6c035629a0b60e177f54c64ae17f1fb9fee700a7a55f5fd658e9a7f8839ed3a2.json create mode 100644 core/deposit/.sqlx/query-6f45f539edff97cdbcdf8ba879e33fd48abe353bbc92cb690d98dcf6f641750f.json create mode 100644 core/deposit/.sqlx/query-70a9ee61b82ceea3c197d4aae1fd017d19410792c60ffcb01edaaca1dfeae2ea.json create mode 100644 core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json create mode 100644 core/deposit/.sqlx/query-73042ca58753f878ef7da169e3d5edb8ac006bf8b55ff7a6f3844aa60ae2eebc.json create mode 100644 core/deposit/.sqlx/query-757592f9832c8e1efb9b8dfb0f78868b00c3c0bdc73fe72a03bae7a807139c6b.json create mode 100644 core/deposit/.sqlx/query-77441bd6efa7cff0917b00344393de214afa08a8a80cd8fea42bcfcf347dbffe.json create mode 100644 core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json create mode 100644 core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json create mode 100644 core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json create mode 100644 core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json create mode 100644 core/deposit/.sqlx/query-7bebb58c6ae4876c06a021a9865d5b68b491701d52b632de14823dafd5756cd3.json create mode 100644 core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json create mode 100644 core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json create mode 100644 core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json create mode 100644 core/deposit/.sqlx/query-86f9a2c0b430230f05fbd7ad65ad3c9d0907d654138ba2a62cb9bee521fd4a03.json create mode 100644 core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json create mode 100644 core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json create mode 100644 core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json create mode 100644 core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json create mode 100644 core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json create mode 100644 core/deposit/.sqlx/query-8eb956fdaf23f5438306641d34b6aab8b7776927ff58875009b77754073abb64.json create mode 100644 core/deposit/.sqlx/query-8f1fda3b0a2a441736e6a2a540cee908b0c2e2db176cdc639192d4e887ebd4a3.json create mode 100644 core/deposit/.sqlx/query-8fea8776f584e7d77a1605903ba9f749f58ae1e85d4cab247dde3caafa24237e.json create mode 100644 core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json create mode 100644 core/deposit/.sqlx/query-907e360e9cf644967b883943c7975388153d6f0cb0f91e4da0741427b00deea4.json create mode 100644 core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json create mode 100644 core/deposit/.sqlx/query-91debda9c1f7653b7bcb38a311d0f665f05d8fb39a8f371b9bbdcd4d35b2280e.json create mode 100644 core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json create mode 100644 core/deposit/.sqlx/query-96cb61b0eda9cb5900206353bffffd14752b73ae0496b0e552d63f242a7d0eee.json create mode 100644 core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json create mode 100644 core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json create mode 100644 core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json create mode 100644 core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json create mode 100644 core/deposit/.sqlx/query-a0c05c6256eb12980957aa7060754488b0ab7620c0df794b0140d4cd29728aba.json create mode 100644 core/deposit/.sqlx/query-a1550c7ad93b614b9aa3e1d7800d5856b23aab7bad820f5cb8ff7c9869cb02ad.json create mode 100644 core/deposit/.sqlx/query-a27bea0d43b3ea7c807ef1a668378640d5eac3049bd61d937bd657b24601a3f0.json create mode 100644 core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json create mode 100644 core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json create mode 100644 core/deposit/.sqlx/query-a675bedaa34fd80880639edf6841764d2ca6b3139949b6e19c42054acaf0fd85.json create mode 100644 core/deposit/.sqlx/query-a6fae2f669eeb47bb3bf3f098bea0f41f5b7c3475ca4794739e41332a36d106f.json create mode 100644 core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json create mode 100644 core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json create mode 100644 core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json create mode 100644 core/deposit/.sqlx/query-aad40f81335198b18a07d489f9af88f89c7e55ae4c151d8f1ca0c90576d3907d.json create mode 100644 core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json create mode 100644 core/deposit/.sqlx/query-ac632e983b85db1bbe41afce033b2571478925ed0183338dd0d1fdfffe5dfc65.json create mode 100644 core/deposit/.sqlx/query-aff13ff30fc3d2db3488a7670ba7f88a5c9be11f7687a9ab1f0629f7f46d8f5c.json create mode 100644 core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json create mode 100644 core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json create mode 100644 core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json create mode 100644 core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json create mode 100644 core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json create mode 100644 core/deposit/.sqlx/query-b746b062c9f0b14efec550715d221aa42c5879711359aa24e1de89d190303442.json create mode 100644 core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json create mode 100644 core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json create mode 100644 core/deposit/.sqlx/query-bd4cdd0f1e5e2d5a9d25e162dcb12aaf3a0cc3b6c3fdc268a2d38a558310a957.json create mode 100644 core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json create mode 100644 core/deposit/.sqlx/query-bd95c4f0035427d576ce6870ff35c376cab226ee9072da6069e0a119ef75fc2c.json create mode 100644 core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json create mode 100644 core/deposit/.sqlx/query-beb47657381fba7a11470b3f22ac2304a2d9a492630adae2e7c089cf02f6490a.json create mode 100644 core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json create mode 100644 core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json create mode 100644 core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json create mode 100644 core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json create mode 100644 core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json create mode 100644 core/deposit/.sqlx/query-cc6402da73a5a1ab26212376f75dd1227bc43f97be6382fa23fe08f9a1d5a585.json create mode 100644 core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json create mode 100644 core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json create mode 100644 core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json create mode 100644 core/deposit/.sqlx/query-d316bf8d73764c5b013048816f51df5eef2f87e6f57403e9cf8ad809d8c6de5f.json create mode 100644 core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json create mode 100644 core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json create mode 100644 core/deposit/.sqlx/query-d5e34d8ca71038cafe1ad05732e698a485634eac2d60ad20fe61bce9b4b92041.json create mode 100644 core/deposit/.sqlx/query-d72800579d235eb5cdf731a6678f1b3ded0740f414586241064c580a06378367.json create mode 100644 core/deposit/.sqlx/query-d7b4e73ae21ba6dbb23590862c2e2199fa385a0b2fd7edaf775118d92c1f574e.json create mode 100644 core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json create mode 100644 core/deposit/.sqlx/query-dbe4ece20e9ec7b11016522a24e613008b81814b9c099b1fa62f3885debeae42.json create mode 100644 core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json create mode 100644 core/deposit/.sqlx/query-de8c9894cbf2908e0749d0c267ab52cd912d85a1dce2e20ef9b16c1d7a16d60c.json create mode 100644 core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json create mode 100644 core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json create mode 100644 core/deposit/.sqlx/query-e26f1c624922b283d07e3f92556be689d2012aef602e07a00c31c774a7bf78a9.json create mode 100644 core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json create mode 100644 core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json create mode 100644 core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json create mode 100644 core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json create mode 100644 core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json create mode 100644 core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json create mode 100644 core/deposit/.sqlx/query-e97961667c6ff7b1acc0ef7acad4a25dd7767f44f9f0daef9aa1d0ab6c553a0b.json create mode 100644 core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json create mode 100644 core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json create mode 100644 core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json create mode 100644 core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json create mode 100644 core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json create mode 100644 core/deposit/.sqlx/query-f3fc3e97653e968b7706ad72dbf9ecd1acc99957b14837f4cd747b9f26b3c02c.json create mode 100644 core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json create mode 100644 core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json create mode 100644 core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json create mode 100644 core/deposit/.sqlx/query-f7bac8b748ff6e5b70952d2ff5efe97a704b71707bcc506db2feb941b5e314f3.json create mode 100644 core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json create mode 100644 core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json create mode 100644 core/deposit/.sqlx/query-f8bc7e13180dafd658190520f81f6cbce2cb9976ede2b5d1c2065f2cc47d27dc.json create mode 100644 core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json create mode 100644 core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json create mode 100644 core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json create mode 100644 core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json create mode 100644 core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json create mode 100644 core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json create mode 100644 core/deposit/.sqlx/query-fecae87d783c20d975d3f14748ca4c3b885a24f2af3c6e4170285551e2b6ac3c.json create mode 100644 core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json create mode 100644 core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json create mode 100644 core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json create mode 100644 core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json create mode 100644 core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json create mode 100644 core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json create mode 100644 core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json create mode 100644 core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json create mode 100644 core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json create mode 100644 core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json create mode 100644 core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json create mode 100644 core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json create mode 100644 core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json create mode 100644 lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json create mode 100644 lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json create mode 100644 lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json create mode 100644 lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json create mode 100644 lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json create mode 100644 lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json create mode 100644 lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json create mode 100644 lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json create mode 100644 lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json create mode 100644 lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json create mode 100644 lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json create mode 100644 lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json create mode 100644 lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json create mode 100644 lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json create mode 100644 lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json create mode 100644 lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json create mode 100644 lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json create mode 100644 lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json create mode 100644 lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json create mode 100644 lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json create mode 100644 lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json create mode 100644 lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json create mode 100644 lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json create mode 100644 lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json create mode 100644 lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json create mode 100644 lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json create mode 100644 lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json create mode 100644 lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json create mode 100644 lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json diff --git a/core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json b/core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json new file mode 100644 index 000000000..391c79775 --- /dev/null +++ b/core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_journals WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13" +} diff --git a/core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json b/core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json new file mode 100644 index 000000000..91a2cfce4 --- /dev/null +++ b/core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT m.account_set_id AS \"set_id!: AccountSetId\", m.member_account_id AS \"account_id!: AccountId\"\n FROM cala_account_set_member_accounts m\n JOIN cala_account_sets s\n ON m.account_set_id = s.id AND s.journal_id = $1\n WHERE m.member_account_id = ANY($2)\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "set_id!: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "account_id!: AccountId", + "type_info": "Uuid" + } + ], + "parameters": { + "Left": [ + "Uuid", + "UuidArray" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240" +} diff --git a/core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json b/core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json new file mode 100644 index 000000000..384ed5fff --- /dev/null +++ b/core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT values, latest_values\n FROM cala_velocity_account_controls v\n JOIN cala_accounts a\n ON v.account_id = a.id\n WHERE account_id = ANY($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "values", + "type_info": "Jsonb" + }, + { + "ordinal": 1, + "name": "latest_values", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9" +} diff --git a/core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json b/core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json new file mode 100644 index 000000000..3c559d471 --- /dev/null +++ b/core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_control_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d" +} diff --git a/core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json b/core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json new file mode 100644 index 000000000..287dfdd96 --- /dev/null +++ b/core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41" +} diff --git a/core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json b/core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json new file mode 100644 index 000000000..b7bc3c3b5 --- /dev/null +++ b/core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE data_source_id = $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef" +} diff --git a/core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json b/core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json new file mode 100644 index 000000000..1331d8cdf --- /dev/null +++ b/core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_journals WHERE id = $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105" +} diff --git a/core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json b/core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json new file mode 100644 index 000000000..a2f5768a7 --- /dev/null +++ b/core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE id = $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b" +} diff --git a/core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json b/core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json new file mode 100644 index 000000000..d05c03db4 --- /dev/null +++ b/core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH limits AS (\n SELECT id, l.created_at AS entity_created_at\n FROM cala_velocity_limits l\n JOIN cala_velocity_control_limits ON id = velocity_limit_id\n WHERE velocity_control_id = $1\n )\n SELECT l.id as entity_id, e.sequence, e.event, e.recorded_at\n FROM limits l\n JOIN cala_velocity_limit_events e ON l.id = e.id\n ORDER BY l.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133" +} diff --git a/core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json b/core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json new file mode 100644 index 000000000..b08c966b6 --- /dev/null +++ b/core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM cala_velocity_controls i JOIN cala_velocity_control_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66" +} diff --git a/core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json b/core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json new file mode 100644 index 000000000..de943f998 --- /dev/null +++ b/core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_journals WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98" +} diff --git a/core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json b/core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json new file mode 100644 index 000000000..8d4e43493 --- /dev/null +++ b/core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_control_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22" +} diff --git a/core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json b/core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json new file mode 100644 index 000000000..d01044d32 --- /dev/null +++ b/core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_transactions (id, external_id, correlation_id, journal_id, tx_template_id, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5, $6, $7)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Varchar", + "Uuid", + "Uuid", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482" +} diff --git a/core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json b/core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json new file mode 100644 index 000000000..dd09f67c2 --- /dev/null +++ b/core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n non_transitive_insert AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id)\n VALUES ($1, $2)\n ),\n transitive_insert AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id, transitive)\n SELECT p.account_set_id, $2, TRUE\n FROM parents p\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "account_set_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [ + null, + null + ] + }, + "hash": "142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8" +} diff --git a/core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json b/core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json new file mode 100644 index 000000000..47d9a7db2 --- /dev/null +++ b/core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT h.values, a.normal_balance_type AS \"normal_balance_type!: DebitOrCredit\"\n FROM cala_balance_history h\n JOIN cala_current_balances c\n ON h.journal_id = c.journal_id\n AND h.account_id = c.account_id\n AND h.currency = c.currency\n AND h.version = c.latest_version\n JOIN cala_accounts a\n ON c.account_id = a.id\n WHERE c.journal_id = $1\n AND c.account_id = $2\n AND c.currency = $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "values", + "type_info": "Jsonb" + }, + { + "ordinal": 1, + "name": "normal_balance_type!: DebitOrCredit", + "type_info": { + "Custom": { + "name": "debitorcredit", + "kind": { + "Enum": [ + "debit", + "credit" + ] + } + } + } + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06" +} diff --git a/core/deposit/.sqlx/query-166f74e9bac033fe87a5db5b44357a637f216963cff3633a9523f44a46df000b.json b/core/deposit/.sqlx/query-166f74e9bac033fe87a5db5b44357a637f216963cff3633a9523f44a46df000b.json new file mode 100644 index 000000000..545c94836 --- /dev/null +++ b/core/deposit/.sqlx/query-166f74e9bac033fe87a5db5b44357a637f216963cff3633a9523f44a46df000b.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM policies WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "166f74e9bac033fe87a5db5b44357a637f216963cff3633a9523f44a46df000b" +} diff --git a/core/deposit/.sqlx/query-17f820d557424ee764e3139317d62dc19644b7d38c0d5f968af2160f741fe3dc.json b/core/deposit/.sqlx/query-17f820d557424ee764e3139317d62dc19644b7d38c0d5f968af2160f741fe3dc.json new file mode 100644 index 000000000..6c6bfa6d5 --- /dev/null +++ b/core/deposit/.sqlx/query-17f820d557424ee764e3139317d62dc19644b7d38c0d5f968af2160f741fe3dc.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM approval_processes i JOIN approval_process_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "17f820d557424ee764e3139317d62dc19644b7d38c0d5f968af2160f741fe3dc" +} diff --git a/core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json b/core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json new file mode 100644 index 000000000..21015f230 --- /dev/null +++ b/core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE data_source_id = $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881" +} diff --git a/core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json new file mode 100644 index 000000000..eb3a84f04 --- /dev/null +++ b/core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" +} diff --git a/core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json b/core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json new file mode 100644 index 000000000..aa58500c6 --- /dev/null +++ b/core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE code = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed" +} diff --git a/core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json b/core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json new file mode 100644 index 000000000..ff6402524 --- /dev/null +++ b/core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n member_accounts_deletion AS (\n DELETE FROM cala_account_set_member_accounts\n WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n AND member_account_id IN (SELECT member_account_id FROM cala_account_set_member_accounts\n WHERE account_set_id = $2)\n ),\n member_account_set_deletion AS (\n DELETE FROM cala_account_set_member_account_sets\n WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n AND member_account_set_id = $2\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "account_set_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [ + null, + null + ] + }, + "hash": "1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587" +} diff --git a/core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json new file mode 100644 index 000000000..1ea12e396 --- /dev/null +++ b/core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" +} diff --git a/core/deposit/.sqlx/query-210062ee036b0b5c901747bb65466462c4184a00f49b745f596a9a48d2866526.json b/core/deposit/.sqlx/query-210062ee036b0b5c901747bb65466462c4184a00f49b745f596a9a48d2866526.json new file mode 100644 index 000000000..765cc9203 --- /dev/null +++ b/core/deposit/.sqlx/query-210062ee036b0b5c901747bb65466462c4184a00f49b745f596a9a48d2866526.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO policy_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "210062ee036b0b5c901747bb65466462c4184a00f49b745f596a9a48d2866526" +} diff --git a/core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json b/core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json new file mode 100644 index 000000000..2c00d24d9 --- /dev/null +++ b/core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550" +} diff --git a/core/deposit/.sqlx/query-22d881277f4f5ab30cfa52a8f741668f041e396940292012dec1f722395723d4.json b/core/deposit/.sqlx/query-22d881277f4f5ab30cfa52a8f741668f041e396940292012dec1f722395723d4.json new file mode 100644 index 000000000..d3d174181 --- /dev/null +++ b/core/deposit/.sqlx/query-22d881277f4f5ab30cfa52a8f741668f041e396940292012dec1f722395723d4.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO approval_processes (id, process_type, committee_id, policy_id, created_at) VALUES ($1, $2, $3, $4, $5)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "22d881277f4f5ab30cfa52a8f741668f041e396940292012dec1f722395723d4" +} diff --git a/core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json b/core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json new file mode 100644 index 000000000..825bf5218 --- /dev/null +++ b/core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_controls WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa" +} diff --git a/core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json new file mode 100644 index 000000000..8046c5db1 --- /dev/null +++ b/core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" +} diff --git a/core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json b/core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json new file mode 100644 index 000000000..f8bda17d4 --- /dev/null +++ b/core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_tx_template_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e" +} diff --git a/core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json b/core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json new file mode 100644 index 000000000..5b094554f --- /dev/null +++ b/core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c" +} diff --git a/core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json new file mode 100644 index 000000000..e246e53b4 --- /dev/null +++ b/core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" +} diff --git a/core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json b/core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json new file mode 100644 index 000000000..2d9aebd2a --- /dev/null +++ b/core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH member_account_sets AS (\n SELECT a.id, a.name, a.created_at\n FROM cala_account_set_member_accounts asm\n JOIN cala_account_sets a ON asm.account_set_id = a.id\n WHERE asm.member_account_id = $1 AND transitive IS FALSE\n AND ((a.name, a.id) > ($3, $2) OR ($3 IS NULL AND $2 IS NULL))\n ORDER BY a.name, a.id\n LIMIT $4\n )\n SELECT mas.id AS \"entity_id!: AccountSetId\", e.sequence, e.event, e.recorded_at\n FROM member_account_sets mas\n JOIN cala_account_set_events e ON mas.id = e.id\n ORDER BY mas.name, mas.id, e.sequence\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id!: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Text", + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38" +} diff --git a/core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json b/core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json new file mode 100644 index 000000000..dce621518 --- /dev/null +++ b/core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT code, id FROM cala_accounts WHERE (COALESCE((code, id) > ($3, $2), $2 IS NULL)) ORDER BY code ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.code asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a" +} diff --git a/core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json b/core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json new file mode 100644 index 000000000..715fe3db9 --- /dev/null +++ b/core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7" +} diff --git a/core/deposit/.sqlx/query-2b1d7fa79075434b7de969a0c05930932876aab67e3c7233ade6238f65abae7e.json b/core/deposit/.sqlx/query-2b1d7fa79075434b7de969a0c05930932876aab67e3c7233ade6238f65abae7e.json new file mode 100644 index 000000000..bda393797 --- /dev/null +++ b/core/deposit/.sqlx/query-2b1d7fa79075434b7de969a0c05930932876aab67e3c7233ade6238f65abae7e.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM committees WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN committee_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "2b1d7fa79075434b7de969a0c05930932876aab67e3c7233ade6238f65abae7e" +} diff --git a/core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json b/core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json new file mode 100644 index 000000000..0c6e48656 --- /dev/null +++ b/core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_journals WHERE data_source_id = $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7" +} diff --git a/core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json b/core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json new file mode 100644 index 000000000..53b0b19f7 --- /dev/null +++ b/core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT COALESCE(MAX(sequence), 0) AS \"max!\" FROM cala_outbox_events", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "max!", + "type_info": "Int8" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140" +} diff --git a/core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json b/core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json new file mode 100644 index 000000000..8340b5c1b --- /dev/null +++ b/core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_journals WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9" +} diff --git a/core/deposit/.sqlx/query-2fa6746fe038859c0a60b826981d794d7e148bc365e6c65ddc4e5d6c5118e892.json b/core/deposit/.sqlx/query-2fa6746fe038859c0a60b826981d794d7e148bc365e6c65ddc4e5d6c5118e892.json new file mode 100644 index 000000000..8d1a8084d --- /dev/null +++ b/core/deposit/.sqlx/query-2fa6746fe038859c0a60b826981d794d7e148bc365e6c65ddc4e5d6c5118e892.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO committees (id, name, created_at) VALUES ($1, $2, $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "2fa6746fe038859c0a60b826981d794d7e148bc365e6c65ddc4e5d6c5118e892" +} diff --git a/core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json new file mode 100644 index 000000000..4d06843d1 --- /dev/null +++ b/core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json @@ -0,0 +1,62 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * FROM casbin_rule", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" +} diff --git a/core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json b/core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json new file mode 100644 index 000000000..1a7e7ccb9 --- /dev/null +++ b/core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE journal_id = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e" +} diff --git a/core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json b/core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json new file mode 100644 index 000000000..6bf6db947 --- /dev/null +++ b/core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE id = $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc" +} diff --git a/core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json b/core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json new file mode 100644 index 000000000..1b9adae0d --- /dev/null +++ b/core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE data_source_id = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1" +} diff --git a/core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json b/core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json new file mode 100644 index 000000000..6f16ea2f8 --- /dev/null +++ b/core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE tx_template_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e" +} diff --git a/core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json b/core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json new file mode 100644 index 000000000..de49ee09a --- /dev/null +++ b/core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n set_insert AS (\n INSERT INTO cala_account_set_member_account_sets (account_set_id, member_account_set_id)\n VALUES ($1, $2)\n ),\n new_members AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id, transitive)\n SELECT $1, m.member_account_id, TRUE\n FROM cala_account_set_member_accounts m\n WHERE m.account_set_id = $2\n RETURNING member_account_id\n ),\n transitive_inserts AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id, transitive)\n SELECT p.account_set_id, n.member_account_id, TRUE\n FROM parents p\n CROSS JOIN new_members n\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "account_set_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [ + null, + null + ] + }, + "hash": "35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245" +} diff --git a/core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json b/core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json new file mode 100644 index 000000000..eec82e391 --- /dev/null +++ b/core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_account_controls (account_id, velocity_control_id, values)\n VALUES ($1, $2, $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201" +} diff --git a/core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json b/core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json new file mode 100644 index 000000000..9f3f85e68 --- /dev/null +++ b/core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE cala_accounts SET name = $2, code = $3, external_id = $4, normal_balance_type = $5, latest_values = $6 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Varchar", + "Varchar", + { + "Custom": { + "name": "debitorcredit", + "kind": { + "Enum": [ + "debit", + "credit" + ] + } + } + }, + "Jsonb" + ] + }, + "nullable": [] + }, + "hash": "362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960" +} diff --git a/core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json b/core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json new file mode 100644 index 000000000..bc7274dba --- /dev/null +++ b/core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f" +} diff --git a/core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json b/core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json new file mode 100644 index 000000000..c616585b7 --- /dev/null +++ b/core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE data_source_id = $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78" +} diff --git a/core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json b/core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json new file mode 100644 index 000000000..c278843bb --- /dev/null +++ b/core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_limits WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4" +} diff --git a/core/deposit/.sqlx/query-3b700518ff9b8645bb55c8228274eb1c8d22b885fc76559381153f00fe5d6997.json b/core/deposit/.sqlx/query-3b700518ff9b8645bb55c8228274eb1c8d22b885fc76559381153f00fe5d6997.json new file mode 100644 index 000000000..577e4b184 --- /dev/null +++ b/core/deposit/.sqlx/query-3b700518ff9b8645bb55c8228274eb1c8d22b885fc76559381153f00fe5d6997.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT committee_id, created_at, id FROM approval_processes WHERE ((committee_id = $1) AND (COALESCE((created_at, id) < ($4, $3), $3 IS NULL))) ORDER BY created_at DESC, id DESC LIMIT $2) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3b700518ff9b8645bb55c8228274eb1c8d22b885fc76559381153f00fe5d6997" +} diff --git a/core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json b/core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json new file mode 100644 index 000000000..5bb13e1cd --- /dev/null +++ b/core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE name = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40" +} diff --git a/core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json b/core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json new file mode 100644 index 000000000..3ac8c2c83 --- /dev/null +++ b/core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_transactions WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9" +} diff --git a/core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json b/core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json new file mode 100644 index 000000000..771f2efea --- /dev/null +++ b/core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_accounts WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819" +} diff --git a/core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json b/core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json new file mode 100644 index 000000000..f716a1d1d --- /dev/null +++ b/core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: EntryId\", e.sequence, e.event, e.recorded_at FROM cala_entries i JOIN cala_entry_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e" +} diff --git a/core/deposit/.sqlx/query-3f939eb162598958144991a18c4ad01fa5cdac730283ce60b91056aadbc5a30e.json b/core/deposit/.sqlx/query-3f939eb162598958144991a18c4ad01fa5cdac730283ce60b91056aadbc5a30e.json new file mode 100644 index 000000000..69351b7e3 --- /dev/null +++ b/core/deposit/.sqlx/query-3f939eb162598958144991a18c4ad01fa5cdac730283ce60b91056aadbc5a30e.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM policies WHERE id = $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3f939eb162598958144991a18c4ad01fa5cdac730283ce60b91056aadbc5a30e" +} diff --git a/core/deposit/.sqlx/query-3faa09694d967adc67414ff65a9076b61390cead90ed9009821b5754f6d062a0.json b/core/deposit/.sqlx/query-3faa09694d967adc67414ff65a9076b61390cead90ed9009821b5754f6d062a0.json new file mode 100644 index 000000000..744355ef3 --- /dev/null +++ b/core/deposit/.sqlx/query-3faa09694d967adc67414ff65a9076b61390cead90ed9009821b5754f6d062a0.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM committees i JOIN committee_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3faa09694d967adc67414ff65a9076b61390cead90ed9009821b5754f6d062a0" +} diff --git a/core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json b/core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json new file mode 100644 index 000000000..b77dec00e --- /dev/null +++ b/core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE data_source_id = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d" +} diff --git a/core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json b/core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json new file mode 100644 index 000000000..86a12f670 --- /dev/null +++ b/core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_account_set_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942" +} diff --git a/core/deposit/.sqlx/query-41c8a58184b92cb958da2fbb008cde50de9da8caf62c5c8d8c5c54b5925144b0.json b/core/deposit/.sqlx/query-41c8a58184b92cb958da2fbb008cde50de9da8caf62c5c8d8c5c54b5925144b0.json new file mode 100644 index 000000000..ae9765d7a --- /dev/null +++ b/core/deposit/.sqlx/query-41c8a58184b92cb958da2fbb008cde50de9da8caf62c5c8d8c5c54b5925144b0.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT committee_id, id FROM approval_processes WHERE ((committee_id = $1) AND (COALESCE(id > $3, true))) ORDER BY id ASC LIMIT $2) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "41c8a58184b92cb958da2fbb008cde50de9da8caf62c5c8d8c5c54b5925144b0" +} diff --git a/core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json new file mode 100644 index 000000000..75c6da350 --- /dev/null +++ b/core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" +} diff --git a/core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json b/core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json new file mode 100644 index 000000000..5a1c58cab --- /dev/null +++ b/core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE id = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4" +} diff --git a/core/deposit/.sqlx/query-4695792a24d5b9b4f2784151b66c15412a584727eb684cd18123a4d2c00929e9.json b/core/deposit/.sqlx/query-4695792a24d5b9b4f2784151b66c15412a584727eb684cd18123a4d2c00929e9.json new file mode 100644 index 000000000..dda5454fb --- /dev/null +++ b/core/deposit/.sqlx/query-4695792a24d5b9b4f2784151b66c15412a584727eb684cd18123a4d2c00929e9.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_withdrawals WHERE approval_process_id = $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "4695792a24d5b9b4f2784151b66c15412a584727eb684cd18123a4d2c00929e9" +} diff --git a/core/deposit/.sqlx/query-47ce06b9bc1c72f53524ba80b97201a7014fc209feac8338c3aa03f05e98ace9.json b/core/deposit/.sqlx/query-47ce06b9bc1c72f53524ba80b97201a7014fc209feac8338c3aa03f05e98ace9.json new file mode 100644 index 000000000..3d15b7ad0 --- /dev/null +++ b/core/deposit/.sqlx/query-47ce06b9bc1c72f53524ba80b97201a7014fc209feac8338c3aa03f05e98ace9.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO committee_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "47ce06b9bc1c72f53524ba80b97201a7014fc209feac8338c3aa03f05e98ace9" +} diff --git a/core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json b/core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json new file mode 100644 index 000000000..eff106f66 --- /dev/null +++ b/core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_account_set_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75" +} diff --git a/core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json b/core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json new file mode 100644 index 000000000..f6661c46b --- /dev/null +++ b/core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH max_sequence AS (\n SELECT COALESCE(MAX(sequence), 0) AS max FROM cala_outbox_events\n )\n SELECT\n g.seq AS \"sequence!: EventSequence\",\n e.id AS \"id?\",\n e.payload AS \"payload?\",\n e.recorded_at AS \"recorded_at?\"\n FROM\n generate_series(LEAST($1 + 1, (SELECT max FROM max_sequence)),\n LEAST($1 + $2, (SELECT max FROM max_sequence)))\n AS g(seq)\n LEFT JOIN\n cala_outbox_events e ON g.seq = e.sequence\n WHERE\n g.seq > $1\n ORDER BY\n g.seq ASC\n LIMIT $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "sequence!: EventSequence", + "type_info": "Int8" + }, + { + "ordinal": 1, + "name": "id?", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "payload?", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at?", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [ + null, + false, + true, + false + ] + }, + "hash": "4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839" +} diff --git a/core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json new file mode 100644 index 000000000..ce229dc41 --- /dev/null +++ b/core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" +} diff --git a/core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json b/core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json new file mode 100644 index 000000000..7c0195034 --- /dev/null +++ b/core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT code, id FROM cala_accounts WHERE (COALESCE((code, id) < ($3, $2), $2 IS NULL)) ORDER BY code DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.code desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11" +} diff --git a/core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json b/core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json new file mode 100644 index 000000000..9096fac05 --- /dev/null +++ b/core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE id = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400" +} diff --git a/core/deposit/.sqlx/query-4ddaa20ede3df1a493c3a91136250b79c2a69f0ff5938d5e082b86346aeac6c4.json b/core/deposit/.sqlx/query-4ddaa20ede3df1a493c3a91136250b79c2a69f0ff5938d5e082b86346aeac6c4.json new file mode 100644 index 000000000..44c08f4da --- /dev/null +++ b/core/deposit/.sqlx/query-4ddaa20ede3df1a493c3a91136250b79c2a69f0ff5938d5e082b86346aeac6c4.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, created_at, id FROM core_withdrawals WHERE ((deposit_account_id = $1) AND (COALESCE((created_at, id) > ($4, $3), $3 IS NULL))) ORDER BY created_at ASC, id ASC LIMIT $2) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "4ddaa20ede3df1a493c3a91136250b79c2a69f0ff5938d5e082b86346aeac6c4" +} diff --git a/core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json new file mode 100644 index 000000000..4c4c1df2a --- /dev/null +++ b/core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" +} diff --git a/core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json b/core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json new file mode 100644 index 000000000..26f667e15 --- /dev/null +++ b/core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_tx_template_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66" +} diff --git a/core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json b/core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json new file mode 100644 index 000000000..28dc1274c --- /dev/null +++ b/core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH member_accounts AS (\n SELECT\n member_account_id AS member_id,\n member_account_id,\n NULL::uuid AS member_account_set_id,\n created_at\n FROM cala_account_set_member_accounts\n WHERE\n transitive IS FALSE\n AND account_set_id = $1\n AND (created_at < $2 OR $2 IS NULL)\n ORDER BY created_at DESC\n LIMIT $3\n ), member_sets AS (\n SELECT\n member_account_set_id AS member_id,\n NULL::uuid AS member_account_id,\n member_account_set_id,\n created_at\n FROM cala_account_set_member_account_sets\n WHERE\n account_set_id = $1\n AND (created_at < $2 OR $2 IS NULL)\n ORDER BY created_at DESC\n LIMIT $3\n ), all_members AS (\n SELECT * FROM member_accounts\n UNION ALL\n SELECT * FROM member_sets\n )\n SELECT * FROM all_members\n ORDER BY created_at DESC\n LIMIT $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "member_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "member_account_id", + "type_info": "Uuid" + }, + { + "ordinal": 2, + "name": "member_account_set_id", + "type_info": "Uuid" + }, + { + "ordinal": 3, + "name": "created_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8" + ] + }, + "nullable": [ + null, + null, + null, + null + ] + }, + "hash": "52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf" +} diff --git a/core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json b/core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json new file mode 100644 index 000000000..5cd7c13c1 --- /dev/null +++ b/core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT name, id FROM cala_account_sets WHERE (COALESCE((name, id) > ($3, $2), $2 IS NULL)) ORDER BY name ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.name asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5" +} diff --git a/core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json b/core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json new file mode 100644 index 000000000..9cedf9499 --- /dev/null +++ b/core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: TransactionId\", e.sequence, e.event, e.recorded_at FROM cala_transactions i JOIN cala_transaction_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b" +} diff --git a/core/deposit/.sqlx/query-56298b5483f52dbc43fdee3f99d183200e6f742ca0956ed5d35e7e64b9facff5.json b/core/deposit/.sqlx/query-56298b5483f52dbc43fdee3f99d183200e6f742ca0956ed5d35e7e64b9facff5.json new file mode 100644 index 000000000..e2bdb8a80 --- /dev/null +++ b/core/deposit/.sqlx/query-56298b5483f52dbc43fdee3f99d183200e6f742ca0956ed5d35e7e64b9facff5.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM policies WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "56298b5483f52dbc43fdee3f99d183200e6f742ca0956ed5d35e7e64b9facff5" +} diff --git a/core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json b/core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json new file mode 100644 index 000000000..cd6480451 --- /dev/null +++ b/core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_account_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798" +} diff --git a/core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json b/core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json new file mode 100644 index 000000000..17d7b2637 --- /dev/null +++ b/core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT external_id, id FROM cala_accounts WHERE ((external_id IS NOT DISTINCT FROM $3) AND COALESCE(id < $2, true) OR COALESCE(external_id < $3, external_id IS NOT NULL)) ORDER BY external_id DESC NULLS LAST, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.external_id desc nulls last, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939" +} diff --git a/core/deposit/.sqlx/query-5cf7924a6417fd9d6a1fc4fc373aeac4e1c0e3953425a4e62acc8a8039cbe539.json b/core/deposit/.sqlx/query-5cf7924a6417fd9d6a1fc4fc373aeac4e1c0e3953425a4e62acc8a8039cbe539.json new file mode 100644 index 000000000..550be8e80 --- /dev/null +++ b/core/deposit/.sqlx/query-5cf7924a6417fd9d6a1fc4fc373aeac4e1c0e3953425a4e62acc8a8039cbe539.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO core_withdrawal_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "5cf7924a6417fd9d6a1fc4fc373aeac4e1c0e3953425a4e62acc8a8039cbe539" +} diff --git a/core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json b/core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json new file mode 100644 index 000000000..b3485a859 --- /dev/null +++ b/core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json @@ -0,0 +1,50 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE normal_balance_type = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + { + "Custom": { + "name": "debitorcredit", + "kind": { + "Enum": [ + "debit", + "credit" + ] + } + } + } + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000" +} diff --git a/core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json b/core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json new file mode 100644 index 000000000..edf69b146 --- /dev/null +++ b/core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_control_limits (velocity_control_id, velocity_limit_id)\n VALUES ($1, $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377" +} diff --git a/core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json b/core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json new file mode 100644 index 000000000..cca808257 --- /dev/null +++ b/core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_controls (id, name, data_source_id, created_at) VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50" +} diff --git a/core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json b/core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json new file mode 100644 index 000000000..f6d7917ec --- /dev/null +++ b/core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab" +} diff --git a/core/deposit/.sqlx/query-606f56745ea686c3c98655f1ba29c892b469fe2e630d9824372ebb58c22314f2.json b/core/deposit/.sqlx/query-606f56745ea686c3c98655f1ba29c892b469fe2e630d9824372ebb58c22314f2.json new file mode 100644 index 000000000..db1a9fc59 --- /dev/null +++ b/core/deposit/.sqlx/query-606f56745ea686c3c98655f1ba29c892b469fe2e630d9824372ebb58c22314f2.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO core_withdrawals (id, deposit_account_id, approval_process_id, reference, created_at) VALUES ($1, $2, $3, $4, $5)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Uuid", + "Varchar", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "606f56745ea686c3c98655f1ba29c892b469fe2e630d9824372ebb58c22314f2" +} diff --git a/core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json b/core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json new file mode 100644 index 000000000..51fbd1640 --- /dev/null +++ b/core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_limit_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc" +} diff --git a/core/deposit/.sqlx/query-63cc3d4239b25c639a879f8742951066a70b78643536b15c52d3c48e81a3891d.json b/core/deposit/.sqlx/query-63cc3d4239b25c639a879f8742951066a70b78643536b15c52d3c48e81a3891d.json new file mode 100644 index 000000000..55eefd952 --- /dev/null +++ b/core/deposit/.sqlx/query-63cc3d4239b25c639a879f8742951066a70b78643536b15c52d3c48e81a3891d.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM committees WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN committee_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "63cc3d4239b25c639a879f8742951066a70b78643536b15c52d3c48e81a3891d" +} diff --git a/core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json b/core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json new file mode 100644 index 000000000..fd86eb9e3 --- /dev/null +++ b/core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE journal_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0" +} diff --git a/core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json b/core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json new file mode 100644 index 000000000..f95dc0ed0 --- /dev/null +++ b/core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_limits (id, name, data_source_id, created_at) VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec" +} diff --git a/core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json b/core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json new file mode 100644 index 000000000..53547db0d --- /dev/null +++ b/core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM cala_account_sets i JOIN cala_account_set_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7" +} diff --git a/core/deposit/.sqlx/query-694f1dd65b5724fcf6937d56b1770c7823d9f85c17f9d98862e425477387ae89.json b/core/deposit/.sqlx/query-694f1dd65b5724fcf6937d56b1770c7823d9f85c17f9d98862e425477387ae89.json new file mode 100644 index 000000000..2c85aa2e3 --- /dev/null +++ b/core/deposit/.sqlx/query-694f1dd65b5724fcf6937d56b1770c7823d9f85c17f9d98862e425477387ae89.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM committees WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN committee_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "694f1dd65b5724fcf6937d56b1770c7823d9f85c17f9d98862e425477387ae89" +} diff --git a/core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} diff --git a/core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json b/core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json new file mode 100644 index 000000000..bb6e98b92 --- /dev/null +++ b/core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_account_sets WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1" +} diff --git a/core/deposit/.sqlx/query-6c035629a0b60e177f54c64ae17f1fb9fee700a7a55f5fd658e9a7f8839ed3a2.json b/core/deposit/.sqlx/query-6c035629a0b60e177f54c64ae17f1fb9fee700a7a55f5fd658e9a7f8839ed3a2.json new file mode 100644 index 000000000..6b19384b0 --- /dev/null +++ b/core/deposit/.sqlx/query-6c035629a0b60e177f54c64ae17f1fb9fee700a7a55f5fd658e9a7f8839ed3a2.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM approval_processes WHERE policy_id = $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "6c035629a0b60e177f54c64ae17f1fb9fee700a7a55f5fd658e9a7f8839ed3a2" +} diff --git a/core/deposit/.sqlx/query-6f45f539edff97cdbcdf8ba879e33fd48abe353bbc92cb690d98dcf6f641750f.json b/core/deposit/.sqlx/query-6f45f539edff97cdbcdf8ba879e33fd48abe353bbc92cb690d98dcf6f641750f.json new file mode 100644 index 000000000..947523020 --- /dev/null +++ b/core/deposit/.sqlx/query-6f45f539edff97cdbcdf8ba879e33fd48abe353bbc92cb690d98dcf6f641750f.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, id FROM core_withdrawals WHERE ((deposit_account_id = $1) AND (COALESCE(id < $3, true))) ORDER BY id DESC LIMIT $2) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "6f45f539edff97cdbcdf8ba879e33fd48abe353bbc92cb690d98dcf6f641750f" +} diff --git a/core/deposit/.sqlx/query-70a9ee61b82ceea3c197d4aae1fd017d19410792c60ffcb01edaaca1dfeae2ea.json b/core/deposit/.sqlx/query-70a9ee61b82ceea3c197d4aae1fd017d19410792c60ffcb01edaaca1dfeae2ea.json new file mode 100644 index 000000000..c18349ed1 --- /dev/null +++ b/core/deposit/.sqlx/query-70a9ee61b82ceea3c197d4aae1fd017d19410792c60ffcb01edaaca1dfeae2ea.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM approval_processes WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "70a9ee61b82ceea3c197d4aae1fd017d19410792c60ffcb01edaaca1dfeae2ea" +} diff --git a/core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json b/core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json new file mode 100644 index 000000000..f2ec311af --- /dev/null +++ b/core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_account_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad" +} diff --git a/core/deposit/.sqlx/query-73042ca58753f878ef7da169e3d5edb8ac006bf8b55ff7a6f3844aa60ae2eebc.json b/core/deposit/.sqlx/query-73042ca58753f878ef7da169e3d5edb8ac006bf8b55ff7a6f3844aa60ae2eebc.json new file mode 100644 index 000000000..1d702f465 --- /dev/null +++ b/core/deposit/.sqlx/query-73042ca58753f878ef7da169e3d5edb8ac006bf8b55ff7a6f3844aa60ae2eebc.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM committees WHERE id = $1) SELECT i.id AS \"entity_id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN committee_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "73042ca58753f878ef7da169e3d5edb8ac006bf8b55ff7a6f3844aa60ae2eebc" +} diff --git a/core/deposit/.sqlx/query-757592f9832c8e1efb9b8dfb0f78868b00c3c0bdc73fe72a03bae7a807139c6b.json b/core/deposit/.sqlx/query-757592f9832c8e1efb9b8dfb0f78868b00c3c0bdc73fe72a03bae7a807139c6b.json new file mode 100644 index 000000000..384262f22 --- /dev/null +++ b/core/deposit/.sqlx/query-757592f9832c8e1efb9b8dfb0f78868b00c3c0bdc73fe72a03bae7a807139c6b.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM core_withdrawals WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "757592f9832c8e1efb9b8dfb0f78868b00c3c0bdc73fe72a03bae7a807139c6b" +} diff --git a/core/deposit/.sqlx/query-77441bd6efa7cff0917b00344393de214afa08a8a80cd8fea42bcfcf347dbffe.json b/core/deposit/.sqlx/query-77441bd6efa7cff0917b00344393de214afa08a8a80cd8fea42bcfcf347dbffe.json new file mode 100644 index 000000000..f631d8a53 --- /dev/null +++ b/core/deposit/.sqlx/query-77441bd6efa7cff0917b00344393de214afa08a8a80cd8fea42bcfcf347dbffe.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM approval_processes WHERE id = $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "77441bd6efa7cff0917b00344393de214afa08a8a80cd8fea42bcfcf347dbffe" +} diff --git a/core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json b/core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json new file mode 100644 index 000000000..b8d23b0b9 --- /dev/null +++ b/core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77" +} diff --git a/core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json b/core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json new file mode 100644 index 000000000..9b6e0a705 --- /dev/null +++ b/core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT event\n FROM cala_tx_template_events\n WHERE id = $1 AND sequence = $2", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "event", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66" +} diff --git a/core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json b/core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json new file mode 100644 index 000000000..ee59fcf53 --- /dev/null +++ b/core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json @@ -0,0 +1,32 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_accounts (id, name, code, external_id, normal_balance_type, eventually_consistent, latest_values, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Varchar", + "Varchar", + { + "Custom": { + "name": "debitorcredit", + "kind": { + "Enum": [ + "debit", + "credit" + ] + } + } + }, + "Bool", + "Jsonb", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343" +} diff --git a/core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json b/core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json new file mode 100644 index 000000000..63ea80597 --- /dev/null +++ b/core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_limits WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4" +} diff --git a/core/deposit/.sqlx/query-7bebb58c6ae4876c06a021a9865d5b68b491701d52b632de14823dafd5756cd3.json b/core/deposit/.sqlx/query-7bebb58c6ae4876c06a021a9865d5b68b491701d52b632de14823dafd5756cd3.json new file mode 100644 index 000000000..5365985d7 --- /dev/null +++ b/core/deposit/.sqlx/query-7bebb58c6ae4876c06a021a9865d5b68b491701d52b632de14823dafd5756cd3.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM committees WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN committee_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "7bebb58c6ae4876c06a021a9865d5b68b491701d52b632de14823dafd5756cd3" +} diff --git a/core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json b/core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json new file mode 100644 index 000000000..3bb487807 --- /dev/null +++ b/core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE external_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee" +} diff --git a/core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json b/core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json new file mode 100644 index 000000000..8485669c0 --- /dev/null +++ b/core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300" +} diff --git a/core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json b/core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json new file mode 100644 index 000000000..aa916bd78 --- /dev/null +++ b/core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE correlation_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4" +} diff --git a/core/deposit/.sqlx/query-86f9a2c0b430230f05fbd7ad65ad3c9d0907d654138ba2a62cb9bee521fd4a03.json b/core/deposit/.sqlx/query-86f9a2c0b430230f05fbd7ad65ad3c9d0907d654138ba2a62cb9bee521fd4a03.json new file mode 100644 index 000000000..5328dc404 --- /dev/null +++ b/core/deposit/.sqlx/query-86f9a2c0b430230f05fbd7ad65ad3c9d0907d654138ba2a62cb9bee521fd4a03.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM approval_processes WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "86f9a2c0b430230f05fbd7ad65ad3c9d0907d654138ba2a62cb9bee521fd4a03" +} diff --git a/core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json b/core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json new file mode 100644 index 000000000..dac7ab34d --- /dev/null +++ b/core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_journal_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad" +} diff --git a/core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json b/core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json new file mode 100644 index 000000000..f96062fbc --- /dev/null +++ b/core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_tx_templates WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a" +} diff --git a/core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json b/core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json new file mode 100644 index 000000000..92e6477ce --- /dev/null +++ b/core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n deletions as (\n DELETE FROM cala_account_set_member_accounts\n WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n AND member_account_id = $2\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "account_set_id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [ + null, + null + ] + }, + "hash": "880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74" +} diff --git a/core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json b/core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json new file mode 100644 index 000000000..a1758be62 --- /dev/null +++ b/core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE cala_journals SET name = $2 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff" +} diff --git a/core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json b/core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json new file mode 100644 index 000000000..c55e45c71 --- /dev/null +++ b/core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_account_sets WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b" +} diff --git a/core/deposit/.sqlx/query-8eb956fdaf23f5438306641d34b6aab8b7776927ff58875009b77754073abb64.json b/core/deposit/.sqlx/query-8eb956fdaf23f5438306641d34b6aab8b7776927ff58875009b77754073abb64.json new file mode 100644 index 000000000..29bf3909a --- /dev/null +++ b/core/deposit/.sqlx/query-8eb956fdaf23f5438306641d34b6aab8b7776927ff58875009b77754073abb64.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM policies WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "8eb956fdaf23f5438306641d34b6aab8b7776927ff58875009b77754073abb64" +} diff --git a/core/deposit/.sqlx/query-8f1fda3b0a2a441736e6a2a540cee908b0c2e2db176cdc639192d4e887ebd4a3.json b/core/deposit/.sqlx/query-8f1fda3b0a2a441736e6a2a540cee908b0c2e2db176cdc639192d4e887ebd4a3.json new file mode 100644 index 000000000..9179fa2eb --- /dev/null +++ b/core/deposit/.sqlx/query-8f1fda3b0a2a441736e6a2a540cee908b0c2e2db176cdc639192d4e887ebd4a3.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_withdrawals WHERE reference = $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "8f1fda3b0a2a441736e6a2a540cee908b0c2e2db176cdc639192d4e887ebd4a3" +} diff --git a/core/deposit/.sqlx/query-8fea8776f584e7d77a1605903ba9f749f58ae1e85d4cab247dde3caafa24237e.json b/core/deposit/.sqlx/query-8fea8776f584e7d77a1605903ba9f749f58ae1e85d4cab247dde3caafa24237e.json new file mode 100644 index 000000000..9badd741a --- /dev/null +++ b/core/deposit/.sqlx/query-8fea8776f584e7d77a1605903ba9f749f58ae1e85d4cab247dde3caafa24237e.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM approval_processes WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "8fea8776f584e7d77a1605903ba9f749f58ae1e85d4cab247dde3caafa24237e" +} diff --git a/core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json b/core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json new file mode 100644 index 000000000..35faa449f --- /dev/null +++ b/core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH member_account_sets AS (\n SELECT a.id, a.name, a.created_at\n FROM cala_account_set_member_account_sets asm\n JOIN cala_account_sets a ON asm.account_set_id = a.id\n WHERE asm.member_account_set_id = $1\n AND ((a.name, a.id) > ($3, $2) OR ($3 IS NULL AND $2 IS NULL))\n ORDER BY a.name, a.id\n LIMIT $4\n )\n SELECT mas.id AS \"entity_id!: AccountSetId\", e.sequence, e.event, e.recorded_at\n FROM member_account_sets mas\n JOIN cala_account_set_events e ON mas.id = e.id\n ORDER BY mas.name, mas.id, e.sequence\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id!: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Text", + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be" +} diff --git a/core/deposit/.sqlx/query-907e360e9cf644967b883943c7975388153d6f0cb0f91e4da0741427b00deea4.json b/core/deposit/.sqlx/query-907e360e9cf644967b883943c7975388153d6f0cb0f91e4da0741427b00deea4.json new file mode 100644 index 000000000..cac5c07aa --- /dev/null +++ b/core/deposit/.sqlx/query-907e360e9cf644967b883943c7975388153d6f0cb0f91e4da0741427b00deea4.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_withdrawals WHERE deposit_account_id = $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "907e360e9cf644967b883943c7975388153d6f0cb0f91e4da0741427b00deea4" +} diff --git a/core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json b/core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json new file mode 100644 index 000000000..34fc6613f --- /dev/null +++ b/core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE transaction_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2" +} diff --git a/core/deposit/.sqlx/query-91debda9c1f7653b7bcb38a311d0f665f05d8fb39a8f371b9bbdcd4d35b2280e.json b/core/deposit/.sqlx/query-91debda9c1f7653b7bcb38a311d0f665f05d8fb39a8f371b9bbdcd4d35b2280e.json new file mode 100644 index 000000000..2643d87f1 --- /dev/null +++ b/core/deposit/.sqlx/query-91debda9c1f7653b7bcb38a311d0f665f05d8fb39a8f371b9bbdcd4d35b2280e.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM core_withdrawals WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "91debda9c1f7653b7bcb38a311d0f665f05d8fb39a8f371b9bbdcd4d35b2280e" +} diff --git a/core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json b/core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json new file mode 100644 index 000000000..35c4724f0 --- /dev/null +++ b/core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT external_id, id FROM cala_accounts WHERE ((external_id IS NOT DISTINCT FROM $3) AND COALESCE(id > $2, true) OR COALESCE(external_id > $3, external_id IS NOT NULL)) ORDER BY external_id ASC NULLS FIRST, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.external_id asc nulls first, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d" +} diff --git a/core/deposit/.sqlx/query-96cb61b0eda9cb5900206353bffffd14752b73ae0496b0e552d63f242a7d0eee.json b/core/deposit/.sqlx/query-96cb61b0eda9cb5900206353bffffd14752b73ae0496b0e552d63f242a7d0eee.json new file mode 100644 index 000000000..5d3b2ece3 --- /dev/null +++ b/core/deposit/.sqlx/query-96cb61b0eda9cb5900206353bffffd14752b73ae0496b0e552d63f242a7d0eee.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO committee_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "96cb61b0eda9cb5900206353bffffd14752b73ae0496b0e552d63f242a7d0eee" +} diff --git a/core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json b/core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json new file mode 100644 index 000000000..a3b71e8be --- /dev/null +++ b/core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: JournalId\", e.sequence, e.event, e.recorded_at FROM cala_journals i JOIN cala_journal_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f" +} diff --git a/core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json b/core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json new file mode 100644 index 000000000..337cc6072 --- /dev/null +++ b/core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_tx_templates (id, code, data_source_id, created_at) VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336" +} diff --git a/core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json b/core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json new file mode 100644 index 000000000..6db8cfd3c --- /dev/null +++ b/core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT name, id FROM cala_accounts WHERE (COALESCE((name, id) < ($3, $2), $2 IS NULL)) ORDER BY name DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.name desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce" +} diff --git a/core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json b/core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json new file mode 100644 index 000000000..909e6ad42 --- /dev/null +++ b/core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT pg_advisory_xact_lock($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "pg_advisory_xact_lock", + "type_info": "Void" + } + ], + "parameters": { + "Left": [ + "Int8" + ] + }, + "nullable": [ + null + ] + }, + "hash": "a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247" +} diff --git a/core/deposit/.sqlx/query-a0c05c6256eb12980957aa7060754488b0ab7620c0df794b0140d4cd29728aba.json b/core/deposit/.sqlx/query-a0c05c6256eb12980957aa7060754488b0ab7620c0df794b0140d4cd29728aba.json new file mode 100644 index 000000000..f91ae37be --- /dev/null +++ b/core/deposit/.sqlx/query-a0c05c6256eb12980957aa7060754488b0ab7620c0df794b0140d4cd29728aba.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM approval_processes WHERE committee_id = $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a0c05c6256eb12980957aa7060754488b0ab7620c0df794b0140d4cd29728aba" +} diff --git a/core/deposit/.sqlx/query-a1550c7ad93b614b9aa3e1d7800d5856b23aab7bad820f5cb8ff7c9869cb02ad.json b/core/deposit/.sqlx/query-a1550c7ad93b614b9aa3e1d7800d5856b23aab7bad820f5cb8ff7c9869cb02ad.json new file mode 100644 index 000000000..3e5aef4c3 --- /dev/null +++ b/core/deposit/.sqlx/query-a1550c7ad93b614b9aa3e1d7800d5856b23aab7bad820f5cb8ff7c9869cb02ad.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM policies WHERE process_type = $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a1550c7ad93b614b9aa3e1d7800d5856b23aab7bad820f5cb8ff7c9869cb02ad" +} diff --git a/core/deposit/.sqlx/query-a27bea0d43b3ea7c807ef1a668378640d5eac3049bd61d937bd657b24601a3f0.json b/core/deposit/.sqlx/query-a27bea0d43b3ea7c807ef1a668378640d5eac3049bd61d937bd657b24601a3f0.json new file mode 100644 index 000000000..6380b4539 --- /dev/null +++ b/core/deposit/.sqlx/query-a27bea0d43b3ea7c807ef1a668378640d5eac3049bd61d937bd657b24601a3f0.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, created_at, id FROM core_withdrawals WHERE ((deposit_account_id = $1) AND (COALESCE((created_at, id) < ($4, $3), $3 IS NULL))) ORDER BY created_at DESC, id DESC LIMIT $2) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a27bea0d43b3ea7c807ef1a668378640d5eac3049bd61d937bd657b24601a3f0" +} diff --git a/core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json b/core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json new file mode 100644 index 000000000..9f8deaa1f --- /dev/null +++ b/core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT name, id FROM cala_account_sets WHERE (COALESCE((name, id) < ($3, $2), $2 IS NULL)) ORDER BY name DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.name desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea" +} diff --git a/core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json b/core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json new file mode 100644 index 000000000..53e679b32 --- /dev/null +++ b/core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_controls WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444" +} diff --git a/core/deposit/.sqlx/query-a675bedaa34fd80880639edf6841764d2ca6b3139949b6e19c42054acaf0fd85.json b/core/deposit/.sqlx/query-a675bedaa34fd80880639edf6841764d2ca6b3139949b6e19c42054acaf0fd85.json new file mode 100644 index 000000000..ae0c22d8b --- /dev/null +++ b/core/deposit/.sqlx/query-a675bedaa34fd80880639edf6841764d2ca6b3139949b6e19c42054acaf0fd85.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM approval_processes WHERE process_type = $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "a675bedaa34fd80880639edf6841764d2ca6b3139949b6e19c42054acaf0fd85" +} diff --git a/core/deposit/.sqlx/query-a6fae2f669eeb47bb3bf3f098bea0f41f5b7c3475ca4794739e41332a36d106f.json b/core/deposit/.sqlx/query-a6fae2f669eeb47bb3bf3f098bea0f41f5b7c3475ca4794739e41332a36d106f.json new file mode 100644 index 000000000..1d0a9782b --- /dev/null +++ b/core/deposit/.sqlx/query-a6fae2f669eeb47bb3bf3f098bea0f41f5b7c3475ca4794739e41332a36d106f.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE core_withdrawals SET reference = $2 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "a6fae2f669eeb47bb3bf3f098bea0f41f5b7c3475ca4794739e41332a36d106f" +} diff --git a/core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json b/core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json new file mode 100644 index 000000000..e4bdd275a --- /dev/null +++ b/core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_transaction_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7" +} diff --git a/core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json b/core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json new file mode 100644 index 000000000..d5b97f9e8 --- /dev/null +++ b/core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: AccountId\", e.sequence, e.event, e.recorded_at FROM cala_accounts i JOIN cala_account_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea" +} diff --git a/core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json b/core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json new file mode 100644 index 000000000..46a926989 --- /dev/null +++ b/core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE account_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5" +} diff --git a/core/deposit/.sqlx/query-aad40f81335198b18a07d489f9af88f89c7e55ae4c151d8f1ca0c90576d3907d.json b/core/deposit/.sqlx/query-aad40f81335198b18a07d489f9af88f89c7e55ae4c151d8f1ca0c90576d3907d.json new file mode 100644 index 000000000..e061b7294 --- /dev/null +++ b/core/deposit/.sqlx/query-aad40f81335198b18a07d489f9af88f89c7e55ae4c151d8f1ca0c90576d3907d.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: PolicyId\", e.sequence, e.event, e.recorded_at FROM policies i JOIN policy_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "aad40f81335198b18a07d489f9af88f89c7e55ae4c151d8f1ca0c90576d3907d" +} diff --git a/core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json b/core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json new file mode 100644 index 000000000..14877febd --- /dev/null +++ b/core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_entries WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e" +} diff --git a/core/deposit/.sqlx/query-ac632e983b85db1bbe41afce033b2571478925ed0183338dd0d1fdfffe5dfc65.json b/core/deposit/.sqlx/query-ac632e983b85db1bbe41afce033b2571478925ed0183338dd0d1fdfffe5dfc65.json new file mode 100644 index 000000000..64b484cfe --- /dev/null +++ b/core/deposit/.sqlx/query-ac632e983b85db1bbe41afce033b2571478925ed0183338dd0d1fdfffe5dfc65.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO policy_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "ac632e983b85db1bbe41afce033b2571478925ed0183338dd0d1fdfffe5dfc65" +} diff --git a/core/deposit/.sqlx/query-aff13ff30fc3d2db3488a7670ba7f88a5c9be11f7687a9ab1f0629f7f46d8f5c.json b/core/deposit/.sqlx/query-aff13ff30fc3d2db3488a7670ba7f88a5c9be11f7687a9ab1f0629f7f46d8f5c.json new file mode 100644 index 000000000..8bc50cdc0 --- /dev/null +++ b/core/deposit/.sqlx/query-aff13ff30fc3d2db3488a7670ba7f88a5c9be11f7687a9ab1f0629f7f46d8f5c.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM policies WHERE committee_id = $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "aff13ff30fc3d2db3488a7670ba7f88a5c9be11f7687a9ab1f0629f7f46d8f5c" +} diff --git a/core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json b/core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json new file mode 100644 index 000000000..afdfbddac --- /dev/null +++ b/core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE eventually_consistent = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Bool" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da" +} diff --git a/core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json b/core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json new file mode 100644 index 000000000..190e66d88 --- /dev/null +++ b/core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_journals WHERE name = $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529" +} diff --git a/core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json b/core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json new file mode 100644 index 000000000..d084530cc --- /dev/null +++ b/core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d" +} diff --git a/core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json b/core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json new file mode 100644 index 000000000..c899777bc --- /dev/null +++ b/core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73" +} diff --git a/core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json b/core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json new file mode 100644 index 000000000..1c253372a --- /dev/null +++ b/core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_transactions WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb" +} diff --git a/core/deposit/.sqlx/query-b746b062c9f0b14efec550715d221aa42c5879711359aa24e1de89d190303442.json b/core/deposit/.sqlx/query-b746b062c9f0b14efec550715d221aa42c5879711359aa24e1de89d190303442.json new file mode 100644 index 000000000..3b366c1b5 --- /dev/null +++ b/core/deposit/.sqlx/query-b746b062c9f0b14efec550715d221aa42c5879711359aa24e1de89d190303442.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO approval_process_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "b746b062c9f0b14efec550715d221aa42c5879711359aa24e1de89d190303442" +} diff --git a/core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json b/core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json new file mode 100644 index 000000000..fc798ebdd --- /dev/null +++ b/core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_entries (id, journal_id, account_id, transaction_id, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5, $6)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Uuid", + "Uuid", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8" +} diff --git a/core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json b/core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json new file mode 100644 index 000000000..1922c734b --- /dev/null +++ b/core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE name = $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229" +} diff --git a/core/deposit/.sqlx/query-bd4cdd0f1e5e2d5a9d25e162dcb12aaf3a0cc3b6c3fdc268a2d38a558310a957.json b/core/deposit/.sqlx/query-bd4cdd0f1e5e2d5a9d25e162dcb12aaf3a0cc3b6c3fdc268a2d38a558310a957.json new file mode 100644 index 000000000..c0be39a36 --- /dev/null +++ b/core/deposit/.sqlx/query-bd4cdd0f1e5e2d5a9d25e162dcb12aaf3a0cc3b6c3fdc268a2d38a558310a957.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE policies SET process_type = $2, committee_id = $3 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "bd4cdd0f1e5e2d5a9d25e162dcb12aaf3a0cc3b6c3fdc268a2d38a558310a957" +} diff --git a/core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json b/core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json new file mode 100644 index 000000000..5b84d9669 --- /dev/null +++ b/core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH locked_accounts AS (\n SELECT 1\n FROM cala_accounts a\n WHERE data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.id = $1\n FOR UPDATE\n ), locked_balances AS (\n SELECT journal_id, account_id, currency, latest_version\n FROM cala_current_balances\n WHERE journal_id = $2\n AND account_id = $1\n FOR UPDATE\n )\n SELECT h.values\n FROM cala_balance_history h\n JOIN locked_balances b\n ON b.journal_id = h.journal_id\n AND b.account_id = h.account_id\n AND b.currency = h.currency\n AND b.latest_version = h.version\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "values", + "type_info": "Jsonb" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid" + ] + }, + "nullable": [ + false + ] + }, + "hash": "bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea" +} diff --git a/core/deposit/.sqlx/query-bd95c4f0035427d576ce6870ff35c376cab226ee9072da6069e0a119ef75fc2c.json b/core/deposit/.sqlx/query-bd95c4f0035427d576ce6870ff35c376cab226ee9072da6069e0a119ef75fc2c.json new file mode 100644 index 000000000..0e7e5da20 --- /dev/null +++ b/core/deposit/.sqlx/query-bd95c4f0035427d576ce6870ff35c376cab226ee9072da6069e0a119ef75fc2c.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO core_withdrawal_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "bd95c4f0035427d576ce6870ff35c376cab226ee9072da6069e0a119ef75fc2c" +} diff --git a/core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json b/core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json new file mode 100644 index 000000000..3cd6df4d1 --- /dev/null +++ b/core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082" +} diff --git a/core/deposit/.sqlx/query-beb47657381fba7a11470b3f22ac2304a2d9a492630adae2e7c089cf02f6490a.json b/core/deposit/.sqlx/query-beb47657381fba7a11470b3f22ac2304a2d9a492630adae2e7c089cf02f6490a.json new file mode 100644 index 000000000..fc1ef73bc --- /dev/null +++ b/core/deposit/.sqlx/query-beb47657381fba7a11470b3f22ac2304a2d9a492630adae2e7c089cf02f6490a.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM committees WHERE name = $1) SELECT i.id AS \"entity_id: CommitteeId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN committee_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: CommitteeId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "beb47657381fba7a11470b3f22ac2304a2d9a492630adae2e7c089cf02f6490a" +} diff --git a/core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json b/core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json new file mode 100644 index 000000000..22ad039cc --- /dev/null +++ b/core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT t.id AS \"id?: TxTemplateId\", MAX(e.sequence) AS \"version\" \n FROM cala_tx_templates t\n JOIN cala_tx_template_events e ON t.id = e.id\n WHERE t.code = $1\n GROUP BY t.id", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id?: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "version", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + null + ] + }, + "hash": "bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf" +} diff --git a/core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json b/core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json new file mode 100644 index 000000000..c1ba12037 --- /dev/null +++ b/core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM cala_tx_templates i JOIN cala_tx_template_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4" +} diff --git a/core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json b/core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json new file mode 100644 index 000000000..9f79adf65 --- /dev/null +++ b/core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityControlId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392" +} diff --git a/core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json b/core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json new file mode 100644 index 000000000..5f024224e --- /dev/null +++ b/core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_account_sets (id, name, journal_id, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3" +} diff --git a/core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json b/core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json new file mode 100644 index 000000000..b9e193eb1 --- /dev/null +++ b/core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE data_source_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481" +} diff --git a/core/deposit/.sqlx/query-cc6402da73a5a1ab26212376f75dd1227bc43f97be6382fa23fe08f9a1d5a585.json b/core/deposit/.sqlx/query-cc6402da73a5a1ab26212376f75dd1227bc43f97be6382fa23fe08f9a1d5a585.json new file mode 100644 index 000000000..d0b957116 --- /dev/null +++ b/core/deposit/.sqlx/query-cc6402da73a5a1ab26212376f75dd1227bc43f97be6382fa23fe08f9a1d5a585.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_withdrawals WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "cc6402da73a5a1ab26212376f75dd1227bc43f97be6382fa23fe08f9a1d5a585" +} diff --git a/core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json b/core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json new file mode 100644 index 000000000..78012ab30 --- /dev/null +++ b/core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE name = $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e" +} diff --git a/core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json b/core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json new file mode 100644 index 000000000..7335a1eb1 --- /dev/null +++ b/core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13" +} diff --git a/core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json b/core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json new file mode 100644 index 000000000..9a9e23967 --- /dev/null +++ b/core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM cala_velocity_limits i JOIN cala_velocity_limit_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe" +} diff --git a/core/deposit/.sqlx/query-d316bf8d73764c5b013048816f51df5eef2f87e6f57403e9cf8ad809d8c6de5f.json b/core/deposit/.sqlx/query-d316bf8d73764c5b013048816f51df5eef2f87e6f57403e9cf8ad809d8c6de5f.json new file mode 100644 index 000000000..cc7d2c567 --- /dev/null +++ b/core/deposit/.sqlx/query-d316bf8d73764c5b013048816f51df5eef2f87e6f57403e9cf8ad809d8c6de5f.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT deposit_account_id, id FROM core_withdrawals WHERE ((deposit_account_id = $1) AND (COALESCE(id > $3, true))) ORDER BY id ASC LIMIT $2) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d316bf8d73764c5b013048816f51df5eef2f87e6f57403e9cf8ad809d8c6de5f" +} diff --git a/core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json b/core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json new file mode 100644 index 000000000..fb1f645e7 --- /dev/null +++ b/core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_journals WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: JournalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb" +} diff --git a/core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json b/core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json new file mode 100644 index 000000000..eb477d288 --- /dev/null +++ b/core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE name = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1" +} diff --git a/core/deposit/.sqlx/query-d5e34d8ca71038cafe1ad05732e698a485634eac2d60ad20fe61bce9b4b92041.json b/core/deposit/.sqlx/query-d5e34d8ca71038cafe1ad05732e698a485634eac2d60ad20fe61bce9b4b92041.json new file mode 100644 index 000000000..2a60e2d14 --- /dev/null +++ b/core/deposit/.sqlx/query-d5e34d8ca71038cafe1ad05732e698a485634eac2d60ad20fe61bce9b4b92041.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM approval_processes WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d5e34d8ca71038cafe1ad05732e698a485634eac2d60ad20fe61bce9b4b92041" +} diff --git a/core/deposit/.sqlx/query-d72800579d235eb5cdf731a6678f1b3ded0740f414586241064c580a06378367.json b/core/deposit/.sqlx/query-d72800579d235eb5cdf731a6678f1b3ded0740f414586241064c580a06378367.json new file mode 100644 index 000000000..ff05f0821 --- /dev/null +++ b/core/deposit/.sqlx/query-d72800579d235eb5cdf731a6678f1b3ded0740f414586241064c580a06378367.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM policies WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: PolicyId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN policy_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: PolicyId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d72800579d235eb5cdf731a6678f1b3ded0740f414586241064c580a06378367" +} diff --git a/core/deposit/.sqlx/query-d7b4e73ae21ba6dbb23590862c2e2199fa385a0b2fd7edaf775118d92c1f574e.json b/core/deposit/.sqlx/query-d7b4e73ae21ba6dbb23590862c2e2199fa385a0b2fd7edaf775118d92c1f574e.json new file mode 100644 index 000000000..6a88c4cfc --- /dev/null +++ b/core/deposit/.sqlx/query-d7b4e73ae21ba6dbb23590862c2e2199fa385a0b2fd7edaf775118d92c1f574e.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE committees SET name = $2 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "d7b4e73ae21ba6dbb23590862c2e2199fa385a0b2fd7edaf775118d92c1f574e" +} diff --git a/core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json b/core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json new file mode 100644 index 000000000..8d77d295f --- /dev/null +++ b/core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_entry_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903" +} diff --git a/core/deposit/.sqlx/query-dbe4ece20e9ec7b11016522a24e613008b81814b9c099b1fa62f3885debeae42.json b/core/deposit/.sqlx/query-dbe4ece20e9ec7b11016522a24e613008b81814b9c099b1fa62f3885debeae42.json new file mode 100644 index 000000000..9723add52 --- /dev/null +++ b/core/deposit/.sqlx/query-dbe4ece20e9ec7b11016522a24e613008b81814b9c099b1fa62f3885debeae42.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_withdrawals WHERE id = $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "dbe4ece20e9ec7b11016522a24e613008b81814b9c099b1fa62f3885debeae42" +} diff --git a/core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json b/core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json new file mode 100644 index 000000000..64ca0b218 --- /dev/null +++ b/core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_entry_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94" +} diff --git a/core/deposit/.sqlx/query-de8c9894cbf2908e0749d0c267ab52cd912d85a1dce2e20ef9b16c1d7a16d60c.json b/core/deposit/.sqlx/query-de8c9894cbf2908e0749d0c267ab52cd912d85a1dce2e20ef9b16c1d7a16d60c.json new file mode 100644 index 000000000..ca15b5dbc --- /dev/null +++ b/core/deposit/.sqlx/query-de8c9894cbf2908e0749d0c267ab52cd912d85a1dce2e20ef9b16c1d7a16d60c.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO approval_process_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "de8c9894cbf2908e0749d0c267ab52cd912d85a1dce2e20ef9b16c1d7a16d60c" +} diff --git a/core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json b/core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json new file mode 100644 index 000000000..613ad1fe8 --- /dev/null +++ b/core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891" +} diff --git a/core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json b/core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json new file mode 100644 index 000000000..2734eac79 --- /dev/null +++ b/core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_journal_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759" +} diff --git a/core/deposit/.sqlx/query-e26f1c624922b283d07e3f92556be689d2012aef602e07a00c31c774a7bf78a9.json b/core/deposit/.sqlx/query-e26f1c624922b283d07e3f92556be689d2012aef602e07a00c31c774a7bf78a9.json new file mode 100644 index 000000000..6248a0050 --- /dev/null +++ b/core/deposit/.sqlx/query-e26f1c624922b283d07e3f92556be689d2012aef602e07a00c31c774a7bf78a9.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT committee_id, id FROM approval_processes WHERE ((committee_id = $1) AND (COALESCE(id < $3, true))) ORDER BY id DESC LIMIT $2) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e26f1c624922b283d07e3f92556be689d2012aef602e07a00c31c774a7bf78a9" +} diff --git a/core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json b/core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json new file mode 100644 index 000000000..8721d665e --- /dev/null +++ b/core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_tx_templates WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4" +} diff --git a/core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json b/core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json new file mode 100644 index 000000000..0c2ab4068 --- /dev/null +++ b/core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE id = $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: VelocityLimitId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673" +} diff --git a/core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json b/core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json new file mode 100644 index 000000000..61e366613 --- /dev/null +++ b/core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE external_id = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f" +} diff --git a/core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json b/core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json new file mode 100644 index 000000000..214a71c9d --- /dev/null +++ b/core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_journals (id, name, data_source_id, created_at) VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3" +} diff --git a/core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json b/core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json new file mode 100644 index 000000000..ab017c339 --- /dev/null +++ b/core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_entries WHERE data_source_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526" +} diff --git a/core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json b/core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json new file mode 100644 index 000000000..0d6a3d3c7 --- /dev/null +++ b/core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE latest_values = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Jsonb" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09" +} diff --git a/core/deposit/.sqlx/query-e97961667c6ff7b1acc0ef7acad4a25dd7767f44f9f0daef9aa1d0ab6c553a0b.json b/core/deposit/.sqlx/query-e97961667c6ff7b1acc0ef7acad4a25dd7767f44f9f0daef9aa1d0ab6c553a0b.json new file mode 100644 index 000000000..1a471d8ee --- /dev/null +++ b/core/deposit/.sqlx/query-e97961667c6ff7b1acc0ef7acad4a25dd7767f44f9f0daef9aa1d0ab6c553a0b.json @@ -0,0 +1,43 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT committee_id, created_at, id FROM approval_processes WHERE ((committee_id = $1) AND (COALESCE((created_at, id) > ($4, $3), $3 IS NULL))) ORDER BY created_at ASC, id ASC LIMIT $2) SELECT i.id AS \"entity_id: ApprovalProcessId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN approval_process_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: ApprovalProcessId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e97961667c6ff7b1acc0ef7acad4a25dd7767f44f9f0daef9aa1d0ab6c553a0b" +} diff --git a/core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json b/core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json new file mode 100644 index 000000000..601b3aa8b --- /dev/null +++ b/core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO cala_outbox_events (sequence)\n SELECT unnest($1::bigint[]) AS sequence\n ON CONFLICT (sequence) DO UPDATE\n SET sequence = EXCLUDED.sequence\n RETURNING id, sequence AS \"sequence!: EventSequence\", payload, recorded_at\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence!: EventSequence", + "type_info": "Int8" + }, + { + "ordinal": 2, + "name": "payload", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8Array" + ] + }, + "nullable": [ + false, + false, + true, + false + ] + }, + "hash": "e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333" +} diff --git a/core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json b/core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json new file mode 100644 index 000000000..1d0ea370e --- /dev/null +++ b/core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145" +} diff --git a/core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json b/core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json new file mode 100644 index 000000000..e97093eb4 --- /dev/null +++ b/core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE code = $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TxTemplateId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d" +} diff --git a/core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json b/core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json new file mode 100644 index 000000000..1fb7baa65 --- /dev/null +++ b/core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountSetId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908" +} diff --git a/core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json new file mode 100644 index 000000000..ef54cdb3b --- /dev/null +++ b/core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" +} diff --git a/core/deposit/.sqlx/query-f3fc3e97653e968b7706ad72dbf9ecd1acc99957b14837f4cd747b9f26b3c02c.json b/core/deposit/.sqlx/query-f3fc3e97653e968b7706ad72dbf9ecd1acc99957b14837f4cd747b9f26b3c02c.json new file mode 100644 index 000000000..bbe406e16 --- /dev/null +++ b/core/deposit/.sqlx/query-f3fc3e97653e968b7706ad72dbf9ecd1acc99957b14837f4cd747b9f26b3c02c.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO policies (id, process_type, committee_id, created_at) VALUES ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "f3fc3e97653e968b7706ad72dbf9ecd1acc99957b14837f4cd747b9f26b3c02c" +} diff --git a/core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json b/core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json new file mode 100644 index 000000000..bd61d76af --- /dev/null +++ b/core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE cala_account_sets SET name = $2 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25" +} diff --git a/core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json b/core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json new file mode 100644 index 000000000..218ed784a --- /dev/null +++ b/core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_entries WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: EntryId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c" +} diff --git a/core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json b/core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json new file mode 100644 index 000000000..c2c7e1111 --- /dev/null +++ b/core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE journal_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: TransactionId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b" +} diff --git a/core/deposit/.sqlx/query-f7bac8b748ff6e5b70952d2ff5efe97a704b71707bcc506db2feb941b5e314f3.json b/core/deposit/.sqlx/query-f7bac8b748ff6e5b70952d2ff5efe97a704b71707bcc506db2feb941b5e314f3.json new file mode 100644 index 000000000..2560d1d99 --- /dev/null +++ b/core/deposit/.sqlx/query-f7bac8b748ff6e5b70952d2ff5efe97a704b71707bcc506db2feb941b5e314f3.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT id FROM core_withdrawals WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN core_withdrawal_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f7bac8b748ff6e5b70952d2ff5efe97a704b71707bcc506db2feb941b5e314f3" +} diff --git a/core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json b/core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json new file mode 100644 index 000000000..f8cab6a2c --- /dev/null +++ b/core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json @@ -0,0 +1,60 @@ +{ + "db_name": "PostgreSQL", + "query": "\n WITH first AS (\n SELECT\n true AS first, false AS last, h.values,\n a.normal_balance_type AS \"normal_balance_type!: DebitOrCredit\", h.recorded_at\n FROM cala_balance_history h\n JOIN cala_accounts a\n ON h.account_id = a.id\n WHERE h.journal_id = $1\n AND h.account_id = $2\n AND h.currency = $3\n AND h.recorded_at < $4\n ORDER BY h.recorded_at DESC, h.version DESC\n LIMIT 1\n ),\n last AS (\n SELECT \n false AS first, true AS last, h.values,\n a.normal_balance_type AS \"normal_balance_type!: DebitOrCredit\", h.recorded_at\n FROM cala_balance_history h\n JOIN cala_accounts a\n ON h.account_id = a.id\n WHERE h.journal_id = $1\n AND h.account_id = $2\n AND h.currency = $3\n AND h.recorded_at <= COALESCE($5, NOW())\n ORDER BY h.recorded_at DESC, h.version DESC\n LIMIT 1\n )\n SELECT * FROM first\n UNION ALL\n SELECT * FROM last\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "first", + "type_info": "Bool" + }, + { + "ordinal": 1, + "name": "last", + "type_info": "Bool" + }, + { + "ordinal": 2, + "name": "values", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "normal_balance_type!: DebitOrCredit", + "type_info": { + "Custom": { + "name": "debitorcredit", + "kind": { + "Enum": [ + "debit", + "credit" + ] + } + } + } + }, + { + "ordinal": 4, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Uuid", + "Uuid", + "Text", + "Timestamptz", + "Timestamptz" + ] + }, + "nullable": [ + null, + null, + null, + null, + null + ] + }, + "hash": "f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb" +} diff --git a/core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json new file mode 100644 index 000000000..0daaa8a87 --- /dev/null +++ b/core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" +} diff --git a/core/deposit/.sqlx/query-f8bc7e13180dafd658190520f81f6cbce2cb9976ede2b5d1c2065f2cc47d27dc.json b/core/deposit/.sqlx/query-f8bc7e13180dafd658190520f81f6cbce2cb9976ede2b5d1c2065f2cc47d27dc.json new file mode 100644 index 000000000..caaf2edb7 --- /dev/null +++ b/core/deposit/.sqlx/query-f8bc7e13180dafd658190520f81f6cbce2cb9976ede2b5d1c2065f2cc47d27dc.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT i.id AS \"id: WithdrawalId\", e.sequence, e.event, e.recorded_at FROM core_withdrawals i JOIN core_withdrawal_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id: WithdrawalId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "UuidArray" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "f8bc7e13180dafd658190520f81f6cbce2cb9976ede2b5d1c2065f2cc47d27dc" +} diff --git a/core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json b/core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json new file mode 100644 index 000000000..dee2968e7 --- /dev/null +++ b/core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_velocity_limit_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Timestamptz", + "UuidArray", + "Int4Array", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087" +} diff --git a/core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json b/core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json new file mode 100644 index 000000000..fbf189e7c --- /dev/null +++ b/core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT name, id FROM cala_accounts WHERE (COALESCE((name, id) > ($3, $2), $2 IS NULL)) ORDER BY name ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.name asc, i.id asc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f" +} diff --git a/core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json new file mode 100644 index 000000000..4a5f7e808 --- /dev/null +++ b/core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" +} diff --git a/core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json b/core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json new file mode 100644 index 000000000..40cad9e0a --- /dev/null +++ b/core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO cala_transaction_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Timestamptz", + "Int8", + "TextArray", + "JsonbArray" + ] + }, + "nullable": [] + }, + "hash": "fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9" +} diff --git a/core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json new file mode 100644 index 000000000..897ae5268 --- /dev/null +++ b/core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json @@ -0,0 +1,75 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" +} diff --git a/core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json b/core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json new file mode 100644 index 000000000..786ee5053 --- /dev/null +++ b/core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "WITH entities AS (SELECT created_at, id FROM cala_accounts WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "entity_id: AccountId", + "type_info": "Uuid" + }, + { + "ordinal": 1, + "name": "sequence", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "event", + "type_info": "Jsonb" + }, + { + "ordinal": 3, + "name": "recorded_at", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Int8", + "Uuid", + "Timestamptz" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3" +} diff --git a/core/deposit/.sqlx/query-fecae87d783c20d975d3f14748ca4c3b885a24f2af3c6e4170285551e2b6ac3c.json b/core/deposit/.sqlx/query-fecae87d783c20d975d3f14748ca4c3b885a24f2af3c6e4170285551e2b6ac3c.json new file mode 100644 index 000000000..fc9eb310f --- /dev/null +++ b/core/deposit/.sqlx/query-fecae87d783c20d975d3f14748ca4c3b885a24f2af3c6e4170285551e2b6ac3c.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE approval_processes SET process_type = $2, committee_id = $3, policy_id = $4 WHERE id = $1", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Uuid", + "Varchar", + "Uuid", + "Uuid" + ] + }, + "nullable": [] + }, + "hash": "fecae87d783c20d975d3f14748ca4c3b885a24f2af3c6e4170285551e2b6ac3c" +} diff --git a/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json new file mode 100644 index 000000000..eb3a84f04 --- /dev/null +++ b/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" +} diff --git a/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json new file mode 100644 index 000000000..1ea12e396 --- /dev/null +++ b/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" +} diff --git a/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json new file mode 100644 index 000000000..8046c5db1 --- /dev/null +++ b/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" +} diff --git a/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json new file mode 100644 index 000000000..e246e53b4 --- /dev/null +++ b/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" +} diff --git a/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json new file mode 100644 index 000000000..4d06843d1 --- /dev/null +++ b/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json @@ -0,0 +1,62 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * FROM casbin_rule", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" +} diff --git a/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json new file mode 100644 index 000000000..75c6da350 --- /dev/null +++ b/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" +} diff --git a/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json new file mode 100644 index 000000000..ce229dc41 --- /dev/null +++ b/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" +} diff --git a/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json new file mode 100644 index 000000000..4c4c1df2a --- /dev/null +++ b/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" +} diff --git a/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} diff --git a/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json new file mode 100644 index 000000000..ef54cdb3b --- /dev/null +++ b/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" +} diff --git a/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json new file mode 100644 index 000000000..0daaa8a87 --- /dev/null +++ b/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" +} diff --git a/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json new file mode 100644 index 000000000..4a5f7e808 --- /dev/null +++ b/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" +} diff --git a/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json new file mode 100644 index 000000000..897ae5268 --- /dev/null +++ b/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json @@ -0,0 +1,75 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" +} diff --git a/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json new file mode 100644 index 000000000..eb3a84f04 --- /dev/null +++ b/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" +} diff --git a/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json new file mode 100644 index 000000000..1ea12e396 --- /dev/null +++ b/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" +} diff --git a/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json new file mode 100644 index 000000000..8046c5db1 --- /dev/null +++ b/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" +} diff --git a/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json new file mode 100644 index 000000000..e246e53b4 --- /dev/null +++ b/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" +} diff --git a/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json new file mode 100644 index 000000000..4d06843d1 --- /dev/null +++ b/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json @@ -0,0 +1,62 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * FROM casbin_rule", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" +} diff --git a/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json new file mode 100644 index 000000000..75c6da350 --- /dev/null +++ b/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" +} diff --git a/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json new file mode 100644 index 000000000..ce229dc41 --- /dev/null +++ b/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" +} diff --git a/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json new file mode 100644 index 000000000..4c4c1df2a --- /dev/null +++ b/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" +} diff --git a/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} diff --git a/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json new file mode 100644 index 000000000..ef54cdb3b --- /dev/null +++ b/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" +} diff --git a/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json new file mode 100644 index 000000000..0daaa8a87 --- /dev/null +++ b/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" +} diff --git a/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json new file mode 100644 index 000000000..4a5f7e808 --- /dev/null +++ b/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" +} diff --git a/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json new file mode 100644 index 000000000..897ae5268 --- /dev/null +++ b/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json @@ -0,0 +1,75 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" +} diff --git a/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json new file mode 100644 index 000000000..eb3a84f04 --- /dev/null +++ b/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" +} diff --git a/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json new file mode 100644 index 000000000..1ea12e396 --- /dev/null +++ b/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" +} diff --git a/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json new file mode 100644 index 000000000..8046c5db1 --- /dev/null +++ b/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" +} diff --git a/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json new file mode 100644 index 000000000..e246e53b4 --- /dev/null +++ b/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" +} diff --git a/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json new file mode 100644 index 000000000..4d06843d1 --- /dev/null +++ b/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json @@ -0,0 +1,62 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * FROM casbin_rule", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" +} diff --git a/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json new file mode 100644 index 000000000..75c6da350 --- /dev/null +++ b/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json @@ -0,0 +1,12 @@ +{ + "db_name": "PostgreSQL", + "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [] + }, + "nullable": [] + }, + "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" +} diff --git a/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json new file mode 100644 index 000000000..ce229dc41 --- /dev/null +++ b/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" +} diff --git a/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json new file mode 100644 index 000000000..4c4c1df2a --- /dev/null +++ b/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json @@ -0,0 +1,19 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" +} diff --git a/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} diff --git a/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json new file mode 100644 index 000000000..ef54cdb3b --- /dev/null +++ b/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" +} diff --git a/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json new file mode 100644 index 000000000..0daaa8a87 --- /dev/null +++ b/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar", + "Varchar", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" +} diff --git a/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json new file mode 100644 index 000000000..4a5f7e808 --- /dev/null +++ b/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" +} diff --git a/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json new file mode 100644 index 000000000..897ae5268 --- /dev/null +++ b/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json @@ -0,0 +1,75 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "ptype", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "v0", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "v1", + "type_info": "Varchar" + }, + { + "ordinal": 4, + "name": "v2", + "type_info": "Varchar" + }, + { + "ordinal": 5, + "name": "v3", + "type_info": "Varchar" + }, + { + "ordinal": 6, + "name": "v4", + "type_info": "Varchar" + }, + { + "ordinal": 7, + "name": "v5", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + }, + "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" +} diff --git a/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} diff --git a/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} diff --git a/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json new file mode 100644 index 000000000..60f58c60f --- /dev/null +++ b/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT NOW()", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "now", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + null + ] + }, + "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" +} From 028f89a7710bd1202b0f59aeb4d9896c26c5c68f Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 12 Dec 2024 09:33:49 +0100 Subject: [PATCH 17/24] fix: add instrumentation to credit_facility.list --- lana/app/src/credit_facility/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index bdd37ef8d..946640d34 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -492,13 +492,13 @@ impl CreditFacilities { Ok(credit_facility) } - // #[instrument(name = "credit_facility.list", skip(self), err)] + #[instrument(name = "credit_facility.list", skip(self), err)] pub async fn list( &self, sub: &Subject, query: es_entity::PaginatedQueryArgs, filter: FindManyCreditFacilities, - sort: impl Into>, + sort: impl Into> + std::fmt::Debug, ) -> Result< es_entity::PaginatedQueryRet, CreditFacilityError, From da687a10d5c683cb5ef069205de2afdf0289277c Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 12 Dec 2024 09:38:04 +0100 Subject: [PATCH 18/24] chore: clippy --- core/deposit/src/ledger/mod.rs | 8 ++++---- lana/app/tests/gcs.rs | 2 +- lib/authz/src/dummy.rs | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/deposit/src/ledger/mod.rs b/core/deposit/src/ledger/mod.rs index 21a1cc853..48794fad7 100644 --- a/core/deposit/src/ledger/mod.rs +++ b/core/deposit/src/ledger/mod.rs @@ -28,10 +28,10 @@ impl DepositLedger { let deposit_omnibus_account_id = Self::create_deposit_omnibus_account(cala, omnibus_account_code.clone()).await?; - templates::RecordDeposit::init(&cala).await?; - templates::InitiateWithdraw::init(&cala).await?; - templates::CancelWithdraw::init(&cala).await?; - templates::ConfirmWithdraw::init(&cala).await?; + templates::RecordDeposit::init(cala).await?; + templates::InitiateWithdraw::init(cala).await?; + templates::CancelWithdraw::init(cala).await?; + templates::ConfirmWithdraw::init(cala).await?; Ok(Self { cala: cala.clone(), diff --git a/lana/app/tests/gcs.rs b/lana/app/tests/gcs.rs index 00e5462aa..4f85929c9 100644 --- a/lana/app/tests/gcs.rs +++ b/lana/app/tests/gcs.rs @@ -32,7 +32,7 @@ async fn upload_doc() -> anyhow::Result<()> { let _ = storage.upload(content, filename, "application/txt").await; let res = storage._list("".to_string()).await?; - assert!(res.first().is_some()); + assert!(!res.is_empty()); let count = res.len(); // generate link diff --git a/lib/authz/src/dummy.rs b/lib/authz/src/dummy.rs index 1101f062e..8b534d2aa 100644 --- a/lib/authz/src/dummy.rs +++ b/lib/authz/src/dummy.rs @@ -24,6 +24,12 @@ impl DummyPerms { } } +impl Default for DummyPerms { + fn default() -> Self { + Self::new() + } +} + #[derive(Debug, Clone, Copy)] pub struct DummySubject; impl audit::SystemSubject for DummySubject { From be885609f5de54cfc71a9c2e9f797e1105d8e2b0 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 12 Dec 2024 10:05:16 +0100 Subject: [PATCH 19/24] chore: CreditLedger boilerplate --- Cargo.lock | 1 + lana/app/Cargo.toml | 1 + lana/app/src/app/error.rs | 2 + lana/app/src/app/mod.rs | 8 ++++ lana/app/src/credit_facility/error.rs | 2 + lana/app/src/credit_facility/ledger/error.rs | 17 +++++++++ lana/app/src/credit_facility/ledger/mod.rs | 21 +++++++++++ lana/app/src/credit_facility/mod.rs | 39 ++++++++++++-------- 8 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 lana/app/src/credit_facility/ledger/error.rs create mode 100644 lana/app/src/credit_facility/ledger/mod.rs diff --git a/Cargo.lock b/Cargo.lock index 276b03623..4f327a461 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2470,6 +2470,7 @@ dependencies = [ "axum-extra", "base64 0.22.1", "cached 0.53.1", + "cala-ledger", "cala-ledger-core-types 0.2.44", "chrono", "clap", diff --git a/lana/app/Cargo.toml b/lana/app/Cargo.toml index 1aab3c55b..5c86ee3db 100644 --- a/lana/app/Cargo.toml +++ b/lana/app/Cargo.toml @@ -25,6 +25,7 @@ outbox = { path = "../../lib/outbox" } audit = { path = "../../lib/audit" } authz = { path = "../../lib/authz" } +cala-ledger = { workspace = true } es-entity = { workspace = true, features = ["graphql"] } sim-time = { workspace = true, optional = true } diff --git a/lana/app/src/app/error.rs b/lana/app/src/app/error.rs index 0f9f6fe41..72813e390 100644 --- a/lana/app/src/app/error.rs +++ b/lana/app/src/app/error.rs @@ -30,4 +30,6 @@ pub enum ApplicationError { WithdrawalError(#[from] crate::withdrawal::error::WithdrawalError), #[error("ApplicationError - DashboardError: {0}")] DashboardError(#[from] dashboard::error::DashboardError), + #[error("ApplicationError - CalaInit: {0}")] + CalaError(#[from] cala_ledger::error::LedgerError), } diff --git a/lana/app/src/app/mod.rs b/lana/app/src/app/mod.rs index 822781cb8..90c383223 100644 --- a/lana/app/src/app/mod.rs +++ b/lana/app/src/app/mod.rs @@ -85,6 +85,12 @@ impl LanaApp { let documents = Documents::new(&pool, &storage, &authz); let report = Reports::init(&pool, &config.report, &authz, &jobs, &storage, &export).await?; let users = Users::init(&pool, &authz, &outbox, config.user.superuser_email).await?; + let cala_config = cala_ledger::CalaLedgerConfig::builder() + .pool(pool.clone()) + .exec_migrations(false) + .build() + .expect("cala config"); + let cala = cala_ledger::CalaLedger::init(cala_config).await?; let credit_facilities = CreditFacilities::init( &pool, config.credit_facility, @@ -96,6 +102,8 @@ impl LanaApp { &ledger, &price, &outbox, + &cala, + cala_ledger::JournalId::new(), ) .await?; let terms_templates = TermsTemplates::new(&pool, &authz, &export); diff --git a/lana/app/src/credit_facility/error.rs b/lana/app/src/credit_facility/error.rs index 48a56c7d5..00361391a 100644 --- a/lana/app/src/credit_facility/error.rs +++ b/lana/app/src/credit_facility/error.rs @@ -6,6 +6,8 @@ use crate::primitives::{CustomerId, Satoshis, UsdCents}; pub enum CreditFacilityError { #[error("CreditFacilityError - Sqlx: {0}")] Sqlx(#[from] sqlx::Error), + #[error("CreditFacilityError - CreditError: {0}")] + CreditLedgerError(#[from] super::ledger::error::CreditLedgerError), #[error("CreditFacilityError - EsEntityError: {0}")] EsEntityError(es_entity::EsEntityError), #[error("FacilityError - CursorDestructureError: {0}")] diff --git a/lana/app/src/credit_facility/ledger/error.rs b/lana/app/src/credit_facility/ledger/error.rs new file mode 100644 index 000000000..29def72e7 --- /dev/null +++ b/lana/app/src/credit_facility/ledger/error.rs @@ -0,0 +1,17 @@ +use thiserror::Error; + +#[derive(Error, Debug)] +pub enum CreditLedgerError { + #[error("DepositLedgerError - Sqlx: {0}")] + Sqlx(#[from] sqlx::Error), + #[error("DepositLedgerError - CalaLedger: {0}")] + CalaLedger(#[from] cala_ledger::error::LedgerError), + #[error("DepositLedgerError - CalaAccountError: {0}")] + CalaAccount(#[from] cala_ledger::account::error::AccountError), + #[error("DepositLedgerError - CalaTxTemplateError: {0}")] + CalaTxTemplate(#[from] cala_ledger::tx_template::error::TxTemplateError), + #[error("DepositLedgerError - CalaBalanceError: {0}")] + CalaBalance(#[from] cala_ledger::balance::error::BalanceError), + #[error("DepositLedgerError - ConversionError: {0}")] + ConversionError(#[from] core_money::ConversionError), +} diff --git a/lana/app/src/credit_facility/ledger/mod.rs b/lana/app/src/credit_facility/ledger/mod.rs new file mode 100644 index 000000000..4deaf4d40 --- /dev/null +++ b/lana/app/src/credit_facility/ledger/mod.rs @@ -0,0 +1,21 @@ +pub mod error; +// mod templates; + +use cala_ledger::{CalaLedger, JournalId}; + +use error::*; + +#[derive(Clone)] +pub struct CreditLedger { + _cala: CalaLedger, + _journal_id: JournalId, +} + +impl CreditLedger { + pub async fn init(cala: &CalaLedger, journal_id: JournalId) -> Result { + Ok(Self { + _cala: cala.clone(), + _journal_id: journal_id, + }) + } +} diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index 946640d34..d2f5b0d4a 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -5,6 +5,7 @@ pub mod error; mod history; mod interest_accrual; mod jobs; +mod ledger; mod processes; mod publisher; mod repo; @@ -12,6 +13,8 @@ mod repo; use std::collections::HashMap; use authz::PermissionCheck; +use cala_ledger::CalaLedger; +use tracing::instrument; use crate::{ audit::AuditInfo, @@ -37,6 +40,7 @@ use error::*; pub use history::*; pub use interest_accrual::*; use jobs::*; +use ledger::CreditLedger; use processes::activate_credit_facility::*; pub use processes::approve_credit_facility::*; pub use processes::approve_disbursal::*; @@ -46,7 +50,6 @@ pub use repo::{ credit_facility_cursor::*, CreditFacilitiesSortBy, FindManyCreditFacilities, ListDirection, Sort, }; -use tracing::instrument; #[derive(Clone)] pub struct CreditFacilities { @@ -55,7 +58,8 @@ pub struct CreditFacilities { credit_facility_repo: CreditFacilityRepo, disbursal_repo: DisbursalRepo, governance: Governance, - ledger: Ledger, + gql_ledger: Ledger, + _ledger: CreditLedger, price: Price, config: CreditFacilityConfig, approve_disbursal: ApproveDisbursal, @@ -72,9 +76,11 @@ impl CreditFacilities { export: &Export, authz: &Authorization, customers: &Customers, - ledger: &Ledger, + gql_ledger: &Ledger, price: &Price, outbox: &Outbox, + cala: &CalaLedger, + journal_id: cala_ledger::JournalId, ) -> Result { let publisher = CreditFacilityPublisher::new(export, outbox); let credit_facility_repo = CreditFacilityRepo::new(pool, &publisher); @@ -84,14 +90,14 @@ impl CreditFacilities { &credit_facility_repo, authz.audit(), governance, - ledger, + gql_ledger, ); let approve_credit_facility = ApproveCreditFacility::new(&credit_facility_repo, authz.audit(), governance); let activate_credit_facility = ActivateCreditFacility::new( &credit_facility_repo, &disbursal_repo, - ledger, + gql_ledger, price, jobs, authz.audit(), @@ -110,14 +116,14 @@ impl CreditFacilities { .await?; jobs.add_initializer( interest_incurrences::CreditFacilityProcessingJobInitializer::new( - ledger, + gql_ledger, credit_facility_repo.clone(), authz.audit(), ), ); jobs.add_initializer( interest_accruals::CreditFacilityProcessingJobInitializer::new( - ledger, + gql_ledger, credit_facility_repo.clone(), jobs, authz.audit(), @@ -143,13 +149,16 @@ impl CreditFacilities { .await; let _ = governance.init_policy(APPROVE_DISBURSAL_PROCESS).await; + let ledger = CreditLedger::init(cala, journal_id).await?; + Ok(Self { authz: authz.clone(), customers: customers.clone(), credit_facility_repo, disbursal_repo, governance: governance.clone(), - ledger: ledger.clone(), + gql_ledger: gql_ledger.clone(), + _ledger: ledger, price: price.clone(), config, approve_disbursal, @@ -214,7 +223,7 @@ impl CreditFacilities { .credit_facility_repo .create_in_op(&mut db, new_credit_facility) .await?; - self.ledger + self.gql_ledger .create_accounts_for_credit_facility(credit_facility.id, credit_facility.account_ids) .await?; @@ -290,7 +299,7 @@ impl CreditFacilities { .await?; let ledger_balances = self - .ledger + .gql_ledger .get_credit_facility_balance(credit_facility.account_ids) .await?; credit_facility @@ -405,7 +414,7 @@ impl CreditFacilities { .update_in_op(&mut db, &mut credit_facility) .await?; - self.ledger + self.gql_ledger .update_credit_facility_collateral(credit_facility_collateral_update) .await?; @@ -454,7 +463,7 @@ impl CreditFacilities { .await?; let ledger_balances = self - .ledger + .gql_ledger .get_credit_facility_balance(credit_facility.account_ids) .await?; credit_facility @@ -466,14 +475,14 @@ impl CreditFacilities { .repo() .find_by_id(credit_facility.customer_id) .await?; - self.ledger + self.gql_ledger .get_customer_balance(customer.account_ids) .await? .check_withdraw_amount(amount)?; let repayment = credit_facility.initiate_repayment(amount)?; let executed_at = self - .ledger + .gql_ledger .record_credit_facility_repayment(repayment.clone()) .await?; credit_facility.confirm_repayment( @@ -681,7 +690,7 @@ impl CreditFacilities { let completion = credit_facility.initiate_completion()?; let executed_at = self - .ledger + .gql_ledger .complete_credit_facility(completion.clone()) .await?; credit_facility.confirm_completion( From b3ed46e1a5eef3c8b3c1fa1f754a0277c4963ca8 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Thu, 12 Dec 2024 11:43:23 +0100 Subject: [PATCH 20/24] chore: create credit facility accounts --- Cargo.lock | 126 +++++++++--------- .../ledger/credit_facility_accounts.rs | 27 ++++ lana/app/src/credit_facility/ledger/mod.rs | 85 +++++++++++- lana/app/src/credit_facility/mod.rs | 16 ++- lana/app/src/ledger/credit_facility.rs | 26 +--- 5 files changed, 183 insertions(+), 97 deletions(-) create mode 100644 lana/app/src/credit_facility/ledger/credit_facility_accounts.rs diff --git a/Cargo.lock b/Cargo.lock index 4f327a461..17c822bdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,7 +254,7 @@ dependencies = [ "proc-macro2", "quote", "strum", - "syn 2.0.87", + "syn 2.0.90", "thiserror", ] @@ -301,7 +301,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -312,7 +312,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -462,7 +462,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -581,7 +581,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -672,7 +672,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -684,7 +684,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -712,7 +712,7 @@ dependencies = [ [[package]] name = "cala-cel-interpreter" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "cala-cel-parser 0.3.3-dev", "chrono", @@ -737,7 +737,7 @@ dependencies = [ [[package]] name = "cala-cel-parser" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "lalrpop", "lalrpop-util", @@ -746,7 +746,7 @@ dependencies = [ [[package]] name = "cala-ledger" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "cached 0.51.4", "cala-cel-interpreter 0.3.3-dev", @@ -796,7 +796,7 @@ dependencies = [ [[package]] name = "cala-ledger-core-types" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "cala-cel-interpreter 0.3.3-dev", "chrono", @@ -813,7 +813,7 @@ dependencies = [ [[package]] name = "cala-tracing" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "anyhow", "axum-extra", @@ -917,7 +917,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1144,7 +1144,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1155,7 +1155,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1253,7 +1253,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1263,7 +1263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1307,7 +1307,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1384,7 +1384,7 @@ dependencies = [ [[package]] name = "es-entity" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "async-graphql", "async-trait", @@ -1403,7 +1403,7 @@ dependencies = [ [[package]] name = "es-entity-macros" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "convert_case", "darling", @@ -1411,7 +1411,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1573,7 +1573,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2250,7 +2250,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3118,7 +3118,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3204,7 +3204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3242,7 +3242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", - "heck 0.5.0", + "heck 0.4.1", "itertools 0.13.0", "log", "multimap", @@ -3254,7 +3254,7 @@ dependencies = [ "pulldown-cmark", "pulldown-cmark-to-cmark", "regex", - "syn 2.0.87", + "syn 2.0.90", "tempfile", ] @@ -3268,7 +3268,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3301,7 +3301,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a669d5acbe719010c6f62a64e6d7d88fdedc1fe46e419747949ecb6312e9b14" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "prost", "prost-build", "prost-types", @@ -3675,7 +3675,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4010,7 +4010,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4074,7 +4074,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4113,7 +4113,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "sim-time" version = "0.3.3-dev" -source = "git+https://github.com/galoymoney/cala.git?branch=main#dd03154ab36873a3316cd6fb10297da649d3c42d" +source = "git+https://github.com/galoymoney/cala.git?branch=main#fe03fbcc0e4243a7f094f54add7f21cc43aa7473" dependencies = [ "chrono", "serde", @@ -4364,7 +4364,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4387,7 +4387,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.87", + "syn 2.0.90", "tempfile", "tokio", "url", @@ -4571,7 +4571,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4593,9 +4593,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -4625,7 +4625,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4705,7 +4705,7 @@ checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4787,9 +4787,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -4810,7 +4810,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4933,7 +4933,7 @@ dependencies = [ "prost-build", "prost-types", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5015,9 +5015,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -5027,20 +5027,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -5089,9 +5089,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -5099,9 +5099,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -5194,7 +5194,7 @@ checksum = "70b20a22c42c8f1cd23ce5e34f165d4d37038f5b663ad20fb6adbdf029172483" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5403,7 +5403,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-shared", ] @@ -5437,7 +5437,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5784,7 +5784,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -5832,7 +5832,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -5852,7 +5852,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure", ] @@ -5881,5 +5881,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] diff --git a/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs b/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs new file mode 100644 index 000000000..a3d261a33 --- /dev/null +++ b/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs @@ -0,0 +1,27 @@ +use serde::{Deserialize, Serialize}; + +use cala_ledger::AccountId as LedgerAccountId; + +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub struct CreditFacilityAccountIds { + pub facility_account_id: LedgerAccountId, + pub disbursed_receivable_account_id: LedgerAccountId, + pub collateral_account_id: LedgerAccountId, + pub interest_receivable_account_id: LedgerAccountId, + pub interest_account_id: LedgerAccountId, + pub fee_income_account_id: LedgerAccountId, +} + +impl CreditFacilityAccountIds { + #[allow(clippy::new_without_default)] + pub fn new() -> Self { + Self { + facility_account_id: LedgerAccountId::new(), + disbursed_receivable_account_id: LedgerAccountId::new(), + collateral_account_id: LedgerAccountId::new(), + interest_receivable_account_id: LedgerAccountId::new(), + interest_account_id: LedgerAccountId::new(), + fee_income_account_id: LedgerAccountId::new(), + } + } +} diff --git a/lana/app/src/credit_facility/ledger/mod.rs b/lana/app/src/credit_facility/ledger/mod.rs index 4deaf4d40..4b975cf9c 100644 --- a/lana/app/src/credit_facility/ledger/mod.rs +++ b/lana/app/src/credit_facility/ledger/mod.rs @@ -1,21 +1,100 @@ +mod credit_facility_accounts; pub mod error; // mod templates; -use cala_ledger::{CalaLedger, JournalId}; +use cala_ledger::{account::NewAccount, CalaLedger, JournalId}; +use crate::primitives::CreditFacilityId; + +pub use credit_facility_accounts::*; use error::*; #[derive(Clone)] pub struct CreditLedger { - _cala: CalaLedger, + cala: CalaLedger, _journal_id: JournalId, } impl CreditLedger { pub async fn init(cala: &CalaLedger, journal_id: JournalId) -> Result { Ok(Self { - _cala: cala.clone(), + cala: cala.clone(), _journal_id: journal_id, }) } + + pub async fn create_accounts_for_credit_facility( + &self, + op: es_entity::DbOp<'_>, + credit_facility_id: CreditFacilityId, + CreditFacilityAccountIds { + facility_account_id, + disbursed_receivable_account_id, + collateral_account_id, + interest_receivable_account_id, + interest_account_id, + fee_income_account_id, + }: CreditFacilityAccountIds, + ) -> Result<(), CreditLedgerError> { + let mut op = self.cala.ledger_operation_from_db_op(op); + let new_accounts = vec![ + NewAccount::builder() + .id(collateral_account_id) + .name("Credit Facility Collateral Account") + .code(format!("CREDIT_FACILITY.COLLATERAL.{}", credit_facility_id)) + .build() + .expect("new account"), + NewAccount::builder() + .id(facility_account_id) + .name("Off-Balance-Sheet Facility Account for Credit Facility") + .code(format!( + "CREDIT_FACILITY.OBS_FACILITY.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(disbursed_receivable_account_id) + .name("Disbursed Receivable Account for Credit Facility") + .code(format!( + "CREDIT_FACILITY.DISBURSED_RECEIVABLE.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(interest_receivable_account_id) + .name("Interest Receivable Account for Credit Facility") + .code(format!( + "CREDIT_FACILITY.INTEREST_RECEIVABLE.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(interest_account_id) + .name("Interest Income for Credit Facility") + .code(format!( + "CREDIT_FACILITY.INTEREST_INCOME.{}", + credit_facility_id + )) + .build() + .expect("new account"), + NewAccount::builder() + .id(fee_income_account_id) + .name("Fee Income for Credit Facility") + .code(format!("CREDIT_FACILITY.FEE_INCOME.{}", credit_facility_id)) + .build() + .expect("new account"), + ]; + + self.cala + .accounts() + .create_all_in_op(&mut op, new_accounts) + .await?; + + op.commit().await?; + + Ok(()) + } } diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index d2f5b0d4a..b59fc9c30 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -5,7 +5,7 @@ pub mod error; mod history; mod interest_accrual; mod jobs; -mod ledger; +pub mod ledger; mod processes; mod publisher; mod repo; @@ -59,7 +59,7 @@ pub struct CreditFacilities { disbursal_repo: DisbursalRepo, governance: Governance, gql_ledger: Ledger, - _ledger: CreditLedger, + ledger: CreditLedger, price: Price, config: CreditFacilityConfig, approve_disbursal: ApproveDisbursal, @@ -158,7 +158,7 @@ impl CreditFacilities { disbursal_repo, governance: governance.clone(), gql_ledger: gql_ledger.clone(), - _ledger: ledger, + ledger, price: price.clone(), config, approve_disbursal, @@ -223,12 +223,14 @@ impl CreditFacilities { .credit_facility_repo .create_in_op(&mut db, new_credit_facility) .await?; - self.gql_ledger - .create_accounts_for_credit_facility(credit_facility.id, credit_facility.account_ids) + self.ledger + .create_accounts_for_credit_facility( + db, + credit_facility.id, + credit_facility.account_ids, + ) .await?; - db.commit().await?; - Ok(credit_facility) } diff --git a/lana/app/src/ledger/credit_facility.rs b/lana/app/src/ledger/credit_facility.rs index 83b779112..3d3b068d5 100644 --- a/lana/app/src/ledger/credit_facility.rs +++ b/lana/app/src/ledger/credit_facility.rs @@ -2,35 +2,13 @@ use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use crate::{ - primitives::{CollateralAction, LedgerAccountId, LedgerTxId, Satoshis, UsdCents}, + primitives::{CollateralAction, LedgerTxId, Satoshis, UsdCents}, terms::InterestPeriod, }; use super::{cala::graphql::*, error::*, CustomerLedgerAccountIds}; -#[derive(Debug, Copy, Clone, Serialize, Deserialize)] -pub struct CreditFacilityAccountIds { - pub facility_account_id: LedgerAccountId, - pub disbursed_receivable_account_id: LedgerAccountId, - pub collateral_account_id: LedgerAccountId, - pub interest_receivable_account_id: LedgerAccountId, - pub interest_account_id: LedgerAccountId, - pub fee_income_account_id: LedgerAccountId, -} - -impl CreditFacilityAccountIds { - #[allow(clippy::new_without_default)] - pub fn new() -> Self { - Self { - facility_account_id: LedgerAccountId::new(), - disbursed_receivable_account_id: LedgerAccountId::new(), - collateral_account_id: LedgerAccountId::new(), - interest_receivable_account_id: LedgerAccountId::new(), - interest_account_id: LedgerAccountId::new(), - fee_income_account_id: LedgerAccountId::new(), - } - } -} +pub use crate::credit_facility::ledger::CreditFacilityAccountIds; #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub struct CreditFacilityLedgerBalance { From 45db3d06b1721714d41a0a6dc408ff69d715b1dc Mon Sep 17 00:00:00 2001 From: vindard <17693119+vindard@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:09:31 -0400 Subject: [PATCH 21/24] chore: run sqlx-prepare --- ...7284bdddedfb421958b14c60dca0f569def13.json | 41 ---------- ...c055897a1f93023072f09fc6317bad9965240.json | 29 ------- ...c7a650116df7dc5c650736a8f7e0d096db6e9.json | 28 ------- ...803e13ab2c0c03c462bfecc72e2588ec7aa3d.json | 18 ----- ...3fe363319ad7f0e4984df668b4a4fb524ac41.json | 41 ---------- ...ee46b8f0e59f973d3755fd15e5dba7f6e84ef.json | 40 ---------- ...7cb2bcbfdb27cb21575398ed79d0e5c204105.json | 40 ---------- ...81d4a067e6090b58b2988b1db17f4008f251b.json | 40 ---------- ...81d7b31d7da4f7aaead8d64a7e1a8840b8133.json | 40 ---------- ...8d81dd413bcf8c499b9f9ead5455096975e66.json | 40 ---------- ...14d6d872f3b5753d86531158e9ba854d0fe98.json | 42 ----------- ...a2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json | 18 ----- ...e1df2adda9f76e60cfc1d9a046cbda7d9b482.json | 20 ----- ...66a01b944a298a27d8b706d5d03633a769fa8.json | 29 ------- ...55985652f3d4611c113b63a479dcc71ed4d06.json | 40 ---------- ...9078bde0a7239c6eb1f725c85ac1dfb730881.json | 40 ---------- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...2d9e89bc89199926d3adf361418ad501a45ed.json | 40 ---------- ...bc89a052c4ee615d24efd601a0a337d631587.json | 29 ------- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...0c80d6a3463468c838795bdacf25d7e34c550.json | 41 ---------- ...18b7eb04b6b3662c819d9156ca8470b6c33fa.json | 42 ----------- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...6f5432ce8b1b9b8087a6c662ab63f635f231e.json | 18 ----- ...db13dcc9c4e37a9819451920447983426325c.json | 41 ---------- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...4c489041858391f80c32e4ec225130ad4ea38.json | 43 ----------- ...94c70e8d83b2c286505f993c6d050992a963a.json | 42 ----------- ...987f9b3227076c7912c07ae5302de8e8983b7.json | 41 ---------- ...04115c0184b6d5efb90e465281248a97035b7.json | 40 ---------- ...09942d115792af4d92ebc6835a4b4dcd1b140.json | 20 ----- ...95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json | 41 ---------- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...9d417d4377b8d48bdf0033a059ddc9d0d845e.json | 40 ---------- ...a9c6d3c24119d5159baf2de193f783aabc1cc.json | 40 ---------- ...342ea95649179cce6431f20bd4436c22ec7b1.json | 40 ---------- ...af293dcc9d7e02f4738c7c2c22ea2a3bb803e.json | 40 ---------- ...453db63a834a9fea6ec03dc9b40b1ffab5245.json | 29 ------- ...505c861fe052578a1cc33fbb2c851eb1a1201.json | 16 ---- ...8e249171ab7be68956199e39c2f97627c7960.json | 29 ------- ...021daba8d6c57a904f53fb2387f17c35ddb5f.json | 41 ---------- ...aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json | 40 ---------- ...ef197b999461df83ad615b5a9720a552a01d4.json | 42 ----------- ...b36cfde97707985a667a26734ddaac783bf40.json | 40 ---------- ...24dc37921d5cecf6f4f36441ff106cbabf2f9.json | 42 ----------- ...4505cd08522806f69fb72e5983e6aeada2819.json | 42 ----------- ...40c9177fa54a3a9e310c0c6871ff6d930dd1e.json | 40 ---------- ...1e78cea75c4b31b08815f29ce116f35b2bd5d.json | 40 ---------- ...b9c7379e3359b0ebd2042262f4b59a5d7f942.json | 18 ----- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...209d8763a8cf017da1bb441011e272f7040c4.json | 40 ---------- ...d763833cf9bbffdd372a446f8e854ce4bdf75.json | 18 ----- ...bb3de32b627d2421414dc139e4bda879fa839.json | 41 ---------- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...545be4621076c93c1819fe4f9fbd109bfae11.json | 42 ----------- ...3f161551ad2dfc79b54ac0ad6b61ad3b48400.json | 40 ---------- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...8695d1456fa5af698639b34dd2f5ca3c73a66.json | 18 ----- ...560e940a06ed4311bc9a371d5c5df448f75bf.json | 42 ----------- ...557a5d34b451eec43fbc2e72a0c2bba76cdf5.json | 42 ----------- ...2fb599f0aa3aac3b963c50de3476e88140e4b.json | 40 ---------- ...fe9701c8399ef465712207af13ff313e0d798.json | 18 ----- ...65622acc350311f428392cbe9e41071c6a939.json | 42 ----------- ...677d009b8358ad66e72d4f9ff1b161a652000.json | 50 ------------- ...0c90508d96a54b93a795f7a6e7543c72a9377.json | 15 ---- ...b9b87cf3ee271fcf85e55d5140b5be5f8ed50.json | 17 ----- ...38c23990ace1716520b2de81ec58a4d8660ab.json | 41 ---------- ...201c27c240e12b86cfbb67142454c22ee18bc.json | 18 ----- ...3528db6fdc940b592734ca8dbf7276c936dc0.json | 40 ---------- ...43cc28f976db4fecd622b693bb70dfc5900ec.json | 17 ----- ...02497e84348ce53b37753b222bd94e19b72f7.json | 40 ---------- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...54c2ba5b4bbe5302423e42881f3aa551c79f1.json | 42 ----------- ...17cd027ae0327a4dd73a4fd2dec006421e5ad.json | 18 ----- ...bced2cb50886bab09c62ee7f059b09e709b77.json | 41 ---------- ...45548e54b94b3c72e26aea4ab321734f8ea66.json | 23 ------ ...892318fc02212d2b72257665b1fbd6a211343.json | 32 -------- ...25f4f0c25add11e21ac141ba74d66d40f97e4.json | 42 ----------- ...4083b6626b5bc80d9bef48e9a654183fa7eee.json | 40 ---------- ...bcb949899d97660cf2d5ec2746758b2460300.json | 40 ---------- ...afc2f8698d54286b81ee552c54024b4aacba4.json | 40 ---------- ...563f8e80470035de31448f15278b48a3d6fad.json | 18 ----- ...5eaad28a6b1c99608ba6266d5aecb2e88924a.json | 42 ----------- ...1f8bd1c696138e116201513b54599727b5c74.json | 29 ------- ...fa5b6970a56e381e5733a67f4476916319cff.json | 15 ---- ...48c5d9ff5640e57bfbdb898b2eda0df48519b.json | 42 ----------- ...f89d23e5a32ecf79d3ba24e6f545bee1931be.json | 43 ----------- ...efd04f99f5caac2cbcb30822a660dcba106c2.json | 40 ---------- ...70649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json | 42 ----------- ...b51556244512f9f3a858317186423e5174e8f.json | 40 ---------- ...34734050a0cde90ffca641c7b219e29818336.json | 17 ----- ...61743e95e9d9a6ac18fd3e4fa1b2966604dce.json | 42 ----------- ...dcc9d963cc033582bf2e945e8bf3a301b4247.json | 22 ------ ...1172e87f7ee5ded42f2101a404d487e4e86ea.json | 42 ----------- ...455bae810c560710a00da05a8072cbc4a4444.json | 42 ----------- ...0998c9da3e94af3323d749b7a6fe9fcfb7cf7.json | 18 ----- ...7c29302c486144d4bc9793e55ecd7de75a2ea.json | 40 ---------- ...f444f41b33400d31d71de019636f9fc2585a5.json | 40 ---------- ...71d0971c7492f59cbfe94ce28a4d7d18e769e.json | 42 ----------- ...8569d51e2f96631002065e8dd8fcd05e9f5da.json | 40 ---------- ...63f99416d5c3b13fa291b3f7dc01932245529.json | 40 ---------- ...d7e90c5ce385892fb73b24edb16725456270d.json | 41 ---------- ...bc339a06fc7ef23b23ca08209ff3c0984ff73.json | 41 ---------- ...fa1691c2ca2939cb5f3556a682f6d4db2badb.json | 42 ----------- ...7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json | 19 ----- ...bf8b9d382e091a4d4bbd46bfffaccf0b47229.json | 40 ---------- ...0d42a80fdede540dbbcbb0bd220a26234b4ea.json | 23 ------ ...d8f29a27d72ec452e16e144f13c8b39828082.json | 41 ---------- ...dddccee12c4023ab3cd7319285f43a90d7aaf.json | 28 ------- ...5b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json | 40 ---------- ...ca9fde3349bbdd32a78c8f69930712782b392.json | 41 ---------- ...b60e33ff0b1afb748855b22cde64c19c112c3.json | 18 ----- ...cb385ca0b8e01ce5132e5aa6f83ab4c497481.json | 40 ---------- ...00b4a97ce6d42768e64c2438f1c2d42d42d1e.json | 40 ---------- ...c5a6d813ad66008c21c0a10ead263fff70f13.json | 41 ---------- ...d57c54950e7ea7b81e652afb4227db389f2fe.json | 40 ---------- ...0619e8c6793419322a882cea05f8a12e3c7cb.json | 42 ----------- ...075dd414d859b95961cd797d32565625234f1.json | 40 ---------- ...dd96a3dd7109770069959279b129a81229903.json | 18 ----- ...88c55338536d6542829d1520af1a07bbd2d94.json | 18 ----- ...f488c622e88a7f5471ffb590dc0a619e0a891.json | 40 ---------- ...d2901f02535f7866939dad145bd912b36b759.json | 18 ----- ...0256979363c88f2000f5e99fe0a215a8f06d4.json | 42 ----------- ...bac04cebc2e3086e9b184dc0ca5ad75b84673.json | 40 ---------- ...07c93159acfda96c25e0588584d4314b37a6f.json | 40 ---------- ...1a11467a3c77483ebe8591d24758ffbaa4dd3.json | 17 ----- ...c870090d7b176c96ec449ed4c34b5893da526.json | 40 ---------- ...16adfe905e9f81ced34a875dbb3bdd5cfdc09.json | 40 ---------- ...e70ff74e62037c3a84f74f8836756f610d333.json | 40 ---------- ...d5de3f0e72eb1af2315ae27c5496867c3b145.json | 41 ---------- ...7c4deb1dc2d3a7bda6df0bb792469748d534d.json | 40 ---------- ...cc4d06192f9575c97dfe8c907d8cec41d7908.json | 41 ---------- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...4de0120a042eaf0bd62e239461276b12abb25.json | 15 ---- ...2d0f81abad1b07a3d1c4587832b8ae912ae4c.json | 42 ----------- ...fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json | 40 ---------- ...5e8c3597c2a54f7f72c9a3a58be9457bd38cb.json | 60 --------------- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...4b159f065a1875dd1f02982a1f579c9558087.json | 18 ----- ...a0cd645e51b04720d1a01a85a778a544b368f.json | 42 ----------- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...f38df6a96e971db2139c10041ad0170cfd0a9.json | 18 ----- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...062c03b1af6949138cc500b1eccd0faf495b3.json | 42 ----------- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...96d94594d0ed0e9064047c7bcc042fdd609d.json} | 4 +- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...bcfe5f968b31500e8c8cf97fe16814bc04164.json | 20 ----- ...766573c91b2775a086c65bc9a5fdc91300bb0.json | 17 ----- ...36247a328db780a48da47c9402e1d3ebd80c9.json | 12 --- ...44610fb79a1b9330730c65953f0c1b88c2a53.json | 20 ----- ...b209a7e1f0974242ecd0f55e5b0098152bad5.json | 62 --------------- ...806b4c78b7aa2a9609c4eccb941c7dff7b107.json | 12 --- ...7cb75a999041a3eb6a8f8177bebfa3c30d56f.json | 16 ---- ...b89853785c32a5f83cb0b25609329c760428a.json | 19 ----- ...96d94594d0ed0e9064047c7bcc042fdd609d.json} | 4 +- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...226ba97993ede9988a4c57d58bd066500a119.json | 20 ----- ...21e00c42a3fad8082cf15c2af88cd8388f41b.json | 18 ----- ...b37d46c5a2f4202e1b8dce1f66a65069beb0b.json | 15 ---- ...c1b90b67b053add3d4cffb8d579bfc8f08345.json | 75 ------------------- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- ...b3dd649758b5afcf70feb2a6eff7d69925bfc.json | 20 ----- 188 files changed, 4 insertions(+), 5935 deletions(-) delete mode 100644 core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json delete mode 100644 core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json delete mode 100644 core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json delete mode 100644 core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json delete mode 100644 core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json delete mode 100644 core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json delete mode 100644 core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json delete mode 100644 core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json delete mode 100644 core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json delete mode 100644 core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json delete mode 100644 core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json delete mode 100644 core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json delete mode 100644 core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json delete mode 100644 core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json delete mode 100644 core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json delete mode 100644 core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json delete mode 100644 core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json delete mode 100644 core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json delete mode 100644 core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json delete mode 100644 core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json delete mode 100644 core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json delete mode 100644 core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json delete mode 100644 core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json delete mode 100644 core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json delete mode 100644 core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json delete mode 100644 core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json delete mode 100644 core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json delete mode 100644 core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json delete mode 100644 core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json delete mode 100644 core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json delete mode 100644 core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json delete mode 100644 core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json delete mode 100644 core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json delete mode 100644 core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json delete mode 100644 core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json delete mode 100644 core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json delete mode 100644 core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json delete mode 100644 core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json delete mode 100644 core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json delete mode 100644 core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json delete mode 100644 core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json delete mode 100644 core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json delete mode 100644 core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json delete mode 100644 core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json delete mode 100644 core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json delete mode 100644 core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json delete mode 100644 core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json delete mode 100644 core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json delete mode 100644 core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json delete mode 100644 core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json delete mode 100644 core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json delete mode 100644 core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json delete mode 100644 core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json delete mode 100644 core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json delete mode 100644 core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json delete mode 100644 core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json delete mode 100644 core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json delete mode 100644 core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json delete mode 100644 core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json delete mode 100644 core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json delete mode 100644 core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json delete mode 100644 core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json delete mode 100644 core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json delete mode 100644 core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json delete mode 100644 core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json delete mode 100644 core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json delete mode 100644 core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json delete mode 100644 core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json delete mode 100644 core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json delete mode 100644 core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json delete mode 100644 core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json delete mode 100644 core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json delete mode 100644 core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json delete mode 100644 core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json delete mode 100644 core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json delete mode 100644 core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json delete mode 100644 core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json delete mode 100644 core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json delete mode 100644 core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json delete mode 100644 core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json delete mode 100644 core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json delete mode 100644 core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json delete mode 100644 core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json delete mode 100644 core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json delete mode 100644 core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json delete mode 100644 core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json delete mode 100644 core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json delete mode 100644 core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json delete mode 100644 core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json delete mode 100644 core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json delete mode 100644 core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json delete mode 100644 core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json delete mode 100644 core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json delete mode 100644 core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json delete mode 100644 core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json delete mode 100644 core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json delete mode 100644 core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json delete mode 100644 core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json delete mode 100644 core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json delete mode 100644 core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json delete mode 100644 core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json delete mode 100644 core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json delete mode 100644 core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json delete mode 100644 core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json delete mode 100644 core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json delete mode 100644 core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json delete mode 100644 core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json delete mode 100644 core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json delete mode 100644 core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json delete mode 100644 core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json delete mode 100644 core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json delete mode 100644 core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json delete mode 100644 core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json delete mode 100644 core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json delete mode 100644 core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json delete mode 100644 core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json delete mode 100644 core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json delete mode 100644 core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json delete mode 100644 core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json delete mode 100644 core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json delete mode 100644 core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json delete mode 100644 core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json delete mode 100644 core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json delete mode 100644 core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json delete mode 100644 core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json delete mode 100644 core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json delete mode 100644 core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json delete mode 100644 core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json delete mode 100644 core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json delete mode 100644 core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json delete mode 100644 core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json delete mode 100644 core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json delete mode 100644 core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json delete mode 100644 core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json rename lana/app/.sqlx/{query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json => query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json} (62%) delete mode 100644 lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json delete mode 100644 lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json delete mode 100644 lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json delete mode 100644 lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json delete mode 100644 lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json delete mode 100644 lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json delete mode 100644 lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json delete mode 100644 lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json rename lana/dashboard/.sqlx/{query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json => query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json} (62%) delete mode 100644 lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json delete mode 100644 lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json delete mode 100644 lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json delete mode 100644 lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json delete mode 100644 lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json delete mode 100644 lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json diff --git a/core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json b/core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json deleted file mode 100644 index 391c79775..000000000 --- a/core/deposit/.sqlx/query-007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_journals WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "007a601f6a9d9cb77e0e98379e07284bdddedfb421958b14c60dca0f569def13" -} diff --git a/core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json b/core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json deleted file mode 100644 index 91a2cfce4..000000000 --- a/core/deposit/.sqlx/query-027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT m.account_set_id AS \"set_id!: AccountSetId\", m.member_account_id AS \"account_id!: AccountId\"\n FROM cala_account_set_member_accounts m\n JOIN cala_account_sets s\n ON m.account_set_id = s.id AND s.journal_id = $1\n WHERE m.member_account_id = ANY($2)\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "set_id!: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "account_id!: AccountId", - "type_info": "Uuid" - } - ], - "parameters": { - "Left": [ - "Uuid", - "UuidArray" - ] - }, - "nullable": [ - false, - false - ] - }, - "hash": "027974685a3d8accfb891acd094c055897a1f93023072f09fc6317bad9965240" -} diff --git a/core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json b/core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json deleted file mode 100644 index 384ed5fff..000000000 --- a/core/deposit/.sqlx/query-030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT values, latest_values\n FROM cala_velocity_account_controls v\n JOIN cala_accounts a\n ON v.account_id = a.id\n WHERE account_id = ANY($1)", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "values", - "type_info": "Jsonb" - }, - { - "ordinal": 1, - "name": "latest_values", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false - ] - }, - "hash": "030ce137853044242ffa49d9c61c7a650116df7dc5c650736a8f7e0d096db6e9" -} diff --git a/core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json b/core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json deleted file mode 100644 index 3c559d471..000000000 --- a/core/deposit/.sqlx/query-031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_control_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "031466649e761e92d8e682880b7803e13ab2c0c03c462bfecc72e2588ec7aa3d" -} diff --git a/core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json b/core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json deleted file mode 100644 index 287dfdd96..000000000 --- a/core/deposit/.sqlx/query-04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "04b7a8b3aeeeed28c884ab136993fe363319ad7f0e4984df668b4a4fb524ac41" -} diff --git a/core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json b/core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json deleted file mode 100644 index b7bc3c3b5..000000000 --- a/core/deposit/.sqlx/query-04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE data_source_id = $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "04ca969137e905e751f157dc0dcee46b8f0e59f973d3755fd15e5dba7f6e84ef" -} diff --git a/core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json b/core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json deleted file mode 100644 index 1331d8cdf..000000000 --- a/core/deposit/.sqlx/query-06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_journals WHERE id = $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "06e9f222a35d79deda5c0ad5a907cb2bcbfdb27cb21575398ed79d0e5c204105" -} diff --git a/core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json b/core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json deleted file mode 100644 index a2f5768a7..000000000 --- a/core/deposit/.sqlx/query-0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE id = $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "0bda4bb7b10c662d14e2a924ddc81d4a067e6090b58b2988b1db17f4008f251b" -} diff --git a/core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json b/core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json deleted file mode 100644 index d05c03db4..000000000 --- a/core/deposit/.sqlx/query-0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH limits AS (\n SELECT id, l.created_at AS entity_created_at\n FROM cala_velocity_limits l\n JOIN cala_velocity_control_limits ON id = velocity_limit_id\n WHERE velocity_control_id = $1\n )\n SELECT l.id as entity_id, e.sequence, e.event, e.recorded_at\n FROM limits l\n JOIN cala_velocity_limit_events e ON l.id = e.id\n ORDER BY l.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "0c3bbb19b3fc1c3b341b798779881d7b31d7da4f7aaead8d64a7e1a8840b8133" -} diff --git a/core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json b/core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json deleted file mode 100644 index b08c966b6..000000000 --- a/core/deposit/.sqlx/query-0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM cala_velocity_controls i JOIN cala_velocity_control_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "0d327ebdfedc973b4a2fd598a9f8d81dd413bcf8c499b9f9ead5455096975e66" -} diff --git a/core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json b/core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json deleted file mode 100644 index de943f998..000000000 --- a/core/deposit/.sqlx/query-12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_journals WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "12f665724e9317d09dca96a68aa14d6d872f3b5753d86531158e9ba854d0fe98" -} diff --git a/core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json b/core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json deleted file mode 100644 index 8d4e43493..000000000 --- a/core/deposit/.sqlx/query-135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_control_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "135ee74ff7b5e89f6b63aa974cba2c514f6ed7bd0e0db0f2e7e82d2c7f733a22" -} diff --git a/core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json b/core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json deleted file mode 100644 index d01044d32..000000000 --- a/core/deposit/.sqlx/query-1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_transactions (id, external_id, correlation_id, journal_id, tx_template_id, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5, $6, $7)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Varchar", - "Uuid", - "Uuid", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "1392db19fcfc49cd0abe646009be1df2adda9f76e60cfc1d9a046cbda7d9b482" -} diff --git a/core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json b/core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json deleted file mode 100644 index dd09f67c2..000000000 --- a/core/deposit/.sqlx/query-142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n non_transitive_insert AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id)\n VALUES ($1, $2)\n ),\n transitive_insert AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id, transitive)\n SELECT p.account_set_id, $2, TRUE\n FROM parents p\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "account_set_id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid" - ] - }, - "nullable": [ - null, - null - ] - }, - "hash": "142f41e72aed810515c083aae2566a01b944a298a27d8b706d5d03633a769fa8" -} diff --git a/core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json b/core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json deleted file mode 100644 index 47d9a7db2..000000000 --- a/core/deposit/.sqlx/query-157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT h.values, a.normal_balance_type AS \"normal_balance_type!: DebitOrCredit\"\n FROM cala_balance_history h\n JOIN cala_current_balances c\n ON h.journal_id = c.journal_id\n AND h.account_id = c.account_id\n AND h.currency = c.currency\n AND h.version = c.latest_version\n JOIN cala_accounts a\n ON c.account_id = a.id\n WHERE c.journal_id = $1\n AND c.account_id = $2\n AND c.currency = $3\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "values", - "type_info": "Jsonb" - }, - { - "ordinal": 1, - "name": "normal_balance_type!: DebitOrCredit", - "type_info": { - "Custom": { - "name": "debitorcredit", - "kind": { - "Enum": [ - "debit", - "credit" - ] - } - } - } - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false - ] - }, - "hash": "157b3c169b10f77ff24ca11ce7f55985652f3d4611c113b63a479dcc71ed4d06" -} diff --git a/core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json b/core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json deleted file mode 100644 index 21015f230..000000000 --- a/core/deposit/.sqlx/query-197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE data_source_id = $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "197c0c7f6a29ec59c20a33fdc439078bde0a7239c6eb1f725c85ac1dfb730881" -} diff --git a/core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/core/deposit/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json b/core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json deleted file mode 100644 index aa58500c6..000000000 --- a/core/deposit/.sqlx/query-1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE code = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "1e4169b7da5e68ed377f63680e02d9e89bc89199926d3adf361418ad501a45ed" -} diff --git a/core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json b/core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json deleted file mode 100644 index ff6402524..000000000 --- a/core/deposit/.sqlx/query-1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n member_accounts_deletion AS (\n DELETE FROM cala_account_set_member_accounts\n WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n AND member_account_id IN (SELECT member_account_id FROM cala_account_set_member_accounts\n WHERE account_set_id = $2)\n ),\n member_account_set_deletion AS (\n DELETE FROM cala_account_set_member_account_sets\n WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n AND member_account_set_id = $2\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "account_set_id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid" - ] - }, - "nullable": [ - null, - null - ] - }, - "hash": "1f18e7dc3507f6f585dccece3aabc89a052c4ee615d24efd601a0a337d631587" -} diff --git a/core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/core/deposit/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json b/core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json deleted file mode 100644 index 2c00d24d9..000000000 --- a/core/deposit/.sqlx/query-22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "22ab5cd0a448f2971ee8e8b680f0c80d6a3463468c838795bdacf25d7e34c550" -} diff --git a/core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json b/core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json deleted file mode 100644 index 825bf5218..000000000 --- a/core/deposit/.sqlx/query-23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_controls WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "23192e145bbc7a7a8e4c426996318b7eb04b6b3662c819d9156ca8470b6c33fa" -} diff --git a/core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/core/deposit/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json b/core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json deleted file mode 100644 index f8bda17d4..000000000 --- a/core/deposit/.sqlx/query-251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_tx_template_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "251f1465f66ca8bdfcf7de5418c6f5432ce8b1b9b8087a6c662ab63f635f231e" -} diff --git a/core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json b/core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json deleted file mode 100644 index 5b094554f..000000000 --- a/core/deposit/.sqlx/query-263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "263fdccba1b3204249e71a8d348db13dcc9c4e37a9819451920447983426325c" -} diff --git a/core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/core/deposit/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json b/core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json deleted file mode 100644 index 2d9aebd2a..000000000 --- a/core/deposit/.sqlx/query-28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH member_account_sets AS (\n SELECT a.id, a.name, a.created_at\n FROM cala_account_set_member_accounts asm\n JOIN cala_account_sets a ON asm.account_set_id = a.id\n WHERE asm.member_account_id = $1 AND transitive IS FALSE\n AND ((a.name, a.id) > ($3, $2) OR ($3 IS NULL AND $2 IS NULL))\n ORDER BY a.name, a.id\n LIMIT $4\n )\n SELECT mas.id AS \"entity_id!: AccountSetId\", e.sequence, e.event, e.recorded_at\n FROM member_account_sets mas\n JOIN cala_account_set_events e ON mas.id = e.id\n ORDER BY mas.name, mas.id, e.sequence\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id!: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid", - "Text", - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "28b8e3778c17b3f7d0cddda31d04c489041858391f80c32e4ec225130ad4ea38" -} diff --git a/core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json b/core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json deleted file mode 100644 index dce621518..000000000 --- a/core/deposit/.sqlx/query-29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT code, id FROM cala_accounts WHERE (COALESCE((code, id) > ($3, $2), $2 IS NULL)) ORDER BY code ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.code asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "29225b902a8924d5b14baa0329d94c70e8d83b2c286505f993c6d050992a963a" -} diff --git a/core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json b/core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json deleted file mode 100644 index 715fe3db9..000000000 --- a/core/deposit/.sqlx/query-2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "2abf0570fe5c3c6b1e2af195230987f9b3227076c7912c07ae5302de8e8983b7" -} diff --git a/core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json b/core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json deleted file mode 100644 index 0c6e48656..000000000 --- a/core/deposit/.sqlx/query-2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_journals WHERE data_source_id = $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "2b370058c0ebe9851feb5488ec404115c0184b6d5efb90e465281248a97035b7" -} diff --git a/core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json b/core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json deleted file mode 100644 index 53b0b19f7..000000000 --- a/core/deposit/.sqlx/query-2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT COALESCE(MAX(sequence), 0) AS \"max!\" FROM cala_outbox_events", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "max!", - "type_info": "Int8" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "2f03e709d0ae22f223c62907dfa09942d115792af4d92ebc6835a4b4dcd1b140" -} diff --git a/core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json b/core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json deleted file mode 100644 index 8340b5c1b..000000000 --- a/core/deposit/.sqlx/query-2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_journals WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "2f43be93a9c6d674e12e5b83edb95d6f5d432bc67a13f7da06f9ca3bda0fc2e9" -} diff --git a/core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/core/deposit/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json b/core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json deleted file mode 100644 index 1a7e7ccb9..000000000 --- a/core/deposit/.sqlx/query-32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE journal_id = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "32e423a12f03ac17feafd99af7a9d417d4377b8d48bdf0033a059ddc9d0d845e" -} diff --git a/core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json b/core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json deleted file mode 100644 index 6bf6db947..000000000 --- a/core/deposit/.sqlx/query-333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE id = $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "333d3e41c73ef64708d25ca8e79a9c6d3c24119d5159baf2de193f783aabc1cc" -} diff --git a/core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json b/core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json deleted file mode 100644 index 1b9adae0d..000000000 --- a/core/deposit/.sqlx/query-3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE data_source_id = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3391d7308cd8a77f031240c198f342ea95649179cce6431f20bd4436c22ec7b1" -} diff --git a/core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json b/core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json deleted file mode 100644 index 6f16ea2f8..000000000 --- a/core/deposit/.sqlx/query-34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE tx_template_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "34122d3d9367712c0f93800220caf293dcc9d7e02f4738c7c2c22ea2a3bb803e" -} diff --git a/core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json b/core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json deleted file mode 100644 index de49ee09a..000000000 --- a/core/deposit/.sqlx/query-35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n set_insert AS (\n INSERT INTO cala_account_set_member_account_sets (account_set_id, member_account_set_id)\n VALUES ($1, $2)\n ),\n new_members AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id, transitive)\n SELECT $1, m.member_account_id, TRUE\n FROM cala_account_set_member_accounts m\n WHERE m.account_set_id = $2\n RETURNING member_account_id\n ),\n transitive_inserts AS (\n INSERT INTO cala_account_set_member_accounts (account_set_id, member_account_id, transitive)\n SELECT p.account_set_id, n.member_account_id, TRUE\n FROM parents p\n CROSS JOIN new_members n\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "account_set_id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid" - ] - }, - "nullable": [ - null, - null - ] - }, - "hash": "35838a1dadec39b3ff3d8cf9a69453db63a834a9fea6ec03dc9b40b1ffab5245" -} diff --git a/core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json b/core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json deleted file mode 100644 index eec82e391..000000000 --- a/core/deposit/.sqlx/query-36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_account_controls (account_id, velocity_control_id, values)\n VALUES ($1, $2, $3)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Uuid", - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "36238751a6cdb77ba46bd352347505c861fe052578a1cc33fbb2c851eb1a1201" -} diff --git a/core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json b/core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json deleted file mode 100644 index 9f3f85e68..000000000 --- a/core/deposit/.sqlx/query-362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE cala_accounts SET name = $2, code = $3, external_id = $4, normal_balance_type = $5, latest_values = $6 WHERE id = $1", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Varchar", - "Varchar", - { - "Custom": { - "name": "debitorcredit", - "kind": { - "Enum": [ - "debit", - "credit" - ] - } - } - }, - "Jsonb" - ] - }, - "nullable": [] - }, - "hash": "362a85a1429b9c1b7d68261a88d8e249171ab7be68956199e39c2f97627c7960" -} diff --git a/core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json b/core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json deleted file mode 100644 index bc7274dba..000000000 --- a/core/deposit/.sqlx/query-3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3731dd5037d24f10824b11961a0021daba8d6c57a904f53fb2387f17c35ddb5f" -} diff --git a/core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json b/core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json deleted file mode 100644 index c616585b7..000000000 --- a/core/deposit/.sqlx/query-37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE data_source_id = $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "37592bfb1c29bde05289e8bac77aaa151f02ed1cfdb70cd96e48c6d8b5d2ce78" -} diff --git a/core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json b/core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json deleted file mode 100644 index c278843bb..000000000 --- a/core/deposit/.sqlx/query-3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_limits WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3a7822d9b1c355b11ee0dffd58fef197b999461df83ad615b5a9720a552a01d4" -} diff --git a/core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json b/core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json deleted file mode 100644 index 5bb13e1cd..000000000 --- a/core/deposit/.sqlx/query-3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE name = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3e521b66ec69bf3fc1c641d6dceb36cfde97707985a667a26734ddaac783bf40" -} diff --git a/core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json b/core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json deleted file mode 100644 index 3ac8c2c83..000000000 --- a/core/deposit/.sqlx/query-3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_transactions WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3e9e91edb6e7608d37a764eac4824dc37921d5cecf6f4f36441ff106cbabf2f9" -} diff --git a/core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json b/core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json deleted file mode 100644 index 771f2efea..000000000 --- a/core/deposit/.sqlx/query-3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_accounts WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3f6bc04f79eaa6a6a7791d7de4e4505cd08522806f69fb72e5983e6aeada2819" -} diff --git a/core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json b/core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json deleted file mode 100644 index f716a1d1d..000000000 --- a/core/deposit/.sqlx/query-3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: EntryId\", e.sequence, e.event, e.recorded_at FROM cala_entries i JOIN cala_entry_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "3f836d81aa46305c562d2eea58340c9177fa54a3a9e310c0c6871ff6d930dd1e" -} diff --git a/core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json b/core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json deleted file mode 100644 index b77dec00e..000000000 --- a/core/deposit/.sqlx/query-4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE data_source_id = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "4015a95fc97bca7ca4477a8f4bf1e78cea75c4b31b08815f29ce116f35b2bd5d" -} diff --git a/core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json b/core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json deleted file mode 100644 index 86a12f670..000000000 --- a/core/deposit/.sqlx/query-40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_account_set_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "40a7eee2286e68fc5d380f71720b9c7379e3359b0ebd2042262f4b59a5d7f942" -} diff --git a/core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/core/deposit/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json b/core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json deleted file mode 100644 index 5a1c58cab..000000000 --- a/core/deposit/.sqlx/query-443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE id = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "443fb2b7248bf11d830d36c7f4a209d8763a8cf017da1bb441011e272f7040c4" -} diff --git a/core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json b/core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json deleted file mode 100644 index eff106f66..000000000 --- a/core/deposit/.sqlx/query-48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_account_set_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "48e0baa2fecb1d49399e62ce42cd763833cf9bbffdd372a446f8e854ce4bdf75" -} diff --git a/core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json b/core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json deleted file mode 100644 index f6661c46b..000000000 --- a/core/deposit/.sqlx/query-4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH max_sequence AS (\n SELECT COALESCE(MAX(sequence), 0) AS max FROM cala_outbox_events\n )\n SELECT\n g.seq AS \"sequence!: EventSequence\",\n e.id AS \"id?\",\n e.payload AS \"payload?\",\n e.recorded_at AS \"recorded_at?\"\n FROM\n generate_series(LEAST($1 + 1, (SELECT max FROM max_sequence)),\n LEAST($1 + $2, (SELECT max FROM max_sequence)))\n AS g(seq)\n LEFT JOIN\n cala_outbox_events e ON g.seq = e.sequence\n WHERE\n g.seq > $1\n ORDER BY\n g.seq ASC\n LIMIT $2", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "sequence!: EventSequence", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "id?", - "type_info": "Uuid" - }, - { - "ordinal": 2, - "name": "payload?", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at?", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int4", - "Int4" - ] - }, - "nullable": [ - null, - false, - true, - false - ] - }, - "hash": "4a2c66932678814aa7420c360acbb3de32b627d2421414dc139e4bda879fa839" -} diff --git a/core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/core/deposit/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json b/core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json deleted file mode 100644 index 7c0195034..000000000 --- a/core/deposit/.sqlx/query-4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT code, id FROM cala_accounts WHERE (COALESCE((code, id) < ($3, $2), $2 IS NULL)) ORDER BY code DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.code desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "4d039ea3618c888ff22e928e0e5545be4621076c93c1819fe4f9fbd109bfae11" -} diff --git a/core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json b/core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json deleted file mode 100644 index 9096fac05..000000000 --- a/core/deposit/.sqlx/query-4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE id = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "4d883ef488458b3844a255ab24c3f161551ad2dfc79b54ac0ad6b61ad3b48400" -} diff --git a/core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/core/deposit/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json b/core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json deleted file mode 100644 index 26f667e15..000000000 --- a/core/deposit/.sqlx/query-52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_tx_template_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "52239f92825e2fb77644574fe148695d1456fa5af698639b34dd2f5ca3c73a66" -} diff --git a/core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json b/core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json deleted file mode 100644 index 28dc1274c..000000000 --- a/core/deposit/.sqlx/query-52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH member_accounts AS (\n SELECT\n member_account_id AS member_id,\n member_account_id,\n NULL::uuid AS member_account_set_id,\n created_at\n FROM cala_account_set_member_accounts\n WHERE\n transitive IS FALSE\n AND account_set_id = $1\n AND (created_at < $2 OR $2 IS NULL)\n ORDER BY created_at DESC\n LIMIT $3\n ), member_sets AS (\n SELECT\n member_account_set_id AS member_id,\n NULL::uuid AS member_account_id,\n member_account_set_id,\n created_at\n FROM cala_account_set_member_account_sets\n WHERE\n account_set_id = $1\n AND (created_at < $2 OR $2 IS NULL)\n ORDER BY created_at DESC\n LIMIT $3\n ), all_members AS (\n SELECT * FROM member_accounts\n UNION ALL\n SELECT * FROM member_sets\n )\n SELECT * FROM all_members\n ORDER BY created_at DESC\n LIMIT $3\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "member_id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "member_account_id", - "type_info": "Uuid" - }, - { - "ordinal": 2, - "name": "member_account_set_id", - "type_info": "Uuid" - }, - { - "ordinal": 3, - "name": "created_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8" - ] - }, - "nullable": [ - null, - null, - null, - null - ] - }, - "hash": "52884ebc5f4d5fd2259e02e1110560e940a06ed4311bc9a371d5c5df448f75bf" -} diff --git a/core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json b/core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json deleted file mode 100644 index 5cd7c13c1..000000000 --- a/core/deposit/.sqlx/query-53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT name, id FROM cala_account_sets WHERE (COALESCE((name, id) > ($3, $2), $2 IS NULL)) ORDER BY name ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.name asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "53b20c4d2300345d45bd22b17f6557a5d34b451eec43fbc2e72a0c2bba76cdf5" -} diff --git a/core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json b/core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json deleted file mode 100644 index 9cedf9499..000000000 --- a/core/deposit/.sqlx/query-5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: TransactionId\", e.sequence, e.event, e.recorded_at FROM cala_transactions i JOIN cala_transaction_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "5450eca75064add5d1656299f7c2fb599f0aa3aac3b963c50de3476e88140e4b" -} diff --git a/core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json b/core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json deleted file mode 100644 index cd6480451..000000000 --- a/core/deposit/.sqlx/query-58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_account_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "58cbff4aaa7278776c1314edc85fe9701c8399ef465712207af13ff313e0d798" -} diff --git a/core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json b/core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json deleted file mode 100644 index 17d7b2637..000000000 --- a/core/deposit/.sqlx/query-5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT external_id, id FROM cala_accounts WHERE ((external_id IS NOT DISTINCT FROM $3) AND COALESCE(id < $2, true) OR COALESCE(external_id < $3, external_id IS NOT NULL)) ORDER BY external_id DESC NULLS LAST, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.external_id desc nulls last, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "5b93458e65fbc816353530e7b0165622acc350311f428392cbe9e41071c6a939" -} diff --git a/core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json b/core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json deleted file mode 100644 index b3485a859..000000000 --- a/core/deposit/.sqlx/query-5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE normal_balance_type = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - { - "Custom": { - "name": "debitorcredit", - "kind": { - "Enum": [ - "debit", - "credit" - ] - } - } - } - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "5d4afcded9484595ef163f3f86a677d009b8358ad66e72d4f9ff1b161a652000" -} diff --git a/core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json b/core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json deleted file mode 100644 index edf69b146..000000000 --- a/core/deposit/.sqlx/query-5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_control_limits (velocity_control_id, velocity_limit_id)\n VALUES ($1, $2)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Uuid" - ] - }, - "nullable": [] - }, - "hash": "5d662960f2bfc723c5c3a027c5d0c90508d96a54b93a795f7a6e7543c72a9377" -} diff --git a/core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json b/core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json deleted file mode 100644 index cca808257..000000000 --- a/core/deposit/.sqlx/query-5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_controls (id, name, data_source_id, created_at) VALUES ($1, $2, $3, $4)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "5ebc454e7dbc00d45859cb24f5ab9b87cf3ee271fcf85e55d5140b5be5f8ed50" -} diff --git a/core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json b/core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json deleted file mode 100644 index f6d7917ec..000000000 --- a/core/deposit/.sqlx/query-5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "5ebd33b02ba2ac389a2558f8bf438c23990ace1716520b2de81ec58a4d8660ab" -} diff --git a/core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json b/core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json deleted file mode 100644 index 51fbd1640..000000000 --- a/core/deposit/.sqlx/query-63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_limit_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "63c9a1919373ca5d700f2921ea8201c27c240e12b86cfbb67142454c22ee18bc" -} diff --git a/core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json b/core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json deleted file mode 100644 index fd86eb9e3..000000000 --- a/core/deposit/.sqlx/query-64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE journal_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "64276b23f90c0071b6a3934214a3528db6fdc940b592734ca8dbf7276c936dc0" -} diff --git a/core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json b/core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json deleted file mode 100644 index f95dc0ed0..000000000 --- a/core/deposit/.sqlx/query-66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_limits (id, name, data_source_id, created_at) VALUES ($1, $2, $3, $4)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "66e6452ff6458d51d65baebc98d43cc28f976db4fecd622b693bb70dfc5900ec" -} diff --git a/core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json b/core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json deleted file mode 100644 index 53547db0d..000000000 --- a/core/deposit/.sqlx/query-66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM cala_account_sets i JOIN cala_account_set_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "66eb2a4ba90e69c369b04fdccbb02497e84348ce53b37753b222bd94e19b72f7" -} diff --git a/core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/core/deposit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json b/core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json deleted file mode 100644 index bb6e98b92..000000000 --- a/core/deposit/.sqlx/query-6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_account_sets WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "6bfe053edb94d679904602c97c754c2ba5b4bbe5302423e42881f3aa551c79f1" -} diff --git a/core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json b/core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json deleted file mode 100644 index f2ec311af..000000000 --- a/core/deposit/.sqlx/query-70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_account_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "70bbb082472d1679b8945fdfd7817cd027ae0327a4dd73a4fd2dec006421e5ad" -} diff --git a/core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json b/core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json deleted file mode 100644 index b8d23b0b9..000000000 --- a/core/deposit/.sqlx/query-79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "79969a08606fa96e8c230a1191dbced2cb50886bab09c62ee7f059b09e709b77" -} diff --git a/core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json b/core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json deleted file mode 100644 index 9b6e0a705..000000000 --- a/core/deposit/.sqlx/query-79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT event\n FROM cala_tx_template_events\n WHERE id = $1 AND sequence = $2", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "event", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Int4" - ] - }, - "nullable": [ - false - ] - }, - "hash": "79dd2b6e80276d9a6d9328ddcbf45548e54b94b3c72e26aea4ab321734f8ea66" -} diff --git a/core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json b/core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json deleted file mode 100644 index ee59fcf53..000000000 --- a/core/deposit/.sqlx/query-7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_accounts (id, name, code, external_id, normal_balance_type, eventually_consistent, latest_values, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Varchar", - "Varchar", - { - "Custom": { - "name": "debitorcredit", - "kind": { - "Enum": [ - "debit", - "credit" - ] - } - } - }, - "Bool", - "Jsonb", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "7a515f3defcb2f4a7411179cbe9892318fc02212d2b72257665b1fbd6a211343" -} diff --git a/core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json b/core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json deleted file mode 100644 index 63ea80597..000000000 --- a/core/deposit/.sqlx/query-7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_limits WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "7af1d3e5930d1bfb35197f9041025f4f0c25add11e21ac141ba74d66d40f97e4" -} diff --git a/core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json b/core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json deleted file mode 100644 index 3bb487807..000000000 --- a/core/deposit/.sqlx/query-7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE external_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "7e8cb1f6f72d6e07a793eebc3c54083b6626b5bc80d9bef48e9a654183fa7eee" -} diff --git a/core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json b/core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json deleted file mode 100644 index 8485669c0..000000000 --- a/core/deposit/.sqlx/query-80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "80ac450d62575381f692c1476b7bcb949899d97660cf2d5ec2746758b2460300" -} diff --git a/core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json b/core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json deleted file mode 100644 index aa916bd78..000000000 --- a/core/deposit/.sqlx/query-83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE correlation_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "83902f4777684df6016cc3e06beafc2f8698d54286b81ee552c54024b4aacba4" -} diff --git a/core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json b/core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json deleted file mode 100644 index dac7ab34d..000000000 --- a/core/deposit/.sqlx/query-87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_journal_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "87709c792b886edf2374373aa0d563f8e80470035de31448f15278b48a3d6fad" -} diff --git a/core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json b/core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json deleted file mode 100644 index f96062fbc..000000000 --- a/core/deposit/.sqlx/query-87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_tx_templates WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "87a61093c8f800d9ab596c6e39b5eaad28a6b1c99608ba6266d5aecb2e88924a" -} diff --git a/core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json b/core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json deleted file mode 100644 index 92e6477ce..000000000 --- a/core/deposit/.sqlx/query-880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH RECURSIVE parents AS (\n SELECT m.member_account_set_id, m.account_set_id\n FROM cala_account_set_member_account_sets m\n JOIN cala_account_sets s\n ON s.id = m.account_set_id\n WHERE m.member_account_set_id = $1\n\n UNION ALL\n SELECT p.member_account_set_id, m.account_set_id\n FROM parents p\n JOIN cala_account_set_member_account_sets m\n ON p.account_set_id = m.member_account_set_id\n ),\n deletions as (\n DELETE FROM cala_account_set_member_accounts\n WHERE account_set_id IN (SELECT account_set_id FROM parents UNION SELECT $1)\n AND member_account_id = $2\n )\n SELECT account_set_id, NULL AS now\n FROM parents\n UNION ALL\n SELECT NULL AS account_set_id, NOW() AS now\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "account_set_id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid" - ] - }, - "nullable": [ - null, - null - ] - }, - "hash": "880622c69f899dc6b83dc4c24761f8bd1c696138e116201513b54599727b5c74" -} diff --git a/core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json b/core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json deleted file mode 100644 index a1758be62..000000000 --- a/core/deposit/.sqlx/query-8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE cala_journals SET name = $2 WHERE id = $1", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "8a293b00b94fb4ac994aed8075efa5b6970a56e381e5733a67f4476916319cff" -} diff --git a/core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json b/core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json deleted file mode 100644 index c55e45c71..000000000 --- a/core/deposit/.sqlx/query-8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_account_sets WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "8de456b1eae40e9434af753807e48c5d9ff5640e57bfbdb898b2eda0df48519b" -} diff --git a/core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json b/core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json deleted file mode 100644 index 35faa449f..000000000 --- a/core/deposit/.sqlx/query-9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH member_account_sets AS (\n SELECT a.id, a.name, a.created_at\n FROM cala_account_set_member_account_sets asm\n JOIN cala_account_sets a ON asm.account_set_id = a.id\n WHERE asm.member_account_set_id = $1\n AND ((a.name, a.id) > ($3, $2) OR ($3 IS NULL AND $2 IS NULL))\n ORDER BY a.name, a.id\n LIMIT $4\n )\n SELECT mas.id AS \"entity_id!: AccountSetId\", e.sequence, e.event, e.recorded_at\n FROM member_account_sets mas\n JOIN cala_account_set_events e ON mas.id = e.id\n ORDER BY mas.name, mas.id, e.sequence\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id!: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid", - "Text", - "Int8" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "9045e5c6b639e1accb4095ca648f89d23e5a32ecf79d3ba24e6f545bee1931be" -} diff --git a/core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json b/core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json deleted file mode 100644 index 34fc6613f..000000000 --- a/core/deposit/.sqlx/query-914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE transaction_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "914b80a281196fc4a412b3f77c2efd04f99f5caac2cbcb30822a660dcba106c2" -} diff --git a/core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json b/core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json deleted file mode 100644 index 35c4724f0..000000000 --- a/core/deposit/.sqlx/query-95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT external_id, id FROM cala_accounts WHERE ((external_id IS NOT DISTINCT FROM $3) AND COALESCE(id > $2, true) OR COALESCE(external_id > $3, external_id IS NOT NULL)) ORDER BY external_id ASC NULLS FIRST, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.external_id asc nulls first, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "95b7a4cf1ec8ba58726b90e4fa770649c6e70c6290ff1b0c0a5c8ea9f6e6128d" -} diff --git a/core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json b/core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json deleted file mode 100644 index a3b71e8be..000000000 --- a/core/deposit/.sqlx/query-9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: JournalId\", e.sequence, e.event, e.recorded_at FROM cala_journals i JOIN cala_journal_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "9be6ec29ff68101eec0427f6afab51556244512f9f3a858317186423e5174e8f" -} diff --git a/core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json b/core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json deleted file mode 100644 index 337cc6072..000000000 --- a/core/deposit/.sqlx/query-9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_tx_templates (id, code, data_source_id, created_at) VALUES ($1, $2, $3, $4)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "9e8cbf7b0defdbebfe3b60fd61834734050a0cde90ffca641c7b219e29818336" -} diff --git a/core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json b/core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json deleted file mode 100644 index 6db8cfd3c..000000000 --- a/core/deposit/.sqlx/query-a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT name, id FROM cala_accounts WHERE (COALESCE((name, id) < ($3, $2), $2 IS NULL)) ORDER BY name DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.name desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "a020d643a6d385c5a4292c8715a61743e95e9d9a6ac18fd3e4fa1b2966604dce" -} diff --git a/core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json b/core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json deleted file mode 100644 index 909e6ad42..000000000 --- a/core/deposit/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT pg_advisory_xact_lock($1)", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "pg_advisory_xact_lock", - "type_info": "Void" - } - ], - "parameters": { - "Left": [ - "Int8" - ] - }, - "nullable": [ - null - ] - }, - "hash": "a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247" -} diff --git a/core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json b/core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json deleted file mode 100644 index 9f8deaa1f..000000000 --- a/core/deposit/.sqlx/query-a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT name, id FROM cala_account_sets WHERE (COALESCE((name, id) < ($3, $2), $2 IS NULL)) ORDER BY name DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.name desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "a380c353e2a0388b927a4a5a73e1172e87f7ee5ded42f2101a404d487e4e86ea" -} diff --git a/core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json b/core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json deleted file mode 100644 index 53e679b32..000000000 --- a/core/deposit/.sqlx/query-a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_velocity_controls WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "a5cc5fc5ba91438832b23683ef8455bae810c560710a00da05a8072cbc4a4444" -} diff --git a/core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json b/core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json deleted file mode 100644 index e4bdd275a..000000000 --- a/core/deposit/.sqlx/query-a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_transaction_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "a8db82d775822389f02959fe3a60998c9da3e94af3323d749b7a6fe9fcfb7cf7" -} diff --git a/core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json b/core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json deleted file mode 100644 index d5b97f9e8..000000000 --- a/core/deposit/.sqlx/query-aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: AccountId\", e.sequence, e.event, e.recorded_at FROM cala_accounts i JOIN cala_account_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "aa4e05726495b3f1c11668661b17c29302c486144d4bc9793e55ecd7de75a2ea" -} diff --git a/core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json b/core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json deleted file mode 100644 index 46a926989..000000000 --- a/core/deposit/.sqlx/query-aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE account_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "aad0ac88d4644e3f89898a1b85ff444f41b33400d31d71de019636f9fc2585a5" -} diff --git a/core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json b/core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json deleted file mode 100644 index 14877febd..000000000 --- a/core/deposit/.sqlx/query-ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_entries WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "ac2c8d138d9728f66d18a20a58771d0971c7492f59cbfe94ce28a4d7d18e769e" -} diff --git a/core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json b/core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json deleted file mode 100644 index afdfbddac..000000000 --- a/core/deposit/.sqlx/query-b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE eventually_consistent = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Bool" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "b1211142fe8c890bc505417a0f78569d51e2f96631002065e8dd8fcd05e9f5da" -} diff --git a/core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json b/core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json deleted file mode 100644 index 190e66d88..000000000 --- a/core/deposit/.sqlx/query-b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_journals WHERE name = $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "b25bd8cb2f8acb04d17ade6b1f163f99416d5c3b13fa291b3f7dc01932245529" -} diff --git a/core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json b/core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json deleted file mode 100644 index d084530cc..000000000 --- a/core/deposit/.sqlx/query-b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "b41a1c97c1f1087936ff39b1a5fd7e90c5ce385892fb73b24edb16725456270d" -} diff --git a/core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json b/core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json deleted file mode 100644 index c899777bc..000000000 --- a/core/deposit/.sqlx/query-b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "b5a81d27f254a807dafbd7809b0bc339a06fc7ef23b23ca08209ff3c0984ff73" -} diff --git a/core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json b/core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json deleted file mode 100644 index 1c253372a..000000000 --- a/core/deposit/.sqlx/query-b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_transactions WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "b5d40e76f3d34b60c9992633e4ffa1691c2ca2939cb5f3556a682f6d4db2badb" -} diff --git a/core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json b/core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json deleted file mode 100644 index fc798ebdd..000000000 --- a/core/deposit/.sqlx/query-b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_entries (id, journal_id, account_id, transaction_id, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5, $6)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Uuid", - "Uuid", - "Uuid", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "b910618278fc0299af005bd3ffb7d7f9bfbf6903f54b08e821e35c9b988e7fe8" -} diff --git a/core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json b/core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json deleted file mode 100644 index 1922c734b..000000000 --- a/core/deposit/.sqlx/query-b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE name = $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "b97e75c567f4553f342556165e7bf8b9d382e091a4d4bbd46bfffaccf0b47229" -} diff --git a/core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json b/core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json deleted file mode 100644 index 5b84d9669..000000000 --- a/core/deposit/.sqlx/query-bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH locked_accounts AS (\n SELECT 1\n FROM cala_accounts a\n WHERE data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.id = $1\n FOR UPDATE\n ), locked_balances AS (\n SELECT journal_id, account_id, currency, latest_version\n FROM cala_current_balances\n WHERE journal_id = $2\n AND account_id = $1\n FOR UPDATE\n )\n SELECT h.values\n FROM cala_balance_history h\n JOIN locked_balances b\n ON b.journal_id = h.journal_id\n AND b.account_id = h.account_id\n AND b.currency = h.currency\n AND b.latest_version = h.version\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "values", - "type_info": "Jsonb" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid" - ] - }, - "nullable": [ - false - ] - }, - "hash": "bd8e1908a288e0ba0bb6af71fa50d42a80fdede540dbbcbb0bd220a26234b4ea" -} diff --git a/core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json b/core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json deleted file mode 100644 index 3cd6df4d1..000000000 --- a/core/deposit/.sqlx/query-be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "be2ee189a825e4a2ce62f8cc528d8f29a27d72ec452e16e144f13c8b39828082" -} diff --git a/core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json b/core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json deleted file mode 100644 index 22ad039cc..000000000 --- a/core/deposit/.sqlx/query-bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT t.id AS \"id?: TxTemplateId\", MAX(e.sequence) AS \"version\" \n FROM cala_tx_templates t\n JOIN cala_tx_template_events e ON t.id = e.id\n WHERE t.code = $1\n GROUP BY t.id", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id?: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "version", - "type_info": "Int4" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - null - ] - }, - "hash": "bf0ee7f3fd1db85944c916fc155dddccee12c4023ab3cd7319285f43a90d7aaf" -} diff --git a/core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json b/core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json deleted file mode 100644 index c1ba12037..000000000 --- a/core/deposit/.sqlx/query-bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM cala_tx_templates i JOIN cala_tx_template_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "bf5cbcd07e48210524388a951f05b5ca8ed690bb7b24ca20747296cb0e1a8fa4" -} diff --git a/core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json b/core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json deleted file mode 100644 index 9f79adf65..000000000 --- a/core/deposit/.sqlx/query-c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_controls WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: VelocityControlId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_control_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityControlId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "c1e16b22fc0352a4f1cd5ad180aca9fde3349bbdd32a78c8f69930712782b392" -} diff --git a/core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json b/core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json deleted file mode 100644 index 5f024224e..000000000 --- a/core/deposit/.sqlx/query-c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_account_sets (id, name, journal_id, data_source_id, created_at) VALUES ($1, $2, $3, $4, $5)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Uuid", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "c58c2d515af167d0bca51562383b60e33ff0b1afb748855b22cde64c19c112c3" -} diff --git a/core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json b/core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json deleted file mode 100644 index b9e193eb1..000000000 --- a/core/deposit/.sqlx/query-c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE data_source_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "c8efe8132e8f2197300f69547e8cb385ca0b8e01ce5132e5aa6f83ab4c497481" -} diff --git a/core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json b/core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json deleted file mode 100644 index 78012ab30..000000000 --- a/core/deposit/.sqlx/query-ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE name = $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "ccd9eba7c72866504396053ba4a00b4a97ce6d42768e64c2438f1c2d42d42d1e" -} diff --git a/core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json b/core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json deleted file mode 100644 index 7335a1eb1..000000000 --- a/core/deposit/.sqlx/query-ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE (COALESCE(id < $2, true)) ORDER BY id DESC LIMIT $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "ced290936645505236ce717c81ac5a6d813ad66008c21c0a10ead263fff70f13" -} diff --git a/core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json b/core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json deleted file mode 100644 index 9a9e23967..000000000 --- a/core/deposit/.sqlx/query-cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT i.id AS \"id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM cala_velocity_limits i JOIN cala_velocity_limit_events e ON i.id = e.id WHERE i.id = ANY($1) ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "UuidArray" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "cf9616e074abd08990fb1c9314ad57c54950e7ea7b81e652afb4227db389f2fe" -} diff --git a/core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json b/core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json deleted file mode 100644 index fb1f645e7..000000000 --- a/core/deposit/.sqlx/query-d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_journals WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: JournalId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_journal_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: JournalId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "d3d061cb7eb1f0c5009097765180619e8c6793419322a882cea05f8a12e3c7cb" -} diff --git a/core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json b/core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json deleted file mode 100644 index eb477d288..000000000 --- a/core/deposit/.sqlx/query-d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE name = $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "d44cef2aef676bed03cea638b4a075dd414d859b95961cd797d32565625234f1" -} diff --git a/core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json b/core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json deleted file mode 100644 index 8d77d295f..000000000 --- a/core/deposit/.sqlx/query-d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_entry_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "d88eeb1e3e61f74fca98c4f9638dd96a3dd7109770069959279b129a81229903" -} diff --git a/core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json b/core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json deleted file mode 100644 index 64ca0b218..000000000 --- a/core/deposit/.sqlx/query-dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_entry_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "dcb0457a64e8fd4f7a521d4fdbb88c55338536d6542829d1520af1a07bbd2d94" -} diff --git a/core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json b/core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json deleted file mode 100644 index 613ad1fe8..000000000 --- a/core/deposit/.sqlx/query-dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "dedd6bbd3831c920f75654298daf488c622e88a7f5471ffb590dc0a619e0a891" -} diff --git a/core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json b/core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json deleted file mode 100644 index 2734eac79..000000000 --- a/core/deposit/.sqlx/query-e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_journal_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "e14d0690dcbba0f40192c3f7c72d2901f02535f7866939dad145bd912b36b759" -} diff --git a/core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json b/core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json deleted file mode 100644 index 8721d665e..000000000 --- a/core/deposit/.sqlx/query-e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_tx_templates WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "e3917353bef64a9e0332e24a5420256979363c88f2000f5e99fe0a215a8f06d4" -} diff --git a/core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json b/core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json deleted file mode 100644 index 0c2ab4068..000000000 --- a/core/deposit/.sqlx/query-e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_velocity_limits WHERE id = $1) SELECT i.id AS \"entity_id: VelocityLimitId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_velocity_limit_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: VelocityLimitId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "e4d6ff9f867fc4eb41478d2f5cbbac04cebc2e3086e9b184dc0ca5ad75b84673" -} diff --git a/core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json b/core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json deleted file mode 100644 index 61e366613..000000000 --- a/core/deposit/.sqlx/query-e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE external_id = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "e56e94ae9e0c5e1d6bb77715eb207c93159acfda96c25e0588584d4314b37a6f" -} diff --git a/core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json b/core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json deleted file mode 100644 index 214a71c9d..000000000 --- a/core/deposit/.sqlx/query-e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_journals (id, name, data_source_id, created_at) VALUES ($1, $2, $3, $4)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [] - }, - "hash": "e5a0f6bf664c4b04fc89b6f9dd61a11467a3c77483ebe8591d24758ffbaa4dd3" -} diff --git a/core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json b/core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json deleted file mode 100644 index ab017c339..000000000 --- a/core/deposit/.sqlx/query-e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_entries WHERE data_source_id = $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "e711cccbac49b2a5016ccf674cfc870090d7b176c96ec449ed4c34b5893da526" -} diff --git a/core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json b/core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json deleted file mode 100644 index 0d6a3d3c7..000000000 --- a/core/deposit/.sqlx/query-e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_accounts WHERE latest_values = $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Jsonb" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "e76ff1b31d7cf5b2244264e3ce116adfe905e9f81ced34a875dbb3bdd5cfdc09" -} diff --git a/core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json b/core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json deleted file mode 100644 index 601b3aa8b..000000000 --- a/core/deposit/.sqlx/query-e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO cala_outbox_events (sequence)\n SELECT unnest($1::bigint[]) AS sequence\n ON CONFLICT (sequence) DO UPDATE\n SET sequence = EXCLUDED.sequence\n RETURNING id, sequence AS \"sequence!: EventSequence\", payload, recorded_at\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence!: EventSequence", - "type_info": "Int8" - }, - { - "ordinal": 2, - "name": "payload", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8Array" - ] - }, - "nullable": [ - false, - false, - true, - false - ] - }, - "hash": "e983a467a77dbf5c21aa33f0ff7e70ff74e62037c3a84f74f8836756f610d333" -} diff --git a/core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json b/core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json deleted file mode 100644 index 1d0ea370e..000000000 --- a/core/deposit/.sqlx/query-e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "e986221978d38f58d09566e7dc8d5de3f0e72eb1af2315ae27c5496867c3b145" -} diff --git a/core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json b/core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json deleted file mode 100644 index e97093eb4..000000000 --- a/core/deposit/.sqlx/query-ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_tx_templates WHERE code = $1) SELECT i.id AS \"entity_id: TxTemplateId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_tx_template_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TxTemplateId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "ec5deac7f225fc2d848dfa9ff437c4deb1dc2d3a7bda6df0bb792469748d534d" -} diff --git a/core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json b/core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json deleted file mode 100644 index 1fb7baa65..000000000 --- a/core/deposit/.sqlx/query-f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_account_sets WHERE (COALESCE(id > $2, true)) ORDER BY id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountSetId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_set_events e ON i.id = e.id ORDER BY i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountSetId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "f03af09ccb782050f2067f616cccc4d06192f9575c97dfe8c907d8cec41d7908" -} diff --git a/core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/core/deposit/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json b/core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json deleted file mode 100644 index bd61d76af..000000000 --- a/core/deposit/.sqlx/query-f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "UPDATE cala_account_sets SET name = $2 WHERE id = $1", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f46c152c38ec5cb1120b74ba51b4de0120a042eaf0bd62e239461276b12abb25" -} diff --git a/core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json b/core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json deleted file mode 100644 index 218ed784a..000000000 --- a/core/deposit/.sqlx/query-f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_entries WHERE (COALESCE((created_at, id) > ($3, $2), $2 IS NULL)) ORDER BY created_at ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: EntryId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_entry_events e ON i.id = e.id ORDER BY i.created_at asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: EntryId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "f5181dc829ed2ff05693acf01452d0f81abad1b07a3d1c4587832b8ae912ae4c" -} diff --git a/core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json b/core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json deleted file mode 100644 index c2c7e1111..000000000 --- a/core/deposit/.sqlx/query-f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT id FROM cala_transactions WHERE journal_id = $1) SELECT i.id AS \"entity_id: TransactionId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_transaction_events e ON i.id = e.id ORDER BY i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: TransactionId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "f7ac91e8ecf9f13ab0235fc30b1fc9b31a7af2bab2c6f980101d4b3eb71ec65b" -} diff --git a/core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json b/core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json deleted file mode 100644 index f8cab6a2c..000000000 --- a/core/deposit/.sqlx/query-f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n WITH first AS (\n SELECT\n true AS first, false AS last, h.values,\n a.normal_balance_type AS \"normal_balance_type!: DebitOrCredit\", h.recorded_at\n FROM cala_balance_history h\n JOIN cala_accounts a\n ON h.account_id = a.id\n WHERE h.journal_id = $1\n AND h.account_id = $2\n AND h.currency = $3\n AND h.recorded_at < $4\n ORDER BY h.recorded_at DESC, h.version DESC\n LIMIT 1\n ),\n last AS (\n SELECT \n false AS first, true AS last, h.values,\n a.normal_balance_type AS \"normal_balance_type!: DebitOrCredit\", h.recorded_at\n FROM cala_balance_history h\n JOIN cala_accounts a\n ON h.account_id = a.id\n WHERE h.journal_id = $1\n AND h.account_id = $2\n AND h.currency = $3\n AND h.recorded_at <= COALESCE($5, NOW())\n ORDER BY h.recorded_at DESC, h.version DESC\n LIMIT 1\n )\n SELECT * FROM first\n UNION ALL\n SELECT * FROM last\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "first", - "type_info": "Bool" - }, - { - "ordinal": 1, - "name": "last", - "type_info": "Bool" - }, - { - "ordinal": 2, - "name": "values", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "normal_balance_type!: DebitOrCredit", - "type_info": { - "Custom": { - "name": "debitorcredit", - "kind": { - "Enum": [ - "debit", - "credit" - ] - } - } - } - }, - { - "ordinal": 4, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Uuid", - "Uuid", - "Text", - "Timestamptz", - "Timestamptz" - ] - }, - "nullable": [ - null, - null, - null, - null, - null - ] - }, - "hash": "f7f6fb7d8d63f7fb053a52b54005e8c3597c2a54f7f72c9a3a58be9457bd38cb" -} diff --git a/core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/core/deposit/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json b/core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json deleted file mode 100644 index dee2968e7..000000000 --- a/core/deposit/.sqlx/query-f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_velocity_limit_events (id, recorded_at, sequence, event_type, event) SELECT unnested.id, $1, unnested.sequence, unnested.event_type, unnested.event FROM UNNEST($2::UUID[], $3::INT[], $4::TEXT[], $5::JSONB[]) AS unnested(id, sequence, event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Timestamptz", - "UuidArray", - "Int4Array", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "f913137cb0dcc0fd536118c964f4b159f065a1875dd1f02982a1f579c9558087" -} diff --git a/core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json b/core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json deleted file mode 100644 index fbf189e7c..000000000 --- a/core/deposit/.sqlx/query-fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT name, id FROM cala_accounts WHERE (COALESCE((name, id) > ($3, $2), $2 IS NULL)) ORDER BY name ASC, id ASC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.name asc, i.id asc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "fa3e89e009e7df93f198f41736ca0cd645e51b04720d1a01a85a778a544b368f" -} diff --git a/core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/core/deposit/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json b/core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json deleted file mode 100644 index 40cad9e0a..000000000 --- a/core/deposit/.sqlx/query-fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO cala_transaction_events (id, recorded_at, sequence, event_type, event) SELECT $1, $2, ROW_NUMBER() OVER () + $3, unnested.event_type, unnested.event FROM UNNEST($4::text[], $5::jsonb[]) AS unnested(event_type, event)", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Uuid", - "Timestamptz", - "Int8", - "TextArray", - "JsonbArray" - ] - }, - "nullable": [] - }, - "hash": "fab10fcf171df145062acf5612ef38df6a96e971db2139c10041ad0170cfd0a9" -} diff --git a/core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/core/deposit/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json b/core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json deleted file mode 100644 index 786ee5053..000000000 --- a/core/deposit/.sqlx/query-fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "WITH entities AS (SELECT created_at, id FROM cala_accounts WHERE (COALESCE((created_at, id) < ($3, $2), $2 IS NULL)) ORDER BY created_at DESC, id DESC LIMIT $1) SELECT i.id AS \"entity_id: AccountId\", e.sequence, e.event, e.recorded_at FROM entities i JOIN cala_account_events e ON i.id = e.id ORDER BY i.created_at desc, i.id desc, i.id, e.sequence", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "entity_id: AccountId", - "type_info": "Uuid" - }, - { - "ordinal": 1, - "name": "sequence", - "type_info": "Int4" - }, - { - "ordinal": 2, - "name": "event", - "type_info": "Jsonb" - }, - { - "ordinal": 3, - "name": "recorded_at", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [ - "Int8", - "Uuid", - "Timestamptz" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "fe8ed538b549515c126b30dc923062c03b1af6949138cc500b1eccd0faf495b3" -} diff --git a/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/core/governance/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/core/governance/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/core/governance/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/core/governance/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/core/governance/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/core/governance/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/core/governance/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/core/governance/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/core/governance/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/core/governance/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/core/governance/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/core/governance/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/core/governance/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/lana/app/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/lana/app/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/lana/app/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/lana/app/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/lana/app/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/lana/app/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/lana/app/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/lana/app/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/lana/app/.sqlx/query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json b/lana/app/.sqlx/query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json similarity index 62% rename from lana/app/.sqlx/query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json rename to lana/app/.sqlx/query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json index ebb5761b9..79ca8a1a7 100644 --- a/lana/app/.sqlx/query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json +++ b/lana/app/.sqlx/query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n WITH selected_jobs AS (\n SELECT je.id, je.execution_state_json AS data_json\n FROM job_executions je\n JOIN jobs ON je.id = jobs.id\n WHERE reschedule_after < $2::timestamptz\n AND je.state = 'pending'\n LIMIT $1\n FOR UPDATE\n )\n UPDATE job_executions AS je\n SET state = 'running', reschedule_after = $2::timestamptz + $3::interval\n FROM selected_jobs\n WHERE je.id = selected_jobs.id\n RETURNING je.id AS \"id!: JobId\", selected_jobs.data_json, je.attempt_index\n ", + "query": "\n WITH selected_jobs AS (\n SELECT je.id, je.execution_state_json AS data_json\n FROM job_executions je\n JOIN jobs ON je.id = jobs.id\n WHERE reschedule_after < $2::timestamptz\n AND je.state = 'pending'\n ORDER BY reschedule_after ASC\n LIMIT $1\n FOR UPDATE\n )\n UPDATE job_executions AS je\n SET state = 'running', reschedule_after = $2::timestamptz + $3::interval\n FROM selected_jobs\n WHERE je.id = selected_jobs.id\n RETURNING je.id AS \"id!: JobId\", selected_jobs.data_json, je.attempt_index\n ", "describe": { "columns": [ { @@ -32,5 +32,5 @@ false ] }, - "hash": "96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c" + "hash": "5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d" } diff --git a/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lana/app/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/lana/app/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/lana/app/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/lana/app/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/lana/app/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json b/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json deleted file mode 100644 index eb3a84f04..000000000 --- a/lana/dashboard/.sqlx/query-1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "INSERT INTO casbin_rule ( ptype, v0, v1, v2, v3, v4, v5 )\n VALUES ( $1, $2, $3, $4, $5, $6, $7 )", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1cabd2f674da323da9e0da724d3bcfe5f968b31500e8c8cf97fe16814bc04164" -} diff --git a/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json b/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json deleted file mode 100644 index 1ea12e396..000000000 --- a/lana/dashboard/.sqlx/query-1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v3 is NULL OR v3 = COALESCE($2,v3)) AND\n (v4 is NULL OR v4 = COALESCE($3,v4)) AND\n (v5 is NULL OR v5 = COALESCE($4,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "1f299262f01a2c9d2ee94079a12766573c91b2775a086c65bc9a5fdc91300bb0" -} diff --git a/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json b/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json deleted file mode 100644 index 8046c5db1..000000000 --- a/lana/dashboard/.sqlx/query-24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "24876462291b90324dfe3682e9f36247a328db780a48da47c9402e1d3ebd80c9" -} diff --git a/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json b/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json deleted file mode 100644 index e246e53b4..000000000 --- a/lana/dashboard/.sqlx/query-2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n v0 = $2 AND\n v1 = $3 AND\n v2 = $4 AND\n v3 = $5 AND\n v4 = $6 AND\n v5 = $7", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "2872b56bbc5bed96b1a303bf9cf44610fb79a1b9330730c65953f0c1b88c2a53" -} diff --git a/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json b/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json deleted file mode 100644 index 4d06843d1..000000000 --- a/lana/dashboard/.sqlx/query-3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * FROM casbin_rule", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "3022cb733970ae5836ab3891367b209a7e1f0974242ecd0f55e5b0098152bad5" -} diff --git a/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json b/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json deleted file mode 100644 index 75c6da350..000000000 --- a/lana/dashboard/.sqlx/query-438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "CREATE TABLE IF NOT EXISTS casbin_rule (\n id SERIAL PRIMARY KEY,\n ptype VARCHAR NOT NULL,\n v0 VARCHAR NOT NULL,\n v1 VARCHAR NOT NULL,\n v2 VARCHAR NOT NULL,\n v3 VARCHAR NOT NULL,\n v4 VARCHAR NOT NULL,\n v5 VARCHAR NOT NULL,\n CONSTRAINT unique_key_sqlx_adapter UNIQUE(ptype, v0, v1, v2, v3, v4, v5)\n );\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "438ee38e669be96e562d09d3bc5806b4c78b7aa2a9609c4eccb941c7dff7b107" -} diff --git a/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json b/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json deleted file mode 100644 index ce229dc41..000000000 --- a/lana/dashboard/.sqlx/query-4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v4 is NULL OR v4 = COALESCE($2,v4)) AND\n (v5 is NULL OR v5 = COALESCE($3,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4acfe0086a593b08177791bb3b47cb75a999041a3eb6a8f8177bebfa3c30d56f" -} diff --git a/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json b/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json deleted file mode 100644 index 4c4c1df2a..000000000 --- a/lana/dashboard/.sqlx/query-4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v1 is NULL OR v1 = COALESCE($2,v1)) AND\n (v2 is NULL OR v2 = COALESCE($3,v2)) AND\n (v3 is NULL OR v3 = COALESCE($4,v3)) AND\n (v4 is NULL OR v4 = COALESCE($5,v4)) AND\n (v5 is NULL OR v5 = COALESCE($6,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "4e7b82d256f7298564f46af6a45b89853785c32a5f83cb0b25609329c760428a" -} diff --git a/lana/dashboard/.sqlx/query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json b/lana/dashboard/.sqlx/query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json similarity index 62% rename from lana/dashboard/.sqlx/query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json rename to lana/dashboard/.sqlx/query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json index ebb5761b9..79ca8a1a7 100644 --- a/lana/dashboard/.sqlx/query-96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c.json +++ b/lana/dashboard/.sqlx/query-5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n WITH selected_jobs AS (\n SELECT je.id, je.execution_state_json AS data_json\n FROM job_executions je\n JOIN jobs ON je.id = jobs.id\n WHERE reschedule_after < $2::timestamptz\n AND je.state = 'pending'\n LIMIT $1\n FOR UPDATE\n )\n UPDATE job_executions AS je\n SET state = 'running', reschedule_after = $2::timestamptz + $3::interval\n FROM selected_jobs\n WHERE je.id = selected_jobs.id\n RETURNING je.id AS \"id!: JobId\", selected_jobs.data_json, je.attempt_index\n ", + "query": "\n WITH selected_jobs AS (\n SELECT je.id, je.execution_state_json AS data_json\n FROM job_executions je\n JOIN jobs ON je.id = jobs.id\n WHERE reschedule_after < $2::timestamptz\n AND je.state = 'pending'\n ORDER BY reschedule_after ASC\n LIMIT $1\n FOR UPDATE\n )\n UPDATE job_executions AS je\n SET state = 'running', reschedule_after = $2::timestamptz + $3::interval\n FROM selected_jobs\n WHERE je.id = selected_jobs.id\n RETURNING je.id AS \"id!: JobId\", selected_jobs.data_json, je.attempt_index\n ", "describe": { "columns": [ { @@ -32,5 +32,5 @@ false ] }, - "hash": "96435b2b5714e99f2055584854a19f6aa0bbb43ebb0ede7c506d36a38b94600c" + "hash": "5501335ba40775766d8425f09a4096d94594d0ed0e9064047c7bcc042fdd609d" } diff --git a/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lana/dashboard/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json b/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json deleted file mode 100644 index ef54cdb3b..000000000 --- a/lana/dashboard/.sqlx/query-f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v0 is NULL OR v0 = COALESCE($2,v0)) AND\n (v1 is NULL OR v1 = COALESCE($3,v1)) AND\n (v2 is NULL OR v2 = COALESCE($4,v2)) AND\n (v3 is NULL OR v3 = COALESCE($5,v3)) AND\n (v4 is NULL OR v4 = COALESCE($6,v4)) AND\n (v5 is NULL OR v5 = COALESCE($7,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f130c22d14ee2a99b9220ac1a45226ba97993ede9988a4c57d58bd066500a119" -} diff --git a/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json b/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json deleted file mode 100644 index 0daaa8a87..000000000 --- a/lana/dashboard/.sqlx/query-f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v2 is NULL OR v2 = COALESCE($2,v2)) AND\n (v3 is NULL OR v3 = COALESCE($3,v3)) AND\n (v4 is NULL OR v4 = COALESCE($4,v4)) AND\n (v5 is NULL OR v5 = COALESCE($5,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar", - "Varchar", - "Varchar", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "f8611a862ed1d3b982e8aa5ccab21e00c42a3fad8082cf15c2af88cd8388f41b" -} diff --git a/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json b/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json deleted file mode 100644 index 4a5f7e808..000000000 --- a/lana/dashboard/.sqlx/query-fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "DELETE FROM casbin_rule WHERE\n ptype = $1 AND\n (v5 is NULL OR v5 = COALESCE($2,v5))", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Text", - "Varchar" - ] - }, - "nullable": [] - }, - "hash": "fa51ae7af271fc17c848694fbf1b37d46c5a2f4202e1b8dce1f66a65069beb0b" -} diff --git a/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json b/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json deleted file mode 100644 index 897ae5268..000000000 --- a/lana/dashboard/.sqlx/query-fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT * from casbin_rule WHERE (\n ptype LIKE 'g%' AND v0 LIKE $1 AND v1 LIKE $2 AND v2 LIKE $3 AND v3 LIKE $4 AND v4 LIKE $5 AND v5 LIKE $6 )\n OR (\n ptype LIKE 'p%' AND v0 LIKE $7 AND v1 LIKE $8 AND v2 LIKE $9 AND v3 LIKE $10 AND v4 LIKE $11 AND v5 LIKE $12 );\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int4" - }, - { - "ordinal": 1, - "name": "ptype", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "v0", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "v1", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "v2", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "v3", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "v4", - "type_info": "Varchar" - }, - { - "ordinal": 7, - "name": "v5", - "type_info": "Varchar" - } - ], - "parameters": { - "Left": [ - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [ - false, - false, - false, - false, - false, - false, - false, - false - ] - }, - "hash": "fb7ce69e70b345d2cf0ca017523c1b90b67b053add3d4cffb8d579bfc8f08345" -} diff --git a/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lib/audit/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lib/job/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} diff --git a/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json b/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json deleted file mode 100644 index 60f58c60f..000000000 --- a/lib/outbox/.sqlx/query-6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "SELECT NOW()", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "now", - "type_info": "Timestamptz" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - null - ] - }, - "hash": "6bae2f6ec3f8d5295b935cef18cb3dd649758b5afcf70feb2a6eff7d69925bfc" -} From 4bd5546c0df52b220865cab3ce471c282e41d27f Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 13 Dec 2024 10:14:19 +0100 Subject: [PATCH 22/24] chore: move get_credit_facility_balance --- .../ledger/credit_facility_accounts.rs | 18 +++++ lana/app/src/credit_facility/ledger/mod.rs | 76 ++++++++++++++++++- lana/app/src/credit_facility/mod.rs | 4 +- lana/app/src/ledger/credit_facility.rs | 13 +--- 4 files changed, 93 insertions(+), 18 deletions(-) diff --git a/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs b/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs index a3d261a33..58af46fb4 100644 --- a/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs +++ b/lana/app/src/credit_facility/ledger/credit_facility_accounts.rs @@ -2,6 +2,8 @@ use serde::{Deserialize, Serialize}; use cala_ledger::AccountId as LedgerAccountId; +use crate::primitives::{Satoshis, UsdCents}; + #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub struct CreditFacilityAccountIds { pub facility_account_id: LedgerAccountId, @@ -25,3 +27,19 @@ impl CreditFacilityAccountIds { } } } + +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub struct CreditFacilityLedgerBalance { + pub facility: UsdCents, + pub collateral: Satoshis, + pub disbursed: UsdCents, + pub disbursed_receivable: UsdCents, + pub interest: UsdCents, + pub interest_receivable: UsdCents, +} + +impl CreditFacilityLedgerBalance { + pub fn check_disbursal_amount(&self, amount: UsdCents) -> bool { + amount < self.facility + } +} diff --git a/lana/app/src/credit_facility/ledger/mod.rs b/lana/app/src/credit_facility/ledger/mod.rs index 4b975cf9c..cba49707b 100644 --- a/lana/app/src/credit_facility/ledger/mod.rs +++ b/lana/app/src/credit_facility/ledger/mod.rs @@ -2,9 +2,9 @@ mod credit_facility_accounts; pub mod error; // mod templates; -use cala_ledger::{account::NewAccount, CalaLedger, JournalId}; +use cala_ledger::{account::NewAccount, CalaLedger, Currency, JournalId}; -use crate::primitives::CreditFacilityId; +use crate::primitives::{CreditFacilityId, Satoshis, UsdCents}; pub use credit_facility_accounts::*; use error::*; @@ -12,14 +12,18 @@ use error::*; #[derive(Clone)] pub struct CreditLedger { cala: CalaLedger, - _journal_id: JournalId, + journal_id: JournalId, + usd: Currency, + btc: Currency, } impl CreditLedger { pub async fn init(cala: &CalaLedger, journal_id: JournalId) -> Result { Ok(Self { cala: cala.clone(), - _journal_id: journal_id, + journal_id, + usd: "USD".parse().expect("Could not parse 'USD'"), + btc: "BTC".parse().expect("Could not parse 'BTC'"), }) } @@ -97,4 +101,68 @@ impl CreditLedger { Ok(()) } + + pub async fn get_credit_facility_balance( + &self, + CreditFacilityAccountIds { + facility_account_id, + disbursed_receivable_account_id, + collateral_account_id, + interest_receivable_account_id, + .. + }: CreditFacilityAccountIds, + ) -> Result { + let facility_id = (self.journal_id, facility_account_id, self.usd); + let collateral_id = (self.journal_id, collateral_account_id, self.btc); + let disbursed_receivable_id = (self.journal_id, disbursed_receivable_account_id, self.btc); + let interest_receivable_id = (self.journal_id, interest_receivable_account_id, self.btc); + let balances = self + .cala + .balances() + .find_all(&[ + facility_id, + collateral_id, + disbursed_receivable_id, + interest_receivable_id, + ]) + .await?; + let facility = if let Some(b) = balances.get(&facility_id) { + UsdCents::try_from_usd(b.settled())? + } else { + UsdCents::ZERO + }; + let disbursed = if let Some(b) = balances.get(&disbursed_receivable_id) { + UsdCents::try_from_usd(b.details.settled.dr_balance)? + } else { + UsdCents::ZERO + }; + let disbursed_receivable = if let Some(b) = balances.get(&disbursed_receivable_id) { + UsdCents::try_from_usd(b.settled())? + } else { + UsdCents::ZERO + }; + let interest = if let Some(b) = balances.get(&interest_receivable_id) { + UsdCents::try_from_usd(b.details.settled.dr_balance)? + } else { + UsdCents::ZERO + }; + let interest_receivable = if let Some(b) = balances.get(&interest_receivable_id) { + UsdCents::try_from_usd(b.settled())? + } else { + UsdCents::ZERO + }; + let collateral = if let Some(b) = balances.get(&collateral_id) { + Satoshis::try_from_btc(b.settled())? + } else { + Satoshis::ZERO + }; + Ok(CreditFacilityLedgerBalance { + facility, + collateral, + disbursed, + disbursed_receivable, + interest, + interest_receivable, + }) + } } diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index b59fc9c30..2bfcb048b 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -300,8 +300,8 @@ impl CreditFacilities { .find_by_id(credit_facility_id) .await?; - let ledger_balances = self - .gql_ledger + let balances = self + .ledger .get_credit_facility_balance(credit_facility.account_ids) .await?; credit_facility diff --git a/lana/app/src/ledger/credit_facility.rs b/lana/app/src/ledger/credit_facility.rs index 3d3b068d5..f206d42ba 100644 --- a/lana/app/src/ledger/credit_facility.rs +++ b/lana/app/src/ledger/credit_facility.rs @@ -1,5 +1,4 @@ use chrono::{DateTime, Utc}; -use serde::{Deserialize, Serialize}; use crate::{ primitives::{CollateralAction, LedgerTxId, Satoshis, UsdCents}, @@ -8,17 +7,7 @@ use crate::{ use super::{cala::graphql::*, error::*, CustomerLedgerAccountIds}; -pub use crate::credit_facility::ledger::CreditFacilityAccountIds; - -#[derive(Debug, Copy, Clone, Serialize, Deserialize)] -pub struct CreditFacilityLedgerBalance { - pub facility: UsdCents, - pub collateral: Satoshis, - pub disbursed: UsdCents, - pub disbursed_receivable: UsdCents, - pub interest: UsdCents, - pub interest_receivable: UsdCents, -} +pub use crate::credit_facility::ledger::{CreditFacilityAccountIds, CreditFacilityLedgerBalance}; impl TryFrom for CreditFacilityLedgerBalance { type Error = LedgerError; From fbf907d26db05e269ab83e51de6944845248ec7d Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 13 Dec 2024 10:47:46 +0100 Subject: [PATCH 23/24] chore: add / remove collateral templates --- lana/app/src/credit_facility/ledger/mod.rs | 18 ++- .../ledger/templates/add_collateral.rs | 128 ++++++++++++++++++ .../credit_facility/ledger/templates/mod.rs | 5 + .../ledger/templates/remove_collateral.rs | 128 ++++++++++++++++++ lana/app/src/credit_facility/mod.rs | 4 +- 5 files changed, 279 insertions(+), 4 deletions(-) create mode 100644 lana/app/src/credit_facility/ledger/templates/add_collateral.rs create mode 100644 lana/app/src/credit_facility/ledger/templates/mod.rs create mode 100644 lana/app/src/credit_facility/ledger/templates/remove_collateral.rs diff --git a/lana/app/src/credit_facility/ledger/mod.rs b/lana/app/src/credit_facility/ledger/mod.rs index cba49707b..659149706 100644 --- a/lana/app/src/credit_facility/ledger/mod.rs +++ b/lana/app/src/credit_facility/ledger/mod.rs @@ -1,6 +1,6 @@ mod credit_facility_accounts; pub mod error; -// mod templates; +mod templates; use cala_ledger::{account::NewAccount, CalaLedger, Currency, JournalId}; @@ -19,6 +19,9 @@ pub struct CreditLedger { impl CreditLedger { pub async fn init(cala: &CalaLedger, journal_id: JournalId) -> Result { + templates::AddCollateral::init(cala).await?; + templates::RemoveCollateral::init(cala).await?; + Ok(Self { cala: cala.clone(), journal_id, @@ -165,4 +168,17 @@ impl CreditLedger { interest_receivable, }) } + + pub async fn update_credit_facility_collateral( + &self, + // CreditFacilityCollateralUpdate { + // tx_id, + // credit_facility_account_ids, + // abs_diff, + // tx_ref, + // action, + // }: CreditFacilityCollateralUpdate, + ) -> Result<(), CreditLedgerError> { + unimplemented!() + } } diff --git a/lana/app/src/credit_facility/ledger/templates/add_collateral.rs b/lana/app/src/credit_facility/ledger/templates/add_collateral.rs new file mode 100644 index 000000000..e30ba642a --- /dev/null +++ b/lana/app/src/credit_facility/ledger/templates/add_collateral.rs @@ -0,0 +1,128 @@ +use rust_decimal::Decimal; +use tracing::instrument; + +use cala_ledger::{ + tx_template::{error::TxTemplateError, Params, *}, + *, +}; + +use crate::credit_facility::ledger::error::*; + +pub const ADD_COLLATERAL_CODE: &str = "ADD_COLLATERAL"; + +#[derive(Debug)] +pub struct AddCollateralParams { + pub journal_id: JournalId, + pub currency: Currency, + pub amount: Decimal, + pub deposit_omnibus_account_id: AccountId, + pub credit_account_id: AccountId, +} + +impl AddCollateralParams { + pub fn defs() -> Vec { + vec![ + NewParamDefinition::builder() + .name("journal_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("currency") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("amount") + .r#type(ParamDataType::Decimal) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("collateral_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("bank_collateral_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("effective") + .r#type(ParamDataType::Date) + .build() + .unwrap(), + ] + } +} + +impl From for Params { + fn from( + AddCollateralParams { + journal_id, + currency, + amount, + deposit_omnibus_account_id, + credit_account_id, + }: AddCollateralParams, + ) -> Self { + let mut params = Self::default(); + params.insert("journal_id", journal_id); + params.insert("currency", currency); + params.insert("amount", amount); + params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); + params.insert("credit_account_id", credit_account_id); + params.insert("effective", chrono::Utc::now().date_naive()); + + params + } +} + +pub struct AddCollateral; + +impl AddCollateral { + #[instrument(name = "ledger.add_collateral.init", skip_all)] + pub async fn init(ledger: &CalaLedger) -> Result<(), CreditLedgerError> { + let tx_input = NewTxTemplateTransaction::builder() + .journal_id("params.journal_id") + .effective("params.effective") + .description("'Record a deposit'") + .build() + .expect("Couldn't build TxInput"); + let entries = vec![ + NewTxTemplateEntry::builder() + .entry_type("'ADD_COLLATERAL_DR'") + .currency("params.currency") + .account_id("params.bank_collateral_account_id") + .direction("DEBIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'ADD_COLLATERAL_CR'") + .currency("params.currency") + .account_id("params.collateral_account_id") + .direction("CREDIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + ]; + + let params = AddCollateralParams::defs(); + let template = NewTxTemplate::builder() + .id(TxTemplateId::new()) + .code(ADD_COLLATERAL_CODE) + .transaction(tx_input) + .entries(entries) + .params(params) + .build() + .expect("Couldn't build template"); + match ledger.tx_templates().create(template).await { + Err(TxTemplateError::DuplicateCode) => Ok(()), + Err(e) => Err(e.into()), + Ok(_) => Ok(()), + } + } +} diff --git a/lana/app/src/credit_facility/ledger/templates/mod.rs b/lana/app/src/credit_facility/ledger/templates/mod.rs new file mode 100644 index 000000000..eaadd1bd7 --- /dev/null +++ b/lana/app/src/credit_facility/ledger/templates/mod.rs @@ -0,0 +1,5 @@ +mod add_collateral; +mod remove_collateral; + +pub use add_collateral::*; +pub use remove_collateral::*; diff --git a/lana/app/src/credit_facility/ledger/templates/remove_collateral.rs b/lana/app/src/credit_facility/ledger/templates/remove_collateral.rs new file mode 100644 index 000000000..5ef235c14 --- /dev/null +++ b/lana/app/src/credit_facility/ledger/templates/remove_collateral.rs @@ -0,0 +1,128 @@ +use rust_decimal::Decimal; +use tracing::instrument; + +use cala_ledger::{ + tx_template::{error::TxTemplateError, Params, *}, + *, +}; + +use crate::credit_facility::ledger::error::*; + +pub const REMOVE_COLLATERAL_CODE: &str = "REMOVE_COLLATERAL"; + +#[derive(Debug)] +pub struct RemoveCollateralParams { + pub journal_id: JournalId, + pub currency: Currency, + pub amount: Decimal, + pub deposit_omnibus_account_id: AccountId, + pub credit_account_id: AccountId, +} + +impl RemoveCollateralParams { + pub fn defs() -> Vec { + vec![ + NewParamDefinition::builder() + .name("journal_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("currency") + .r#type(ParamDataType::String) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("amount") + .r#type(ParamDataType::Decimal) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("collateral_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("bank_collateral_account_id") + .r#type(ParamDataType::Uuid) + .build() + .unwrap(), + NewParamDefinition::builder() + .name("effective") + .r#type(ParamDataType::Date) + .build() + .unwrap(), + ] + } +} + +impl From for Params { + fn from( + RemoveCollateralParams { + journal_id, + currency, + amount, + deposit_omnibus_account_id, + credit_account_id, + }: RemoveCollateralParams, + ) -> Self { + let mut params = Self::default(); + params.insert("journal_id", journal_id); + params.insert("currency", currency); + params.insert("amount", amount); + params.insert("deposit_omnibus_account_id", deposit_omnibus_account_id); + params.insert("credit_account_id", credit_account_id); + params.insert("effective", chrono::Utc::now().date_naive()); + + params + } +} + +pub struct RemoveCollateral; + +impl RemoveCollateral { + #[instrument(name = "ledger.add_collateral.init", skip_all)] + pub async fn init(ledger: &CalaLedger) -> Result<(), CreditLedgerError> { + let tx_input = NewTxTemplateTransaction::builder() + .journal_id("params.journal_id") + .effective("params.effective") + .description("'Record a deposit'") + .build() + .expect("Couldn't build TxInput"); + let entries = vec![ + NewTxTemplateEntry::builder() + .entry_type("'REMOVE_COLLATERAL_DR'") + .currency("params.currency") + .account_id("params.collateral_account_id") + .direction("DEBIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + NewTxTemplateEntry::builder() + .entry_type("'REMOVE_COLLATERAL_CR'") + .currency("params.currency") + .account_id("params.bank_collateral_account_id") + .direction("CREDIT") + .layer("SETTLED") + .units("params.amount") + .build() + .expect("Couldn't build entry"), + ]; + + let params = RemoveCollateralParams::defs(); + let template = NewTxTemplate::builder() + .id(TxTemplateId::new()) + .code(REMOVE_COLLATERAL_CODE) + .transaction(tx_input) + .entries(entries) + .params(params) + .build() + .expect("Couldn't build template"); + match ledger.tx_templates().create(template).await { + Err(TxTemplateError::DuplicateCode) => Ok(()), + Err(e) => Err(e.into()), + Ok(_) => Ok(()), + } + } +} diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index 2bfcb048b..858ecdc89 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -412,6 +412,7 @@ impl CreditFacilities { price, self.config.upgrade_buffer_cvl_pct, )?; + self.credit_facility_repo .update_in_op(&mut db, &mut credit_facility) .await?; @@ -420,9 +421,6 @@ impl CreditFacilities { .update_credit_facility_collateral(credit_facility_collateral_update) .await?; - self.credit_facility_repo - .update_in_op(&mut db, &mut credit_facility) - .await?; db.commit().await?; Ok(credit_facility) } From cb305ca7373b565a0b75113c7a28171369678b01 Mon Sep 17 00:00:00 2001 From: bodymindarts Date: Fri, 13 Dec 2024 10:49:39 +0100 Subject: [PATCH 24/24] chore: fix name --- lana/app/src/credit_facility/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lana/app/src/credit_facility/mod.rs b/lana/app/src/credit_facility/mod.rs index 858ecdc89..d1877832c 100644 --- a/lana/app/src/credit_facility/mod.rs +++ b/lana/app/src/credit_facility/mod.rs @@ -304,9 +304,7 @@ impl CreditFacilities { .ledger .get_credit_facility_balance(credit_facility.account_ids) .await?; - credit_facility - .balances() - .check_against_ledger(ledger_balances)?; + credit_facility.balances().check_against_ledger(balances)?; credit_facility.balances().check_disbursal_amount(amount)?; @@ -412,7 +410,6 @@ impl CreditFacilities { price, self.config.upgrade_buffer_cvl_pct, )?; - self.credit_facility_repo .update_in_op(&mut db, &mut credit_facility) .await?;