diff --git a/cala-ledger/.sqlx/query-4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66.json b/cala-ledger/.sqlx/query-7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a.json similarity index 89% rename from cala-ledger/.sqlx/query-4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66.json rename to cala-ledger/.sqlx/query-7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a.json index cffc628d..e8bbf82d 100644 --- a/cala-ledger/.sqlx/query-4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66.json +++ b/cala-ledger/.sqlx/query-7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_transactions a\n JOIN cala_transaction_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.external_id = $1", + "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_transactions a\n JOIN cala_transaction_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.external_id = $1\n ORDER BY e.sequence", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66" + "hash": "7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a" } diff --git a/cala-ledger/.sqlx/query-cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3.json b/cala-ledger/.sqlx/query-a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697.json similarity index 89% rename from cala-ledger/.sqlx/query-cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3.json rename to cala-ledger/.sqlx/query-a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697.json index 0db99a8b..f4281f9b 100644 --- a/cala-ledger/.sqlx/query-cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3.json +++ b/cala-ledger/.sqlx/query-a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_tx_templates a\n JOIN cala_tx_template_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.code = $1", + "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_tx_templates a\n JOIN cala_tx_template_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.code = $1\n ORDER BY e.sequence", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3" + "hash": "a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697" } diff --git a/cala-server/.sqlx/query-e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb.json b/cala-ledger/.sqlx/query-ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10.json similarity index 89% rename from cala-server/.sqlx/query-e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb.json rename to cala-ledger/.sqlx/query-ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10.json index f13ea960..ed35aa7d 100644 --- a/cala-server/.sqlx/query-e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb.json +++ b/cala-ledger/.sqlx/query-ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_account_sets a\n JOIN cala_account_set_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.id = $1", + "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_account_sets a\n JOIN cala_account_set_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.id = $1\n ORDER BY e.sequence", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb" + "hash": "ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10" } diff --git a/cala-ledger/src/account_set/repo.rs b/cala-ledger/src/account_set/repo.rs index 7c35d748..4a5ce3b6 100644 --- a/cala-ledger/src/account_set/repo.rs +++ b/cala-ledger/src/account_set/repo.rs @@ -196,7 +196,8 @@ impl AccountSetRepo { ON a.data_source_id = e.data_source_id AND a.id = e.id WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000' - AND a.id = $1"#, + AND a.id = $1 + ORDER BY e.sequence"#, account_set_id as AccountSetId ) .fetch_all(&mut **db) diff --git a/cala-ledger/src/transaction/repo.rs b/cala-ledger/src/transaction/repo.rs index 6a429b5a..22ebc5e9 100644 --- a/cala-ledger/src/transaction/repo.rs +++ b/cala-ledger/src/transaction/repo.rs @@ -83,7 +83,8 @@ impl TransactionRepo { ON a.data_source_id = e.data_source_id AND a.id = e.id WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000' - AND a.external_id = $1"#, + AND a.external_id = $1 + ORDER BY e.sequence"#, external_id ) .fetch_all(&self.pool) diff --git a/cala-ledger/src/tx_template/repo.rs b/cala-ledger/src/tx_template/repo.rs index 4784f7bf..42bcb470 100644 --- a/cala-ledger/src/tx_template/repo.rs +++ b/cala-ledger/src/tx_template/repo.rs @@ -79,7 +79,8 @@ impl TxTemplateRepo { ON a.data_source_id = e.data_source_id AND a.id = e.id WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000' - AND a.code = $1"#, + AND a.code = $1 + ORDER BY e.sequence"#, code ) .fetch_all(&self.pool) diff --git a/cala-server/.sqlx/query-4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66.json b/cala-server/.sqlx/query-7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a.json similarity index 89% rename from cala-server/.sqlx/query-4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66.json rename to cala-server/.sqlx/query-7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a.json index cffc628d..e8bbf82d 100644 --- a/cala-server/.sqlx/query-4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66.json +++ b/cala-server/.sqlx/query-7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_transactions a\n JOIN cala_transaction_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.external_id = $1", + "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_transactions a\n JOIN cala_transaction_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.external_id = $1\n ORDER BY e.sequence", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "4c48da8dd9ef0e3fa73c0c359b7bbbfd97ed7c9fb41045c2bc0d48a37672ec66" + "hash": "7ec60cc57350c6ac7ae42c3be62c64ef176f380b9155064eed6bd0ab2bc29b4a" } diff --git a/cala-server/.sqlx/query-cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3.json b/cala-server/.sqlx/query-a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697.json similarity index 89% rename from cala-server/.sqlx/query-cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3.json rename to cala-server/.sqlx/query-a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697.json index 0db99a8b..f4281f9b 100644 --- a/cala-server/.sqlx/query-cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3.json +++ b/cala-server/.sqlx/query-a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_tx_templates a\n JOIN cala_tx_template_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.code = $1", + "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_tx_templates a\n JOIN cala_tx_template_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.code = $1\n ORDER BY e.sequence", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "cd0eaf0bcf0b32e3f8f50157375731b67b2976337b3347cdea3c59e12e452dd3" + "hash": "a4093155c9bb098edefc0da48dafdee211170abe8dc5926430bb0a8caba71697" } diff --git a/cala-ledger/.sqlx/query-e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb.json b/cala-server/.sqlx/query-ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10.json similarity index 89% rename from cala-ledger/.sqlx/query-e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb.json rename to cala-server/.sqlx/query-ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10.json index f13ea960..ed35aa7d 100644 --- a/cala-ledger/.sqlx/query-e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb.json +++ b/cala-server/.sqlx/query-ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_account_sets a\n JOIN cala_account_set_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.id = $1", + "query": "SELECT a.id, e.sequence, e.event,\n a.created_at AS entity_created_at, e.recorded_at AS event_recorded_at\n FROM cala_account_sets a\n JOIN cala_account_set_events e\n ON a.data_source_id = e.data_source_id\n AND a.id = e.id\n WHERE a.data_source_id = '00000000-0000-0000-0000-000000000000'\n AND a.id = $1\n ORDER BY e.sequence", "describe": { "columns": [ { @@ -42,5 +42,5 @@ false ] }, - "hash": "e315dfafa413d41430066ceb00c21047608599fb63b7822e8f5a676ce2f367bb" + "hash": "ac7e46d15fb8b0e6dfe634ce16acab95002bbd515bf5628462ad04f54aa3bf10" }