Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

Add balance-triggered AI credit auto-reload and custom purchase amounts (#7624)

Will Hutchinson6a1855a30eee
diff --git a/.sqlx/query-0055d4a483142faaef23f692a7235c27ebffc78f26f0a669a2ed6a9248844aa1.json b/.sqlx/query-0055d4a483142faaef23f692a7235c27ebffc78f26f0a669a2ed6a9248844aa1.json
deleted file mode 100644
index 283d27c0ff..0000000000
--- a/.sqlx/query-0055d4a483142faaef23f692a7235c27ebffc78f26f0a669a2ed6a9248844aa1.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO property_definitions (id, user_id, display_name, data_type, is_multi_select)\n VALUES ($1, $2, $3, 'STRING', false)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "0055d4a483142faaef23f692a7235c27ebffc78f26f0a669a2ed6a9248844aa1"
-}
diff --git a/.sqlx/query-02e02203a76c8bf9103aaf932450592b27c8fc3f689634a1f490921c18be83a9.json b/.sqlx/query-02e02203a76c8bf9103aaf932450592b27c8fc3f689634a1f490921c18be83a9.json
deleted file mode 100644
index 690c056af4..0000000000
--- a/.sqlx/query-02e02203a76c8bf9103aaf932450592b27c8fc3f689634a1f490921c18be83a9.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_contacts (id, company_id, email, hidden, first_interaction, last_interaction)\n VALUES ($1, $2, $3, $4, now(), now())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Bool"
- ]
- },
- "nullable": []
- },
- "hash": "02e02203a76c8bf9103aaf932450592b27c8fc3f689634a1f490921c18be83a9"
-}
diff --git a/.sqlx/query-03c1f300effe353d4fbd0edadb14d47d823a7b30fb531e515758ef72919cd9df.json b/.sqlx/query-03c1f300effe353d4fbd0edadb14d47d823a7b30fb531e515758ef72919cd9df.json
deleted file mode 100644
index 30b8a29f8c..0000000000
--- a/.sqlx/query-03c1f300effe353d4fbd0edadb14d47d823a7b30fb531e515758ef72919cd9df.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM agent_session WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "03c1f300effe353d4fbd0edadb14d47d823a7b30fb531e515758ef72919cd9df"
-}
diff --git a/.sqlx/query-0408ab8d764514d0d8e61b720a83c0965063d1b259db60388230043c469bc701.json b/.sqlx/query-0408ab8d764514d0d8e61b720a83c0965063d1b259db60388230043c469bc701.json
deleted file mode 100644
index 9cc208ac95..0000000000
--- a/.sqlx/query-0408ab8d764514d0d8e61b720a83c0965063d1b259db60388230043c469bc701.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_messages SET is_draft = false WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "0408ab8d764514d0d8e61b720a83c0965063d1b259db60388230043c469bc701"
-}
diff --git a/.sqlx/query-04497347961cee74a829f6367fee3a3545beb7cea74e5eb5fdab9aaf4984fa3f.json b/.sqlx/query-04497347961cee74a829f6367fee3a3545beb7cea74e5eb5fdab9aaf4984fa3f.json
deleted file mode 100644
index 318d0550c2..0000000000
--- a/.sqlx/query-04497347961cee74a829f6367fee3a3545beb7cea74e5eb5fdab9aaf4984fa3f.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user_info (macro_user_id, first_name, last_name) VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "04497347961cee74a829f6367fee3a3545beb7cea74e5eb5fdab9aaf4984fa3f"
-}
diff --git a/.sqlx/query-058c3089c19e7ff2ad58f186a7705d5844847eb9550a9a87dc3edc0742412e81.json b/.sqlx/query-058c3089c19e7ff2ad58f186a7705d5844847eb9550a9a87dc3edc0742412e81.json
deleted file mode 100644
index 1712c1783f..0000000000
--- a/.sqlx/query-058c3089c19e7ff2ad58f186a7705d5844847eb9550a9a87dc3edc0742412e81.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ('d1000000-0000-0000-0000-000000000002', 'delegate', '[email protected]', 'collection_delegate')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "058c3089c19e7ff2ad58f186a7705d5844847eb9550a9a87dc3edc0742412e81"
-}
diff --git a/.sqlx/query-05d52e30277ab985b7ba27789736abab59b27e56a33c01e4b90729fa6112e832.json b/.sqlx/query-05d52e30277ab985b7ba27789736abab59b27e56a33c01e4b90729fa6112e832.json
deleted file mode 100644
index a38f634366..0000000000
--- a/.sqlx/query-05d52e30277ab985b7ba27789736abab59b27e56a33c01e4b90729fa6112e832.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET left_at = now(), role = 'admin' WHERE channel_id = $1 AND user_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "05d52e30277ab985b7ba27789736abab59b27e56a33c01e4b90729fa6112e832"
-}
diff --git a/.sqlx/query-071509888a88fa74d75735ba87cb18f03e0b441d1263f9cbf0899d9e386e6e03.json b/.sqlx/query-071509888a88fa74d75735ba87cb18f03e0b441d1263f9cbf0899d9e386e6e03.json
deleted file mode 100644
index 20dd758b10..0000000000
--- a/.sqlx/query-071509888a88fa74d75735ba87cb18f03e0b441d1263f9cbf0899d9e386e6e03.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"ItemLastAccessed\" (\"item_id\", \"item_type\", \"last_accessed\") VALUES ($1, $2, NOW())\n RETURNING \"last_accessed\" as last_accessed\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "last_accessed",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "071509888a88fa74d75735ba87cb18f03e0b441d1263f9cbf0899d9e386e6e03"
-}
diff --git a/.sqlx/query-071aa384be7a68b05d05a735a85972ac5868ce6b06dcf867c58f5aa5b7c457a2.json b/.sqlx/query-071aa384be7a68b05d05a735a85972ac5868ce6b06dcf867c58f5aa5b7c457a2.json
deleted file mode 100644
index 996972bffc..0000000000
--- a/.sqlx/query-071aa384be7a68b05d05a735a85972ac5868ce6b06dcf867c58f5aa5b7c457a2.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team (id, name, owner_id)\n VALUES\n ('dddddddd-dddd-dddd-dddd-000000000001', 'Chat owner team', 'user-1'),\n ('dddddddd-dddd-dddd-dddd-000000000002', 'Other team', 'user-2')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "071aa384be7a68b05d05a735a85972ac5868ce6b06dcf867c58f5aa5b7c457a2"
-}
diff --git a/.sqlx/query-0768e44184d2a54457e500d992b1ec9e89290590ce42eab4f5123c9060de917b.json b/.sqlx/query-0768e44184d2a54457e500d992b1ec9e89290590ce42eab4f5123c9060de917b.json
deleted file mode 100644
index 23edf2157e..0000000000
--- a/.sqlx/query-0768e44184d2a54457e500d992b1ec9e89290590ce42eab4f5123c9060de917b.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT status, attempt_count FROM webhook_delivery WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "attempt_count",
- "type_info": "Int4"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "0768e44184d2a54457e500d992b1ec9e89290590ce42eab4f5123c9060de917b"
-}
diff --git a/.sqlx/query-07bd38eeebbfbe491683e8847603e5db8ea18a4a31bf629cb5815468978966df.json b/.sqlx/query-07bd38eeebbfbe491683e8847603e5db8ea18a4a31bf629cb5815468978966df.json
deleted file mode 100644
index d7400e9730..0000000000
--- a/.sqlx/query-07bd38eeebbfbe491683e8847603e5db8ea18a4a31bf629cb5815468978966df.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT to_jsonb(pr) AS \"snapshot!: serde_json::Value\"\n FROM github_pull_request pr ORDER BY github_key",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "snapshot!: serde_json::Value",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "07bd38eeebbfbe491683e8847603e5db8ea18a4a31bf629cb5815468978966df"
-}
diff --git a/.sqlx/query-08099d03d67a7546f8b64bd35a9d33a328cd502da43df681d0f875017f4454b3.json b/.sqlx/query-08099d03d67a7546f8b64bd35a9d33a328cd502da43df681d0f875017f4454b3.json
deleted file mode 100644
index 3fe4afca99..0000000000
--- a/.sqlx/query-08099d03d67a7546f8b64bd35a9d33a328cd502da43df681d0f875017f4454b3.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM team_user WHERE user_id = 'macro|[email protected]'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "08099d03d67a7546f8b64bd35a9d33a328cd502da43df681d0f875017f4454b3"
-}
diff --git a/.sqlx/query-0847577b2a01482adb9ee7766aeee698483be5c7f7acd8906f1fcb601ebfd848.json b/.sqlx/query-0847577b2a01482adb9ee7766aeee698483be5c7f7acd8906f1fcb601ebfd848.json
deleted file mode 100644
index 7ecd7886c1..0000000000
--- a/.sqlx/query-0847577b2a01482adb9ee7766aeee698483be5c7f7acd8906f1fcb601ebfd848.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM comms_activity",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "0847577b2a01482adb9ee7766aeee698483be5c7f7acd8906f1fcb601ebfd848"
-}
diff --git a/.sqlx/query-08b109922b70a7958250245d2878ae372d8f84a1470c5eab6d1e20b08f2043ea.json b/.sqlx/query-08b109922b70a7958250245d2878ae372d8f84a1470c5eab6d1e20b08f2043ea.json
deleted file mode 100644
index 5c6752949a..0000000000
--- a/.sqlx/query-08b109922b70a7958250245d2878ae372d8f84a1470c5eab6d1e20b08f2043ea.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_threads SET latest_inbound_message_ts = NULL, inbox_visible = false WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "08b109922b70a7958250245d2878ae372d8f84a1470c5eab6d1e20b08f2043ea"
-}
diff --git a/.sqlx/query-0935d6e6df07b7a7b05f9d284dc5c780ece714f7357c7e5d8430b298f7fd2ed8.json b/.sqlx/query-0935d6e6df07b7a7b05f9d284dc5c780ece714f7357c7e5d8430b298f7fd2ed8.json
deleted file mode 100644
index b43d5fde9d..0000000000
--- a/.sqlx/query-0935d6e6df07b7a7b05f9d284dc5c780ece714f7357c7e5d8430b298f7fd2ed8.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channel_participants (channel_id, role, user_id)\n VALUES ($1, 'member', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "0935d6e6df07b7a7b05f9d284dc5c780ece714f7357c7e5d8430b298f7fd2ed8"
-}
diff --git a/.sqlx/query-0942cc627f9a1efe46c01de642b422f58d7368eed6d671887e2d65bb29858cd1.json b/.sqlx/query-0942cc627f9a1efe46c01de642b422f58d7368eed6d671887e2d65bb29858cd1.json
deleted file mode 100644
index 7ec56065e1..0000000000
--- a/.sqlx/query-0942cc627f9a1efe46c01de642b422f58d7368eed6d671887e2d65bb29858cd1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT root_id FROM \"PdfPlaceableCommentAnchor\" WHERE uuid = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "root_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "0942cc627f9a1efe46c01de642b422f58d7368eed6d671887e2d65bb29858cd1"
-}
diff --git a/.sqlx/query-0953c73b72345668f2cfb7fbe14339fc4f48e11fae0349c0b60ffc477af81e65.json b/.sqlx/query-0953c73b72345668f2cfb7fbe14339fc4f48e11fae0349c0b60ffc477af81e65.json
deleted file mode 100644
index 6e37534ca9..0000000000
--- a/.sqlx/query-0953c73b72345668f2cfb7fbe14339fc4f48e11fae0349c0b60ffc477af81e65.json
+++ /dev/null
@@ -1,178 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n id, name, owner_id, thread_id, originating_message_id, bot_id,\n model, harness, repo_url, repo_branch, pull_request_url, workspace, sandbox_size, instructions,\n mcp_scope, mcp_servers, acp_session_id, status,\n status_event_name, agent_session.created_at, modified_at,\n (SELECT jsonb_build_object('type', parent_entity_type, 'id', parent_entity_id)\n FROM comms_messages WHERE id = agent_session.thread_id)\n AS \"thread_parent?: Json<MessageParent>\",\n ext.provider AS \"external_provider?\", ext.external_id AS \"external_id?\",\n ext.external_name AS \"external_name?\", ext.external_url AS \"external_url?\",\n ext.last_run_id AS \"external_last_run_id?\"\n FROM agent_session\n LEFT JOIN external_agent_session AS ext ON ext.agent_session_id = agent_session.id\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "thread_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "originating_message_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "bot_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 6,
- "name": "model",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "harness",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "repo_url",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "repo_branch",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "pull_request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 11,
- "name": "workspace",
- "type_info": "Text"
- },
- {
- "ordinal": 12,
- "name": "sandbox_size",
- "type_info": "Text"
- },
- {
- "ordinal": 13,
- "name": "instructions",
- "type_info": "Text"
- },
- {
- "ordinal": 14,
- "name": "mcp_scope",
- "type_info": "Text"
- },
- {
- "ordinal": 15,
- "name": "mcp_servers",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 16,
- "name": "acp_session_id",
- "type_info": "Text"
- },
- {
- "ordinal": 17,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 18,
- "name": "status_event_name",
- "type_info": "Text"
- },
- {
- "ordinal": 19,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 20,
- "name": "modified_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 21,
- "name": "thread_parent?: Json<MessageParent>",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 22,
- "name": "external_provider?",
- "type_info": "Text"
- },
- {
- "ordinal": 23,
- "name": "external_id?",
- "type_info": "Text"
- },
- {
- "ordinal": 24,
- "name": "external_name?",
- "type_info": "Text"
- },
- {
- "ordinal": 25,
- "name": "external_url?",
- "type_info": "Text"
- },
- {
- "ordinal": 26,
- "name": "external_last_run_id?",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- true,
- false,
- true,
- false,
- false,
- null,
- false,
- false,
- true,
- true,
- true
- ]
- },
- "hash": "0953c73b72345668f2cfb7fbe14339fc4f48e11fae0349c0b60ffc477af81e65"
-}
diff --git a/.sqlx/query-097d81df581fceedb035d0b862ba2b46e9c701aa52d0cd285164bdc4d9b65a83.json b/.sqlx/query-097d81df581fceedb035d0b862ba2b46e9c701aa52d0cd285164bdc4d9b65a83.json
deleted file mode 100644
index dae2641b7d..0000000000
--- a/.sqlx/query-097d81df581fceedb035d0b862ba2b46e9c701aa52d0cd285164bdc4d9b65a83.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT billed_users AS \"billed_users!\",\n included_cents_by_user AS \"included_cents_by_user!\",\n included_cost_cents_by_user,\n updated_at\n FROM ai_billing_period_allowance\n WHERE user_id = $1 AND period_start = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "billed_users!",
- "type_info": "TextArray"
- },
- {
- "ordinal": 1,
- "name": "included_cents_by_user!",
- "type_info": "Int8Array"
- },
- {
- "ordinal": 2,
- "name": "included_cost_cents_by_user",
- "type_info": "Int8Array"
- },
- {
- "ordinal": 3,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": [
- false,
- false,
- true,
- false
- ]
- },
- "hash": "097d81df581fceedb035d0b862ba2b46e9c701aa52d0cd285164bdc4d9b65a83"
-}
diff --git a/.sqlx/query-0a6865a4f9a071baf88abf99f5a195bc34e24111a768b2a913ba5bcdebc801e5.json b/.sqlx/query-0a6865a4f9a071baf88abf99f5a195bc34e24111a768b2a913ba5bcdebc801e5.json
deleted file mode 100644
index 1589645cbe..0000000000
--- a/.sqlx/query-0a6865a4f9a071baf88abf99f5a195bc34e24111a768b2a913ba5bcdebc801e5.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduling_public_budget SET window_start = now() - interval '2 hours' WHERE profile_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "0a6865a4f9a071baf88abf99f5a195bc34e24111a768b2a913ba5bcdebc801e5"
-}
diff --git a/.sqlx/query-0ab18665acc9da09f15d847bba3342df7b5d550efbaba767323e294e1f6ab2d2.json b/.sqlx/query-0ab18665acc9da09f15d847bba3342df7b5d550efbaba767323e294e1f6ab2d2.json
deleted file mode 100644
index f5b8216478..0000000000
--- a/.sqlx/query-0ab18665acc9da09f15d847bba3342df7b5d550efbaba767323e294e1f6ab2d2.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT kind, name, folder, member_ids, creator_id, source_created_at, archived, message_count\n FROM slack_import_conversation WHERE job_id = $1 AND slack_channel_id = 'C1'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "kind",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "folder",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "member_ids",
- "type_info": "TextArray"
- },
- {
- "ordinal": 4,
- "name": "creator_id",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "source_created_at",
- "type_info": "Int8"
- },
- {
- "ordinal": 6,
- "name": "archived",
- "type_info": "Bool"
- },
- {
- "ordinal": 7,
- "name": "message_count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- true,
- true,
- false,
- true
- ]
- },
- "hash": "0ab18665acc9da09f15d847bba3342df7b5d550efbaba767323e294e1f6ab2d2"
-}
diff --git a/.sqlx/query-0b4e3ffcf5e0d381e6cc59a796349af5e818ce569ce795e47a4c3b72fa612dc9.json b/.sqlx/query-0b4e3ffcf5e0d381e6cc59a796349af5e818ce569ce795e47a4c3b72fa612dc9.json
deleted file mode 100644
index c7ecd2baf9..0000000000
--- a/.sqlx/query-0b4e3ffcf5e0d381e6cc59a796349af5e818ce569ce795e47a4c3b72fa612dc9.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM property_definitions WHERE database_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "0b4e3ffcf5e0d381e6cc59a796349af5e818ce569ce795e47a4c3b72fa612dc9"
-}
diff --git a/.sqlx/query-0b7bcfe72aa7dc8e53033e457ade701bd6593c9cd48b501b32b568e0d738388d.json b/.sqlx/query-0b7bcfe72aa7dc8e53033e457ade701bd6593c9cd48b501b32b568e0d738388d.json
deleted file mode 100644
index 533a99f7de..0000000000
--- a/.sqlx/query-0b7bcfe72aa7dc8e53033e457ade701bd6593c9cd48b501b32b568e0d738388d.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT is_sent, is_draft, subject FROM email_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "is_sent",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "is_draft",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "subject",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- true
- ]
- },
- "hash": "0b7bcfe72aa7dc8e53033e457ade701bd6593c9cd48b501b32b568e0d738388d"
-}
diff --git a/.sqlx/query-0c6aeec780edc0e50bf637f6805553d971ff086b227cc80da1a122ef92120027.json b/.sqlx/query-0c6aeec780edc0e50bf637f6805553d971ff086b227cc80da1a122ef92120027.json
deleted file mode 100644
index 0ab0d60fa7..0000000000
--- a/.sqlx/query-0c6aeec780edc0e50bf637f6805553d971ff086b227cc80da1a122ef92120027.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_channels (id, name, channel_type, org_id, owner_id, created_at, updated_at)\n VALUES ($1, NULL, 'direct_message', NULL, $2, now(), now())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "0c6aeec780edc0e50bf637f6805553d971ff086b227cc80da1a122ef92120027"
-}
diff --git a/.sqlx/query-0c9e740da45c30942a9b4dd3806afb6031437c940e2f60cc4231f8707daa3399.json b/.sqlx/query-0c9e740da45c30942a9b4dd3806afb6031437c940e2f60cc4231f8707daa3399.json
deleted file mode 100644
index a0691aed52..0000000000
--- a/.sqlx/query-0c9e740da45c30942a9b4dd3806afb6031437c940e2f60cc4231f8707daa3399.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO bots (id, kind, owner_user_id, name, handle, has_agent)\n VALUES ($1, 'owned', $2, 'Bound agent', $3, true)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "0c9e740da45c30942a9b4dd3806afb6031437c940e2f60cc4231f8707daa3399"
-}
diff --git a/.sqlx/query-0cc3b33f09455637437947f04dec4e4ddbbd9fefc4ccf3e5877d8e4162da0b9e.json b/.sqlx/query-0cc3b33f09455637437947f04dec4e4ddbbd9fefc4ccf3e5877d8e4162da0b9e.json
deleted file mode 100644
index 77cced870e..0000000000
--- a/.sqlx/query-0cc3b33f09455637437947f04dec4e4ddbbd9fefc4ccf3e5877d8e4162da0b9e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id)\n SELECT $1, $1, id FROM macro_user WHERE email = $1 ON CONFLICT DO NOTHING",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "0cc3b33f09455637437947f04dec4e4ddbbd9fefc4ccf3e5877d8e4162da0b9e"
-}
diff --git a/.sqlx/query-0d0fd018b6a7f2f70289f795dca89d2e4d8774e97774f39f0e60fd98effe7f5b.json b/.sqlx/query-0d0fd018b6a7f2f70289f795dca89d2e4d8774e97774f39f0e60fd98effe7f5b.json
deleted file mode 100644
index 044ad25149..0000000000
--- a/.sqlx/query-0d0fd018b6a7f2f70289f795dca89d2e4d8774e97774f39f0e60fd98effe7f5b.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)\n VALUES ($1, $2, 'DOCUMENT', $3, $4)\n ON CONFLICT (entity_id, entity_type, property_definition_id)\n DO UPDATE SET values = $4\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "0d0fd018b6a7f2f70289f795dca89d2e4d8774e97774f39f0e60fd98effe7f5b"
-}
diff --git a/.sqlx/query-0d56be80252c95c2465f017b431a75bf7cf07b45d0c9ea98a774bf957a422c16.json b/.sqlx/query-0d56be80252c95c2465f017b431a75bf7cf07b45d0c9ea98a774bf957a422c16.json
deleted file mode 100644
index c88a219f0d..0000000000
--- a/.sqlx/query-0d56be80252c95c2465f017b431a75bf7cf07b45d0c9ea98a774bf957a422c16.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM database_tables WHERE database_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "0d56be80252c95c2465f017b431a75bf7cf07b45d0c9ea98a774bf957a422c16"
-}
diff --git a/.sqlx/query-0da6cde6a14eb8b5db324411399af2a5c2878ffd97f68e7551a81a5eda4864d6.json b/.sqlx/query-0da6cde6a14eb8b5db324411399af2a5c2878ffd97f68e7551a81a5eda4864d6.json
deleted file mode 100644
index 1dd91649a1..0000000000
--- a/.sqlx/query-0da6cde6a14eb8b5db324411399af2a5c2878ffd97f68e7551a81a5eda4864d6.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_queries (id, definition, created_by) VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Jsonb",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "0da6cde6a14eb8b5db324411399af2a5c2878ffd97f68e7551a81a5eda4864d6"
-}
diff --git a/.sqlx/query-0e77131ec7a8afa9f8e58dbe401234ae26915f7b7a401c1778534acaac3ca3a0.json b/.sqlx/query-0e77131ec7a8afa9f8e58dbe401234ae26915f7b7a401c1778534acaac3ca3a0.json
deleted file mode 100644
index 624d6ec1ed..0000000000
--- a/.sqlx/query-0e77131ec7a8afa9f8e58dbe401234ae26915f7b7a401c1778534acaac3ca3a0.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO scheduled_action (owner, name, schedule, kind, timezone, task, next_run_at, enabled)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n RETURNING id, trigger_type, configuration_revision, event_filters, event_activated_at\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "trigger_type",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "configuration_revision",
- "type_info": "Int8"
- },
- {
- "ordinal": 3,
- "name": "event_filters",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 4,
- "name": "event_activated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Jsonb",
- "Timestamptz",
- "Bool"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true
- ]
- },
- "hash": "0e77131ec7a8afa9f8e58dbe401234ae26915f7b7a401c1778534acaac3ca3a0"
-}
diff --git a/.sqlx/query-0edfe62a94be7007bbfd5c636cb7835f2f16cb6643fc81b5abc019b1e1e8e5f1.json b/.sqlx/query-0edfe62a94be7007bbfd5c636cb7835f2f16cb6643fc81b5abc019b1e1e8e5f1.json
deleted file mode 100644
index 2065732abe..0000000000
--- a/.sqlx/query-0edfe62a94be7007bbfd5c636cb7835f2f16cb6643fc81b5abc019b1e1e8e5f1.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT (SELECT COUNT(*) FROM databases)\n + (SELECT COUNT(*) FROM database_entities)\n + (SELECT COUNT(*) FROM database_tables)\n + (SELECT COUNT(*) FROM database_columns)\n + (SELECT COUNT(*) FROM database_rows)\n + (SELECT COUNT(*) FROM database_views)\n + (SELECT COUNT(*) FROM database_view_positions)\n + (SELECT COUNT(*) FROM property_definitions WHERE database_id IS NOT NULL)\n + (SELECT COUNT(*) FROM entity_properties WHERE entity_type = 'DATABASE_ROW')\n + (SELECT COUNT(*) FROM entity_access WHERE entity_type = 'database')\n + (SELECT COUNT(*) FROM database_changes)\n + (SELECT COUNT(*) FROM database_change_rows)\n + (SELECT COUNT(*) FROM database_change_columns)\n + (SELECT COUNT(*) FROM database_queries)\n + (SELECT COUNT(*) FROM database_starter_seeds) AS \"count!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "0edfe62a94be7007bbfd5c636cb7835f2f16cb6643fc81b5abc019b1e1e8e5f1"
-}
diff --git a/.sqlx/query-0f9031fa93f6623c3121701b82477edf00672efe87149eb3d729afac70264cd8.json b/.sqlx/query-0f9031fa93f6623c3121701b82477edf00672efe87149eb3d729afac70264cd8.json
deleted file mode 100644
index 7f18076709..0000000000
--- a/.sqlx/query-0f9031fa93f6623c3121701b82477edf00672efe87149eb3d729afac70264cd8.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT email FROM notification_email_unsubscribe WHERE email = 'new'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "email",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "0f9031fa93f6623c3121701b82477edf00672efe87149eb3d729afac70264cd8"
-}
diff --git a/.sqlx/query-0f96c44538cedde6542afa59428aa308b0b816f29de728ef1aadf8c0a13ec791.json b/.sqlx/query-0f96c44538cedde6542afa59428aa308b0b816f29de728ef1aadf8c0a13ec791.json
deleted file mode 100644
index 4ad255b8be..0000000000
--- a/.sqlx/query-0f96c44538cedde6542afa59428aa308b0b816f29de728ef1aadf8c0a13ec791.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT auto_join_team FROM comms_channels WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "auto_join_team",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "0f96c44538cedde6542afa59428aa308b0b816f29de728ef1aadf8c0a13ec791"
-}
diff --git a/.sqlx/query-0fa7ef02b9a876d94d603c2ec97afd1e65f3e12669b2a403dc6ea6735fd96804.json b/.sqlx/query-0fa7ef02b9a876d94d603c2ec97afd1e65f3e12669b2a403dc6ea6735fd96804.json
deleted file mode 100644
index 71fa7ffe3f..0000000000
--- a/.sqlx/query-0fa7ef02b9a876d94d603c2ec97afd1e65f3e12669b2a403dc6ea6735fd96804.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT paying\n FROM team\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "paying",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "0fa7ef02b9a876d94d603c2ec97afd1e65f3e12669b2a403dc6ea6735fd96804"
-}
diff --git a/.sqlx/query-101a22ec0b29754f6e6e8fd86839b8fbf668639ba6ae3b11a9c606041e724a4d.json b/.sqlx/query-101a22ec0b29754f6e6e8fd86839b8fbf668639ba6ae3b11a9c606041e724a4d.json
deleted file mode 100644
index 8178e842ec..0000000000
--- a/.sqlx/query-101a22ec0b29754f6e6e8fd86839b8fbf668639ba6ae3b11a9c606041e724a4d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE webhook_delivery\n SET next_attempt_at = now() - INTERVAL '1 second'\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "101a22ec0b29754f6e6e8fd86839b8fbf668639ba6ae3b11a9c606041e724a4d"
-}
diff --git a/.sqlx/query-102699bbba66483ee8462091dfb444ecf60ef7e55c674379b17d0d0b22b52b6e.json b/.sqlx/query-102699bbba66483ee8462091dfb444ecf60ef7e55c674379b17d0d0b22b52b6e.json
deleted file mode 100644
index 0443c93750..0000000000
--- a/.sqlx/query-102699bbba66483ee8462091dfb444ecf60ef7e55c674379b17d0d0b22b52b6e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET role = 'admin', left_at = $2 WHERE channel_id = $1 AND user_id = 'macro|[email protected]'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "102699bbba66483ee8462091dfb444ecf60ef7e55c674379b17d0d0b22b52b6e"
-}
diff --git a/.sqlx/query-10c975ec9d47e99c1b6416719688e500f90ac0af1a95e50abb44b781f329f859.json b/.sqlx/query-10c975ec9d47e99c1b6416719688e500f90ac0af1a95e50abb44b781f329f859.json
deleted file mode 100644
index 71f8d909c5..0000000000
--- a/.sqlx/query-10c975ec9d47e99c1b6416719688e500f90ac0af1a95e50abb44b781f329f859.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_message_threads SET deleted_at = NOW() WHERE root_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "10c975ec9d47e99c1b6416719688e500f90ac0af1a95e50abb44b781f329f859"
-}
diff --git a/.sqlx/query-11a31808dde20094b5ed57bc76171b6c30fba0f2f439c761c9507e768c3eb35c.json b/.sqlx/query-11a31808dde20094b5ed57bc76171b6c30fba0f2f439c761c9507e768c3eb35c.json
deleted file mode 100644
index c15c9cbc25..0000000000
--- a/.sqlx/query-11a31808dde20094b5ed57bc76171b6c30fba0f2f439c761c9507e768c3eb35c.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM database_rows WHERE table_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "11a31808dde20094b5ed57bc76171b6c30fba0f2f439c761c9507e768c3eb35c"
-}
diff --git a/.sqlx/query-11d1a56900bb3e1aaf82dd15e5d3fb81aa1cdf392ad3dd87b1815a9dc4fe50ca.json b/.sqlx/query-11d1a56900bb3e1aaf82dd15e5d3fb81aa1cdf392ad3dd87b1815a9dc4fe50ca.json
deleted file mode 100644
index c8c8dad293..0000000000
--- a/.sqlx/query-11d1a56900bb3e1aaf82dd15e5d3fb81aa1cdf392ad3dd87b1815a9dc4fe50ca.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT team_id, email FROM team_joined_macro_email",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "team_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "email",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "11d1a56900bb3e1aaf82dd15e5d3fb81aa1cdf392ad3dd87b1815a9dc4fe50ca"
-}
diff --git a/.sqlx/query-11e1b4a0bedea73283a010c9b5d7ce31b46818b73a7a479d13e28d1d82bbe7cd.json b/.sqlx/query-11e1b4a0bedea73283a010c9b5d7ce31b46818b73a7a479d13e28d1d82bbe7cd.json
deleted file mode 100644
index 24a941845d..0000000000
--- a/.sqlx/query-11e1b4a0bedea73283a010c9b5d7ce31b46818b73a7a479d13e28d1d82bbe7cd.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_messages SET has_attachments = true WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "11e1b4a0bedea73283a010c9b5d7ce31b46818b73a7a479d13e28d1d82bbe7cd"
-}
diff --git a/.sqlx/query-11eac3a887fa3990adcebdef936eb7ab02937cf53e6003ec8000e86aeae52e68.json b/.sqlx/query-11eac3a887fa3990adcebdef936eb7ab02937cf53e6003ec8000e86aeae52e68.json
deleted file mode 100644
index ec147e42e9..0000000000
--- a/.sqlx/query-11eac3a887fa3990adcebdef936eb7ab02937cf53e6003ec8000e86aeae52e68.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team (id, name, owner_id)\n VALUES ($1, $2, $3)\n ON CONFLICT (id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "11eac3a887fa3990adcebdef936eb7ab02937cf53e6003ec8000e86aeae52e68"
-}
diff --git a/.sqlx/query-124cfaa56419d20a5b1985e937f620835e76bdb737fa882caffba72b4ce52909.json b/.sqlx/query-124cfaa56419d20a5b1985e937f620835e76bdb737fa882caffba72b4ce52909.json
deleted file mode 100644
index 9d4a2ea0b2..0000000000
--- a/.sqlx/query-124cfaa56419d20a5b1985e937f620835e76bdb737fa882caffba72b4ce52909.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM entity_access WHERE entity_id = $1 AND entity_type = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "124cfaa56419d20a5b1985e937f620835e76bdb737fa882caffba72b4ce52909"
-}
diff --git a/.sqlx/query-12f64bb05648a7305e5bdf0f23f07cd0e52e7b39b61d4b6d6dbcf055cff69cde.json b/.sqlx/query-12f64bb05648a7305e5bdf0f23f07cd0e52e7b39b61d4b6d6dbcf055cff69cde.json
deleted file mode 100644
index 9e44979279..0000000000
--- a/.sqlx/query-12f64bb05648a7305e5bdf0f23f07cd0e52e7b39b61d4b6d6dbcf055cff69cde.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO harnesses (id, name, owner_user_id, created_by)\n VALUES ($1, 'theirs', $2, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "12f64bb05648a7305e5bdf0f23f07cd0e52e7b39b61d4b6d6dbcf055cff69cde"
-}
diff --git a/.sqlx/query-12f6f67c28024527342db6f87e5b9de6e16cd65729fb18c5713f281ff39f56c4.json b/.sqlx/query-12f6f67c28024527342db6f87e5b9de6e16cd65729fb18c5713f281ff39f56c4.json
deleted file mode 100644
index 04cf548b0e..0000000000
--- a/.sqlx/query-12f6f67c28024527342db6f87e5b9de6e16cd65729fb18c5713f281ff39f56c4.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Project\" (\"id\", \"name\", \"userId\") VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "12f6f67c28024527342db6f87e5b9de6e16cd65729fb18c5713f281ff39f56c4"
-}
diff --git a/.sqlx/query-148ee5761f03d50f605eb76cb23f8ff83b338b73bd69685deab2034d4d21104a.json b/.sqlx/query-148ee5761f03d50f605eb76cb23f8ff83b338b73bd69685deab2034d4d21104a.json
deleted file mode 100644
index 9b4f0dda8f..0000000000
--- a/.sqlx/query-148ee5761f03d50f605eb76cb23f8ff83b338b73bd69685deab2034d4d21104a.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id, count_usage FROM ai_usage ORDER BY id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "count_usage",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "148ee5761f03d50f605eb76cb23f8ff83b338b73bd69685deab2034d4d21104a"
-}
diff --git a/.sqlx/query-14a2188cb52a1529c3593351f08c82f5d13acb89ded253aefa3f759f184d87f3.json b/.sqlx/query-14a2188cb52a1529c3593351f08c82f5d13acb89ded253aefa3f759f184d87f3.json
deleted file mode 100644
index 1792f99b65..0000000000
--- a/.sqlx/query-14a2188cb52a1529c3593351f08c82f5d13acb89ded253aefa3f759f184d87f3.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT COUNT(*) FROM \"Project\" WHERE \"uploadRequestId\" = 'lambda-request-id')\n AS \"upload_projects!\",\n (SELECT COUNT(*) FROM \"Document\" WHERE owner = $1) AS \"documents!\",\n (SELECT COUNT(*) FROM entity WHERE owner_id = $1) AS \"entities!\",\n (SELECT COUNT(*) FROM entity_access WHERE source_id = $1) AS \"grants!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "upload_projects!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "documents!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "entities!",
- "type_info": "Int8"
- },
- {
- "ordinal": 3,
- "name": "grants!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null,
- null,
- null,
- null
- ]
- },
- "hash": "14a2188cb52a1529c3593351f08c82f5d13acb89ded253aefa3f759f184d87f3"
-}
diff --git a/.sqlx/query-14d172fd70252bfe96ce970424b2cfbc14f3dbb80285c4748573952f69c81184.json b/.sqlx/query-14d172fd70252bfe96ce970424b2cfbc14f3dbb80285c4748573952f69c81184.json
deleted file mode 100644
index 31a51b1c37..0000000000
--- a/.sqlx/query-14d172fd70252bfe96ce970424b2cfbc14f3dbb80285c4748573952f69c81184.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT completed_at IS NULL AS \"pending!\" FROM slack_import_message_reference",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pending!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "14d172fd70252bfe96ce970424b2cfbc14f3dbb80285c4748573952f69c81184"
-}
diff --git a/.sqlx/query-15871789e389c9d408aaf5e1ad03cb47e91dfd0e0bedaa24f3d5a2fbaa88d623.json b/.sqlx/query-15871789e389c9d408aaf5e1ad03cb47e91dfd0e0bedaa24f3d5a2fbaa88d623.json
deleted file mode 100644
index 11c8ce643f..0000000000
--- a/.sqlx/query-15871789e389c9d408aaf5e1ad03cb47e91dfd0e0bedaa24f3d5a2fbaa88d623.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM team_joined_macro_email",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "15871789e389c9d408aaf5e1ad03cb47e91dfd0e0bedaa24f3d5a2fbaa88d623"
-}
diff --git a/.sqlx/query-15e02b53db3701c3b5ccf21336a9a67f5477ec629e173e58c67ea58219048c06.json b/.sqlx/query-15e02b53db3701c3b5ccf21336a9a67f5477ec629e173e58c67ea58219048c06.json
deleted file mode 100644
index 850cc4de9b..0000000000
--- a/.sqlx/query-15e02b53db3701c3b5ccf21336a9a67f5477ec629e173e58c67ea58219048c06.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session SET list_hidden = TRUE WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "15e02b53db3701c3b5ccf21336a9a67f5477ec629e173e58c67ea58219048c06"
-}
diff --git a/.sqlx/query-16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644.json b/.sqlx/query-16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644.json
deleted file mode 100644
index 03b1b3fb24..0000000000
--- a/.sqlx/query-16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team_user (user_id, team_id, team_role) VALUES ($1, $2, 'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "16d72a752357648effb2327791a771b02d72dd71725f71a90b4e7f05d87f2644"
-}
diff --git a/.sqlx/query-176574836aa9379945d404f73e4ff0b5bdd4b5c4c28dc5fab0300ed4956f79a8.json b/.sqlx/query-176574836aa9379945d404f73e4ff0b5bdd4b5c4c28dc5fab0300ed4956f79a8.json
deleted file mode 100644
index 2092f62c93..0000000000
--- a/.sqlx/query-176574836aa9379945d404f73e4ff0b5bdd4b5c4c28dc5fab0300ed4956f79a8.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM database_columns WHERE table_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "176574836aa9379945d404f73e4ff0b5bdd4b5c4c28dc5fab0300ed4956f79a8"
-}
diff --git a/.sqlx/query-1806f429874e271fe817e54f60b6784f17845ef18ddce95bfc4154bfea8a941e.json b/.sqlx/query-1806f429874e271fe817e54f60b6784f17845ef18ddce95bfc4154bfea8a941e.json
deleted file mode 100644
index e1e6502426..0000000000
--- a/.sqlx/query-1806f429874e271fe817e54f60b6784f17845ef18ddce95bfc4154bfea8a941e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE user_notification SET deleted_at = NOW() WHERE user_id = $1 AND notification_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "1806f429874e271fe817e54f60b6784f17845ef18ddce95bfc4154bfea8a941e"
-}
diff --git a/.sqlx/query-18550ce144d61e0c7b74342212f687d463723d2de3f525739a509b0644197e8b.json b/.sqlx/query-18550ce144d61e0c7b74342212f687d463723d2de3f525739a509b0644197e8b.json
deleted file mode 100644
index 47e578bf77..0000000000
--- a/.sqlx/query-18550ce144d61e0c7b74342212f687d463723d2de3f525739a509b0644197e8b.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT m.id, m.parent_entity_type, m.parent_entity_id, a.entity_id\n FROM comms_messages m JOIN comms_attachments a ON a.message_id = m.id\n WHERE m.id = ANY($1) ORDER BY m.created_at",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "parent_entity_type",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "parent_entity_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "entity_id",
- "type_info": "Varchar"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false
- ]
- },
- "hash": "18550ce144d61e0c7b74342212f687d463723d2de3f525739a509b0644197e8b"
-}
diff --git a/.sqlx/query-18bf1cc68f468b81306d322aa12b9a7e748da35c8fbebd5ea9a0d6aa0052f0fd.json b/.sqlx/query-18bf1cc68f468b81306d322aa12b9a7e748da35c8fbebd5ea9a0d6aa0052f0fd.json
deleted file mode 100644
index 784518a50e..0000000000
--- a/.sqlx/query-18bf1cc68f468b81306d322aa12b9a7e748da35c8fbebd5ea9a0d6aa0052f0fd.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT count(*) FROM notification) AS \"notifications!\",\n (SELECT count(*) FROM user_notification) AS \"user_notifications!\",\n (SELECT count(*) FROM notification_email_sent) AS \"emails!\",\n (SELECT count(*) FROM channel_notification_email_sent) AS \"channel_emails!\",\n (SELECT count(*) FROM comms_activity) AS \"channel_activity!\",\n (SELECT count(*) FROM activity_events) AS \"activity_events!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "notifications!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "user_notifications!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "emails!",
- "type_info": "Int8"
- },
- {
- "ordinal": 3,
- "name": "channel_emails!",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "channel_activity!",
- "type_info": "Int8"
- },
- {
- "ordinal": 5,
- "name": "activity_events!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null,
- null,
- null,
- null,
- null,
- null
- ]
- },
- "hash": "18bf1cc68f468b81306d322aa12b9a7e748da35c8fbebd5ea9a0d6aa0052f0fd"
-}
diff --git a/.sqlx/query-18cb827b8feab289580e69c2ebc84c422a08bf5378f24eca1fe9d870784c826a.json b/.sqlx/query-18cb827b8feab289580e69c2ebc84c422a08bf5378f24eca1fe9d870784c826a.json
deleted file mode 100644
index 7521d9b3c5..0000000000
--- a/.sqlx/query-18cb827b8feab289580e69c2ebc84c422a08bf5378f24eca1fe9d870784c826a.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE entity_properties SET property_definition_id = $1 WHERE entity_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "18cb827b8feab289580e69c2ebc84c422a08bf5378f24eca1fe9d870784c826a"
-}
diff --git a/.sqlx/query-1974e68bb4636b3e7a50667a8ee06ce1bb2c5deed374ebd9b15fa4feb7e18b5e.json b/.sqlx/query-1974e68bb4636b3e7a50667a8ee06ce1bb2c5deed374ebd9b15fa4feb7e18b5e.json
deleted file mode 100644
index 624fe0498b..0000000000
--- a/.sqlx/query-1974e68bb4636b3e7a50667a8ee06ce1bb2c5deed374ebd9b15fa4feb7e18b5e.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT inbox_visible, latest_inbound_message_ts, reminder_returned_at FROM email_threads WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "inbox_visible",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "latest_inbound_message_ts",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "reminder_returned_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- true
- ]
- },
- "hash": "1974e68bb4636b3e7a50667a8ee06ce1bb2c5deed374ebd9b15fa4feb7e18b5e"
-}
diff --git a/.sqlx/query-19992234afc65ab0fee6e03978bdaccdac10436fad87e1b6b37ec348f64a94dd.json b/.sqlx/query-19992234afc65ab0fee6e03978bdaccdac10436fad87e1b6b37ec348f64a94dd.json
deleted file mode 100644
index 4a62f1f9ac..0000000000
--- a/.sqlx/query-19992234afc65ab0fee6e03978bdaccdac10436fad87e1b6b37ec348f64a94dd.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, user_id, device_token, device_endpoint, device_type as \"device_type:DeviceType\" \n FROM notification_user_device_registration \n WHERE id = '017d85a8-c7c6-7c40-b4f3-a6c1b3c0d1e4'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "device_token",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "device_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "device_type:DeviceType",
- "type_info": {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android",
- "iosvoip"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "19992234afc65ab0fee6e03978bdaccdac10436fad87e1b6b37ec348f64a94dd"
-}
diff --git a/.sqlx/query-1a4898ee2e492a703cc54762b4ae15d88ffc309fcdb9764c3685a9d50a42ef26.json b/.sqlx/query-1a4898ee2e492a703cc54762b4ae15d88ffc309fcdb9764c3685a9d50a42ef26.json
deleted file mode 100644
index 2de4775d28..0000000000
--- a/.sqlx/query-1a4898ee2e492a703cc54762b4ae15d88ffc309fcdb9764c3685a9d50a42ef26.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_messages SET body_html_sanitized = '<p>Hello</p>', body_text = 'Hello' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "1a4898ee2e492a703cc54762b4ae15d88ffc309fcdb9764c3685a9d50a42ef26"
-}
diff --git a/.sqlx/query-1ace84dbc2133ca52b88a247f96babb8b79a15c91403762d37651d2b0053fa25.json b/.sqlx/query-1ace84dbc2133ca52b88a247f96babb8b79a15c91403762d37651d2b0053fa25.json
deleted file mode 100644
index e1c160f0b1..0000000000
--- a/.sqlx/query-1ace84dbc2133ca52b88a247f96babb8b79a15c91403762d37651d2b0053fa25.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO user_notification (user_id, notification_id, created_at, sent, state) SELECT $1, id, created_at, TRUE, 'unseen' FROM notification WHERE id = ANY($2::uuid[])",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "1ace84dbc2133ca52b88a247f96babb8b79a15c91403762d37651d2b0053fa25"
-}
diff --git a/.sqlx/query-1b472b0b475a351d505afae3b2278bdc121db0b7795e7396d26f0ceaaafc21c3.json b/.sqlx/query-1b472b0b475a351d505afae3b2278bdc121db0b7795e7396d26f0ceaaafc21c3.json
deleted file mode 100644
index b6308e341f..0000000000
--- a/.sqlx/query-1b472b0b475a351d505afae3b2278bdc121db0b7795e7396d26f0ceaaafc21c3.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT attempt_count, first_attempt_at, last_attempt_at, next_attempt_at\n FROM webhook_delivery\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "attempt_count",
- "type_info": "Int4"
- },
- {
- "ordinal": 1,
- "name": "first_attempt_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "last_attempt_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "next_attempt_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true,
- true,
- true
- ]
- },
- "hash": "1b472b0b475a351d505afae3b2278bdc121db0b7795e7396d26f0ceaaafc21c3"
-}
diff --git a/.sqlx/query-1c9f7e8a6e0c50dee802223e3df95237dc608c33310d2d17048b340604cb602d.json b/.sqlx/query-1c9f7e8a6e0c50dee802223e3df95237dc608c33310d2d17048b340604cb602d.json
deleted file mode 100644
index 341f61daa9..0000000000
--- a/.sqlx/query-1c9f7e8a6e0c50dee802223e3df95237dc608c33310d2d17048b340604cb602d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id)\n SELECT $1, $1, id FROM macro_user WHERE email = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "1c9f7e8a6e0c50dee802223e3df95237dc608c33310d2d17048b340604cb602d"
-}
diff --git a/.sqlx/query-1d6d04c5ff95a450655ddc74eed981b9b17be88b41ea7ea3ca7e84eb1c427981.json b/.sqlx/query-1d6d04c5ff95a450655ddc74eed981b9b17be88b41ea7ea3ca7e84eb1c427981.json
deleted file mode 100644
index 1085566c8c..0000000000
--- a/.sqlx/query-1d6d04c5ff95a450655ddc74eed981b9b17be88b41ea7ea3ca7e84eb1c427981.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_contacts (id, company_id, email, first_interaction, last_interaction)\n VALUES ($1, $2, $3, now(), now())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "1d6d04c5ff95a450655ddc74eed981b9b17be88b41ea7ea3ca7e84eb1c427981"
-}
diff --git a/.sqlx/query-1d75e5cc7de8c554b277b0929a5c3d4972c32475dee65dfa2a19b1cb83a0525a.json b/.sqlx/query-1d75e5cc7de8c554b277b0929a5c3d4972c32475dee65dfa2a19b1cb83a0525a.json
deleted file mode 100644
index cad1a7aacf..0000000000
--- a/.sqlx/query-1d75e5cc7de8c554b277b0929a5c3d4972c32475dee65dfa2a19b1cb83a0525a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Chat\" (id, \"userId\", name) VALUES ($1, 'macro|[email protected]', 'Private chat')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "1d75e5cc7de8c554b277b0929a5c3d4972c32475dee65dfa2a19b1cb83a0525a"
-}
diff --git a/.sqlx/query-1d787282a8b72ed682cc1d3b9a050fdafa95343c0d778f7b198d84a8d428562b.json b/.sqlx/query-1d787282a8b72ed682cc1d3b9a050fdafa95343c0d778f7b198d84a8d428562b.json
deleted file mode 100644
index 51b763ac38..0000000000
--- a/.sqlx/query-1d787282a8b72ed682cc1d3b9a050fdafa95343c0d778f7b198d84a8d428562b.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT COALESCE(-SUM(delta_cents), 0)::bigint AS \"consumed!\"\n FROM ai_credit_ledger\n WHERE user_id = $1 AND kind = 'consumption' AND period_start = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "consumed!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "1d787282a8b72ed682cc1d3b9a050fdafa95343c0d778f7b198d84a8d428562b"
-}
diff --git a/.sqlx/query-1d7f66dcafd017e02ab21025309ebbf918209c857b1ff7621832ddb7ca33b382.json b/.sqlx/query-1d7f66dcafd017e02ab21025309ebbf918209c857b1ff7621832ddb7ca33b382.json
deleted file mode 100644
index fd8d14cf4e..0000000000
--- a/.sqlx/query-1d7f66dcafd017e02ab21025309ebbf918209c857b1ff7621832ddb7ca33b382.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_settings SET signature = '<p>Changed</p>' WHERE link_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "1d7f66dcafd017e02ab21025309ebbf918209c857b1ff7621832ddb7ca33b382"
-}
diff --git a/.sqlx/query-1daa88e349f8067e35be783a31260caad8711fe6793f600a90599f9f84a783b1.json b/.sqlx/query-1daa88e349f8067e35be783a31260caad8711fe6793f600a90599f9f84a783b1.json
deleted file mode 100644
index ee321949b6..0000000000
--- a/.sqlx/query-1daa88e349f8067e35be783a31260caad8711fe6793f600a90599f9f84a783b1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT COUNT(*) as \"persisted_count!\"\n FROM foreign_entity\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "persisted_count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "1daa88e349f8067e35be783a31260caad8711fe6793f600a90599f9f84a783b1"
-}
diff --git a/.sqlx/query-1dea6532f3f64c99533def46ddacaa205778636c2842d5213d81472b58eacfc5.json b/.sqlx/query-1dea6532f3f64c99533def46ddacaa205778636c2842d5213d81472b58eacfc5.json
deleted file mode 100644
index a1fdec7d32..0000000000
--- a/.sqlx/query-1dea6532f3f64c99533def46ddacaa205778636c2842d5213d81472b58eacfc5.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO property_options (id, property_definition_id, display_order, string_value, number_value)\n VALUES ($1, $2, 0, $3, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Float8"
- ]
- },
- "nullable": []
- },
- "hash": "1dea6532f3f64c99533def46ddacaa205778636c2842d5213d81472b58eacfc5"
-}
diff --git a/.sqlx/query-1e28520f3ddf16587848a6a543f5111c3f2588464f0ab2e0c7227fd990e67b40.json b/.sqlx/query-1e28520f3ddf16587848a6a543f5111c3f2588464f0ab2e0c7227fd990e67b40.json
deleted file mode 100644
index 7d1447f63f..0000000000
--- a/.sqlx/query-1e28520f3ddf16587848a6a543f5111c3f2588464f0ab2e0c7227fd990e67b40.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT send_time, sent FROM email_scheduled_messages WHERE message_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "send_time",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 1,
- "name": "sent",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "1e28520f3ddf16587848a6a543f5111c3f2588464f0ab2e0c7227fd990e67b40"
-}
diff --git a/.sqlx/query-1ea50d508684a2f5dd1a8fe8c5de55570a8e93fba8df89ffab096be14ff21210.json b/.sqlx/query-1ea50d508684a2f5dd1a8fe8c5de55570a8e93fba8df89ffab096be14ff21210.json
new file mode 100644
index 0000000000..b5d6c27781
--- /dev/null
+++ b/.sqlx/query-1ea50d508684a2f5dd1a8fe8c5de55570a8e93fba8df89ffab096be14ff21210.json
@@ -0,0 +1,16 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n INSERT INTO ai_credit_reload (id, user_id, amount_cents, status)\n VALUES ($1, $2, $3, 'pending')\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text",
+ "Int8"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "1ea50d508684a2f5dd1a8fe8c5de55570a8e93fba8df89ffab096be14ff21210"
+}
diff --git a/.sqlx/query-1f6ed68aaa85344fb41877eed44c812033c50618fdbf219db80a117728d55577.json b/.sqlx/query-1f6ed68aaa85344fb41877eed44c812033c50618fdbf219db80a117728d55577.json
deleted file mode 100644
index e1752b3d8d..0000000000
--- a/.sqlx/query-1f6ed68aaa85344fb41877eed44c812033c50618fdbf219db80a117728d55577.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE harness_replica SET last_heartbeat_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "1f6ed68aaa85344fb41877eed44c812033c50618fdbf219db80a117728d55577"
-}
diff --git a/.sqlx/query-2036fd34035088aeafb99858f8b016fac6f818f326e4d0c148842ff711178f1c.json b/.sqlx/query-2036fd34035088aeafb99858f8b016fac6f818f326e4d0c148842ff711178f1c.json
deleted file mode 100644
index 9c1b257bd8..0000000000
--- a/.sqlx/query-2036fd34035088aeafb99858f8b016fac6f818f326e4d0c148842ff711178f1c.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT source_type::text AS \"source_type!\", source_id,\n access_level::text AS \"access_level!\", granted_from_project_id\n FROM entity_access\n WHERE entity_id = $1 AND entity_type = 'project'\n ORDER BY source_type::text, source_id, granted_from_project_id NULLS FIRST\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "access_level!",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "granted_from_project_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- false,
- null,
- true
- ]
- },
- "hash": "2036fd34035088aeafb99858f8b016fac6f818f326e4d0c148842ff711178f1c"
-}
diff --git a/.sqlx/query-204c6de853bb2ceb8b7c13f42931800be4092c170c7825ca61e218957395f00f.json b/.sqlx/query-204c6de853bb2ceb8b7c13f42931800be4092c170c7825ca61e218957395f00f.json
deleted file mode 100644
index 96233900e5..0000000000
--- a/.sqlx/query-204c6de853bb2ceb8b7c13f42931800be4092c170c7825ca61e218957395f00f.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO microsoft_oauth_grants (\n fusionauth_user_id,\n email_address,\n refresh_token_ciphertext,\n encrypted_data_key,\n nonce,\n encryption_version,\n kms_key_id\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Bytea",
- "Bytea",
- "Bytea",
- "Int4",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "204c6de853bb2ceb8b7c13f42931800be4092c170c7825ca61e218957395f00f"
-}
diff --git a/.sqlx/query-208832639d67b1e0442db145f285aa5932dfc5b12c2895b94071a60337e66996.json b/.sqlx/query-208832639d67b1e0442db145f285aa5932dfc5b12c2895b94071a60337e66996.json
deleted file mode 100644
index 21fd704cd4..0000000000
--- a/.sqlx/query-208832639d67b1e0442db145f285aa5932dfc5b12c2895b94071a60337e66996.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS(SELECT 1 FROM \"PdfPlaceableCommentAnchor\" WHERE uuid = $1) AS \"exists!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "208832639d67b1e0442db145f285aa5932dfc5b12c2895b94071a60337e66996"
-}
diff --git a/.sqlx/query-20d19851add36857c81a73b3767b645806cfaf1c5e6db1be2d39a9ee1c75bbea.json b/.sqlx/query-20d19851add36857c81a73b3767b645806cfaf1c5e6db1be2d39a9ee1c75bbea.json
deleted file mode 100644
index 10883b7e59..0000000000
--- a/.sqlx/query-20d19851add36857c81a73b3767b645806cfaf1c5e6db1be2d39a9ee1c75bbea.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ('macro|[email protected]', '[email protected]', $1)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "20d19851add36857c81a73b3767b645806cfaf1c5e6db1be2d39a9ee1c75bbea"
-}
diff --git a/.sqlx/query-217acdbed6242ff0c4b45c2d2d20fabf7819587af3f045b0bbcd500b6f9c5107.json b/.sqlx/query-217acdbed6242ff0c4b45c2d2d20fabf7819587af3f045b0bbcd500b6f9c5107.json
deleted file mode 100644
index 32825ab260..0000000000
--- a/.sqlx/query-217acdbed6242ff0c4b45c2d2d20fabf7819587af3f045b0bbcd500b6f9c5107.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "ANALYZE",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "217acdbed6242ff0c4b45c2d2d20fabf7819587af3f045b0bbcd500b6f9c5107"
-}
diff --git a/.sqlx/query-227394b31cc92f54d863a268c57687d547dd43ee79232d56cccc9237155f356a.json b/.sqlx/query-227394b31cc92f54d863a268c57687d547dd43ee79232d56cccc9237155f356a.json
deleted file mode 100644
index 4ba454ceaf..0000000000
--- a/.sqlx/query-227394b31cc92f54d863a268c57687d547dd43ee79232d56cccc9237155f356a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM slack_import_outbox WHERE job_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "227394b31cc92f54d863a268c57687d547dd43ee79232d56cccc9237155f356a"
-}
diff --git a/.sqlx/query-22cbb960de6d19f3533b1d61a111b6aaa5db90dcde1d3deb845353d15b47b901.json b/.sqlx/query-22cbb960de6d19f3533b1d61a111b6aaa5db90dcde1d3deb845353d15b47b901.json
deleted file mode 100644
index c3c209e521..0000000000
--- a/.sqlx/query-22cbb960de6d19f3533b1d61a111b6aaa5db90dcde1d3deb845353d15b47b901.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"id\"\n FROM \"User\"\n WHERE \"email\" = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "22cbb960de6d19f3533b1d61a111b6aaa5db90dcde1d3deb845353d15b47b901"
-}
diff --git a/.sqlx/query-22e88df8834a54db1440f0da2867f0f76d755f29d6f880f56dfb20505fcab7ae.json b/.sqlx/query-22e88df8834a54db1440f0da2867f0f76d755f29d6f880f56dfb20505fcab7ae.json
deleted file mode 100644
index 0c59f9ac2a..0000000000
--- a/.sqlx/query-22e88df8834a54db1440f0da2867f0f76d755f29d6f880f56dfb20505fcab7ae.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO calls (id, channel_id, room_name, created_by, share_permission_id)\n VALUES ($1, $2::uuid, $2::uuid::text, $3, $4)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "22e88df8834a54db1440f0da2867f0f76d755f29d6f880f56dfb20505fcab7ae"
-}
diff --git a/.sqlx/query-239210ccb8f59955dbfb234bdb4d0ce122a6b34ddd6885bc17589e0d38f88da1.json b/.sqlx/query-239210ccb8f59955dbfb234bdb4d0ce122a6b34ddd6885bc17589e0d38f88da1.json
deleted file mode 100644
index 3a6c3a6c26..0000000000
--- a/.sqlx/query-239210ccb8f59955dbfb234bdb4d0ce122a6b34ddd6885bc17589e0d38f88da1.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM harnesses",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "239210ccb8f59955dbfb234bdb4d0ce122a6b34ddd6885bc17589e0d38f88da1"
-}
diff --git a/.sqlx/query-239ca21de9709a5c5e1876863d9d6f1ebd4a1e3b229d3901297a0b8af47ea65b.json b/.sqlx/query-239ca21de9709a5c5e1876863d9d6f1ebd4a1e3b229d3901297a0b8af47ea65b.json
deleted file mode 100644
index 493d0fa706..0000000000
--- a/.sqlx/query-239ca21de9709a5c5e1876863d9d6f1ebd4a1e3b229d3901297a0b8af47ea65b.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE user_notification SET state = $3, seen_at = $4 WHERE user_id = $1 AND notification_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- {
- "Custom": {
- "name": "notification_state",
- "kind": {
- "Enum": [
- "unseen",
- "seen",
- "done"
- ]
- }
- }
- },
- "Timestamp"
- ]
- },
- "nullable": []
- },
- "hash": "239ca21de9709a5c5e1876863d9d6f1ebd4a1e3b229d3901297a0b8af47ea65b"
-}
diff --git a/.sqlx/query-23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522.json b/.sqlx/query-23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522.json
deleted file mode 100644
index 5d0ad6f28b..0000000000
--- a/.sqlx/query-23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user_links (primary_macro_id, child_macro_id, link_id)\n VALUES ($1, $2, $3)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "23d9f97b2e79c6cb15fc6cf68e74c892f7e0d561597bd7aaac3b7cb8694a4522"
-}
diff --git a/.sqlx/query-2416870bd69a64d042ec84ece4336270c81c2dd92e71a5d247992fb1e30c5f66.json b/.sqlx/query-2416870bd69a64d042ec84ece4336270c81c2dd92e71a5d247992fb1e30c5f66.json
deleted file mode 100644
index 0e511612d0..0000000000
--- a/.sqlx/query-2416870bd69a64d042ec84ece4336270c81c2dd92e71a5d247992fb1e30c5f66.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE team_user SET team_role = 'member' WHERE team_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "2416870bd69a64d042ec84ece4336270c81c2dd92e71a5d247992fb1e30c5f66"
-}
diff --git a/.sqlx/query-24358be03c0a8890b4c5c6157e203bb80d6dee0636bc727b2f6791a09d4f5b36.json b/.sqlx/query-24358be03c0a8890b4c5c6157e203bb80d6dee0636bc727b2f6791a09d4f5b36.json
deleted file mode 100644
index 20ace6497f..0000000000
--- a/.sqlx/query-24358be03c0a8890b4c5c6157e203bb80d6dee0636bc727b2f6791a09d4f5b36.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM property_options WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "24358be03c0a8890b4c5c6157e203bb80d6dee0636bc727b2f6791a09d4f5b36"
-}
diff --git a/.sqlx/query-244ab6962023f3c8f4a50d22626c13ecb33019853c728795cad4209e6197b0df.json b/.sqlx/query-244ab6962023f3c8f4a50d22626c13ecb33019853c728795cad4209e6197b0df.json
deleted file mode 100644
index de0dfe044b..0000000000
--- a/.sqlx/query-244ab6962023f3c8f4a50d22626c13ecb33019853c728795cad4209e6197b0df.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_tables (id, database_id, name, position) VALUES ($1, $2, 't', 'a')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "244ab6962023f3c8f4a50d22626c13ecb33019853c728795cad4209e6197b0df"
-}
diff --git a/.sqlx/query-246d88f16e6bac8064be41148528e0545be33e3c43a3dc5193ab12220f8d8a7c.json b/.sqlx/query-246d88f16e6bac8064be41148528e0545be33e3c43a3dc5193ab12220f8d8a7c.json
deleted file mode 100644
index 5d095581d7..0000000000
--- a/.sqlx/query-246d88f16e6bac8064be41148528e0545be33e3c43a3dc5193ab12220f8d8a7c.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n id,\n thread_id AS \"thread_id!\",\n sender_id,\n triggered_by_user_id,\n content,\n created_at,\n updated_at,\n edited_at::timestamptz AS \"edited_at?\"\n FROM comms_messages\n WHERE thread_id = $1\n AND deleted_at IS NULL\n ORDER BY created_at ASC, id ASC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "thread_id!",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "sender_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "triggered_by_user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "content",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 6,
- "name": "updated_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 7,
- "name": "edited_at?",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- false,
- true,
- false,
- false,
- false,
- null
- ]
- },
- "hash": "246d88f16e6bac8064be41148528e0545be33e3c43a3dc5193ab12220f8d8a7c"
-}
diff --git a/.sqlx/query-252e517571fef697082b4e2a8084123f1e1eedf96eec93052034e9ea0ee5edea.json b/.sqlx/query-252e517571fef697082b4e2a8084123f1e1eedf96eec93052034e9ea0ee5edea.json
deleted file mode 100644
index 683e32866e..0000000000
--- a/.sqlx/query-252e517571fef697082b4e2a8084123f1e1eedf96eec93052034e9ea0ee5edea.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM entity_properties WHERE entity_id = $1 AND entity_type = 'DATABASE_ROW'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "252e517571fef697082b4e2a8084123f1e1eedf96eec93052034e9ea0ee5edea"
-}
diff --git a/.sqlx/query-2556c2cf7833c3f764cc6f34f482370e1e16f1024fe838445befdb0d4a9183ba.json b/.sqlx/query-2556c2cf7833c3f764cc6f34f482370e1e16f1024fe838445befdb0d4a9183ba.json
deleted file mode 100644
index 6166cbdea1..0000000000
--- a/.sqlx/query-2556c2cf7833c3f764cc6f34f482370e1e16f1024fe838445befdb0d4a9183ba.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id) VALUES (gen_random_uuid(), 'message', $1, 'doc', 'doc1', NULL)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Varchar"
- ]
- },
- "nullable": []
- },
- "hash": "2556c2cf7833c3f764cc6f34f482370e1e16f1024fe838445befdb0d4a9183ba"
-}
diff --git a/.sqlx/query-2601beb7d46f7f44b9e2cd62f330c5e7420290d55b8c4b4a8178abbb41601004.json b/.sqlx/query-2601beb7d46f7f44b9e2cd62f330c5e7420290d55b8c4b4a8178abbb41601004.json
deleted file mode 100644
index a60124e95c..0000000000
--- a/.sqlx/query-2601beb7d46f7f44b9e2cd62f330c5e7420290d55b8c4b4a8178abbb41601004.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, user_id, device_token, device_endpoint, device_type as \"device_type:DeviceType\" \n FROM notification_user_device_registration \n WHERE device_endpoint = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "device_token",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "device_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "device_type:DeviceType",
- "type_info": {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android",
- "iosvoip"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "2601beb7d46f7f44b9e2cd62f330c5e7420290d55b8c4b4a8178abbb41601004"
-}
diff --git a/.sqlx/query-265f2d683fc4afcd0723e7285f26ceb38843c39dae4a577853837803df0f84ee.json b/.sqlx/query-265f2d683fc4afcd0723e7285f26ceb38843c39dae4a577853837803df0f84ee.json
deleted file mode 100644
index ea804e2b9b..0000000000
--- a/.sqlx/query-265f2d683fc4afcd0723e7285f26ceb38843c39dae4a577853837803df0f84ee.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE ai_overage_charge SET updated_at = NOW() - INTERVAL '1 hour' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "265f2d683fc4afcd0723e7285f26ceb38843c39dae4a577853837803df0f84ee"
-}
diff --git a/.sqlx/query-26a76b5eae7dfe22e53a40628be0a61971f6ea27caaa65b5df176056d34511b4.json b/.sqlx/query-26a76b5eae7dfe22e53a40628be0a61971f6ea27caaa65b5df176056d34511b4.json
deleted file mode 100644
index 72a589b448..0000000000
--- a/.sqlx/query-26a76b5eae7dfe22e53a40628be0a61971f6ea27caaa65b5df176056d34511b4.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) as \"count!\" FROM \"Document\" WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "26a76b5eae7dfe22e53a40628be0a61971f6ea27caaa65b5df176056d34511b4"
-}
diff --git a/.sqlx/query-26e90b7b244ce94450797f8e0ab9a2fb4ef12d63913566c24238b04fc9b88bff.json b/.sqlx/query-26e90b7b244ce94450797f8e0ab9a2fb4ef12d63913566c24238b04fc9b88bff.json
deleted file mode 100644
index c675f3a89d..0000000000
--- a/.sqlx/query-26e90b7b244ce94450797f8e0ab9a2fb4ef12d63913566c24238b04fc9b88bff.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET channel_type = 'public', team_id = NULL WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "26e90b7b244ce94450797f8e0ab9a2fb4ef12d63913566c24238b04fc9b88bff"
-}
diff --git a/.sqlx/query-272cb961c7808fac2017ab886d31d0b3e35de71145189f0e7295e13fa275725b.json b/.sqlx/query-272cb961c7808fac2017ab886d31d0b3e35de71145189f0e7295e13fa275725b.json
deleted file mode 100644
index 3bdc5f555f..0000000000
--- a/.sqlx/query-272cb961c7808fac2017ab886d31d0b3e35de71145189f0e7295e13fa275725b.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO github_links (id, macro_id, fusionauth_user_id, github_username, github_user_id)\n VALUES ($1, $2, $3, $4, $5)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Varchar",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "272cb961c7808fac2017ab886d31d0b3e35de71145189f0e7295e13fa275725b"
-}
diff --git a/.sqlx/query-27385b4ff354563a2cc18f745cb98b859e73b7bb1932d2cafcd5177a435e35db.json b/.sqlx/query-27385b4ff354563a2cc18f745cb98b859e73b7bb1932d2cafcd5177a435e35db.json
deleted file mode 100644
index 24c380322d..0000000000
--- a/.sqlx/query-27385b4ff354563a2cc18f745cb98b859e73b7bb1932d2cafcd5177a435e35db.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) AS \"count!\" FROM scheduled_action WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "27385b4ff354563a2cc18f745cb98b859e73b7bb1932d2cafcd5177a435e35db"
-}
diff --git a/.sqlx/query-280b524fe0ce00b66ee0adb59a63d54749a76b03fc7006ea64270c34763f605f.json b/.sqlx/query-280b524fe0ce00b66ee0adb59a63d54749a76b03fc7006ea64270c34763f605f.json
deleted file mode 100644
index ba7824ec45..0000000000
--- a/.sqlx/query-280b524fe0ce00b66ee0adb59a63d54749a76b03fc7006ea64270c34763f605f.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE foreign_entity\n SET created_at = $2, updated_at = $3\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "280b524fe0ce00b66ee0adb59a63d54749a76b03fc7006ea64270c34763f605f"
-}
diff --git a/.sqlx/query-29098ee291ac1a36f3aab99346e3a6e545b9ef69ff8f09c8aef1944aebefdb7e.json b/.sqlx/query-29098ee291ac1a36f3aab99346e3a6e545b9ef69ff8f09c8aef1944aebefdb7e.json
deleted file mode 100644
index ac3a44665b..0000000000
--- a/.sqlx/query-29098ee291ac1a36f3aab99346e3a6e545b9ef69ff8f09c8aef1944aebefdb7e.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM \"ChatMessage\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "29098ee291ac1a36f3aab99346e3a6e545b9ef69ff8f09c8aef1944aebefdb7e"
-}
diff --git a/.sqlx/query-29997f3c4d74e67781d4dc3691976cccc8554cf14567bf93a75fe4a3c7e333db.json b/.sqlx/query-29997f3c4d74e67781d4dc3691976cccc8554cf14567bf93a75fe4a3c7e333db.json
deleted file mode 100644
index fd49e0c2f1..0000000000
--- a/.sqlx/query-29997f3c4d74e67781d4dc3691976cccc8554cf14567bf93a75fe4a3c7e333db.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_session (\n id, owner_id, bot_id, model, harness, repo_url, workspace, list_hidden\n )\n VALUES ($1, $2, '00000000-0000-0000-0000-00000000a9e7', 'model', 'harness', NULL, '/workspace', TRUE)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "29997f3c4d74e67781d4dc3691976cccc8554cf14567bf93a75fe4a3c7e333db"
-}
diff --git a/.sqlx/query-29b0f9fb4913bba3bc7960de0f9cb67f3c7c9a9df6d67fb41a4ba9834d7a330f.json b/.sqlx/query-29b0f9fb4913bba3bc7960de0f9cb67f3c7c9a9df6d67fb41a4ba9834d7a330f.json
deleted file mode 100644
index 1b36b3e553..0000000000
--- a/.sqlx/query-29b0f9fb4913bba3bc7960de0f9cb67f3c7c9a9df6d67fb41a4ba9834d7a330f.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_session (id, owner_id, bot_id, model, harness, workspace)\n VALUES ($1, $2, $3, 'default', 'in-memory', '/workspace')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "29b0f9fb4913bba3bc7960de0f9cb67f3c7c9a9df6d67fb41a4ba9834d7a330f"
-}
diff --git a/.sqlx/query-2a09a8b0399791b5acd489c0ad6fccca6a98327a1f043f7ca79584ab0d5720c0.json b/.sqlx/query-2a09a8b0399791b5acd489c0ad6fccca6a98327a1f043f7ca79584ab0d5720c0.json
deleted file mode 100644
index 1074453cba..0000000000
--- a/.sqlx/query-2a09a8b0399791b5acd489c0ad6fccca6a98327a1f043f7ca79584ab0d5720c0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team_user (user_id, team_id, team_role)\n VALUES ($1, $2, 'member')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "2a09a8b0399791b5acd489c0ad6fccca6a98327a1f043f7ca79584ab0d5720c0"
-}
diff --git a/.sqlx/query-2b67d08f6da6ad42d94604cae8435d68ee4057f63b3a588ac0ca17e5486f0698.json b/.sqlx/query-2b67d08f6da6ad42d94604cae8435d68ee4057f63b3a588ac0ca17e5486f0698.json
deleted file mode 100644
index e211287ed3..0000000000
--- a/.sqlx/query-2b67d08f6da6ad42d94604cae8435d68ee4057f63b3a588ac0ca17e5486f0698.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_messages(id, parent_entity_type, parent_entity_id, sender_id, content) VALUES ($1, $2, $3, $4, 'test')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "2b67d08f6da6ad42d94604cae8435d68ee4057f63b3a588ac0ca17e5486f0698"
-}
diff --git a/.sqlx/query-2ba299b337299a1ce837f0042c3a8cf15ddd312d287f1018b8fc63cd0f5ea58e.json b/.sqlx/query-2ba299b337299a1ce837f0042c3a8cf15ddd312d287f1018b8fc63cd0f5ea58e.json
deleted file mode 100644
index ef7714031e..0000000000
--- a/.sqlx/query-2ba299b337299a1ce837f0042c3a8cf15ddd312d287f1018b8fc63cd0f5ea58e.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT \"documentId\" as \"document_id\" FROM \"InstructionsDocuments\" WHERE \"userId\" = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "document_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "2ba299b337299a1ce837f0042c3a8cf15ddd312d287f1018b8fc63cd0f5ea58e"
-}
diff --git a/.sqlx/query-2d29668b4717cb9a6a6d4a0afa942112008f6cff5562eca725c7b1ffe7985b8d.json b/.sqlx/query-2d29668b4717cb9a6a6d4a0afa942112008f6cff5562eca725c7b1ffe7985b8d.json
deleted file mode 100644
index 1457748364..0000000000
--- a/.sqlx/query-2d29668b4717cb9a6a6d4a0afa942112008f6cff5562eca725c7b1ffe7985b8d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM slack_import_job WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "2d29668b4717cb9a6a6d4a0afa942112008f6cff5562eca725c7b1ffe7985b8d"
-}
diff --git a/.sqlx/query-2d37c7d9327edc0989b655a735a6542f9b85c1fc99dc6f806344112e0a125a20.json b/.sqlx/query-2d37c7d9327edc0989b655a735a6542f9b85c1fc99dc6f806344112e0a125a20.json
deleted file mode 100644
index d8dfd2c49f..0000000000
--- a/.sqlx/query-2d37c7d9327edc0989b655a735a6542f9b85c1fc99dc6f806344112e0a125a20.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT 'document' AS \"kind!\", id AS \"id!\" FROM \"Document\"\n UNION ALL SELECT 'chat', id FROM \"Chat\"\n UNION ALL SELECT 'project', id FROM \"Project\"\n UNION ALL SELECT 'entity', id::text FROM entity\n UNION ALL SELECT CASE WHEN granted_from_project_id IS NULL THEN 'access' ELSE 'inherited' END,\n entity_id::text FROM entity_access\n ORDER BY 1, 2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "kind!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "id!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null,
- null
- ]
- },
- "hash": "2d37c7d9327edc0989b655a735a6542f9b85c1fc99dc6f806344112e0a125a20"
-}
diff --git a/.sqlx/query-2db782fa5ff33ca3709443a123d0b911552a2b5c3b19df359eac03ece1b9c195.json b/.sqlx/query-2db782fa5ff33ca3709443a123d0b911552a2b5c3b19df359eac03ece1b9c195.json
deleted file mode 100644
index 2b336c9230..0000000000
--- a/.sqlx/query-2db782fa5ff33ca3709443a123d0b911552a2b5c3b19df359eac03ece1b9c195.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE reminder_email_followup SET payload = '{}'::jsonb WHERE reminder_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "2db782fa5ff33ca3709443a123d0b911552a2b5c3b19df359eac03ece1b9c195"
-}
diff --git a/.sqlx/query-2ea2a143eab94461f62be76320578f818dd75d5e15944b8775a07e48c43edb66.json b/.sqlx/query-2ea2a143eab94461f62be76320578f818dd75d5e15944b8775a07e48c43edb66.json
deleted file mode 100644
index 7c691a3b02..0000000000
--- a/.sqlx/query-2ea2a143eab94461f62be76320578f818dd75d5e15944b8775a07e48c43edb66.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session_log SET created_at = created_at + interval '1 second' WHERE agent_session_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "2ea2a143eab94461f62be76320578f818dd75d5e15944b8775a07e48c43edb66"
-}
diff --git a/.sqlx/query-3038cc3e5fa2c21d249c10dc5a67edf050acaab06dcf8ca6e239a613812fb8eb.json b/.sqlx/query-3038cc3e5fa2c21d249c10dc5a67edf050acaab06dcf8ca6e239a613812fb8eb.json
deleted file mode 100644
index cbc4d2795c..0000000000
--- a/.sqlx/query-3038cc3e5fa2c21d249c10dc5a67edf050acaab06dcf8ca6e239a613812fb8eb.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO webhook (\n id, workspace_id, namespace, name, endpoint_url, signing_secret,\n filters, created_by_user_id\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Jsonb",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3038cc3e5fa2c21d249c10dc5a67edf050acaab06dcf8ca6e239a613812fb8eb"
-}
diff --git a/.sqlx/query-31046e81937ed209e30272e8fdacd5eb8d547c9f7dc47c30a387005d7021ae8d.json b/.sqlx/query-31046e81937ed209e30272e8fdacd5eb8d547c9f7dc47c30a387005d7021ae8d.json
deleted file mode 100644
index 27db92a19e..0000000000
--- a/.sqlx/query-31046e81937ed209e30272e8fdacd5eb8d547c9f7dc47c30a387005d7021ae8d.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM user_notification WHERE notification_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "31046e81937ed209e30272e8fdacd5eb8d547c9f7dc47c30a387005d7021ae8d"
-}
diff --git a/.sqlx/query-31ba74a23ea4aaa29be1ee3cea7e20e4e93a41aa9027a28b96feb070185ce758.json b/.sqlx/query-31ba74a23ea4aaa29be1ee3cea7e20e4e93a41aa9027a28b96feb070185ce758.json
deleted file mode 100644
index 62eda5b337..0000000000
--- a/.sqlx/query-31ba74a23ea4aaa29be1ee3cea7e20e4e93a41aa9027a28b96feb070185ce758.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session SET thread_id = $1 WHERE id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "31ba74a23ea4aaa29be1ee3cea7e20e4e93a41aa9027a28b96feb070185ce758"
-}
diff --git a/.sqlx/query-31ed0496ad3add328514f2e8732b69611987753114d2342c404b3da4c9055d5a.json b/.sqlx/query-31ed0496ad3add328514f2e8732b69611987753114d2342c404b3da4c9055d5a.json
deleted file mode 100644
index 4b0b9175ea..0000000000
--- a/.sqlx/query-31ed0496ad3add328514f2e8732b69611987753114d2342c404b3da4c9055d5a.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "31ed0496ad3add328514f2e8732b69611987753114d2342c404b3da4c9055d5a"
-}
diff --git a/.sqlx/query-32769e980bd65abeb0e8810499490deddbc73c6850576c5106b0c30efa5002f3.json b/.sqlx/query-32769e980bd65abeb0e8810499490deddbc73c6850576c5106b0c30efa5002f3.json
deleted file mode 100644
index 9be60df46f..0000000000
--- a/.sqlx/query-32769e980bd65abeb0e8810499490deddbc73c6850576c5106b0c30efa5002f3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM ai_financial_rate WHERE version = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "32769e980bd65abeb0e8810499490deddbc73c6850576c5106b0c30efa5002f3"
-}
diff --git a/.sqlx/query-33806b4a47804361303ba141ecae712fadaacad258646bdce61d1d457bb44c80.json b/.sqlx/query-33806b4a47804361303ba141ecae712fadaacad258646bdce61d1d457bb44c80.json
deleted file mode 100644
index 886f0793a3..0000000000
--- a/.sqlx/query-33806b4a47804361303ba141ecae712fadaacad258646bdce61d1d457bb44c80.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_attachments (id, message_id, entity_type, entity_id)\n VALUES ($1, $2, 'document', $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Varchar"
- ]
- },
- "nullable": []
- },
- "hash": "33806b4a47804361303ba141ecae712fadaacad258646bdce61d1d457bb44c80"
-}
diff --git a/.sqlx/query-339c2b874da822ae11c4fda1e472ac17e74b0084fac5758a6be49c1532a04f1e.json b/.sqlx/query-339c2b874da822ae11c4fda1e472ac17e74b0084fac5758a6be49c1532a04f1e.json
deleted file mode 100644
index 1d91e63d78..0000000000
--- a/.sqlx/query-339c2b874da822ae11c4fda1e472ac17e74b0084fac5758a6be49c1532a04f1e.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS(SELECT 1 FROM entity_access WHERE entity_type = 'channel' AND source_id = $1) OR EXISTS(SELECT 1 FROM comms_channel_participants WHERE user_id = $1) AS \"exists!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "339c2b874da822ae11c4fda1e472ac17e74b0084fac5758a6be49c1532a04f1e"
-}
diff --git a/.sqlx/query-3401326e36f2eed91e6ea93bdf8d9f06b2e1d1227a4a8853b42a9ca56176e501.json b/.sqlx/query-3401326e36f2eed91e6ea93bdf8d9f06b2e1d1227a4a8853b42a9ca56176e501.json
deleted file mode 100644
index 85cb1908d0..0000000000
--- a/.sqlx/query-3401326e36f2eed91e6ea93bdf8d9f06b2e1d1227a4a8853b42a9ca56176e501.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) AS \"count!\" FROM agent_mcp_servers WHERE bot_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "3401326e36f2eed91e6ea93bdf8d9f06b2e1d1227a4a8853b42a9ca56176e501"
-}
diff --git a/.sqlx/query-3490a86ba541f1847bb70c46ad3ed56e5dceb23c2ae6dcb5904d037e43d6f36d.json b/.sqlx/query-3490a86ba541f1847bb70c46ad3ed56e5dceb23c2ae6dcb5904d037e43d6f36d.json
deleted file mode 100644
index b97578ec55..0000000000
--- a/.sqlx/query-3490a86ba541f1847bb70c46ad3ed56e5dceb23c2ae6dcb5904d037e43d6f36d.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"BlockedEmail\" (email)\n VALUES ('[email protected]')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "3490a86ba541f1847bb70c46ad3ed56e5dceb23c2ae6dcb5904d037e43d6f36d"
-}
diff --git a/.sqlx/query-370541e82eea62ff832bc2a199f39a4843cd777c9b5a3eb813129b534f6699bd.json b/.sqlx/query-370541e82eea62ff832bc2a199f39a4843cd777c9b5a3eb813129b534f6699bd.json
deleted file mode 100644
index 71c01477e7..0000000000
--- a/.sqlx/query-370541e82eea62ff832bc2a199f39a4843cd777c9b5a3eb813129b534f6699bd.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT (SELECT count(*) FROM comms_messages) AS \"messages!\", (SELECT count(*) FROM comms_reactions) AS \"reactions!\", (SELECT count(*) FROM slack_import_message_map) AS \"mappings!\", (SELECT count(*) FROM slack_import_outbox WHERE kind = 'search') AS \"search!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "messages!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "reactions!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "mappings!",
- "type_info": "Int8"
- },
- {
- "ordinal": 3,
- "name": "search!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null,
- null,
- null,
- null
- ]
- },
- "hash": "370541e82eea62ff832bc2a199f39a4843cd777c9b5a3eb813129b534f6699bd"
-}
diff --git a/.sqlx/query-378d779e6b9aa5d731593bed90cbb307d9311cc5faac829914d3fd39544ed1c4.json b/.sqlx/query-378d779e6b9aa5d731593bed90cbb307d9311cc5faac829914d3fd39544ed1c4.json
deleted file mode 100644
index 7784be8504..0000000000
--- a/.sqlx/query-378d779e6b9aa5d731593bed90cbb307d9311cc5faac829914d3fd39544ed1c4.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id FROM property_options WHERE property_definition_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "378d779e6b9aa5d731593bed90cbb307d9311cc5faac829914d3fd39544ed1c4"
-}
diff --git a/.sqlx/query-38c286776a6f6d9cf792a170769cbc1cb2b7540552079d908f912d631adb2c43.json b/.sqlx/query-38c286776a6f6d9cf792a170769cbc1cb2b7540552079d908f912d631adb2c43.json
deleted file mode 100644
index 5ef5022702..0000000000
--- a/.sqlx/query-38c286776a6f6d9cf792a170769cbc1cb2b7540552079d908f912d631adb2c43.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO migrated_comment_id (comment_id, message_id, document_id)\n VALUES (10, $1, 'message-doc-a'), (11, $2, 'message-doc-a')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "38c286776a6f6d9cf792a170769cbc1cb2b7540552079d908f912d631adb2c43"
-}
diff --git a/.sqlx/query-3955be928fd3c11d424dde331860ad14913a6285b31d1d2ab2774dd7aa30bf5d.json b/.sqlx/query-3955be928fd3c11d424dde331860ad14913a6285b31d1d2ab2774dd7aa30bf5d.json
deleted file mode 100644
index 3954b3d2c8..0000000000
--- a/.sqlx/query-3955be928fd3c11d424dde331860ad14913a6285b31d1d2ab2774dd7aa30bf5d.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT lane FROM database_view_positions WHERE view_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "lane",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "3955be928fd3c11d424dde331860ad14913a6285b31d1d2ab2774dd7aa30bf5d"
-}
diff --git a/.sqlx/query-39b7438988b5c9004055e16ecee679cc680f336685a776264832762dd2bdf6b4.json b/.sqlx/query-39b7438988b5c9004055e16ecee679cc680f336685a776264832762dd2bdf6b4.json
deleted file mode 100644
index 1f4bc3c4a1..0000000000
--- a/.sqlx/query-39b7438988b5c9004055e16ecee679cc680f336685a776264832762dd2bdf6b4.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT name, \"fileType\" as \"file_type\", owner FROM \"Document\" WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "file_type",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true,
- false
- ]
- },
- "hash": "39b7438988b5c9004055e16ecee679cc680f336685a776264832762dd2bdf6b4"
-}
diff --git a/.sqlx/query-39fca497572c002c867196ee262bae22e85e5ec9c68753b6a18fdb5935afe93d.json b/.sqlx/query-39fca497572c002c867196ee262bae22e85e5ec9c68753b6a18fdb5935afe93d.json
new file mode 100644
index 0000000000..2eaed44066
--- /dev/null
+++ b/.sqlx/query-39fca497572c002c867196ee262bae22e85e5ec9c68753b6a18fdb5935afe93d.json
@@ -0,0 +1,29 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n UPDATE ai_credit_reload\n SET status = ($2::text)::ai_credit_reload_status, updated_at = NOW()\n WHERE stripe_invoice_id = $1\n AND status <> 'paid'\n AND status <> ($2::text)::ai_credit_reload_status\n RETURNING user_id, amount_cents\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "user_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "amount_cents",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Text"
+ ]
+ },
+ "nullable": [
+ false,
+ false
+ ]
+ },
+ "hash": "39fca497572c002c867196ee262bae22e85e5ec9c68753b6a18fdb5935afe93d"
+}
diff --git a/.sqlx/query-3a51f140f71b9faece1b1851f5144ea3ef6fa7f99da6a57045d4196f3b03d851.json b/.sqlx/query-3a51f140f71b9faece1b1851f5144ea3ef6fa7f99da6a57045d4196f3b03d851.json
deleted file mode 100644
index 8cda30975e..0000000000
--- a/.sqlx/query-3a51f140f71b9faece1b1851f5144ea3ef6fa7f99da6a57045d4196f3b03d851.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT pg_advisory_unlock(27001)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pg_advisory_unlock",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "3a51f140f71b9faece1b1851f5144ea3ef6fa7f99da6a57045d4196f3b03d851"
-}
diff --git a/.sqlx/query-3ab9e72d167d0cf4b1981d4d454c6f0fe18d3f705ea354b1c28fa5eba0d329a2.json b/.sqlx/query-3ab9e72d167d0cf4b1981d4d454c6f0fe18d3f705ea354b1c28fa5eba0d329a2.json
deleted file mode 100644
index 6f221f05df..0000000000
--- a/.sqlx/query-3ab9e72d167d0cf4b1981d4d454c6f0fe18d3f705ea354b1c28fa5eba0d329a2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT working_branch FROM agent_session WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "working_branch",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "3ab9e72d167d0cf4b1981d4d454c6f0fe18d3f705ea354b1c28fa5eba0d329a2"
-}
diff --git a/.sqlx/query-3ac2cf269852e3147ca2f9f28c8087393f8e66e5056f5c49ef23005adb7f2b88.json b/.sqlx/query-3ac2cf269852e3147ca2f9f28c8087393f8e66e5056f5c49ef23005adb7f2b88.json
deleted file mode 100644
index 4bc6bcd9b2..0000000000
--- a/.sqlx/query-3ac2cf269852e3147ca2f9f28c8087393f8e66e5056f5c49ef23005adb7f2b88.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ($1, $2, $3) ON CONFLICT (id) DO NOTHING",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "3ac2cf269852e3147ca2f9f28c8087393f8e66e5056f5c49ef23005adb7f2b88"
-}
diff --git a/.sqlx/query-3b13867ea311a21db2f71500245f93ba4b1a93a2906a7e6db7a8773f6bff8a1f.json b/.sqlx/query-3b13867ea311a21db2f71500245f93ba4b1a93a2906a7e6db7a8773f6bff8a1f.json
deleted file mode 100644
index 9366a2eba4..0000000000
--- a/.sqlx/query-3b13867ea311a21db2f71500245f93ba4b1a93a2906a7e6db7a8773f6bff8a1f.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT access_level AS \"access_level!: AccessLevel\" FROM entity_access WHERE entity_id = $1 AND entity_type = 'call' AND source_id = $2 AND source_type = 'user' AND granted_from_project_id IS NULL",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level!: AccessLevel",
- "type_info": {
- "Custom": {
- "name": "\"AccessLevel\"",
- "kind": {
- "Enum": [
- "view",
- "comment",
- "edit",
- "owner"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "3b13867ea311a21db2f71500245f93ba4b1a93a2906a7e6db7a8773f6bff8a1f"
-}
diff --git a/.sqlx/query-3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1.json b/.sqlx/query-3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1.json
deleted file mode 100644
index 53c3c181dc..0000000000
--- a/.sqlx/query-3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'Team', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3b2dbc5b0affbcf53cfe76fe5210b7e4d96dad61a84d4a87dced9d2f66dc6ff1"
-}
diff --git a/.sqlx/query-3b906e559d0490db6be6eb5e8e2eec9f0c51942e4ac7d1c9c81ea0cb7c1b8557.json b/.sqlx/query-3b906e559d0490db6be6eb5e8e2eec9f0c51942e4ac7d1c9c81ea0cb7c1b8557.json
deleted file mode 100644
index ec25c0c14c..0000000000
--- a/.sqlx/query-3b906e559d0490db6be6eb5e8e2eec9f0c51942e4ac7d1c9c81ea0cb7c1b8557.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_channel_participants (channel_id, user_id, role, joined_at)\n VALUES ($1, $2, 'member', now())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3b906e559d0490db6be6eb5e8e2eec9f0c51942e4ac7d1c9c81ea0cb7c1b8557"
-}
diff --git a/.sqlx/query-3b9c5a5b2f2bc9c05419a2f362dd067a7c37a7dd9e6f65f37a2be3c11a01d4c2.json b/.sqlx/query-3b9c5a5b2f2bc9c05419a2f362dd067a7c37a7dd9e6f65f37a2be3c11a01d4c2.json
deleted file mode 100644
index fac46dc612..0000000000
--- a/.sqlx/query-3b9c5a5b2f2bc9c05419a2f362dd067a7c37a7dd9e6f65f37a2be3c11a01d4c2.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT access_level AS \"access_level: AccessLevel\"\n FROM entity_access\n WHERE entity_id = $1 AND entity_type = 'project' AND source_type = 'team'\n AND granted_from_project_id IS NULL\n ORDER BY access_level\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level: AccessLevel",
- "type_info": {
- "Custom": {
- "name": "\"AccessLevel\"",
- "kind": {
- "Enum": [
- "view",
- "comment",
- "edit",
- "owner"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "3b9c5a5b2f2bc9c05419a2f362dd067a7c37a7dd9e6f65f37a2be3c11a01d4c2"
-}
diff --git a/.sqlx/query-3ba1b5f429b1d41317e5b607e8d49d4ba9ca16f05ae85c224476b30aecfca3c4.json b/.sqlx/query-3ba1b5f429b1d41317e5b607e8d49d4ba9ca16f05ae85c224476b30aecfca3c4.json
deleted file mode 100644
index f5e938e96e..0000000000
--- a/.sqlx/query-3ba1b5f429b1d41317e5b607e8d49d4ba9ca16f05ae85c224476b30aecfca3c4.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $3, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3ba1b5f429b1d41317e5b607e8d49d4ba9ca16f05ae85c224476b30aecfca3c4"
-}
diff --git a/.sqlx/query-3bc81c6fb0d3c38284ade8539e16b11ca80044f5d3371867c2ba0540a432b583.json b/.sqlx/query-3bc81c6fb0d3c38284ade8539e16b11ca80044f5d3371867c2ba0540a432b583.json
deleted file mode 100644
index 634825c2d6..0000000000
--- a/.sqlx/query-3bc81c6fb0d3c38284ade8539e16b11ca80044f5d3371867c2ba0540a432b583.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT\n EXISTS(SELECT 1 FROM comms_messages WHERE id = ANY($1)) AS \"messages!\",\n EXISTS(SELECT 1 FROM comms_message_threads WHERE root_id = ANY($1)) AS \"threads!\",\n EXISTS(SELECT 1 FROM comms_attachments WHERE message_id = ANY($1)) AS \"attachments!\",\n EXISTS(SELECT 1 FROM comms_reactions WHERE message_id = ANY($1)) AS \"reactions!\",\n EXISTS(SELECT 1 FROM comms_entity_mentions WHERE source_entity_type = 'message' AND source_entity_id = ANY($2)) AS \"mentions!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "messages!",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "threads!",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "attachments!",
- "type_info": "Bool"
- },
- {
- "ordinal": 3,
- "name": "reactions!",
- "type_info": "Bool"
- },
- {
- "ordinal": 4,
- "name": "mentions!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray",
- "TextArray"
- ]
- },
- "nullable": [
- null,
- null,
- null,
- null,
- null
- ]
- },
- "hash": "3bc81c6fb0d3c38284ade8539e16b11ca80044f5d3371867c2ba0540a432b583"
-}
diff --git a/.sqlx/query-3be9ce3de1997682fc34534f301129a542094a2836d4519d1e04c47547099874.json b/.sqlx/query-3be9ce3de1997682fc34534f301129a542094a2836d4519d1e04c47547099874.json
deleted file mode 100644
index e579333566..0000000000
--- a/.sqlx/query-3be9ce3de1997682fc34534f301129a542094a2836d4519d1e04c47547099874.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id, database_id, table_id, version, actor, acting_bot, ops, inverse, payload_version\n FROM database_changes ORDER BY id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "database_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "table_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 3,
- "name": "version",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "actor",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "acting_bot",
- "type_info": "Text"
- },
- {
- "ordinal": 6,
- "name": "ops",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 7,
- "name": "inverse",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 8,
- "name": "payload_version",
- "type_info": "Int4"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false
- ]
- },
- "hash": "3be9ce3de1997682fc34534f301129a542094a2836d4519d1e04c47547099874"
-}
diff --git a/.sqlx/query-3be9d6b028e1e403360eb3a5b7efb90db68325a3e4105fc4e3ad32283b96a56c.json b/.sqlx/query-3be9d6b028e1e403360eb3a5b7efb90db68325a3e4105fc4e3ad32283b96a56c.json
deleted file mode 100644
index 7eeb05f5a0..0000000000
--- a/.sqlx/query-3be9d6b028e1e403360eb3a5b7efb90db68325a3e4105fc4e3ad32283b96a56c.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session SET share_permission_id = 'initialized-session' WHERE id = '20000000-0000-0000-0000-000000000010'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "3be9d6b028e1e403360eb3a5b7efb90db68325a3e4105fc4e3ad32283b96a56c"
-}
diff --git a/.sqlx/query-3d1f314799b67cda36d303512abac16d099e398c3ea4581bdb95600a8dc409a2.json b/.sqlx/query-3d1f314799b67cda36d303512abac16d099e398c3ea4581bdb95600a8dc409a2.json
deleted file mode 100644
index 8b9f0c6f68..0000000000
--- a/.sqlx/query-3d1f314799b67cda36d303512abac16d099e398c3ea4581bdb95600a8dc409a2.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) as \"count!\" FROM \"InstructionsDocuments\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "3d1f314799b67cda36d303512abac16d099e398c3ea4581bdb95600a8dc409a2"
-}
diff --git a/.sqlx/query-3d29e2ee55cab12719d0940b5d212b1855790f41bba1d92419ab49a15458566c.json b/.sqlx/query-3d29e2ee55cab12719d0940b5d212b1855790f41bba1d92419ab49a15458566c.json
deleted file mode 100644
index 1261681752..0000000000
--- a/.sqlx/query-3d29e2ee55cab12719d0940b5d212b1855790f41bba1d92419ab49a15458566c.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n d.status,\n d.next_attempt_at,\n a.status AS attempt_status,\n a.completed_at,\n w.last_failure_at\n FROM webhook_delivery d\n JOIN webhook_delivery_attempt a ON a.webhook_delivery_id = d.id\n JOIN webhook w ON w.id = d.webhook_id\n WHERE d.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "next_attempt_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "attempt_status",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "completed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 4,
- "name": "last_failure_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true,
- false,
- true,
- true
- ]
- },
- "hash": "3d29e2ee55cab12719d0940b5d212b1855790f41bba1d92419ab49a15458566c"
-}
diff --git a/.sqlx/query-3d444801dac44f47578f48713f8affb7aa14a5a823eb6fe8b6f1d62d457ee785.json b/.sqlx/query-3d444801dac44f47578f48713f8affb7aa14a5a823eb6fe8b6f1d62d457ee785.json
deleted file mode 100644
index a5e956ed91..0000000000
--- a/.sqlx/query-3d444801dac44f47578f48713f8affb7aa14a5a823eb6fe8b6f1d62d457ee785.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT pg_backend_pid() AS \"pid!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pid!",
- "type_info": "Int4"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "3d444801dac44f47578f48713f8affb7aa14a5a823eb6fe8b6f1d62d457ee785"
-}
diff --git a/.sqlx/query-3d90daaf6657fce4944f9100e4dfafc4f27772e0688bac0b3165692422846d7e.json b/.sqlx/query-3d90daaf6657fce4944f9100e4dfafc4f27772e0688bac0b3165692422846d7e.json
deleted file mode 100644
index befb5520dc..0000000000
--- a/.sqlx/query-3d90daaf6657fce4944f9100e4dfafc4f27772e0688bac0b3165692422846d7e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level) VALUES ($1, 'email_thread', $2, 'user', 'view')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3d90daaf6657fce4944f9100e4dfafc4f27772e0688bac0b3165692422846d7e"
-}
diff --git a/.sqlx/query-3e7beed2a659e4f8afb75f8da1181378414177725689736cb8efb29319af5d1b.json b/.sqlx/query-3e7beed2a659e4f8afb75f8da1181378414177725689736cb8efb29319af5d1b.json
deleted file mode 100644
index 7f4503f98d..0000000000
--- a/.sqlx/query-3e7beed2a659e4f8afb75f8da1181378414177725689736cb8efb29319af5d1b.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS(SELECT 1 FROM pg_stat_activity WHERE datname = current_database() AND $1 = ANY(pg_blocking_pids(pid))) AS \"exists!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Int4"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "3e7beed2a659e4f8afb75f8da1181378414177725689736cb8efb29319af5d1b"
-}
diff --git a/.sqlx/query-3f55e29e4b01ea495af980ccec349f7e251bd2034994a95de309c89a4394d723.json b/.sqlx/query-3f55e29e4b01ea495af980ccec349f7e251bd2034994a95de309c89a4394d723.json
deleted file mode 100644
index cb96e988ef..0000000000
--- a/.sqlx/query-3f55e29e4b01ea495af980ccec349f7e251bd2034994a95de309c89a4394d723.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT COALESCE(SUM(amount_cents), 0)::bigint AS \"charged!\"\n FROM ai_overage_charge\n WHERE user_id = $1\n AND period_start = $2\n AND (status <> 'failed' OR stripe_invoice_id IS NOT NULL)\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "charged!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "3f55e29e4b01ea495af980ccec349f7e251bd2034994a95de309c89a4394d723"
-}
diff --git a/.sqlx/query-3f5f8573e6a53714acafc8709676cf9a0a6b68d4e2409a45135303d868e97ea2.json b/.sqlx/query-3f5f8573e6a53714acafc8709676cf9a0a6b68d4e2409a45135303d868e97ea2.json
deleted file mode 100644
index 532db7b6ab..0000000000
--- a/.sqlx/query-3f5f8573e6a53714acafc8709676cf9a0a6b68d4e2409a45135303d868e97ea2.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_scheduled_messages SET processing = false, sent = true WHERE message_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "3f5f8573e6a53714acafc8709676cf9a0a6b68d4e2409a45135303d868e97ea2"
-}
diff --git a/.sqlx/query-406c70b57542e83e2be08e369d59fe361004eeec74353501ebcf39496d056b2a.json b/.sqlx/query-406c70b57542e83e2be08e369d59fe361004eeec74353501ebcf39496d056b2a.json
deleted file mode 100644
index 28513a6e30..0000000000
--- a/.sqlx/query-406c70b57542e83e2be08e369d59fe361004eeec74353501ebcf39496d056b2a.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \n channel_id, \n access_level::text as \"access_level!\"\n FROM \"ChannelSharePermission\"\n WHERE \"share_permission_id\" = 'sp-p1'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "channel_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- null
- ]
- },
- "hash": "406c70b57542e83e2be08e369d59fe361004eeec74353501ebcf39496d056b2a"
-}
diff --git a/.sqlx/query-409b637f5e3b6dc968b7eac8b7183864a1d158717c507ed4a156479abf53b4e8.json b/.sqlx/query-409b637f5e3b6dc968b7eac8b7183864a1d158717c507ed4a156479abf53b4e8.json
deleted file mode 100644
index 4dc6854094..0000000000
--- a/.sqlx/query-409b637f5e3b6dc968b7eac8b7183864a1d158717c507ed4a156479abf53b4e8.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT message_id FROM slack_import_message_map",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "message_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "409b637f5e3b6dc968b7eac8b7183864a1d158717c507ed4a156479abf53b4e8"
-}
diff --git a/.sqlx/query-409e5f09ab3126ed9c799e4764d868e7ef5f099a49f3b792ddaedd57c34e14e6.json b/.sqlx/query-409e5f09ab3126ed9c799e4764d868e7ef5f099a49f3b792ddaedd57c34e14e6.json
deleted file mode 100644
index 721204ee50..0000000000
--- a/.sqlx/query-409e5f09ab3126ed9c799e4764d868e7ef5f099a49f3b792ddaedd57c34e14e6.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"DocumentBom\" (\"documentId\") VALUES ($1) RETURNING id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "409e5f09ab3126ed9c799e4764d868e7ef5f099a49f3b792ddaedd57c34e14e6"
-}
diff --git a/.sqlx/query-40af4bc51382276ca7165b935d1a9231fa2900cf771f3b7b28c1323c99dc883c.json b/.sqlx/query-40af4bc51382276ca7165b935d1a9231fa2900cf771f3b7b28c1323c99dc883c.json
deleted file mode 100644
index 4c5df83139..0000000000
--- a/.sqlx/query-40af4bc51382276ca7165b935d1a9231fa2900cf771f3b7b28c1323c99dc883c.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT COUNT(*) FROM \"Project\") AS \"projects!\",\n (SELECT COUNT(*) FROM entity) AS \"entities!\",\n (SELECT COUNT(*) FROM entity_access) AS \"grants!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "projects!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "entities!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "grants!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null,
- null,
- null
- ]
- },
- "hash": "40af4bc51382276ca7165b935d1a9231fa2900cf771f3b7b28c1323c99dc883c"
-}
diff --git a/.sqlx/query-415513ad29c49b81ef3e9ad7c54637d2a6b70515bdf30c1fe1c3bc89bf39928f.json b/.sqlx/query-415513ad29c49b81ef3e9ad7c54637d2a6b70515bdf30c1fe1c3bc89bf39928f.json
deleted file mode 100644
index 63d1e47006..0000000000
--- a/.sqlx/query-415513ad29c49b81ef3e9ad7c54637d2a6b70515bdf30c1fe1c3bc89bf39928f.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ('macro|[email protected]', '[email protected]', 'd2000000-0000-0000-0000-000000000002')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "415513ad29c49b81ef3e9ad7c54637d2a6b70515bdf30c1fe1c3bc89bf39928f"
-}
diff --git a/.sqlx/query-41773e640798f98e03056f516a5df7e7ef225f967b477197924296d0a5f49c13.json b/.sqlx/query-41773e640798f98e03056f516a5df7e7ef225f967b477197924296d0a5f49c13.json
deleted file mode 100644
index e6aeb7771d..0000000000
--- a/.sqlx/query-41773e640798f98e03056f516a5df7e7ef225f967b477197924296d0a5f49c13.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, \"sha\", \"path\" FROM \"BomPart\"\n WHERE \"documentBomId\" = $1;\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "sha",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "path",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "41773e640798f98e03056f516a5df7e7ef225f967b477197924296d0a5f49c13"
-}
diff --git a/.sqlx/query-41b85fd7785e6c05bb6b710d5e0c4c524180eb49e95de51fb95dc6fc8cf56a7d.json b/.sqlx/query-41b85fd7785e6c05bb6b710d5e0c4c524180eb49e95de51fb95dc6fc8cf56a7d.json
deleted file mode 100644
index bf09778c54..0000000000
--- a/.sqlx/query-41b85fd7785e6c05bb6b710d5e0c4c524180eb49e95de51fb95dc6fc8cf56a7d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_threads (id, link_id) VALUES ($1, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "41b85fd7785e6c05bb6b710d5e0c4c524180eb49e95de51fb95dc6fc8cf56a7d"
-}
diff --git a/.sqlx/query-41f74379907081bd7bca8a2453f51312eca5cd57176f615f72fc0fbee455bbb2.json b/.sqlx/query-41f74379907081bd7bca8a2453f51312eca5cd57176f615f72fc0fbee455bbb2.json
deleted file mode 100644
index b74f32c6ca..0000000000
--- a/.sqlx/query-41f74379907081bd7bca8a2453f51312eca5cd57176f615f72fc0fbee455bbb2.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET claimed = $2, claim_token = $3 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "41f74379907081bd7bca8a2453f51312eca5cd57176f615f72fc0fbee455bbb2"
-}
diff --git a/.sqlx/query-42b88973ab31145895857f5bcae7ad85f50146513f21b3ce12efd4a295e2e3af.json b/.sqlx/query-42b88973ab31145895857f5bcae7ad85f50146513f21b3ce12efd4a295e2e3af.json
deleted file mode 100644
index 2d1a717019..0000000000
--- a/.sqlx/query-42b88973ab31145895857f5bcae7ad85f50146513f21b3ce12efd4a295e2e3af.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET claim_token = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "42b88973ab31145895857f5bcae7ad85f50146513f21b3ce12efd4a295e2e3af"
-}
diff --git a/.sqlx/query-430ee6519c72200b7a1b911d0f85d3860085500cf9e88ef696ebb77d5345e9a6.json b/.sqlx/query-430ee6519c72200b7a1b911d0f85d3860085500cf9e88ef696ebb77d5345e9a6.json
deleted file mode 100644
index c8fb053e2f..0000000000
--- a/.sqlx/query-430ee6519c72200b7a1b911d0f85d3860085500cf9e88ef696ebb77d5345e9a6.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT created_at FROM comms_reactions WHERE message_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "430ee6519c72200b7a1b911d0f85d3860085500cf9e88ef696ebb77d5345e9a6"
-}
diff --git a/.sqlx/query-43d36c997fba93604673047e1b20134f434a08c57491fe853ace520bbc9fbfcb.json b/.sqlx/query-43d36c997fba93604673047e1b20134f434a08c57491fe853ace520bbc9fbfcb.json
deleted file mode 100644
index 065f156fe5..0000000000
--- a/.sqlx/query-43d36c997fba93604673047e1b20134f434a08c57491fe853ace520bbc9fbfcb.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE \"SharePermission\" SET \"linkShare\" = NULL, \"linkShareAccessLevel\" = NULL\n WHERE id = 'session-public'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "43d36c997fba93604673047e1b20134f434a08c57491fe853ace520bbc9fbfcb"
-}
diff --git a/.sqlx/query-43f8d11343322110949319887587bb6379e6347e180608651ac13a9574f1fb25.json b/.sqlx/query-43f8d11343322110949319887587bb6379e6347e180608651ac13a9574f1fb25.json
deleted file mode 100644
index ca08c25ef4..0000000000
--- a/.sqlx/query-43f8d11343322110949319887587bb6379e6347e180608651ac13a9574f1fb25.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO frecency_aggregates (\n entity_id, entity_type, user_id, event_count,\n frecency_score, first_event, recent_events\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text",
- "Int4",
- "Float8",
- "Timestamptz",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "43f8d11343322110949319887587bb6379e6347e180608651ac13a9574f1fb25"
-}
diff --git a/.sqlx/query-4420bff6bddf7c7f5c1dd886322c258f062f5fd7eef77bcbd9c628b1a6e504b7.json b/.sqlx/query-4420bff6bddf7c7f5c1dd886322c258f062f5fd7eef77bcbd9c628b1a6e504b7.json
new file mode 100644
index 0000000000..c8e0d87eaa
--- /dev/null
+++ b/.sqlx/query-4420bff6bddf7c7f5c1dd886322c258f062f5fd7eef77bcbd9c628b1a6e504b7.json
@@ -0,0 +1,24 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT COALESCE(SUM(amount_cents), 0)::bigint AS \"spent!\"\n FROM ai_credit_reload\n WHERE user_id = $1\n AND (status <> 'failed' OR stripe_invoice_id IS NOT NULL)\n AND created_at >= $2\n AND created_at < $3\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "spent!",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Timestamptz",
+ "Timestamptz"
+ ]
+ },
+ "nullable": [
+ null
+ ]
+ },
+ "hash": "4420bff6bddf7c7f5c1dd886322c258f062f5fd7eef77bcbd9c628b1a6e504b7"
+}
diff --git a/.sqlx/query-4460ad8f431c3bd2d23106bba737743a674adec629cd79ebcda148fc6d39daed.json b/.sqlx/query-4460ad8f431c3bd2d23106bba737743a674adec629cd79ebcda148fc6d39daed.json
deleted file mode 100644
index 24601c7e75..0000000000
--- a/.sqlx/query-4460ad8f431c3bd2d23106bba737743a674adec629cd79ebcda148fc6d39daed.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET claimed = NULL WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "4460ad8f431c3bd2d23106bba737743a674adec629cd79ebcda148fc6d39daed"
-}
diff --git a/.sqlx/query-4466a1be8171a5eec965c61c6ed5089b87756a89255e6f5aad1886ed8ad7d541.json b/.sqlx/query-4466a1be8171a5eec965c61c6ed5089b87756a89255e6f5aad1886ed8ad7d541.json
deleted file mode 100644
index a54060d0a1..0000000000
--- a/.sqlx/query-4466a1be8171a5eec965c61c6ed5089b87756a89255e6f5aad1886ed8ad7d541.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT turn_state FROM agent_session WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "turn_state",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "4466a1be8171a5eec965c61c6ed5089b87756a89255e6f5aad1886ed8ad7d541"
-}
diff --git a/.sqlx/query-44d9f4c7e8e4cb6c672b4c93260ede6bf9798f7abaf013b3bd2eeb2911cf0180.json b/.sqlx/query-44d9f4c7e8e4cb6c672b4c93260ede6bf9798f7abaf013b3bd2eeb2911cf0180.json
deleted file mode 100644
index d8fa0fda29..0000000000
--- a/.sqlx/query-44d9f4c7e8e4cb6c672b4c93260ede6bf9798f7abaf013b3bd2eeb2911cf0180.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_view_positions (view_id, row_id, lane, position)\n VALUES ($1, $2, $3, '80'), ($1, $4, '', '80')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "44d9f4c7e8e4cb6c672b4c93260ede6bf9798f7abaf013b3bd2eeb2911cf0180"
-}
diff --git a/.sqlx/query-452679773633600344e0618a01b5d653a5f4cd42e6150402eb4adbb8f3f894dc.json b/.sqlx/query-452679773633600344e0618a01b5d653a5f4cd42e6150402eb4adbb8f3f894dc.json
deleted file mode 100644
index 89082691b0..0000000000
--- a/.sqlx/query-452679773633600344e0618a01b5d653a5f4cd42e6150402eb4adbb8f3f894dc.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_rows (id, table_id, position) VALUES ($1, $2, '80')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "452679773633600344e0618a01b5d653a5f4cd42e6150402eb4adbb8f3f894dc"
-}
diff --git a/.sqlx/query-45d9583e8b5a6a89e339a1299cfe1a1971381c54106c0487256af27f3d2f55e1.json b/.sqlx/query-45d9583e8b5a6a89e339a1299cfe1a1971381c54106c0487256af27f3d2f55e1.json
deleted file mode 100644
index eb5fa5f3f2..0000000000
--- a/.sqlx/query-45d9583e8b5a6a89e339a1299cfe1a1971381c54106c0487256af27f3d2f55e1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_companies (id, team_id, first_interaction, last_interaction)\n VALUES ($1, $2, now(), now())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "45d9583e8b5a6a89e339a1299cfe1a1971381c54106c0487256af27f3d2f55e1"
-}
diff --git a/.sqlx/query-46d2ff64b6b9a3b0a6806b50c9e039b33687b8c60bd59f1495a6f727c9493be4.json b/.sqlx/query-46d2ff64b6b9a3b0a6806b50c9e039b33687b8c60bd59f1495a6f727c9493be4.json
deleted file mode 100644
index bb3b0c0e29..0000000000
--- a/.sqlx/query-46d2ff64b6b9a3b0a6806b50c9e039b33687b8c60bd59f1495a6f727c9493be4.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET event_activated_at = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "46d2ff64b6b9a3b0a6806b50c9e039b33687b8c60bd59f1495a6f727c9493be4"
-}
diff --git a/.sqlx/query-46daa61a3a837c75426b48340931a5988793eee1696bfabacb989b458275fd44.json b/.sqlx/query-46daa61a3a837c75426b48340931a5988793eee1696bfabacb989b458275fd44.json
deleted file mode 100644
index 1cddc761cf..0000000000
--- a/.sqlx/query-46daa61a3a837c75426b48340931a5988793eee1696bfabacb989b458275fd44.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT owner_type::text AS \"owner_type!\", owner_id,\n (SELECT COUNT(*) FROM \"UserHistory\" WHERE \"itemId\" = $1) AS \"user_history_rows!\"\n FROM entity\n WHERE id::text = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "user_history_rows!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null,
- false,
- null
- ]
- },
- "hash": "46daa61a3a837c75426b48340931a5988793eee1696bfabacb989b458275fd44"
-}
diff --git a/.sqlx/query-470f8419ac20eb1d30f491e84a79bf19934da3e557606db0e36f96d1b3de953a.json b/.sqlx/query-470f8419ac20eb1d30f491e84a79bf19934da3e557606db0e36f96d1b3de953a.json
deleted file mode 100644
index 6cf34d1db8..0000000000
--- a/.sqlx/query-470f8419ac20eb1d30f491e84a79bf19934da3e557606db0e36f96d1b3de953a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE call_records SET channel_id = NULL WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "470f8419ac20eb1d30f491e84a79bf19934da3e557606db0e36f96d1b3de953a"
-}
diff --git a/.sqlx/query-472628032919f5ea7bb596cf5c4fd729bdbd32924fa927df0deb215f8b85981a.json b/.sqlx/query-472628032919f5ea7bb596cf5c4fd729bdbd32924fa927df0deb215f8b85981a.json
deleted file mode 100644
index d1aa76ad25..0000000000
--- a/.sqlx/query-472628032919f5ea7bb596cf5c4fd729bdbd32924fa927df0deb215f8b85981a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT count(*) AS \"count!\"\n FROM agent_session_queue\n WHERE agent_session_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "472628032919f5ea7bb596cf5c4fd729bdbd32924fa927df0deb215f8b85981a"
-}
diff --git a/.sqlx/query-486f15bfd292acec985998d529e538b0e4805c9390b6a2c09e89921df3293f97.json b/.sqlx/query-486f15bfd292acec985998d529e538b0e4805c9390b6a2c09e89921df3293f97.json
deleted file mode 100644
index 5dd276aa74..0000000000
--- a/.sqlx/query-486f15bfd292acec985998d529e538b0e4805c9390b6a2c09e89921df3293f97.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session SET created_at = NOW() - INTERVAL '11 minutes' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "486f15bfd292acec985998d529e538b0e4805c9390b6a2c09e89921df3293f97"
-}
diff --git a/.sqlx/query-48bd4e72b43cd79c1200d1ff0c3449002826f5e7cb51a22311649bea6d35e15e.json b/.sqlx/query-48bd4e72b43cd79c1200d1ff0c3449002826f5e7cb51a22311649bea6d35e15e.json
deleted file mode 100644
index 3634f14323..0000000000
--- a/.sqlx/query-48bd4e72b43cd79c1200d1ff0c3449002826f5e7cb51a22311649bea6d35e15e.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $2, $3)\n ON CONFLICT (id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "48bd4e72b43cd79c1200d1ff0c3449002826f5e7cb51a22311649bea6d35e15e"
-}
diff --git a/.sqlx/query-4992c5ea6f7ec3063ca7c262f785894d40e36b7a3fb6c1e8b773a5a38961a546.json b/.sqlx/query-4992c5ea6f7ec3063ca7c262f785894d40e36b7a3fb6c1e8b773a5a38961a546.json
deleted file mode 100644
index 212685949f..0000000000
--- a/.sqlx/query-4992c5ea6f7ec3063ca7c262f785894d40e36b7a3fb6c1e8b773a5a38961a546.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'CRM team', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4992c5ea6f7ec3063ca7c262f785894d40e36b7a3fb6c1e8b773a5a38961a546"
-}
diff --git a/.sqlx/query-49fb81179d4ceb002cbc92bda592b765422b3c2f29839edecdcfa9995e821eb3.json b/.sqlx/query-49fb81179d4ceb002cbc92bda592b765422b3c2f29839edecdcfa9995e821eb3.json
deleted file mode 100644
index 0fb17a5c0b..0000000000
--- a/.sqlx/query-49fb81179d4ceb002cbc92bda592b765422b3c2f29839edecdcfa9995e821eb3.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_messages (id, link_id, thread_id, subject, is_draft, is_sent) VALUES ($1, $2, $3, 'confirmed content', true, false)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "49fb81179d4ceb002cbc92bda592b765422b3c2f29839edecdcfa9995e821eb3"
-}
diff --git a/.sqlx/query-4a126845898ffc207a6ca3713374086ca8462a6ebffe8d6c003d3301fdec8c77.json b/.sqlx/query-4a126845898ffc207a6ca3713374086ca8462a6ebffe8d6c003d3301fdec8c77.json
deleted file mode 100644
index 1e5eff5c9f..0000000000
--- a/.sqlx/query-4a126845898ffc207a6ca3713374086ca8462a6ebffe8d6c003d3301fdec8c77.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team(id, name, owner_id) VALUES ($1, 'test', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4a126845898ffc207a6ca3713374086ca8462a6ebffe8d6c003d3301fdec8c77"
-}
diff --git a/.sqlx/query-4b3dad3dbb00432113ba9aaeeb70576ff24ab960b1ac5bfe5ca8a3d7dc42d3d5.json b/.sqlx/query-4b3dad3dbb00432113ba9aaeeb70576ff24ab960b1ac5bfe5ca8a3d7dc42d3d5.json
deleted file mode 100644
index 1dff5996b9..0000000000
--- a/.sqlx/query-4b3dad3dbb00432113ba9aaeeb70576ff24ab960b1ac5bfe5ca8a3d7dc42d3d5.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, owner_id)\n VALUES ($1, 'Call chat test', 'public', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4b3dad3dbb00432113ba9aaeeb70576ff24ab960b1ac5bfe5ca8a3d7dc42d3d5"
-}
diff --git a/.sqlx/query-4b68bd9e023bf62f14bf8848f9f2d94fa59e692d412219a7e9edaec5f394cba3.json b/.sqlx/query-4b68bd9e023bf62f14bf8848f9f2d94fa59e692d412219a7e9edaec5f394cba3.json
deleted file mode 100644
index 9fcddbaf9f..0000000000
--- a/.sqlx/query-4b68bd9e023bf62f14bf8848f9f2d94fa59e692d412219a7e9edaec5f394cba3.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM webhook_delivery_attempt WHERE webhook_delivery_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "4b68bd9e023bf62f14bf8848f9f2d94fa59e692d412219a7e9edaec5f394cba3"
-}
diff --git a/.sqlx/query-4c06c20732d36578c86bcfe55a58b0b63d82a57e0871837943d00bf29889c7c9.json b/.sqlx/query-4c06c20732d36578c86bcfe55a58b0b63d82a57e0871837943d00bf29889c7c9.json
deleted file mode 100644
index b76149e70d..0000000000
--- a/.sqlx/query-4c06c20732d36578c86bcfe55a58b0b63d82a57e0871837943d00bf29889c7c9.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ($1, '[email protected]', $2), ('macro|[email protected]', '[email protected]', $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "4c06c20732d36578c86bcfe55a58b0b63d82a57e0871837943d00bf29889c7c9"
-}
diff --git a/.sqlx/query-4c54bcf9277edde8c40c993bde999e25c425d6f632af80043ad012bf29607629.json b/.sqlx/query-4c54bcf9277edde8c40c993bde999e25c425d6f632af80043ad012bf29607629.json
deleted file mode 100644
index a454b049e9..0000000000
--- a/.sqlx/query-4c54bcf9277edde8c40c993bde999e25c425d6f632af80043ad012bf29607629.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT values as \"values: serde_json::Value\"\n FROM entity_properties\n WHERE entity_id = $1 AND entity_type = 'DOCUMENT' AND property_definition_id = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "values: serde_json::Value",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "4c54bcf9277edde8c40c993bde999e25c425d6f632af80043ad012bf29607629"
-}
diff --git a/.sqlx/query-4c5a7613d85a7b1f1e336256b2dd7f8a89f6b82418086dc1de8914e9d3879fd7.json b/.sqlx/query-4c5a7613d85a7b1f1e336256b2dd7f8a89f6b82418086dc1de8914e9d3879fd7.json
deleted file mode 100644
index 4729d6f441..0000000000
--- a/.sqlx/query-4c5a7613d85a7b1f1e336256b2dd7f8a89f6b82418086dc1de8914e9d3879fd7.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT name, created_at, auto_join_team, team_id FROM comms_channels WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "name",
- "type_info": "Varchar"
- },
- {
- "ordinal": 1,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "auto_join_team",
- "type_info": "Bool"
- },
- {
- "ordinal": 3,
- "name": "team_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- false,
- false,
- true
- ]
- },
- "hash": "4c5a7613d85a7b1f1e336256b2dd7f8a89f6b82418086dc1de8914e9d3879fd7"
-}
diff --git a/.sqlx/query-4d90616f23512f6162c8a89b98b49224dd1e73823c74fe56eddfa4c761154982.json b/.sqlx/query-4d90616f23512f6162c8a89b98b49224dd1e73823c74fe56eddfa4c761154982.json
deleted file mode 100644
index 70663f60ef..0000000000
--- a/.sqlx/query-4d90616f23512f6162c8a89b98b49224dd1e73823c74fe56eddfa4c761154982.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"createdAt\", \"updatedAt\" FROM \"Pin\" WHERE \"userId\" = $1 AND \"pinnedItemId\" = $2 and \"pinnedItemType\" = $3\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "createdAt",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 1,
- "name": "updatedAt",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "4d90616f23512f6162c8a89b98b49224dd1e73823c74fe56eddfa4c761154982"
-}
diff --git a/.sqlx/query-4dc8e5fb101c7e05efde4720e9dc538eecf360dc1e872223634a96df79678418.json b/.sqlx/query-4dc8e5fb101c7e05efde4720e9dc538eecf360dc1e872223634a96df79678418.json
deleted file mode 100644
index 692e031df3..0000000000
--- a/.sqlx/query-4dc8e5fb101c7e05efde4720e9dc538eecf360dc1e872223634a96df79678418.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT source_created_at, resolved_created_at, creator_id, message_count FROM slack_import_conversation WHERE job_id = $1 AND slack_channel_id = 'D1'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_created_at",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "resolved_created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "creator_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "message_count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true,
- true,
- true
- ]
- },
- "hash": "4dc8e5fb101c7e05efde4720e9dc538eecf360dc1e872223634a96df79678418"
-}
diff --git a/.sqlx/query-4e2894aae898f12e69659f42fadb83c5594fc79a6da0cd357d9cd0a5133bdbf5.json b/.sqlx/query-4e2894aae898f12e69659f42fadb83c5594fc79a6da0cd357d9cd0a5133bdbf5.json
deleted file mode 100644
index 1cb334cf80..0000000000
--- a/.sqlx/query-4e2894aae898f12e69659f42fadb83c5594fc79a6da0cd357d9cd0a5133bdbf5.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE call_records SET summary = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4e2894aae898f12e69659f42fadb83c5594fc79a6da0cd357d9cd0a5133bdbf5"
-}
diff --git a/.sqlx/query-4e84745f9618a807c80b74ad581730db76a0d75d20ed029798842e715fac125c.json b/.sqlx/query-4e84745f9618a807c80b74ad581730db76a0d75d20ed029798842e715fac125c.json
deleted file mode 100644
index 88ff73d8ab..0000000000
--- a/.sqlx/query-4e84745f9618a807c80b74ad581730db76a0d75d20ed029798842e715fac125c.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, thread_id, sender_id, content, created_at)\n VALUES ($1, 'channel', $2, $3, 'macro|[email protected]', 'reply', '2020-01-02T00:00:00Z'),\n ($4, 'document', 'doc-backfill-test', NULL, 'macro|[email protected]', 'document', '2020-01-02T00:00:00Z')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "4e84745f9618a807c80b74ad581730db76a0d75d20ed029798842e715fac125c"
-}
diff --git a/.sqlx/query-2b085d52dfc73a35dd75163a923febcc32c778880e83d4eb497c6a78067aa0d8.json b/.sqlx/query-4f25e6bdf690f0821ea3b3d950dcdc0698aad890f5ba0125de6c1e746943c469.json
similarity index 54%
rename from .sqlx/query-2b085d52dfc73a35dd75163a923febcc32c778880e83d4eb497c6a78067aa0d8.json
rename to .sqlx/query-4f25e6bdf690f0821ea3b3d950dcdc0698aad890f5ba0125de6c1e746943c469.json
index 03e524a0fe..48ec8ab359 100644
--- a/.sqlx/query-2b085d52dfc73a35dd75163a923febcc32c778880e83d4eb497c6a78067aa0d8.json
+++ b/.sqlx/query-4f25e6bdf690f0821ea3b3d950dcdc0698aad890f5ba0125de6c1e746943c469.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT overage_enabled, overage_limit_cents, overage_suspended_at,\n period_start, period_end, seat_generation\n FROM ai_billing_account\n WHERE user_id = $1\n ",
+ "query": "\n SELECT overage_enabled, overage_limit_cents, overage_suspended_at,\n auto_reload_minimum_cents, auto_reload_target_cents,\n auto_reload_monthly_limit_cents, auto_reload_suspended_at\n FROM ai_billing_account\n WHERE user_id = $1\n ",
"describe": {
"columns": [
{
@@ -20,18 +20,23 @@
},
{
"ordinal": 3,
- "name": "period_start",
- "type_info": "Timestamptz"
+ "name": "auto_reload_minimum_cents",
+ "type_info": "Int8"
},
{
"ordinal": 4,
- "name": "period_end",
- "type_info": "Timestamptz"
+ "name": "auto_reload_target_cents",
+ "type_info": "Int8"
},
{
"ordinal": 5,
- "name": "seat_generation",
+ "name": "auto_reload_monthly_limit_cents",
"type_info": "Int8"
+ },
+ {
+ "ordinal": 6,
+ "name": "auto_reload_suspended_at",
+ "type_info": "Timestamptz"
}
],
"parameters": {
@@ -43,10 +48,11 @@
false,
false,
true,
+ false,
+ false,
true,
- true,
- false
+ true
]
},
- "hash": "2b085d52dfc73a35dd75163a923febcc32c778880e83d4eb497c6a78067aa0d8"
+ "hash": "4f25e6bdf690f0821ea3b3d950dcdc0698aad890f5ba0125de6c1e746943c469"
}
diff --git a/.sqlx/query-4f9c9564c14f2154a8d8765c41179495d295ab0c6dd659dfe60881b1d6c64480.json b/.sqlx/query-4f9c9564c14f2154a8d8765c41179495d295ab0c6dd659dfe60881b1d6c64480.json
deleted file mode 100644
index f78b0f956b..0000000000
--- a/.sqlx/query-4f9c9564c14f2154a8d8765c41179495d295ab0c6dd659dfe60881b1d6c64480.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n VALUES ($1, 'database', $4, 'user', 'view'),\n ($1, 'database', $5, 'team', 'edit'),\n ($2, 'database', $4, 'user', 'owner'),\n ($2, 'chat', $4, 'user', 'view'),\n ($3, 'database', $6, 'user', 'owner')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid",
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4f9c9564c14f2154a8d8765c41179495d295ab0c6dd659dfe60881b1d6c64480"
-}
diff --git a/.sqlx/query-4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d.json b/.sqlx/query-4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d.json
deleted file mode 100644
index 71d62aeb00..0000000000
--- a/.sqlx/query-4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET left_at = now() WHERE channel_id = $1 AND user_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4fc233f6f1e289e9acb848611c00b92d5c783802d3df1ff5a2893888246a960d"
-}
diff --git a/.sqlx/query-4fd6e422ff633b1d851637e9991401dd8abeaff2a11a3c95f30f427123e3ad68.json b/.sqlx/query-4fd6e422ff633b1d851637e9991401dd8abeaff2a11a3c95f30f427123e3ad68.json
deleted file mode 100644
index e724baf4dd..0000000000
--- a/.sqlx/query-4fd6e422ff633b1d851637e9991401dd8abeaff2a11a3c95f30f427123e3ad68.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE initiative\n SET updated_at = now()\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "4fd6e422ff633b1d851637e9991401dd8abeaff2a11a3c95f30f427123e3ad68"
-}
diff --git a/.sqlx/query-4ff2b8958c1096283c433a4f3169d4a22062e3b37987eb55b7afdd3024cd11ae.json b/.sqlx/query-4ff2b8958c1096283c433a4f3169d4a22062e3b37987eb55b7afdd3024cd11ae.json
deleted file mode 100644
index 95449dd764..0000000000
--- a/.sqlx/query-4ff2b8958c1096283c433a4f3169d4a22062e3b37987eb55b7afdd3024cd11ae.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE call_participants SET left_at = now() WHERE call_id = $1 AND user_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "4ff2b8958c1096283c433a4f3169d4a22062e3b37987eb55b7afdd3024cd11ae"
-}
diff --git a/.sqlx/query-5021113af6bb370e324911c7b2e4a5bd772764f9b0649504b998465a8aba81f1.json b/.sqlx/query-5021113af6bb370e324911c7b2e4a5bd772764f9b0649504b998465a8aba81f1.json
deleted file mode 100644
index 194e7ec561..0000000000
--- a/.sqlx/query-5021113af6bb370e324911c7b2e4a5bd772764f9b0649504b998465a8aba81f1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT claim_token FROM scheduled_action WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "claim_token",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "5021113af6bb370e324911c7b2e4a5bd772764f9b0649504b998465a8aba81f1"
-}
diff --git a/.sqlx/query-50b96d640b2a960215c974fd09b9757b9c900ab89b71393e32535ca67634487c.json b/.sqlx/query-50b96d640b2a960215c974fd09b9757b9c900ab89b71393e32535ca67634487c.json
deleted file mode 100644
index 507a695306..0000000000
--- a/.sqlx/query-50b96d640b2a960215c974fd09b9757b9c900ab89b71393e32535ca67634487c.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT pg_advisory_lock(27001)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pg_advisory_lock",
- "type_info": "Void"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "50b96d640b2a960215c974fd09b9757b9c900ab89b71393e32535ca67634487c"
-}
diff --git a/.sqlx/query-50bac6ea88878c0dc615156727eba8a2bf4eb4efcb858c6faecf5a14fad201d2.json b/.sqlx/query-50bac6ea88878c0dc615156727eba8a2bf4eb4efcb858c6faecf5a14fad201d2.json
deleted file mode 100644
index c2b6718960..0000000000
--- a/.sqlx/query-50bac6ea88878c0dc615156727eba8a2bf4eb4efcb858c6faecf5a14fad201d2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT inverse FROM database_changes WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "inverse",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "50bac6ea88878c0dc615156727eba8a2bf4eb4efcb858c6faecf5a14fad201d2"
-}
diff --git a/.sqlx/query-50dfd858334dd888d95f2e8404367af8fde56df34e05272846994f54797343d4.json b/.sqlx/query-50dfd858334dd888d95f2e8404367af8fde56df34e05272846994f54797343d4.json
deleted file mode 100644
index abdb359760..0000000000
--- a/.sqlx/query-50dfd858334dd888d95f2e8404367af8fde56df34e05272846994f54797343d4.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, 'followup', '[email protected]', 'followup')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "50dfd858334dd888d95f2e8404367af8fde56df34e05272846994f54797343d4"
-}
diff --git a/.sqlx/query-512c17ff4d9aea7aad64bdfae21e655e186be19ebf67205610934cfda0039999.json b/.sqlx/query-512c17ff4d9aea7aad64bdfae21e655e186be19ebf67205610934cfda0039999.json
deleted file mode 100644
index d0ddd066d4..0000000000
--- a/.sqlx/query-512c17ff4d9aea7aad64bdfae21e655e186be19ebf67205610934cfda0039999.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT change_id, row_id, kind, columns FROM database_change_rows\n ORDER BY change_id, row_id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "change_id",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "row_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "kind",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "columns",
- "type_info": "UuidArray"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false,
- false
- ]
- },
- "hash": "512c17ff4d9aea7aad64bdfae21e655e186be19ebf67205610934cfda0039999"
-}
diff --git a/.sqlx/query-5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee.json b/.sqlx/query-5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee.json
deleted file mode 100644
index 43c54438a5..0000000000
--- a/.sqlx/query-5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO calendar_accounts (\n id, owner_id, email_link_id, provider, provider_account_id\n )\n VALUES ($1, $2, $3, 'google', $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5244b960cd63a70408aef8ba2b4bc5a8c78819f16c5ff4dbd9dcc5525d3da5ee"
-}
diff --git a/.sqlx/query-526d0d03d698cedf01017f32d59a864b92521d97afe0175685da55c675e71c77.json b/.sqlx/query-526d0d03d698cedf01017f32d59a864b92521d97afe0175685da55c675e71c77.json
deleted file mode 100644
index 8295651eb7..0000000000
--- a/.sqlx/query-526d0d03d698cedf01017f32d59a864b92521d97afe0175685da55c675e71c77.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT job_id, message_id FROM slack_import_message_reference",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "job_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "message_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "526d0d03d698cedf01017f32d59a864b92521d97afe0175685da55c675e71c77"
-}
diff --git a/.sqlx/query-5307e0b89349055b2045f1a14c302ce32b1ac6b2869e91a54bbb24dd656bd76d.json b/.sqlx/query-5307e0b89349055b2045f1a14c302ce32b1ac6b2869e91a54bbb24dd656bd76d.json
deleted file mode 100644
index 2338a5e93c..0000000000
--- a/.sqlx/query-5307e0b89349055b2045f1a14c302ce32b1ac6b2869e91a54bbb24dd656bd76d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE \"Document\" SET \"deletedAt\" = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5307e0b89349055b2045f1a14c302ce32b1ac6b2869e91a54bbb24dd656bd76d"
-}
diff --git a/.sqlx/query-530c0fb037a3cbe47247b1ead4652072630923c20f1b7579c57c212845216836.json b/.sqlx/query-530c0fb037a3cbe47247b1ead4652072630923c20f1b7579c57c212845216836.json
deleted file mode 100644
index acbd1fd347..0000000000
--- a/.sqlx/query-530c0fb037a3cbe47247b1ead4652072630923c20f1b7579c57c212845216836.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"Project\" (\"id\", \"name\", \"userId\", \"deletedAt\")\n VALUES ('p1', 'd', 'macro|[email protected]', '2019-10-16 00:00:00')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "530c0fb037a3cbe47247b1ead4652072630923c20f1b7579c57c212845216836"
-}
diff --git a/.sqlx/query-5343d5820d16618ef702cebdd513d324060fb473a5215fc7f86896004238155b.json b/.sqlx/query-5343d5820d16618ef702cebdd513d324060fb473a5215fc7f86896004238155b.json
deleted file mode 100644
index 51dd2b0704..0000000000
--- a/.sqlx/query-5343d5820d16618ef702cebdd513d324060fb473a5215fc7f86896004238155b.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO bots (id, kind, owner_user_id, name, handle, has_agent)\n VALUES ($1, 'owned', $2, 'Other agent', $3, true)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5343d5820d16618ef702cebdd513d324060fb473a5215fc7f86896004238155b"
-}
diff --git a/.sqlx/query-534c8ac63fa4fb0bd49d0eb006ca9ff8a342d4b281ebc78a2c98c9773c0a5619.json b/.sqlx/query-534c8ac63fa4fb0bd49d0eb006ca9ff8a342d4b281ebc78a2c98c9773c0a5619.json
deleted file mode 100644
index 467e3743ff..0000000000
--- a/.sqlx/query-534c8ac63fa4fb0bd49d0eb006ca9ff8a342d4b281ebc78a2c98c9773c0a5619.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_domains (company_id, team_id, domain) VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "534c8ac63fa4fb0bd49d0eb006ca9ff8a342d4b281ebc78a2c98c9773c0a5619"
-}
diff --git a/.sqlx/query-5392d04a21e2f3c41dc84a6193f1cd004c9c571ae61a47c448a4f1e28f678255.json b/.sqlx/query-5392d04a21e2f3c41dc84a6193f1cd004c9c571ae61a47c448a4f1e28f678255.json
deleted file mode 100644
index 1b6e64017a..0000000000
--- a/.sqlx/query-5392d04a21e2f3c41dc84a6193f1cd004c9c571ae61a47c448a4f1e28f678255.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"UserApiKey\" (id, name, user_id, hash)\n VALUES ($1, $2, $3, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Bytea"
- ]
- },
- "nullable": []
- },
- "hash": "5392d04a21e2f3c41dc84a6193f1cd004c9c571ae61a47c448a4f1e28f678255"
-}
diff --git a/.sqlx/query-53aab496584e71041d3d2c380e6bb8b82d175b956b857bde826728c726f98718.json b/.sqlx/query-53aab496584e71041d3d2c380e6bb8b82d175b956b857bde826728c726f98718.json
deleted file mode 100644
index 83cda06d30..0000000000
--- a/.sqlx/query-53aab496584e71041d3d2c380e6bb8b82d175b956b857bde826728c726f98718.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"User\" (id, email, macro_user_id)\n VALUES ($1, $1, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "53aab496584e71041d3d2c380e6bb8b82d175b956b857bde826728c726f98718"
-}
diff --git a/.sqlx/query-5404d007fe2d2b712c0ea9d037dbb7fb6a3887246f99d2de01eaa6e279d9fd43.json b/.sqlx/query-5404d007fe2d2b712c0ea9d037dbb7fb6a3887246f99d2de01eaa6e279d9fd43.json
deleted file mode 100644
index 4d9369017b..0000000000
--- a/.sqlx/query-5404d007fe2d2b712c0ea9d037dbb7fb6a3887246f99d2de01eaa6e279d9fd43.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"Document\" (id, name, owner)\n VALUES ($1, $2, 'macro|[email protected]')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5404d007fe2d2b712c0ea9d037dbb7fb6a3887246f99d2de01eaa6e279d9fd43"
-}
diff --git a/.sqlx/query-5417eeb2b1d7b6a1185f10ecb03a3bd66ae34884eb5b99494a041caa4c6df25a.json b/.sqlx/query-5417eeb2b1d7b6a1185f10ecb03a3bd66ae34884eb5b99494a041caa4c6df25a.json
deleted file mode 100644
index 6f73cacc1b..0000000000
--- a/.sqlx/query-5417eeb2b1d7b6a1185f10ecb03a3bd66ae34884eb5b99494a041caa4c6df25a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT event_generation FROM slack_import_conversation WHERE job_id = $1 AND slack_channel_id = 'C1'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "event_generation",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "5417eeb2b1d7b6a1185f10ecb03a3bd66ae34884eb5b99494a041caa4c6df25a"
-}
diff --git a/.sqlx/query-54ba620d9d2e75a6cff4e824c769db16182a94cc30e5d69a9fc481a13dd08c49.json b/.sqlx/query-54ba620d9d2e75a6cff4e824c769db16182a94cc30e5d69a9fc481a13dd08c49.json
deleted file mode 100644
index 828e110c77..0000000000
--- a/.sqlx/query-54ba620d9d2e75a6cff4e824c769db16182a94cc30e5d69a9fc481a13dd08c49.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_channel_participants (channel_id, user_id, role, left_at)\n VALUES ($1, $2, 'member'::comms_participant_role, NULL)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "54ba620d9d2e75a6cff4e824c769db16182a94cc30e5d69a9fc481a13dd08c49"
-}
diff --git a/.sqlx/query-55c45e9910ee3872af6feffea842117180eeb1eb8aa32f87538871443105a41b.json b/.sqlx/query-55c45e9910ee3872af6feffea842117180eeb1eb8aa32f87538871443105a41b.json
deleted file mode 100644
index 1ff1ebad09..0000000000
--- a/.sqlx/query-55c45e9910ee3872af6feffea842117180eeb1eb8aa32f87538871443105a41b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Document\" (id, name, owner, \"createdAt\", \"updatedAt\")\n SELECT id, 'notified benchmark', $2, '2024-06-02', '2024-06-02'\n FROM unnest($1::text[]) id",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "55c45e9910ee3872af6feffea842117180eeb1eb8aa32f87538871443105a41b"
-}
diff --git a/.sqlx/query-567b8d6383ddfe7d7a9fd1f5de9098d3d4194eb0ebf2d3954542127a78c440a7.json b/.sqlx/query-567b8d6383ddfe7d7a9fd1f5de9098d3d4194eb0ebf2d3954542127a78c440a7.json
deleted file mode 100644
index 88e6019276..0000000000
--- a/.sqlx/query-567b8d6383ddfe7d7a9fd1f5de9098d3d4194eb0ebf2d3954542127a78c440a7.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channel_participants (channel_id, user_id, role, joined_at, left_at) SELECT $1, user_id, role, joined_at, $3 FROM comms_channel_participants WHERE channel_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "567b8d6383ddfe7d7a9fd1f5de9098d3d4194eb0ebf2d3954542127a78c440a7"
-}
diff --git a/.sqlx/query-56cc24dab392220f41df911649f223d6b2793030ab7d1e3e300b815f1f8b0bd2.json b/.sqlx/query-56cc24dab392220f41df911649f223d6b2793030ab7d1e3e300b815f1f8b0bd2.json
deleted file mode 100644
index ddae577b81..0000000000
--- a/.sqlx/query-56cc24dab392220f41df911649f223d6b2793030ab7d1e3e300b815f1f8b0bd2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT last_accessed FROM \"ItemLastAccessed\" WHERE item_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "last_accessed",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "56cc24dab392220f41df911649f223d6b2793030ab7d1e3e300b815f1f8b0bd2"
-}
diff --git a/.sqlx/query-56f380911d1ece3f1a04ad73ffdf724d132c32f4971d533f7dbe0a42e283ebce.json b/.sqlx/query-56f380911d1ece3f1a04ad73ffdf724d132c32f4971d533f7dbe0a42e283ebce.json
deleted file mode 100644
index c55fe1a69c..0000000000
--- a/.sqlx/query-56f380911d1ece3f1a04ad73ffdf724d132c32f4971d533f7dbe0a42e283ebce.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id\n FROM comms_channels\n WHERE channel_type = 'direct_message'::comms_channel_type\n AND EXISTS (\n SELECT 1\n FROM comms_channel_participants cp\n WHERE cp.channel_id = comms_channels.id\n AND cp.user_id = $1\n )\n AND EXISTS (\n SELECT 1\n FROM comms_channel_participants cp\n WHERE cp.channel_id = comms_channels.id\n AND cp.user_id = $2\n )\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "56f380911d1ece3f1a04ad73ffdf724d132c32f4971d533f7dbe0a42e283ebce"
-}
diff --git a/.sqlx/query-575b2fcbff22f2e979f0e9bf10143459e72efb66b4a60d415852096f22990a2f.json b/.sqlx/query-575b2fcbff22f2e979f0e9bf10143459e72efb66b4a60d415852096f22990a2f.json
deleted file mode 100644
index a1d37c5727..0000000000
--- a/.sqlx/query-575b2fcbff22f2e979f0e9bf10143459e72efb66b4a60d415852096f22990a2f.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT team_id FROM owner_team($1)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "team_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "575b2fcbff22f2e979f0e9bf10143459e72efb66b4a60d415852096f22990a2f"
-}
diff --git a/.sqlx/query-58016ffa6318e7c7bf0a233c97d4cc039a0ce08ce6a42ca6bd2c5312cfaacbd4.json b/.sqlx/query-58016ffa6318e7c7bf0a233c97d4cc039a0ce08ce6a42ca6bd2c5312cfaacbd4.json
deleted file mode 100644
index 1b69f3a8b0..0000000000
--- a/.sqlx/query-58016ffa6318e7c7bf0a233c97d4cc039a0ce08ce6a42ca6bd2c5312cfaacbd4.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_reactions",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "58016ffa6318e7c7bf0a233c97d4cc039a0ce08ce6a42ca6bd2c5312cfaacbd4"
-}
diff --git a/.sqlx/query-58817807e0585c5994cbe5f65c38d7fd67060a3cf7e1204f325b3af8cf4ff31d.json b/.sqlx/query-58817807e0585c5994cbe5f65c38d7fd67060a3cf7e1204f325b3af8cf4ff31d.json
deleted file mode 100644
index 12c1006ba2..0000000000
--- a/.sqlx/query-58817807e0585c5994cbe5f65c38d7fd67060a3cf7e1204f325b3af8cf4ff31d.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT values AS \"values: serde_json::Value\" FROM entity_properties\n WHERE entity_id = $1 AND property_definition_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "values: serde_json::Value",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "58817807e0585c5994cbe5f65c38d7fd67060a3cf7e1204f325b3af8cf4ff31d"
-}
diff --git a/.sqlx/query-58c402543075bfc006f9b1b87d8d3939c94a7273f4e0e4378a4bfc34474ce65d.json b/.sqlx/query-58c402543075bfc006f9b1b87d8d3939c94a7273f4e0e4378a4bfc34474ce65d.json
deleted file mode 100644
index fa018a44bb..0000000000
--- a/.sqlx/query-58c402543075bfc006f9b1b87d8d3939c94a7273f4e0e4378a4bfc34474ce65d.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO scheduling_booking (id, profile_id, request_id, event_type_id, starts_at, ends_at, status, record) SELECT id, $1, id, $2, $3, $4, 'confirmed', $5 FROM unnest($6::uuid[]) AS id",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Timestamptz",
- "Timestamptz",
- "Jsonb",
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "58c402543075bfc006f9b1b87d8d3939c94a7273f4e0e4378a4bfc34474ce65d"
-}
diff --git a/.sqlx/query-5945fa9d910fb96c378548d1ecbfa70afe5c760ad115d1d652a562e7d4258b35.json b/.sqlx/query-5945fa9d910fb96c378548d1ecbfa70afe5c760ad115d1d652a562e7d4258b35.json
deleted file mode 100644
index 83e920965c..0000000000
--- a/.sqlx/query-5945fa9d910fb96c378548d1ecbfa70afe5c760ad115d1d652a562e7d4258b35.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_messages (id, sender_id, content, parent_entity_type, parent_entity_id)\n VALUES ($1, 'macro|[email protected]', 'attachment', 'document', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5945fa9d910fb96c378548d1ecbfa70afe5c760ad115d1d652a562e7d4258b35"
-}
diff --git a/.sqlx/query-59517bccf29ea6e96b86f6a7f28c861c0db7709ab72c68f7a5c27b275f96bc65.json b/.sqlx/query-59517bccf29ea6e96b86f6a7f28c861c0db7709ab72c68f7a5c27b275f96bc65.json
deleted file mode 100644
index ad3ff9550a..0000000000
--- a/.sqlx/query-59517bccf29ea6e96b86f6a7f28c861c0db7709ab72c68f7a5c27b275f96bc65.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT state, outcome, execution_record_id FROM scheduled_action_event_run WHERE action_id = $1 AND event_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "state",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "outcome",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 2,
- "name": "execution_record_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- true
- ]
- },
- "hash": "59517bccf29ea6e96b86f6a7f28c861c0db7709ab72c68f7a5c27b275f96bc65"
-}
diff --git a/.sqlx/query-59744a37fe9d239158668457771988c10053706dd209eacb8e5997b601010ca6.json b/.sqlx/query-59744a37fe9d239158668457771988c10053706dd209eacb8e5997b601010ca6.json
deleted file mode 100644
index 94d0b41ded..0000000000
--- a/.sqlx/query-59744a37fe9d239158668457771988c10053706dd209eacb8e5997b601010ca6.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT parent_entity_type, parent_entity_id, import_metadata, import_order FROM comms_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "parent_entity_type",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "parent_entity_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "import_metadata",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 3,
- "name": "import_order",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- true,
- true
- ]
- },
- "hash": "59744a37fe9d239158668457771988c10053706dd209eacb8e5997b601010ca6"
-}
diff --git a/.sqlx/query-59963658076b29580661b870d083b9f8ec834860f1707b4fbb50e458905a3e00.json b/.sqlx/query-59963658076b29580661b870d083b9f8ec834860f1707b4fbb50e458905a3e00.json
deleted file mode 100644
index 051df18422..0000000000
--- a/.sqlx/query-59963658076b29580661b870d083b9f8ec834860f1707b4fbb50e458905a3e00.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE entity_access SET access_level = $3::text::\"AccessLevel\"\n WHERE entity_id = $1 AND entity_type = 'call'\n AND source_id = $2 AND source_type = 'channel'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "59963658076b29580661b870d083b9f8ec834860f1707b4fbb50e458905a3e00"
-}
diff --git a/.sqlx/query-5b306d29053e2926b145c31b331295ebcc120ad05b03b795cc9723545f7815cb.json b/.sqlx/query-5b306d29053e2926b145c31b331295ebcc120ad05b03b795cc9723545f7815cb.json
deleted file mode 100644
index c9cd2a8e22..0000000000
--- a/.sqlx/query-5b306d29053e2926b145c31b331295ebcc120ad05b03b795cc9723545f7815cb.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_conversation SET lease_expires_at = clock_timestamp() - interval '1 second' WHERE job_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5b306d29053e2926b145c31b331295ebcc120ad05b03b795cc9723545f7815cb"
-}
diff --git a/.sqlx/query-5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e.json b/.sqlx/query-5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e.json
deleted file mode 100644
index 443cd1a93f..0000000000
--- a/.sqlx/query-5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM email_links WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5b45457b0629b66ab1694e99d7ef5119f136035f6b8489934c845c7321eade6e"
-}
diff --git a/.sqlx/query-5bf079123e6ce402809dd9659eda17854525d30a39bb92c7c9b2a2fe315e947f.json b/.sqlx/query-5bf079123e6ce402809dd9659eda17854525d30a39bb92c7c9b2a2fe315e947f.json
deleted file mode 100644
index 9007aa1bab..0000000000
--- a/.sqlx/query-5bf079123e6ce402809dd9659eda17854525d30a39bb92c7c9b2a2fe315e947f.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"documentId\" as \"document_id\",\n \"content\" as \"content\",\n \"tokenCount\" as \"token_count\"\n FROM \"DocumentText\"\n WHERE \"documentId\" = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "document_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "content",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "token_count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "5bf079123e6ce402809dd9659eda17854525d30a39bb92c7c9b2a2fe315e947f"
-}
diff --git a/.sqlx/query-5c23ce84d469b4732bbda39b3869cbe6a0b0e54ac14498eb7c80629e83a78dba.json b/.sqlx/query-5c23ce84d469b4732bbda39b3869cbe6a0b0e54ac14498eb7c80629e83a78dba.json
deleted file mode 100644
index fb9d80731e..0000000000
--- a/.sqlx/query-5c23ce84d469b4732bbda39b3869cbe6a0b0e54ac14498eb7c80629e83a78dba.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_messages WHERE id = ANY($1)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "5c23ce84d469b4732bbda39b3869cbe6a0b0e54ac14498eb7c80629e83a78dba"
-}
diff --git a/.sqlx/query-5c5bb5665c2f17e43ed18d2229651c5ddef91721ff24d669ac7b6ce26298e26e.json b/.sqlx/query-5c5bb5665c2f17e43ed18d2229651c5ddef91721ff24d669ac7b6ce26298e26e.json
deleted file mode 100644
index 2e92aa5da6..0000000000
--- a/.sqlx/query-5c5bb5665c2f17e43ed18d2229651c5ddef91721ff24d669ac7b6ce26298e26e.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n id, name, owner_id, thread_id, originating_message_id, bot_id,\n model, harness, repo_url, repo_branch, pull_request_url, workspace, sandbox_size, instructions,\n mcp_scope, mcp_servers, acp_session_id, status,\n status_event_name, agent_session.created_at, modified_at,\n (SELECT jsonb_build_object('type', parent_entity_type, 'id', parent_entity_id)\n FROM comms_messages WHERE id = agent_session.thread_id)\n AS \"thread_parent?: Json<MessageParent>\",\n ext.provider AS \"external_provider?\", ext.external_id AS \"external_id?\",\n ext.external_name AS \"external_name?\", ext.external_url AS \"external_url?\",\n ext.last_run_id AS \"external_last_run_id?\"\n FROM agent_session\n LEFT JOIN external_agent_session AS ext ON ext.agent_session_id = agent_session.id\n WHERE owner_id = $1\n ORDER BY agent_session.created_at DESC, id DESC\n LIMIT $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "thread_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "originating_message_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "bot_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 6,
- "name": "model",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "harness",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "repo_url",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "repo_branch",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "pull_request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 11,
- "name": "workspace",
- "type_info": "Text"
- },
- {
- "ordinal": 12,
- "name": "sandbox_size",
- "type_info": "Text"
- },
- {
- "ordinal": 13,
- "name": "instructions",
- "type_info": "Text"
- },
- {
- "ordinal": 14,
- "name": "mcp_scope",
- "type_info": "Text"
- },
- {
- "ordinal": 15,
- "name": "mcp_servers",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 16,
- "name": "acp_session_id",
- "type_info": "Text"
- },
- {
- "ordinal": 17,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 18,
- "name": "status_event_name",
- "type_info": "Text"
- },
- {
- "ordinal": 19,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 20,
- "name": "modified_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 21,
- "name": "thread_parent?: Json<MessageParent>",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 22,
- "name": "external_provider?",
- "type_info": "Text"
- },
- {
- "ordinal": 23,
- "name": "external_id?",
- "type_info": "Text"
- },
- {
- "ordinal": 24,
- "name": "external_name?",
- "type_info": "Text"
- },
- {
- "ordinal": 25,
- "name": "external_url?",
- "type_info": "Text"
- },
- {
- "ordinal": 26,
- "name": "external_last_run_id?",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Int8"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- true,
- false,
- true,
- false,
- false,
- null,
- false,
- false,
- true,
- true,
- true
- ]
- },
- "hash": "5c5bb5665c2f17e43ed18d2229651c5ddef91721ff24d669ac7b6ce26298e26e"
-}
diff --git a/.sqlx/query-5c6b90097e9d8079a185a6b481201628eba37b86c378363299474e6774b9edd4.json b/.sqlx/query-5c6b90097e9d8079a185a6b481201628eba37b86c378363299474e6774b9edd4.json
deleted file mode 100644
index f5948d3b96..0000000000
--- a/.sqlx/query-5c6b90097e9d8079a185a6b481201628eba37b86c378363299474e6774b9edd4.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE \"Document\"\n SET \"deletedAt\" = NOW()\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5c6b90097e9d8079a185a6b481201628eba37b86c378363299474e6774b9edd4"
-}
diff --git a/.sqlx/query-5df1ebd365045326be20bde16b25580d273cbc9c8cdf99b84b44f4e4eacc4885.json b/.sqlx/query-5df1ebd365045326be20bde16b25580d273cbc9c8cdf99b84b44f4e4eacc4885.json
deleted file mode 100644
index 4017f592e7..0000000000
--- a/.sqlx/query-5df1ebd365045326be20bde16b25580d273cbc9c8cdf99b84b44f4e4eacc4885.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity (id, entity_type, owner_type, owner_id)\n VALUES ($1, 'scheduled_action', 'user', 'macro|[email protected]')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5df1ebd365045326be20bde16b25580d273cbc9c8cdf99b84b44f4e4eacc4885"
-}
diff --git a/.sqlx/query-5e213707bf932b7985482dc5f63f9429aab31023693b899937d230eb89b2fece.json b/.sqlx/query-5e213707bf932b7985482dc5f63f9429aab31023693b899937d230eb89b2fece.json
deleted file mode 100644
index bf63cc5ef7..0000000000
--- a/.sqlx/query-5e213707bf932b7985482dc5f63f9429aab31023693b899937d230eb89b2fece.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE \"PdfPlaceableCommentAnchor\" SET\n \"page\" = COALESCE($1, \"page\"),\n \"originalPage\" = COALESCE($2, \"originalPage\"),\n \"originalIndex\" = COALESCE($3, \"originalIndex\"),\n \"xPct\" = COALESCE($4, \"xPct\"),\n \"yPct\" = COALESCE($5, \"yPct\"),\n \"widthPct\" = COALESCE($6, \"widthPct\"),\n \"heightPct\" = COALESCE($7, \"heightPct\"),\n \"rotation\" = COALESCE($8, \"rotation\"),\n \"allowableEdits\" = COALESCE($9, \"allowableEdits\"),\n \"wasEdited\" = COALESCE($10, \"wasEdited\"),\n \"wasDeleted\" = COALESCE($11, \"wasDeleted\"),\n \"shouldLockOnSave\" = COALESCE($12, \"shouldLockOnSave\")\n WHERE uuid = $13\n RETURNING \n uuid, \n \"documentId\" as document_id,\n owner, \n \"threadId\" as thread_id,\n root_id,\n page, \n \"originalPage\" as original_page, \n \"originalIndex\" as original_index, \n \"xPct\" as x_pct, \n \"yPct\" as y_pct, \n \"widthPct\" as width_pct, \n \"heightPct\" as height_pct, \n rotation,\n \"allowableEdits\" as allowable_edits, \n \"wasEdited\" as was_edited, \n \"wasDeleted\" as was_deleted, \n \"shouldLockOnSave\" as should_lock_on_save\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "uuid",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "document_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "thread_id",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "root_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "page",
- "type_info": "Int4"
- },
- {
- "ordinal": 6,
- "name": "original_page",
- "type_info": "Int4"
- },
- {
- "ordinal": 7,
- "name": "original_index",
- "type_info": "Int4"
- },
- {
- "ordinal": 8,
- "name": "x_pct",
- "type_info": "Float8"
- },
- {
- "ordinal": 9,
- "name": "y_pct",
- "type_info": "Float8"
- },
- {
- "ordinal": 10,
- "name": "width_pct",
- "type_info": "Float8"
- },
- {
- "ordinal": 11,
- "name": "height_pct",
- "type_info": "Float8"
- },
- {
- "ordinal": 12,
- "name": "rotation",
- "type_info": "Float8"
- },
- {
- "ordinal": 13,
- "name": "allowable_edits",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 14,
- "name": "was_edited",
- "type_info": "Bool"
- },
- {
- "ordinal": 15,
- "name": "was_deleted",
- "type_info": "Bool"
- },
- {
- "ordinal": 16,
- "name": "should_lock_on_save",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Int4",
- "Int4",
- "Int4",
- "Float8",
- "Float8",
- "Float8",
- "Float8",
- "Float8",
- "Jsonb",
- "Bool",
- "Bool",
- "Bool",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- true,
- false,
- false,
- false
- ]
- },
- "hash": "5e213707bf932b7985482dc5f63f9429aab31023693b899937d230eb89b2fece"
-}
diff --git a/.sqlx/query-5ea86d0df1cb75de68942e815b3eb8a1283ebafacc6f01db4d4a0fbb602b92b5.json b/.sqlx/query-5ea86d0df1cb75de68942e815b3eb8a1283ebafacc6f01db4d4a0fbb602b92b5.json
deleted file mode 100644
index 9b897d7944..0000000000
--- a/.sqlx/query-5ea86d0df1cb75de68942e815b3eb8a1283ebafacc6f01db4d4a0fbb602b92b5.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id,email,macro_user_id) VALUES ($1,$1,$2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5ea86d0df1cb75de68942e815b3eb8a1283ebafacc6f01db4d4a0fbb602b92b5"
-}
diff --git a/.sqlx/query-5f810f662db85ef26f402de1c0eb2554417038d246c1f2d9962fbb88eadf4d33.json b/.sqlx/query-5f810f662db85ef26f402de1c0eb2554417038d246c1f2d9962fbb88eadf4d33.json
deleted file mode 100644
index 6ba4aae0f6..0000000000
--- a/.sqlx/query-5f810f662db85ef26f402de1c0eb2554417038d246c1f2d9962fbb88eadf4d33.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session SET working_branch = 'cursor/no-pr', repo_url = 'https://github.com/example/example' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "5f810f662db85ef26f402de1c0eb2554417038d246c1f2d9962fbb88eadf4d33"
-}
diff --git a/.sqlx/query-5f8417de25d85852d915bf9111b6bd1e4c0f2bb3f3ac205e8428b4ee504d24da.json b/.sqlx/query-5f8417de25d85852d915bf9111b6bd1e4c0f2bb3f3ac205e8428b4ee504d24da.json
deleted file mode 100644
index f7724686fa..0000000000
--- a/.sqlx/query-5f8417de25d85852d915bf9111b6bd1e4c0f2bb3f3ac205e8428b4ee504d24da.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT first_name, last_name FROM macro_user_info WHERE macro_user_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "first_name",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "last_name",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true
- ]
- },
- "hash": "5f8417de25d85852d915bf9111b6bd1e4c0f2bb3f3ac205e8428b4ee504d24da"
-}
diff --git a/.sqlx/query-5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0.json b/.sqlx/query-5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0.json
deleted file mode 100644
index 89ab941a64..0000000000
--- a/.sqlx/query-5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_usage (id, feature, user_id, model, input_tokens, output_tokens)\n VALUES ($1, 'chat', $2, 'legacy-model', 1000000, 1000000)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "5f9e7585eb577e5078ec97258f650dc5014688de2f1e1f7cc666895aee59cfa0"
-}
diff --git a/.sqlx/query-612735cf543ddca6001668303d4050ab0fec75a4b97a639bf5e3f3a35df9c2df.json b/.sqlx/query-612735cf543ddca6001668303d4050ab0fec75a4b97a639bf5e3f3a35df9c2df.json
deleted file mode 100644
index 206b5621f3..0000000000
--- a/.sqlx/query-612735cf543ddca6001668303d4050ab0fec75a4b97a639bf5e3f3a35df9c2df.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_conversation SET lease_expires_at = clock_timestamp() - interval '1 second' WHERE job_id = $1 AND slack_channel_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "612735cf543ddca6001668303d4050ab0fec75a4b97a639bf5e3f3a35df9c2df"
-}
diff --git a/.sqlx/query-616574723fb036d508bd737039476c7ed0ab1292f3009d643b5c3463df7934fb.json b/.sqlx/query-616574723fb036d508bd737039476c7ed0ab1292f3009d643b5c3463df7934fb.json
deleted file mode 100644
index 5ffaa18b11..0000000000
--- a/.sqlx/query-616574723fb036d508bd737039476c7ed0ab1292f3009d643b5c3463df7934fb.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, owner_id) VALUES ($1, 'Chan', 'private', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "616574723fb036d508bd737039476c7ed0ab1292f3009d643b5c3463df7934fb"
-}
diff --git a/.sqlx/query-61c509d7de04b81793ff8cb4b12eb50fdf6d4d7dd8222377ab3156fcc1b95f62.json b/.sqlx/query-61c509d7de04b81793ff8cb4b12eb50fdf6d4d7dd8222377ab3156fcc1b95f62.json
deleted file mode 100644
index 7527609128..0000000000
--- a/.sqlx/query-61c509d7de04b81793ff8cb4b12eb50fdf6d4d7dd8222377ab3156fcc1b95f62.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_settings (link_id, signature_on_replies_forwards, signature) VALUES ($1, true, '<p>Regards</p>')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "61c509d7de04b81793ff8cb4b12eb50fdf6d4d7dd8222377ab3156fcc1b95f62"
-}
diff --git a/.sqlx/query-61e7ef25d4b66fa59430caec78760c4642cace5c536b74d0a46851f247e0f2c4.json b/.sqlx/query-61e7ef25d4b66fa59430caec78760c4642cace5c536b74d0a46851f247e0f2c4.json
deleted file mode 100644
index c2d0c7df01..0000000000
--- a/.sqlx/query-61e7ef25d4b66fa59430caec78760c4642cace5c536b74d0a46851f247e0f2c4.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_labels (id, link_id, provider_label_id, name) VALUES ($1, $2, 'SENT', 'SENT')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "61e7ef25d4b66fa59430caec78760c4642cace5c536b74d0a46851f247e0f2c4"
-}
diff --git a/.sqlx/query-62ba149ed381410cfc5775da4cea6dedbd1bc72769cea9fa32a84fa69592e8d6.json b/.sqlx/query-62ba149ed381410cfc5775da4cea6dedbd1bc72769cea9fa32a84fa69592e8d6.json
deleted file mode 100644
index 5f0baf7714..0000000000
--- a/.sqlx/query-62ba149ed381410cfc5775da4cea6dedbd1bc72769cea9fa32a84fa69592e8d6.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO ai_billing_period_allowance (\n user_id, period_start, billed_users, included_cents_by_user, updated_at\n )\n VALUES ($1, $2, $3, $4, $5)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz",
- "TextArray",
- "Int8Array",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "62ba149ed381410cfc5775da4cea6dedbd1bc72769cea9fa32a84fa69592e8d6"
-}
diff --git a/.sqlx/query-633851f2ef2a49c338a54e7ce207fa407f70c3bdb211c144db973d9f8027a087.json b/.sqlx/query-633851f2ef2a49c338a54e7ce207fa407f70c3bdb211c144db973d9f8027a087.json
deleted file mode 100644
index 6c90910ad0..0000000000
--- a/.sqlx/query-633851f2ef2a49c338a54e7ce207fa407f70c3bdb211c144db973d9f8027a087.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT updated_at FROM comms_channels WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "633851f2ef2a49c338a54e7ce207fa407f70c3bdb211c144db973d9f8027a087"
-}
diff --git a/.sqlx/query-637ecfc4ea514f2aac0bd1ef27738bb9db884b5b3dc604aecb2bd8b60b9c3d29.json b/.sqlx/query-637ecfc4ea514f2aac0bd1ef27738bb9db884b5b3dc604aecb2bd8b60b9c3d29.json
deleted file mode 100644
index 3768cd9d12..0000000000
--- a/.sqlx/query-637ecfc4ea514f2aac0bd1ef27738bb9db884b5b3dc604aecb2bd8b60b9c3d29.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'Lifecycle', 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "637ecfc4ea514f2aac0bd1ef27738bb9db884b5b3dc604aecb2bd8b60b9c3d29"
-}
diff --git a/.sqlx/query-63da48ff0a9e0b8704d8964d7cecabf075a58597fee1c6e46f5091adcd1aa257.json b/.sqlx/query-63da48ff0a9e0b8704d8964d7cecabf075a58597fee1c6e46f5091adcd1aa257.json
deleted file mode 100644
index f6162c9b2e..0000000000
--- a/.sqlx/query-63da48ff0a9e0b8704d8964d7cecabf075a58597fee1c6e46f5091adcd1aa257.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE harnesses SET deleted_at = now()",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "63da48ff0a9e0b8704d8964d7cecabf075a58597fee1c6e46f5091adcd1aa257"
-}
diff --git a/.sqlx/query-63df2200ff2211bc6ef45535509d76af1303de2e40146765941ce5e558af814e.json b/.sqlx/query-63df2200ff2211bc6ef45535509d76af1303de2e40146765941ce5e558af814e.json
deleted file mode 100644
index 9bed031652..0000000000
--- a/.sqlx/query-63df2200ff2211bc6ef45535509d76af1303de2e40146765941ce5e558af814e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channel_participants (channel_id, user_id, role) VALUES ($1, 'macro|[email protected]', 'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "63df2200ff2211bc6ef45535509d76af1303de2e40146765941ce5e558af814e"
-}
diff --git a/.sqlx/query-648149fc2ffdfd0e53c63a53fccc141a08478d52ef87049002fee65901e82ee1.json b/.sqlx/query-648149fc2ffdfd0e53c63a53fccc141a08478d52ef87049002fee65901e82ee1.json
deleted file mode 100644
index f119c37a8b..0000000000
--- a/.sqlx/query-648149fc2ffdfd0e53c63a53fccc141a08478d52ef87049002fee65901e82ee1.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO user_notification (user_id, notification_id, state, seen_at)\n VALUES ($1, $2, CASE WHEN $3::bool THEN 'done'::notification_state\n WHEN $4::timestamp IS NOT NULL THEN 'seen'::notification_state\n ELSE 'unseen'::notification_state END, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- "Bool",
- "Timestamp"
- ]
- },
- "nullable": []
- },
- "hash": "648149fc2ffdfd0e53c63a53fccc141a08478d52ef87049002fee65901e82ee1"
-}
diff --git a/.sqlx/query-6495146fc7e78a00ea9599f800d59f7e0f4f94b67031420f701712bbeebbf4a0.json b/.sqlx/query-6495146fc7e78a00ea9599f800d59f7e0f4f94b67031420f701712bbeebbf4a0.json
deleted file mode 100644
index edeeae7624..0000000000
--- a/.sqlx/query-6495146fc7e78a00ea9599f800d59f7e0f4f94b67031420f701712bbeebbf4a0.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"createdAt\" as created_at, \"updatedAt\" as updated_at FROM \"UserHistory\" WHERE \"userId\" = $1 AND \"itemId\" = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 1,
- "name": "updated_at",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "6495146fc7e78a00ea9599f800d59f7e0f4f94b67031420f701712bbeebbf4a0"
-}
diff --git a/.sqlx/query-64e6a529200262f372307a69d2519d6b233260545e5bc3b0061855e89081e990.json b/.sqlx/query-64e6a529200262f372307a69d2519d6b233260545e5bc3b0061855e89081e990.json
deleted file mode 100644
index 9967f7c84b..0000000000
--- a/.sqlx/query-64e6a529200262f372307a69d2519d6b233260545e5bc3b0061855e89081e990.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "64e6a529200262f372307a69d2519d6b233260545e5bc3b0061855e89081e990"
-}
diff --git a/.sqlx/query-65648ac4de903cba9f10b2a8491b6c0c43780188336997a7302a77e34e07c54a.json b/.sqlx/query-65648ac4de903cba9f10b2a8491b6c0c43780188336997a7302a77e34e07c54a.json
deleted file mode 100644
index c29d8cf466..0000000000
--- a/.sqlx/query-65648ac4de903cba9f10b2a8491b6c0c43780188336997a7302a77e34e07c54a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE call_records SET channel_id = NULL, custom_name = 'Customer review' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "65648ac4de903cba9f10b2a8491b6c0c43780188336997a7302a77e34e07c54a"
-}
diff --git a/.sqlx/query-661996cd2f3a4e844049ada20eb8d736630dd247b9c2e9b1c79851da43cbeb8d.json b/.sqlx/query-661996cd2f3a4e844049ada20eb8d736630dd247b9c2e9b1c79851da43cbeb8d.json
deleted file mode 100644
index 5aaa7ecde7..0000000000
--- a/.sqlx/query-661996cd2f3a4e844049ada20eb8d736630dd247b9c2e9b1c79851da43cbeb8d.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT seat_generation FROM ai_billing_account WHERE user_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "seat_generation",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "661996cd2f3a4e844049ada20eb8d736630dd247b9c2e9b1c79851da43cbeb8d"
-}
diff --git a/.sqlx/query-662f5ccc9966fd852ef6466d6914c8e22cab300c88e2147520f818affdf5f34c.json b/.sqlx/query-662f5ccc9966fd852ef6466d6914c8e22cab300c88e2147520f818affdf5f34c.json
deleted file mode 100644
index e03e2fc22d..0000000000
--- a/.sqlx/query-662f5ccc9966fd852ef6466d6914c8e22cab300c88e2147520f818affdf5f34c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_conversation SET lease_expires_at = clock_timestamp() - interval '1 second' WHERE job_id = $1 AND status = 'importing'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "662f5ccc9966fd852ef6466d6914c8e22cab300c88e2147520f818affdf5f34c"
-}
diff --git a/.sqlx/query-6661357a095607aed2b703595ba91cf812e17df57ebc8a54ee72d15e7dc18cd1.json b/.sqlx/query-6661357a095607aed2b703595ba91cf812e17df57ebc8a54ee72d15e7dc18cd1.json
deleted file mode 100644
index 623d35fbee..0000000000
--- a/.sqlx/query-6661357a095607aed2b703595ba91cf812e17df57ebc8a54ee72d15e7dc18cd1.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM comms_attachments WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6661357a095607aed2b703595ba91cf812e17df57ebc8a54ee72d15e7dc18cd1"
-}
diff --git a/.sqlx/query-6690f1280a982415a150a0db5bc65d750f153701f40cf556a953463104515bd9.json b/.sqlx/query-6690f1280a982415a150a0db5bc65d750f153701f40cf556a953463104515bd9.json
deleted file mode 100644
index 36b698e070..0000000000
--- a/.sqlx/query-6690f1280a982415a150a0db5bc65d750f153701f40cf556a953463104515bd9.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET name = 'Acme sales' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6690f1280a982415a150a0db5bc65d750f153701f40cf556a953463104515bd9"
-}
diff --git a/.sqlx/query-67809c28827bd163e23a02284f0e90f4649aa8d50d5fb4d088e01cfd25b59738.json b/.sqlx/query-67809c28827bd163e23a02284f0e90f4649aa8d50d5fb4d088e01cfd25b59738.json
deleted file mode 100644
index 42dc2bb6f2..0000000000
--- a/.sqlx/query-67809c28827bd163e23a02284f0e90f4649aa8d50d5fb4d088e01cfd25b59738.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT m.entity_id, m.entity_type\n FROM comms_entity_mentions m\n WHERE m.source_entity_type = 'message' AND m.source_entity_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "entity_id",
- "type_info": "Varchar"
- },
- {
- "ordinal": 1,
- "name": "entity_type",
- "type_info": "Varchar"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "67809c28827bd163e23a02284f0e90f4649aa8d50d5fb4d088e01cfd25b59738"
-}
diff --git a/.sqlx/query-67ac072e2efaf7d6bb79bbdc10a2ac4ebd904a7bd4d0ff635fb3578c00890a81.json b/.sqlx/query-67ac072e2efaf7d6bb79bbdc10a2ac4ebd904a7bd4d0ff635fb3578c00890a81.json
deleted file mode 100644
index c2d3d07168..0000000000
--- a/.sqlx/query-67ac072e2efaf7d6bb79bbdc10a2ac4ebd904a7bd4d0ff635fb3578c00890a81.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM notification WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "67ac072e2efaf7d6bb79bbdc10a2ac4ebd904a7bd4d0ff635fb3578c00890a81"
-}
diff --git a/.sqlx/query-67c59263594eeadbfd225f2d4134443f9a9044209ec08de331bfb4afbde371ee.json b/.sqlx/query-67c59263594eeadbfd225f2d4134443f9a9044209ec08de331bfb4afbde371ee.json
deleted file mode 100644
index 84e969f239..0000000000
--- a/.sqlx/query-67c59263594eeadbfd225f2d4134443f9a9044209ec08de331bfb4afbde371ee.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team_user (user_id, team_id, team_role)\n VALUES\n ('user-1', 'dddddddd-dddd-dddd-dddd-000000000001', 'owner'),\n ('user-3', 'dddddddd-dddd-dddd-dddd-000000000001', 'member'),\n ('user-2', 'dddddddd-dddd-dddd-dddd-000000000002', 'owner'),\n ('user-public-access-only', 'dddddddd-dddd-dddd-dddd-000000000002', 'member')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "67c59263594eeadbfd225f2d4134443f9a9044209ec08de331bfb4afbde371ee"
-}
diff --git a/.sqlx/query-683c65a8a703d8463efed57efc9fd06db7113ae4a015bd645c3482149443e3d4.json b/.sqlx/query-683c65a8a703d8463efed57efc9fd06db7113ae4a015bd645c3482149443e3d4.json
deleted file mode 100644
index b2fca67443..0000000000
--- a/.sqlx/query-683c65a8a703d8463efed57efc9fd06db7113ae4a015bd645c3482149443e3d4.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT 1 AS ignored FROM pg_advisory_xact_lock(1987213841)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "ignored",
- "type_info": "Int4"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "683c65a8a703d8463efed57efc9fd06db7113ae4a015bd645c3482149443e3d4"
-}
diff --git a/.sqlx/query-68a503269b2fe1df96fc697738ae8fbc1007a335d1c96b4614287a72f194a1fd.json b/.sqlx/query-68a503269b2fe1df96fc697738ae8fbc1007a335d1c96b4614287a72f194a1fd.json
deleted file mode 100644
index 910c07db22..0000000000
--- a/.sqlx/query-68a503269b2fe1df96fc697738ae8fbc1007a335d1c96b4614287a72f194a1fd.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user_links (primary_macro_id, child_macro_id, link_id)\n VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "68a503269b2fe1df96fc697738ae8fbc1007a335d1c96b4614287a72f194a1fd"
-}
diff --git a/.sqlx/query-68ba7cb71623522b89eee53109b6c6030fa4b339e95d3965b2ea4e447054673e.json b/.sqlx/query-68ba7cb71623522b89eee53109b6c6030fa4b339e95d3965b2ea4e447054673e.json
deleted file mode 100644
index ecd353f8c0..0000000000
--- a/.sqlx/query-68ba7cb71623522b89eee53109b6c6030fa4b339e95d3965b2ea4e447054673e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE foreign_entity\n SET updated_at = NOW() - INTERVAL '1 hour'\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "68ba7cb71623522b89eee53109b6c6030fa4b339e95d3965b2ea4e447054673e"
-}
diff --git a/.sqlx/query-692980d5dad75638ccfdec21b7d319914b45acb3eb3923f8e2d427d1ea0cbb7f.json b/.sqlx/query-692980d5dad75638ccfdec21b7d319914b45acb3eb3923f8e2d427d1ea0cbb7f.json
deleted file mode 100644
index edc21badfe..0000000000
--- a/.sqlx/query-692980d5dad75638ccfdec21b7d319914b45acb3eb3923f8e2d427d1ea0cbb7f.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $3, $4)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "692980d5dad75638ccfdec21b7d319914b45acb3eb3923f8e2d427d1ea0cbb7f"
-}
diff --git a/.sqlx/query-69e503e7fd0091707b82bb5d7aeb43405c9b9d47b7d9e82864ac74efb8121106.json b/.sqlx/query-69e503e7fd0091707b82bb5d7aeb43405c9b9d47b7d9e82864ac74efb8121106.json
deleted file mode 100644
index d21c4ca5fb..0000000000
--- a/.sqlx/query-69e503e7fd0091707b82bb5d7aeb43405c9b9d47b7d9e82864ac74efb8121106.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_session\n (id, owner_id, bot_id, model, harness, workspace, status, status_event_name,\n created_at, modified_at)\n VALUES ($1, $2, $3, 'default', 'macrod', '/workspace', $4, $5,\n now() - make_interval(mins => $6), now() - make_interval(mins => $6))\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Text",
- "Text",
- "Int4"
- ]
- },
- "nullable": []
- },
- "hash": "69e503e7fd0091707b82bb5d7aeb43405c9b9d47b7d9e82864ac74efb8121106"
-}
diff --git a/.sqlx/query-6a5e78ae2a24b1c443a38d9ecc41184b8cd192359c2aabcd8b4e2f8375ac493f.json b/.sqlx/query-6a5e78ae2a24b1c443a38d9ecc41184b8cd192359c2aabcd8b4e2f8375ac493f.json
deleted file mode 100644
index 56a5b0b673..0000000000
--- a/.sqlx/query-6a5e78ae2a24b1c443a38d9ecc41184b8cd192359c2aabcd8b4e2f8375ac493f.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT values as \"values!: serde_json::Value\"\n FROM entity_properties\n WHERE entity_id = $1 AND entity_type = $2 AND property_definition_id = $3\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "values!: serde_json::Value",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- {
- "Custom": {
- "name": "property_entity_type",
- "kind": {
- "Enum": [
- "CHANNEL",
- "CHAT",
- "DOCUMENT",
- "PROJECT",
- "THREAD",
- "USER",
- "COMPANY",
- "TASK",
- "CALL_RECORD",
- "CALENDAR_EVENT",
- "INITIATIVE",
- "CONTACT",
- "DATABASE_ROW"
- ]
- }
- }
- },
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "6a5e78ae2a24b1c443a38d9ecc41184b8cd192359c2aabcd8b4e2f8375ac493f"
-}
diff --git a/.sqlx/query-6a6f629b0b617bf5cf39f0e493f0d8ac42d87a8d1e536d48710b2acdbc0bb93b.json b/.sqlx/query-6a6f629b0b617bf5cf39f0e493f0d8ac42d87a8d1e536d48710b2acdbc0bb93b.json
deleted file mode 100644
index 25577da7ab..0000000000
--- a/.sqlx/query-6a6f629b0b617bf5cf39f0e493f0d8ac42d87a8d1e536d48710b2acdbc0bb93b.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM comms_channel_participants WHERE channel_id = $1 AND left_at IS NOT NULL",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "6a6f629b0b617bf5cf39f0e493f0d8ac42d87a8d1e536d48710b2acdbc0bb93b"
-}
diff --git a/.sqlx/query-6ac0f229f06980ddbc62f5f5056b7996d92d842e88d386cb0b65fb11468cdc57.json b/.sqlx/query-6ac0f229f06980ddbc62f5f5056b7996d92d842e88d386cb0b65fb11468cdc57.json
deleted file mode 100644
index c1dc3cfe3e..0000000000
--- a/.sqlx/query-6ac0f229f06980ddbc62f5f5056b7996d92d842e88d386cb0b65fb11468cdc57.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE \"PdfHighlightAnchor\"\n SET \"deletedAt\" = NOW()\n WHERE uuid = $1 AND \"deletedAt\" IS NULL\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6ac0f229f06980ddbc62f5f5056b7996d92d842e88d386cb0b65fb11468cdc57"
-}
diff --git a/.sqlx/query-6b97d07d2a1ca458ff76c6c00b3b4154096bfa144486e3ba1858e541e017a64f.json b/.sqlx/query-6b97d07d2a1ca458ff76c6c00b3b4154096bfa144486e3ba1858e541e017a64f.json
deleted file mode 100644
index 446b29cd6d..0000000000
--- a/.sqlx/query-6b97d07d2a1ca458ff76c6c00b3b4154096bfa144486e3ba1858e541e017a64f.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, 'lifecycle', '[email protected]', 'lifecycle-customer')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6b97d07d2a1ca458ff76c6c00b3b4154096bfa144486e3ba1858e541e017a64f"
-}
diff --git a/.sqlx/query-6baf01caee63a634cf1fcd5a3667c61cc68a867af310783113d83cd5ed57974d.json b/.sqlx/query-6baf01caee63a634cf1fcd5a3667c61cc68a867af310783113d83cd5ed57974d.json
deleted file mode 100644
index 747734ca0d..0000000000
--- a/.sqlx/query-6baf01caee63a634cf1fcd5a3667c61cc68a867af310783113d83cd5ed57974d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET configuration_revision = configuration_revision + 1 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6baf01caee63a634cf1fcd5a3667c61cc68a867af310783113d83cd5ed57974d"
-}
diff --git a/.sqlx/query-6c1fa70775136bab3e911de94d21e2e153a080065475f0eb056e0fffb3c188a2.json b/.sqlx/query-6c1fa70775136bab3e911de94d21e2e153a080065475f0eb056e0fffb3c188a2.json
deleted file mode 100644
index 5616c68fb5..0000000000
--- a/.sqlx/query-6c1fa70775136bab3e911de94d21e2e153a080065475f0eb056e0fffb3c188a2.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, stripe_customer_id, username, email) VALUES ($1, 'bogus', 'username', 'bogus')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6c1fa70775136bab3e911de94d21e2e153a080065475f0eb056e0fffb3c188a2"
-}
diff --git a/.sqlx/query-6d29a98718ce26f572e787f694cda222d519367d241aea2259d189a20fa91a76.json b/.sqlx/query-6d29a98718ce26f572e787f694cda222d519367d241aea2259d189a20fa91a76.json
new file mode 100644
index 0000000000..792bcd8358
--- /dev/null
+++ b/.sqlx/query-6d29a98718ce26f572e787f694cda222d519367d241aea2259d189a20fa91a76.json
@@ -0,0 +1,14 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n INSERT INTO ai_billing_account (user_id, auto_reload_suspended_at)\n VALUES ($1, NOW())\n ON CONFLICT (user_id) DO UPDATE\n SET auto_reload_suspended_at\n = COALESCE(ai_billing_account.auto_reload_suspended_at, NOW()),\n updated_at = NOW()\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "6d29a98718ce26f572e787f694cda222d519367d241aea2259d189a20fa91a76"
+}
diff --git a/.sqlx/query-6d5fe359a96357a37b1bb43adc31fa41ad001376c454876a5f49d460429dd62a.json b/.sqlx/query-6d5fe359a96357a37b1bb43adc31fa41ad001376c454876a5f49d460429dd62a.json
deleted file mode 100644
index 28ff3216f3..0000000000
--- a/.sqlx/query-6d5fe359a96357a37b1bb43adc31fa41ad001376c454876a5f49d460429dd62a.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_views (id, database_id, table_id, name, position, query, layout)\n VALUES ($1, $2, $3, 'By status', '80', '{\"filter\": null, \"sort\": []}',\n jsonb_build_object(\n 'kind', 'board',\n 'groupBy', $4::uuid,\n 'lanes', jsonb_build_array(\n jsonb_build_object('option', $5::uuid, 'hidden', true),\n jsonb_build_object('option', null)\n ),\n 'cardFields', jsonb_build_array(),\n 'hideEmptyLanes', false\n ))",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6d5fe359a96357a37b1bb43adc31fa41ad001376c454876a5f49d460429dd62a"
-}
diff --git a/.sqlx/query-6d7c78442c57bf0420b3bb8a7cddd7ac903e54e8132d8deafe279b3ebb6a804e.json b/.sqlx/query-6d7c78442c57bf0420b3bb8a7cddd7ac903e54e8132d8deafe279b3ebb6a804e.json
deleted file mode 100644
index 5176248cba..0000000000
--- a/.sqlx/query-6d7c78442c57bf0420b3bb8a7cddd7ac903e54e8132d8deafe279b3ebb6a804e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM team_user WHERE user_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "6d7c78442c57bf0420b3bb8a7cddd7ac903e54e8132d8deafe279b3ebb6a804e"
-}
diff --git a/.sqlx/query-6d81455fd223ed55ed47a74f5ebcbe9e89b1bc01c66bd2da58702c020f5dfabe.json b/.sqlx/query-6d81455fd223ed55ed47a74f5ebcbe9e89b1bc01c66bd2da58702c020f5dfabe.json
deleted file mode 100644
index 3ededd60f6..0000000000
--- a/.sqlx/query-6d81455fd223ed55ed47a74f5ebcbe9e89b1bc01c66bd2da58702c020f5dfabe.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, team_id, owner_id)\n VALUES ($1, CASE WHEN $2 = 'direct_message' THEN NULL ELSE 'Historical' END,\n $2::comms_channel_type, $3, 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6d81455fd223ed55ed47a74f5ebcbe9e89b1bc01c66bd2da58702c020f5dfabe"
-}
diff --git a/.sqlx/query-6d8538f77a28ee01a0d8dc13eea092d75350df46212dc93c17a959596a76b439.json b/.sqlx/query-6d8538f77a28ee01a0d8dc13eea092d75350df46212dc93c17a959596a76b439.json
deleted file mode 100644
index ec75f32d98..0000000000
--- a/.sqlx/query-6d8538f77a28ee01a0d8dc13eea092d75350df46212dc93c17a959596a76b439.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_scheduled_messages SET send_time = NOW() + INTERVAL '1 hour' WHERE message_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6d8538f77a28ee01a0d8dc13eea092d75350df46212dc93c17a959596a76b439"
-}
diff --git a/.sqlx/query-6d8b8d883a247884c6381d885097e1e7909e92951140190de71780fbf10f4ae5.json b/.sqlx/query-6d8b8d883a247884c6381d885097e1e7909e92951140190de71780fbf10f4ae5.json
deleted file mode 100644
index 14755c78d6..0000000000
--- a/.sqlx/query-6d8b8d883a247884c6381d885097e1e7909e92951140190de71780fbf10f4ae5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id\n FROM initiative\n WHERE id = $1\n FOR UPDATE\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "6d8b8d883a247884c6381d885097e1e7909e92951140190de71780fbf10f4ae5"
-}
diff --git a/.sqlx/query-6e165ca672ced9ce1765bd4ac02d0aeac6bd45d0d86b0a8aa5b5f6c24d5f722e.json b/.sqlx/query-6e165ca672ced9ce1765bd4ac02d0aeac6bd45d0d86b0a8aa5b5f6c24d5f722e.json
deleted file mode 100644
index e62a825123..0000000000
--- a/.sqlx/query-6e165ca672ced9ce1765bd4ac02d0aeac6bd45d0d86b0a8aa5b5f6c24d5f722e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET role = 'admin' WHERE channel_id = $1 AND user_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "6e165ca672ced9ce1765bd4ac02d0aeac6bd45d0d86b0a8aa5b5f6c24d5f722e"
-}
diff --git a/.sqlx/query-6e4046f3e490a8efe3ffe072da4c282f367b490b0f7fe6adf4a67ab10cc78e59.json b/.sqlx/query-6e4046f3e490a8efe3ffe072da4c282f367b490b0f7fe6adf4a67ab10cc78e59.json
deleted file mode 100644
index 3b8e41f713..0000000000
--- a/.sqlx/query-6e4046f3e490a8efe3ffe072da4c282f367b490b0f7fe6adf4a67ab10cc78e59.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE database_entities SET trashed_at = now() WHERE database_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6e4046f3e490a8efe3ffe072da4c282f367b490b0f7fe6adf4a67ab10cc78e59"
-}
diff --git a/.sqlx/query-6e876d9d84e75e8a728561d18cac6a317c95cd43590f6485fdd23a9ecf0aa116.json b/.sqlx/query-6e876d9d84e75e8a728561d18cac6a317c95cd43590f6485fdd23a9ecf0aa116.json
deleted file mode 100644
index 6c38e558ae..0000000000
--- a/.sqlx/query-6e876d9d84e75e8a728561d18cac6a317c95cd43590f6485fdd23a9ecf0aa116.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SET idle_in_transaction_session_timeout = '50ms'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "6e876d9d84e75e8a728561d18cac6a317c95cd43590f6485fdd23a9ecf0aa116"
-}
diff --git a/.sqlx/query-6ea116bc34d74d84cf91f0e9ab41f1831024a5659d858372888b68374d699b47.json b/.sqlx/query-6ea116bc34d74d84cf91f0e9ab41f1831024a5659d858372888b68374d699b47.json
deleted file mode 100644
index 22d2f128e4..0000000000
--- a/.sqlx/query-6ea116bc34d74d84cf91f0e9ab41f1831024a5659d858372888b68374d699b47.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id FROM databases",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "6ea116bc34d74d84cf91f0e9ab41f1831024a5659d858372888b68374d699b47"
-}
diff --git a/.sqlx/query-6f222966714b16e81dec1e0b8a127dc1b065b131fc55a54aec7dacaeb1aa3444.json b/.sqlx/query-6f222966714b16e81dec1e0b8a127dc1b065b131fc55a54aec7dacaeb1aa3444.json
deleted file mode 100644
index e568e7a7f8..0000000000
--- a/.sqlx/query-6f222966714b16e81dec1e0b8a127dc1b065b131fc55a54aec7dacaeb1aa3444.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels(id, channel_type, owner_id) VALUES ($1, 'private', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "6f222966714b16e81dec1e0b8a127dc1b065b131fc55a54aec7dacaeb1aa3444"
-}
diff --git a/.sqlx/query-6f5af43c8c300d18592d183b9d272a115811d56d6e7fa9235b7deec3ed03b751.json b/.sqlx/query-6f5af43c8c300d18592d183b9d272a115811d56d6e7fa9235b7deec3ed03b751.json
deleted file mode 100644
index 026afd6c9b..0000000000
--- a/.sqlx/query-6f5af43c8c300d18592d183b9d272a115811d56d6e7fa9235b7deec3ed03b751.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM notification WHERE id = ANY($1)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "6f5af43c8c300d18592d183b9d272a115811d56d6e7fa9235b7deec3ed03b751"
-}
diff --git a/.sqlx/query-6fedf690a9e09ba50fd448225ca6971a2181429dba4b1c4daaa72d911871dfc9.json b/.sqlx/query-6fedf690a9e09ba50fd448225ca6971a2181429dba4b1c4daaa72d911871dfc9.json
deleted file mode 100644
index 0b51e2b517..0000000000
--- a/.sqlx/query-6fedf690a9e09ba50fd448225ca6971a2181429dba4b1c4daaa72d911871dfc9.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_companies(id, team_id, first_interaction, last_interaction) VALUES ($1, $2, now(), now())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "6fedf690a9e09ba50fd448225ca6971a2181429dba4b1c4daaa72d911871dfc9"
-}
diff --git a/.sqlx/query-70840b3a7e70aa1120dfb953aa6b2014f4c001de2b2c7f6de5122962197b9e21.json b/.sqlx/query-70840b3a7e70aa1120dfb953aa6b2014f4c001de2b2c7f6de5122962197b9e21.json
deleted file mode 100644
index 92695b7b70..0000000000
--- a/.sqlx/query-70840b3a7e70aa1120dfb953aa6b2014f4c001de2b2c7f6de5122962197b9e21.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_attachments WHERE message_id = ANY($1)",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "70840b3a7e70aa1120dfb953aa6b2014f4c001de2b2c7f6de5122962197b9e21"
-}
diff --git a/.sqlx/query-708a6d4141258264cd97bebaa89538094109ed0d11e6daa9475fb9a9960ab258.json b/.sqlx/query-708a6d4141258264cd97bebaa89538094109ed0d11e6daa9475fb9a9960ab258.json
deleted file mode 100644
index 32eca519c9..0000000000
--- a/.sqlx/query-708a6d4141258264cd97bebaa89538094109ed0d11e6daa9475fb9a9960ab258.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_tables (id, database_id, name, position) VALUES ($1, $2, 'Contacts', '80')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "708a6d4141258264cd97bebaa89538094109ed0d11e6daa9475fb9a9960ab258"
-}
diff --git a/.sqlx/query-70fd335b1cc501c338da576cff3f572d57395ee6a80ee5e4429598f701ac407b.json b/.sqlx/query-70fd335b1cc501c338da576cff3f572d57395ee6a80ee5e4429598f701ac407b.json
deleted file mode 100644
index 9312e25478..0000000000
--- a/.sqlx/query-70fd335b1cc501c338da576cff3f572d57395ee6a80ee5e4429598f701ac407b.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM \"DocumentInstance\" WHERE \"documentId\" = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "70fd335b1cc501c338da576cff3f572d57395ee6a80ee5e4429598f701ac407b"
-}
diff --git a/.sqlx/query-7148c51a64de5cc3721334828de9c6349171f0a9c46fbe5be239c16e007fbef8.json b/.sqlx/query-7148c51a64de5cc3721334828de9c6349171f0a9c46fbe5be239c16e007fbef8.json
deleted file mode 100644
index c99125b0fe..0000000000
--- a/.sqlx/query-7148c51a64de5cc3721334828de9c6349171f0a9c46fbe5be239c16e007fbef8.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_message_threads WHERE root_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "7148c51a64de5cc3721334828de9c6349171f0a9c46fbe5be239c16e007fbef8"
-}
diff --git a/.sqlx/query-715cfbc5cfc1101acfd623e32ed0e784e45d498e41bc9527e93ee6db3114ee1a.json b/.sqlx/query-715cfbc5cfc1101acfd623e32ed0e784e45d498e41bc9527e93ee6db3114ee1a.json
deleted file mode 100644
index 5051791716..0000000000
--- a/.sqlx/query-715cfbc5cfc1101acfd623e32ed0e784e45d498e41bc9527e93ee6db3114ee1a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT processing FROM email_scheduled_messages WHERE message_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "processing",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "715cfbc5cfc1101acfd623e32ed0e784e45d498e41bc9527e93ee6db3114ee1a"
-}
diff --git a/.sqlx/query-71c5ff27eb1944132a86b81e2964dddac097803db77a4ae9d28fd1fb1a7fc71a.json b/.sqlx/query-71c5ff27eb1944132a86b81e2964dddac097803db77a4ae9d28fd1fb1a7fc71a.json
deleted file mode 100644
index fd4f407316..0000000000
--- a/.sqlx/query-71c5ff27eb1944132a86b81e2964dddac097803db77a4ae9d28fd1fb1a7fc71a.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"createdAt\" as created_at, \"updatedAt\" as updated_at\n FROM \"UserHistory\"\n WHERE \"userId\" = $1 AND \"itemId\" = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 1,
- "name": "updated_at",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "71c5ff27eb1944132a86b81e2964dddac097803db77a4ae9d28fd1fb1a7fc71a"
-}
diff --git a/.sqlx/query-7357d61151be99fc37aada71f9a9e5cd7a0552b25d288523b14d955a7552ab8c.json b/.sqlx/query-7357d61151be99fc37aada71f9a9e5cd7a0552b25d288523b14d955a7552ab8c.json
deleted file mode 100644
index 0feff3d898..0000000000
--- a/.sqlx/query-7357d61151be99fc37aada71f9a9e5cd7a0552b25d288523b14d955a7552ab8c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ('macro|[email protected]', '[email protected]', $1)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7357d61151be99fc37aada71f9a9e5cd7a0552b25d288523b14d955a7552ab8c"
-}
diff --git a/.sqlx/query-736a15378e19dcaacae0b77359f63b9c5a157f04c7c828a1f109733b2d4c9eb9.json b/.sqlx/query-736a15378e19dcaacae0b77359f63b9c5a157f04c7c828a1f109733b2d4c9eb9.json
deleted file mode 100644
index d8d678a5a4..0000000000
--- a/.sqlx/query-736a15378e19dcaacae0b77359f63b9c5a157f04c7c828a1f109733b2d4c9eb9.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO ai_billing_period_allowance (\n user_id, period_start, billed_users, included_cents_by_user,\n included_cost_cents_by_user\n )\n VALUES ($1, $2, $3, $4, $5)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz",
- "TextArray",
- "Int8Array",
- "Int8Array"
- ]
- },
- "nullable": []
- },
- "hash": "736a15378e19dcaacae0b77359f63b9c5a157f04c7c828a1f109733b2d4c9eb9"
-}
diff --git a/.sqlx/query-73997a3c3273379693f7d1e6a3f29a9487e15195e7c92a8d02398ee6179b9bda.json b/.sqlx/query-73997a3c3273379693f7d1e6a3f29a9487e15195e7c92a8d02398ee6179b9bda.json
deleted file mode 100644
index 907c92bdbf..0000000000
--- a/.sqlx/query-73997a3c3273379693f7d1e6a3f29a9487e15195e7c92a8d02398ee6179b9bda.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, 't17', '[email protected]', 't17-customer')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "73997a3c3273379693f7d1e6a3f29a9487e15195e7c92a8d02398ee6179b9bda"
-}
diff --git a/.sqlx/query-73ade1d5ca9b510d490338f98d32548a9dffc2b313ddcb9fbd1eae3a6e782d76.json b/.sqlx/query-73ade1d5ca9b510d490338f98d32548a9dffc2b313ddcb9fbd1eae3a6e782d76.json
deleted file mode 100644
index 65ba99591b..0000000000
--- a/.sqlx/query-73ade1d5ca9b510d490338f98d32548a9dffc2b313ddcb9fbd1eae3a6e782d76.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT anchor AS \"anchor!\" FROM comms_message_threads WHERE root_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "anchor!",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "73ade1d5ca9b510d490338f98d32548a9dffc2b313ddcb9fbd1eae3a6e782d76"
-}
diff --git a/.sqlx/query-73bdc42122354f8eb051d7754aedbda47add5963ca53c335589db04ea1bab3f5.json b/.sqlx/query-73bdc42122354f8eb051d7754aedbda47add5963ca53c335589db04ea1bab3f5.json
deleted file mode 100644
index a0bae906cd..0000000000
--- a/.sqlx/query-73bdc42122354f8eb051d7754aedbda47add5963ca53c335589db04ea1bab3f5.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES\n ('d1000000-0000-0000-0000-000000000001', 'owner', '[email protected]', 'followup_owner'),\n ('d1000000-0000-0000-0000-000000000002', 'delegate', '[email protected]', 'followup_delegate')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "73bdc42122354f8eb051d7754aedbda47add5963ca53c335589db04ea1bab3f5"
-}
diff --git a/.sqlx/query-740675ec64e23b476db7b1a0e7df4f13a18ed6ebaf40f20be915d9a4d867ed04.json b/.sqlx/query-740675ec64e23b476db7b1a0e7df4f13a18ed6ebaf40f20be915d9a4d867ed04.json
deleted file mode 100644
index c2e8ea95fa..0000000000
--- a/.sqlx/query-740675ec64e23b476db7b1a0e7df4f13a18ed6ebaf40f20be915d9a4d867ed04.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO ai_billing_period_allowance (\n user_id, period_start, billed_users, included_cents_by_user,\n included_cost_cents_by_user\n )\n VALUES ($1, $2, $3, $4, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz",
- "TextArray",
- "Int8Array"
- ]
- },
- "nullable": []
- },
- "hash": "740675ec64e23b476db7b1a0e7df4f13a18ed6ebaf40f20be915d9a4d867ed04"
-}
diff --git a/.sqlx/query-74476621882c558774449b191be0247686be4cbf3abf133b48bfd6ca1f4ea9a8.json b/.sqlx/query-74476621882c558774449b191be0247686be4cbf3abf133b48bfd6ca1f4ea9a8.json
deleted file mode 100644
index 9563dc0dbd..0000000000
--- a/.sqlx/query-74476621882c558774449b191be0247686be4cbf3abf133b48bfd6ca1f4ea9a8.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE ai_financial_invocation SET finalization = NULL, finalized_at = NULL WHERE invocation_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "74476621882c558774449b191be0247686be4cbf3abf133b48bfd6ca1f4ea9a8"
-}
diff --git a/.sqlx/query-747ec3ab833e17695fe727b92ad7e50018ad0be230e2dc9cd671c40fdcea55f5.json b/.sqlx/query-747ec3ab833e17695fe727b92ad7e50018ad0be230e2dc9cd671c40fdcea55f5.json
deleted file mode 100644
index 3739ece1c9..0000000000
--- a/.sqlx/query-747ec3ab833e17695fe727b92ad7e50018ad0be230e2dc9cd671c40fdcea55f5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT has_calendar_attachment FROM email_threads WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "has_calendar_attachment",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "747ec3ab833e17695fe727b92ad7e50018ad0be230e2dc9cd671c40fdcea55f5"
-}
diff --git a/.sqlx/query-74c1f97b51a3b15e2ad5e662e85c19b874d47235b28c13b57d73ee2d1ab2cce7.json b/.sqlx/query-74c1f97b51a3b15e2ad5e662e85c19b874d47235b28c13b57d73ee2d1ab2cce7.json
deleted file mode 100644
index b93653a377..0000000000
--- a/.sqlx/query-74c1f97b51a3b15e2ad5e662e85c19b874d47235b28c13b57d73ee2d1ab2cce7.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM comms_messages\n WHERE parent_entity_type = 'document' AND parent_entity_id = 'message-doc-a'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "74c1f97b51a3b15e2ad5e662e85c19b874d47235b28c13b57d73ee2d1ab2cce7"
-}
diff --git a/.sqlx/query-7502dfa03c80d96fdee36b722b560bf2f8d0d3d70a10983dc2179afdb73d6b4d.json b/.sqlx/query-7502dfa03c80d96fdee36b722b560bf2f8d0d3d70a10983dc2179afdb73d6b4d.json
deleted file mode 100644
index c62fafadfc..0000000000
--- a/.sqlx/query-7502dfa03c80d96fdee36b722b560bf2f8d0d3d70a10983dc2179afdb73d6b4d.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team_user (user_id, team_id, team_role)\n VALUES ($1, $2, $3::text::team_role)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7502dfa03c80d96fdee36b722b560bf2f8d0d3d70a10983dc2179afdb73d6b4d"
-}
diff --git a/.sqlx/query-7507caf42d9e35d16a767c916a1eb6e4486a45a585078aa7570a20e0c816bc2d.json b/.sqlx/query-7507caf42d9e35d16a767c916a1eb6e4486a45a585078aa7570a20e0c816bc2d.json
deleted file mode 100644
index 5ad9286b34..0000000000
--- a/.sqlx/query-7507caf42d9e35d16a767c916a1eb6e4486a45a585078aa7570a20e0c816bc2d.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT message_id FROM slack_import_message_reference",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "message_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "7507caf42d9e35d16a767c916a1eb6e4486a45a585078aa7570a20e0c816bc2d"
-}
diff --git a/.sqlx/query-751db03599259334fdab485abcbf6c29da6654f33853b600a208406f2ad17cb0.json b/.sqlx/query-751db03599259334fdab485abcbf6c29da6654f33853b600a208406f2ad17cb0.json
deleted file mode 100644
index 12aa2decbf..0000000000
--- a/.sqlx/query-751db03599259334fdab485abcbf6c29da6654f33853b600a208406f2ad17cb0.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) AS \"count!\" FROM channel_label_channel WHERE label_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "751db03599259334fdab485abcbf6c29da6654f33853b600a208406f2ad17cb0"
-}
diff --git a/.sqlx/query-753c12914c55bc487f0c5fa53ef55e0e3efb7292f770e9761767054c43fd8a47.json b/.sqlx/query-753c12914c55bc487f0c5fa53ef55e0e3efb7292f770e9761767054c43fd8a47.json
deleted file mode 100644
index eff329e2e2..0000000000
--- a/.sqlx/query-753c12914c55bc487f0c5fa53ef55e0e3efb7292f770e9761767054c43fd8a47.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT source_type::text AS \"source_type!\", source_id\n FROM entity_access\n WHERE entity_id = $1 AND access_level = 'owner'\n ORDER BY source_type::text\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- false
- ]
- },
- "hash": "753c12914c55bc487f0c5fa53ef55e0e3efb7292f770e9761767054c43fd8a47"
-}
diff --git a/.sqlx/query-7550baf37fc11d382c34ab38427a290bbc9719715ac95a86e49a9abc6e77f5fb.json b/.sqlx/query-7550baf37fc11d382c34ab38427a290bbc9719715ac95a86e49a9abc6e77f5fb.json
deleted file mode 100644
index 677c2281ea..0000000000
--- a/.sqlx/query-7550baf37fc11d382c34ab38427a290bbc9719715ac95a86e49a9abc6e77f5fb.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, owner_id) VALUES ($1, 'historical', 'private', 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7550baf37fc11d382c34ab38427a290bbc9719715ac95a86e49a9abc6e77f5fb"
-}
diff --git a/.sqlx/query-75b5be3dd7cb58382235b5b6a6efd05128ee36a118dfb2c95a4fa3cbccc0543d.json b/.sqlx/query-75b5be3dd7cb58382235b5b6a6efd05128ee36a118dfb2c95a4fa3cbccc0543d.json
deleted file mode 100644
index a806f5dcc5..0000000000
--- a/.sqlx/query-75b5be3dd7cb58382235b5b6a6efd05128ee36a118dfb2c95a4fa3cbccc0543d.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"itemId\" as item_id FROM \"UserHistory\" WHERE \"userId\" = $1 AND \"itemId\" = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "item_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "75b5be3dd7cb58382235b5b6a6efd05128ee36a118dfb2c95a4fa3cbccc0543d"
-}
diff --git a/.sqlx/query-7615dbd23b600f4e15c45024d84a0366c3ef228e00417b272922c94b66285685.json b/.sqlx/query-7615dbd23b600f4e15c45024d84a0366c3ef228e00417b272922c94b66285685.json
deleted file mode 100644
index beddf1a164..0000000000
--- a/.sqlx/query-7615dbd23b600f4e15c45024d84a0366c3ef228e00417b272922c94b66285685.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET enabled = false WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7615dbd23b600f4e15c45024d84a0366c3ef228e00417b272922c94b66285685"
-}
diff --git a/.sqlx/query-76829ccfdac09457be977dc373b1313620bf709930deccd0fc769ff9567d45d2.json b/.sqlx/query-76829ccfdac09457be977dc373b1313620bf709930deccd0fc769ff9567d45d2.json
deleted file mode 100644
index 10b5485811..0000000000
--- a/.sqlx/query-76829ccfdac09457be977dc373b1313620bf709930deccd0fc769ff9567d45d2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) AS \"count!\" FROM \"UserHistory\" WHERE \"itemId\" = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "76829ccfdac09457be977dc373b1313620bf709930deccd0fc769ff9567d45d2"
-}
diff --git a/.sqlx/query-7688cca5149914d19c07acb0a2b2f9a56e4801a2a77e289a6b50a2118db8e8c5.json b/.sqlx/query-7688cca5149914d19c07acb0a2b2f9a56e4801a2a77e289a6b50a2118db8e8c5.json
deleted file mode 100644
index 65b15c2319..0000000000
--- a/.sqlx/query-7688cca5149914d19c07acb0a2b2f9a56e4801a2a77e289a6b50a2118db8e8c5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT body_html_sanitized FROM email_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "body_html_sanitized",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "7688cca5149914d19c07acb0a2b2f9a56e4801a2a77e289a6b50a2118db8e8c5"
-}
diff --git a/.sqlx/query-76b6889b4bf8178dddbfbaa3bb730a68d95ebd4b775c8fc72534681d6ccb8b15.json b/.sqlx/query-76b6889b4bf8178dddbfbaa3bb730a68d95ebd4b775c8fc72534681d6ccb8b15.json
deleted file mode 100644
index 981b19e811..0000000000
--- a/.sqlx/query-76b6889b4bf8178dddbfbaa3bb730a68d95ebd4b775c8fc72534681d6ccb8b15.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO bots (id, kind, owner_user_id, name, handle, has_agent)\n VALUES ($1, 'owned', $2, 'Unbound agent', $3, true)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "76b6889b4bf8178dddbfbaa3bb730a68d95ebd4b775c8fc72534681d6ccb8b15"
-}
diff --git a/.sqlx/query-775868ef05798d2ba33d35d9e8cb66753fe8662dc0c30a58ead2c5ec16258afb.json b/.sqlx/query-775868ef05798d2ba33d35d9e8cb66753fe8662dc0c30a58ead2c5ec16258afb.json
deleted file mode 100644
index 0c0389b3c8..0000000000
--- a/.sqlx/query-775868ef05798d2ba33d35d9e8cb66753fe8662dc0c30a58ead2c5ec16258afb.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level) VALUES ($1, 'database', $2, 'user', 'owner')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "775868ef05798d2ba33d35d9e8cb66753fe8662dc0c30a58ead2c5ec16258afb"
-}
diff --git a/.sqlx/query-786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e.json b/.sqlx/query-786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e.json
deleted file mode 100644
index 417b14c176..0000000000
--- a/.sqlx/query-786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_overage_charge (id, user_id, period_start, amount_cents, status, accounting_policy)\n VALUES ($1, $2, $3, 105, 'paid', 'public_allowance_v1')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "786dd4d53269c55a1865fedd231901cff70a3fe3a814eaeb3883e038e53c086e"
-}
diff --git a/.sqlx/query-7a084d02b69403f03a5e1a4a59487bf2e66bd41543908d873d602a9d23b03ca8.json b/.sqlx/query-7a084d02b69403f03a5e1a4a59487bf2e66bd41543908d873d602a9d23b03ca8.json
deleted file mode 100644
index 94500204f5..0000000000
--- a/.sqlx/query-7a084d02b69403f03a5e1a4a59487bf2e66bd41543908d873d602a9d23b03ca8.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $2, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7a084d02b69403f03a5e1a4a59487bf2e66bd41543908d873d602a9d23b03ca8"
-}
diff --git a/.sqlx/query-7a1b46ab8909534cab7572ba5c031df2cb4a9a35c882f112fc79ce4429b5aa13.json b/.sqlx/query-7a1b46ab8909534cab7572ba5c031df2cb4a9a35c882f112fc79ce4429b5aa13.json
deleted file mode 100644
index b9feade6b2..0000000000
--- a/.sqlx/query-7a1b46ab8909534cab7572ba5c031df2cb4a9a35c882f112fc79ce4429b5aa13.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT email FROM notification_email_unsubscribe WHERE email = 'a'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "email",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "7a1b46ab8909534cab7572ba5c031df2cb4a9a35c882f112fc79ce4429b5aa13"
-}
diff --git a/.sqlx/query-7a46646d6f977892d26d63d547e9f42fe01f8a7b19a3dade9420553615125f6a.json b/.sqlx/query-7a46646d6f977892d26d63d547e9f42fe01f8a7b19a3dade9420553615125f6a.json
deleted file mode 100644
index 05debfe9e0..0000000000
--- a/.sqlx/query-7a46646d6f977892d26d63d547e9f42fe01f8a7b19a3dade9420553615125f6a.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO document_sub_type(document_id, sub_type) VALUES ('message-doc-a', 'task')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "7a46646d6f977892d26d63d547e9f42fe01f8a7b19a3dade9420553615125f6a"
-}
diff --git a/.sqlx/query-7a6fdeac3b3c02c186e827f2ac20e0083bc01c0392e43def49a00704c527b83e.json b/.sqlx/query-7a6fdeac3b3c02c186e827f2ac20e0083bc01c0392e43def49a00704c527b83e.json
deleted file mode 100644
index 2a456c2a13..0000000000
--- a/.sqlx/query-7a6fdeac3b3c02c186e827f2ac20e0083bc01c0392e43def49a00704c527b83e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO user_notification(user_id, notification_id) VALUES ($1, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7a6fdeac3b3c02c186e827f2ac20e0083bc01c0392e43def49a00704c527b83e"
-}
diff --git a/.sqlx/query-7b26d0501d1026eeeaef076e7a6e9386f2ba163ba045d50954c4fddd397c97e7.json b/.sqlx/query-7b26d0501d1026eeeaef076e7a6e9386f2ba163ba045d50954c4fddd397c97e7.json
deleted file mode 100644
index b8ec2d8008..0000000000
--- a/.sqlx/query-7b26d0501d1026eeeaef076e7a6e9386f2ba163ba045d50954c4fddd397c97e7.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET team_id = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7b26d0501d1026eeeaef076e7a6e9386f2ba163ba045d50954c4fddd397c97e7"
-}
diff --git a/.sqlx/query-7b960e99de9758063ef0f189bec909f9703d817af2a7aed68e6a5fc1bc94159e.json b/.sqlx/query-7b960e99de9758063ef0f189bec909f9703d817af2a7aed68e6a5fc1bc94159e.json
deleted file mode 100644
index e47b9c574f..0000000000
--- a/.sqlx/query-7b960e99de9758063ef0f189bec909f9703d817af2a7aed68e6a5fc1bc94159e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Document\" (id, name, owner, \"fileType\") VALUES ($1, 'doc', $2, 'md')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7b960e99de9758063ef0f189bec909f9703d817af2a7aed68e6a5fc1bc94159e"
-}
diff --git a/.sqlx/query-7b9ab815fcc51927f17f3fa838a0a13ebcc05049fe61d74eda708f22172b0ac7.json b/.sqlx/query-7b9ab815fcc51927f17f3fa838a0a13ebcc05049fe61d74eda708f22172b0ac7.json
deleted file mode 100644
index 51d69aa8bf..0000000000
--- a/.sqlx/query-7b9ab815fcc51927f17f3fa838a0a13ebcc05049fe61d74eda708f22172b0ac7.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT uploaded, \"contentState\", \"contentLocation\"\n FROM \"Document\"\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "uploaded",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "contentState",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "contentLocation",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- true
- ]
- },
- "hash": "7b9ab815fcc51927f17f3fa838a0a13ebcc05049fe61d74eda708f22172b0ac7"
-}
diff --git a/.sqlx/query-7c10177cc44ad44c72239f6b01371412c5f263168f3adc145c7c5bad424c5dd1.json b/.sqlx/query-7c10177cc44ad44c72239f6b01371412c5f263168f3adc145c7c5bad424c5dd1.json
deleted file mode 100644
index 647b4740c9..0000000000
--- a/.sqlx/query-7c10177cc44ad44c72239f6b01371412c5f263168f3adc145c7c5bad424c5dd1.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO ai_billing_period_allowance (\n user_id, period_start, billed_users, included_cents_by_user\n )\n VALUES ($1, $2, $3, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz",
- "TextArray",
- "Int8Array"
- ]
- },
- "nullable": []
- },
- "hash": "7c10177cc44ad44c72239f6b01371412c5f263168f3adc145c7c5bad424c5dd1"
-}
diff --git a/.sqlx/query-7c4a3f3a694d4005d372a04d2b7f529eed8c3be87deff2bd76aef749db8b7fcf.json b/.sqlx/query-7c4a3f3a694d4005d372a04d2b7f529eed8c3be87deff2bd76aef749db8b7fcf.json
deleted file mode 100644
index 2340b4856e..0000000000
--- a/.sqlx/query-7c4a3f3a694d4005d372a04d2b7f529eed8c3be87deff2bd76aef749db8b7fcf.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id FROM comms_messages ORDER BY id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "7c4a3f3a694d4005d372a04d2b7f529eed8c3be87deff2bd76aef749db8b7fcf"
-}
diff --git a/.sqlx/query-7c70af198faef5fdb3bcf374164b855261cb6d68ab105ea540dcda3d19760d9c.json b/.sqlx/query-7c70af198faef5fdb3bcf374164b855261cb6d68ab105ea540dcda3d19760d9c.json
deleted file mode 100644
index 577257f5d4..0000000000
--- a/.sqlx/query-7c70af198faef5fdb3bcf374164b855261cb6d68ab105ea540dcda3d19760d9c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'Atomic history', 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7c70af198faef5fdb3bcf374164b855261cb6d68ab105ea540dcda3d19760d9c"
-}
diff --git a/.sqlx/query-7cd8404cd175b06f3a86492d2ce09d38912394428377ae29149586cba067c6af.json b/.sqlx/query-7cd8404cd175b06f3a86492d2ce09d38912394428377ae29149586cba067c6af.json
deleted file mode 100644
index 6145c5a09d..0000000000
--- a/.sqlx/query-7cd8404cd175b06f3a86492d2ce09d38912394428377ae29149586cba067c6af.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO document_sub_type (document_id, sub_type)\n VALUES ($1, 'task'), ($2, 'snippet')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7cd8404cd175b06f3a86492d2ce09d38912394428377ae29149586cba067c6af"
-}
diff --git a/.sqlx/query-7ced61e34ca50f6f3f002e9fa0609cb1c143e37ad838a39d0cee671283347a2b.json b/.sqlx/query-7ced61e34ca50f6f3f002e9fa0609cb1c143e37ad838a39d0cee671283347a2b.json
deleted file mode 100644
index 7e372e8019..0000000000
--- a/.sqlx/query-7ced61e34ca50f6f3f002e9fa0609cb1c143e37ad838a39d0cee671283347a2b.json
+++ /dev/null
@@ -1,178 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n id, name, owner_id, thread_id, originating_message_id, bot_id,\n model, harness, repo_url, repo_branch, pull_request_url, workspace, sandbox_size, instructions,\n mcp_scope, mcp_servers, acp_session_id, status,\n status_event_name, agent_session.created_at, modified_at,\n (SELECT jsonb_build_object('type', parent_entity_type, 'id', parent_entity_id)\n FROM comms_messages WHERE id = agent_session.thread_id)\n AS \"thread_parent?: Json<MessageParent>\",\n ext.provider AS \"external_provider?\", ext.external_id AS \"external_id?\",\n ext.external_name AS \"external_name?\", ext.external_url AS \"external_url?\",\n ext.last_run_id AS \"external_last_run_id?\"\n FROM agent_session\n LEFT JOIN external_agent_session AS ext ON ext.agent_session_id = agent_session.id\n WHERE thread_id = $1\n ORDER BY agent_session.created_at DESC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "thread_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "originating_message_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "bot_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 6,
- "name": "model",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "harness",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "repo_url",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "repo_branch",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "pull_request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 11,
- "name": "workspace",
- "type_info": "Text"
- },
- {
- "ordinal": 12,
- "name": "sandbox_size",
- "type_info": "Text"
- },
- {
- "ordinal": 13,
- "name": "instructions",
- "type_info": "Text"
- },
- {
- "ordinal": 14,
- "name": "mcp_scope",
- "type_info": "Text"
- },
- {
- "ordinal": 15,
- "name": "mcp_servers",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 16,
- "name": "acp_session_id",
- "type_info": "Text"
- },
- {
- "ordinal": 17,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 18,
- "name": "status_event_name",
- "type_info": "Text"
- },
- {
- "ordinal": 19,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 20,
- "name": "modified_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 21,
- "name": "thread_parent?: Json<MessageParent>",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 22,
- "name": "external_provider?",
- "type_info": "Text"
- },
- {
- "ordinal": 23,
- "name": "external_id?",
- "type_info": "Text"
- },
- {
- "ordinal": 24,
- "name": "external_name?",
- "type_info": "Text"
- },
- {
- "ordinal": 25,
- "name": "external_url?",
- "type_info": "Text"
- },
- {
- "ordinal": 26,
- "name": "external_last_run_id?",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- true,
- false,
- true,
- false,
- false,
- null,
- false,
- false,
- true,
- true,
- true
- ]
- },
- "hash": "7ced61e34ca50f6f3f002e9fa0609cb1c143e37ad838a39d0cee671283347a2b"
-}
diff --git a/.sqlx/query-7d6ddfd9f54a47761fbfc2a6994c52e978af082443e0034e73e1288762b7c868.json b/.sqlx/query-7d6ddfd9f54a47761fbfc2a6994c52e978af082443e0034e73e1288762b7c868.json
deleted file mode 100644
index 88ec0d30f2..0000000000
--- a/.sqlx/query-7d6ddfd9f54a47761fbfc2a6994c52e978af082443e0034e73e1288762b7c868.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, owner_id) VALUES ($1, 'History', 'private', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7d6ddfd9f54a47761fbfc2a6994c52e978af082443e0034e73e1288762b7c868"
-}
diff --git a/.sqlx/query-7e496227f6eb0829a95ccc6b6e4b4dc4402f0c119bac82ef9b136b354a6466e3.json b/.sqlx/query-7e496227f6eb0829a95ccc6b6e4b4dc4402f0c119bac82ef9b136b354a6466e3.json
deleted file mode 100644
index 2d4791f800..0000000000
--- a/.sqlx/query-7e496227f6eb0829a95ccc6b6e4b4dc4402f0c119bac82ef9b136b354a6466e3.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) AS \"count!\" FROM entity WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "7e496227f6eb0829a95ccc6b6e4b4dc4402f0c119bac82ef9b136b354a6466e3"
-}
diff --git a/.sqlx/query-7e7a4d40b0d7008dcff499ce33bf78da6f46946f61a20006fd0b05d181d083e5.json b/.sqlx/query-7e7a4d40b0d7008dcff499ce33bf78da6f46946f61a20006fd0b05d181d083e5.json
deleted file mode 100644
index e5597bc5b2..0000000000
--- a/.sqlx/query-7e7a4d40b0d7008dcff499ce33bf78da6f46946f61a20006fd0b05d181d083e5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) as \"count!\" FROM property_options WHERE property_definition_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "7e7a4d40b0d7008dcff499ce33bf78da6f46946f61a20006fd0b05d181d083e5"
-}
diff --git a/.sqlx/query-7e8ff83fbde71d313ca6e3a426943c3837f17395d5f0956ef62f50c3f853729c.json b/.sqlx/query-7e8ff83fbde71d313ca6e3a426943c3837f17395d5f0956ef62f50c3f853729c.json
deleted file mode 100644
index 9bae0a82cf..0000000000
--- a/.sqlx/query-7e8ff83fbde71d313ca6e3a426943c3837f17395d5f0956ef62f50c3f853729c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_scheduled_messages SET sent = true, processing = false WHERE message_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "7e8ff83fbde71d313ca6e3a426943c3837f17395d5f0956ef62f50c3f853729c"
-}
diff --git a/.sqlx/query-7e93321a1228780634c5fdc4189f4c66a9098d2860c6aa01ec58e22fd1ca06a7.json b/.sqlx/query-7e93321a1228780634c5fdc4189f4c66a9098d2860c6aa01ec58e22fd1ca06a7.json
deleted file mode 100644
index 4244da7ffe..0000000000
--- a/.sqlx/query-7e93321a1228780634c5fdc4189f4c66a9098d2860c6aa01ec58e22fd1ca06a7.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT title, draft, assignees, requested_reviewer_github_user_ids FROM github_pull_request WHERE github_key = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "title",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "draft",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "assignees",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 3,
- "name": "requested_reviewer_github_user_ids",
- "type_info": "TextArray"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true,
- false,
- false,
- false
- ]
- },
- "hash": "7e93321a1228780634c5fdc4189f4c66a9098d2860c6aa01ec58e22fd1ca06a7"
-}
diff --git a/.sqlx/query-7ed2dc20b31dab0735c2ef2e95ac47a2766ae79f71fea5dbfd68e3a921bdbeb0.json b/.sqlx/query-7ed2dc20b31dab0735c2ef2e95ac47a2766ae79f71fea5dbfd68e3a921bdbeb0.json
deleted file mode 100644
index 106487f46a..0000000000
--- a/.sqlx/query-7ed2dc20b31dab0735c2ef2e95ac47a2766ae79f71fea5dbfd68e3a921bdbeb0.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, sender_id, content)\n VALUES ($1, $2, $3, 'macro|[email protected]', 'Agent invocation')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "7ed2dc20b31dab0735c2ef2e95ac47a2766ae79f71fea5dbfd68e3a921bdbeb0"
-}
diff --git a/.sqlx/query-7ed909a3256b9eccf56895bdb8edec3901029a2e72db81b74ebbfc6a626680f2.json b/.sqlx/query-7ed909a3256b9eccf56895bdb8edec3901029a2e72db81b74ebbfc6a626680f2.json
deleted file mode 100644
index 2389bc8624..0000000000
--- a/.sqlx/query-7ed909a3256b9eccf56895bdb8edec3901029a2e72db81b74ebbfc6a626680f2.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT user_id, role AS \"role: ParticipantRole\", joined_at, left_at\n FROM comms_channel_participants WHERE channel_id = $1 ORDER BY user_id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "role: ParticipantRole",
- "type_info": {
- "Custom": {
- "name": "comms_participant_role",
- "kind": {
- "Enum": [
- "owner",
- "admin",
- "member"
- ]
- }
- }
- }
- },
- {
- "ordinal": 2,
- "name": "joined_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "left_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true
- ]
- },
- "hash": "7ed909a3256b9eccf56895bdb8edec3901029a2e72db81b74ebbfc6a626680f2"
-}
diff --git a/.sqlx/query-7ee8fafbf316792909b43741a5d2afdfe798b1e893a1b116519efc97a7f5553d.json b/.sqlx/query-7ee8fafbf316792909b43741a5d2afdfe798b1e893a1b116519efc97a7f5553d.json
deleted file mode 100644
index 07a5062e64..0000000000
--- a/.sqlx/query-7ee8fafbf316792909b43741a5d2afdfe798b1e893a1b116519efc97a7f5553d.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT root_id, text FROM \"PdfHighlightAnchor\" WHERE uuid = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "root_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "text",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- false
- ]
- },
- "hash": "7ee8fafbf316792909b43741a5d2afdfe798b1e893a1b116519efc97a7f5553d"
-}
diff --git a/.sqlx/query-7eef7c2119d728248f3b9d5f47bd305f3870966ea08061045a942b4f32aa4e7d.json b/.sqlx/query-7eef7c2119d728248f3b9d5f47bd305f3870966ea08061045a942b4f32aa4e7d.json
deleted file mode 100644
index a90adfecda..0000000000
--- a/.sqlx/query-7eef7c2119d728248f3b9d5f47bd305f3870966ea08061045a942b4f32aa4e7d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE github_pull_request SET updated_at = $2 WHERE github_key = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "7eef7c2119d728248f3b9d5f47bd305f3870966ea08061045a942b4f32aa4e7d"
-}
diff --git a/.sqlx/query-7f08d83c7255e9eea3d6a749d736ca2ff3563eb57edc627e1fecaaf8815e2eff.json b/.sqlx/query-7f08d83c7255e9eea3d6a749d736ca2ff3563eb57edc627e1fecaaf8815e2eff.json
deleted file mode 100644
index 2882d276f8..0000000000
--- a/.sqlx/query-7f08d83c7255e9eea3d6a749d736ca2ff3563eb57edc627e1fecaaf8815e2eff.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM \"Chat\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "7f08d83c7255e9eea3d6a749d736ca2ff3563eb57edc627e1fecaaf8815e2eff"
-}
diff --git a/.sqlx/query-809a1435a81112b0569446f0e938aaae2504e5609f31840e263d4c0849a9333d.json b/.sqlx/query-809a1435a81112b0569446f0e938aaae2504e5609f31840e263d4c0849a9333d.json
deleted file mode 100644
index 8697e5c56a..0000000000
--- a/.sqlx/query-809a1435a81112b0569446f0e938aaae2504e5609f31840e263d4c0849a9333d.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT patch_blob_key FROM agent_session_changes WHERE agent_session_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "patch_blob_key",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "809a1435a81112b0569446f0e938aaae2504e5609f31840e263d4c0849a9333d"
-}
diff --git a/.sqlx/query-809c5aa01e78839bf554c5c757ad126a2459193e68149f62ddf31e1047be3647.json b/.sqlx/query-809c5aa01e78839bf554c5c757ad126a2459193e68149f62ddf31e1047be3647.json
deleted file mode 100644
index ef952aef99..0000000000
--- a/.sqlx/query-809c5aa01e78839bf554c5c757ad126a2459193e68149f62ddf31e1047be3647.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT send_time, sent, processing FROM email_scheduled_messages WHERE message_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "send_time",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 1,
- "name": "sent",
- "type_info": "Bool"
- },
- {
- "ordinal": 2,
- "name": "processing",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "809c5aa01e78839bf554c5c757ad126a2459193e68149f62ddf31e1047be3647"
-}
diff --git a/.sqlx/query-81cfa29d3ef15ee3afd3eecfa95cd0672b36eed05d7ab9d8ca1342bb6ee4a2b4.json b/.sqlx/query-81cfa29d3ef15ee3afd3eecfa95cd0672b36eed05d7ab9d8ca1342bb6ee4a2b4.json
deleted file mode 100644
index 17de52602e..0000000000
--- a/.sqlx/query-81cfa29d3ef15ee3afd3eecfa95cd0672b36eed05d7ab9d8ca1342bb6ee4a2b4.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE scheduled_action_event_run SET started_at = $3, deadline = $4\n WHERE action_id = $1 AND event_id = $2\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Timestamptz",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "81cfa29d3ef15ee3afd3eecfa95cd0672b36eed05d7ab9d8ca1342bb6ee4a2b4"
-}
diff --git a/.sqlx/query-831ea954f15db76b05365d7f49ab47b32249f716aa8c14c1b53bbb30ccfd7547.json b/.sqlx/query-831ea954f15db76b05365d7f49ab47b32249f716aa8c14c1b53bbb30ccfd7547.json
deleted file mode 100644
index b21c2061f1..0000000000
--- a/.sqlx/query-831ea954f15db76b05365d7f49ab47b32249f716aa8c14c1b53bbb30ccfd7547.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE webhook SET deleted_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "831ea954f15db76b05365d7f49ab47b32249f716aa8c14c1b53bbb30ccfd7547"
-}
diff --git a/.sqlx/query-838135b559e17898abd72732aa324763e72d9e91ea5d1f9b5e493b5c395ec8ae.json b/.sqlx/query-838135b559e17898abd72732aa324763e72d9e91ea5d1f9b5e493b5c395ec8ae.json
deleted file mode 100644
index a8dc6362ef..0000000000
--- a/.sqlx/query-838135b559e17898abd72732aa324763e72d9e91ea5d1f9b5e493b5c395ec8ae.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT inbox_visible, latest_inbound_message_ts FROM email_threads WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "inbox_visible",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "latest_inbound_message_ts",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "838135b559e17898abd72732aa324763e72d9e91ea5d1f9b5e493b5c395ec8ae"
-}
diff --git a/.sqlx/query-83aa76a5608d26ff825dfe283bd6db93c5ccbed720a5ad29a36eaaea2fe32a90.json b/.sqlx/query-83aa76a5608d26ff825dfe283bd6db93c5ccbed720a5ad29a36eaaea2fe32a90.json
deleted file mode 100644
index 9bf664e2ca..0000000000
--- a/.sqlx/query-83aa76a5608d26ff825dfe283bd6db93c5ccbed720a5ad29a36eaaea2fe32a90.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (\n entity_id,\n entity_type,\n source_id,\n source_type,\n access_level\n )\n VALUES ($1, $2, $3, $4::text::entity_access_source_type, $5::text::\"AccessLevel\")\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "83aa76a5608d26ff825dfe283bd6db93c5ccbed720a5ad29a36eaaea2fe32a90"
-}
diff --git a/.sqlx/query-8529dbdb87b3db2fdc811f033037615068009f9aad3ef766d39bc16d0a0126cb.json b/.sqlx/query-8529dbdb87b3db2fdc811f033037615068009f9aad3ef766d39bc16d0a0126cb.json
deleted file mode 100644
index c831f0ef47..0000000000
--- a/.sqlx/query-8529dbdb87b3db2fdc811f033037615068009f9aad3ef766d39bc16d0a0126cb.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET edited_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "8529dbdb87b3db2fdc811f033037615068009f9aad3ef766d39bc16d0a0126cb"
-}
diff --git a/.sqlx/query-852e47ffa47afb353be2647be296e2cc49bfc26475bfd3845673214e241e4213.json b/.sqlx/query-852e47ffa47afb353be2647be296e2cc49bfc26475bfd3845673214e241e4213.json
deleted file mode 100644
index d3e78923dd..0000000000
--- a/.sqlx/query-852e47ffa47afb353be2647be296e2cc49bfc26475bfd3845673214e241e4213.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_messages SET is_sent = TRUE WHERE thread_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "852e47ffa47afb353be2647be296e2cc49bfc26475bfd3845673214e241e4213"
-}
diff --git a/.sqlx/query-853d49f9fb31c959a73c428da3a80d3d8a4c7f8d71faa164be649e5f4ad86dfe.json b/.sqlx/query-853d49f9fb31c959a73c428da3a80d3d8a4c7f8d71faa164be649e5f4ad86dfe.json
deleted file mode 100644
index d1d0953e16..0000000000
--- a/.sqlx/query-853d49f9fb31c959a73c428da3a80d3d8a4c7f8d71faa164be649e5f4ad86dfe.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_job SET registration_closed_at = now(), cancel_requested_at = now(), status = 'cancelled' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "853d49f9fb31c959a73c428da3a80d3d8a4c7f8d71faa164be649e5f4ad86dfe"
-}
diff --git a/.sqlx/query-85d9d5595305c691fc07ce2c4727ca3cb728a0cad52430047808b2776555a1f1.json b/.sqlx/query-85d9d5595305c691fc07ce2c4727ca3cb728a0cad52430047808b2776555a1f1.json
deleted file mode 100644
index 12e0f5ddec..0000000000
--- a/.sqlx/query-85d9d5595305c691fc07ce2c4727ca3cb728a0cad52430047808b2776555a1f1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ($1, '[email protected]', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "85d9d5595305c691fc07ce2c4727ca3cb728a0cad52430047808b2776555a1f1"
-}
diff --git a/.sqlx/query-86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76.json b/.sqlx/query-86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76.json
deleted file mode 100644
index 7c40a440bf..0000000000
--- a/.sqlx/query-86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_usage (id, feature, user_id, model, input_tokens, output_tokens,\n total, created_at, count_usage)\n VALUES ($1, 'chat', $2, 'test-model', 0, 0, 1.0, $3, $4)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Timestamptz",
- "Bool"
- ]
- },
- "nullable": []
- },
- "hash": "86b8905de61002d7be77fd8ed1b411dd86157c409cd3c53d22794407d5bf7e76"
-}
diff --git a/.sqlx/query-870db7495d7a1d85a58a9684a67ff16330fdd1bb88e2bff2bcdf94f9d026b45a.json b/.sqlx/query-870db7495d7a1d85a58a9684a67ff16330fdd1bb88e2bff2bcdf94f9d026b45a.json
deleted file mode 100644
index 9aea9fe1a4..0000000000
--- a/.sqlx/query-870db7495d7a1d85a58a9684a67ff16330fdd1bb88e2bff2bcdf94f9d026b45a.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, user_id, device_token, device_endpoint, device_type as \"device_type:DeviceType\" \n FROM notification_user_device_registration \n WHERE device_token = $1 AND device_type = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "device_token",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "device_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "device_type:DeviceType",
- "type_info": {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android",
- "iosvoip"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android",
- "iosvoip"
- ]
- }
- }
- }
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "870db7495d7a1d85a58a9684a67ff16330fdd1bb88e2bff2bcdf94f9d026b45a"
-}
diff --git a/.sqlx/query-87676ed37d3c69cad81b0b81fa54abd0804a9168c202103afac5653fdeb10304.json b/.sqlx/query-87676ed37d3c69cad81b0b81fa54abd0804a9168c202103afac5653fdeb10304.json
deleted file mode 100644
index 751bcd311c..0000000000
--- a/.sqlx/query-87676ed37d3c69cad81b0b81fa54abd0804a9168c202103afac5653fdeb10304.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO notification_email_unsubscribe_code(email, code)\n VALUES ($1, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "87676ed37d3c69cad81b0b81fa54abd0804a9168c202103afac5653fdeb10304"
-}
diff --git a/.sqlx/query-87c03661de52e0dd44d8c2d7655c928a89090e993e70db255508966014ba10f6.json b/.sqlx/query-87c03661de52e0dd44d8c2d7655c928a89090e993e70db255508966014ba10f6.json
deleted file mode 100644
index a2006b4b56..0000000000
--- a/.sqlx/query-87c03661de52e0dd44d8c2d7655c928a89090e993e70db255508966014ba10f6.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) AS \"count!\" FROM entity_access WHERE entity_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "87c03661de52e0dd44d8c2d7655c928a89090e993e70db255508966014ba10f6"
-}
diff --git a/.sqlx/query-87e0ab7d9cb677457aacd502ea09d9c19e36b4b3e610d96c1afced87e3537226.json b/.sqlx/query-87e0ab7d9cb677457aacd502ea09d9c19e36b4b3e610d96c1afced87e3537226.json
deleted file mode 100644
index ef67dab2aa..0000000000
--- a/.sqlx/query-87e0ab7d9cb677457aacd502ea09d9c19e36b4b3e610d96c1afced87e3537226.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET auto_join_team = true WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "87e0ab7d9cb677457aacd502ea09d9c19e36b4b3e610d96c1afced87e3537226"
-}
diff --git a/.sqlx/query-88ff3a1387f629582e9cb573364794a49911212fa3431b97c70e87574809dae1.json b/.sqlx/query-88ff3a1387f629582e9cb573364794a49911212fa3431b97c70e87574809dae1.json
deleted file mode 100644
index 6813429b7b..0000000000
--- a/.sqlx/query-88ff3a1387f629582e9cb573364794a49911212fa3431b97c70e87574809dae1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Document\" (id, name, owner, \"fileType\") VALUES ($1, 'Description', $2, 'md')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "88ff3a1387f629582e9cb573364794a49911212fa3431b97c70e87574809dae1"
-}
diff --git a/.sqlx/query-892bc28b71266d791c42b239b76acfc6667400f846e3dd698af89058ecb186e9.json b/.sqlx/query-892bc28b71266d791c42b239b76acfc6667400f846e3dd698af89058ecb186e9.json
deleted file mode 100644
index 09bc946401..0000000000
--- a/.sqlx/query-892bc28b71266d791c42b239b76acfc6667400f846e3dd698af89058ecb186e9.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM entity_access WHERE entity_id = $1 AND source_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "892bc28b71266d791c42b239b76acfc6667400f846e3dd698af89058ecb186e9"
-}
diff --git a/.sqlx/query-8a5b5e8e1e4992958968606d363bd491c714225964e44dec89aef85ab1b581bb.json b/.sqlx/query-8a5b5e8e1e4992958968606d363bd491c714225964e44dec89aef85ab1b581bb.json
deleted file mode 100644
index a5e5129305..0000000000
--- a/.sqlx/query-8a5b5e8e1e4992958968606d363bd491c714225964e44dec89aef85ab1b581bb.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO ai_billing_period_allowance (\n user_id, period_start, billed_users, included_cents_by_user, updated_at,\n included_cost_cents_by_user\n )\n VALUES ($1, $2, $3, $4, $5, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz",
- "TextArray",
- "Int8Array",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "8a5b5e8e1e4992958968606d363bd491c714225964e44dec89aef85ab1b581bb"
-}
diff --git a/.sqlx/query-8ae05c4367968a7f8c1a5ba0836fa52dd52a67f33e14b677d6816695c5da2cb1.json b/.sqlx/query-8ae05c4367968a7f8c1a5ba0836fa52dd52a67f33e14b677d6816695c5da2cb1.json
deleted file mode 100644
index 5997e6ff01..0000000000
--- a/.sqlx/query-8ae05c4367968a7f8c1a5ba0836fa52dd52a67f33e14b677d6816695c5da2cb1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT count(*) AS \"count!\"\n FROM agent_session\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "8ae05c4367968a7f8c1a5ba0836fa52dd52a67f33e14b677d6816695c5da2cb1"
-}
diff --git a/.sqlx/query-8b396eaf27c45aa0d66fc504b9a2b49c85a842dc1ac6002531a7017465818a6a.json b/.sqlx/query-8b396eaf27c45aa0d66fc504b9a2b49c85a842dc1ac6002531a7017465818a6a.json
deleted file mode 100644
index c504b13e4f..0000000000
--- a/.sqlx/query-8b396eaf27c45aa0d66fc504b9a2b49c85a842dc1ac6002531a7017465818a6a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM slack_import_outbox WHERE job_id = $1 AND kind = 'import' AND published_at IS NULL",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "8b396eaf27c45aa0d66fc504b9a2b49c85a842dc1ac6002531a7017465818a6a"
-}
diff --git a/.sqlx/query-8be1555d39091c5f68e7bb5e1716e1a0671a6defb484def3c49e8e4f1d224dcc.json b/.sqlx/query-8be1555d39091c5f68e7bb5e1716e1a0671a6defb484def3c49e8e4f1d224dcc.json
deleted file mode 100644
index 21fc16f35d..0000000000
--- a/.sqlx/query-8be1555d39091c5f68e7bb5e1716e1a0671a6defb484def3c49e8e4f1d224dcc.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO call_meetings (id, share_token, user_id, title, scheduled_start, scheduled_end, active_call_id)\n VALUES ($1, $1::uuid::text, $2, 'Standalone chat', $3, $4, $5)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Timestamptz",
- "Timestamptz",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "8be1555d39091c5f68e7bb5e1716e1a0671a6defb484def3c49e8e4f1d224dcc"
-}
diff --git a/.sqlx/query-8cfb7d9a0867557d4a56f2073f89620d9410e0ab4e0a50bbe2cc70d3f6a9be23.json b/.sqlx/query-8cfb7d9a0867557d4a56f2073f89620d9410e0ab4e0a50bbe2cc70d3f6a9be23.json
deleted file mode 100644
index 4b24b32a50..0000000000
--- a/.sqlx/query-8cfb7d9a0867557d4a56f2073f89620d9410e0ab4e0a50bbe2cc70d3f6a9be23.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT is_signal FROM email_threads WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "is_signal",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "8cfb7d9a0867557d4a56f2073f89620d9410e0ab4e0a50bbe2cc70d3f6a9be23"
-}
diff --git a/.sqlx/query-8d1a3e662ff1757a905271ed857c72de32d49a9bf348634ee1c8d9afca21359b.json b/.sqlx/query-8d1a3e662ff1757a905271ed857c72de32d49a9bf348634ee1c8d9afca21359b.json
deleted file mode 100644
index 578cb5b7c3..0000000000
--- a/.sqlx/query-8d1a3e662ff1757a905271ed857c72de32d49a9bf348634ee1c8d9afca21359b.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET deleted_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "8d1a3e662ff1757a905271ed857c72de32d49a9bf348634ee1c8d9afca21359b"
-}
diff --git a/.sqlx/query-8d1d17c1cc6c6582a909c1f723083efa174a50417040df24cf99e4ce7a473a6c.json b/.sqlx/query-8d1d17c1cc6c6582a909c1f723083efa174a50417040df24cf99e4ce7a473a6c.json
deleted file mode 100644
index 59c7889aba..0000000000
--- a/.sqlx/query-8d1d17c1cc6c6582a909c1f723083efa174a50417040df24cf99e4ce7a473a6c.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, sender_id, content, created_at, deleted_at)\n SELECT id, 'channel', channel_id::text, 'macro|[email protected]', 'history',\n '2020-01-01T00:00:00.123456Z'::timestamptz, deleted_at\n FROM UNNEST($1::uuid[], $2::uuid[], $3::timestamptz[]) AS rows(id, channel_id, deleted_at)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "UuidArray",
- "UuidArray",
- "TimestamptzArray"
- ]
- },
- "nullable": []
- },
- "hash": "8d1d17c1cc6c6582a909c1f723083efa174a50417040df24cf99e4ce7a473a6c"
-}
diff --git a/.sqlx/query-8dd50c91dde939b322679a644cf23233e369590188fd0900d807549f1220af7f.json b/.sqlx/query-8dd50c91dde939b322679a644cf23233e369590188fd0900d807549f1220af7f.json
deleted file mode 100644
index 539fb176a0..0000000000
--- a/.sqlx/query-8dd50c91dde939b322679a644cf23233e369590188fd0900d807549f1220af7f.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Document\" (id, name, owner)\n VALUES ($1, 'Attachment', 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "8dd50c91dde939b322679a644cf23233e369590188fd0900d807549f1220af7f"
-}
diff --git a/.sqlx/query-8e8027056ea54b5a3279a1f41673c5aa108a05cc405c9639c6f6bdb54b3a7be2.json b/.sqlx/query-8e8027056ea54b5a3279a1f41673c5aa108a05cc405c9639c6f6bdb54b3a7be2.json
deleted file mode 100644
index 2deca21ae8..0000000000
--- a/.sqlx/query-8e8027056ea54b5a3279a1f41673c5aa108a05cc405c9639c6f6bdb54b3a7be2.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM slack_import_message_reference WHERE completed_at IS NOT NULL",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "8e8027056ea54b5a3279a1f41673c5aa108a05cc405c9639c6f6bdb54b3a7be2"
-}
diff --git a/.sqlx/query-8e916256efd1879917c9f1e955ac25a7ae3150e32393e4817526db7e0b6adef9.json b/.sqlx/query-8e916256efd1879917c9f1e955ac25a7ae3150e32393e4817526db7e0b6adef9.json
deleted file mode 100644
index 8b998bf1b5..0000000000
--- a/.sqlx/query-8e916256efd1879917c9f1e955ac25a7ae3150e32393e4817526db7e0b6adef9.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM macro_user_links WHERE primary_macro_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "8e916256efd1879917c9f1e955ac25a7ae3150e32393e4817526db7e0b6adef9"
-}
diff --git a/.sqlx/query-8f7951cdcbe053bb5a863104f0900418980ba2ff65799d433eec2f2e3365b296.json b/.sqlx/query-8f7951cdcbe053bb5a863104f0900418980ba2ff65799d433eec2f2e3365b296.json
deleted file mode 100644
index 81fd176b83..0000000000
--- a/.sqlx/query-8f7951cdcbe053bb5a863104f0900418980ba2ff65799d433eec2f2e3365b296.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_message_threads SET deleted_at = now() WHERE root_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "8f7951cdcbe053bb5a863104f0900418980ba2ff65799d433eec2f2e3365b296"
-}
diff --git a/.sqlx/query-8fdc25ca235cbaf6c1b37a64e2449111e1732140a8958686ba8c23299ad3e9a0.json b/.sqlx/query-8fdc25ca235cbaf6c1b37a64e2449111e1732140a8958686ba8c23299ad3e9a0.json
deleted file mode 100644
index 1dc259e8fb..0000000000
--- a/.sqlx/query-8fdc25ca235cbaf6c1b37a64e2449111e1732140a8958686ba8c23299ad3e9a0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE team SET auto_join_domain = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "8fdc25ca235cbaf6c1b37a64e2449111e1732140a8958686ba8c23299ad3e9a0"
-}
diff --git a/.sqlx/query-9114619788863e612cd02ec5d12c6a5c585f731c6d5d6acf1fbc6bccc521d37f.json b/.sqlx/query-9114619788863e612cd02ec5d12c6a5c585f731c6d5d6acf1fbc6bccc521d37f.json
deleted file mode 100644
index 30dce9d166..0000000000
--- a/.sqlx/query-9114619788863e612cd02ec5d12c6a5c585f731c6d5d6acf1fbc6bccc521d37f.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, owner_id, team_id)\n VALUES ($1, $2, $3::text::comms_channel_type, $4, $5)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Varchar",
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9114619788863e612cd02ec5d12c6a5c585f731c6d5d6acf1fbc6bccc521d37f"
-}
diff --git a/.sqlx/query-9143f7be1461b1d18f4ab336cb56a6871f22d84c2dd5dfad378a49903b07fc23.json b/.sqlx/query-9143f7be1461b1d18f4ab336cb56a6871f22d84c2dd5dfad378a49903b07fc23.json
deleted file mode 100644
index 2a0291e1ae..0000000000
--- a/.sqlx/query-9143f7be1461b1d18f4ab336cb56a6871f22d84c2dd5dfad378a49903b07fc23.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO harnesses (id, name, owner_user_id, created_by)\n VALUES ($1, 'mine', $2, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "9143f7be1461b1d18f4ab336cb56a6871f22d84c2dd5dfad378a49903b07fc23"
-}
diff --git a/.sqlx/query-915dda37616b7a0ae4f2b9d5e2a22797cdde5d177dc6d6f7e0469c42001ec24b.json b/.sqlx/query-915dda37616b7a0ae4f2b9d5e2a22797cdde5d177dc6d6f7e0469c42001ec24b.json
deleted file mode 100644
index b5ab8331f1..0000000000
--- a/.sqlx/query-915dda37616b7a0ae4f2b9d5e2a22797cdde5d177dc6d6f7e0469c42001ec24b.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_scheduled_messages SET processing = true WHERE message_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "915dda37616b7a0ae4f2b9d5e2a22797cdde5d177dc6d6f7e0469c42001ec24b"
-}
diff --git a/.sqlx/query-917476e4149b4ba5da14be9cc082ed9c816d2ebef19181c9a111a9827361cf4d.json b/.sqlx/query-917476e4149b4ba5da14be9cc082ed9c816d2ebef19181c9a111a9827361cf4d.json
deleted file mode 100644
index 397c93183c..0000000000
--- a/.sqlx/query-917476e4149b4ba5da14be9cc082ed9c816d2ebef19181c9a111a9827361cf4d.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT thread_id FROM comms_messages WHERE parent_entity_type = 'channel' AND parent_entity_id = $1::uuid::text AND id <> $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "thread_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "917476e4149b4ba5da14be9cc082ed9c816d2ebef19181c9a111a9827361cf4d"
-}
diff --git a/.sqlx/query-91ce7a400ca4decbbb562dfe4091777a5e21d4696d09dd5ebd5ee5c3e880714d.json b/.sqlx/query-91ce7a400ca4decbbb562dfe4091777a5e21d4696d09dd5ebd5ee5c3e880714d.json
deleted file mode 100644
index 81d3b32108..0000000000
--- a/.sqlx/query-91ce7a400ca4decbbb562dfe4091777a5e21d4696d09dd5ebd5ee5c3e880714d.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, $2, $3, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "91ce7a400ca4decbbb562dfe4091777a5e21d4696d09dd5ebd5ee5c3e880714d"
-}
diff --git a/.sqlx/query-9241b1410316592468e6557e3fddbecd0e549214bb3027e9c8596510b2aa5c9e.json b/.sqlx/query-9241b1410316592468e6557e3fddbecd0e549214bb3027e9c8596510b2aa5c9e.json
deleted file mode 100644
index 6b399923c5..0000000000
--- a/.sqlx/query-9241b1410316592468e6557e3fddbecd0e549214bb3027e9c8596510b2aa5c9e.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM import_target_reservation",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "9241b1410316592468e6557e3fddbecd0e549214bb3027e9c8596510b2aa5c9e"
-}
diff --git a/.sqlx/query-92b9f96f119c098f3c790e8276f77595535d586e6cfb1ecb0a5411c869a14cfb.json b/.sqlx/query-92b9f96f119c098f3c790e8276f77595535d586e6cfb1ecb0a5411c869a14cfb.json
deleted file mode 100644
index 3bcf9562ac..0000000000
--- a/.sqlx/query-92b9f96f119c098f3c790e8276f77595535d586e6cfb1ecb0a5411c869a14cfb.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT entity_type AS \"entity_type: EntityType\", property_definition_id, values\n FROM entity_properties\n WHERE entity_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "entity_type: EntityType",
- "type_info": {
- "Custom": {
- "name": "property_entity_type",
- "kind": {
- "Enum": [
- "CHANNEL",
- "CHAT",
- "DOCUMENT",
- "PROJECT",
- "THREAD",
- "USER",
- "COMPANY",
- "TASK",
- "CALL_RECORD",
- "CALENDAR_EVENT",
- "INITIATIVE",
- "CONTACT",
- "DATABASE_ROW"
- ]
- }
- }
- }
- },
- {
- "ordinal": 1,
- "name": "property_definition_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "values",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- true
- ]
- },
- "hash": "92b9f96f119c098f3c790e8276f77595535d586e6cfb1ecb0a5411c869a14cfb"
-}
diff --git a/.sqlx/query-9336d3c7a1a5c10e183c125e2f8d761a2e35f74ce134a1b9921d00d472936d42.json b/.sqlx/query-9336d3c7a1a5c10e183c125e2f8d761a2e35f74ce134a1b9921d00d472936d42.json
deleted file mode 100644
index 61b7880ef8..0000000000
--- a/.sqlx/query-9336d3c7a1a5c10e183c125e2f8d761a2e35f74ce134a1b9921d00d472936d42.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT definition FROM database_queries WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "definition",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "9336d3c7a1a5c10e183c125e2f8d761a2e35f74ce134a1b9921d00d472936d42"
-}
diff --git a/.sqlx/query-93a69c346b4a320ec3222fe8cee2ab56cc795072cf84e05a55d68d4f3d0ccb0a.json b/.sqlx/query-93a69c346b4a320ec3222fe8cee2ab56cc795072cf84e05a55d68d4f3d0ccb0a.json
deleted file mode 100644
index 12e4a877b8..0000000000
--- a/.sqlx/query-93a69c346b4a320ec3222fe8cee2ab56cc795072cf84e05a55d68d4f3d0ccb0a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE \"PdfHighlightAnchor\" SET text = 'edited words' WHERE uuid = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "93a69c346b4a320ec3222fe8cee2ab56cc795072cf84e05a55d68d4f3d0ccb0a"
-}
diff --git a/.sqlx/query-93e1fa2f9b76113cb2c2e424d40e75ddab6d2d1b839d0deabd1998cbcefa8d03.json b/.sqlx/query-93e1fa2f9b76113cb2c2e424d40e75ddab6d2d1b839d0deabd1998cbcefa8d03.json
deleted file mode 100644
index 126309b011..0000000000
--- a/.sqlx/query-93e1fa2f9b76113cb2c2e424d40e75ddab6d2d1b839d0deabd1998cbcefa8d03.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO entity_properties(id, entity_id, entity_type, property_definition_id, values)\n VALUES ($1, 'message-doc-a', 'DOCUMENT', $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "93e1fa2f9b76113cb2c2e424d40e75ddab6d2d1b839d0deabd1998cbcefa8d03"
-}
diff --git a/.sqlx/query-942f94d3e0fca40e63e754acce88e8f57b6a9585154e9726e48c50385faff96c.json b/.sqlx/query-942f94d3e0fca40e63e754acce88e8f57b6a9585154e9726e48c50385faff96c.json
deleted file mode 100644
index 1f79555f27..0000000000
--- a/.sqlx/query-942f94d3e0fca40e63e754acce88e8f57b6a9585154e9726e48c50385faff96c.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"pinnedItemId\" as \"pinned_item_id\" FROM \"Pin\"\n WHERE \"userId\" = $1\n ORDER BY \"pinIndex\" ASC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pinned_item_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "942f94d3e0fca40e63e754acce88e8f57b6a9585154e9726e48c50385faff96c"
-}
diff --git a/.sqlx/query-944d28ee5d144db813a9da046b83c9f945fa0a0d04e1df1bc111eb3b31365ed4.json b/.sqlx/query-944d28ee5d144db813a9da046b83c9f945fa0a0d04e1df1bc111eb3b31365ed4.json
deleted file mode 100644
index 901dba2b11..0000000000
--- a/.sqlx/query-944d28ee5d144db813a9da046b83c9f945fa0a0d04e1df1bc111eb3b31365ed4.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT content FROM comms_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "content",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "944d28ee5d144db813a9da046b83c9f945fa0a0d04e1df1bc111eb3b31365ed4"
-}
diff --git a/.sqlx/query-9462aac02fc975ddd9ea12fb293fc81ab09cb02e38e2aa66cd3fe7774d02b717.json b/.sqlx/query-9462aac02fc975ddd9ea12fb293fc81ab09cb02e38e2aa66cd3fe7774d02b717.json
deleted file mode 100644
index 110ca61ed5..0000000000
--- a/.sqlx/query-9462aac02fc975ddd9ea12fb293fc81ab09cb02e38e2aa66cd3fe7774d02b717.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM call_invitees WHERE call_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "9462aac02fc975ddd9ea12fb293fc81ab09cb02e38e2aa66cd3fe7774d02b717"
-}
diff --git a/.sqlx/query-956decc6a22d7b954a65cdcc70755ac93003e13ba7a74a98c759275a8a28bf5e.json b/.sqlx/query-956decc6a22d7b954a65cdcc70755ac93003e13ba7a74a98c759275a8a28bf5e.json
deleted file mode 100644
index 80a55364d4..0000000000
--- a/.sqlx/query-956decc6a22d7b954a65cdcc70755ac93003e13ba7a74a98c759275a8a28bf5e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) SELECT $1, '[email protected]', id FROM macro_user WHERE email = '[email protected]'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "956decc6a22d7b954a65cdcc70755ac93003e13ba7a74a98c759275a8a28bf5e"
-}
diff --git a/.sqlx/query-9574a7ee952e0613ad8f149f15e3e14079fb5516c751cd65e10358ea0ce84369.json b/.sqlx/query-9574a7ee952e0613ad8f149f15e3e14079fb5516c751cd65e10358ea0ce84369.json
deleted file mode 100644
index a0ccf9b8b5..0000000000
--- a/.sqlx/query-9574a7ee952e0613ad8f149f15e3e14079fb5516c751cd65e10358ea0ce84369.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT access_level AS \"access_level: AccessLevel\" FROM entity_access WHERE entity_id = $1 AND source_type = 'user' AND source_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level: AccessLevel",
- "type_info": {
- "Custom": {
- "name": "\"AccessLevel\"",
- "kind": {
- "Enum": [
- "view",
- "comment",
- "edit",
- "owner"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "9574a7ee952e0613ad8f149f15e3e14079fb5516c751cd65e10358ea0ce84369"
-}
diff --git a/.sqlx/query-95ef8545a4ad4b4e503d3d3f61aab9d101cda916613ae041941e3adacdaf8940.json b/.sqlx/query-95ef8545a4ad4b4e503d3d3f61aab9d101cda916613ae041941e3adacdaf8940.json
deleted file mode 100644
index b463a53326..0000000000
--- a/.sqlx/query-95ef8545a4ad4b4e503d3d3f61aab9d101cda916613ae041941e3adacdaf8940.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id, is_signal FROM email_threads",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "is_signal",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "95ef8545a4ad4b4e503d3d3f61aab9d101cda916613ae041941e3adacdaf8940"
-}
diff --git a/.sqlx/query-9675e7e8a3682d7f8d324fad5420a939f33331a4d7abbea4a71afd91402e2172.json b/.sqlx/query-9675e7e8a3682d7f8d324fad5420a939f33331a4d7abbea4a71afd91402e2172.json
deleted file mode 100644
index 009ab4ca0b..0000000000
--- a/.sqlx/query-9675e7e8a3682d7f8d324fad5420a939f33331a4d7abbea4a71afd91402e2172.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT last_failure_at FROM webhook WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "last_failure_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "9675e7e8a3682d7f8d324fad5420a939f33331a4d7abbea4a71afd91402e2172"
-}
diff --git a/.sqlx/query-969742dfee2f5e99ff77b9a03dbd832d9c3bd4bcaee0409e52da5268f8bbe5dc.json b/.sqlx/query-969742dfee2f5e99ff77b9a03dbd832d9c3bd4bcaee0409e52da5268f8bbe5dc.json
deleted file mode 100644
index c9702cd910..0000000000
--- a/.sqlx/query-969742dfee2f5e99ff77b9a03dbd832d9c3bd4bcaee0409e52da5268f8bbe5dc.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT database_id FROM database_tables WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "database_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "969742dfee2f5e99ff77b9a03dbd832d9c3bd4bcaee0409e52da5268f8bbe5dc"
-}
diff --git a/.sqlx/query-96c0dbb948e601ccd5e4a17f9e1580437dd7614619329cb494b5e88584eb1b72.json b/.sqlx/query-96c0dbb948e601ccd5e4a17f9e1580437dd7614619329cb494b5e88584eb1b72.json
deleted file mode 100644
index 023704438f..0000000000
--- a/.sqlx/query-96c0dbb948e601ccd5e4a17f9e1580437dd7614619329cb494b5e88584eb1b72.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT updated_by FROM database_rows WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "updated_by",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "96c0dbb948e601ccd5e4a17f9e1580437dd7614619329cb494b5e88584eb1b72"
-}
diff --git a/.sqlx/query-97faa0a85a5dff3830e9be6c9ac139c88da8ec033327158d502b71ea2823824a.json b/.sqlx/query-97faa0a85a5dff3830e9be6c9ac139c88da8ec033327158d502b71ea2823824a.json
deleted file mode 100644
index 7f6d66a1c9..0000000000
--- a/.sqlx/query-97faa0a85a5dff3830e9be6c9ac139c88da8ec033327158d502b71ea2823824a.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET created_at = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "97faa0a85a5dff3830e9be6c9ac139c88da8ec033327158d502b71ea2823824a"
-}
diff --git a/.sqlx/query-9857d2a09f3577b409c4c0fe0fa199537905f6ea62f1477efb1f1e7ee8c301c7.json b/.sqlx/query-9857d2a09f3577b409c4c0fe0fa199537905f6ea62f1477efb1f1e7ee8c301c7.json
new file mode 100644
index 0000000000..26712954e1
--- /dev/null
+++ b/.sqlx/query-9857d2a09f3577b409c4c0fe0fa199537905f6ea62f1477efb1f1e7ee8c301c7.json
@@ -0,0 +1,14 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n UPDATE ai_credit_reload\n SET status = 'pending', updated_at = NOW()\n WHERE id = $1\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "9857d2a09f3577b409c4c0fe0fa199537905f6ea62f1477efb1f1e7ee8c301c7"
+}
diff --git a/.sqlx/query-989648dfb9d67182dd4fc0f649bbbe2d7c521be6aa21b011f5efff2cc77e3f38.json b/.sqlx/query-989648dfb9d67182dd4fc0f649bbbe2d7c521be6aa21b011f5efff2cc77e3f38.json
deleted file mode 100644
index a126cb201b..0000000000
--- a/.sqlx/query-989648dfb9d67182dd4fc0f649bbbe2d7c521be6aa21b011f5efff2cc77e3f38.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"PdfHighlightAnchor\"\n (uuid, \"documentId\", owner, page, red, green, blue, alpha, type, text, \"pageViewportWidth\", \"pageViewportHeight\")\n VALUES ($1, 'message-doc-a', $2, 1, 255, 255, 0, 0.5, 1, $3, 600, 800)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "989648dfb9d67182dd4fc0f649bbbe2d7c521be6aa21b011f5efff2cc77e3f38"
-}
diff --git a/.sqlx/query-98c8bee947ac1133f6301e2f7aeb41e1465842b591438ed83a85c9fd5bfee0c8.json b/.sqlx/query-98c8bee947ac1133f6301e2f7aeb41e1465842b591438ed83a85c9fd5bfee0c8.json
deleted file mode 100644
index bbd9e2c72e..0000000000
--- a/.sqlx/query-98c8bee947ac1133f6301e2f7aeb41e1465842b591438ed83a85c9fd5bfee0c8.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE \"SharePermission\"\n SET \"linkShare\" = 'TEAM', \"linkShareAccessLevel\" = 'comment'\n WHERE id = 'sp-public-edit'\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "98c8bee947ac1133f6301e2f7aeb41e1465842b591438ed83a85c9fd5bfee0c8"
-}
diff --git a/.sqlx/query-98dccab5beb0b73399e455341f71f7555bff0b06c63ae7e0e77fbc177d56636d.json b/.sqlx/query-98dccab5beb0b73399e455341f71f7555bff0b06c63ae7e0e77fbc177d56636d.json
deleted file mode 100644
index 63a3ffc25b..0000000000
--- a/.sqlx/query-98dccab5beb0b73399e455341f71f7555bff0b06c63ae7e0e77fbc177d56636d.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n d.status,\n d.delivered_at,\n a.status AS attempt_status,\n a.completed_at,\n a.duration_ms,\n a.response_status,\n a.response_headers_redacted,\n a.response_body_preview,\n a.error_kind,\n a.error_message,\n w.last_success_at,\n w.last_failure_at\n FROM webhook_delivery d\n JOIN webhook_delivery_attempt a ON a.webhook_delivery_id = d.id\n JOIN webhook w ON w.id = d.webhook_id\n WHERE d.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "delivered_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "attempt_status",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "completed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 4,
- "name": "duration_ms",
- "type_info": "Int4"
- },
- {
- "ordinal": 5,
- "name": "response_status",
- "type_info": "Int4"
- },
- {
- "ordinal": 6,
- "name": "response_headers_redacted",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 7,
- "name": "response_body_preview",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "error_kind",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "error_message",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "last_success_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 11,
- "name": "last_failure_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true,
- false,
- true,
- true,
- true,
- true,
- true,
- true,
- true,
- true,
- true
- ]
- },
- "hash": "98dccab5beb0b73399e455341f71f7555bff0b06c63ae7e0e77fbc177d56636d"
-}
diff --git a/.sqlx/query-98e9071cd2057f95b954cd0651f219789b90bf920fa7c38da5fc0a6c12edd58d.json b/.sqlx/query-98e9071cd2057f95b954cd0651f219789b90bf920fa7c38da5fc0a6c12edd58d.json
deleted file mode 100644
index 8f87370cbd..0000000000
--- a/.sqlx/query-98e9071cd2057f95b954cd0651f219789b90bf920fa7c38da5fc0a6c12edd58d.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT registered_bytes FROM slack_import_job WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "registered_bytes",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "98e9071cd2057f95b954cd0651f219789b90bf920fa7c38da5fc0a6c12edd58d"
-}
diff --git a/.sqlx/query-99b2dd7ad2eea5488c441faee7021a0839d34a7d2cbe5d47d7f60a8538432d28.json b/.sqlx/query-99b2dd7ad2eea5488c441faee7021a0839d34a7d2cbe5d47d7f60a8538432d28.json
deleted file mode 100644
index 1f6a0d3f2d..0000000000
--- a/.sqlx/query-99b2dd7ad2eea5488c441faee7021a0839d34a7d2cbe5d47d7f60a8538432d28.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO document_sub_type (document_id, sub_type) VALUES ($1, 'task')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "99b2dd7ad2eea5488c441faee7021a0839d34a7d2cbe5d47d7f60a8538432d28"
-}
diff --git a/.sqlx/query-99c1afe678447276f96470657a80b018d73395ce772073ccac806029fcd5079b.json b/.sqlx/query-99c1afe678447276f96470657a80b018d73395ce772073ccac806029fcd5079b.json
deleted file mode 100644
index a1c5922448..0000000000
--- a/.sqlx/query-99c1afe678447276f96470657a80b018d73395ce772073ccac806029fcd5079b.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n request_url,\n request_headers_redacted,\n request_body,\n event,\n event_schema_version,\n event_entity_type,\n event_entity_id,\n event_ordering_key\n FROM webhook_delivery\n WHERE webhook_id = $1 AND event_id = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "request_headers_redacted",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 2,
- "name": "request_body",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 3,
- "name": "event",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "event_schema_version",
- "type_info": "Int4"
- },
- {
- "ordinal": 5,
- "name": "event_entity_type",
- "type_info": "Text"
- },
- {
- "ordinal": 6,
- "name": "event_entity_id",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "event_ordering_key",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "99c1afe678447276f96470657a80b018d73395ce772073ccac806029fcd5079b"
-}
diff --git a/.sqlx/query-9a14ff2c21c4f16bfa2e06ac2decf57426e53bc0f44ff99c47e253a1d6919eec.json b/.sqlx/query-9a14ff2c21c4f16bfa2e06ac2decf57426e53bc0f44ff99c47e253a1d6919eec.json
deleted file mode 100644
index ac88b2d45d..0000000000
--- a/.sqlx/query-9a14ff2c21c4f16bfa2e06ac2decf57426e53bc0f44ff99c47e253a1d6919eec.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n id, name, owner_id, thread_id, originating_message_id, bot_id,\n model, harness, repo_url, repo_branch, pull_request_url, workspace, sandbox_size, instructions,\n mcp_scope, mcp_servers, acp_session_id, status,\n status_event_name, agent_session.created_at, modified_at,\n (SELECT jsonb_build_object('type', parent_entity_type, 'id', parent_entity_id)\n FROM comms_messages WHERE id = agent_session.thread_id)\n AS \"thread_parent?: Json<MessageParent>\",\n ext.provider AS \"external_provider?\", ext.external_id AS \"external_id?\",\n ext.external_name AS \"external_name?\", ext.external_url AS \"external_url?\",\n ext.last_run_id AS \"external_last_run_id?\"\n FROM agent_session\n LEFT JOIN external_agent_session AS ext ON ext.agent_session_id = agent_session.id\n WHERE thread_id = $1 AND bot_id = $2\n ORDER BY agent_session.created_at DESC\n LIMIT 1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "thread_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "originating_message_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "bot_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 6,
- "name": "model",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "harness",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "repo_url",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "repo_branch",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "pull_request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 11,
- "name": "workspace",
- "type_info": "Text"
- },
- {
- "ordinal": 12,
- "name": "sandbox_size",
- "type_info": "Text"
- },
- {
- "ordinal": 13,
- "name": "instructions",
- "type_info": "Text"
- },
- {
- "ordinal": 14,
- "name": "mcp_scope",
- "type_info": "Text"
- },
- {
- "ordinal": 15,
- "name": "mcp_servers",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 16,
- "name": "acp_session_id",
- "type_info": "Text"
- },
- {
- "ordinal": 17,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 18,
- "name": "status_event_name",
- "type_info": "Text"
- },
- {
- "ordinal": 19,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 20,
- "name": "modified_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 21,
- "name": "thread_parent?: Json<MessageParent>",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 22,
- "name": "external_provider?",
- "type_info": "Text"
- },
- {
- "ordinal": 23,
- "name": "external_id?",
- "type_info": "Text"
- },
- {
- "ordinal": 24,
- "name": "external_name?",
- "type_info": "Text"
- },
- {
- "ordinal": 25,
- "name": "external_url?",
- "type_info": "Text"
- },
- {
- "ordinal": 26,
- "name": "external_last_run_id?",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- true,
- false,
- true,
- false,
- false,
- null,
- false,
- false,
- true,
- true,
- true
- ]
- },
- "hash": "9a14ff2c21c4f16bfa2e06ac2decf57426e53bc0f44ff99c47e253a1d6919eec"
-}
diff --git a/.sqlx/query-9a8884281232e860f1af27ce98cd5e3678c61bcbcc5e6df7640c80982719cd9b.json b/.sqlx/query-9a8884281232e860f1af27ce98cd5e3678c61bcbcc5e6df7640c80982719cd9b.json
deleted file mode 100644
index 224124fad9..0000000000
--- a/.sqlx/query-9a8884281232e860f1af27ce98cd5e3678c61bcbcc5e6df7640c80982719cd9b.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_job SET staging_expires_at = clock_timestamp() + interval '12 hours' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9a8884281232e860f1af27ce98cd5e3678c61bcbcc5e6df7640c80982719cd9b"
-}
diff --git a/.sqlx/query-9aa41ed19b65f711651fc74586ca2660fa9dacd52f3bceb44a7fcd16a61a8b7b.json b/.sqlx/query-9aa41ed19b65f711651fc74586ca2660fa9dacd52f3bceb44a7fcd16a61a8b7b.json
deleted file mode 100644
index 77776f3bf8..0000000000
--- a/.sqlx/query-9aa41ed19b65f711651fc74586ca2660fa9dacd52f3bceb44a7fcd16a61a8b7b.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO harness_tokens (id, harness_id, token_hash, token_prefix)\n VALUES ($1, $2, $3, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Bytea",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "9aa41ed19b65f711651fc74586ca2660fa9dacd52f3bceb44a7fcd16a61a8b7b"
-}
diff --git a/.sqlx/query-9adbcd4e580d7125e78d05c6ccafd3cd3510542c513207b573ac44e7a4af1e74.json b/.sqlx/query-9adbcd4e580d7125e78d05c6ccafd3cd3510542c513207b573ac44e7a4af1e74.json
deleted file mode 100644
index 89d0f70ab4..0000000000
--- a/.sqlx/query-9adbcd4e580d7125e78d05c6ccafd3cd3510542c513207b573ac44e7a4af1e74.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT role::text AS \"role!\", left_at FROM comms_channel_participants WHERE channel_id = $1 AND user_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "role!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "left_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- null,
- true
- ]
- },
- "hash": "9adbcd4e580d7125e78d05c6ccafd3cd3510542c513207b573ac44e7a4af1e74"
-}
diff --git a/.sqlx/query-9adc8edbe71364b37068c05e4a4f5f955f31fedb9d900dbcef143e270e375757.json b/.sqlx/query-9adc8edbe71364b37068c05e4a4f5f955f31fedb9d900dbcef143e270e375757.json
deleted file mode 100644
index b3b94bf403..0000000000
--- a/.sqlx/query-9adc8edbe71364b37068c05e4a4f5f955f31fedb9d900dbcef143e270e375757.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT content FROM comms_messages",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "content",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "9adc8edbe71364b37068c05e4a4f5f955f31fedb9d900dbcef143e270e375757"
-}
diff --git a/.sqlx/query-9b8c52bba7cb857f99dcd345a787713bc221e0f2dbdded93f1146294431db3dd.json b/.sqlx/query-9b8c52bba7cb857f99dcd345a787713bc221e0f2dbdded93f1146294431db3dd.json
deleted file mode 100644
index 7a1e33e871..0000000000
--- a/.sqlx/query-9b8c52bba7cb857f99dcd345a787713bc221e0f2dbdded93f1146294431db3dd.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'Ledger test', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "9b8c52bba7cb857f99dcd345a787713bc221e0f2dbdded93f1146294431db3dd"
-}
diff --git a/.sqlx/query-9ba814ffded0974c86808d9512d7ad789e20afd71ee38125b1555aba651bbdda.json b/.sqlx/query-9ba814ffded0974c86808d9512d7ad789e20afd71ee38125b1555aba651bbdda.json
deleted file mode 100644
index 804add3ba5..0000000000
--- a/.sqlx/query-9ba814ffded0974c86808d9512d7ad789e20afd71ee38125b1555aba651bbdda.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team_user (team_id, user_id, team_role) VALUES ($1, 'macro|[email protected]', 'owner')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9ba814ffded0974c86808d9512d7ad789e20afd71ee38125b1555aba651bbdda"
-}
diff --git a/.sqlx/query-9c0b58996b37b423dc4113ad3b1d301ef694a1e1a07a8d67f14b8ecb4dfc7812.json b/.sqlx/query-9c0b58996b37b423dc4113ad3b1d301ef694a1e1a07a8d67f14b8ecb4dfc7812.json
deleted file mode 100644
index c67ead58d2..0000000000
--- a/.sqlx/query-9c0b58996b37b423dc4113ad3b1d301ef694a1e1a07a8d67f14b8ecb4dfc7812.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_links (id, macro_id, fusionauth_user_id, email_address, provider) VALUES ($1, $2, 'followup', '[email protected]', 'GMAIL')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "9c0b58996b37b423dc4113ad3b1d301ef694a1e1a07a8d67f14b8ecb4dfc7812"
-}
diff --git a/.sqlx/query-9ca1e0bb096d08f20783cde4a26d3b4d4ffc2f43e573f0898b76f4acf167a423.json b/.sqlx/query-9ca1e0bb096d08f20783cde4a26d3b4d4ffc2f43e573f0898b76f4acf167a423.json
deleted file mode 100644
index e40adbdf8b..0000000000
--- a/.sqlx/query-9ca1e0bb096d08f20783cde4a26d3b4d4ffc2f43e573f0898b76f4acf167a423.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT source_type::text AS \"source_type!\", source_id, access_level::text AS \"access_level!\"\n FROM entity_access\n WHERE entity_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- false,
- null
- ]
- },
- "hash": "9ca1e0bb096d08f20783cde4a26d3b4d4ffc2f43e573f0898b76f4acf167a423"
-}
diff --git a/.sqlx/query-9df48cd2e7a8a1dc6bcdb70d98a11553f9f733045b7d08cd0aeee43038a555b6.json b/.sqlx/query-9df48cd2e7a8a1dc6bcdb70d98a11553f9f733045b7d08cd0aeee43038a555b6.json
deleted file mode 100644
index 4d003a2c7c..0000000000
--- a/.sqlx/query-9df48cd2e7a8a1dc6bcdb70d98a11553f9f733045b7d08cd0aeee43038a555b6.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT c.relname AS \"table!\", co.collname AS \"collation!\"\n FROM pg_attribute a\n JOIN pg_class c ON c.oid = a.attrelid\n JOIN pg_collation co ON co.oid = a.attcollation\n WHERE a.attname = 'position'\n AND c.relname IN ('database_tables', 'database_columns', 'database_rows',\n 'database_views', 'database_view_positions')\n ORDER BY c.relname",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "table!",
- "type_info": "Name"
- },
- {
- "ordinal": 1,
- "name": "collation!",
- "type_info": "Name"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "9df48cd2e7a8a1dc6bcdb70d98a11553f9f733045b7d08cd0aeee43038a555b6"
-}
diff --git a/.sqlx/query-9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e.json b/.sqlx/query-9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e.json
deleted file mode 100644
index 4aff03b59d..0000000000
--- a/.sqlx/query-9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n l.macro_id,\n l.email_address::text AS \"email_address!\",\n COALESCE(g.granted_scopes, '{}') AS \"granted_scopes!\",\n COALESCE(g.grant_version, 0) AS \"grant_version!\",\n g.calendar_disabled_at\n FROM email_links l\n LEFT JOIN email_link_google_scopes g ON g.link_id = l.id\n WHERE l.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "macro_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "email_address!",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "granted_scopes!",
- "type_info": "TextArray"
- },
- {
- "ordinal": 3,
- "name": "grant_version!",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "calendar_disabled_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- null,
- null,
- null,
- true
- ]
- },
- "hash": "9e3e9a5ba74600ee544a3a930bf54da41abaed6e7d7695e7fac88b65c4a3361e"
-}
diff --git a/.sqlx/query-9e453315ff2ed288ca3b380e57c799da6c091ca5f836299f18266ca557030dba.json b/.sqlx/query-9e453315ff2ed288ca3b380e57c799da6c091ca5f836299f18266ca557030dba.json
deleted file mode 100644
index a867874256..0000000000
--- a/.sqlx/query-9e453315ff2ed288ca3b380e57c799da6c091ca5f836299f18266ca557030dba.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT draft, assignees, labels, requested_reviewer_github_user_ids, review_decision FROM github_pull_request WHERE github_key = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "draft",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "assignees",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 2,
- "name": "labels",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 3,
- "name": "requested_reviewer_github_user_ids",
- "type_info": "TextArray"
- },
- {
- "ordinal": 4,
- "name": "review_decision",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- true
- ]
- },
- "hash": "9e453315ff2ed288ca3b380e57c799da6c091ca5f836299f18266ca557030dba"
-}
diff --git a/.sqlx/query-9e57932e08ad1cab486adb0d9d1a6c4b587e278b4a1854830b7aab942a5ddee0.json b/.sqlx/query-9e57932e08ad1cab486adb0d9d1a6c4b587e278b4a1854830b7aab942a5ddee0.json
deleted file mode 100644
index ee963669c3..0000000000
--- a/.sqlx/query-9e57932e08ad1cab486adb0d9d1a6c4b587e278b4a1854830b7aab942a5ddee0.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_columns (id, table_id, property_definition_id, position) VALUES ($1, $2, $3, 'a')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "9e57932e08ad1cab486adb0d9d1a6c4b587e278b4a1854830b7aab942a5ddee0"
-}
diff --git a/.sqlx/query-9e630408ab64e086f3d05ce57b9e612cc71856aa421640675dedb7fae95c2c09.json b/.sqlx/query-9e630408ab64e086f3d05ce57b9e612cc71856aa421640675dedb7fae95c2c09.json
deleted file mode 100644
index ef38737f9e..0000000000
--- a/.sqlx/query-9e630408ab64e086f3d05ce57b9e612cc71856aa421640675dedb7fae95c2c09.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT finalization AS \"finalization: Json<StateData>\" FROM ai_usage_observation WHERE invocation_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "finalization: Json<StateData>",
- "type_info": "Jsonb"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "9e630408ab64e086f3d05ce57b9e612cc71856aa421640675dedb7fae95c2c09"
-}
diff --git a/.sqlx/query-9f2a13d4dd04581b65566aa5eb00679fac726265af9ad7aadc4d0f5b7e14fd0e.json b/.sqlx/query-9f2a13d4dd04581b65566aa5eb00679fac726265af9ad7aadc4d0f5b7e14fd0e.json
deleted file mode 100644
index 000ae34291..0000000000
--- a/.sqlx/query-9f2a13d4dd04581b65566aa5eb00679fac726265af9ad7aadc4d0f5b7e14fd0e.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT source_type::text AS \"source_type!\", source_id,\n access_level::text AS \"access_level!\"\n FROM entity_access\n WHERE entity_id = $1 AND granted_from_project_id IS NULL\n ORDER BY source_type::text, source_id\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- false,
- null
- ]
- },
- "hash": "9f2a13d4dd04581b65566aa5eb00679fac726265af9ad7aadc4d0f5b7e14fd0e"
-}
diff --git a/.sqlx/query-9f8552d3da8d8d1d705cb28d51c52fa2150ba95cab2a6e96880dd7ff97a5828b.json b/.sqlx/query-9f8552d3da8d8d1d705cb28d51c52fa2150ba95cab2a6e96880dd7ff97a5828b.json
new file mode 100644
index 0000000000..92b0fc013f
--- /dev/null
+++ b/.sqlx/query-9f8552d3da8d8d1d705cb28d51c52fa2150ba95cab2a6e96880dd7ff97a5828b.json
@@ -0,0 +1,76 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT overage_enabled, overage_limit_cents, overage_suspended_at,\n auto_reload_minimum_cents, auto_reload_target_cents,\n auto_reload_monthly_limit_cents, auto_reload_suspended_at,\n period_start, period_end, seat_generation\n FROM ai_billing_account\n WHERE user_id = $1\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "overage_enabled",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 1,
+ "name": "overage_limit_cents",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 2,
+ "name": "overage_suspended_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 3,
+ "name": "auto_reload_minimum_cents",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 4,
+ "name": "auto_reload_target_cents",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 5,
+ "name": "auto_reload_monthly_limit_cents",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 6,
+ "name": "auto_reload_suspended_at",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 7,
+ "name": "period_start",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 8,
+ "name": "period_end",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 9,
+ "name": "seat_generation",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ true,
+ false,
+ false,
+ true,
+ true,
+ true,
+ true,
+ false
+ ]
+ },
+ "hash": "9f8552d3da8d8d1d705cb28d51c52fa2150ba95cab2a6e96880dd7ff97a5828b"
+}
diff --git a/.sqlx/query-a02284dd792ffd9ab316f10c5db6be68daf45af8e8348da0ed2dbbcbf9a1d902.json b/.sqlx/query-a02284dd792ffd9ab316f10c5db6be68daf45af8e8348da0ed2dbbcbf9a1d902.json
deleted file mode 100644
index 92aae96c4f..0000000000
--- a/.sqlx/query-a02284dd792ffd9ab316f10c5db6be68daf45af8e8348da0ed2dbbcbf9a1d902.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) as \"count!\" FROM entity_properties WHERE property_definition_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "a02284dd792ffd9ab316f10c5db6be68daf45af8e8348da0ed2dbbcbf9a1d902"
-}
diff --git a/.sqlx/query-a030b082421b4ac6e9763695155814b5ba2f530881f26f48320585be945fcf01.json b/.sqlx/query-a030b082421b4ac6e9763695155814b5ba2f530881f26f48320585be945fcf01.json
deleted file mode 100644
index 0462661fad..0000000000
--- a/.sqlx/query-a030b082421b4ac6e9763695155814b5ba2f530881f26f48320585be945fcf01.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT working_branch, pull_request_url, modified_at FROM agent_session WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "working_branch",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "pull_request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "modified_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true,
- false
- ]
- },
- "hash": "a030b082421b4ac6e9763695155814b5ba2f530881f26f48320585be945fcf01"
-}
diff --git a/.sqlx/query-a07f0622de5a2491d3561e87eff3e856f48779041f64fee910a5dade485c25a8.json b/.sqlx/query-a07f0622de5a2491d3561e87eff3e856f48779041f64fee910a5dade485c25a8.json
deleted file mode 100644
index a70ed472ac..0000000000
--- a/.sqlx/query-a07f0622de5a2491d3561e87eff3e856f48779041f64fee910a5dade485c25a8.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_entity_mentions (id, source_entity_type, source_entity_id, entity_type, entity_id, user_id) VALUES (gen_random_uuid(), 'doc', 'doc_source_mixed', 'doc', 'doc1', NULL)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "a07f0622de5a2491d3561e87eff3e856f48779041f64fee910a5dade485c25a8"
-}
diff --git a/.sqlx/query-a0c3aed794f2bb8b37562e850f0b8136632c335a0134b85b8ca9b9992db5916c.json b/.sqlx/query-a0c3aed794f2bb8b37562e850f0b8136632c335a0134b85b8ca9b9992db5916c.json
deleted file mode 100644
index 08d579f776..0000000000
--- a/.sqlx/query-a0c3aed794f2bb8b37562e850f0b8136632c335a0134b85b8ca9b9992db5916c.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM scheduling_public_budget WHERE profile_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "a0c3aed794f2bb8b37562e850f0b8136632c335a0134b85b8ca9b9992db5916c"
-}
diff --git a/.sqlx/query-a19b4fe99206d243a850ab886248b487961a5d91bdcb8ae08211ebe3fcf4275f.json b/.sqlx/query-a19b4fe99206d243a850ab886248b487961a5d91bdcb8ae08211ebe3fcf4275f.json
deleted file mode 100644
index bf748c2cb8..0000000000
--- a/.sqlx/query-a19b4fe99206d243a850ab886248b487961a5d91bdcb8ae08211ebe3fcf4275f.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"projectId\" as project_id FROM \"Document\" WHERE \"id\" = 'document-one'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "project_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- true
- ]
- },
- "hash": "a19b4fe99206d243a850ab886248b487961a5d91bdcb8ae08211ebe3fcf4275f"
-}
diff --git a/.sqlx/query-a19c6fa759c82bc703f2136aa7ff725cba816d9e1cb45512f98c914e907c0905.json b/.sqlx/query-a19c6fa759c82bc703f2136aa7ff725cba816d9e1cb45512f98c914e907c0905.json
deleted file mode 100644
index 095b91f204..0000000000
--- a/.sqlx/query-a19c6fa759c82bc703f2136aa7ff725cba816d9e1cb45512f98c914e907c0905.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT property_definition_id FROM property_options WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "property_definition_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "a19c6fa759c82bc703f2136aa7ff725cba816d9e1cb45512f98c914e907c0905"
-}
diff --git a/.sqlx/query-a1bf781fdf9e640eb93e9565e2eba9632610d0a9b4a1e70a022db9c05c4cdf72.json b/.sqlx/query-a1bf781fdf9e640eb93e9565e2eba9632610d0a9b4a1e70a022db9c05c4cdf72.json
deleted file mode 100644
index 25d35ec37a..0000000000
--- a/.sqlx/query-a1bf781fdf9e640eb93e9565e2eba9632610d0a9b4a1e70a022db9c05c4cdf72.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ('macro|[email protected]', '[email protected]', 'd1000000-0000-0000-0000-000000000002')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "a1bf781fdf9e640eb93e9565e2eba9632610d0a9b4a1e70a022db9c05c4cdf72"
-}
diff --git a/.sqlx/query-a1f487c1d017d637934627933947fb7768f94043d7c307b535144199dc71579e.json b/.sqlx/query-a1f487c1d017d637934627933947fb7768f94043d7c307b535144199dc71579e.json
deleted file mode 100644
index 23c9624cf9..0000000000
--- a/.sqlx/query-a1f487c1d017d637934627933947fb7768f94043d7c307b535144199dc71579e.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"EmailThreadPermission\" (\"threadId\", \"sharePermissionId\", \"userId\")\n VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "a1f487c1d017d637934627933947fb7768f94043d7c307b535144199dc71579e"
-}
diff --git a/.sqlx/query-a2b1be64dc00ad01197ffa76bdd8c92829439094f9dfa529b1d4fa2da6ad20cc.json b/.sqlx/query-a2b1be64dc00ad01197ffa76bdd8c92829439094f9dfa529b1d4fa2da6ad20cc.json
deleted file mode 100644
index a0f976d8fc..0000000000
--- a/.sqlx/query-a2b1be64dc00ad01197ffa76bdd8c92829439094f9dfa529b1d4fa2da6ad20cc.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n owner_type::text AS \"owner_type!\",\n owner_id,\n entity_type,\n deleted_at\n FROM entity\n WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "entity_type",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "deleted_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null,
- false,
- false,
- true
- ]
- },
- "hash": "a2b1be64dc00ad01197ffa76bdd8c92829439094f9dfa529b1d4fa2da6ad20cc"
-}
diff --git a/.sqlx/query-a2bc347716dd6fcfe2bc061b3820fb8790cc7c0c4dd1ed198ac2f5d1dc6929d4.json b/.sqlx/query-a2bc347716dd6fcfe2bc061b3820fb8790cc7c0c4dd1ed198ac2f5d1dc6929d4.json
deleted file mode 100644
index b87222d201..0000000000
--- a/.sqlx/query-a2bc347716dd6fcfe2bc061b3820fb8790cc7c0c4dd1ed198ac2f5d1dc6929d4.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT sent, processing FROM email_scheduled_messages WHERE message_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "sent",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "processing",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "a2bc347716dd6fcfe2bc061b3820fb8790cc7c0c4dd1ed198ac2f5d1dc6929d4"
-}
diff --git a/.sqlx/query-a4dbf23b71bcb8653395683a703a13007db7e68529b9f6f0bb0d3661f9728944.json b/.sqlx/query-a4dbf23b71bcb8653395683a703a13007db7e68529b9f6f0bb0d3661f9728944.json
deleted file mode 100644
index 7cd0bd8178..0000000000
--- a/.sqlx/query-a4dbf23b71bcb8653395683a703a13007db7e68529b9f6f0bb0d3661f9728944.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_entity_mentions",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "a4dbf23b71bcb8653395683a703a13007db7e68529b9f6f0bb0d3661f9728944"
-}
diff --git a/.sqlx/query-a4e1faa9186a0579d9dc4307d158019eea1904a2e412df235f603f5b80986ec3.json b/.sqlx/query-a4e1faa9186a0579d9dc4307d158019eea1904a2e412df235f603f5b80986ec3.json
deleted file mode 100644
index cf6bad164e..0000000000
--- a/.sqlx/query-a4e1faa9186a0579d9dc4307d158019eea1904a2e412df235f603f5b80986ec3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM entity WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "a4e1faa9186a0579d9dc4307d158019eea1904a2e412df235f603f5b80986ec3"
-}
diff --git a/.sqlx/query-a583fa61f96ae3bc3cbbdf24de61255130e01c857e9a27b2fcdb1c3eb2a4ac93.json b/.sqlx/query-a583fa61f96ae3bc3cbbdf24de61255130e01c857e9a27b2fcdb1c3eb2a4ac93.json
deleted file mode 100644
index 231562444c..0000000000
--- a/.sqlx/query-a583fa61f96ae3bc3cbbdf24de61255130e01c857e9a27b2fcdb1c3eb2a4ac93.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_outbox SET available_at = clock_timestamp() - interval '1 second' WHERE job_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "a583fa61f96ae3bc3cbbdf24de61255130e01c857e9a27b2fcdb1c3eb2a4ac93"
-}
diff --git a/.sqlx/query-a6c5e0b67bfc2fcab27342d238de9f6eca65da5be07e916915e7afb8b27fe713.json b/.sqlx/query-a6c5e0b67bfc2fcab27342d238de9f6eca65da5be07e916915e7afb8b27fe713.json
deleted file mode 100644
index fbd45070c6..0000000000
--- a/.sqlx/query-a6c5e0b67bfc2fcab27342d238de9f6eca65da5be07e916915e7afb8b27fe713.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, amount_cents, stripe_invoice_id, status::text AS \"status!\"\n FROM ai_overage_charge\n WHERE user_id = $1\n AND period_start = $2\n AND (\n status = 'failed'\n OR (\n status = 'pending'\n AND stripe_invoice_id IS NULL\n AND updated_at < NOW() - INTERVAL '10 minutes'\n )\n )\n ORDER BY created_at\n FOR UPDATE\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "amount_cents",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "stripe_invoice_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "status!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": [
- false,
- false,
- true,
- null
- ]
- },
- "hash": "a6c5e0b67bfc2fcab27342d238de9f6eca65da5be07e916915e7afb8b27fe713"
-}
diff --git a/.sqlx/query-a79fb60be1082cb56c5313fa53ea3de248735636835c6f0a46a1c5e7f736f332.json b/.sqlx/query-a79fb60be1082cb56c5313fa53ea3de248735636835c6f0a46a1c5e7f736f332.json
deleted file mode 100644
index 61de543969..0000000000
--- a/.sqlx/query-a79fb60be1082cb56c5313fa53ea3de248735636835c6f0a46a1c5e7f736f332.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"documentId\" FROM \"UploadJob\" WHERE \"jobId\" = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "documentId",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "a79fb60be1082cb56c5313fa53ea3de248735636835c6f0a46a1c5e7f736f332"
-}
diff --git a/.sqlx/query-a7baf370108371fedbc9eec0287181a1581a3cc2c483b49f0b7579dd7338bd22.json b/.sqlx/query-a7baf370108371fedbc9eec0287181a1581a3cc2c483b49f0b7579dd7338bd22.json
deleted file mode 100644
index 90d0e8b42c..0000000000
--- a/.sqlx/query-a7baf370108371fedbc9eec0287181a1581a3cc2c483b49f0b7579dd7338bd22.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT share_permission_id FROM call_records WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "share_permission_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "a7baf370108371fedbc9eec0287181a1581a3cc2c483b49f0b7579dd7338bd22"
-}
diff --git a/.sqlx/query-a7dfb6458b8d45a9db74a18fe006b1cc470cec88050afedd5043b96e942fccee.json b/.sqlx/query-a7dfb6458b8d45a9db74a18fe006b1cc470cec88050afedd5043b96e942fccee.json
deleted file mode 100644
index c72a28ca98..0000000000
--- a/.sqlx/query-a7dfb6458b8d45a9db74a18fe006b1cc470cec88050afedd5043b96e942fccee.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT status::text AS \"status!\" FROM email_backfill_jobs WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "a7dfb6458b8d45a9db74a18fe006b1cc470cec88050afedd5043b96e942fccee"
-}
diff --git a/.sqlx/query-a7fec80ef3e17e04b8d68f34f52955cb6573201d0a11be57ef378f03631fd70b.json b/.sqlx/query-a7fec80ef3e17e04b8d68f34f52955cb6573201d0a11be57ef378f03631fd70b.json
deleted file mode 100644
index 6bf891451f..0000000000
--- a/.sqlx/query-a7fec80ef3e17e04b8d68f34f52955cb6573201d0a11be57ef378f03631fd70b.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_attachments",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "a7fec80ef3e17e04b8d68f34f52955cb6573201d0a11be57ef378f03631fd70b"
-}
diff --git a/.sqlx/query-a857929264fb9bd01aff3e0fd4e0e9de760dda83189644be2326bc6f90f45936.json b/.sqlx/query-a857929264fb9bd01aff3e0fd4e0e9de760dda83189644be2326bc6f90f45936.json
deleted file mode 100644
index a346ab521f..0000000000
--- a/.sqlx/query-a857929264fb9bd01aff3e0fd4e0e9de760dda83189644be2326bc6f90f45936.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO migrated_comment_thread_id (thread_id, root_id, document_id) VALUES (1, $1, 'message-doc-a')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "a857929264fb9bd01aff3e0fd4e0e9de760dda83189644be2326bc6f90f45936"
-}
diff --git a/.sqlx/query-a8c25823d80a213351c1beaeeba4c1b4516b8674fbb2148aa618ad4f360709b7.json b/.sqlx/query-a8c25823d80a213351c1beaeeba4c1b4516b8674fbb2148aa618ad4f360709b7.json
deleted file mode 100644
index 8e551465d5..0000000000
--- a/.sqlx/query-a8c25823d80a213351c1beaeeba4c1b4516b8674fbb2148aa618ad4f360709b7.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES\n ('macro|[email protected]', '[email protected]', 'd1000000-0000-0000-0000-000000000001'),\n ('macro|[email protected]', '[email protected]', 'd1000000-0000-0000-0000-000000000002')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "a8c25823d80a213351c1beaeeba4c1b4516b8674fbb2148aa618ad4f360709b7"
-}
diff --git a/.sqlx/query-a9357f0a71c3e4a559d9728f39d45434842d864067ced0cc64b0017257032f6a.json b/.sqlx/query-a9357f0a71c3e4a559d9728f39d45434842d864067ced0cc64b0017257032f6a.json
deleted file mode 100644
index 9ba4c1dc61..0000000000
--- a/.sqlx/query-a9357f0a71c3e4a559d9728f39d45434842d864067ced0cc64b0017257032f6a.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO calls (id, room_name, created_by, share_permission_id) VALUES ($1, 'test-room', 'macro|[email protected]', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "a9357f0a71c3e4a559d9728f39d45434842d864067ced0cc64b0017257032f6a"
-}
diff --git a/.sqlx/query-a990c42683ac176337a16987d448fe562b420e692135be77f966c52e2a2c2495.json b/.sqlx/query-a990c42683ac176337a16987d448fe562b420e692135be77f966c52e2a2c2495.json
deleted file mode 100644
index 3e31daae59..0000000000
--- a/.sqlx/query-a990c42683ac176337a16987d448fe562b420e692135be77f966c52e2a2c2495.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level) SELECT id::uuid, 'document', $2, 'user', 'owner' FROM unnest($1::text[]) id",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "TextArray",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "a990c42683ac176337a16987d448fe562b420e692135be77f966c52e2a2c2495"
-}
diff --git a/.sqlx/query-aa9592f76b10e53415c3d06dcdc76d1277d5c0d8522b6b0a64b5b71951da2edc.json b/.sqlx/query-aa9592f76b10e53415c3d06dcdc76d1277d5c0d8522b6b0a64b5b71951da2edc.json
deleted file mode 100644
index 8757ce8259..0000000000
--- a/.sqlx/query-aa9592f76b10e53415c3d06dcdc76d1277d5c0d8522b6b0a64b5b71951da2edc.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO foreign_entity (id, foreign_entity_id, foreign_entity_source, metadata,\n stored_for_id, stored_for_auth_entity)\n SELECT id, 'macro/app/pull/7', 'github_pull_request', '{}'::jsonb, 'user', 'user'\n FROM unnest($1::uuid[]) AS id",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "aa9592f76b10e53415c3d06dcdc76d1277d5c0d8522b6b0a64b5b71951da2edc"
-}
diff --git a/.sqlx/query-acbfde5ceed9ad24f4a14c231f29cd3ee1509cf21ebd4b6201f52135ee53c91f.json b/.sqlx/query-acbfde5ceed9ad24f4a14c231f29cd3ee1509cf21ebd4b6201f52135ee53c91f.json
deleted file mode 100644
index fae72596c9..0000000000
--- a/.sqlx/query-acbfde5ceed9ad24f4a14c231f29cd3ee1509cf21ebd4b6201f52135ee53c91f.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM ai_financial_invocation",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "acbfde5ceed9ad24f4a14c231f29cd3ee1509cf21ebd4b6201f52135ee53c91f"
-}
diff --git a/.sqlx/query-ad4df630fb2c69f9114b8781a05436ea3cb67fcdd2e5eae565e8611178e744fb.json b/.sqlx/query-ad4df630fb2c69f9114b8781a05436ea3cb67fcdd2e5eae565e8611178e744fb.json
deleted file mode 100644
index 51dae586cc..0000000000
--- a/.sqlx/query-ad4df630fb2c69f9114b8781a05436ea3cb67fcdd2e5eae565e8611178e744fb.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO frecency_aggregates (\n entity_id, entity_type, user_id, event_count,\n frecency_score, first_event, recent_events\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text",
- "Int4",
- "Float8",
- "Timestamptz",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "ad4df630fb2c69f9114b8781a05436ea3cb67fcdd2e5eae565e8611178e744fb"
-}
diff --git a/.sqlx/query-ad96cfb0ad76c6895be87809f9f9b09b9f959b8ded27f73e24b005485b02e80c.json b/.sqlx/query-ad96cfb0ad76c6895be87809f9f9b09b9f959b8ded27f73e24b005485b02e80c.json
deleted file mode 100644
index 4e37b6191e..0000000000
--- a/.sqlx/query-ad96cfb0ad76c6895be87809f9f9b09b9f959b8ded27f73e24b005485b02e80c.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_messages",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "ad96cfb0ad76c6895be87809f9f9b09b9f959b8ded27f73e24b005485b02e80c"
-}
diff --git a/.sqlx/query-adc9064f28cc19e0475d574e1ceeef6398adbde7a0e8da3f0fb9c99be37f65f8.json b/.sqlx/query-adc9064f28cc19e0475d574e1ceeef6398adbde7a0e8da3f0fb9c99be37f65f8.json
deleted file mode 100644
index 22dd058087..0000000000
--- a/.sqlx/query-adc9064f28cc19e0475d574e1ceeef6398adbde7a0e8da3f0fb9c99be37f65f8.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT inbox_visible, updated_at FROM email_threads WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "inbox_visible",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "adc9064f28cc19e0475d574e1ceeef6398adbde7a0e8da3f0fb9c99be37f65f8"
-}
diff --git a/.sqlx/query-add7da0319cea71451fc509584591ba15a6973e42321c4261c186918635903a6.json b/.sqlx/query-add7da0319cea71451fc509584591ba15a6973e42321c4261c186918635903a6.json
deleted file mode 100644
index 47d84f4dee..0000000000
--- a/.sqlx/query-add7da0319cea71451fc509584591ba15a6973e42321c4261c186918635903a6.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduling_booking SET recovery_at = now() - interval '1 second' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "add7da0319cea71451fc509584591ba15a6973e42321c4261c186918635903a6"
-}
diff --git a/.sqlx/query-add9f378c7e48521866ded0797002c33631e171900c9fc99e9c70bfd5e09fb74.json b/.sqlx/query-add9f378c7e48521866ded0797002c33631e171900c9fc99e9c70bfd5e09fb74.json
deleted file mode 100644
index 5b214501bc..0000000000
--- a/.sqlx/query-add9f378c7e48521866ded0797002c33631e171900c9fc99e9c70bfd5e09fb74.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO harnesses (id, name, team_id, created_by)\n VALUES ($1, 'teams', $2, 'macro|[email protected]')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "add9f378c7e48521866ded0797002c33631e171900c9fc99e9c70bfd5e09fb74"
-}
diff --git a/.sqlx/query-adf44cbb3d760af4502a9a46e4ac7936fead71ffe6cb571dbe7ef8fccdf50d83.json b/.sqlx/query-adf44cbb3d760af4502a9a46e4ac7936fead71ffe6cb571dbe7ef8fccdf50d83.json
deleted file mode 100644
index 2641e4a598..0000000000
--- a/.sqlx/query-adf44cbb3d760af4502a9a46e4ac7936fead71ffe6cb571dbe7ef8fccdf50d83.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE ai_financial_rate SET model = 'mutated' WHERE version = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "adf44cbb3d760af4502a9a46e4ac7936fead71ffe6cb571dbe7ef8fccdf50d83"
-}
diff --git a/.sqlx/query-af468f414a9aa17d5a4048ef54b103881675c7b38ae8d2d02e82b40f1e97a5d5.json b/.sqlx/query-af468f414a9aa17d5a4048ef54b103881675c7b38ae8d2d02e82b40f1e97a5d5.json
deleted file mode 100644
index e3a4b30636..0000000000
--- a/.sqlx/query-af468f414a9aa17d5a4048ef54b103881675c7b38ae8d2d02e82b40f1e97a5d5.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE \"Document\" SET \"projectId\" = 'p1' WHERE \"id\" = 'document-one'\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "af468f414a9aa17d5a4048ef54b103881675c7b38ae8d2d02e82b40f1e97a5d5"
-}
diff --git a/.sqlx/query-afd9feb0092b20cb90d2b39847a238f82db24fc1cc95468c3d3fc8e57719e86e.json b/.sqlx/query-afd9feb0092b20cb90d2b39847a238f82db24fc1cc95468c3d3fc8e57719e86e.json
deleted file mode 100644
index dd8cdb5516..0000000000
--- a/.sqlx/query-afd9feb0092b20cb90d2b39847a238f82db24fc1cc95468c3d3fc8e57719e86e.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_threads SET reminder_returned_at = NOW() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "afd9feb0092b20cb90d2b39847a238f82db24fc1cc95468c3d3fc8e57719e86e"
-}
diff --git a/.sqlx/query-aff5c0d4800f217ac175958099a229449436692ffe9ca187e57566f000c76ea3.json b/.sqlx/query-aff5c0d4800f217ac175958099a229449436692ffe9ca187e57566f000c76ea3.json
deleted file mode 100644
index 8e9ec874f0..0000000000
--- a/.sqlx/query-aff5c0d4800f217ac175958099a229449436692ffe9ca187e57566f000c76ea3.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id FROM property_definitions WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "aff5c0d4800f217ac175958099a229449436692ffe9ca187e57566f000c76ea3"
-}
diff --git a/.sqlx/query-b0d50f06983bc88d5ca6e118f0e08183aa05b11cb4165977e7a68d39721a049e.json b/.sqlx/query-b0d50f06983bc88d5ca6e118f0e08183aa05b11cb4165977e7a68d39721a049e.json
deleted file mode 100644
index a962353884..0000000000
--- a/.sqlx/query-b0d50f06983bc88d5ca6e118f0e08183aa05b11cb4165977e7a68d39721a049e.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE \"Document\" SET \"deletedAt\" = now() WHERE id = 'message-doc-a'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "b0d50f06983bc88d5ca6e118f0e08183aa05b11cb4165977e7a68d39721a049e"
-}
diff --git a/.sqlx/query-b0f2f6bf6e78863cb38625f1f26303d3f195a82c23c3660fba2fb5706a6b98ab.json b/.sqlx/query-b0f2f6bf6e78863cb38625f1f26303d3f195a82c23c3660fba2fb5706a6b98ab.json
deleted file mode 100644
index 2c868d98aa..0000000000
--- a/.sqlx/query-b0f2f6bf6e78863cb38625f1f26303d3f195a82c23c3660fba2fb5706a6b98ab.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_threads SET updated_at = '2000-01-01T00:00:00Z' WHERE id = $1 RETURNING updated_at",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "b0f2f6bf6e78863cb38625f1f26303d3f195a82c23c3660fba2fb5706a6b98ab"
-}
diff --git a/.sqlx/query-b16931ecba057b16bf4028b613bf9f85761fe643ceb64b3185db814f1ea1a5d7.json b/.sqlx/query-b16931ecba057b16bf4028b613bf9f85761fe643ceb64b3185db814f1ea1a5d7.json
deleted file mode 100644
index ac476c9a0b..0000000000
--- a/.sqlx/query-b16931ecba057b16bf4028b613bf9f85761fe643ceb64b3185db814f1ea1a5d7.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT history_start_log_id FROM agent_session WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "history_start_log_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "b16931ecba057b16bf4028b613bf9f85761fe643ceb64b3185db814f1ea1a5d7"
-}
diff --git a/.sqlx/query-b1ac4ab49729df68d741d817512bb66ad26d937554466326bb17dbf661a4fa1f.json b/.sqlx/query-b1ac4ab49729df68d741d817512bb66ad26d937554466326bb17dbf661a4fa1f.json
deleted file mode 100644
index 8ac0422148..0000000000
--- a/.sqlx/query-b1ac4ab49729df68d741d817512bb66ad26d937554466326bb17dbf661a4fa1f.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_session_log (id, agent_session_id, user_id, direction, content, created_at)\n SELECT frame.id, $1, frame.user_id, frame.direction, frame.content,\n now() + (frame.ordinality - 1) * interval '1 microsecond'\n FROM UNNEST($2::uuid[], $3::text[], $4::text[], $5::jsonb[])\n WITH ORDINALITY AS frame(id, user_id, direction, content, ordinality)\n RETURNING id, created_at\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "created_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "UuidArray",
- "TextArray",
- "TextArray",
- "JsonbArray"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "b1ac4ab49729df68d741d817512bb66ad26d937554466326bb17dbf661a4fa1f"
-}
diff --git a/.sqlx/query-b1d4072235ad4bed4f94f52cf60155cb3a0f95d40f2d710c6118101a3f56b224.json b/.sqlx/query-b1d4072235ad4bed4f94f52cf60155cb3a0f95d40f2d710c6118101a3f56b224.json
new file mode 100644
index 0000000000..7e363e47a1
--- /dev/null
+++ b/.sqlx/query-b1d4072235ad4bed4f94f52cf60155cb3a0f95d40f2d710c6118101a3f56b224.json
@@ -0,0 +1,46 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT id, amount_cents, stripe_invoice_id, status::text AS \"status!\",\n (status = 'pending'\n AND stripe_invoice_id IS NULL\n AND updated_at < NOW() - INTERVAL '10 minutes') AS \"orphaned!\"\n FROM ai_credit_reload\n WHERE user_id = $1\n AND (status = 'pending'\n OR (status = 'failed' AND stripe_invoice_id IS NOT NULL))\n ORDER BY created_at\n FOR UPDATE\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "amount_cents",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 2,
+ "name": "stripe_invoice_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "status!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "orphaned!",
+ "type_info": "Bool"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ true,
+ null,
+ null
+ ]
+ },
+ "hash": "b1d4072235ad4bed4f94f52cf60155cb3a0f95d40f2d710c6118101a3f56b224"
+}
diff --git a/.sqlx/query-b1e9a9983331e291b2e8053fdd35d23ac43712b3ffe0b13dc1c6f4d6d1b6d6ae.json b/.sqlx/query-b1e9a9983331e291b2e8053fdd35d23ac43712b3ffe0b13dc1c6f4d6d1b6d6ae.json
deleted file mode 100644
index 6d4fe36092..0000000000
--- a/.sqlx/query-b1e9a9983331e291b2e8053fdd35d23ac43712b3ffe0b13dc1c6f4d6d1b6d6ae.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, $2, $2, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "b1e9a9983331e291b2e8053fdd35d23ac43712b3ffe0b13dc1c6f4d6d1b6d6ae"
-}
diff --git a/.sqlx/query-b24bf8d106dff1f1d07180fed6ccb9c89f9c86f8b9e7e3520667bc0801035c4f.json b/.sqlx/query-b24bf8d106dff1f1d07180fed6ccb9c89f9c86f8b9e7e3520667bc0801035c4f.json
deleted file mode 100644
index 2d4b41ad51..0000000000
--- a/.sqlx/query-b24bf8d106dff1f1d07180fed6ccb9c89f9c86f8b9e7e3520667bc0801035c4f.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT subject FROM email_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "subject",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "b24bf8d106dff1f1d07180fed6ccb9c89f9c86f8b9e7e3520667bc0801035c4f"
-}
diff --git a/.sqlx/query-b2d33e673b47de4353142b3169c7aa72261006f750423b9bee516c130face1ee.json b/.sqlx/query-b2d33e673b47de4353142b3169c7aa72261006f750423b9bee516c130face1ee.json
deleted file mode 100644
index 7916c4afe5..0000000000
--- a/.sqlx/query-b2d33e673b47de4353142b3169c7aa72261006f750423b9bee516c130face1ee.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"PdfHighlightAnchor\"\n (uuid, \"documentId\", owner, page, red, green, blue, alpha, type, text, \"pageViewportWidth\", \"pageViewportHeight\")\n VALUES ($1, 'message-doc-a', $2, 1, 255, 255, 0, 0.5, 1, 'selected text', 600, 800)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "b2d33e673b47de4353142b3169c7aa72261006f750423b9bee516c130face1ee"
-}
diff --git a/.sqlx/query-b33a80bfdb02cc2bd80c1f15fae10b5a9a3e3ede8422ab0f8a7d6962b8112005.json b/.sqlx/query-b33a80bfdb02cc2bd80c1f15fae10b5a9a3e3ede8422ab0f8a7d6962b8112005.json
deleted file mode 100644
index b74bfe2198..0000000000
--- a/.sqlx/query-b33a80bfdb02cc2bd80c1f15fae10b5a9a3e3ede8422ab0f8a7d6962b8112005.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id, entity_id, values AS \"values: serde_json::Value\", updated_at\n FROM entity_properties\n WHERE property_definition_id = $1\n ORDER BY entity_id",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "entity_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "values: serde_json::Value",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 3,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- true,
- false
- ]
- },
- "hash": "b33a80bfdb02cc2bd80c1f15fae10b5a9a3e3ede8422ab0f8a7d6962b8112005"
-}
diff --git a/.sqlx/query-b3a0afcda1f0ab33f36dda316b1ac763c805d90083c1b0d91635729b74fb4b92.json b/.sqlx/query-b3a0afcda1f0ab33f36dda316b1ac763c805d90083c1b0d91635729b74fb4b92.json
deleted file mode 100644
index 1e3904ee22..0000000000
--- a/.sqlx/query-b3a0afcda1f0ab33f36dda316b1ac763c805d90083c1b0d91635729b74fb4b92.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, $2, $2, $2) ON CONFLICT DO NOTHING",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "b3a0afcda1f0ab33f36dda316b1ac763c805d90083c1b0d91635729b74fb4b92"
-}
diff --git a/.sqlx/query-b3d3fbba4d014d0aa509eb7f1fc895dfa4cbf38507e37358c31859be89f08ce0.json b/.sqlx/query-b3d3fbba4d014d0aa509eb7f1fc895dfa4cbf38507e37358c31859be89f08ce0.json
deleted file mode 100644
index fe6dcfde32..0000000000
--- a/.sqlx/query-b3d3fbba4d014d0aa509eb7f1fc895dfa4cbf38507e37358c31859be89f08ce0.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_channel_participants",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "b3d3fbba4d014d0aa509eb7f1fc895dfa4cbf38507e37358c31859be89f08ce0"
-}
diff --git a/.sqlx/query-b3f6579a5fe4359baf945f0d58654c489318870b0996348ab069f9a8a4c8f732.json b/.sqlx/query-b3f6579a5fe4359baf945f0d58654c489318870b0996348ab069f9a8a4c8f732.json
deleted file mode 100644
index 1a292cc103..0000000000
--- a/.sqlx/query-b3f6579a5fe4359baf945f0d58654c489318870b0996348ab069f9a8a4c8f732.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET channel_type = 'public' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "b3f6579a5fe4359baf945f0d58654c489318870b0996348ab069f9a8a4c8f732"
-}
diff --git a/.sqlx/query-b46d01ab978242d753ca1627575ac9339e580c45a232befd7b741649f493ae74.json b/.sqlx/query-b46d01ab978242d753ca1627575ac9339e580c45a232befd7b741649f493ae74.json
deleted file mode 100644
index 176ff8cf89..0000000000
--- a/.sqlx/query-b46d01ab978242d753ca1627575ac9339e580c45a232befd7b741649f493ae74.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT name, owner_id, team_id, auto_join_team, created_at, updated_at FROM comms_channels WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "name",
- "type_info": "Varchar"
- },
- {
- "ordinal": 1,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "team_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 3,
- "name": "auto_join_team",
- "type_info": "Bool"
- },
- {
- "ordinal": 4,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 5,
- "name": "updated_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- false,
- true,
- false,
- false,
- false
- ]
- },
- "hash": "b46d01ab978242d753ca1627575ac9339e580c45a232befd7b741649f493ae74"
-}
diff --git a/.sqlx/query-b474d1e4b872802a90244e2a8b6c17369f8d1986cb8f6cd74d52c7014a39164a.json b/.sqlx/query-b474d1e4b872802a90244e2a8b6c17369f8d1986cb8f6cd74d52c7014a39164a.json
deleted file mode 100644
index 610a7118e4..0000000000
--- a/.sqlx/query-b474d1e4b872802a90244e2a8b6c17369f8d1986cb8f6cd74d52c7014a39164a.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_companies (id, team_id, hidden, first_interaction, last_interaction)\n VALUES ($1, $2, $3, now(), now())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Bool"
- ]
- },
- "nullable": []
- },
- "hash": "b474d1e4b872802a90244e2a8b6c17369f8d1986cb8f6cd74d52c7014a39164a"
-}
diff --git a/.sqlx/query-b4fa2a26ca884a6c8a3613ec44bb8291d5fc75bfea7db794ff58446882afd478.json b/.sqlx/query-b4fa2a26ca884a6c8a3613ec44bb8291d5fc75bfea7db794ff58446882afd478.json
deleted file mode 100644
index 8a3067e67f..0000000000
--- a/.sqlx/query-b4fa2a26ca884a6c8a3613ec44bb8291d5fc75bfea7db794ff58446882afd478.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO harnesses (id, name, owner_user_id, created_by, last_connected_at)\n VALUES ($1, 'mine', $2, $2, now())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "b4fa2a26ca884a6c8a3613ec44bb8291d5fc75bfea7db794ff58446882afd478"
-}
diff --git a/.sqlx/query-b5361358a7530ee5c9381fd6d3b00ad9b667d71ec9b3bf925e7fc16ea99653f3.json b/.sqlx/query-b5361358a7530ee5c9381fd6d3b00ad9b667d71ec9b3bf925e7fc16ea99653f3.json
deleted file mode 100644
index 9e0a10a964..0000000000
--- a/.sqlx/query-b5361358a7530ee5c9381fd6d3b00ad9b667d71ec9b3bf925e7fc16ea99653f3.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (\n entity_id,\n entity_type,\n source_id,\n source_type,\n access_level\n )\n VALUES (\n 'cccccccc-cccc-cccc-cccc-000000000001',\n 'chat',\n 'user-3',\n 'user',\n 'view'\n )\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "b5361358a7530ee5c9381fd6d3b00ad9b667d71ec9b3bf925e7fc16ea99653f3"
-}
diff --git a/.sqlx/query-b61cc43a2ea1c9803fb6f7e68afc9bf2e337396d4d35986aeeaeea28b05d3511.json b/.sqlx/query-b61cc43a2ea1c9803fb6f7e68afc9bf2e337396d4d35986aeeaeea28b05d3511.json
deleted file mode 100644
index 4fad7ecd32..0000000000
--- a/.sqlx/query-b61cc43a2ea1c9803fb6f7e68afc9bf2e337396d4d35986aeeaeea28b05d3511.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team_user (user_id, team_id, team_role)\n VALUES ($1, $2, $3::text::team_role)\n ON CONFLICT (user_id, team_id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "b61cc43a2ea1c9803fb6f7e68afc9bf2e337396d4d35986aeeaeea28b05d3511"
-}
diff --git a/.sqlx/query-b7a3ba808c125b4ea6d66ce1a5f98aef0a7bfe7d5133c30c4a74081198e93209.json b/.sqlx/query-b7a3ba808c125b4ea6d66ce1a5f98aef0a7bfe7d5133c30c4a74081198e93209.json
deleted file mode 100644
index 35bd3bd76b..0000000000
--- a/.sqlx/query-b7a3ba808c125b4ea6d66ce1a5f98aef0a7bfe7d5133c30c4a74081198e93209.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM initiative WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "b7a3ba808c125b4ea6d66ce1a5f98aef0a7bfe7d5133c30c4a74081198e93209"
-}
diff --git a/.sqlx/query-b83d9608a1c3512152009746b284b5713d71fe0d8f732ecbcdbca390097e736a.json b/.sqlx/query-b83d9608a1c3512152009746b284b5713d71fe0d8f732ecbcdbca390097e736a.json
deleted file mode 100644
index d25e3fc26f..0000000000
--- a/.sqlx/query-b83d9608a1c3512152009746b284b5713d71fe0d8f732ecbcdbca390097e736a.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM database_columns WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "b83d9608a1c3512152009746b284b5713d71fe0d8f732ecbcdbca390097e736a"
-}
diff --git a/.sqlx/query-b8bebd828019c7a0d8b9638e76bd3c7866017f7dda1a20ea7339a03ae07b5aa3.json b/.sqlx/query-b8bebd828019c7a0d8b9638e76bd3c7866017f7dda1a20ea7339a03ae07b5aa3.json
deleted file mode 100644
index 4230593cb8..0000000000
--- a/.sqlx/query-b8bebd828019c7a0d8b9638e76bd3c7866017f7dda1a20ea7339a03ae07b5aa3.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS(SELECT 1 FROM entity WHERE id = $1) AS \"exists!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "b8bebd828019c7a0d8b9638e76bd3c7866017f7dda1a20ea7339a03ae07b5aa3"
-}
diff --git a/.sqlx/query-b905a7b3100f7cff2d8b8ef1d316005ab28b52c3103384562bf26751b973958f.json b/.sqlx/query-b905a7b3100f7cff2d8b8ef1d316005ab28b52c3103384562bf26751b973958f.json
deleted file mode 100644
index 4058cfa8a4..0000000000
--- a/.sqlx/query-b905a7b3100f7cff2d8b8ef1d316005ab28b52c3103384562bf26751b973958f.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT created_at\n FROM channel_notification_email_sent\n WHERE channel_id = $1\n AND user_id = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "b905a7b3100f7cff2d8b8ef1d316005ab28b52c3103384562bf26751b973958f"
-}
diff --git a/.sqlx/query-b9075c63faef0a5076087f8b0c701950824da41cd5ac8049135fd9e30ecc4cfc.json b/.sqlx/query-b9075c63faef0a5076087f8b0c701950824da41cd5ac8049135fd9e30ecc4cfc.json
deleted file mode 100644
index 62ad01b577..0000000000
--- a/.sqlx/query-b9075c63faef0a5076087f8b0c701950824da41cd5ac8049135fd9e30ecc4cfc.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, sender_id, content, imported_author)\n VALUES ($1, 'channel', $2::uuid::text, 'macro|[email protected]', 'Historical content', $3)\n ON CONFLICT (id) DO UPDATE SET imported_author = EXCLUDED.imported_author\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "b9075c63faef0a5076087f8b0c701950824da41cd5ac8049135fd9e30ecc4cfc"
-}
diff --git a/.sqlx/query-baa8d6d24fc102d63c6d4b501728dd8b8efe42c926053b0a6a38b6d1b1a2b006.json b/.sqlx/query-baa8d6d24fc102d63c6d4b501728dd8b8efe42c926053b0a6a38b6d1b1a2b006.json
deleted file mode 100644
index d6bda3b888..0000000000
--- a/.sqlx/query-baa8d6d24fc102d63c6d4b501728dd8b8efe42c926053b0a6a38b6d1b1a2b006.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO database_rows (id, table_id, position) VALUES ($1, $2, 'a')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "baa8d6d24fc102d63c6d4b501728dd8b8efe42c926053b0a6a38b6d1b1a2b006"
-}
diff --git a/.sqlx/query-bac7dcac5151e27205a782204dd3f6d0bc4e10250215f559adcccf0b1fd3a95d.json b/.sqlx/query-bac7dcac5151e27205a782204dd3f6d0bc4e10250215f559adcccf0b1fd3a95d.json
deleted file mode 100644
index e11c78e811..0000000000
--- a/.sqlx/query-bac7dcac5151e27205a782204dd3f6d0bc4e10250215f559adcccf0b1fd3a95d.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM scheduled_action_event_run",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "bac7dcac5151e27205a782204dd3f6d0bc4e10250215f559adcccf0b1fd3a95d"
-}
diff --git a/.sqlx/query-bacb14adfca8cf154de66a71df2a397482a74f60bc37f8548cf68e8aed95214e.json b/.sqlx/query-bacb14adfca8cf154de66a71df2a397482a74f60bc37f8548cf68e8aed95214e.json
deleted file mode 100644
index 41a9c5fc1d..0000000000
--- a/.sqlx/query-bacb14adfca8cf154de66a71df2a397482a74f60bc37f8548cf68e8aed95214e.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id, item_id, item_type FROM user_notification_item_unsubscribe WHERE item_id = 'document-one' AND user_id = 'macro|[email protected]'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "item_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "item_type",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "bacb14adfca8cf154de66a71df2a397482a74f60bc37f8548cf68e8aed95214e"
-}
diff --git a/.sqlx/query-bb3e095a9da280495a2c7979e4a4b1d86d442dd8e49c66ecc6e7d414145c281c.json b/.sqlx/query-bb3e095a9da280495a2c7979e4a4b1d86d442dd8e49c66ecc6e7d414145c281c.json
deleted file mode 100644
index c692649fe5..0000000000
--- a/.sqlx/query-bb3e095a9da280495a2c7979e4a4b1d86d442dd8e49c66ecc6e7d414145c281c.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT seat_count FROM team WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "seat_count",
- "type_info": "Int4"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "bb3e095a9da280495a2c7979e4a4b1d86d442dd8e49c66ecc6e7d414145c281c"
-}
diff --git a/.sqlx/query-bb5c2b997a973899bb78cb2a28d8c4faae2e68d674123ecc2b6c5b11434d020c.json b/.sqlx/query-bb5c2b997a973899bb78cb2a28d8c4faae2e68d674123ecc2b6c5b11434d020c.json
deleted file mode 100644
index 3aee0f3b09..0000000000
--- a/.sqlx/query-bb5c2b997a973899bb78cb2a28d8c4faae2e68d674123ecc2b6c5b11434d020c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id, auto_join_domain) VALUES ($1, 'Atomic history', 'macro|[email protected]', 'example.com')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "bb5c2b997a973899bb78cb2a28d8c4faae2e68d674123ecc2b6c5b11434d020c"
-}
diff --git a/.sqlx/query-bb9c322f601c8672e364dc9e2700de834ed8b6abf3330c251b085538739db7cb.json b/.sqlx/query-bb9c322f601c8672e364dc9e2700de834ed8b6abf3330c251b085538739db7cb.json
deleted file mode 100644
index 025c3aa1c7..0000000000
--- a/.sqlx/query-bb9c322f601c8672e364dc9e2700de834ed8b6abf3330c251b085538739db7cb.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO user_notification (user_id, notification_id, created_at, seen_at, state)\n VALUES ($1, $2, NOW(), NULL, 'unseen'), ($1, $3, NOW(), NOW(), 'done')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "bb9c322f601c8672e364dc9e2700de834ed8b6abf3330c251b085538739db7cb"
-}
diff --git a/.sqlx/query-bbc30241fa767b210c65d1edd257ab9cd4c450e9eb5750a24481e651fc2d73b3.json b/.sqlx/query-bbc30241fa767b210c65d1edd257ab9cd4c450e9eb5750a24481e651fc2d73b3.json
deleted file mode 100644
index 079ce453e9..0000000000
--- a/.sqlx/query-bbc30241fa767b210c65d1edd257ab9cd4c450e9eb5750a24481e651fc2d73b3.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM property_definitions WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "bbc30241fa767b210c65d1edd257ab9cd4c450e9eb5750a24481e651fc2d73b3"
-}
diff --git a/.sqlx/query-bca4c5ebcfe4b6716bd20d8a031735081e3a2e2181b5c52b5c42a9506310bfc8.json b/.sqlx/query-bca4c5ebcfe4b6716bd20d8a031735081e3a2e2181b5c52b5c42a9506310bfc8.json
deleted file mode 100644
index 1b1e23ff3d..0000000000
--- a/.sqlx/query-bca4c5ebcfe4b6716bd20d8a031735081e3a2e2181b5c52b5c42a9506310bfc8.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"macro_user_id\" as \"macro_user_id!\" FROM \"User\" WHERE \"macro_user_id\" = $1 AND \"id\" = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "macro_user_id!",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "bca4c5ebcfe4b6716bd20d8a031735081e3a2e2181b5c52b5c42a9506310bfc8"
-}
diff --git a/.sqlx/query-bcec006efa10df748a886c294b809ccc4f8cea4c74f21363e4eb22595bb73d78.json b/.sqlx/query-bcec006efa10df748a886c294b809ccc4f8cea4c74f21363e4eb22595bb73d78.json
deleted file mode 100644
index 320062f619..0000000000
--- a/.sqlx/query-bcec006efa10df748a886c294b809ccc4f8cea4c74f21363e4eb22595bb73d78.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE webhook\n SET\n endpoint_url = $2,\n headers = $3,\n updated_at = now()\n WHERE id = $1\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "bcec006efa10df748a886c294b809ccc4f8cea4c74f21363e4eb22595bb73d78"
-}
diff --git a/.sqlx/query-bd07ef1bc7c233082f6c0e55fffbd3ef9b3da489891b668b9f95602bca33acd0.json b/.sqlx/query-bd07ef1bc7c233082f6c0e55fffbd3ef9b3da489891b668b9f95602bca33acd0.json
new file mode 100644
index 0000000000..b50bac4177
--- /dev/null
+++ b/.sqlx/query-bd07ef1bc7c233082f6c0e55fffbd3ef9b3da489891b668b9f95602bca33acd0.json
@@ -0,0 +1,20 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n INSERT INTO ai_billing_account (\n user_id, overage_enabled, overage_limit_cents,\n auto_reload_minimum_cents, auto_reload_target_cents,\n auto_reload_monthly_limit_cents\n )\n VALUES ($1, $2, $3, $4, $5, $6)\n ON CONFLICT (user_id) DO UPDATE\n SET overage_enabled = EXCLUDED.overage_enabled,\n overage_limit_cents = EXCLUDED.overage_limit_cents,\n auto_reload_minimum_cents = CASE\n WHEN $7 THEN EXCLUDED.auto_reload_minimum_cents\n ELSE ai_billing_account.auto_reload_minimum_cents\n END,\n auto_reload_target_cents = CASE\n WHEN $7 THEN EXCLUDED.auto_reload_target_cents\n ELSE ai_billing_account.auto_reload_target_cents\n END,\n auto_reload_monthly_limit_cents = CASE\n WHEN $7 THEN EXCLUDED.auto_reload_monthly_limit_cents\n ELSE ai_billing_account.auto_reload_monthly_limit_cents\n END,\n overage_suspended_at = NULL,\n auto_reload_suspended_at = NULL,\n updated_at = NOW()\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Bool",
+ "Int8",
+ "Int8",
+ "Int8",
+ "Int8",
+ "Bool"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "bd07ef1bc7c233082f6c0e55fffbd3ef9b3da489891b668b9f95602bca33acd0"
+}
diff --git a/.sqlx/query-bd091acfa5b872c5e83ea62a9be05cbd205ca770468279a3cc4f18d2dac261fe.json b/.sqlx/query-bd091acfa5b872c5e83ea62a9be05cbd205ca770468279a3cc4f18d2dac261fe.json
deleted file mode 100644
index 554e4bcfaf..0000000000
--- a/.sqlx/query-bd091acfa5b872c5e83ea62a9be05cbd205ca770468279a3cc4f18d2dac261fe.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_conversation SET lease_expires_at = now() - interval '1 minute' WHERE job_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "bd091acfa5b872c5e83ea62a9be05cbd205ca770468279a3cc4f18d2dac261fe"
-}
diff --git a/.sqlx/query-bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654.json b/.sqlx/query-bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654.json
deleted file mode 100644
index 9c45666aca..0000000000
--- a/.sqlx/query-bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channel_participants (channel_id, user_id, role) VALUES ($1, $2, 'member')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "bd37a33a82a494a2fe668169d07d22ea805b30ffd34e53c9407b0ed04ee43654"
-}
diff --git a/.sqlx/query-bd8536537fe4ddb1624f3b2465bd4a614f69b41c4e3e4d0c06d198208c1f1ac6.json b/.sqlx/query-bd8536537fe4ddb1624f3b2465bd4a614f69b41c4e3e4d0c06d198208c1f1ac6.json
deleted file mode 100644
index 396b01c652..0000000000
--- a/.sqlx/query-bd8536537fe4ddb1624f3b2465bd4a614f69b41c4e3e4d0c06d198208c1f1ac6.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ('d2000000-0000-0000-0000-000000000002', 'shared-viewer', '[email protected]', 'collection_shared')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "bd8536537fe4ddb1624f3b2465bd4a614f69b41c4e3e4d0c06d198208c1f1ac6"
-}
diff --git a/.sqlx/query-be6acd044d4ad3dd1e0165756ae84f6a20ad1463670e32e3fb188673efa93f61.json b/.sqlx/query-be6acd044d4ad3dd1e0165756ae84f6a20ad1463670e32e3fb188673efa93f61.json
deleted file mode 100644
index 8072303154..0000000000
--- a/.sqlx/query-be6acd044d4ad3dd1e0165756ae84f6a20ad1463670e32e3fb188673efa93f61.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM team WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "be6acd044d4ad3dd1e0165756ae84f6a20ad1463670e32e3fb188673efa93f61"
-}
diff --git a/.sqlx/query-bee8f14659d58b33c71c06209782294887fab648371d0d56fb488cb4093d0995.json b/.sqlx/query-bee8f14659d58b33c71c06209782294887fab648371d0d56fb488cb4093d0995.json
deleted file mode 100644
index 9d33601efa..0000000000
--- a/.sqlx/query-bee8f14659d58b33c71c06209782294887fab648371d0d56fb488cb4093d0995.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO comms_channel_participants (channel_id, user_id, role)\n VALUES ($1, $2, 'admin'::comms_participant_role)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "bee8f14659d58b33c71c06209782294887fab648371d0d56fb488cb4093d0995"
-}
diff --git a/.sqlx/query-bff01581339088cabd0406aa4cb27cc932fd5a1f483533ac0c315bd9d0680675.json b/.sqlx/query-bff01581339088cabd0406aa4cb27cc932fd5a1f483533ac0c315bd9d0680675.json
deleted file mode 100644
index c5dc3ca39b..0000000000
--- a/.sqlx/query-bff01581339088cabd0406aa4cb27cc932fd5a1f483533ac0c315bd9d0680675.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT needs_reauth FROM email_links WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "needs_reauth",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "bff01581339088cabd0406aa4cb27cc932fd5a1f483533ac0c315bd9d0680675"
-}
diff --git a/.sqlx/query-bff5f187b7e78e8757f7b0b82d8afb515b62313fe73ab3b068f117e7c43db380.json b/.sqlx/query-bff5f187b7e78e8757f7b0b82d8afb515b62313fe73ab3b068f117e7c43db380.json
deleted file mode 100644
index 23c823a8d8..0000000000
--- a/.sqlx/query-bff5f187b7e78e8757f7b0b82d8afb515b62313fe73ab3b068f117e7c43db380.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT table_id FROM database_rows WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "table_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "bff5f187b7e78e8757f7b0b82d8afb515b62313fe73ab3b068f117e7c43db380"
-}
diff --git a/.sqlx/query-c05417bf59b0918a5064d4f361dfe04c5f66ac246807523f4132d98a394f11c2.json b/.sqlx/query-c05417bf59b0918a5064d4f361dfe04c5f66ac246807523f4132d98a394f11c2.json
deleted file mode 100644
index 79489973a1..0000000000
--- a/.sqlx/query-c05417bf59b0918a5064d4f361dfe04c5f66ac246807523f4132d98a394f11c2.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE database_columns SET property_definition_id = $3\n WHERE table_id = $1 AND property_definition_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c05417bf59b0918a5064d4f361dfe04c5f66ac246807523f4132d98a394f11c2"
-}
diff --git a/.sqlx/query-c0c2a9e29068b3b344001e3ab47675f5236d0f1bae47c70a015608ce2b999c73.json b/.sqlx/query-c0c2a9e29068b3b344001e3ab47675f5236d0f1bae47c70a015608ce2b999c73.json
deleted file mode 100644
index 4f585e5a13..0000000000
--- a/.sqlx/query-c0c2a9e29068b3b344001e3ab47675f5236d0f1bae47c70a015608ce2b999c73.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_messages SET is_sent = true, is_draft = false WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c0c2a9e29068b3b344001e3ab47675f5236d0f1bae47c70a015608ce2b999c73"
-}
diff --git a/.sqlx/query-c14338c83613a887a46aec25ace964ad0fcb992f5461c9e5be988c60b07862d3.json b/.sqlx/query-c14338c83613a887a46aec25ace964ad0fcb992f5461c9e5be988c60b07862d3.json
deleted file mode 100644
index bfac44cde6..0000000000
--- a/.sqlx/query-c14338c83613a887a46aec25ace964ad0fcb992f5461c9e5be988c60b07862d3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_configs (bot_id, instructions, harness, default_model, channel_scope, is_coding)\n VALUES ($1, 'prompt', 'in-memory', 'default', 'all', false)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c14338c83613a887a46aec25ace964ad0fcb992f5461c9e5be988c60b07862d3"
-}
diff --git a/.sqlx/query-c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a.json b/.sqlx/query-c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a.json
new file mode 100644
index 0000000000..706a0acfcb
--- /dev/null
+++ b/.sqlx/query-c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a.json
@@ -0,0 +1,17 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n INSERT INTO ai_credit_ledger (id, user_id, kind, delta_cents, stripe_reference, note)\n VALUES ($1, $2, 'purchase', $3, $4, 'Automatic reload')\n ON CONFLICT (stripe_reference) WHERE stripe_reference IS NOT NULL DO NOTHING\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text",
+ "Int8",
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "c2034a09d94daac82338267149c38feeb656b6e7aab9747d400dd6f3ad686c5a"
+}
diff --git a/.sqlx/query-c3aa57ab0a5b982c0020f3e2eecc3432e627ddbfb37aa39c79c58d8cbf328a8c.json b/.sqlx/query-c3aa57ab0a5b982c0020f3e2eecc3432e627ddbfb37aa39c79c58d8cbf328a8c.json
deleted file mode 100644
index 1362efb11a..0000000000
--- a/.sqlx/query-c3aa57ab0a5b982c0020f3e2eecc3432e627ddbfb37aa39c79c58d8cbf328a8c.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT user_id FROM user_mute_notification WHERE user_id = 'A'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "user_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "c3aa57ab0a5b982c0020f3e2eecc3432e627ddbfb37aa39c79c58d8cbf328a8c"
-}
diff --git a/.sqlx/query-c3ae46a0aebd0bd2cb8ca053f38ec7515761e0de081ad219d3e31fcbe6e2a4cd.json b/.sqlx/query-c3ae46a0aebd0bd2cb8ca053f38ec7515761e0de081ad219d3e31fcbe6e2a4cd.json
deleted file mode 100644
index 9b42a4545c..0000000000
--- a/.sqlx/query-c3ae46a0aebd0bd2cb8ca053f38ec7515761e0de081ad219d3e31fcbe6e2a4cd.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO entity_properties (id, entity_id, entity_type, property_definition_id, values)\n VALUES ($1, $2, 'DATABASE_ROW', $3, jsonb_build_object('type', 'String', 'value', $4::text))",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "c3ae46a0aebd0bd2cb8ca053f38ec7515761e0de081ad219d3e31fcbe6e2a4cd"
-}
diff --git a/.sqlx/query-c46e24f291443a9a4ef367198bb899bc5e427aa314c2e8ff7e8472509b07e478.json b/.sqlx/query-c46e24f291443a9a4ef367198bb899bc5e427aa314c2e8ff7e8472509b07e478.json
deleted file mode 100644
index 27b32c583d..0000000000
--- a/.sqlx/query-c46e24f291443a9a4ef367198bb899bc5e427aa314c2e8ff7e8472509b07e478.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO webhook (\n id,\n workspace_id,\n namespace,\n name,\n endpoint_url,\n signing_secret,\n headers,\n filters,\n status,\n is_valid,\n created_by_user_id,\n deleted_at\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, true, $10, $11)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Jsonb",
- "Jsonb",
- "Text",
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "c46e24f291443a9a4ef367198bb899bc5e427aa314c2e8ff7e8472509b07e478"
-}
diff --git a/.sqlx/query-c4945dec390eede39113f1c677cfd8a97272e7db948e506ed1c93505ec221f2f.json b/.sqlx/query-c4945dec390eede39113f1c677cfd8a97272e7db948e506ed1c93505ec221f2f.json
deleted file mode 100644
index dd40e406f1..0000000000
--- a/.sqlx/query-c4945dec390eede39113f1c677cfd8a97272e7db948e506ed1c93505ec221f2f.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT draft, assignees, labels, requested_reviewer_github_user_ids, participant_github_user_ids, reviews, review_decision FROM github_pull_request WHERE github_key = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "draft",
- "type_info": "Bool"
- },
- {
- "ordinal": 1,
- "name": "assignees",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 2,
- "name": "labels",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 3,
- "name": "requested_reviewer_github_user_ids",
- "type_info": "TextArray"
- },
- {
- "ordinal": 4,
- "name": "participant_github_user_ids",
- "type_info": "TextArray"
- },
- {
- "ordinal": 5,
- "name": "reviews",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 6,
- "name": "review_decision",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false,
- false,
- true
- ]
- },
- "hash": "c4945dec390eede39113f1c677cfd8a97272e7db948e506ed1c93505ec221f2f"
-}
diff --git a/.sqlx/query-c4ef2d7794fbee599582073bb2901ad347f7f570db4b3bd02dd0e348e1d65815.json b/.sqlx/query-c4ef2d7794fbee599582073bb2901ad347f7f570db4b3bd02dd0e348e1d65815.json
deleted file mode 100644
index 51257cfaa1..0000000000
--- a/.sqlx/query-c4ef2d7794fbee599582073bb2901ad347f7f570db4b3bd02dd0e348e1d65815.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT attempt_number, status\n FROM webhook_delivery_attempt\n WHERE webhook_delivery_id = $1\n ORDER BY attempt_number\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "attempt_number",
- "type_info": "Int4"
- },
- {
- "ordinal": 1,
- "name": "status",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "c4ef2d7794fbee599582073bb2901ad347f7f570db4b3bd02dd0e348e1d65815"
-}
diff --git a/.sqlx/query-c520df6bc7468dc2846dd074eaef6fd38e2e862744473e98ac1e9a0226d9d0cd.json b/.sqlx/query-c520df6bc7468dc2846dd074eaef6fd38e2e862744473e98ac1e9a0226d9d0cd.json
deleted file mode 100644
index cff83746ce..0000000000
--- a/.sqlx/query-c520df6bc7468dc2846dd074eaef6fd38e2e862744473e98ac1e9a0226d9d0cd.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n sp.team_share_access_level::text AS \"level?\",\n sp.team_share_team_id AS \"team_id?\",\n sp.team_share_revision AS revision\n FROM \"ProjectPermission\" pp\n JOIN \"SharePermission\" sp ON pp.\"sharePermissionId\" = sp.id\n WHERE pp.\"projectId\" = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "level?",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "team_id?",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "revision",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null,
- true,
- false
- ]
- },
- "hash": "c520df6bc7468dc2846dd074eaef6fd38e2e862744473e98ac1e9a0226d9d0cd"
-}
diff --git a/.sqlx/query-c5d1372ccabff0625eeac4834753c2e732429b4adb66415106637ea0f214643e.json b/.sqlx/query-c5d1372ccabff0625eeac4834753c2e732429b4adb66415106637ea0f214643e.json
deleted file mode 100644
index 7b6dddeb4e..0000000000
--- a/.sqlx/query-c5d1372ccabff0625eeac4834753c2e732429b4adb66415106637ea0f214643e.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM harness_tokens",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "c5d1372ccabff0625eeac4834753c2e732429b4adb66415106637ea0f214643e"
-}
diff --git a/.sqlx/query-c5dfb8f0e980af93d0bcf1074cbdb0f51245d49823426957bba536448decb274.json b/.sqlx/query-c5dfb8f0e980af93d0bcf1074cbdb0f51245d49823426957bba536448decb274.json
deleted file mode 100644
index df78d2d982..0000000000
--- a/.sqlx/query-c5dfb8f0e980af93d0bcf1074cbdb0f51245d49823426957bba536448decb274.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE agent_session SET manager_replica_id = $2, manager_fence = manager_fence + 1 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c5dfb8f0e980af93d0bcf1074cbdb0f51245d49823426957bba536448decb274"
-}
diff --git a/.sqlx/query-c69d6ed9b74f4be0b67a0ddde6645f0b76ab12a19afb17e42d26663fc8e802c3.json b/.sqlx/query-c69d6ed9b74f4be0b67a0ddde6645f0b76ab12a19afb17e42d26663fc8e802c3.json
deleted file mode 100644
index 0b3d6c3902..0000000000
--- a/.sqlx/query-c69d6ed9b74f4be0b67a0ddde6645f0b76ab12a19afb17e42d26663fc8e802c3.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT created_at, user_id FROM comms_entity_mentions WHERE source_entity_type = 'message' AND source_entity_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 1,
- "name": "user_id",
- "type_info": "Varchar"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true
- ]
- },
- "hash": "c69d6ed9b74f4be0b67a0ddde6645f0b76ab12a19afb17e42d26663fc8e802c3"
-}
diff --git a/.sqlx/query-c7809937643b33aa3beeb44aa0f35dcc64453af5fb45071481454e0af30d9e40.json b/.sqlx/query-c7809937643b33aa3beeb44aa0f35dcc64453af5fb45071481454e0af30d9e40.json
deleted file mode 100644
index 680710df48..0000000000
--- a/.sqlx/query-c7809937643b33aa3beeb44aa0f35dcc64453af5fb45071481454e0af30d9e40.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO call_participants (call_id, user_id) VALUES ($1, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "c7809937643b33aa3beeb44aa0f35dcc64453af5fb45071481454e0af30d9e40"
-}
diff --git a/.sqlx/query-c7907437d0fbb4862daece91db17e3e9c9c32fca6d1813c4e4262f6f3f7ed3a1.json b/.sqlx/query-c7907437d0fbb4862daece91db17e3e9c9c32fca6d1813c4e4262f6f3f7ed3a1.json
deleted file mode 100644
index 95bdb8fedc..0000000000
--- a/.sqlx/query-c7907437d0fbb4862daece91db17e3e9c9c32fca6d1813c4e4262f6f3f7ed3a1.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id, user_id, device_token, device_endpoint, device_type as \"device_type:DeviceType\" \n FROM notification_user_device_registration \n WHERE id = '017d85a8-c7c6-7c40-b4f3-a6c1b3c0d1e2'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "user_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "device_token",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "device_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "device_type:DeviceType",
- "type_info": {
- "Custom": {
- "name": "notification_device_type_option",
- "kind": {
- "Enum": [
- "ios",
- "android",
- "iosvoip"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false,
- false,
- false
- ]
- },
- "hash": "c7907437d0fbb4862daece91db17e3e9c9c32fca6d1813c4e4262f6f3f7ed3a1"
-}
diff --git a/.sqlx/query-c7a846fd129481937e0fd7a2b8aa64bd26b7812faba88f3f623f6396ccdb699d.json b/.sqlx/query-c7a846fd129481937e0fd7a2b8aa64bd26b7812faba88f3f623f6396ccdb699d.json
deleted file mode 100644
index 8f2ed6124c..0000000000
--- a/.sqlx/query-c7a846fd129481937e0fd7a2b8aa64bd26b7812faba88f3f623f6396ccdb699d.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE database_changes SET payload_version = 2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "c7a846fd129481937e0fd7a2b8aa64bd26b7812faba88f3f623f6396ccdb699d"
-}
diff --git a/.sqlx/query-c7d3ce19850ed84be244b079bffa60a027155c3181743ec171d51d0864a20d55.json b/.sqlx/query-c7d3ce19850ed84be244b079bffa60a027155c3181743ec171d51d0864a20d55.json
deleted file mode 100644
index 02ba949697..0000000000
--- a/.sqlx/query-c7d3ce19850ed84be244b079bffa60a027155c3181743ec171d51d0864a20d55.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET claimed = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c7d3ce19850ed84be244b079bffa60a027155c3181743ec171d51d0864a20d55"
-}
diff --git a/.sqlx/query-c7dadf94cc6550c04c89c1d0ef87be2a8d6f7b02e5ab0e1056f98cbd9ecd8232.json b/.sqlx/query-c7dadf94cc6550c04c89c1d0ef87be2a8d6f7b02e5ab0e1056f98cbd9ecd8232.json
deleted file mode 100644
index 37fdad5867..0000000000
--- a/.sqlx/query-c7dadf94cc6550c04c89c1d0ef87be2a8d6f7b02e5ab0e1056f98cbd9ecd8232.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"macro_user\" (\"id\", \"email\", \"stripe_customer_id\", \"username\")\n VALUES ($1, $2, $3, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "c7dadf94cc6550c04c89c1d0ef87be2a8d6f7b02e5ab0e1056f98cbd9ecd8232"
-}
diff --git a/.sqlx/query-c90a782357d39d9eca4093d6f719a31fa32916d97538ce3efec86327d9bd20e3.json b/.sqlx/query-c90a782357d39d9eca4093d6f719a31fa32916d97538ce3efec86327d9bd20e3.json
deleted file mode 100644
index b83877a448..0000000000
--- a/.sqlx/query-c90a782357d39d9eca4093d6f719a31fa32916d97538ce3efec86327d9bd20e3.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_configs (bot_id, instructions, harness, default_model, channel_scope, harness_id, is_coding)\n VALUES ($1, 'prompt', 'macrod', 'default', 'all', $2, true)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c90a782357d39d9eca4093d6f719a31fa32916d97538ce3efec86327d9bd20e3"
-}
diff --git a/.sqlx/query-c95fe44857da7de19d5f72d146238283bdfcc125f856829d669e8717379a4805.json b/.sqlx/query-c95fe44857da7de19d5f72d146238283bdfcc125f856829d669e8717379a4805.json
deleted file mode 100644
index 547b6b3405..0000000000
--- a/.sqlx/query-c95fe44857da7de19d5f72d146238283bdfcc125f856829d669e8717379a4805.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE entity_access\n SET access_level = 'view'\n WHERE entity_id = $1 AND entity_type = 'scheduled_action'\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c95fe44857da7de19d5f72d146238283bdfcc125f856829d669e8717379a4805"
-}
diff --git a/.sqlx/query-c9e69cce3bdaa2b2b4f5213d17097bc26ffe40d6b65e193d9b509da30966d8b7.json b/.sqlx/query-c9e69cce3bdaa2b2b4f5213d17097bc26ffe40d6b65e193d9b509da30966d8b7.json
deleted file mode 100644
index c5c5a738b9..0000000000
--- a/.sqlx/query-c9e69cce3bdaa2b2b4f5213d17097bc26ffe40d6b65e193d9b509da30966d8b7.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET deleted_at = NOW() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "c9e69cce3bdaa2b2b4f5213d17097bc26ffe40d6b65e193d9b509da30966d8b7"
-}
diff --git a/.sqlx/query-ca03a6bc69bdb551dd89abdc6e2276c61a6ca8f234877fa7996f71612aefa2b5.json b/.sqlx/query-ca03a6bc69bdb551dd89abdc6e2276c61a6ca8f234877fa7996f71612aefa2b5.json
deleted file mode 100644
index 605cb1a40b..0000000000
--- a/.sqlx/query-ca03a6bc69bdb551dd89abdc6e2276c61a6ca8f234877fa7996f71612aefa2b5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_entity_mentions WHERE source_entity_type = 'message' AND source_entity_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "ca03a6bc69bdb551dd89abdc6e2276c61a6ca8f234877fa7996f71612aefa2b5"
-}
diff --git a/.sqlx/query-ca37ef6aa67efe87991aea962750cdebbd32a398d0c3d04e45ba5c26de1ea006.json b/.sqlx/query-ca37ef6aa67efe87991aea962750cdebbd32a398d0c3d04e45ba5c26de1ea006.json
deleted file mode 100644
index e62f23b5c1..0000000000
--- a/.sqlx/query-ca37ef6aa67efe87991aea962750cdebbd32a398d0c3d04e45ba5c26de1ea006.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id, list_hidden FROM agent_session WHERE id = ANY($1) ORDER BY list_hidden DESC",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "list_hidden",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "UuidArray"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "ca37ef6aa67efe87991aea962750cdebbd32a398d0c3d04e45ba5c26de1ea006"
-}
diff --git a/.sqlx/query-ca7c42077a45660f10e82d8576af5d7e92563e1a5fd3a03b37303a711f865178.json b/.sqlx/query-ca7c42077a45660f10e82d8576af5d7e92563e1a5fd3a03b37303a711f865178.json
new file mode 100644
index 0000000000..3423b08079
--- /dev/null
+++ b/.sqlx/query-ca7c42077a45660f10e82d8576af5d7e92563e1a5fd3a03b37303a711f865178.json
@@ -0,0 +1,16 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n UPDATE ai_credit_reload\n SET stripe_invoice_id = COALESCE($2, stripe_invoice_id),\n status = ($3::text)::ai_credit_reload_status,\n updated_at = NOW()\n WHERE id = $1\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Uuid",
+ "Text",
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "ca7c42077a45660f10e82d8576af5d7e92563e1a5fd3a03b37303a711f865178"
+}
diff --git a/.sqlx/query-cb0a598257df9b622180a61858b1fb87ae08abf2df0bdf9d05287b1b3e935caa.json b/.sqlx/query-cb0a598257df9b622180a61858b1fb87ae08abf2df0bdf9d05287b1b3e935caa.json
deleted file mode 100644
index 32f7364f6b..0000000000
--- a/.sqlx/query-cb0a598257df9b622180a61858b1fb87ae08abf2df0bdf9d05287b1b3e935caa.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n VALUES ($1, 'database', $3, 'user', 'view'),\n ($1, 'database', $4, 'team', 'edit'),\n ($1, 'database', '00000000-0000-0000-0000-0000000ea002', 'team', 'owner'),\n ($1, 'chat', $3, 'user', 'owner'),\n ($2, 'database', $3, 'user', 'owner')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "cb0a598257df9b622180a61858b1fb87ae08abf2df0bdf9d05287b1b3e935caa"
-}
diff --git a/.sqlx/query-cb1be54c1f4c697551f959823955639bd8446ecb4ee9a4359fa0ce1cd05b04b5.json b/.sqlx/query-cb1be54c1f4c697551f959823955639bd8446ecb4ee9a4359fa0ce1cd05b04b5.json
deleted file mode 100644
index e82217b378..0000000000
--- a/.sqlx/query-cb1be54c1f4c697551f959823955639bd8446ecb4ee9a4359fa0ce1cd05b04b5.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT attempt_number, status, completed_at\n FROM webhook_delivery_attempt\n WHERE webhook_delivery_id = $1\n ORDER BY attempt_number\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "attempt_number",
- "type_info": "Int4"
- },
- {
- "ordinal": 1,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "completed_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- true
- ]
- },
- "hash": "cb1be54c1f4c697551f959823955639bd8446ecb4ee9a4359fa0ce1cd05b04b5"
-}
diff --git a/.sqlx/query-cc4f754e35a3d3bfcd58fb3e5f98fce7aab8bdeeaa6419ce2a98b52ff4c3b107.json b/.sqlx/query-cc4f754e35a3d3bfcd58fb3e5f98fce7aab8bdeeaa6419ce2a98b52ff4c3b107.json
deleted file mode 100644
index 47da2adcc0..0000000000
--- a/.sqlx/query-cc4f754e35a3d3bfcd58fb3e5f98fce7aab8bdeeaa6419ce2a98b52ff4c3b107.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM ai_usage",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "cc4f754e35a3d3bfcd58fb3e5f98fce7aab8bdeeaa6419ce2a98b52ff4c3b107"
-}
diff --git a/.sqlx/query-cc916073ea39cc7814ef3bbaa7a86f912bc4c14ef62f597a99c1350367ddd8dc.json b/.sqlx/query-cc916073ea39cc7814ef3bbaa7a86f912bc4c14ef62f597a99c1350367ddd8dc.json
deleted file mode 100644
index 86b12e41cd..0000000000
--- a/.sqlx/query-cc916073ea39cc7814ef3bbaa7a86f912bc4c14ef62f597a99c1350367ddd8dc.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT last_success_at, last_failure_at FROM webhook WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "last_success_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 1,
- "name": "last_failure_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true,
- true
- ]
- },
- "hash": "cc916073ea39cc7814ef3bbaa7a86f912bc4c14ef62f597a99c1350367ddd8dc"
-}
diff --git a/.sqlx/query-cc9bce558e79c8f411d6ecf90aae3eb9ed6a6dd0723fd36f603b7b747cf8d164.json b/.sqlx/query-cc9bce558e79c8f411d6ecf90aae3eb9ed6a6dd0723fd36f603b7b747cf8d164.json
deleted file mode 100644
index 5651e17342..0000000000
--- a/.sqlx/query-cc9bce558e79c8f411d6ecf90aae3eb9ed6a6dd0723fd36f603b7b747cf8d164.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"account_merge_request\" (\"id\", \"macro_user_id\", \"to_merge_macro_user_id\", \"code\", \"created_at\")\n VALUES ($1, $2, $3, $4, NOW())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "cc9bce558e79c8f411d6ecf90aae3eb9ed6a6dd0723fd36f603b7b747cf8d164"
-}
diff --git a/.sqlx/query-ccffcdc346ba29f62505162f7df86e7352e50be067678781ce6386cf59cc61fd.json b/.sqlx/query-ccffcdc346ba29f62505162f7df86e7352e50be067678781ce6386cf59cc61fd.json
deleted file mode 100644
index 1fadfe4c60..0000000000
--- a/.sqlx/query-ccffcdc346ba29f62505162f7df86e7352e50be067678781ce6386cf59cc61fd.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO notification (id, notification_event_type, event_item_id, event_item_type, service_sender, created_at)\n SELECT id, 'document_comment', entity_id, 'document', 'test',\n timestamp '2024-06-02' + position * interval '1 second'\n FROM unnest($1::uuid[], $2::text[]) WITH ORDINALITY seeded(id, entity_id, position)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "UuidArray",
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "ccffcdc346ba29f62505162f7df86e7352e50be067678781ce6386cf59cc61fd"
-}
diff --git a/.sqlx/query-cdb67d7c03e18b81c5c1cc9ddd26d81999d7deccc030620155029797e6c5082b.json b/.sqlx/query-cdb67d7c03e18b81c5c1cc9ddd26d81999d7deccc030620155029797e6c5082b.json
deleted file mode 100644
index 674815f5c0..0000000000
--- a/.sqlx/query-cdb67d7c03e18b81c5c1cc9ddd26d81999d7deccc030620155029797e6c5082b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1, 'archive', '[email protected]', 'archive-customer'), ($2, 'foreign', '[email protected]', 'foreign-customer')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "cdb67d7c03e18b81c5c1cc9ddd26d81999d7deccc030620155029797e6c5082b"
-}
diff --git a/.sqlx/query-cdce8a94205aa3154b6a1205180d23697c8707004cc794f6f92412938df3cc34.json b/.sqlx/query-cdce8a94205aa3154b6a1205180d23697c8707004cc794f6f92412938df3cc34.json
deleted file mode 100644
index fe0d7a7d02..0000000000
--- a/.sqlx/query-cdce8a94205aa3154b6a1205180d23697c8707004cc794f6f92412938df3cc34.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM comms_message_threads\n WHERE parent_entity_type = 'document' AND parent_entity_id = 'message-doc-a'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "cdce8a94205aa3154b6a1205180d23697c8707004cc794f6f92412938df3cc34"
-}
diff --git a/.sqlx/query-ce05940abd256a8c92e81ada0b2a4935e9353b7ed741fc398e4d36043df86d8e.json b/.sqlx/query-ce05940abd256a8c92e81ada0b2a4935e9353b7ed741fc398e4d36043df86d8e.json
deleted file mode 100644
index e858608d1c..0000000000
--- a/.sqlx/query-ce05940abd256a8c92e81ada0b2a4935e9353b7ed741fc398e4d36043df86d8e.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO foreign_entity (id, foreign_entity_id, foreign_entity_source, metadata,\n stored_for_id, stored_for_auth_entity)\n VALUES ($1, $2, $3, $4, 'macro|[email protected]', 'user')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "ce05940abd256a8c92e81ada0b2a4935e9353b7ed741fc398e4d36043df86d8e"
-}
diff --git a/.sqlx/query-ce412ec518979bbde55cfa89c941aa25611aef717cfae6c9a6be3cef969cfe15.json b/.sqlx/query-ce412ec518979bbde55cfa89c941aa25611aef717cfae6c9a6be3cef969cfe15.json
deleted file mode 100644
index 4d17041acf..0000000000
--- a/.sqlx/query-ce412ec518979bbde55cfa89c941aa25611aef717cfae6c9a6be3cef969cfe15.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n d.status,\n d.delivered_at,\n d.attempt_count,\n a.status AS attempt_status,\n a.completed_at,\n w.last_success_at,\n w.last_failure_at\n FROM webhook_delivery d\n JOIN webhook_delivery_attempt a ON a.webhook_delivery_id = d.id\n JOIN webhook w ON w.id = d.webhook_id\n WHERE d.id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "delivered_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "attempt_count",
- "type_info": "Int4"
- },
- {
- "ordinal": 3,
- "name": "attempt_status",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "completed_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 5,
- "name": "last_success_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 6,
- "name": "last_failure_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- true,
- false,
- false,
- true,
- true,
- true
- ]
- },
- "hash": "ce412ec518979bbde55cfa89c941aa25611aef717cfae6c9a6be3cef969cfe15"
-}
diff --git a/.sqlx/query-cef68a830ecef3ff486ad5c4a82edf67c7bf0917356a564acb7d2f0e8fded674.json b/.sqlx/query-cef68a830ecef3ff486ad5c4a82edf67c7bf0917356a564acb7d2f0e8fded674.json
deleted file mode 100644
index 3a9af54e0f..0000000000
--- a/.sqlx/query-cef68a830ecef3ff486ad5c4a82edf67c7bf0917356a564acb7d2f0e8fded674.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calls SET channel_id = NULL, meeting_id = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "cef68a830ecef3ff486ad5c4a82edf67c7bf0917356a564acb7d2f0e8fded674"
-}
diff --git a/.sqlx/query-cf56b7fe06552a170266462ef0645043a7dc11b998140b715fec5a532486872c.json b/.sqlx/query-cf56b7fe06552a170266462ef0645043a7dc11b998140b715fec5a532486872c.json
deleted file mode 100644
index a38ba710bc..0000000000
--- a/.sqlx/query-cf56b7fe06552a170266462ef0645043a7dc11b998140b715fec5a532486872c.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT (SELECT COUNT(*) FROM database_entities)\n + (SELECT COUNT(*) FROM entity_access) AS \"count!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "cf56b7fe06552a170266462ef0645043a7dc11b998140b715fec5a532486872c"
-}
diff --git a/.sqlx/query-cfd3ab7c022a44b5a2b497ddfe4b09fd5caa22e941d3a83791010085952d1b1a.json b/.sqlx/query-cfd3ab7c022a44b5a2b497ddfe4b09fd5caa22e941d3a83791010085952d1b1a.json
deleted file mode 100644
index 51b20313f8..0000000000
--- a/.sqlx/query-cfd3ab7c022a44b5a2b497ddfe4b09fd5caa22e941d3a83791010085952d1b1a.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_message_labels (message_id, label_id) SELECT id, $2 FROM email_messages WHERE thread_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "cfd3ab7c022a44b5a2b497ddfe4b09fd5caa22e941d3a83791010085952d1b1a"
-}
diff --git a/.sqlx/query-d01018c61d1f99729dd1cf82a43a4a32e9122985840fdfe08029196902255122.json b/.sqlx/query-d01018c61d1f99729dd1cf82a43a4a32e9122985840fdfe08029196902255122.json
deleted file mode 100644
index 051a398f38..0000000000
--- a/.sqlx/query-d01018c61d1f99729dd1cf82a43a4a32e9122985840fdfe08029196902255122.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"SharePermission\" (id) VALUES ($1)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "d01018c61d1f99729dd1cf82a43a4a32e9122985840fdfe08029196902255122"
-}
diff --git a/.sqlx/query-d0538df2f14368486385a50e250cc59f96e560c7f2b3e52aec9414af02f2b10a.json b/.sqlx/query-d0538df2f14368486385a50e250cc59f96e560c7f2b3e52aec9414af02f2b10a.json
deleted file mode 100644
index 09291f5e50..0000000000
--- a/.sqlx/query-d0538df2f14368486385a50e250cc59f96e560c7f2b3e52aec9414af02f2b10a.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) AS \"count!\" FROM harness_tokens WHERE revoked_at IS NULL",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "d0538df2f14368486385a50e250cc59f96e560c7f2b3e52aec9414af02f2b10a"
-}
diff --git a/.sqlx/query-d08cea9c8ce158f5d2dae74eee59b3b7d6c52b6fc8135ef906260893b094652b.json b/.sqlx/query-d08cea9c8ce158f5d2dae74eee59b3b7d6c52b6fc8135ef906260893b094652b.json
deleted file mode 100644
index c199999363..0000000000
--- a/.sqlx/query-d08cea9c8ce158f5d2dae74eee59b3b7d6c52b6fc8135ef906260893b094652b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email, macro_user_id) VALUES ($1, $1, $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d08cea9c8ce158f5d2dae74eee59b3b7d6c52b6fc8135ef906260893b094652b"
-}
diff --git a/.sqlx/query-d102f557380f9ffe4922043745bd81c4a3a7c34924af6db91242f12304bf4da6.json b/.sqlx/query-d102f557380f9ffe4922043745bd81c4a3a7c34924af6db91242f12304bf4da6.json
deleted file mode 100644
index d620d09221..0000000000
--- a/.sqlx/query-d102f557380f9ffe4922043745bd81c4a3a7c34924af6db91242f12304bf4da6.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM webhook_delivery WHERE webhook_id = $1 AND event_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "d102f557380f9ffe4922043745bd81c4a3a7c34924af6db91242f12304bf4da6"
-}
diff --git a/.sqlx/query-d1386571f515c3eed3ae97d71660c9d6d76cda1f180f2cd14338729c82a12201.json b/.sqlx/query-d1386571f515c3eed3ae97d71660c9d6d76cda1f180f2cd14338729c82a12201.json
deleted file mode 100644
index 10cf47bc05..0000000000
--- a/.sqlx/query-d1386571f515c3eed3ae97d71660c9d6d76cda1f180f2cd14338729c82a12201.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO webhook (\n id, workspace_id, namespace, name, endpoint_url, signing_secret,\n filters, status, is_valid, created_by_user_id, deleted_at\n )\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Text",
- "Jsonb",
- "Text",
- "Bool",
- "Text",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "d1386571f515c3eed3ae97d71660c9d6d76cda1f180f2cd14338729c82a12201"
-}
diff --git a/.sqlx/query-d14d902edcd7cc7f630777c955c874cf78cd17eadd87b0576fc74c3eaa334f78.json b/.sqlx/query-d14d902edcd7cc7f630777c955c874cf78cd17eadd87b0576fc74c3eaa334f78.json
deleted file mode 100644
index 53c5bb60ce..0000000000
--- a/.sqlx/query-d14d902edcd7cc7f630777c955c874cf78cd17eadd87b0576fc74c3eaa334f78.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH replica AS (\n INSERT INTO harness_replica (id, last_heartbeat_at)\n VALUES ($2, now())\n ON CONFLICT (id) DO UPDATE SET last_heartbeat_at = now()\n )\n UPDATE agent_session\n SET manager_replica_id = $2,\n manager_fence = manager_fence + 1,\n modified_at = now()\n WHERE id = $1\n AND (\n manager_replica_id IS NULL\n OR manager_replica_id = $2\n OR NOT EXISTS (\n SELECT 1 FROM harness_replica live\n WHERE live.id = agent_session.manager_replica_id\n AND live.last_heartbeat_at > now() - make_interval(secs => $3)\n AND live.draining_at IS NULL\n )\n )\n RETURNING manager_fence\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "manager_fence",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Float8"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "d14d902edcd7cc7f630777c955c874cf78cd17eadd87b0576fc74c3eaa334f78"
-}
diff --git a/.sqlx/query-d17c1df5dfcdd5efd7024810961350e86dd88214e54bd428e992d602f25a7b18.json b/.sqlx/query-d17c1df5dfcdd5efd7024810961350e86dd88214e54bd428e992d602f25a7b18.json
deleted file mode 100644
index 92917b2e64..0000000000
--- a/.sqlx/query-d17c1df5dfcdd5efd7024810961350e86dd88214e54bd428e992d602f25a7b18.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE ai_financial_invocation SET request = '{}'::jsonb WHERE invocation_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d17c1df5dfcdd5efd7024810961350e86dd88214e54bd428e992d602f25a7b18"
-}
diff --git a/.sqlx/query-d1a6b2b870e158988c48aa0ba123edd22c48f2ab1de91cc6c7a62230fa989d6b.json b/.sqlx/query-d1a6b2b870e158988c48aa0ba123edd22c48f2ab1de91cc6c7a62230fa989d6b.json
deleted file mode 100644
index 54d0b3385f..0000000000
--- a/.sqlx/query-d1a6b2b870e158988c48aa0ba123edd22c48f2ab1de91cc6c7a62230fa989d6b.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "WITH storage AS (INSERT INTO databases (id) VALUES ($1) RETURNING id)\n INSERT INTO database_entities (database_id, name, user_id) SELECT id, 'db', $2 FROM storage",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "d1a6b2b870e158988c48aa0ba123edd22c48f2ab1de91cc6c7a62230fa989d6b"
-}
diff --git a/.sqlx/query-d2408d7cca5a71f14325af6e58c42cc70cd7ec651701f49573c944f0a1610213.json b/.sqlx/query-d2408d7cca5a71f14325af6e58c42cc70cd7ec651701f49573c944f0a1610213.json
deleted file mode 100644
index 0191a1ac91..0000000000
--- a/.sqlx/query-d2408d7cca5a71f14325af6e58c42cc70cd7ec651701f49573c944f0a1610213.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT current_setting('work_mem')",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "current_setting",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "d2408d7cca5a71f14325af6e58c42cc70cd7ec651701f49573c944f0a1610213"
-}
diff --git a/.sqlx/query-d2436d56842caa18e8b58e18c40a20a428e76153260009a757c6aefa4f6a4ce3.json b/.sqlx/query-d2436d56842caa18e8b58e18c40a20a428e76153260009a757c6aefa4f6a4ce3.json
deleted file mode 100644
index bc47dc3549..0000000000
--- a/.sqlx/query-d2436d56842caa18e8b58e18c40a20a428e76153260009a757c6aefa4f6a4ce3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"Document\" (id, name, owner, \"fileType\")\n VALUES ($1, 'Empty Test Document', 'macro|[email protected]', 'pdf')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "d2436d56842caa18e8b58e18c40a20a428e76153260009a757c6aefa4f6a4ce3"
-}
diff --git a/.sqlx/query-d33c134eba8107a87fe05325e03c3c5f66d6e5beb40989427ba31b117fbb6dae.json b/.sqlx/query-d33c134eba8107a87fe05325e03c3c5f66d6e5beb40989427ba31b117fbb6dae.json
deleted file mode 100644
index 1d932b2739..0000000000
--- a/.sqlx/query-d33c134eba8107a87fe05325e03c3c5f66d6e5beb40989427ba31b117fbb6dae.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM comms_channels",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "d33c134eba8107a87fe05325e03c3c5f66d6e5beb40989427ba31b117fbb6dae"
-}
diff --git a/.sqlx/query-d390c2e9563c62e31a26c4797b1831a97429bf181bacab118ff2b99ee58d1e61.json b/.sqlx/query-d390c2e9563c62e31a26c4797b1831a97429bf181bacab118ff2b99ee58d1e61.json
deleted file mode 100644
index 74ce3111b4..0000000000
--- a/.sqlx/query-d390c2e9563c62e31a26c4797b1831a97429bf181bacab118ff2b99ee58d1e61.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM comms_channel_participants WHERE channel_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "d390c2e9563c62e31a26c4797b1831a97429bf181bacab118ff2b99ee58d1e61"
-}
diff --git a/.sqlx/query-d3d1bad73ec1c3b43f70b469b0f9008c199d81c3730ec79cbd68266c9f5ebb42.json b/.sqlx/query-d3d1bad73ec1c3b43f70b469b0f9008c199d81c3730ec79cbd68266c9f5ebb42.json
deleted file mode 100644
index d63241ee16..0000000000
--- a/.sqlx/query-d3d1bad73ec1c3b43f70b469b0f9008c199d81c3730ec79cbd68266c9f5ebb42.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO agent_session_log (id, agent_session_id, user_id, direction, content)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING created_at\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Text",
- "Jsonb"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "d3d1bad73ec1c3b43f70b469b0f9008c199d81c3730ec79cbd68266c9f5ebb42"
-}
diff --git a/.sqlx/query-d3e2b4f0a9136b8cc8c8ffc7cd63db82ba5eb2ba4d9d3a6e05f0618edf0292e7.json b/.sqlx/query-d3e2b4f0a9136b8cc8c8ffc7cd63db82ba5eb2ba4d9d3a6e05f0618edf0292e7.json
deleted file mode 100644
index 9ace4c7c41..0000000000
--- a/.sqlx/query-d3e2b4f0a9136b8cc8c8ffc7cd63db82ba5eb2ba4d9d3a6e05f0618edf0292e7.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*)::bigint AS \"count!\" FROM ai_overage_charge WHERE user_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "d3e2b4f0a9136b8cc8c8ffc7cd63db82ba5eb2ba4d9d3a6e05f0618edf0292e7"
-}
diff --git a/.sqlx/query-d41ddfbac9ee4f0aa4bd6f29c8b06b65eb1447587a1bc0063a4ad6166108f8f9.json b/.sqlx/query-d41ddfbac9ee4f0aa4bd6f29c8b06b65eb1447587a1bc0063a4ad6166108f8f9.json
deleted file mode 100644
index 63489d49ee..0000000000
--- a/.sqlx/query-d41ddfbac9ee4f0aa4bd6f29c8b06b65eb1447587a1bc0063a4ad6166108f8f9.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"SharePermission\" (id) VALUES ('initialized-session')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "d41ddfbac9ee4f0aa4bd6f29c8b06b65eb1447587a1bc0063a4ad6166108f8f9"
-}
diff --git a/.sqlx/query-d5d3a3f46f7cf1a9a6ab4bbd5df9dc1e75f5deddcf822ba1f2fb83169f4837ff.json b/.sqlx/query-d5d3a3f46f7cf1a9a6ab4bbd5df9dc1e75f5deddcf822ba1f2fb83169f4837ff.json
deleted file mode 100644
index b6518b89b5..0000000000
--- a/.sqlx/query-d5d3a3f46f7cf1a9a6ab4bbd5df9dc1e75f5deddcf822ba1f2fb83169f4837ff.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM \"User\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "d5d3a3f46f7cf1a9a6ab4bbd5df9dc1e75f5deddcf822ba1f2fb83169f4837ff"
-}
diff --git a/.sqlx/query-d5eb58c854011331a2fd160bc618f65cb4e0202a434e459c8e1deb3c4ee09a48.json b/.sqlx/query-d5eb58c854011331a2fd160bc618f65cb4e0202a434e459c8e1deb3c4ee09a48.json
deleted file mode 100644
index fd1b7ca01b..0000000000
--- a/.sqlx/query-d5eb58c854011331a2fd160bc618f65cb4e0202a434e459c8e1deb3c4ee09a48.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT id\n FROM \"Document\"\n WHERE id = ANY($1)\n ORDER BY id\n FOR UPDATE\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "TextArray"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "d5eb58c854011331a2fd160bc618f65cb4e0202a434e459c8e1deb3c4ee09a48"
-}
diff --git a/.sqlx/query-d610b4b3200be51f79986d70f932e78ffdc7a6bbef7f6c55481d684009002f63.json b/.sqlx/query-d610b4b3200be51f79986d70f932e78ffdc7a6bbef7f6c55481d684009002f63.json
deleted file mode 100644
index fc4779206d..0000000000
--- a/.sqlx/query-d610b4b3200be51f79986d70f932e78ffdc7a6bbef7f6c55481d684009002f63.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT source_type::text AS \"source_type!\", source_id,\n access_level::text AS \"access_level!\"\n FROM entity_access\n WHERE entity_id::text = $1 AND granted_from_project_id IS NULL\n ORDER BY source_type::text, source_id\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "source_type!",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "source_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "access_level!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null,
- false,
- null
- ]
- },
- "hash": "d610b4b3200be51f79986d70f932e78ffdc7a6bbef7f6c55481d684009002f63"
-}
diff --git a/.sqlx/query-d6a5674577c2af2e7d97a655029ffeb635dacfd02e08cb5f018c65913ff994b3.json b/.sqlx/query-d6a5674577c2af2e7d97a655029ffeb635dacfd02e08cb5f018c65913ff994b3.json
deleted file mode 100644
index 34c4dd6d25..0000000000
--- a/.sqlx/query-d6a5674577c2af2e7d97a655029ffeb635dacfd02e08cb5f018c65913ff994b3.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO ai_usage (id, feature, user_id, model, input_tokens, output_tokens)\n VALUES ($1, 'chat', $2, $3, 1000000, 0)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "d6a5674577c2af2e7d97a655029ffeb635dacfd02e08cb5f018c65913ff994b3"
-}
diff --git a/.sqlx/query-d7254f05e4df78081e857ad99eefdf8477002e1f87e23d8c0d4e5021b1fa0430.json b/.sqlx/query-d7254f05e4df78081e857ad99eefdf8477002e1f87e23d8c0d4e5021b1fa0430.json
deleted file mode 100644
index 927d886266..0000000000
--- a/.sqlx/query-d7254f05e4df78081e857ad99eefdf8477002e1f87e23d8c0d4e5021b1fa0430.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE scheduled_action SET owner = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "d7254f05e4df78081e857ad99eefdf8477002e1f87e23d8c0d4e5021b1fa0430"
-}
diff --git a/.sqlx/query-d76eb0e4430d876fc7e175a16fa3b88615d4627f82bde6608de9194c367e6a7d.json b/.sqlx/query-d76eb0e4430d876fc7e175a16fa3b88615d4627f82bde6608de9194c367e6a7d.json
deleted file mode 100644
index 58b79f1d5c..0000000000
--- a/.sqlx/query-d76eb0e4430d876fc7e175a16fa3b88615d4627f82bde6608de9194c367e6a7d.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n VALUES ($1, 'database', $3, 'user', 'view'),\n ($1, 'database', $4, 'team', 'edit'),\n ($1, 'chat', $3, 'user', 'owner'),\n ($2, 'database', $3, 'user', 'owner')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "d76eb0e4430d876fc7e175a16fa3b88615d4627f82bde6608de9194c367e6a7d"
-}
diff --git a/.sqlx/query-d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491.json b/.sqlx/query-d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491.json
deleted file mode 100644
index 43dbb6e867..0000000000
--- a/.sqlx/query-d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM ai_billing_usage_observation",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "d81a0f98a2299337971e33f3299709237742b6be8c777181f54e2c056d9c3491"
-}
diff --git a/.sqlx/query-d82233b2b97a64be5dfbfe4ddb5bf9c36cf8516279191ffac82df02b95cb3524.json b/.sqlx/query-d82233b2b97a64be5dfbfe4ddb5bf9c36cf8516279191ffac82df02b95cb3524.json
deleted file mode 100644
index 58d59eb1bf..0000000000
--- a/.sqlx/query-d82233b2b97a64be5dfbfe4ddb5bf9c36cf8516279191ffac82df02b95cb3524.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, owner_id, channel_type, created_at) VALUES ($1, 'macro|[email protected]', 'direct_message', $2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "d82233b2b97a64be5dfbfe4ddb5bf9c36cf8516279191ffac82df02b95cb3524"
-}
diff --git a/.sqlx/query-d97a72359e8b3cd8601e2d017ee6bee90e55bdcf2e51e8b4bcc8d23b26301eee.json b/.sqlx/query-d97a72359e8b3cd8601e2d017ee6bee90e55bdcf2e51e8b4bcc8d23b26301eee.json
deleted file mode 100644
index 85cc9a5328..0000000000
--- a/.sqlx/query-d97a72359e8b3cd8601e2d017ee6bee90e55bdcf2e51e8b4bcc8d23b26301eee.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channel_participants (channel_id, user_id, role, left_at) VALUES ($1, 'macro|[email protected]', 'member', NOW())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "d97a72359e8b3cd8601e2d017ee6bee90e55bdcf2e51e8b4bcc8d23b26301eee"
-}
diff --git a/.sqlx/query-da3817408f1d38bf8ed5eda805e205068b651e3f93655552fd942ad5b2e19aef.json b/.sqlx/query-da3817408f1d38bf8ed5eda805e205068b651e3f93655552fd942ad5b2e19aef.json
deleted file mode 100644
index 5e1ea242e4..0000000000
--- a/.sqlx/query-da3817408f1d38bf8ed5eda805e205068b651e3f93655552fd942ad5b2e19aef.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO notification(id, notification_event_type, event_item_type, event_item_id, service_sender, metadata) VALUES ($1, 'test', $2, $3, 'test', $4)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Jsonb"
- ]
- },
- "nullable": []
- },
- "hash": "da3817408f1d38bf8ed5eda805e205068b651e3f93655552fd942ad5b2e19aef"
-}
diff --git a/.sqlx/query-daa0bc442d41e913c848192b36d41aebaebab9284b4a3e5f01c28259003653af.json b/.sqlx/query-daa0bc442d41e913c848192b36d41aebaebab9284b4a3e5f01c28259003653af.json
deleted file mode 100644
index 0a709b4a62..0000000000
--- a/.sqlx/query-daa0bc442d41e913c848192b36d41aebaebab9284b4a3e5f01c28259003653af.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE harnesses SET last_disconnected_at = now() + interval '1 second'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "daa0bc442d41e913c848192b36d41aebaebab9284b4a3e5f01c28259003653af"
-}
diff --git a/.sqlx/query-dadeb0693a2e5cb939f4bda49b67a6b7823897cc5fe852c77070ae7e8fe8f2a1.json b/.sqlx/query-dadeb0693a2e5cb939f4bda49b67a6b7823897cc5fe852c77070ae7e8fe8f2a1.json
deleted file mode 100644
index 7d11059f6a..0000000000
--- a/.sqlx/query-dadeb0693a2e5cb939f4bda49b67a6b7823897cc5fe852c77070ae7e8fe8f2a1.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS (SELECT 1 FROM email_messages WHERE id = $1) AS \"exists!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "dadeb0693a2e5cb939f4bda49b67a6b7823897cc5fe852c77070ae7e8fe8f2a1"
-}
diff --git a/.sqlx/query-db70624d99935d61fe910e1d77fda95bedd2d3b707369826002ba76ce84ed644.json b/.sqlx/query-db70624d99935d61fe910e1d77fda95bedd2d3b707369826002ba76ce84ed644.json
deleted file mode 100644
index db85245593..0000000000
--- a/.sqlx/query-db70624d99935d61fe910e1d77fda95bedd2d3b707369826002ba76ce84ed644.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM entity_properties WHERE property_definition_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "db70624d99935d61fe910e1d77fda95bedd2d3b707369826002ba76ce84ed644"
-}
diff --git a/.sqlx/query-dc2ec6a135cda3f8dba621e94607fef4e969871d201ff20c7fc49fbfdc083643.json b/.sqlx/query-dc2ec6a135cda3f8dba621e94607fef4e969871d201ff20c7fc49fbfdc083643.json
deleted file mode 100644
index bddc44d156..0000000000
--- a/.sqlx/query-dc2ec6a135cda3f8dba621e94607fef4e969871d201ff20c7fc49fbfdc083643.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET content = 'live edit', edited_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "dc2ec6a135cda3f8dba621e94607fef4e969871d201ff20c7fc49fbfdc083643"
-}
diff --git a/.sqlx/query-dccb25443a931c517f20948f076aa52bad64d3401182432fde55bbad8f75f921.json b/.sqlx/query-dccb25443a931c517f20948f076aa52bad64d3401182432fde55bbad8f75f921.json
deleted file mode 100644
index f2a40c7f09..0000000000
--- a/.sqlx/query-dccb25443a931c517f20948f076aa52bad64d3401182432fde55bbad8f75f921.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_message_threads",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "dccb25443a931c517f20948f076aa52bad64d3401182432fde55bbad8f75f921"
-}
diff --git a/.sqlx/query-dcf98f09f78e496eb6cd6c4d69b8eebaa80454db87d814f180de9bcf6dff4c31.json b/.sqlx/query-dcf98f09f78e496eb6cd6c4d69b8eebaa80454db87d814f180de9bcf6dff4c31.json
deleted file mode 100644
index 705c576a92..0000000000
--- a/.sqlx/query-dcf98f09f78e496eb6cd6c4d69b8eebaa80454db87d814f180de9bcf6dff4c31.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM entity_access WHERE entity_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "dcf98f09f78e496eb6cd6c4d69b8eebaa80454db87d814f180de9bcf6dff4c31"
-}
diff --git a/.sqlx/query-dcfc09b1d22a1ecb939dac75303533d0a2a581f31424d0632070bfb0f0dafbd5.json b/.sqlx/query-dcfc09b1d22a1ecb939dac75303533d0a2a581f31424d0632070bfb0f0dafbd5.json
deleted file mode 100644
index 3349cc433d..0000000000
--- a/.sqlx/query-dcfc09b1d22a1ecb939dac75303533d0a2a581f31424d0632070bfb0f0dafbd5.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT email FROM team_joined_macro_email WHERE team_id = $1 ORDER BY email",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "email",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "dcfc09b1d22a1ecb939dac75303533d0a2a581f31424d0632070bfb0f0dafbd5"
-}
diff --git a/.sqlx/query-dd0a0070028b5b15f0144c0defd4e36d83132d0fe88bbc6de1c4e7ba39b590a0.json b/.sqlx/query-dd0a0070028b5b15f0144c0defd4e36d83132d0fe88bbc6de1c4e7ba39b590a0.json
deleted file mode 100644
index 87eb233d88..0000000000
--- a/.sqlx/query-dd0a0070028b5b15f0144c0defd4e36d83132d0fe88bbc6de1c4e7ba39b590a0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE database_rows SET position = $2 WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "dd0a0070028b5b15f0144c0defd4e36d83132d0fe88bbc6de1c4e7ba39b590a0"
-}
diff --git a/.sqlx/query-dd6f9906f208dc2ef01da6cacae56264e30129ae8e309da34f7a1ad0a6b20e38.json b/.sqlx/query-dd6f9906f208dc2ef01da6cacae56264e30129ae8e309da34f7a1ad0a6b20e38.json
deleted file mode 100644
index 109040a2f1..0000000000
--- a/.sqlx/query-dd6f9906f208dc2ef01da6cacae56264e30129ae8e309da34f7a1ad0a6b20e38.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT access_level AS \"access_level: AccessLevel\" FROM entity_access\n WHERE entity_id = $1 AND entity_type = 'agent_session' AND source_id = $2\n AND source_type = 'channel' AND granted_from_project_id IS NULL",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "access_level: AccessLevel",
- "type_info": {
- "Custom": {
- "name": "\"AccessLevel\"",
- "kind": {
- "Enum": [
- "view",
- "comment",
- "edit",
- "owner"
- ]
- }
- }
- }
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "dd6f9906f208dc2ef01da6cacae56264e30129ae8e309da34f7a1ad0a6b20e38"
-}
diff --git a/.sqlx/query-dd70275d1f21a505bddab63286b1e7a031aaa7d0be090d1c9e74430de679f478.json b/.sqlx/query-dd70275d1f21a505bddab63286b1e7a031aaa7d0be090d1c9e74430de679f478.json
deleted file mode 100644
index caf2cf07d7..0000000000
--- a/.sqlx/query-dd70275d1f21a505bddab63286b1e7a031aaa7d0be090d1c9e74430de679f478.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET deleted_at = NULL, content = 'edited' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "dd70275d1f21a505bddab63286b1e7a031aaa7d0be090d1c9e74430de679f478"
-}
diff --git a/.sqlx/query-ddd55650f9c7be80c0b4d815a4512ec66e0cbd8ca43ae14b5c8337f83be81ee5.json b/.sqlx/query-ddd55650f9c7be80c0b4d815a4512ec66e0cbd8ca43ae14b5c8337f83be81ee5.json
deleted file mode 100644
index bbf90bd407..0000000000
--- a/.sqlx/query-ddd55650f9c7be80c0b4d815a4512ec66e0cbd8ca43ae14b5c8337f83be81ee5.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO crm_contacts(id, company_id, email, first_interaction, last_interaction) VALUES ($1, $2, '[email protected]', now(), now())",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ddd55650f9c7be80c0b4d815a4512ec66e0cbd8ca43ae14b5c8337f83be81ee5"
-}
diff --git a/.sqlx/query-decf8e840e13bfe975576b35ff48779f7e243d461d37cbe0fff1678955a988bb.json b/.sqlx/query-decf8e840e13bfe975576b35ff48779f7e243d461d37cbe0fff1678955a988bb.json
deleted file mode 100644
index f226e79a6b..0000000000
--- a/.sqlx/query-decf8e840e13bfe975576b35ff48779f7e243d461d37cbe0fff1678955a988bb.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE bots SET deleted_at = now()",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "decf8e840e13bfe975576b35ff48779f7e243d461d37cbe0fff1678955a988bb"
-}
diff --git a/.sqlx/query-dee4c075f75a05b8a209c0e771d9e4471485983dfa7e07ddf3c03803bb217fe1.json b/.sqlx/query-dee4c075f75a05b8a209c0e771d9e4471485983dfa7e07ddf3c03803bb217fe1.json
deleted file mode 100644
index cb54490e5d..0000000000
--- a/.sqlx/query-dee4c075f75a05b8a209c0e771d9e4471485983dfa7e07ddf3c03803bb217fe1.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET content = 'live', edited_at = now() WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "dee4c075f75a05b8a209c0e771d9e4471485983dfa7e07ddf3c03803bb217fe1"
-}
diff --git a/.sqlx/query-e02aeee47ef3a5a376c3154c98b066a7e77d326248f2a647b4a8e87fe32fc2b1.json b/.sqlx/query-e02aeee47ef3a5a376c3154c98b066a7e77d326248f2a647b4a8e87fe32fc2b1.json
deleted file mode 100644
index 1d7fba0fb2..0000000000
--- a/.sqlx/query-e02aeee47ef3a5a376c3154c98b066a7e77d326248f2a647b4a8e87fe32fc2b1.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM slack_import_message_reference",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "e02aeee47ef3a5a376c3154c98b066a7e77d326248f2a647b4a8e87fe32fc2b1"
-}
diff --git a/.sqlx/query-e154e97b6351beaf07d91407a01e5040dcbfcd1992ec71924771c7840c22b18a.json b/.sqlx/query-e154e97b6351beaf07d91407a01e5040dcbfcd1992ec71924771c7840c22b18a.json
deleted file mode 100644
index f91e81d7c0..0000000000
--- a/.sqlx/query-e154e97b6351beaf07d91407a01e5040dcbfcd1992ec71924771c7840c22b18a.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, owner_id, name) VALUES ($1, $2, $3)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e154e97b6351beaf07d91407a01e5040dcbfcd1992ec71924771c7840c22b18a"
-}
diff --git a/.sqlx/query-e2267d44c0767ecc833984a98488623ffca5cdd79dd448f66196db389906e8d5.json b/.sqlx/query-e2267d44c0767ecc833984a98488623ffca5cdd79dd448f66196db389906e8d5.json
deleted file mode 100644
index 9b23a0572f..0000000000
--- a/.sqlx/query-e2267d44c0767ecc833984a98488623ffca5cdd79dd448f66196db389906e8d5.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO scheduled_action\n (id, owner, name, schedule, kind, timezone, task, next_run_at, enabled)\n VALUES ($1, $2, 'legacy', $3, 'Agent', 'UTC', $4, $5, true)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Jsonb",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "e2267d44c0767ecc833984a98488623ffca5cdd79dd448f66196db389906e8d5"
-}
diff --git a/.sqlx/query-e233b0f2888b75bd70f9b6ecc11593c8be6cf5d43c234873dbc6f3b3296c8f00.json b/.sqlx/query-e233b0f2888b75bd70f9b6ecc11593c8be6cf5d43c234873dbc6f3b3296c8f00.json
deleted file mode 100644
index a9fc472b29..0000000000
--- a/.sqlx/query-e233b0f2888b75bd70f9b6ecc11593c8be6cf5d43c234873dbc6f3b3296c8f00.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT share_permission_id FROM calls WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "share_permission_id",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "e233b0f2888b75bd70f9b6ecc11593c8be6cf5d43c234873dbc6f3b3296c8f00"
-}
diff --git a/.sqlx/query-e276e53d1b162dc479efe8062a1ac365c3400b7c47f5975e1dc8649feb514ed2.json b/.sqlx/query-e276e53d1b162dc479efe8062a1ac365c3400b7c47f5975e1dc8649feb514ed2.json
deleted file mode 100644
index 9330bbede7..0000000000
--- a/.sqlx/query-e276e53d1b162dc479efe8062a1ac365c3400b7c47f5975e1dc8649feb514ed2.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $2, $3)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e276e53d1b162dc479efe8062a1ac365c3400b7c47f5975e1dc8649feb514ed2"
-}
diff --git a/.sqlx/query-e27d39c398b1710d5ccc81e7e17c23418e701af3fb3eaa1c2faf53d0d51af889.json b/.sqlx/query-e27d39c398b1710d5ccc81e7e17c23418e701af3fb3eaa1c2faf53d0d51af889.json
deleted file mode 100644
index 4a38c85d69..0000000000
--- a/.sqlx/query-e27d39c398b1710d5ccc81e7e17c23418e701af3fb3eaa1c2faf53d0d51af889.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE \"Document\" SET \"fileType\" = 'spreadsheet' WHERE id = 'message-doc-a'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "e27d39c398b1710d5ccc81e7e17c23418e701af3fb3eaa1c2faf53d0d51af889"
-}
diff --git a/.sqlx/query-e2a9119ecdf92ee9c1afff509209afb89788106d0bd3793444757df3e5013a01.json b/.sqlx/query-e2a9119ecdf92ee9c1afff509209afb89788106d0bd3793444757df3e5013a01.json
deleted file mode 100644
index ec0cd132c5..0000000000
--- a/.sqlx/query-e2a9119ecdf92ee9c1afff509209afb89788106d0bd3793444757df3e5013a01.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO harnesses (id, name, owner_user_id, team_id, created_by)\n VALUES ($1, 'test harness', $2, $3, $4)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e2a9119ecdf92ee9c1afff509209afb89788106d0bd3793444757df3e5013a01"
-}
diff --git a/.sqlx/query-e354f41fcd88a03d4522e7819087d30035e5395628c815eee057693b49f44509.json b/.sqlx/query-e354f41fcd88a03d4522e7819087d30035e5395628c815eee057693b49f44509.json
deleted file mode 100644
index fcf06dacdd..0000000000
--- a/.sqlx/query-e354f41fcd88a03d4522e7819087d30035e5395628c815eee057693b49f44509.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_messages SET deleted_at = now() WHERE parent_entity_type = 'channel' AND parent_entity_id = $1::uuid::text",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "e354f41fcd88a03d4522e7819087d30035e5395628c815eee057693b49f44509"
-}
diff --git a/.sqlx/query-e35d7fe5ba28b3ef58d279f13afb0a24cb9607fc6c8f73d8860b6124086ad031.json b/.sqlx/query-e35d7fe5ba28b3ef58d279f13afb0a24cb9607fc6c8f73d8860b6124086ad031.json
deleted file mode 100644
index 7ae3ad1427..0000000000
--- a/.sqlx/query-e35d7fe5ba28b3ef58d279f13afb0a24cb9607fc6c8f73d8860b6124086ad031.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT body_html_sanitized, body_text FROM email_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "body_html_sanitized",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "body_text",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true
- ]
- },
- "hash": "e35d7fe5ba28b3ef58d279f13afb0a24cb9607fc6c8f73d8860b6124086ad031"
-}
diff --git a/.sqlx/query-e3bc02b0885c334a45c6a33adac61e20b294499a7b56fee8a490301633369002.json b/.sqlx/query-e3bc02b0885c334a45c6a33adac61e20b294499a7b56fee8a490301633369002.json
deleted file mode 100644
index 0fb467fe59..0000000000
--- a/.sqlx/query-e3bc02b0885c334a45c6a33adac61e20b294499a7b56fee8a490301633369002.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level) VALUES ($1, 'call', $2, $3::text::entity_access_source_type, 'view')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e3bc02b0885c334a45c6a33adac61e20b294499a7b56fee8a490301633369002"
-}
diff --git a/.sqlx/query-e43bc62321b365269426586b59760811d4c0e88d3b95e761fba7771edb8f57bc.json b/.sqlx/query-e43bc62321b365269426586b59760811d4c0e88d3b95e761fba7771edb8f57bc.json
deleted file mode 100644
index 97d0523ac4..0000000000
--- a/.sqlx/query-e43bc62321b365269426586b59760811d4c0e88d3b95e761fba7771edb8f57bc.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM entity_access WHERE entity_id = $1 AND access_level = 'owner'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "e43bc62321b365269426586b59760811d4c0e88d3b95e761fba7771edb8f57bc"
-}
diff --git a/.sqlx/query-e44bd90bfad892091b1ca8d4e1f0302d470e21754b9c26bcb502ab46ddf1f449.json b/.sqlx/query-e44bd90bfad892091b1ca8d4e1f0302d470e21754b9c26bcb502ab46ddf1f449.json
deleted file mode 100644
index 8921a19a69..0000000000
--- a/.sqlx/query-e44bd90bfad892091b1ca8d4e1f0302d470e21754b9c26bcb502ab46ddf1f449.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO migrated_comment_id (comment_id, message_id, document_id) VALUES (12, $1, 'message-doc-a')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "e44bd90bfad892091b1ca8d4e1f0302d470e21754b9c26bcb502ab46ddf1f449"
-}
diff --git a/.sqlx/query-e455ea2b92eaf6a6a7eaf70c459d6ba56f4190ab4490c753e41c31da4c5c4aa8.json b/.sqlx/query-e455ea2b92eaf6a6a7eaf70c459d6ba56f4190ab4490c753e41c31da4c5c4aa8.json
deleted file mode 100644
index bb34828a08..0000000000
--- a/.sqlx/query-e455ea2b92eaf6a6a7eaf70c459d6ba56f4190ab4490c753e41c31da4c5c4aa8.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM action_execution_record",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "e455ea2b92eaf6a6a7eaf70c459d6ba56f4190ab4490c753e41c31da4c5c4aa8"
-}
diff --git a/.sqlx/query-e4b7973901b35028d8ddf8bcac7b93c1b58beecbb2a38a1aa7095210cc311150.json b/.sqlx/query-e4b7973901b35028d8ddf8bcac7b93c1b58beecbb2a38a1aa7095210cc311150.json
deleted file mode 100644
index cf23315619..0000000000
--- a/.sqlx/query-e4b7973901b35028d8ddf8bcac7b93c1b58beecbb2a38a1aa7095210cc311150.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_channels (id, name, channel_type, owner_id) VALUES ($1, 'source', 'private', 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "e4b7973901b35028d8ddf8bcac7b93c1b58beecbb2a38a1aa7095210cc311150"
-}
diff --git a/.sqlx/query-e4e2f979bf0f8b7dccd44a3a63be28fdfe12b11f6e4729cac81428fac6535e0c.json b/.sqlx/query-e4e2f979bf0f8b7dccd44a3a63be28fdfe12b11f6e4729cac81428fac6535e0c.json
deleted file mode 100644
index 83af7187c8..0000000000
--- a/.sqlx/query-e4e2f979bf0f8b7dccd44a3a63be28fdfe12b11f6e4729cac81428fac6535e0c.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT template IS NULL AS \"cleared!\" FROM slack_import_message_reference WHERE job_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "cleared!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "e4e2f979bf0f8b7dccd44a3a63be28fdfe12b11f6e4729cac81428fac6535e0c"
-}
diff --git a/.sqlx/query-e5872d3011fbd489185842b84577939eecf959c75ce9cb649d3bb8582c54529f.json b/.sqlx/query-e5872d3011fbd489185842b84577939eecf959c75ce9cb649d3bb8582c54529f.json
deleted file mode 100644
index 734c912c8a..0000000000
--- a/.sqlx/query-e5872d3011fbd489185842b84577939eecf959c75ce9cb649d3bb8582c54529f.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user_info (macro_user_id, first_name, last_name)\n VALUES ($1, $2, $3)\n ON CONFLICT (macro_user_id) DO UPDATE\n SET first_name = EXCLUDED.first_name, last_name = EXCLUDED.last_name\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e5872d3011fbd489185842b84577939eecf959c75ce9cb649d3bb8582c54529f"
-}
diff --git a/.sqlx/query-e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b.json b/.sqlx/query-e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b.json
deleted file mode 100644
index 82f38da2f6..0000000000
--- a/.sqlx/query-e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SET TRANSACTION ISOLATION LEVEL REPEATABLE READ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "e67fda05dacea7a0b6290e8b69932ad27e5a0dd128af9273d1d6179e60f9ea0b"
-}
diff --git a/.sqlx/query-e70125689debc2ca94cbea8959d80e38d7d0e9b31c0c40843d6a70ed7acd312a.json b/.sqlx/query-e70125689debc2ca94cbea8959d80e38d7d0e9b31c0c40843d6a70ed7acd312a.json
deleted file mode 100644
index 1829e389e8..0000000000
--- a/.sqlx/query-e70125689debc2ca94cbea8959d80e38d7d0e9b31c0c40843d6a70ed7acd312a.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, 'message-test', '[email protected]', 'message-test')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "e70125689debc2ca94cbea8959d80e38d7d0e9b31c0c40843d6a70ed7acd312a"
-}
diff --git a/.sqlx/query-e747ad81c61092baaa02154932db84aaf63c40af65d09e4d4f054077d2833d29.json b/.sqlx/query-e747ad81c61092baaa02154932db84aaf63c40af65d09e4d4f054077d2833d29.json
deleted file mode 100644
index d64b93c725..0000000000
--- a/.sqlx/query-e747ad81c61092baaa02154932db84aaf63c40af65d09e4d4f054077d2833d29.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"User\" (id, email) VALUES ($1, $2) ON CONFLICT (id) DO NOTHING",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e747ad81c61092baaa02154932db84aaf63c40af65d09e4d4f054077d2833d29"
-}
diff --git a/.sqlx/query-e7582dfc1a5a859c0b372847c021ae5ebd9623624fefeec79196782a6f334eec.json b/.sqlx/query-e7582dfc1a5a859c0b372847c021ae5ebd9623624fefeec79196782a6f334eec.json
deleted file mode 100644
index 8093418c67..0000000000
--- a/.sqlx/query-e7582dfc1a5a859c0b372847c021ae5ebd9623624fefeec79196782a6f334eec.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM scheduled_action WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "e7582dfc1a5a859c0b372847c021ae5ebd9623624fefeec79196782a6f334eec"
-}
diff --git a/.sqlx/query-e8a8d00cba328f2d36000ed7e6c7e234f286d9f9b3a8591805459937a1c3aff2.json b/.sqlx/query-e8a8d00cba328f2d36000ed7e6c7e234f286d9f9b3a8591805459937a1c3aff2.json
deleted file mode 100644
index d7a5b93ab1..0000000000
--- a/.sqlx/query-e8a8d00cba328f2d36000ed7e6c7e234f286d9f9b3a8591805459937a1c3aff2.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n VALUES ($1, 'database', $2, 'user', 'edit')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "e8a8d00cba328f2d36000ed7e6c7e234f286d9f9b3a8591805459937a1c3aff2"
-}
diff --git a/.sqlx/query-ea0bc02ec826150584d7d33b6094598f7fd7b556d897fb37ba6d08e38edf536d.json b/.sqlx/query-ea0bc02ec826150584d7d33b6094598f7fd7b556d897fb37ba6d08e38edf536d.json
deleted file mode 100644
index 15ee478ae4..0000000000
--- a/.sqlx/query-ea0bc02ec826150584d7d33b6094598f7fd7b556d897fb37ba6d08e38edf536d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO team_user (user_id, team_id, team_role)\n VALUES ($1, $2, 'member'::team_role)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ea0bc02ec826150584d7d33b6094598f7fd7b556d897fb37ba6d08e38edf536d"
-}
diff --git a/.sqlx/query-ea1966f2a67b47a0a4c713e86148360ade75fce0b032ef5c7b5daec480710c6b.json b/.sqlx/query-ea1966f2a67b47a0a4c713e86148360ade75fce0b032ef5c7b5daec480710c6b.json
deleted file mode 100644
index bd6375f590..0000000000
--- a/.sqlx/query-ea1966f2a67b47a0a4c713e86148360ade75fce0b032ef5c7b5daec480710c6b.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO call_records (id, channel_id, room_name, created_by, started_at, duration_ms, share_permission_id, meeting_id)\n SELECT id, channel_id, room_name, created_by, created_at, 1000, share_permission_id, meeting_id FROM calls WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ea1966f2a67b47a0a4c713e86148360ade75fce0b032ef5c7b5daec480710c6b"
-}
diff --git a/.sqlx/query-eb08b9e4d30641ae932d5a572e4239f5fbc5a471fe5811e6521a2ab157008681.json b/.sqlx/query-eb08b9e4d30641ae932d5a572e4239f5fbc5a471fe5811e6521a2ab157008681.json
deleted file mode 100644
index 57d597d6d2..0000000000
--- a/.sqlx/query-eb08b9e4d30641ae932d5a572e4239f5fbc5a471fe5811e6521a2ab157008681.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO macro_user (id, username, email, stripe_customer_id)\n VALUES ($1, $2, $2, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "eb08b9e4d30641ae932d5a572e4239f5fbc5a471fe5811e6521a2ab157008681"
-}
diff --git a/.sqlx/query-eb0b6e62c6e97efbf5101d16350f2fee54a2547f36db951992e5896ef96481a3.json b/.sqlx/query-eb0b6e62c6e97efbf5101d16350f2fee54a2547f36db951992e5896ef96481a3.json
deleted file mode 100644
index 9e25d849b7..0000000000
--- a/.sqlx/query-eb0b6e62c6e97efbf5101d16350f2fee54a2547f36db951992e5896ef96481a3.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user (id, username, email, stripe_customer_id) VALUES ($1,$2,$2,$2)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "eb0b6e62c6e97efbf5101d16350f2fee54a2547f36db951992e5896ef96481a3"
-}
diff --git a/.sqlx/query-eba001bed3f012a9b5536a865d1dbf5bb3196a757e160895209a2d98db1b45cd.json b/.sqlx/query-eba001bed3f012a9b5536a865d1dbf5bb3196a757e160895209a2d98db1b45cd.json
deleted file mode 100644
index dca549a5b9..0000000000
--- a/.sqlx/query-eba001bed3f012a9b5536a865d1dbf5bb3196a757e160895209a2d98db1b45cd.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SET work_mem = '16MB'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "eba001bed3f012a9b5536a865d1dbf5bb3196a757e160895209a2d98db1b45cd"
-}
diff --git a/.sqlx/query-ebba8e0b0f74d635c5c8a8e47c37b64ea486c0ba825bdd16b011472ea576827f.json b/.sqlx/query-ebba8e0b0f74d635c5c8a8e47c37b64ea486c0ba825bdd16b011472ea576827f.json
deleted file mode 100644
index b68e79c91d..0000000000
--- a/.sqlx/query-ebba8e0b0f74d635c5c8a8e47c37b64ea486c0ba825bdd16b011472ea576827f.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO scheduled_action\n (id, owner, name, kind, task, enabled, trigger_type, event_filters, event_activated_at)\n VALUES ($1, $2, 'event run test', 'Agent', '{}', true, 'events', $3, $4)\n ON CONFLICT DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Jsonb",
- "Timestamptz"
- ]
- },
- "nullable": []
- },
- "hash": "ebba8e0b0f74d635c5c8a8e47c37b64ea486c0ba825bdd16b011472ea576827f"
-}
diff --git a/.sqlx/query-ec6a86191fd9b73e86f19b543e6bc977c5397850c402248fd014ae97f210f5b6.json b/.sqlx/query-ec6a86191fd9b73e86f19b543e6bc977c5397850c402248fd014ae97f210f5b6.json
deleted file mode 100644
index 308196510b..0000000000
--- a/.sqlx/query-ec6a86191fd9b73e86f19b543e6bc977c5397850c402248fd014ae97f210f5b6.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT content, created_at, updated_at, edited_at FROM comms_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "content",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "updated_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "edited_at",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true
- ]
- },
- "hash": "ec6a86191fd9b73e86f19b543e6bc977c5397850c402248fd014ae97f210f5b6"
-}
diff --git a/.sqlx/query-ec6b32a8c746e43fd849c922d059eb904a0411b5a11ae2a3e7ea09c4bf174d5e.json b/.sqlx/query-ec6b32a8c746e43fd849c922d059eb904a0411b5a11ae2a3e7ea09c4bf174d5e.json
deleted file mode 100644
index e2e7f7aeb3..0000000000
--- a/.sqlx/query-ec6b32a8c746e43fd849c922d059eb904a0411b5a11ae2a3e7ea09c4bf174d5e.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT change_id, column_id, kind FROM database_change_columns ORDER BY change_id, kind",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "change_id",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "column_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "kind",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "ec6b32a8c746e43fd849c922d059eb904a0411b5a11ae2a3e7ea09c4bf174d5e"
-}
diff --git a/.sqlx/query-ecbff9fb72d7a078d4be0999ea3877350f0efbd33ddbdcdf33f29e96ed02041a.json b/.sqlx/query-ecbff9fb72d7a078d4be0999ea3877350f0efbd33ddbdcdf33f29e96ed02041a.json
deleted file mode 100644
index be33fc0f08..0000000000
--- a/.sqlx/query-ecbff9fb72d7a078d4be0999ea3877350f0efbd33ddbdcdf33f29e96ed02041a.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT email FROM \"OrganizationInvitation\" WHERE email=$1 AND organization_id = $2",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "email",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Int4"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "ecbff9fb72d7a078d4be0999ea3877350f0efbd33ddbdcdf33f29e96ed02041a"
-}
diff --git a/.sqlx/query-ecc7c047b0576142b51f47f047e5768c4c3f3093b7762a1ffee52e2a53f181f8.json b/.sqlx/query-ecc7c047b0576142b51f47f047e5768c4c3f3093b7762a1ffee52e2a53f181f8.json
deleted file mode 100644
index 517b5059fa..0000000000
--- a/.sqlx/query-ecc7c047b0576142b51f47f047e5768c4c3f3093b7762a1ffee52e2a53f181f8.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"Project\" (\"id\", \"name\", \"userId\")\n VALUES ('p1', 'd', 'macro|[email protected]')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "ecc7c047b0576142b51f47f047e5768c4c3f3093b7762a1ffee52e2a53f181f8"
-}
diff --git a/.sqlx/query-ed1c423836a64765d2943e28f8b12efb3d4df076738e92296dd1598656b13f4d.json b/.sqlx/query-ed1c423836a64765d2943e28f8b12efb3d4df076738e92296dd1598656b13f4d.json
deleted file mode 100644
index 95d4b40c32..0000000000
--- a/.sqlx/query-ed1c423836a64765d2943e28f8b12efb3d4df076738e92296dd1598656b13f4d.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team_user (user_id, team_id, team_role) VALUES ($1, $2, 'admin')\n ON CONFLICT (user_id) DO UPDATE SET team_id = EXCLUDED.team_id",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ed1c423836a64765d2943e28f8b12efb3d4df076738e92296dd1598656b13f4d"
-}
diff --git a/.sqlx/query-ed615756aac4510ac1d99e11f5b15d299db90c1a75d82b726d27043c23ba6abf.json b/.sqlx/query-ed615756aac4510ac1d99e11f5b15d299db90c1a75d82b726d27043c23ba6abf.json
deleted file mode 100644
index cded2dd5ba..0000000000
--- a/.sqlx/query-ed615756aac4510ac1d99e11f5b15d299db90c1a75d82b726d27043c23ba6abf.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n \"macro_user_id\",\n \"email\",\n \"is_verified\"\n FROM \"macro_user_email_verification\"\n WHERE \"macro_user_id\" = $1 AND \"email\" = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "macro_user_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "email",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "is_verified",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false
- ]
- },
- "hash": "ed615756aac4510ac1d99e11f5b15d299db90c1a75d82b726d27043c23ba6abf"
-}
diff --git a/.sqlx/query-edb3749d85688451e8988bd5de13ce7787c0420468511f9ed0cb8f4fb37cd3c0.json b/.sqlx/query-edb3749d85688451e8988bd5de13ce7787c0420468511f9ed0cb8f4fb37cd3c0.json
deleted file mode 100644
index 4bea9a8790..0000000000
--- a/.sqlx/query-edb3749d85688451e8988bd5de13ce7787c0420468511f9ed0cb8f4fb37cd3c0.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT COUNT(*) FROM webhook_delivery",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "edb3749d85688451e8988bd5de13ce7787c0420468511f9ed0cb8f4fb37cd3c0"
-}
diff --git a/.sqlx/query-edefa1a786af8acc7aec70203f3fc41661123b2be3a6dba1337c21d842c85dcc.json b/.sqlx/query-edefa1a786af8acc7aec70203f3fc41661123b2be3a6dba1337c21d842c85dcc.json
deleted file mode 100644
index 6339b34c2d..0000000000
--- a/.sqlx/query-edefa1a786af8acc7aec70203f3fc41661123b2be3a6dba1337c21d842c85dcc.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT subject, body_text, has_attachments FROM email_messages WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "subject",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "body_text",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "has_attachments",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- true,
- true,
- false
- ]
- },
- "hash": "edefa1a786af8acc7aec70203f3fc41661123b2be3a6dba1337c21d842c85dcc"
-}
diff --git a/.sqlx/query-ee7ad3516f1d1efcc66e35a611ba9b4c4ee03a0ec65c132427563e5e679047ca.json b/.sqlx/query-ee7ad3516f1d1efcc66e35a611ba9b4c4ee03a0ec65c132427563e5e679047ca.json
deleted file mode 100644
index a0ec0b6404..0000000000
--- a/.sqlx/query-ee7ad3516f1d1efcc66e35a611ba9b4c4ee03a0ec65c132427563e5e679047ca.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE calls SET channel_id = NULL WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "ee7ad3516f1d1efcc66e35a611ba9b4c4ee03a0ec65c132427563e5e679047ca"
-}
diff --git a/.sqlx/query-ee89350343f16092d0e364414f2b182eb2c2a8e4823ffbb20f8312c268a4a7dc.json b/.sqlx/query-ee89350343f16092d0e364414f2b182eb2c2a8e4823ffbb20f8312c268a4a7dc.json
deleted file mode 100644
index 94a46342fa..0000000000
--- a/.sqlx/query-ee89350343f16092d0e364414f2b182eb2c2a8e4823ffbb20f8312c268a4a7dc.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT root_id, \"xPct\" AS x FROM \"PdfPlaceableCommentAnchor\" WHERE uuid = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "root_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "x",
- "type_info": "Float8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "ee89350343f16092d0e364414f2b182eb2c2a8e4823ffbb20f8312c268a4a7dc"
-}
diff --git a/.sqlx/query-f06292f93d2ed73cd37308a3dd5fbebbcf68224404eeb093127e8e39b5b24f24.json b/.sqlx/query-f06292f93d2ed73cd37308a3dd5fbebbcf68224404eeb093127e8e39b5b24f24.json
deleted file mode 100644
index 638604143e..0000000000
--- a/.sqlx/query-f06292f93d2ed73cd37308a3dd5fbebbcf68224404eeb093127e8e39b5b24f24.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT count(*) AS \"count!\"\n FROM entity_access\n WHERE entity_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "f06292f93d2ed73cd37308a3dd5fbebbcf68224404eeb093127e8e39b5b24f24"
-}
diff --git a/.sqlx/query-f07c7c14b06831f213fd48fd34dcb05b3fae3ced5e464d75cab227bcc4db6835.json b/.sqlx/query-f07c7c14b06831f213fd48fd34dcb05b3fae3ced5e464d75cab227bcc4db6835.json
deleted file mode 100644
index f55b5927f0..0000000000
--- a/.sqlx/query-f07c7c14b06831f213fd48fd34dcb05b3fae3ced5e464d75cab227bcc4db6835.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT digest(convert_to($1, 'UTF8'), 'sha256')",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "digest",
- "type_info": "Bytea"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "f07c7c14b06831f213fd48fd34dcb05b3fae3ced5e464d75cab227bcc4db6835"
-}
diff --git a/.sqlx/query-f08cd91cb17544945253c4a83c49660e1136e037095cb7d91130f5ce176b5f3b.json b/.sqlx/query-f08cd91cb17544945253c4a83c49660e1136e037095cb7d91130f5ce176b5f3b.json
deleted file mode 100644
index f6603be909..0000000000
--- a/.sqlx/query-f08cd91cb17544945253c4a83c49660e1136e037095cb7d91130f5ce176b5f3b.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS (SELECT 1 FROM email_threads WHERE id = $1) AS \"exists!\"",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "f08cd91cb17544945253c4a83c49660e1136e037095cb7d91130f5ce176b5f3b"
-}
diff --git a/.sqlx/query-f19e1ae90e534281d96af475a3b60f5fd4e8ffd5d34dc3e5bc012784c68726f2.json b/.sqlx/query-f19e1ae90e534281d96af475a3b60f5fd4e8ffd5d34dc3e5bc012784c68726f2.json
deleted file mode 100644
index fbfcc9d70b..0000000000
--- a/.sqlx/query-f19e1ae90e534281d96af475a3b60f5fd4e8ffd5d34dc3e5bc012784c68726f2.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO scheduled_action\n (id, owner, name, kind, task, enabled, trigger_type, schedule, timezone,\n next_run_at, event_filters, event_activated_at, configuration_revision)\n VALUES ($1, $2, 'invalid', 'Agent', '{}', true, $3, $4, $5, $6, $7, $8, $9)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text",
- "Text",
- "Text",
- "Timestamptz",
- "Jsonb",
- "Timestamptz",
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "f19e1ae90e534281d96af475a3b60f5fd4e8ffd5d34dc3e5bc012784c68726f2"
-}
diff --git a/.sqlx/query-f204cb7321ff15dc476c1d781f28a152904633496f272a2529bd2b22789d9830.json b/.sqlx/query-f204cb7321ff15dc476c1d781f28a152904633496f272a2529bd2b22789d9830.json
deleted file mode 100644
index f0097234ff..0000000000
--- a/.sqlx/query-f204cb7321ff15dc476c1d781f28a152904633496f272a2529bd2b22789d9830.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (\n entity_id,\n entity_type,\n source_id,\n source_type,\n access_level\n )\n VALUES ($1, 'project', $2, 'team', $3::text::\"AccessLevel\")\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f204cb7321ff15dc476c1d781f28a152904633496f272a2529bd2b22789d9830"
-}
diff --git a/.sqlx/query-f2beae95c82ea9bbc9afb279a4b9ed66185c11f00d3608919b988ff8c4234c3f.json b/.sqlx/query-f2beae95c82ea9bbc9afb279a4b9ed66185c11f00d3608919b988ff8c4234c3f.json
deleted file mode 100644
index f51cc6b708..0000000000
--- a/.sqlx/query-f2beae95c82ea9bbc9afb279a4b9ed66185c11f00d3608919b988ff8c4234c3f.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_messages SET is_sent = true WHERE thread_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f2beae95c82ea9bbc9afb279a4b9ed66185c11f00d3608919b988ff8c4234c3f"
-}
diff --git a/.sqlx/query-f2c385527feb659c2860c556b9d99c3250384196f47c9d6e07950cfa3e65d614.json b/.sqlx/query-f2c385527feb659c2860c556b9d99c3250384196f47c9d6e07950cfa3e65d614.json
deleted file mode 100644
index 9716d30c0d..0000000000
--- a/.sqlx/query-f2c385527feb659c2860c556b9d99c3250384196f47c9d6e07950cfa3e65d614.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO macro_user_links (primary_macro_id, child_macro_id, link_id) VALUES ('macro|[email protected]', 'macro|[email protected]', $1)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f2c385527feb659c2860c556b9d99c3250384196f47c9d6e07950cfa3e65d614"
-}
diff --git a/.sqlx/query-f308b4c145ee2a10958b9b29e2eba74dcd9741e73a4936c16791dbc0534b1698.json b/.sqlx/query-f308b4c145ee2a10958b9b29e2eba74dcd9741e73a4936c16791dbc0534b1698.json
deleted file mode 100644
index 2837699c0c..0000000000
--- a/.sqlx/query-f308b4c145ee2a10958b9b29e2eba74dcd9741e73a4936c16791dbc0534b1698.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"DocumentPermission\" (\"documentId\", \"sharePermissionId\")\n VALUES ($1, $2)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f308b4c145ee2a10958b9b29e2eba74dcd9741e73a4936c16791dbc0534b1698"
-}
diff --git a/.sqlx/query-f35f0aea15af8da6867b9d83ec9337506100007f3124b9023c4651da20a5d954.json b/.sqlx/query-f35f0aea15af8da6867b9d83ec9337506100007f3124b9023c4651da20a5d954.json
deleted file mode 100644
index de08d9e6c7..0000000000
--- a/.sqlx/query-f35f0aea15af8da6867b9d83ec9337506100007f3124b9023c4651da20a5d954.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_outbox SET available_at = clock_timestamp() - interval '1 second' WHERE job_id = $1 AND kind = 'search'",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f35f0aea15af8da6867b9d83ec9337506100007f3124b9023c4651da20a5d954"
-}
diff --git a/.sqlx/query-f3ee355f36a75fc3cfd40e04a828d57334e6cf21008b7cc26c9e000fff21fc53.json b/.sqlx/query-f3ee355f36a75fc3cfd40e04a828d57334e6cf21008b7cc26c9e000fff21fc53.json
deleted file mode 100644
index f0e5d9a90c..0000000000
--- a/.sqlx/query-f3ee355f36a75fc3cfd40e04a828d57334e6cf21008b7cc26c9e000fff21fc53.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO channel_label_channel (scope_key, channel_id, label_id)\n SELECT $1, channel_id, $2 FROM unnest($3::uuid[]) AS channel_id",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Uuid",
- "UuidArray"
- ]
- },
- "nullable": []
- },
- "hash": "f3ee355f36a75fc3cfd40e04a828d57334e6cf21008b7cc26c9e000fff21fc53"
-}
diff --git a/.sqlx/query-f3f25971844627d5ff05aaeed82062ff9a5e824988baaba7e6da332485a62d2e.json b/.sqlx/query-f3f25971844627d5ff05aaeed82062ff9a5e824988baaba7e6da332485a62d2e.json
deleted file mode 100644
index d23bdea5c1..0000000000
--- a/.sqlx/query-f3f25971844627d5ff05aaeed82062ff9a5e824988baaba7e6da332485a62d2e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO \"Document\" (id, name, owner, \"fileType\") VALUES ($1, $1, $2, 'md')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f3f25971844627d5ff05aaeed82062ff9a5e824988baaba7e6da332485a62d2e"
-}
diff --git a/.sqlx/query-f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c.json b/.sqlx/query-f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c.json
deleted file mode 100644
index ab57db9444..0000000000
--- a/.sqlx/query-f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"User\" (id, email, macro_user_id)\n VALUES ($1, $2, $3)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f400e52fd81e057c31a80c0bb4f4835481bf9952c8e4518d927f05212457585c"
-}
diff --git a/.sqlx/query-f4a4117466186462642204b171c3b730bb1bbcffa0fe3abac3f824788e60788c.json b/.sqlx/query-f4a4117466186462642204b171c3b730bb1bbcffa0fe3abac3f824788e60788c.json
deleted file mode 100644
index 1e0d58694a..0000000000
--- a/.sqlx/query-f4a4117466186462642204b171c3b730bb1bbcffa0fe3abac3f824788e60788c.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO document_sub_type (document_id, sub_type)\n VALUES ($1, 'task')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f4a4117466186462642204b171c3b730bb1bbcffa0fe3abac3f824788e60788c"
-}
diff --git a/.sqlx/query-f4b62aa8ee8d581e32781d5a6d34033b22bdc71106622f5da6271184550c5f6e.json b/.sqlx/query-f4b62aa8ee8d581e32781d5a6d34033b22bdc71106622f5da6271184550c5f6e.json
deleted file mode 100644
index 26840e4619..0000000000
--- a/.sqlx/query-f4b62aa8ee8d581e32781d5a6d34033b22bdc71106622f5da6271184550c5f6e.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM database_columns WHERE table_id = $1 AND property_definition_id = $2",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f4b62aa8ee8d581e32781d5a6d34033b22bdc71106622f5da6271184550c5f6e"
-}
diff --git a/.sqlx/query-f666bbb70cea5292ca1a0e8d353ce43d9a8e4bdd2f0db3b3b5f9e96a5b80c852.json b/.sqlx/query-f666bbb70cea5292ca1a0e8d353ce43d9a8e4bdd2f0db3b3b5f9e96a5b80c852.json
deleted file mode 100644
index b0f94cd0b7..0000000000
--- a/.sqlx/query-f666bbb70cea5292ca1a0e8d353ce43d9a8e4bdd2f0db3b3b5f9e96a5b80c852.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE slack_import_job SET staging_expires_at = clock_timestamp() + interval '12 hours' WHERE team_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f666bbb70cea5292ca1a0e8d353ce43d9a8e4bdd2f0db3b3b5f9e96a5b80c852"
-}
diff --git a/.sqlx/query-f72a2833ed5fedef8253772b6f583426895b080a6de4394c94dba28e04578747.json b/.sqlx/query-f72a2833ed5fedef8253772b6f583426895b080a6de4394c94dba28e04578747.json
deleted file mode 100644
index e2b442ac7b..0000000000
--- a/.sqlx/query-f72a2833ed5fedef8253772b6f583426895b080a6de4394c94dba28e04578747.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO comms_messages (id, parent_entity_type, parent_entity_id, sender_id, content) VALUES ($1, 'channel', $2::uuid::text, $3, $4)",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f72a2833ed5fedef8253772b6f583426895b080a6de4394c94dba28e04578747"
-}
diff --git a/.sqlx/query-f77ba84d34f2cb3652cccfa586f8335d5ea377177b502bfdc594a09c09f99b13.json b/.sqlx/query-f77ba84d34f2cb3652cccfa586f8335d5ea377177b502bfdc594a09c09f99b13.json
deleted file mode 100644
index cfcdf506ac..0000000000
--- a/.sqlx/query-f77ba84d34f2cb3652cccfa586f8335d5ea377177b502bfdc594a09c09f99b13.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT entity_id, property_definition_id, values ->> 'value' AS \"value!\"\n FROM entity_properties WHERE entity_type = 'DATABASE_ROW'\n ORDER BY values ->> 'value'",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "entity_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "property_definition_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 2,
- "name": "value!",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false,
- false,
- null
- ]
- },
- "hash": "f77ba84d34f2cb3652cccfa586f8335d5ea377177b502bfdc594a09c09f99b13"
-}
diff --git a/.sqlx/query-f7f3b51b9f3d2f40e2fb3314b7cda8e9df42bee9c4dc3edc8d79475719232a5e.json b/.sqlx/query-f7f3b51b9f3d2f40e2fb3314b7cda8e9df42bee9c4dc3edc8d79475719232a5e.json
deleted file mode 100644
index 904903738f..0000000000
--- a/.sqlx/query-f7f3b51b9f3d2f40e2fb3314b7cda8e9df42bee9c4dc3edc8d79475719232a5e.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"createdAt\" as created_at, \"updatedAt\" as updated_at\n FROM \"UserHistory\"\n WHERE \"userId\" = $1 AND \"itemId\" = $2 AND \"itemType\" = 'project'\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "created_at",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 1,
- "name": "updated_at",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "f7f3b51b9f3d2f40e2fb3314b7cda8e9df42bee9c4dc3edc8d79475719232a5e"
-}
diff --git a/.sqlx/query-f917f7fe8609711fe7beb3033b422d44877e9462f2dc83fd12f6c1df0dbb33b0.json b/.sqlx/query-f917f7fe8609711fe7beb3033b422d44877e9462f2dc83fd12f6c1df0dbb33b0.json
deleted file mode 100644
index 810aff2022..0000000000
--- a/.sqlx/query-f917f7fe8609711fe7beb3033b422d44877e9462f2dc83fd12f6c1df0dbb33b0.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO scheduled_action (\n id, owner, name, schedule, kind, timezone, task, next_run_at, enabled\n )\n VALUES ($1, $2, 'routine', '0 * * * *', 'Agent', 'UTC', '{}'::jsonb, NOW(), true)\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f917f7fe8609711fe7beb3033b422d44877e9462f2dc83fd12f6c1df0dbb33b0"
-}
diff --git a/.sqlx/query-f9a5d3c291386c430cf997762a6bca3730901a18d73fe8c5ac86c3d9aff05ae6.json b/.sqlx/query-f9a5d3c291386c430cf997762a6bca3730901a18d73fe8c5ac86c3d9aff05ae6.json
deleted file mode 100644
index 083edc04c2..0000000000
--- a/.sqlx/query-f9a5d3c291386c430cf997762a6bca3730901a18d73fe8c5ac86c3d9aff05ae6.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM comms_channels WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "f9a5d3c291386c430cf997762a6bca3730901a18d73fe8c5ac86c3d9aff05ae6"
-}
diff --git a/.sqlx/query-f9bb9f0f9ca19b97547a4e3cdd7cfff65270fa16bbd9df7be6cb27b641624930.json b/.sqlx/query-f9bb9f0f9ca19b97547a4e3cdd7cfff65270fa16bbd9df7be6cb27b641624930.json
deleted file mode 100644
index 658d51a574..0000000000
--- a/.sqlx/query-f9bb9f0f9ca19b97547a4e3cdd7cfff65270fa16bbd9df7be6cb27b641624930.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO team (id, name, owner_id) VALUES ($1, 'Archive', $3), ($2, 'Foreign', 'macro|[email protected]')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "f9bb9f0f9ca19b97547a4e3cdd7cfff65270fa16bbd9df7be6cb27b641624930"
-}
diff --git a/.sqlx/query-f9f08b3339a271ed59f187c186d48ffa2db11396cb13563558d58d04c6b74b3a.json b/.sqlx/query-f9f08b3339a271ed59f187c186d48ffa2db11396cb13563558d58d04c6b74b3a.json
deleted file mode 100644
index e6c0819afa..0000000000
--- a/.sqlx/query-f9f08b3339a271ed59f187c186d48ffa2db11396cb13563558d58d04c6b74b3a.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT owner_id, created_at, updated_at, team_id FROM comms_channels WHERE id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 2,
- "name": "updated_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 3,
- "name": "team_id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true
- ]
- },
- "hash": "f9f08b3339a271ed59f187c186d48ffa2db11396cb13563558d58d04c6b74b3a"
-}
diff --git a/.sqlx/query-fa3f3685ba4be7c897b3d6fdbc39985902ac0116c49cd886b0ae77d6dd7e8078.json b/.sqlx/query-fa3f3685ba4be7c897b3d6fdbc39985902ac0116c49cd886b0ae77d6dd7e8078.json
deleted file mode 100644
index 344d1ee1b5..0000000000
--- a/.sqlx/query-fa3f3685ba4be7c897b3d6fdbc39985902ac0116c49cd886b0ae77d6dd7e8078.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE database_changes SET inverse = inverse - 'formatVersion' WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "fa3f3685ba4be7c897b3d6fdbc39985902ac0116c49cd886b0ae77d6dd7e8078"
-}
diff --git a/.sqlx/query-fa4718f2b7b0c4a6174affe0da6949a0f2410bbab7454f38ddaa2b29df927158.json b/.sqlx/query-fa4718f2b7b0c4a6174affe0da6949a0f2410bbab7454f38ddaa2b29df927158.json
deleted file mode 100644
index 7a55728fd0..0000000000
--- a/.sqlx/query-fa4718f2b7b0c4a6174affe0da6949a0f2410bbab7454f38ddaa2b29df927158.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "WITH storage AS (INSERT INTO databases (id) VALUES ($1) RETURNING id)\n INSERT INTO database_entities (database_id, name, user_id) SELECT id, 'db', 'macro|[email protected]' FROM storage",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fa4718f2b7b0c4a6174affe0da6949a0f2410bbab7454f38ddaa2b29df927158"
-}
diff --git a/.sqlx/query-fa98cf64fc220fec5755e06433758c22eb832bd3437ea4aaa4ad385c0f412c04.json b/.sqlx/query-fa98cf64fc220fec5755e06433758c22eb832bd3437ea4aaa4ad385c0f412c04.json
deleted file mode 100644
index 49e9eb8ce3..0000000000
--- a/.sqlx/query-fa98cf64fc220fec5755e06433758c22eb832bd3437ea4aaa4ad385c0f412c04.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"pinnedItemId\" FROM \"Pin\" WHERE \"userId\" = $1 AND \"pinnedItemId\" = $2 AND \"pinnedItemType\" = $3\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pinnedItemId",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "fa98cf64fc220fec5755e06433758c22eb832bd3437ea4aaa4ad385c0f412c04"
-}
diff --git a/.sqlx/query-fb43d363a3386eb501d8eb29cb073930b41b5823eea316366dc6d28cba2008fd.json b/.sqlx/query-fb43d363a3386eb501d8eb29cb073930b41b5823eea316366dc6d28cba2008fd.json
deleted file mode 100644
index 06b13b8772..0000000000
--- a/.sqlx/query-fb43d363a3386eb501d8eb29cb073930b41b5823eea316366dc6d28cba2008fd.json
+++ /dev/null
@@ -1,178 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n id, name, owner_id, thread_id, originating_message_id, bot_id,\n model, harness, repo_url, repo_branch, pull_request_url, workspace, sandbox_size, instructions,\n mcp_scope, mcp_servers, acp_session_id, status,\n status_event_name, agent_session.created_at, modified_at,\n (SELECT jsonb_build_object('type', parent_entity_type, 'id', parent_entity_id)\n FROM comms_messages WHERE id = agent_session.thread_id)\n AS \"thread_parent?: Json<MessageParent>\",\n ext.provider AS \"external_provider?\", ext.external_id AS \"external_id?\",\n ext.external_name AS \"external_name?\", ext.external_url AS \"external_url?\",\n ext.last_run_id AS \"external_last_run_id?\"\n FROM agent_session\n LEFT JOIN external_agent_session AS ext ON ext.agent_session_id = agent_session.id\n WHERE egress_token_hash = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "owner_id",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "thread_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 4,
- "name": "originating_message_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "bot_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 6,
- "name": "model",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "harness",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "repo_url",
- "type_info": "Text"
- },
- {
- "ordinal": 9,
- "name": "repo_branch",
- "type_info": "Text"
- },
- {
- "ordinal": 10,
- "name": "pull_request_url",
- "type_info": "Text"
- },
- {
- "ordinal": 11,
- "name": "workspace",
- "type_info": "Text"
- },
- {
- "ordinal": 12,
- "name": "sandbox_size",
- "type_info": "Text"
- },
- {
- "ordinal": 13,
- "name": "instructions",
- "type_info": "Text"
- },
- {
- "ordinal": 14,
- "name": "mcp_scope",
- "type_info": "Text"
- },
- {
- "ordinal": 15,
- "name": "mcp_servers",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 16,
- "name": "acp_session_id",
- "type_info": "Text"
- },
- {
- "ordinal": 17,
- "name": "status",
- "type_info": "Text"
- },
- {
- "ordinal": 18,
- "name": "status_event_name",
- "type_info": "Text"
- },
- {
- "ordinal": 19,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 20,
- "name": "modified_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 21,
- "name": "thread_parent?: Json<MessageParent>",
- "type_info": "Jsonb"
- },
- {
- "ordinal": 22,
- "name": "external_provider?",
- "type_info": "Text"
- },
- {
- "ordinal": 23,
- "name": "external_id?",
- "type_info": "Text"
- },
- {
- "ordinal": 24,
- "name": "external_name?",
- "type_info": "Text"
- },
- {
- "ordinal": 25,
- "name": "external_url?",
- "type_info": "Text"
- },
- {
- "ordinal": 26,
- "name": "external_last_run_id?",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- true,
- false,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- true,
- false,
- true,
- false,
- false,
- null,
- false,
- false,
- true,
- true,
- true
- ]
- },
- "hash": "fb43d363a3386eb501d8eb29cb073930b41b5823eea316366dc6d28cba2008fd"
-}
diff --git a/.sqlx/query-fb724ff2353856afffacad5616ef6672fb044cd48371ca6258ec064060bcedcb.json b/.sqlx/query-fb724ff2353856afffacad5616ef6672fb044cd48371ca6258ec064060bcedcb.json
deleted file mode 100644
index 4474d2ca36..0000000000
--- a/.sqlx/query-fb724ff2353856afffacad5616ef6672fb044cd48371ca6258ec064060bcedcb.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE agent_session\n SET name = $2,\n modified_at = NOW()\n WHERE id = $1\n AND name = $3\n RETURNING modified_at\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "modified_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Text",
- "Text"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "fb724ff2353856afffacad5616ef6672fb044cd48371ca6258ec064060bcedcb"
-}
diff --git a/.sqlx/query-fb79764ad1ebce9ebd67d054c61fef8e4c59ddd9582053aa240ddb8e60f54f00.json b/.sqlx/query-fb79764ad1ebce9ebd67d054c61fef8e4c59ddd9582053aa240ddb8e60f54f00.json
deleted file mode 100644
index 7797e2f3f0..0000000000
--- a/.sqlx/query-fb79764ad1ebce9ebd67d054c61fef8e4c59ddd9582053aa240ddb8e60f54f00.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO entity_access (entity_id, entity_type, source_id, source_type, access_level)\n VALUES ($1, 'database', $2, 'channel', 'view')\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "fb79764ad1ebce9ebd67d054c61fef8e4c59ddd9582053aa240ddb8e60f54f00"
-}
diff --git a/.sqlx/query-fb9a3fc797421a73fb66c55111908d003e98c9ae81e744612d63ef213e5360fd.json b/.sqlx/query-fb9a3fc797421a73fb66c55111908d003e98c9ae81e744612d63ef213e5360fd.json
deleted file mode 100644
index f72627d24e..0000000000
--- a/.sqlx/query-fb9a3fc797421a73fb66c55111908d003e98c9ae81e744612d63ef213e5360fd.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT send_time FROM email_scheduled_messages WHERE message_id = $1",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "send_time",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "fb9a3fc797421a73fb66c55111908d003e98c9ae81e744612d63ef213e5360fd"
-}
diff --git a/.sqlx/query-fba98a8f2e80f01882a4c00fafbc37e6415ee7ee767cb67c4c49b80b4b16ef24.json b/.sqlx/query-fba98a8f2e80f01882a4c00fafbc37e6415ee7ee767cb67c4c49b80b4b16ef24.json
deleted file mode 100644
index 7c0d9abf02..0000000000
--- a/.sqlx/query-fba98a8f2e80f01882a4c00fafbc37e6415ee7ee767cb67c4c49b80b4b16ef24.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO email_scheduled_messages (message_id, link_id, send_time) VALUES ($1, $2, NOW() + INTERVAL '1 hour')",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fba98a8f2e80f01882a4c00fafbc37e6415ee7ee767cb67c4c49b80b4b16ef24"
-}
diff --git a/.sqlx/query-fbbf74147f59395c77e63eeb9b7b4c8bead2b2857c5c41e306c5b334da9c134b.json b/.sqlx/query-fbbf74147f59395c77e63eeb9b7b4c8bead2b2857c5c41e306c5b334da9c134b.json
deleted file mode 100644
index 1d797550ce..0000000000
--- a/.sqlx/query-fbbf74147f59395c77e63eeb9b7b4c8bead2b2857c5c41e306c5b334da9c134b.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE email_scheduled_messages SET send_time = NOW() - INTERVAL '1 minute' WHERE message_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fbbf74147f59395c77e63eeb9b7b4c8bead2b2857c5c41e306c5b334da9c134b"
-}
diff --git a/.sqlx/query-fcf137663dd5235fcac50d9d59e315fb0eedbe6960718bca269581bef3881a2f.json b/.sqlx/query-fcf137663dd5235fcac50d9d59e315fb0eedbe6960718bca269581bef3881a2f.json
deleted file mode 100644
index fe1621b177..0000000000
--- a/.sqlx/query-fcf137663dd5235fcac50d9d59e315fb0eedbe6960718bca269581bef3881a2f.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET left_at = NULL WHERE channel_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fcf137663dd5235fcac50d9d59e315fb0eedbe6960718bca269581bef3881a2f"
-}
diff --git a/.sqlx/query-fd35175c2d4880a5e6188576b4adb0a7628bc97d4203d50aabdd43ad1b794d17.json b/.sqlx/query-fd35175c2d4880a5e6188576b4adb0a7628bc97d4203d50aabdd43ad1b794d17.json
deleted file mode 100644
index c3af15085e..0000000000
--- a/.sqlx/query-fd35175c2d4880a5e6188576b4adb0a7628bc97d4203d50aabdd43ad1b794d17.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"SharePermission\" (\n id,\n \"linkShare\",\n \"linkShareAccessLevel\",\n \"createdAt\",\n \"updatedAt\"\n )\n VALUES ($1, NULL, NULL, NOW(), NOW())\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "fd35175c2d4880a5e6188576b4adb0a7628bc97d4203d50aabdd43ad1b794d17"
-}
diff --git a/.sqlx/query-fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433.json b/.sqlx/query-fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433.json
deleted file mode 100644
index ad01379f13..0000000000
--- a/.sqlx/query-fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE comms_channel_participants SET left_at = now() WHERE channel_id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fda562d30ca57ca7b5b112f2414f38f809e78207c82ed1fb32fcb01ef7864433"
-}
diff --git a/.sqlx/query-fde1e0c0715a20f7baf7ddccff5be85b0259368a74b8a41fdc3092e756b704da.json b/.sqlx/query-fde1e0c0715a20f7baf7ddccff5be85b0259368a74b8a41fdc3092e756b704da.json
deleted file mode 100644
index ff934961ae..0000000000
--- a/.sqlx/query-fde1e0c0715a20f7baf7ddccff5be85b0259368a74b8a41fdc3092e756b704da.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT \"deletedAt\" as deleted_at FROM \"Document\" WHERE id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "deleted_at",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "fde1e0c0715a20f7baf7ddccff5be85b0259368a74b8a41fdc3092e756b704da"
-}
diff --git a/.sqlx/query-fe287fb5b7cf1346a3ce18b91694be599181321febba7e87364c463ef44bc0ec.json b/.sqlx/query-fe287fb5b7cf1346a3ce18b91694be599181321febba7e87364c463ef44bc0ec.json
deleted file mode 100644
index 0d85b3999f..0000000000
--- a/.sqlx/query-fe287fb5b7cf1346a3ce18b91694be599181321febba7e87364c463ef44bc0ec.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT EXISTS(SELECT 1 FROM pg_stat_activity WHERE application_name = $1 AND wait_event = 'advisory')",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "exists",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null
- ]
- },
- "hash": "fe287fb5b7cf1346a3ce18b91694be599181321febba7e87364c463ef44bc0ec"
-}
diff --git a/.sqlx/query-fe76770c0a2d5e6329180d611ef43e18e2a3eabdb112ed1486e9095cba95a579.json b/.sqlx/query-fe76770c0a2d5e6329180d611ef43e18e2a3eabdb112ed1486e9095cba95a579.json
deleted file mode 100644
index 60d47562ae..0000000000
--- a/.sqlx/query-fe76770c0a2d5e6329180d611ef43e18e2a3eabdb112ed1486e9095cba95a579.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT id FROM email_threads",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "id",
- "type_info": "Uuid"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- false
- ]
- },
- "hash": "fe76770c0a2d5e6329180d611ef43e18e2a3eabdb112ed1486e9095cba95a579"
-}
diff --git a/.sqlx/query-fe76c5e489b1ccab4b37fbe0b479d7c93335334b2e934f7bad97904c9696372e.json b/.sqlx/query-fe76c5e489b1ccab4b37fbe0b479d7c93335334b2e934f7bad97904c9696372e.json
deleted file mode 100644
index 5c3e92099e..0000000000
--- a/.sqlx/query-fe76c5e489b1ccab4b37fbe0b479d7c93335334b2e934f7bad97904c9696372e.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DROP TRIGGER trg_initialize_comms_message_thread ON comms_messages",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": []
- },
- "nullable": []
- },
- "hash": "fe76c5e489b1ccab4b37fbe0b479d7c93335334b2e934f7bad97904c9696372e"
-}
diff --git a/.sqlx/query-fedf501a2d6920b9918220f4cd89c8b70c05548f9c46a3ffc76a86886fca54b1.json b/.sqlx/query-fedf501a2d6920b9918220f4cd89c8b70c05548f9c46a3ffc76a86886fca54b1.json
deleted file mode 100644
index b3e39eb33c..0000000000
--- a/.sqlx/query-fedf501a2d6920b9918220f4cd89c8b70c05548f9c46a3ffc76a86886fca54b1.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO \"User\" (id, email, macro_user_id)\n VALUES ($1, $2, $3)\n ON CONFLICT (id) DO NOTHING\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text",
- "Text",
- "Uuid"
- ]
- },
- "nullable": []
- },
- "hash": "fedf501a2d6920b9918220f4cd89c8b70c05548f9c46a3ffc76a86886fca54b1"
-}
diff --git a/.sqlx/query-fee0e22fe6c75d31138f3adddaef07525ee7ae1ea5772f9e33d7329c97656540.json b/.sqlx/query-fee0e22fe6c75d31138f3adddaef07525ee7ae1ea5772f9e33d7329c97656540.json
deleted file mode 100644
index 5372856a9a..0000000000
--- a/.sqlx/query-fee0e22fe6c75d31138f3adddaef07525ee7ae1ea5772f9e33d7329c97656540.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "SELECT count(*) FROM comms_activity",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "count",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": []
- },
- "nullable": [
- null
- ]
- },
- "hash": "fee0e22fe6c75d31138f3adddaef07525ee7ae1ea5772f9e33d7329c97656540"
-}
diff --git a/.sqlx/query-fff2597beb29f7b5eb8480afc6f45f5df2e7ec46974fc45707f02dcdc3c4bcb5.json b/.sqlx/query-fff2597beb29f7b5eb8480afc6f45f5df2e7ec46974fc45707f02dcdc3c4bcb5.json
deleted file mode 100644
index c19b001caa..0000000000
--- a/.sqlx/query-fff2597beb29f7b5eb8480afc6f45f5df2e7ec46974fc45707f02dcdc3c4bcb5.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n (SELECT COUNT(*) FROM \"Document\" WHERE owner = $1) AS \"documents!\",\n (SELECT COUNT(*) FROM entity WHERE owner_id = $1) AS \"entities!\",\n (SELECT COUNT(*) FROM entity_access WHERE source_id = $1) AS \"grants!\"\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "documents!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "entities!",
- "type_info": "Int8"
- },
- {
- "ordinal": 2,
- "name": "grants!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": [
- null,
- null,
- null
- ]
- },
- "hash": "fff2597beb29f7b5eb8480afc6f45f5df2e7ec46974fc45707f02dcdc3c4bcb5"
-}
diff --git a/.sqlx/query-fff97e1f692a5f636b4e25083ddf14ddd99a5960dadbda61660960f53079f205.json b/.sqlx/query-fff97e1f692a5f636b4e25083ddf14ddd99a5960dadbda61660960f53079f205.json
deleted file mode 100644
index 0e5ce19245..0000000000
--- a/.sqlx/query-fff97e1f692a5f636b4e25083ddf14ddd99a5960dadbda61660960f53079f205.json
+++ /dev/null
@@ -1,95 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n c.id as \"channel_id\",\n c.name as \"name\",\n c.channel_type AS \"channel_type: ChannelType\",\n c.org_id as \"org_id\",\n m.id as \"message_id\",\n m.thread_id as \"thread_id\",\n m.sender_id as \"sender_id\",\n m.content as \"content\",\n m.created_at as \"created_at\",\n m.updated_at as \"updated_at\",\n m.deleted_at::timestamptz as \"deleted_at\"\n FROM\n comms_messages m\n JOIN\n comms_channels c on m.parent_entity_type = 'channel' AND m.parent_entity_id = c.id::text\n WHERE\n m.id = $1\n AND c.id = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "channel_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 1,
- "name": "name",
- "type_info": "Varchar"
- },
- {
- "ordinal": 2,
- "name": "channel_type: ChannelType",
- "type_info": {
- "Custom": {
- "name": "comms_channel_type",
- "kind": {
- "Enum": [
- "public",
- "private",
- "direct_message",
- "team"
- ]
- }
- }
- }
- },
- {
- "ordinal": 3,
- "name": "org_id",
- "type_info": "Int8"
- },
- {
- "ordinal": 4,
- "name": "message_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 5,
- "name": "thread_id",
- "type_info": "Uuid"
- },
- {
- "ordinal": 6,
- "name": "sender_id",
- "type_info": "Text"
- },
- {
- "ordinal": 7,
- "name": "content",
- "type_info": "Text"
- },
- {
- "ordinal": 8,
- "name": "created_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 9,
- "name": "updated_at",
- "type_info": "Timestamptz"
- },
- {
- "ordinal": 10,
- "name": "deleted_at",
- "type_info": "Timestamptz"
- }
- ],
- "parameters": {
- "Left": [
- "Uuid",
- "Uuid"
- ]
- },
- "nullable": [
- false,
- true,
- false,
- true,
- false,
- true,
- false,
- false,
- false,
- false,
- null
- ]
- },
- "hash": "fff97e1f692a5f636b4e25083ddf14ddd99a5960dadbda61660960f53079f205"
-}
diff --git a/apps/web/src/features/usage/context/usage-context.ts b/apps/web/src/features/usage/context/usage-context.ts
index d764e0a017..31b6961f9e 100644
--- a/apps/web/src/features/usage/context/usage-context.ts
+++ b/apps/web/src/features/usage/context/usage-context.ts
@@ -21,6 +21,8 @@ export type UsageContext = {
settings: Accessor<AutoReloadSettings>;
available: Accessor<boolean>;
pending: Accessor<boolean>;
+ /** The last automatic reload failed to charge; saving retries. */
+ suspended: Accessor<boolean>;
save: (settings: AutoReloadSettings) => Promise<void>;
preview: Accessor<boolean>;
};
diff --git a/apps/web/src/features/usage/core/usage.test.ts b/apps/web/src/features/usage/core/usage.test.ts
index d16da2c46c..335a81e4bc 100644
--- a/apps/web/src/features/usage/core/usage.test.ts
+++ b/apps/web/src/features/usage/core/usage.test.ts
@@ -1,8 +1,10 @@
import { describe, expect, it } from 'vitest';
import {
+ DEFAULT_AUTO_RELOAD,
isUsageAvailable,
monthlyUsagePercent,
parseDollarInput,
+ validateAutoReload,
} from './usage';
describe('monthly usage', () => {
@@ -33,6 +35,63 @@ describe('dollar inputs', () => {
});
});
+describe('Auto-Reload validation', () => {
+ it('requires the target to exceed the minimum by the smallest chargeable reload', () => {
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ minimumBalanceCents: 1_000,
+ targetBalanceCents: 1_049,
+ })
+ ).toBe(
+ 'Target balance must be greater than minimum balance by at least $0.50.'
+ );
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ minimumBalanceCents: 1_000,
+ targetBalanceCents: 1_050,
+ })
+ ).toBeUndefined();
+ });
+
+ it('caps the target balance at $5,000', () => {
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ targetBalanceCents: 500_001,
+ })
+ ).toBe('Target balance can be at most $5,000.');
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ targetBalanceCents: 500_000,
+ })
+ ).toBeUndefined();
+ });
+
+ it('requires a monthly spend limit of at least $5 when one is set', () => {
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ monthlySpendLimitCents: 499,
+ })
+ ).toBe('Monthly spend limit must be at least $5, or leave it blank.');
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ monthlySpendLimitCents: 500,
+ })
+ ).toBeUndefined();
+ expect(
+ validateAutoReload({
+ ...DEFAULT_AUTO_RELOAD,
+ monthlySpendLimitCents: null,
+ })
+ ).toBeUndefined();
+ });
+});
+
describe('Usage rollout', () => {
it.each([
{ production: false, flag: false, available: true },
diff --git a/apps/web/src/features/usage/core/usage.ts b/apps/web/src/features/usage/core/usage.ts
index 996a108d76..5419dfc453 100644
--- a/apps/web/src/features/usage/core/usage.ts
+++ b/apps/web/src/features/usage/core/usage.ts
@@ -5,6 +5,7 @@ export type UsageSummary = {
creditBalanceCents: number;
billingAccess: 'free' | 'payer' | 'team-member';
existingUsageBilling?: { limitCents: number; suspended: boolean };
+ autoReload: { settings: AutoReloadSettings; suspended: boolean };
};
export type UsagePreviewPlan = 'free' | 'paid';
@@ -23,6 +24,18 @@ export const DEFAULT_AUTO_RELOAD: AutoReloadSettings = {
monthlySpendLimitCents: null,
};
+/** The smallest reload the backend will charge, so target must exceed minimum by this much. */
+export const MIN_RELOAD_CENTS = 50;
+
+export const MAX_TARGET_BALANCE_CENTS = 500_000;
+
+/**
+ * The monthly spend limit also caps usage billing, which the backend clamps to
+ * at least this much (`OVERAGE_LIMIT_MIN_CENTS`), so a smaller limit would be
+ * silently raised.
+ */
+export const MIN_MONTHLY_SPEND_LIMIT_CENTS = 500;
+
/** Development remains interactive; production follows the UI rollout flag. */
export function isUsageAvailable(
production: boolean,
@@ -58,13 +71,19 @@ export function validateAutoReload(
): string | undefined {
if (settings.minimumBalanceCents <= 0)
return 'Enter a minimum balance greater than $0.';
- if (settings.targetBalanceCents <= settings.minimumBalanceCents) {
- return 'Target balance must be greater than minimum balance.';
+ if (
+ settings.targetBalanceCents <
+ settings.minimumBalanceCents + MIN_RELOAD_CENTS
+ ) {
+ return `Target balance must be greater than minimum balance by at least ${formatCreditBalance(MIN_RELOAD_CENTS)}.`;
+ }
+ if (settings.targetBalanceCents > MAX_TARGET_BALANCE_CENTS) {
+ return `Target balance can be at most ${formatCreditBalance(MAX_TARGET_BALANCE_CENTS)}.`;
}
if (
settings.monthlySpendLimitCents !== null &&
- settings.monthlySpendLimitCents <= 0
+ settings.monthlySpendLimitCents < MIN_MONTHLY_SPEND_LIMIT_CENTS
) {
- return 'Enter a monthly spend limit greater than $0, or leave it blank.';
+ return `Monthly spend limit must be at least ${formatCreditBalance(MIN_MONTHLY_SPEND_LIMIT_CENTS)}, or leave it blank.`;
}
}
diff --git a/apps/web/src/features/usage/queries/usage-summary.test.ts b/apps/web/src/features/usage/queries/usage-summary.test.ts
index e2e3c632c5..2f85591f3d 100644
--- a/apps/web/src/features/usage/queries/usage-summary.test.ts
+++ b/apps/web/src/features/usage/queries/usage-summary.test.ts
@@ -1,5 +1,6 @@
import type { AiUsageSnapshot } from '@service-auth/ai-billing-types';
import { describe, expect, it } from 'vitest';
+import { DEFAULT_AUTO_RELOAD } from '../core/usage';
import { toUsageSummary } from './usage-summary';
const snapshot: AiUsageSnapshot = {
@@ -67,3 +68,38 @@ describe('usage billing access', () => {
}
);
});
+
+describe('automatic reload', () => {
+ it('treats usage billing as the opt-in and reads thresholds from the backend', () => {
+ expect(
+ toUsageSummary({
+ ...snapshot,
+ tier: 'premium',
+ overage_enabled: true,
+ overage_limit_cents: 7_500,
+ auto_reload: {
+ minimum_balance_cents: 500,
+ target_balance_cents: 2_000,
+ monthly_spend_limit_cents: 7_500,
+ suspended: true,
+ active: false,
+ },
+ }).autoReload
+ ).toEqual({
+ settings: {
+ enabled: true,
+ minimumBalanceCents: 500,
+ targetBalanceCents: 2_000,
+ monthlySpendLimitCents: 7_500,
+ },
+ suspended: true,
+ });
+ });
+
+ it('falls back to the default thresholds when the snapshot has none', () => {
+ expect(toUsageSummary(snapshot).autoReload).toEqual({
+ settings: DEFAULT_AUTO_RELOAD,
+ suspended: false,
+ });
+ });
+});
diff --git a/apps/web/src/features/usage/queries/usage-summary.ts b/apps/web/src/features/usage/queries/usage-summary.ts
index 87714bc1ab..828e71cddb 100644
--- a/apps/web/src/features/usage/queries/usage-summary.ts
+++ b/apps/web/src/features/usage/queries/usage-summary.ts
@@ -1,5 +1,24 @@
import type { AiUsageSnapshot } from '@service-auth/ai-billing-types';
-import { monthlyUsagePercent, type UsageSummary } from '../core/usage';
+import {
+ DEFAULT_AUTO_RELOAD,
+ monthlyUsagePercent,
+ type UsageSummary,
+} from '../core/usage';
+
+function toAutoReload(snapshot: AiUsageSnapshot): UsageSummary['autoReload'] {
+ const reload = snapshot.auto_reload;
+ const thresholds = reload
+ ? {
+ minimumBalanceCents: reload.minimum_balance_cents,
+ targetBalanceCents: reload.target_balance_cents,
+ monthlySpendLimitCents: reload.monthly_spend_limit_cents,
+ }
+ : DEFAULT_AUTO_RELOAD;
+ return {
+ settings: { ...thresholds, enabled: snapshot.overage_enabled },
+ suspended: reload?.suspended ?? false,
+ };
+}
export function toUsageSummary(snapshot: AiUsageSnapshot): UsageSummary {
return {
@@ -18,6 +37,7 @@ export function toUsageSummary(snapshot: AiUsageSnapshot): UsageSummary {
suspended: snapshot.overage_suspended,
}
: undefined,
+ autoReload: toAutoReload(snapshot),
billingAccess:
snapshot.tier === 'free'
? 'free'
diff --git a/apps/web/src/features/usage/usage.tsx b/apps/web/src/features/usage/usage.tsx
index 7210b31c1b..a1a6f7d984 100644
--- a/apps/web/src/features/usage/usage.tsx
+++ b/apps/web/src/features/usage/usage.tsx
@@ -12,6 +12,7 @@ import {
useAiBillingSummaryQuery,
useCreateAiCreditCheckoutMutation,
useCreateBillingPortalMutation,
+ useUpdateAiAutoReloadMutation,
useUpdateAiOverageMutation,
} from '@queries/auth';
import { createSignal, Suspense } from 'solid-js';
@@ -32,6 +33,7 @@ export function Usage() {
const checkout = useCreateAiCreditCheckoutMutation();
const portal = useCreateBillingPortalMutation();
const overage = useUpdateAiOverageMutation();
+ const autoReloadMutation = useUpdateAiAutoReloadMutation();
const usagePreview = useAiUsagePreview();
const { showUsageLimit, hideUsageLimit } = useAiUsageLimitState();
const { openSettings } = useSettingsState();
@@ -43,15 +45,26 @@ export function Usage() {
!usagePreview.beforeLaunch() &&
isUsageAvailable(PROD_MODE_ENV && !LOCAL_ONLY, aiUsageBilling().enabled);
const returnUrl = `${window.location.origin}/app/settings/usage`;
+ const usageSummary = () => {
+ const snapshot = usagePreview.withPreview(
+ summary.isSuccess ? summary.data : undefined,
+ plans.isSuccess ? plans.data.plans : undefined
+ );
+ return snapshot ? toUsageSummary(snapshot) : undefined;
+ };
+ const canChangeAutoReload = () =>
+ available() &&
+ !previewing() &&
+ summary.isSuccess &&
+ !summary.data.unlimited &&
+ summary.data.tier !== 'free' &&
+ summary.data.can_manage_billing;
+ const autoReloadAvailable = () =>
+ canChangeAutoReload() ||
+ (available() && DEV_MODE_ENV && autoReloadPreview());
const context: UsageContext = {
available,
- summary: () => {
- const snapshot = usagePreview.withPreview(
- summary.isSuccess ? summary.data : undefined,
- plans.isSuccess ? plans.data.plans : undefined
- );
- return snapshot ? toUsageSummary(snapshot) : undefined;
- },
+ summary: usageSummary,
loading: () => summary.isPending,
failed: () => summary.isError,
refresh: () => {
@@ -81,16 +94,21 @@ export function Usage() {
},
},
autoReload: {
- settings: () =>
- autoReloadPreview() ? previewSettings() : DEFAULT_AUTO_RELOAD,
- available: () => available() && DEV_MODE_ENV && autoReloadPreview(),
- pending: () => false,
+ settings: () => {
+ if (autoReloadPreview()) return previewSettings();
+ return usageSummary()?.autoReload.settings ?? DEFAULT_AUTO_RELOAD;
+ },
+ available: autoReloadAvailable,
+ pending: () => autoReloadMutation.isPending,
+ suspended: () => usageSummary()?.autoReload.suspended ?? false,
preview: autoReloadPreview,
save: async (settings) => {
- // No auto-reload API exists yet. Only the explicit development preview can save.
- if (!available() || !DEV_MODE_ENV || !autoReloadPreview())
- throw new Error('Auto-Reload unavailable');
- setPreviewSettings(settings);
+ if (!autoReloadAvailable()) throw new Error('Auto-Reload unavailable');
+ if (autoReloadPreview()) {
+ setPreviewSettings(settings);
+ return;
+ }
+ await autoReloadMutation.mutateAsync(settings);
},
},
paymentMethods: {
diff --git a/apps/web/src/features/usage/views/auto-reload.tsx b/apps/web/src/features/usage/views/auto-reload.tsx
index c206d0d276..0130624c38 100644
--- a/apps/web/src/features/usage/views/auto-reload.tsx
+++ b/apps/web/src/features/usage/views/auto-reload.tsx
@@ -13,8 +13,10 @@ export function AutoReloadView(props: {
const notice = () => {
if (props.context.autoReload.preview())
return 'Developer preview. These settings only change this preview and will not charge your card.';
- if (!props.context.autoReload.available())
- return 'Automatic reload is not available yet. You can buy usage credits manually.';
+ if (props.context.summary()?.billingAccess === 'team-member')
+ return 'Only the account that pays for this plan can change automatic reload.';
+ if (props.context.autoReload.suspended())
+ return 'Your last automatic reload could not be charged. Update your payment method, then save to try again.';
};
const save = async (enabled: boolean) => {
const settings = enabled
diff --git a/apps/web/src/features/usage/views/usage-settings.tsx b/apps/web/src/features/usage/views/usage-settings.tsx
index 61a079c361..cf1f74d1c7 100644
--- a/apps/web/src/features/usage/views/usage-settings.tsx
+++ b/apps/web/src/features/usage/views/usage-settings.tsx
@@ -191,7 +191,7 @@ export function UsageSettingsView(props: { context: UsageContext }) {
{(billing) => (
<SettingsSection
title="Existing usage billing"
- description="This bills additional usage to your card after it happens. It does not automatically reload credits."
+ description="Usage past your plan and credits is billed to your card. While it is on, credits reload automatically when your balance drops below your minimum."
>
<SettingsCard>
<SettingsRow
diff --git a/apps/web/src/lib/queries/auth/ai-billing.ts b/apps/web/src/lib/queries/auth/ai-billing.ts
index 52131421bf..4c7ee683e3 100644
--- a/apps/web/src/lib/queries/auth/ai-billing.ts
+++ b/apps/web/src/lib/queries/auth/ai-billing.ts
@@ -90,6 +90,27 @@ export function useUpdateAiOverageMutation() {
}));
}
+/**
+ * Turn automatic credit reloads (and with them, usage billing) on or off and
+ * set the balance thresholds and optional monthly spend limit.
+ */
+export function useUpdateAiAutoReloadMutation() {
+ return useMutation(() => ({
+ mutationFn: async (args: {
+ enabled: boolean;
+ minimumBalanceCents: number;
+ targetBalanceCents: number;
+ monthlySpendLimitCents: number | null;
+ }) =>
+ await throwOnErr(
+ async () => await authServiceClient.updateAiAutoReload(args)
+ ),
+ onSuccess: (snapshot) => {
+ queryClient.setQueryData(authKeys.aiBillingSummary.queryKey, snapshot);
+ },
+ }));
+}
+
/** Start a Stripe Checkout for a credit pack; resolves to the hosted URL. */
export function useCreateAiCreditCheckoutMutation() {
return useMutation(() => ({
diff --git a/apps/web/src/lib/queries/auth/index.ts b/apps/web/src/lib/queries/auth/index.ts
index 25161accbb..b51b8f9793 100644
--- a/apps/web/src/lib/queries/auth/index.ts
+++ b/apps/web/src/lib/queries/auth/index.ts
@@ -11,6 +11,7 @@ export {
useChangePlanMutation,
useCreateAiCreditCheckoutMutation,
useIncludedAiCentsByTier,
+ useUpdateAiAutoReloadMutation,
useUpdateAiOverageMutation,
} from './ai-billing';
export {
diff --git a/apps/web/src/lib/service-clients/service-auth/ai-billing-types.ts b/apps/web/src/lib/service-clients/service-auth/ai-billing-types.ts
index 219e0bc2b4..314d270b2a 100644
--- a/apps/web/src/lib/service-clients/service-auth/ai-billing-types.ts
+++ b/apps/web/src/lib/service-clients/service-auth/ai-billing-types.ts
@@ -23,6 +23,20 @@ export type AiDenyCode =
| 'ai_overage_limit_reached'
| 'ai_overage_payment_failed';
+/** The payer's automatic reload settings and whether reloads will fire. */
+export interface AiAutoReloadSnapshot {
+ /** Reload once the effective balance drops below this, customer cents. */
+ minimum_balance_cents: number;
+ /** Reload the balance back up to this, customer cents. */
+ target_balance_cents: number;
+ /** Most reloaded per UTC calendar month; `null` when there is no limit. */
+ monthly_spend_limit_cents: number | null;
+ /** Reloads are paused after a failed reload charge. */
+ suspended: boolean;
+ /** Overage is on and reloads are not suspended. */
+ active: boolean;
+}
+
export interface AiUsageSnapshot {
tier: AiPlanTier;
unlimited: boolean;
@@ -39,6 +53,8 @@ export interface AiUsageSnapshot {
overage_limit_cents: number;
overage_charged_cents: number;
overage_suspended: boolean;
+ /** Optional until the next client regeneration; always present from the backend. */
+ auto_reload?: AiAutoReloadSnapshot;
uncovered_cents: number;
remaining_cents: number;
blocked_reason?: AiDenyReason;
@@ -51,11 +67,21 @@ export interface AiPlanCatalogEntry {
purchasable: boolean;
}
+/** Thresholds automatic reload starts from before the payer sets their own. */
+export interface AiAutoReloadDefaults {
+ minimum_balance_cents: number;
+ target_balance_cents: number;
+}
+
export interface AiPlanCatalog {
plans: AiPlanCatalogEntry[];
credit_packs_cents: number[];
overage_limit_min_cents: number;
overage_limit_max_cents: number;
+ /** Optional until the next client regeneration; always present from the backend. */
+ auto_reload_target_max_cents?: number;
+ /** Optional until the next client regeneration; always present from the backend. */
+ auto_reload_defaults?: AiAutoReloadDefaults;
}
export type PaidPlan = 'premium' | 'max';
diff --git a/apps/web/src/lib/service-clients/service-auth/client.ts b/apps/web/src/lib/service-clients/service-auth/client.ts
index b05186c2bc..d51f9da6b5 100644
--- a/apps/web/src/lib/service-clients/service-auth/client.ts
+++ b/apps/web/src/lib/service-clients/service-auth/client.ts
@@ -738,6 +738,26 @@ export const authServiceClient = {
);
},
+ async updateAiAutoReload(args: {
+ enabled: boolean;
+ minimumBalanceCents: number;
+ targetBalanceCents: number;
+ monthlySpendLimitCents: number | null;
+ }) {
+ return await fetchWithAuth<AiUsageSnapshot>(
+ `${authHost}/ai-billing/auto-reload`,
+ {
+ method: 'PATCH',
+ body: JSON.stringify({
+ enabled: args.enabled,
+ minimumBalanceCents: args.minimumBalanceCents,
+ targetBalanceCents: args.targetBalanceCents,
+ monthlySpendLimitCents: args.monthlySpendLimitCents,
+ }),
+ }
+ );
+ },
+
async createAiCreditCheckout(args: {
amountCents: number;
successUrl: string;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/client.ts b/apps/web/src/lib/service-clients/service-auth/generated/client.ts
index ddd018c0d0..91e4786882 100644
--- a/apps/web/src/lib/service-clients/service-auth/generated/client.ts
+++ b/apps/web/src/lib/service-clients/service-auth/generated/client.ts
@@ -89,6 +89,7 @@ import type {
TeamWithMembers,
ToggleAutoJoinDomainResponse,
ToggleNonAdminInvitesResponse,
+ UpdateAutoReloadRequest,
UpdateOverageRequest,
UsageSnapshot,
UserLinkResponse,
@@ -99,6 +100,86 @@ import type {
UserTokensResponse,
} from './schemas';
+/**
+ * @summary Turn automatic credit reloads (and with them overage) on with the given
+thresholds, or off. Payer only. Enabling settles right away, so a balance
+already under the minimum reloads immediately.
+ */
+export type updateAiBillingAutoReloadResponse200 = {
+ data: UsageSnapshot;
+ status: 200;
+};
+
+export type updateAiBillingAutoReloadResponse400 = {
+ data: AiBillingErrorBody;
+ status: 400;
+};
+
+export type updateAiBillingAutoReloadResponse401 = {
+ data: void;
+ status: 401;
+};
+
+export type updateAiBillingAutoReloadResponse402 = {
+ data: AiBillingErrorBody;
+ status: 402;
+};
+
+export type updateAiBillingAutoReloadResponse403 = {
+ data: AiBillingErrorBody;
+ status: 403;
+};
+
+export type updateAiBillingAutoReloadResponse500 = {
+ data: AiBillingErrorBody;
+ status: 500;
+};
+
+export type updateAiBillingAutoReloadResponseSuccess =
+ updateAiBillingAutoReloadResponse200 & {
+ headers: Headers;
+ };
+export type updateAiBillingAutoReloadResponseError = (
+ | updateAiBillingAutoReloadResponse400
+ | updateAiBillingAutoReloadResponse401
+ | updateAiBillingAutoReloadResponse402
+ | updateAiBillingAutoReloadResponse403
+ | updateAiBillingAutoReloadResponse500
+) & {
+ headers: Headers;
+};
+
+export type updateAiBillingAutoReloadResponse =
+ | updateAiBillingAutoReloadResponseSuccess
+ | updateAiBillingAutoReloadResponseError;
+
+export const getUpdateAiBillingAutoReloadUrl = () => {
+ return `/ai-billing/auto-reload`;
+};
+
+export const updateAiBillingAutoReload = async (
+ updateAutoReloadRequest: UpdateAutoReloadRequest,
+ options?: RequestInit
+): Promise<updateAiBillingAutoReloadResponse> => {
+ const res = await fetch(getUpdateAiBillingAutoReloadUrl(), {
+ ...options,
+ method: 'PATCH',
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
+ body: JSON.stringify(updateAutoReloadRequest),
+ });
+
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
+
+ const data: updateAiBillingAutoReloadResponse['data'] = body
+ ? JSON.parse(body)
+ : {};
+ return {
+ data,
+ status: res.status,
+ headers: res.headers,
+ } as updateAiBillingAutoReloadResponse;
+};
+
/**
* @summary Start a Stripe Checkout for a credit pack. Payer only.
*/
@@ -256,7 +337,8 @@ export const updateAiBillingOverage = async (
};
/**
- * @summary The plan catalog, credit packs, and overage cap bounds.
+ * @summary The plan catalog, credit packs, overage cap bounds, and automatic reload
+defaults and bounds.
*/
export type getAiBillingPlansResponse200 = {
data: PlanCatalogResponse;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadDefaults.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadDefaults.ts
new file mode 100644
index 0000000000..49dcbecb3d
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadDefaults.ts
@@ -0,0 +1,16 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * The automatic reload thresholds a payer starts from.
+ */
+export interface AutoReloadDefaults {
+ /** Balance below which a reload fires, cents. */
+ minimum_balance_cents: number;
+ /** Balance a reload tops up to, cents. */
+ target_balance_cents: number;
+}
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadSnapshot.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadSnapshot.ts
new file mode 100644
index 0000000000..2c778d2a3d
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadSnapshot.ts
@@ -0,0 +1,24 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { AutoReloadSnapshotMonthlySpendLimitCents } from './autoReloadSnapshotMonthlySpendLimitCents';
+
+/**
+ * The payer's automatic reload settings, as shown in Billing settings.
+ */
+export interface AutoReloadSnapshot {
+ /** Whether reloads will fire: overage is on and reloads are not suspended. */
+ active: boolean;
+ /** Reload once the effective balance drops below this, in customer cents. */
+ minimum_balance_cents: number;
+ /** Most reloaded per UTC calendar month, in customer cents. `null` when
+there is no limit. */
+ monthly_spend_limit_cents?: AutoReloadSnapshotMonthlySpendLimitCents;
+ /** Whether reloads are paused after a failed reload charge. */
+ suspended: boolean;
+ /** Reload the balance back up to this, in customer cents. */
+ target_balance_cents: number;
+}
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadSnapshotMonthlySpendLimitCents.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadSnapshotMonthlySpendLimitCents.ts
new file mode 100644
index 0000000000..bf3366ca19
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/autoReloadSnapshotMonthlySpendLimitCents.ts
@@ -0,0 +1,12 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Most reloaded per UTC calendar month, in customer cents. `null` when
+there is no limit.
+ */
+export type AutoReloadSnapshotMonthlySpendLimitCents = number | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts
index 5a487ee7bd..54004113d7 100644
--- a/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/index.ts
@@ -8,6 +8,9 @@
export * from './aBGroup';
export * from './aiBillingErrorBody';
export * from './appleLoginRequest';
+export * from './autoReloadDefaults';
+export * from './autoReloadSnapshot';
+export * from './autoReloadSnapshotMonthlySpendLimitCents';
export * from './changePlanRequest';
export * from './changePlanResponse';
export * from './checkoutSessionMetadata';
@@ -190,6 +193,8 @@ export * from './teamWithMembers';
export * from './toggleAutoJoinDomainResponse';
export * from './toggleAutoJoinDomainResponseAutoJoinDomain';
export * from './toggleNonAdminInvitesResponse';
+export * from './updateAutoReloadRequest';
+export * from './updateAutoReloadRequestMonthlySpendLimitCents';
export * from './updateOverageRequest';
export * from './usageSnapshot';
export * from './usageSnapshotBlockedReason';
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/planCatalogResponse.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/planCatalogResponse.ts
index 37c3c0fffd..062b05c15b 100644
--- a/apps/web/src/lib/service-clients/service-auth/generated/schemas/planCatalogResponse.ts
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/planCatalogResponse.ts
@@ -4,12 +4,17 @@
* authentication_service
* OpenAPI spec version: 0.1.0
*/
+import type { AutoReloadDefaults } from './autoReloadDefaults';
import type { PlanCatalogEntry } from './planCatalogEntry';
/**
* The plan catalog and the knobs the billing UI offers.
*/
export interface PlanCatalogResponse {
+ /** Thresholds automatic reload starts from before the payer sets their own. */
+ auto_reload_defaults: AutoReloadDefaults;
+ /** Largest allowed automatic reload target, cents. */
+ auto_reload_target_max_cents: number;
/** Credit packs a payer may buy, cents. */
credit_packs_cents: number[];
/** Largest allowed overage cap, cents. */
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/updateAutoReloadRequest.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/updateAutoReloadRequest.ts
new file mode 100644
index 0000000000..28f94791de
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/updateAutoReloadRequest.ts
@@ -0,0 +1,26 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { UpdateAutoReloadRequestMonthlySpendLimitCents } from './updateAutoReloadRequestMonthlySpendLimitCents';
+
+/**
+ * Request body for [`update_auto_reload_handler`].
+ */
+export interface UpdateAutoReloadRequest {
+ /** Reload credits automatically, billing usage past allowance and
+credits to the payer's card. Turning this off also turns off overage. */
+ enabled: boolean;
+ /** Reload once the balance drops below this, cents. Must be positive. */
+ minimumBalanceCents: number;
+ /** Most to reload per calendar month, cents. Omit or `null` for no limit.
+Also serves as the per-period overage cap, so it must be at least the
+catalog's `overage_limit_min_cents`; larger values are capped at
+`overage_limit_max_cents`. */
+ monthlySpendLimitCents?: UpdateAutoReloadRequestMonthlySpendLimitCents;
+ /** Reload the balance back up to this, cents. At least $0.50 above the
+minimum and no more than the catalog's `auto_reload_target_max_cents`. */
+ targetBalanceCents: number;
+}
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/updateAutoReloadRequestMonthlySpendLimitCents.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/updateAutoReloadRequestMonthlySpendLimitCents.ts
new file mode 100644
index 0000000000..692bd53aff
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/updateAutoReloadRequestMonthlySpendLimitCents.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * authentication_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Most to reload per calendar month, cents. Omit or `null` for no limit.
+Also serves as the per-period overage cap, so it must be at least the
+catalog's `overage_limit_min_cents`; larger values are capped at
+`overage_limit_max_cents`.
+ */
+export type UpdateAutoReloadRequestMonthlySpendLimitCents = number | null;
diff --git a/apps/web/src/lib/service-clients/service-auth/generated/schemas/usageSnapshot.ts b/apps/web/src/lib/service-clients/service-auth/generated/schemas/usageSnapshot.ts
index 45f267d940..17d982dc1e 100644
--- a/apps/web/src/lib/service-clients/service-auth/generated/schemas/usageSnapshot.ts
+++ b/apps/web/src/lib/service-clients/service-auth/generated/schemas/usageSnapshot.ts
@@ -4,7 +4,7 @@
* authentication_service
* OpenAPI spec version: 0.1.0
*/
-
+import type { AutoReloadSnapshot } from './autoReloadSnapshot';
import type { PlanTier } from './planTier';
import type { UsageSnapshotBlockedReason } from './usageSnapshotBlockedReason';
@@ -13,6 +13,9 @@ import type { UsageSnapshotBlockedReason } from './usageSnapshotBlockedReason';
by the gate.
*/
export interface UsageSnapshot {
+ /** Automatic credit reload settings. `active` means overage is on and
+reloads are not suspended. */
+ auto_reload: AutoReloadSnapshot;
blocked_reason?: UsageSnapshotBlockedReason;
/** Whether the requesting user is the payer. */
can_manage_billing: boolean;
diff --git a/apps/web/src/lib/service-clients/service-auth/openapi.json b/apps/web/src/lib/service-clients/service-auth/openapi.json
index ef26cc383d..e2e9aa3341 100644
--- a/apps/web/src/lib/service-clients/service-auth/openapi.json
+++ b/apps/web/src/lib/service-clients/service-auth/openapi.json
@@ -10,6 +10,78 @@
"version": "0.1.0"
},
"paths": {
+ "/ai-billing/auto-reload": {
+ "patch": {
+ "tags": ["ai_billing"],
+ "summary": "Turn automatic credit reloads (and with them overage) on with the given\nthresholds, or off. Payer only. Enabling settles right away, so a balance\nalready under the minimum reloads immediately.",
+ "operationId": "update_ai_billing_auto_reload",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateAutoReloadRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Updated position",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UsageSnapshot"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid thresholds",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "402": {
+ "description": "A paid plan is required",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Only the payer may change billing",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/ai-billing/credits/checkout": {
"post": {
"tags": ["ai_billing"],
@@ -157,7 +229,7 @@
"/ai-billing/plans": {
"get": {
"tags": ["ai_billing"],
- "summary": "The plan catalog, credit packs, and overage cap bounds.",
+ "summary": "The plan catalog, credit packs, overage cap bounds, and automatic reload\ndefaults and bounds.",
"operationId": "get_ai_billing_plans",
"responses": {
"200": {
@@ -4844,6 +4916,58 @@
}
}
},
+ "AutoReloadDefaults": {
+ "type": "object",
+ "description": "The automatic reload thresholds a payer starts from.",
+ "required": ["minimum_balance_cents", "target_balance_cents"],
+ "properties": {
+ "minimum_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Balance below which a reload fires, cents."
+ },
+ "target_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Balance a reload tops up to, cents."
+ }
+ }
+ },
+ "AutoReloadSnapshot": {
+ "type": "object",
+ "description": "The payer's automatic reload settings, as shown in Billing settings.",
+ "required": [
+ "minimum_balance_cents",
+ "target_balance_cents",
+ "suspended",
+ "active"
+ ],
+ "properties": {
+ "active": {
+ "type": "boolean",
+ "description": "Whether reloads will fire: overage is on and reloads are not suspended."
+ },
+ "minimum_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload once the effective balance drops below this, in customer cents."
+ },
+ "monthly_spend_limit_cents": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "Most reloaded per UTC calendar month, in customer cents. `null` when\nthere is no limit."
+ },
+ "suspended": {
+ "type": "boolean",
+ "description": "Whether reloads are paused after a failed reload charge."
+ },
+ "target_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload the balance back up to this, in customer cents."
+ }
+ }
+ },
"ChangePlanRequest": {
"type": "object",
"description": "Request body for switching plans",
@@ -6360,9 +6484,20 @@
"plans",
"credit_packs_cents",
"overage_limit_min_cents",
- "overage_limit_max_cents"
+ "overage_limit_max_cents",
+ "auto_reload_target_max_cents",
+ "auto_reload_defaults"
],
"properties": {
+ "auto_reload_defaults": {
+ "$ref": "#/components/schemas/AutoReloadDefaults",
+ "description": "Thresholds automatic reload starts from before the payer sets their own."
+ },
+ "auto_reload_target_max_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Largest allowed automatic reload target, cents."
+ },
"credit_packs_cents": {
"type": "array",
"items": {
@@ -6750,6 +6885,32 @@
}
}
},
+ "UpdateAutoReloadRequest": {
+ "type": "object",
+ "description": "Request body for [`update_auto_reload_handler`].",
+ "required": ["enabled", "minimumBalanceCents", "targetBalanceCents"],
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "description": "Reload credits automatically, billing usage past allowance and\ncredits to the payer's card. Turning this off also turns off overage."
+ },
+ "minimumBalanceCents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload once the balance drops below this, cents. Must be positive."
+ },
+ "monthlySpendLimitCents": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "Most to reload per calendar month, cents. Omit or `null` for no limit.\nAlso serves as the per-period overage cap, so it must be at least the\ncatalog's `overage_limit_min_cents`; larger values are capped at\n`overage_limit_max_cents`."
+ },
+ "targetBalanceCents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload the balance back up to this, cents. At least $0.50 above the\nminimum and no more than the catalog's `auto_reload_target_max_cents`."
+ }
+ }
+ },
"UpdateOverageRequest": {
"type": "object",
"description": "Request body for [`update_overage_handler`].",
@@ -6785,10 +6946,15 @@
"overage_limit_cents",
"overage_charged_cents",
"overage_suspended",
+ "auto_reload",
"uncovered_cents",
"remaining_cents"
],
"properties": {
+ "auto_reload": {
+ "$ref": "#/components/schemas/AutoReloadSnapshot",
+ "description": "Automatic credit reload settings. `active` means overage is on and\nreloads are not suspended."
+ },
"blocked_reason": {
"oneOf": [
{
diff --git a/crates/agent_inmem/src/testing.rs b/crates/agent_inmem/src/testing.rs
index 9961038194..26f6b90186 100644
--- a/crates/agent_inmem/src/testing.rs
+++ b/crates/agent_inmem/src/testing.rs
@@ -74,6 +74,15 @@ impl ai_billing::domain::BillingService for UnavailableBilling {
panic!("admission must not change settings")
}
+ async fn update_auto_reload(
+ &self,
+ _: &MacroUserIdStr<'_>,
+ _: bool,
+ _: ai_billing::domain::AutoReloadThresholds,
+ ) -> ai_billing::domain::Result<ai_billing::domain::UsageSnapshot> {
+ panic!("admission must not change settings")
+ }
+
async fn create_credit_checkout(
&self,
_: &MacroUserIdStr<'_>,
@@ -106,6 +115,10 @@ impl ai_billing::domain::BillingService for UnavailableBilling {
async fn mark_overage_invoice(&self, _: &str, _: bool) -> ai_billing::domain::Result<()> {
panic!("admission must not handle invoices")
}
+
+ async fn mark_credit_reload_invoice(&self, _: &str, _: bool) -> ai_billing::domain::Result<()> {
+ panic!("admission must not handle invoices")
+ }
}
/// Models advertised by shared test engines.
diff --git a/crates/ai_billing/src/domain.rs b/crates/ai_billing/src/domain.rs
index 75f328d999..d6b0b78892 100644
--- a/crates/ai_billing/src/domain.rs
+++ b/crates/ai_billing/src/domain.rs
@@ -15,18 +15,23 @@ pub use admission::{
AdmissionFuture, AiAdmissionError, AiAdmissionService, BillingAdmissionService,
DisabledAiAdmissionService,
};
-pub use ledger::{SettlementPlan, SettlementPolicy, SettlementState, plan_settlement};
+pub use ledger::{
+ ReloadState, SettlementPlan, SettlementPolicy, SettlementState, plan_reload, plan_settlement,
+};
pub use models::{
- AiUsageBilling, AllowanceDecision, AllowanceStore, BillingError, BillingPeriod,
- BillingSettings, CREDIT_PACKS_CENTS, DenyReason, Entitlement, MIN_STRIPE_CHARGE_CENTS,
+ AUTO_RELOAD_DEFAULT_MINIMUM_CENTS, AUTO_RELOAD_DEFAULT_TARGET_CENTS,
+ AUTO_RELOAD_TARGET_MAX_CENTS, AiUsageBilling, AllowanceDecision, AllowanceStore,
+ AutoReloadSnapshot, AutoReloadThresholds, BillingError, BillingPeriod, BillingSettings,
+ CREDIT_PACKS_CENTS, CreditReloadStatus, DenyReason, Entitlement, MIN_STRIPE_CHARGE_CENTS,
OVERAGE_CHARGE_THRESHOLD_CENTS, OVERAGE_LIMIT_MAX_CENTS, OVERAGE_LIMIT_MIN_CENTS,
OpenPeriodStart, OverageChargeStatus, PayerScope, PeriodAllowance, PeriodLedger, PlanTier,
Result, SeatAllowance, SeatGeneration, SeatUsage, SubscriptionScope, UsagePolicy,
UsageSnapshot,
};
pub use ports::{
- BillingRepo, BillingService, CreditCheckoutRequest, EntitlementSource, OverageChargeRequest,
- PaymentGateway, PendingCharge, SettlementOutcome, SettlementTrigger, UsageReader,
+ BillingRepo, BillingService, CreditCheckoutRequest, CreditReloadRequest, EntitlementSource,
+ OverageChargeRequest, PaymentGateway, PendingCharge, PendingReload, ResolvedReload,
+ SettlementOutcome, SettlementTrigger, UsageReader,
};
pub use pricing::{
AiPricing, IncludedAllowanceCents, OverageMarkupPercent, PlanAllowances, PricingError,
diff --git a/crates/ai_billing/src/domain/admission/test.rs b/crates/ai_billing/src/domain/admission/test.rs
index 792d33700d..73a1dc2397 100644
--- a/crates/ai_billing/src/domain/admission/test.rs
+++ b/crates/ai_billing/src/domain/admission/test.rs
@@ -46,6 +46,14 @@ impl BillingService for FakeBilling {
) -> BillingResult<UsageSnapshot> {
panic!("admission must not change settings")
}
+ async fn update_auto_reload(
+ &self,
+ _: &MacroUserIdStr<'_>,
+ _: bool,
+ _: crate::domain::AutoReloadThresholds,
+ ) -> BillingResult<UsageSnapshot> {
+ panic!("admission must not change settings")
+ }
async fn create_credit_checkout(
&self,
_: &MacroUserIdStr<'_>,
@@ -75,6 +83,9 @@ impl BillingService for FakeBilling {
async fn mark_overage_invoice(&self, _: &str, _: bool) -> BillingResult<()> {
panic!("admission must not handle invoices")
}
+ async fn mark_credit_reload_invoice(&self, _: &str, _: bool) -> BillingResult<()> {
+ panic!("admission must not handle invoices")
+ }
}
fn user() -> MacroUserIdStr<'static> {
diff --git a/crates/ai_billing/src/domain/ledger.rs b/crates/ai_billing/src/domain/ledger.rs
index db391b20b4..bc76a22357 100644
--- a/crates/ai_billing/src/domain/ledger.rs
+++ b/crates/ai_billing/src/domain/ledger.rs
@@ -12,6 +12,9 @@
//! uncovered = max(0, chargeable - covered)
//! headroom = (covered - chargeable) + credit_balance + overage_room
//! remaining = seat_remaining_cost + cost_cents_covered_by(headroom)
+//! effective = credit_balance - uncovered
+//! reload = min(target - effective, monthly_limit - reloaded_this_month)
+//! when effective < minimum
//! ```
//!
//! The markup is applied to the period's cumulative chargeable cost, never to
@@ -22,6 +25,11 @@
//! simply usage that has not been booked yet; the gate accounts for it through
//! `headroom`.
//!
+//! When automatic reloads are on, the current period is checked before
+//! settlement: `effective` is what the balance will be once this settlement
+//! consumes credits, and a reload tops it back up to `target` (within the
+//! calendar-month limit) so credits, not overage, pay for the usage.
+//!
//! Free users have no credits or overage: their `remaining` is only the
//! unused part of the free allowance, and nothing is ever settled for them.
@@ -29,8 +37,8 @@
mod test;
use super::models::{
- AllowanceDecision, BillingPeriod, BillingSettings, DenyReason, Entitlement,
- MIN_STRIPE_CHARGE_CENTS, PeriodLedger, PlanTier, UsageSnapshot,
+ AllowanceDecision, AutoReloadSnapshot, AutoReloadThresholds, BillingPeriod, BillingSettings,
+ DenyReason, Entitlement, MIN_STRIPE_CHARGE_CENTS, PeriodLedger, PlanTier, UsageSnapshot,
};
use super::pricing::AiPricing;
use macro_user_id::user_id::MacroUserIdStr;
@@ -107,6 +115,39 @@ pub fn plan_settlement(state: SettlementState, policy: SettlementPolicy) -> Sett
}
}
+/// The balance position an automatic reload plans against.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct ReloadState {
+ /// Current credit balance, customer cents.
+ pub credit_balance_cents: i64,
+ /// Current-period chargeable money not yet covered by credits or charges,
+ /// customer cents. The settlement that follows will consume it from the
+ /// balance.
+ pub uncovered_cents: i64,
+ /// Reloads already reserved or paid this UTC calendar month, customer cents.
+ pub spent_this_month_cents: i64,
+}
+
+/// Decide whether to reload credits now and by how much.
+///
+/// Reloads when the balance left after settling the uncovered usage drops
+/// below the minimum, topping it back up to the target. The monthly limit caps
+/// the amount; a remainder Stripe would reject is skipped rather than charged.
+pub fn plan_reload(state: ReloadState, thresholds: &AutoReloadThresholds) -> Option<i64> {
+ let effective = state.credit_balance_cents - state.uncovered_cents;
+ if effective >= thresholds.minimum_cents {
+ return None;
+ }
+
+ let mut amount = thresholds.target_cents - effective;
+ if let Some(limit) = thresholds.monthly_limit_cents {
+ let room = (limit - state.spent_this_month_cents).max(0);
+ amount = amount.min(room);
+ }
+
+ (amount >= MIN_STRIPE_CHARGE_CENTS).then_some(amount)
+}
+
/// Assemble the API-facing snapshot from the resolved inputs. `used_cost_cents`
/// is this seat's usage at cost; `shared_chargeable_customer_cents` is the
/// payer's cumulative usage beyond all seat allowances, already marked up at
@@ -164,6 +205,13 @@ pub fn build_snapshot(
overage_limit_cents: settings.overage_limit_cents,
overage_charged_cents: ledger.overage_charged_cents,
overage_suspended: settings.overage_suspended_at.is_some(),
+ auto_reload: AutoReloadSnapshot {
+ minimum_balance_cents: settings.auto_reload.minimum_cents,
+ target_balance_cents: settings.auto_reload.target_cents,
+ monthly_spend_limit_cents: settings.auto_reload.monthly_limit_cents,
+ suspended: settings.auto_reload_suspended_at.is_some(),
+ active: settings.auto_reload_active(),
+ },
uncovered_cents,
remaining_cents,
blocked_reason: None,
diff --git a/crates/ai_billing/src/domain/ledger/test.rs b/crates/ai_billing/src/domain/ledger/test.rs
index 62c571c964..4703850332 100644
--- a/crates/ai_billing/src/domain/ledger/test.rs
+++ b/crates/ai_billing/src/domain/ledger/test.rs
@@ -1,5 +1,8 @@
use super::*;
-use crate::domain::models::{OVERAGE_CHARGE_THRESHOLD_CENTS, PayerScope};
+use crate::domain::models::{
+ AUTO_RELOAD_TARGET_MAX_CENTS, BillingError, OVERAGE_CHARGE_THRESHOLD_CENTS,
+ OVERAGE_LIMIT_MIN_CENTS, PayerScope,
+};
use crate::domain::pricing::AiPricing;
use chrono::{TimeZone, Utc};
@@ -173,6 +176,96 @@ fn settling_in_chunks_books_the_same_money_as_settling_once() {
);
}
+fn reload_state(balance: i64, uncovered: i64, spent: i64) -> ReloadState {
+ ReloadState {
+ credit_balance_cents: balance,
+ uncovered_cents: uncovered,
+ spent_this_month_cents: spent,
+ }
+}
+
+fn thresholds(minimum: i64, target: i64, monthly_limit: Option<i64>) -> AutoReloadThresholds {
+ AutoReloadThresholds {
+ minimum_cents: minimum,
+ target_cents: target,
+ monthly_limit_cents: monthly_limit,
+ }
+}
+
+#[test]
+fn no_reload_at_or_above_the_minimum() {
+ let t = thresholds(1_000, 10_000, None);
+ assert_eq!(plan_reload(reload_state(1_000, 0, 0), &t), None);
+ assert_eq!(plan_reload(reload_state(5_000, 0, 0), &t), None);
+ // Uncovered usage is subtracted first, but 1_500 - 500 still meets the minimum.
+ assert_eq!(plan_reload(reload_state(1_500, 500, 0), &t), None);
+}
+
+#[test]
+fn reload_tops_the_effective_balance_up_to_the_target() {
+ let t = thresholds(1_000, 10_000, None);
+ assert_eq!(plan_reload(reload_state(999, 0, 0), &t), Some(9_001));
+ assert_eq!(plan_reload(reload_state(500, 0, 0), &t), Some(9_500));
+ // Uncovered usage past the balance leaves a negative effective balance
+ // that the reload also has to cover.
+ assert_eq!(plan_reload(reload_state(500, 2_000, 0), &t), Some(11_500));
+}
+
+#[test]
+fn monthly_limit_caps_the_reload() {
+ let t = thresholds(1_000, 10_000, Some(5_000));
+ assert_eq!(plan_reload(reload_state(0, 0, 0), &t), Some(5_000));
+ assert_eq!(plan_reload(reload_state(0, 0, 3_000), &t), Some(2_000));
+ // The limit is spent (or overspent): nothing left to reload.
+ assert_eq!(plan_reload(reload_state(0, 0, 5_000), &t), None);
+ assert_eq!(plan_reload(reload_state(0, 0, 6_000), &t), None);
+}
+
+#[test]
+fn reload_below_the_stripe_minimum_is_skipped() {
+ // Only 49 cents of monthly room left.
+ let t = thresholds(1_000, 10_000, Some(5_000));
+ assert_eq!(plan_reload(reload_state(0, 0, 4_951), &t), None);
+ assert_eq!(plan_reload(reload_state(0, 0, 4_950), &t), Some(50));
+}
+
+#[test]
+fn default_thresholds_are_valid() {
+ let defaults = AutoReloadThresholds::default();
+ assert_eq!(defaults, thresholds(1_000, 10_000, None));
+ assert!(defaults.validate().is_ok());
+}
+
+#[test]
+fn thresholds_reject_each_invalid_setting() {
+ let invalid = [
+ thresholds(0, 10_000, None),
+ thresholds(-1, 10_000, None),
+ thresholds(1_000, 1_049, None),
+ thresholds(1_000, AUTO_RELOAD_TARGET_MAX_CENTS + 1, None),
+ thresholds(1_000, 10_000, Some(0)),
+ thresholds(1_000, 10_000, Some(-1)),
+ thresholds(1_000, 10_000, Some(OVERAGE_LIMIT_MIN_CENTS - 1)),
+ ];
+ for t in invalid {
+ assert!(
+ matches!(t.validate(), Err(BillingError::InvalidAutoReload(_))),
+ "{t:?} should be invalid"
+ );
+ }
+
+ assert!(thresholds(1_000, 1_050, None).validate().is_ok());
+ assert!(
+ thresholds(
+ 1_000,
+ AUTO_RELOAD_TARGET_MAX_CENTS,
+ Some(OVERAGE_LIMIT_MIN_CENTS)
+ )
+ .validate()
+ .is_ok()
+ );
+}
+
fn snapshot_for(
tier: PlanTier,
settings: BillingSettings,
@@ -330,6 +423,53 @@ fn gate_reports_failed_payment_when_suspended() {
);
}
+#[test]
+fn snapshot_reports_auto_reload_settings_and_activity() {
+ let s = snapshot_for(
+ PlanTier::Premium,
+ BillingSettings::default(),
+ 0,
+ PeriodLedger::default(),
+ 0,
+ );
+ assert_eq!(s.auto_reload.minimum_balance_cents, 1_000);
+ assert_eq!(s.auto_reload.target_balance_cents, 10_000);
+ assert_eq!(s.auto_reload.monthly_spend_limit_cents, None);
+ assert!(!s.auto_reload.suspended);
+ assert!(!s.auto_reload.active, "overage off: reloads never fire");
+
+ let settings = BillingSettings {
+ overage_enabled: true,
+ overage_limit_cents: 2_000,
+ auto_reload: thresholds(2_000, 20_000, Some(50_000)),
+ ..Default::default()
+ };
+ let s = snapshot_for(
+ PlanTier::Premium,
+ settings.clone(),
+ 0,
+ PeriodLedger::default(),
+ 0,
+ );
+ assert_eq!(s.auto_reload.minimum_balance_cents, 2_000);
+ assert_eq!(s.auto_reload.target_balance_cents, 20_000);
+ assert_eq!(s.auto_reload.monthly_spend_limit_cents, Some(50_000));
+ assert!(s.auto_reload.active);
+
+ let s = snapshot_for(
+ PlanTier::Premium,
+ BillingSettings {
+ auto_reload_suspended_at: Some(Utc::now()),
+ ..settings
+ },
+ 0,
+ PeriodLedger::default(),
+ 0,
+ );
+ assert!(s.auto_reload.suspended);
+ assert!(!s.auto_reload.active);
+}
+
#[test]
fn free_users_are_hard_capped_at_the_free_allowance() {
let s = snapshot_for(
diff --git a/crates/ai_billing/src/domain/models.rs b/crates/ai_billing/src/domain/models.rs
index 4d1f2ccd20..f0882ae061 100644
--- a/crates/ai_billing/src/domain/models.rs
+++ b/crates/ai_billing/src/domain/models.rs
@@ -52,6 +52,14 @@ pub const CREDIT_PACKS_CENTS: [i64; 4] = [1_000, 2_500, 5_000, 10_000];
pub const OVERAGE_LIMIT_MIN_CENTS: i64 = 500;
/// Largest per-period overage cap a payer may set.
pub const OVERAGE_LIMIT_MAX_CENTS: i64 = 500_000;
+/// Credit balance below which an automatic reload fires, unless the payer
+/// has set their own minimum.
+pub const AUTO_RELOAD_DEFAULT_MINIMUM_CENTS: i64 = 1_000;
+/// Credit balance an automatic reload tops up to, unless the payer has set
+/// their own target.
+pub const AUTO_RELOAD_DEFAULT_TARGET_CENTS: i64 = 10_000;
+/// Largest automatic reload target a payer may set.
+pub const AUTO_RELOAD_TARGET_MAX_CENTS: i64 = 500_000;
/// Accrued overage is charged once it reaches this much (or when the period
/// ends), so a payer sees a few predictable charges rather than one per
/// completion.
@@ -413,6 +421,65 @@ impl Entitlement {
}
}
+/// When and how far a payer's credit balance is automatically reloaded.
+///
+/// Reloads piggyback on the overage opt-in: they only run while
+/// [`BillingSettings::overage_active`] holds.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct AutoReloadThresholds {
+ /// Reload once the effective balance drops below this, in customer cents.
+ pub minimum_cents: i64,
+ /// Reload the balance back up to this, in customer cents.
+ pub target_cents: i64,
+ /// Most a payer will be reloaded per UTC calendar month, in customer
+ /// cents. `None` means no limit.
+ pub monthly_limit_cents: Option<i64>,
+}
+
+impl Default for AutoReloadThresholds {
+ fn default() -> Self {
+ Self {
+ minimum_cents: AUTO_RELOAD_DEFAULT_MINIMUM_CENTS,
+ target_cents: AUTO_RELOAD_DEFAULT_TARGET_CENTS,
+ monthly_limit_cents: None,
+ }
+ }
+}
+
+impl AutoReloadThresholds {
+ /// Reject thresholds that could never produce a chargeable reload or
+ /// that exceed the offered range.
+ pub fn validate(&self) -> Result<()> {
+ if self.minimum_cents <= 0 {
+ return Err(BillingError::InvalidAutoReload(
+ "minimum balance must be positive",
+ ));
+ }
+ if self.target_cents < self.minimum_cents + MIN_STRIPE_CHARGE_CENTS {
+ return Err(BillingError::InvalidAutoReload(
+ "target balance must be at least $0.50 above the minimum balance",
+ ));
+ }
+ if self.target_cents > AUTO_RELOAD_TARGET_MAX_CENTS {
+ return Err(BillingError::InvalidAutoReload(
+ "target balance exceeds the largest offered reload",
+ ));
+ }
+ // The monthly limit doubles as the per-period overage cap, which is
+ // clamped into the offered range: a smaller limit would be raised to
+ // the cap minimum and the payer billed more than they set.
+ if self
+ .monthly_limit_cents
+ .is_some_and(|limit| limit < OVERAGE_LIMIT_MIN_CENTS)
+ {
+ return Err(BillingError::InvalidAutoReload(
+ "monthly spend limit must be at least $5",
+ ));
+ }
+ Ok(())
+ }
+}
+
/// The payer's overage settings, Stripe period anchor, and open-seat generation.
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct BillingSettings {
@@ -422,6 +489,10 @@ pub struct BillingSettings {
pub overage_limit_cents: i64,
/// Set when an overage charge failed to collect.
pub overage_suspended_at: Option<DateTime<Utc>>,
+ /// When and how far credits are automatically reloaded.
+ pub auto_reload: AutoReloadThresholds,
+ /// Set when an automatic reload failed to collect.
+ pub auto_reload_suspended_at: Option<DateTime<Utc>>,
/// The subscription period last observed from Stripe (webhook or read-through).
pub period_anchor: Option<(DateTime<Utc>, DateTime<Utc>)>,
/// Generation of the payer's open-seat roster. Zero when no account row exists.
@@ -433,6 +504,12 @@ impl BillingSettings {
pub fn overage_active(&self) -> bool {
self.overage_enabled && self.overage_suspended_at.is_none() && self.overage_limit_cents > 0
}
+
+ /// Whether credits are automatically reloaded: overage is on and no
+ /// reload has failed since the payer last re-enabled it.
+ pub fn auto_reload_active(&self) -> bool {
+ self.overage_active() && self.auto_reload_suspended_at.is_none()
+ }
}
/// What has already been settled against a period.
@@ -472,6 +549,21 @@ pub enum OverageChargeStatus {
Failed,
}
+/// Lifecycle of an automatic credit reload pushed to Stripe.
+#[derive(
+ Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, strum::Display, strum::EnumString,
+)]
+#[serde(rename_all = "snake_case")]
+#[strum(serialize_all = "snake_case")]
+pub enum CreditReloadStatus {
+ /// Reserved; Stripe not yet confirmed.
+ Pending,
+ /// Collected and booked as credits.
+ Paid,
+ /// Collection failed and automatic reloads are suspended.
+ Failed,
+}
+
/// Why a request was refused.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ToSchema, strum::Display)]
#[serde(rename_all = "snake_case")]
@@ -527,6 +619,22 @@ pub enum AllowanceDecision {
Deny(DenyReason),
}
+/// The payer's automatic reload settings, as shown in Billing settings.
+#[derive(Debug, Clone, Serialize, ToSchema)]
+pub struct AutoReloadSnapshot {
+ /// Reload once the effective balance drops below this, in customer cents.
+ pub minimum_balance_cents: i64,
+ /// Reload the balance back up to this, in customer cents.
+ pub target_balance_cents: i64,
+ /// Most reloaded per UTC calendar month, in customer cents. `null` when
+ /// there is no limit.
+ pub monthly_spend_limit_cents: Option<i64>,
+ /// Whether reloads are paused after a failed reload charge.
+ pub suspended: bool,
+ /// Whether reloads will fire: overage is on and reloads are not suspended.
+ pub active: bool,
+}
+
/// The payer's current-period position, as shown in Billing settings and used
/// by the gate.
#[derive(Debug, Clone, Serialize, ToSchema)]
@@ -562,6 +670,9 @@ pub struct UsageSnapshot {
pub overage_charged_cents: i64,
/// Whether overage is paused after a failed charge.
pub overage_suspended: bool,
+ /// Automatic credit reload settings. `active` means overage is on and
+ /// reloads are not suspended.
+ pub auto_reload: AutoReloadSnapshot,
/// Team-wide usage beyond per-seat allowances, at the overage markup, that
/// is not yet covered by shared credits or charges (awaiting settlement).
/// Customer cents.
@@ -590,6 +701,10 @@ pub enum BillingError {
/// Outside the allowed overage cap range.
#[error("overage limit must be between ${} and ${}", OVERAGE_LIMIT_MIN_CENTS / 100, OVERAGE_LIMIT_MAX_CENTS / 100)]
InvalidOverageLimit,
+ /// Automatic reload thresholds that could never charge or exceed the
+ /// offered range ([`AutoReloadThresholds::validate`]).
+ #[error("invalid automatic reload settings: {0}")]
+ InvalidAutoReload(&'static str),
/// The payer has no Stripe customer to bill.
#[error("no payment account on file")]
NoStripeCustomer,
diff --git a/crates/ai_billing/src/domain/ports.rs b/crates/ai_billing/src/domain/ports.rs
index 95dd378708..21cbce8515 100644
--- a/crates/ai_billing/src/domain/ports.rs
+++ b/crates/ai_billing/src/domain/ports.rs
@@ -4,9 +4,10 @@
use super::financial::FundingPeriod;
use super::ledger::SettlementPolicy;
use super::models::{
- AllowanceDecision, AllowanceStore, BillingPeriod, BillingSettings, Entitlement,
- OpenPeriodStart, OverageChargeStatus, PeriodAllowance, PeriodLedger, Result, SeatAllowance,
- SeatGeneration, SeatUsage, SubscriptionScope, UsageSnapshot,
+ AllowanceDecision, AllowanceStore, AutoReloadThresholds, BillingPeriod, BillingSettings,
+ CreditReloadStatus, Entitlement, OpenPeriodStart, OverageChargeStatus, PeriodAllowance,
+ PeriodLedger, Result, SeatAllowance, SeatGeneration, SeatUsage, SubscriptionScope,
+ UsageSnapshot,
};
use super::policy::UsageAllocation;
use ai_usage::domain::financial::{
@@ -98,6 +99,28 @@ pub struct PendingCharge {
pub stripe_invoice_id: Option<String>,
}
+/// An automatic credit reload reserved in the ledger that still has to be
+/// collected.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct PendingReload {
+ /// The `ai_credit_reload` row.
+ pub id: Uuid,
+ /// Amount to collect and then book as credits, customer cents.
+ pub amount_cents: i64,
+ /// The Stripe invoice an earlier attempt opened for this reload, if any.
+ /// A retry pays that invoice instead of opening a second one.
+ pub stripe_invoice_id: Option<String>,
+}
+
+/// A credit reload whose Stripe invoice outcome just changed.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct ResolvedReload {
+ /// Who the credits belong to.
+ pub payer: MacroUserIdStr<'static>,
+ /// Amount collected (or not), customer cents.
+ pub amount_cents: i64,
+}
+
/// What a settlement booked.
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct SettlementOutcome {
@@ -265,6 +288,74 @@ pub trait BillingRepo: Send + Sync + 'static {
&self,
payer: &MacroUserIdStr<'_>,
) -> impl Future<Output = Result<Option<OverageChargeStatus>>> + Send;
+
+ /// Set overage on/off with the cap, and optionally the reload thresholds.
+ /// `None` thresholds keep the stored ones. Clears both the overage and the
+ /// reload suspension.
+ fn update_auto_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ enabled: bool,
+ overage_limit_cents: i64,
+ thresholds: Option<&AutoReloadThresholds>,
+ ) -> impl Future<Output = Result<()>> + Send;
+
+ /// Atomically decide whether to reload credits: under the payer's row
+ /// lock, read the balance and the period ledger, run
+ /// [`plan_reload`](super::ledger::plan_reload) with the stored thresholds
+ /// against the usage `chargeable_customer_cents` that credits or charges
+ /// have not yet covered, and reserve a pending reload. Reloads in the UTC
+ /// calendar month containing `now` that Stripe may still collect (pending,
+ /// paid, or failed with an invoice) count against the monthly limit.
+ ///
+ /// `None` unless [`BillingSettings::auto_reload_active`] holds. A reload
+ /// reserved earlier whose collection never finished is handed back so the
+ /// retry reuses its id, Stripe idempotency keys, and invoice: a pending
+ /// reload with no invoice that went stale, or a failed reload whose
+ /// invoice is still open (returned as pending again). Any other pending
+ /// reload blocks a new one until Stripe resolves it.
+ fn reserve_credit_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ period_start: DateTime<Utc>,
+ chargeable_customer_cents: i64,
+ now: DateTime<Utc>,
+ ) -> impl Future<Output = Result<Option<PendingReload>>> + Send;
+
+ /// Record the result of collecting a reserved reload.
+ fn finish_credit_reload(
+ &self,
+ reload_id: Uuid,
+ stripe_invoice_id: Option<&str>,
+ status: CreditReloadStatus,
+ ) -> impl Future<Output = Result<()>> + Send;
+
+ /// Book a collected reload as purchased credits. Returns `false` when
+ /// `stripe_invoice_id` was already booked (collector and webhook both
+ /// reported it).
+ fn record_credit_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ amount_cents: i64,
+ stripe_invoice_id: &str,
+ ) -> impl Future<Output = Result<bool>> + Send;
+
+ /// Update a reload by its Stripe invoice (webhook). Returns the payer and
+ /// amount when the invoice was one of ours *and* the status changed.
+ /// `Paid` is terminal: a late or duplicate failure event never un-pays a
+ /// reload, and re-reporting the current status is a no-op.
+ fn resolve_credit_reload_invoice(
+ &self,
+ stripe_invoice_id: &str,
+ status: CreditReloadStatus,
+ ) -> impl Future<Output = Result<Option<ResolvedReload>>> + Send;
+
+ /// Pause automatic reloads after a failed collection. Overage itself
+ /// stays as it was.
+ fn suspend_auto_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ ) -> impl Future<Output = Result<()>> + Send;
}
/// A one-off credit purchase to start.
@@ -298,6 +389,24 @@ pub struct OverageChargeRequest {
pub scope: SubscriptionScope,
}
+/// An automatic credit reload to invoice.
+#[derive(Debug, Clone)]
+pub struct CreditReloadRequest {
+ /// The payer's Stripe customer.
+ pub customer_id: String,
+ /// The payer, stamped on the invoice so the webhook can book the credits.
+ pub payer: MacroUserIdStr<'static>,
+ /// The reserved reload; doubles as the idempotency key, so opening the
+ /// same reload twice yields the same invoice.
+ pub reload_id: Uuid,
+ /// Amount, customer cents.
+ pub amount_cents: i64,
+ /// Line description shown on the invoice.
+ pub description: String,
+ /// Which subscription pays this reload.
+ pub scope: SubscriptionScope,
+}
+
/// The payment provider.
pub trait PaymentGateway: Send + Sync + 'static {
/// Start a Checkout Session for a credit pack; returns the hosted URL.
@@ -319,10 +428,23 @@ pub trait PaymentGateway: Send + Sync + 'static {
request: OverageChargeRequest,
) -> impl Future<Output = Result<String>> + Send;
- /// Attempt to collect an open overage invoice now. `scope` is the payer's
- /// current subscription scope. A scope stamped on the invoice overrides
- /// it. Invoices without that stamp use `scope`. Distinct effective methods
- /// in the chosen scope fail with
+ /// Open a finalized invoice for exactly this credit reload, following the
+ /// same routing and payment-method rules as [`open_overage_invoice`]
+ /// (selected by [`CreditReloadRequest::scope`]). Returns the invoice id.
+ /// Idempotent on `reload_id`.
+ ///
+ /// [`open_overage_invoice`]: PaymentGateway::open_overage_invoice
+ fn open_credit_reload_invoice(
+ &self,
+ request: CreditReloadRequest,
+ ) -> impl Future<Output = Result<String>> + Send;
+
+ /// Attempt to collect now an open one-off invoice this crate opened (an
+ /// overage chunk or a credit reload). `charge_id` is the reserved charge
+ /// or reload id and only keeps the idempotency key unique. `scope` is the
+ /// payer's current subscription scope. A scope stamped on the invoice
+ /// overrides it. Invoices without that stamp use `scope`. Distinct
+ /// effective methods in the chosen scope fail with
/// [`BillingError::Payment`](super::BillingError::Payment).
/// If no active or trialing subscription matches, an invoice-stored
/// payment method may still collect the existing debt.
@@ -409,6 +531,18 @@ pub trait BillingService: Send + Sync + 'static {
limit_cents: i64,
) -> impl Future<Output = Result<UsageSnapshot>> + Send;
+ /// Turn automatic credit reloads, and with them overage, on with
+ /// `thresholds` or off. Payer only. Enabling validates the thresholds,
+ /// derives the overage cap from the monthly spend limit, clears both
+ /// suspensions, and settles right away, so a balance already under the
+ /// minimum reloads immediately. Disabling keeps the stored thresholds.
+ fn update_auto_reload(
+ &self,
+ user: &MacroUserIdStr<'_>,
+ enabled: bool,
+ thresholds: AutoReloadThresholds,
+ ) -> impl Future<Output = Result<UsageSnapshot>> + Send;
+
/// Start a credit-pack purchase. Payer only. Returns the Checkout URL.
fn create_credit_checkout(
&self,
@@ -444,4 +578,14 @@ pub trait BillingService: Send + Sync + 'static {
stripe_invoice_id: &str,
paid: bool,
) -> impl Future<Output = Result<()>> + Send;
+
+ /// Record the outcome of a credit reload invoice (webhook). Unknown
+ /// invoices are ignored. A paid invoice books its credits once, even when
+ /// the collector already did, and settles; a failed one pauses automatic
+ /// reloads.
+ fn mark_credit_reload_invoice(
+ &self,
+ stripe_invoice_id: &str,
+ paid: bool,
+ ) -> impl Future<Output = Result<()>> + Send;
}
diff --git a/crates/ai_billing/src/domain/service.rs b/crates/ai_billing/src/domain/service.rs
index 67d71be848..85da05aaf7 100644
--- a/crates/ai_billing/src/domain/service.rs
+++ b/crates/ai_billing/src/domain/service.rs
@@ -6,16 +6,16 @@ mod test;
use super::ledger::{SettlementPolicy, build_snapshot, decide};
use super::models::{
- AiUsageBilling, AllowanceDecision, AllowanceStore, BillingError, BillingPeriod,
- BillingSettings, CREDIT_PACKS_CENTS, Entitlement, OVERAGE_CHARGE_THRESHOLD_CENTS,
- OVERAGE_LIMIT_MAX_CENTS, OVERAGE_LIMIT_MIN_CENTS, OverageChargeStatus, PayerScope,
- PeriodAllowance, PeriodLedger, Result, SeatAllowance, SeatUsage, SubscriptionScope,
- UsageSnapshot,
+ AiUsageBilling, AllowanceDecision, AllowanceStore, AutoReloadThresholds, BillingError,
+ BillingPeriod, BillingSettings, CREDIT_PACKS_CENTS, CreditReloadStatus, Entitlement,
+ OVERAGE_CHARGE_THRESHOLD_CENTS, OVERAGE_LIMIT_MAX_CENTS, OVERAGE_LIMIT_MIN_CENTS,
+ OverageChargeStatus, PayerScope, PeriodAllowance, PeriodLedger, Result, SeatAllowance,
+ SeatUsage, SubscriptionScope, UsageSnapshot,
};
use super::period::{PeriodSync, SubscriptionPeriod};
use super::ports::{
- BillingRepo, BillingService, CreditCheckoutRequest, EntitlementSource, OverageChargeRequest,
- PaymentGateway, PendingCharge, UsageReader,
+ BillingRepo, BillingService, CreditCheckoutRequest, CreditReloadRequest, EntitlementSource,
+ OverageChargeRequest, PaymentGateway, PendingCharge, PendingReload, UsageReader,
};
use super::pricing::AiPricing;
use ai_usage::AiUsageEnforcement;
@@ -94,6 +94,20 @@ impl<E, U, R, P> BillingServiceImpl<E, U, R, P> {
}
}
+/// Whether settling a period may first top up credits automatically.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+enum ReloadCheck {
+ /// A closed period is settled from what is on hand.
+ Skip,
+ /// The open period reloads credits before any overage is reserved.
+ Current,
+}
+
+/// `cents` as a dollar amount for an invoice line, e.g. `$95.00`.
+fn dollars(cents: i64) -> String {
+ format!("${}.{:02}", cents / 100, cents % 100)
+}
+
/// Everything resolved for one user at one instant.
struct Position {
entitlement: Entitlement,
@@ -421,14 +435,16 @@ where
Ok(entitlement.seat_allowances(self.pricing))
}
- /// Settle one period for a payer: book uncovered usage from credits, then
- /// reserve and collect an overage chunk.
+ /// Settle one period for a payer: top up credits when automatic reload
+ /// asks for it, book uncovered usage from credits, then reserve and
+ /// collect an overage chunk.
#[tracing::instrument(skip(self, entitlement), fields(payer = %entitlement.payer), err)]
async fn settle_period(
&self,
entitlement: &Entitlement,
period: BillingPeriod,
now: DateTime<Utc>,
+ reload: ReloadCheck,
) -> Result<()> {
let seats = self.allowance_for_period(entitlement, period, now).await?;
let users: Vec<_> = seats.iter().map(|seat| seat.user.clone()).collect();
@@ -441,12 +457,18 @@ where
.legacy_seats(&entitlement.payer, period, seats)
.await?;
let chargeable_cost = chargeable_cost_cents(&seats, &usage);
- if chargeable_cost == 0 {
- return Ok(());
- }
// Mark up the cumulative total, never an increment: the repository
// books the difference from what earlier settlements already covered.
let chargeable_customer_cents = self.pricing.extra_customer_cents(chargeable_cost);
+ if reload == ReloadCheck::Current {
+ // Before credits are consumed, so the top-up covers this usage
+ // instead of an overage chunk.
+ self.reload_credits(entitlement, period.start, chargeable_customer_cents, now)
+ .await?;
+ }
+ if chargeable_cost == 0 {
+ return Ok(());
+ }
let outcome = self
.repo
@@ -592,6 +614,154 @@ where
self.repo.suspend_overage(payer).await
}
+ /// Reserve and collect an automatic credit reload when the payer's
+ /// balance, net of the usage this settlement is about to consume, is
+ /// under their minimum. A card or customer problem is logged and left to
+ /// the webhook or the next attempt: it never blocks the overage fallback
+ /// or the summary read that triggered settlement.
+ async fn reload_credits(
+ &self,
+ entitlement: &Entitlement,
+ period_start: DateTime<Utc>,
+ chargeable_customer_cents: i64,
+ now: DateTime<Utc>,
+ ) -> Result<()> {
+ let Some(reload) = self
+ .repo
+ .reserve_credit_reload(
+ &entitlement.payer,
+ period_start,
+ chargeable_customer_cents,
+ now,
+ )
+ .await?
+ else {
+ return Ok(());
+ };
+ match self.collect_reload(entitlement, reload).await {
+ Ok(()) => Ok(()),
+ Err(e @ (BillingError::Payment(_) | BillingError::NoStripeCustomer)) => {
+ tracing::warn!(
+ error = ?e,
+ "automatic credit reload failed; overage remains the fallback"
+ );
+ Ok(())
+ }
+ Err(e) => Err(e),
+ }
+ }
+
+ /// Collect a reserved credit reload: open its invoice (or pick up the one
+ /// an earlier attempt opened), try to pay it, and book the credits once
+ /// paid. A provider failure marks the reload failed and pauses automatic
+ /// reloads until the payer saves their settings again. A recorded invoice
+ /// stays on the row because Stripe may still collect it, in which case
+ /// the webhook books the credits.
+ async fn collect_reload(&self, entitlement: &Entitlement, reload: PendingReload) -> Result<()> {
+ let payer = &entitlement.payer;
+ let scope = SubscriptionScope::from(&entitlement.scope);
+ let customer_id = match self.entitlements.stripe_customer_id(payer).await {
+ Ok(Some(customer_id)) => customer_id,
+ Ok(None) => {
+ tracing::warn!("credit reload reserved but payer has no stripe customer");
+ self.fail_reload(payer, reload.id).await?;
+ return Err(BillingError::NoStripeCustomer);
+ }
+ Err(e) => {
+ self.fail_reload(payer, reload.id).await?;
+ return Err(e);
+ }
+ };
+
+ let invoice_id = match reload.stripe_invoice_id.clone() {
+ Some(invoice_id) => invoice_id,
+ None => {
+ let description = format!(
+ "Macro AI credits, automatic reload of {}",
+ dollars(reload.amount_cents)
+ );
+ match self
+ .payments
+ .open_credit_reload_invoice(CreditReloadRequest {
+ customer_id,
+ payer: payer.clone(),
+ reload_id: reload.id,
+ amount_cents: reload.amount_cents,
+ description,
+ scope,
+ })
+ .await
+ {
+ Ok(invoice_id) => invoice_id,
+ Err(e) => {
+ tracing::error!(
+ error = ?e,
+ cents = reload.amount_cents,
+ "ai credit reload invoice could not be opened"
+ );
+ self.fail_reload(payer, reload.id).await?;
+ return Err(e);
+ }
+ }
+ }
+ };
+ // Record the invoice before collecting: if this process dies here the
+ // next settlement pays this invoice instead of opening another.
+ self.repo
+ .finish_credit_reload(reload.id, Some(&invoice_id), CreditReloadStatus::Pending)
+ .await?;
+
+ match self
+ .payments
+ .pay_overage_invoice(reload.id, &invoice_id, scope)
+ .await
+ {
+ Ok(true) => {
+ self.repo
+ .record_credit_reload(payer, reload.amount_cents, &invoice_id)
+ .await?;
+ self.repo
+ .finish_credit_reload(reload.id, Some(&invoice_id), CreditReloadStatus::Paid)
+ .await?;
+ tracing::info!(
+ cents = reload.amount_cents,
+ invoice = %invoice_id,
+ "collected automatic ai credit reload"
+ );
+ Ok(())
+ }
+ Ok(false) => {
+ // Declined: the invoice stays open for Stripe's retries and
+ // the webhook books the credits if one succeeds.
+ tracing::info!(
+ cents = reload.amount_cents,
+ invoice = %invoice_id,
+ "ai credit reload invoice awaiting payment"
+ );
+ Ok(())
+ }
+ Err(e) => {
+ tracing::error!(
+ error = ?e,
+ cents = reload.amount_cents,
+ invoice = %invoice_id,
+ "ai credit reload failed"
+ );
+ self.fail_reload(payer, reload.id).await?;
+ Err(e)
+ }
+ }
+ }
+
+ /// A reload that could not be collected: automatic reloads pause until
+ /// the payer saves their settings again. Overage itself stays as it was.
+ async fn fail_reload(&self, payer: &MacroUserIdStr<'_>, reload_id: Uuid) -> Result<()> {
+ self.repo
+ .finish_credit_reload(reload_id, None, CreditReloadStatus::Failed)
+ .await?;
+ self.repo.suspend_auto_reload(payer).await
+ }
+
fn require_payer(entitlement: &Entitlement, user: &MacroUserIdStr<'_>) -> Result<()> {
if !entitlement.is_payer(user) {
return Err(BillingError::NotPayer);
@@ -664,10 +834,20 @@ where
// flushed before the current one accrues. Closed-period settlement
// uses the freeze recorded while that period was open, not the live
// plan or seat list.
- self.settle_period(&position.entitlement, position.period.previous(), now)
- .await?;
- self.settle_period(&position.entitlement, position.period, now)
- .await
+ self.settle_period(
+ &position.entitlement,
+ position.period.previous(),
+ now,
+ ReloadCheck::Skip,
+ )
+ .await?;
+ self.settle_period(
+ &position.entitlement,
+ position.period,
+ now,
+ ReloadCheck::Current,
+ )
+ .await
}
#[tracing::instrument(skip(self), err)]
@@ -696,6 +876,46 @@ where
self.snapshot(user).await
}
+ #[tracing::instrument(skip(self), err)]
+ async fn update_auto_reload(
+ &self,
+ user: &MacroUserIdStr<'_>,
+ enabled: bool,
+ thresholds: AutoReloadThresholds,
+ ) -> Result<UsageSnapshot> {
+ let entitlement = self.entitlements.entitlement(user).await?;
+ Self::require_payer(&entitlement, user)?;
+ if !enabled {
+ self.repo
+ .update_auto_reload(&entitlement.payer, false, 0, None)
+ .await?;
+ return self.snapshot(user).await;
+ }
+ thresholds.validate()?;
+ // The dialog has no overage cap of its own: the monthly spend limit
+ // doubles as the per-period cap. Validation keeps it at or above the
+ // cap minimum, so the clamp only ever lowers it.
+ let overage_limit_cents = thresholds
+ .monthly_limit_cents
+ .unwrap_or(OVERAGE_LIMIT_MAX_CENTS)
+ .clamp(OVERAGE_LIMIT_MIN_CENTS, OVERAGE_LIMIT_MAX_CENTS);
+ self.repo
+ .update_auto_reload(
+ &entitlement.payer,
+ true,
+ overage_limit_cents,
+ Some(&thresholds),
+ )
+ .await?;
+ // A balance already under the minimum reloads now, and anything that
+ // was waiting on overage is retried; a collection failure re-suspends
+ // and is reported in the snapshot.
+ if let Err(e) = self.settle(user).await {
+ tracing::warn!(error = ?e, "settlement after enabling automatic reload failed");
+ }
+ self.snapshot(user).await
+ }
+
#[tracing::instrument(skip(self, success_url, cancel_url), err)]
async fn create_credit_checkout(
&self,
@@ -801,4 +1021,34 @@ where
Some(OverageChargeStatus::Pending) | None => Ok(()),
}
}
+
+ #[tracing::instrument(skip(self), err)]
+ async fn mark_credit_reload_invoice(&self, stripe_invoice_id: &str, paid: bool) -> Result<()> {
+ let status = if paid {
+ CreditReloadStatus::Paid
+ } else {
+ CreditReloadStatus::Failed
+ };
+ let Some(resolved) = self
+ .repo
+ .resolve_credit_reload_invoice(stripe_invoice_id, status)
+ .await?
+ else {
+ // Not ours, already paid, or already in this state.
+ return Ok(());
+ };
+ if !paid {
+ return self.repo.suspend_auto_reload(&resolved.payer).await;
+ }
+ // Idempotent on the invoice: the collector may have booked these
+ // credits before the webhook arrived.
+ self.repo
+ .record_credit_reload(&resolved.payer, resolved.amount_cents, stripe_invoice_id)
+ .await?;
+ // The reloaded credits cover any usage that was waiting on them.
+ if let Err(e) = self.settle(&resolved.payer).await {
+ tracing::warn!(error = ?e, "settlement after credit reload failed");
+ }
+ Ok(())
+ }
}
diff --git a/crates/ai_billing/src/domain/service/test.rs b/crates/ai_billing/src/domain/service/test.rs
index 0264f04304..32955ef756 100644
--- a/crates/ai_billing/src/domain/service/test.rs
+++ b/crates/ai_billing/src/domain/service/test.rs
@@ -1,10 +1,10 @@
use super::*;
-use crate::domain::ledger::plan_settlement;
+use crate::domain::ledger::{ReloadState, plan_reload, plan_settlement};
use crate::domain::models::{
- AllowanceStore, DenyReason, OpenPeriodStart, PayerScope, PeriodAllowance, PeriodLedger,
- PlanTier, SeatGeneration,
+ AllowanceStore, AutoReloadThresholds, CreditReloadStatus, DenyReason, OpenPeriodStart,
+ PayerScope, PeriodAllowance, PeriodLedger, PlanTier, SeatGeneration,
};
-use crate::domain::ports::SettlementOutcome;
+use crate::domain::ports::{CreditReloadRequest, PendingReload, ResolvedReload, SettlementOutcome};
use chrono::TimeZone;
use macro_user_id::cowlike::CowLike;
use macro_uuid::Uuid;
@@ -152,6 +152,16 @@ struct FakeCharge {
invoice: Option<String>,
}
+/// One `ai_credit_reload` row.
+#[derive(Debug, Clone)]
+struct FakeReload {
+ id: Uuid,
+ amount_cents: i64,
+ status: CreditReloadStatus,
+ invoice: Option<String>,
+ created_at: DateTime<Utc>,
+}
+
#[derive(Default)]
struct RepoState {
settings: BillingSettings,
@@ -161,6 +171,8 @@ struct RepoState {
purchases: Vec<String>,
charges: Vec<FakeCharge>,
suspended: bool,
+ reloads: Vec<FakeReload>,
+ auto_reload_suspended: bool,
allowances: HashMap<DateTime<Utc>, PeriodAllowance>,
releases: Vec<(String, DateTime<Utc>, String)>,
activated_seats: Vec<String>,
@@ -194,6 +206,18 @@ impl FakeRepo {
fn charges(&self) -> Vec<FakeCharge> {
self.state.lock().unwrap().charges.clone()
}
+ fn reloads(&self) -> Vec<FakeReload> {
+ self.state.lock().unwrap().reloads.clone()
+ }
+ fn set_balance(&self, cents: i64) {
+ self.state.lock().unwrap().balance = cents;
+ }
+ /// Overage without automatic reloads, as after a failed reload charge.
+ /// Overage tests that start with no credits use this so the default
+ /// thresholds do not top the balance up before the chunk is reserved.
+ fn pause_reloads(&self) {
+ self.state.lock().unwrap().auto_reload_suspended = true;
+ }
fn freeze(&self, period_start: DateTime<Utc>, allowance: PeriodAllowance) {
self.state
.lock()
@@ -238,6 +262,7 @@ impl BillingRepo for FakeRepo {
let s = self.state.lock().unwrap();
let mut settings = s.settings.clone();
settings.overage_suspended_at = s.suspended.then(Utc::now);
+ settings.auto_reload_suspended_at = s.auto_reload_suspended.then(Utc::now);
Ok(settings)
}
async fn update_overage(
@@ -465,6 +490,146 @@ impl BillingRepo for FakeRepo {
) -> Result<Option<OverageChargeStatus>> {
Ok(self.state.lock().unwrap().charges.last().map(|c| c.status))
}
+ async fn update_auto_reload(
+ &self,
+ _payer: &MacroUserIdStr<'_>,
+ enabled: bool,
+ overage_limit_cents: i64,
+ thresholds: Option<&AutoReloadThresholds>,
+ ) -> Result<()> {
+ let mut s = self.state.lock().unwrap();
+ s.settings.overage_enabled = enabled;
+ s.settings.overage_limit_cents = overage_limit_cents;
+ if let Some(thresholds) = thresholds {
+ s.settings.auto_reload = *thresholds;
+ }
+ s.suspended = false;
+ s.auto_reload_suspended = false;
+ Ok(())
+ }
+ /// Mirrors the Postgres adapter: a stale uninvoiced reload is handed
+ /// back, any other pending reload blocks, otherwise plan a new one.
+ async fn reserve_credit_reload(
+ &self,
+ _payer: &MacroUserIdStr<'_>,
+ period_start: DateTime<Utc>,
+ chargeable_customer_cents: i64,
+ now: DateTime<Utc>,
+ ) -> Result<Option<PendingReload>> {
+ let mut s = self.state.lock().unwrap();
+ let active = s.settings.overage_enabled
+ && !s.suspended
+ && s.settings.overage_limit_cents > 0
+ && !s.auto_reload_suspended;
+ if !active {
+ return Ok(None);
+ }
+
+ let stale_before = now - chrono::Duration::minutes(10);
+ let pending: Vec<&FakeReload> = s
+ .reloads
+ .iter()
+ .filter(|r| r.status == CreditReloadStatus::Pending)
+ .collect();
+ if let Some(orphan) = pending
+ .iter()
+ .find(|r| r.invoice.is_none() && r.created_at < stale_before)
+ {
+ return Ok(Some(PendingReload {
+ id: orphan.id,
+ amount_cents: orphan.amount_cents,
+ stripe_invoice_id: orphan.invoice.clone(),
+ }));
+ }
+ if !pending.is_empty() {
+ return Ok(None);
+ }
+
+ let ledger = s.ledger(period_start);
+ let covered = ledger.credits_consumed_cents + ledger.overage_charged_cents;
+ let month = BillingPeriod::calendar_month(now);
+ let spent_this_month_cents = s
+ .reloads
+ .iter()
+ .filter(|r| {
+ r.status != CreditReloadStatus::Failed
+ && month.start <= r.created_at
+ && r.created_at < month.end
+ })
+ .map(|r| r.amount_cents)
+ .sum();
+ let amount_cents = plan_reload(
+ ReloadState {
+ credit_balance_cents: s.balance,
+ uncovered_cents: (chargeable_customer_cents - covered).max(0),
+ spent_this_month_cents,
+ },
+ &s.settings.auto_reload,
+ );
+ let Some(amount_cents) = amount_cents else {
+ return Ok(None);
+ };
+ let id = macro_uuid::generate_uuid_v7();
+ s.reloads.push(FakeReload {
+ id,
+ amount_cents,
+ status: CreditReloadStatus::Pending,
+ invoice: None,
+ created_at: now,
+ });
+ Ok(Some(PendingReload {
+ id,
+ amount_cents,
+ stripe_invoice_id: None,
+ }))
+ }
+ async fn finish_credit_reload(
+ &self,
+ reload_id: Uuid,
+ stripe_invoice_id: Option<&str>,
+ status: CreditReloadStatus,
+ ) -> Result<()> {
+ let mut s = self.state.lock().unwrap();
+ for r in s.reloads.iter_mut().filter(|r| r.id == reload_id) {
+ r.status = status;
+ if let Some(inv) = stripe_invoice_id {
+ r.invoice = Some(inv.to_string());
+ }
+ }
+ Ok(())
+ }
+ async fn record_credit_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ amount_cents: i64,
+ stripe_invoice_id: &str,
+ ) -> Result<bool> {
+ self.record_credit_purchase(payer, amount_cents, stripe_invoice_id)
+ .await
+ }
+ async fn resolve_credit_reload_invoice(
+ &self,
+ stripe_invoice_id: &str,
+ status: CreditReloadStatus,
+ ) -> Result<Option<ResolvedReload>> {
+ let mut s = self.state.lock().unwrap();
+ let found = s.reloads.iter_mut().find(|r| {
+ r.invoice.as_deref() == Some(stripe_invoice_id)
+ && r.status != CreditReloadStatus::Paid
+ && r.status != status
+ });
+ Ok(found.map(|r| {
+ r.status = status;
+ ResolvedReload {
+ payer: user("[email protected]"),
+ amount_cents: r.amount_cents,
+ }
+ }))
+ }
+ async fn suspend_auto_reload(&self, _payer: &MacroUserIdStr<'_>) -> Result<()> {
+ self.state.lock().unwrap().auto_reload_suspended = true;
+ Ok(())
+ }
}
/// How the fake provider answers the next payment attempts.
@@ -492,6 +657,7 @@ struct FakePayments {
pay_outcome: Arc<Mutex<PayOutcome>>,
checkouts: Arc<Mutex<Vec<CreditCheckoutRequest>>>,
opened: Arc<Mutex<Vec<OverageChargeRequest>>>,
+ opened_reloads: Arc<Mutex<Vec<CreditReloadRequest>>>,
payments: Arc<Mutex<Vec<(Uuid, String)>>>,
period_reply: Arc<Mutex<PeriodReply>>,
period_requests: Arc<Mutex<Vec<(String, SubscriptionScope)>>>,
@@ -510,6 +676,9 @@ impl FakePayments {
fn opened(&self) -> Vec<OverageChargeRequest> {
self.opened.lock().unwrap().clone()
}
+ fn opened_reloads(&self) -> Vec<CreditReloadRequest> {
+ self.opened_reloads.lock().unwrap().clone()
+ }
fn payments(&self) -> Vec<(Uuid, String)> {
self.payments.lock().unwrap().clone()
}
@@ -528,6 +697,14 @@ impl PaymentGateway for FakePayments {
self.opened.lock().unwrap().push(request);
Ok(invoice)
}
+ async fn open_credit_reload_invoice(&self, request: CreditReloadRequest) -> Result<String> {
+ if *self.fail_open.lock().unwrap() {
+ return Err(BillingError::Payment(anyhow::anyhow!("stripe unavailable")));
+ }
+ let invoice = format!("in_{}", request.reload_id);
+ self.opened_reloads.lock().unwrap().push(request);
+ Ok(invoice)
+ }
async fn pay_overage_invoice(
&self,
charge_id: Uuid,
@@ -627,6 +804,14 @@ async fn period_sync_is_gated_and_never_calls_payments_or_changes_item_anchors()
type Service = BillingServiceImpl<FakeEntitlements, FakeUsage, FakeRepo, FakePayments>;
+fn thresholds(minimum: i64, target: i64, monthly_limit: Option<i64>) -> AutoReloadThresholds {
+ AutoReloadThresholds {
+ minimum_cents: minimum,
+ target_cents: target,
+ monthly_limit_cents: monthly_limit,
+ }
+}
+
fn premium_service(used_cents: i64) -> (Service, FakeRepo, FakePayments, FakeUsage) {
premium_service_with(AiUsageBilling::Enabled, used_cents)
}
@@ -987,6 +1172,11 @@ async fn free_users_are_hard_capped_at_the_free_allowance() {
svc.update_overage(&free, true, 5_000).await,
Err(BillingError::FreePlan)
));
+ assert!(matches!(
+ svc.update_auto_reload(&free, true, AutoReloadThresholds::default())
+ .await,
+ Err(BillingError::FreePlan)
+ ));
assert!(matches!(
svc.create_credit_checkout(&free, 1_000, String::new(), String::new())
.await,
@@ -1044,6 +1234,7 @@ async fn credits_unblock_and_settlement_consumes_them() {
async fn overage_is_charged_in_chunks_and_respects_the_cap() {
let (svc, repo, payments, usage) = premium_service(2_500);
let payer = user("[email protected]");
+ repo.pause_reloads();
let snap = svc.update_overage(&payer, true, 2_000).await.unwrap();
assert!(snap.overage_enabled);
@@ -1081,6 +1272,7 @@ async fn overage_is_charged_in_chunks_and_respects_the_cap() {
async fn failed_overage_charge_suspends_overage_and_is_retried_not_duplicated() {
let (svc, repo, payments, _) = premium_service(3_500);
let payer = user("[email protected]");
+ repo.pause_reloads();
payments.set_pay(PayOutcome::Error);
// Enabling settles; the collection failure is swallowed into the snapshot.
@@ -1119,6 +1311,7 @@ async fn failed_overage_charge_suspends_overage_and_is_retried_not_duplicated()
async fn opening_the_invoice_failing_marks_the_charge_failed() {
let (svc, repo, payments, _) = premium_service(3_500);
let payer = user("[email protected]");
+ repo.pause_reloads();
*payments.fail_open.lock().unwrap() = true;
let snap = svc.update_overage(&payer, true, 5_000).await.unwrap();
@@ -1142,6 +1335,7 @@ async fn opening_the_invoice_failing_marks_the_charge_failed() {
async fn a_failed_uninvoiced_charge_whose_usage_credits_covered_is_not_retried() {
let (svc, repo, payments, _) = premium_service(3_800);
let payer = user("[email protected]");
+ repo.pause_reloads();
*payments.fail_open.lock().unwrap() = true;
svc.update_overage(&payer, true, 10_000).await.unwrap();
assert_eq!(repo.charges()[0].status, OverageChargeStatus::Failed);
@@ -1170,6 +1364,7 @@ async fn a_failed_uninvoiced_charge_whose_usage_credits_covered_is_not_retried()
async fn failed_invoiced_charge_keeps_coverage_when_credits_are_bought() {
let (svc, repo, payments, _) = premium_service(5_000);
let payer = user("[email protected]");
+ repo.pause_reloads();
payments.set_pay(PayOutcome::Error);
svc.update_overage(&payer, true, 10_000).await.unwrap();
@@ -1202,6 +1397,7 @@ async fn failed_invoiced_charge_keeps_coverage_when_credits_are_bought() {
async fn a_declined_card_leaves_the_invoice_open_for_the_webhook() {
let (svc, repo, payments, _) = premium_service(3_500);
let payer = user("[email protected]");
+ repo.pause_reloads();
payments.set_pay(PayOutcome::Declined);
let snap = svc.update_overage(&payer, true, 5_000).await.unwrap();
@@ -1249,6 +1445,11 @@ async fn only_the_payer_manages_billing_and_needs_a_paid_plan() {
svc.update_overage(&member, true, 1_000).await,
Err(BillingError::NotPayer)
));
+ assert!(matches!(
+ svc.update_auto_reload(&member, true, AutoReloadThresholds::default())
+ .await,
+ Err(BillingError::NotPayer)
+ ));
assert!(matches!(
svc.create_credit_checkout(&member, 1_000, "s".into(), "c".into())
.await,
@@ -1340,6 +1541,7 @@ async fn team_seats_keep_allowances_separate_and_share_credits() {
async fn overage_invoice_webhooks_update_suspension() {
let (svc, repo, payments, _) = premium_service(3_500);
let payer = user("[email protected]");
+ repo.pause_reloads();
payments.set_pay(PayOutcome::Declined);
svc.update_overage(&payer, true, 5_000).await.unwrap();
let invoice = repo.charges()[0].invoice.clone().unwrap();
@@ -1369,6 +1571,7 @@ async fn overage_invoice_webhooks_update_suspension() {
async fn out_of_order_invoice_webhooks_follow_the_newest_charge() {
let (svc, repo, payments, usage) = premium_service(4_000);
let payer = user("[email protected]");
+ repo.pause_reloads();
payments.set_pay(PayOutcome::Declined);
// Charge A: 2_000 cost over, 2_100 owed, declined, awaiting Stripe.
svc.update_overage(&payer, true, 10_000).await.unwrap();
@@ -1399,6 +1602,7 @@ async fn out_of_order_invoice_webhooks_follow_the_newest_charge() {
// The mirror image: a late failure for an older invoice after the newest
// charge went through does not re-suspend.
let (svc, repo, payments, usage) = premium_service(4_000);
+ repo.pause_reloads();
payments.set_pay(PayOutcome::Declined);
svc.update_overage(&payer, true, 10_000).await.unwrap();
*usage.cents.lock().unwrap() = 5_500;
@@ -1418,6 +1622,438 @@ async fn out_of_order_invoice_webhooks_follow_the_newest_charge() {
assert_eq!(repo.charges()[0].status, OverageChargeStatus::Failed);
}
+#[tokio::test]
+async fn disabled_billing_never_reloads_credits() {
+ let (svc, repo, payments, _) = premium_service_with(AiUsageBilling::Disabled, 2_600);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+
+ let snap = svc
+ .update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ assert!(snap.overage_enabled);
+ assert!(snap.auto_reload.active);
+ svc.settle(&payer).await.unwrap();
+ svc.snapshot(&payer).await.unwrap();
+
+ assert!(repo.reloads().is_empty());
+ assert!(payments.opened_reloads().is_empty());
+ assert!(payments.payments().is_empty());
+ assert_eq!(repo.state.lock().unwrap().balance, 500);
+}
+
+#[tokio::test]
+async fn overage_off_never_reloads_credits() {
+ let (svc, repo, payments, _) = premium_service(2_600);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+
+ svc.settle(&payer).await.unwrap();
+ let snap = svc.snapshot(&payer).await.unwrap();
+
+ assert!(!snap.overage_enabled);
+ assert!(!snap.auto_reload.active);
+ assert!(!snap.auto_reload.suspended);
+ assert!(repo.reloads().is_empty());
+ assert!(payments.opened_reloads().is_empty());
+ // The 630 owed drains the 500 of credits; the rest stays uncovered.
+ assert_eq!(snap.credit_balance_cents, 0);
+ assert_eq!(snap.uncovered_cents, 130);
+}
+
+#[tokio::test]
+async fn a_low_balance_reloads_credits_before_overage_is_reserved() {
+ let (svc, repo, payments, _) = premium_service(2_600);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+
+ // 600 cost over is 630 owed: the balance would end at -130, so the
+ // reload brings it back to the $100 target after this usage is paid.
+ let snap = svc
+ .update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ let opened = payments.opened_reloads();
+ assert_eq!(opened.len(), 1);
+ assert_eq!(opened[0].amount_cents, 10_130);
+ assert_eq!(opened[0].customer_id, "cus_123");
+ assert_eq!(opened[0].payer, payer);
+ assert_eq!(opened[0].scope, SubscriptionScope::Personal);
+ assert!(opened[0].description.contains("$101.30"));
+ let reloads = repo.reloads();
+ assert_eq!(reloads.len(), 1);
+ assert_eq!(reloads[0].status, CreditReloadStatus::Paid);
+ assert_eq!(
+ reloads[0].invoice.as_deref(),
+ Some(format!("in_{}", reloads[0].id).as_str())
+ );
+ assert_eq!(
+ payments.payments(),
+ vec![(reloads[0].id, format!("in_{}", reloads[0].id))]
+ );
+
+ // The reloaded credits covered the usage: no overage chunk was reserved.
+ assert_eq!(snap.credits_consumed_cents, 630);
+ assert_eq!(snap.credit_balance_cents, 10_000);
+ assert_eq!(snap.overage_charged_cents, 0);
+ assert_eq!(snap.uncovered_cents, 0);
+ assert!(repo.charges().is_empty());
+ assert!(payments.opened().is_empty());
+
+ // Back at the target, nothing more is reloaded.
+ svc.settle(&payer).await.unwrap();
+ assert_eq!(repo.reloads().len(), 1);
+}
+
+#[tokio::test]
+async fn reload_amount_covers_the_usage_about_to_be_consumed() {
+ // 1_904 cost over is exactly 2_000 owed at the 5% markup.
+ let (svc, repo, payments, _) = premium_service(3_904);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+
+ let snap = svc
+ .update_auto_reload(&payer, true, thresholds(1_000, 10_000, None))
+ .await
+ .unwrap();
+
+ // 500 on hand less 2_000 owed is -1_500; reaching 10_000 takes 11_500.
+ assert_eq!(payments.opened_reloads()[0].amount_cents, 11_500);
+ assert_eq!(repo.reloads()[0].amount_cents, 11_500);
+ assert_eq!(snap.credits_consumed_cents, 2_000);
+ assert_eq!(snap.credit_balance_cents, 10_000);
+ assert!(repo.charges().is_empty());
+}
+
+#[tokio::test]
+async fn monthly_spend_limit_caps_reloads() {
+ let (svc, repo, payments, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+
+ let snap = svc
+ .update_auto_reload(&payer, true, thresholds(1_000, 10_000, Some(5_000)))
+ .await
+ .unwrap();
+ assert_eq!(payments.opened_reloads()[0].amount_cents, 5_000);
+ assert_eq!(snap.credit_balance_cents, 5_500);
+ assert_eq!(snap.auto_reload.monthly_spend_limit_cents, Some(5_000));
+
+ // The month's limit is spent: draining the balance reloads nothing more.
+ repo.set_balance(500);
+ svc.settle(&payer).await.unwrap();
+ assert_eq!(repo.reloads().len(), 1);
+ assert_eq!(payments.opened_reloads().len(), 1);
+ assert_eq!(repo.state.lock().unwrap().balance, 500);
+}
+
+#[tokio::test]
+async fn a_declined_reload_stays_pending_for_the_webhook() {
+ let (svc, repo, payments, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+ payments.set_pay(PayOutcome::Declined);
+
+ let snap = svc
+ .update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ // Not suspended: Stripe retries, the webhook decides.
+ assert!(snap.auto_reload.active);
+ assert!(!snap.auto_reload.suspended);
+ assert_eq!(snap.credit_balance_cents, 500);
+ let reloads = repo.reloads();
+ assert_eq!(reloads.len(), 1);
+ assert_eq!(reloads[0].status, CreditReloadStatus::Pending);
+ assert!(reloads[0].invoice.is_some());
+
+ // While it is open no second reload is reserved or attempted.
+ svc.settle(&payer).await.unwrap();
+ assert_eq!(repo.reloads().len(), 1);
+ assert_eq!(payments.payments().len(), 1);
+}
+
+#[tokio::test]
+async fn a_failed_reload_pauses_reloads_and_falls_back_to_overage() {
+ let (svc, repo, payments, _) = premium_service(3_500);
+ let payer = user("[email protected]");
+ payments.set_pay(PayOutcome::Error);
+
+ // The reload fails first; the 1_575 owed still goes to an overage chunk,
+ // which fails on the same card. Neither failure fails the call.
+ let snap = svc
+ .update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ let reloads = repo.reloads();
+ assert_eq!(reloads.len(), 1);
+ assert_eq!(reloads[0].status, CreditReloadStatus::Failed);
+ // The invoice stays on the row because Stripe may still collect it.
+ assert!(reloads[0].invoice.is_some());
+ assert!(snap.auto_reload.suspended);
+ assert!(!snap.auto_reload.active);
+ assert!(snap.overage_suspended);
+ let charges = repo.charges();
+ assert_eq!(charges.len(), 1);
+ assert_eq!(charges[0].amount_cents, 1_575);
+ assert_eq!(charges[0].status, OverageChargeStatus::Failed);
+ assert_eq!(payments.payments().len(), 2);
+
+ // Re-enabling overage alone retries the chunk but leaves reloads paused.
+ payments.set_pay(PayOutcome::Paid);
+ let snap = svc.update_overage(&payer, true, 10_000).await.unwrap();
+ assert_eq!(repo.charges()[0].status, OverageChargeStatus::Paid);
+ assert_eq!(snap.overage_charged_cents, 1_575);
+ assert!(snap.auto_reload.suspended);
+ assert_eq!(repo.reloads().len(), 1);
+ assert_eq!(payments.opened_reloads().len(), 1);
+
+ // Saving the reload settings clears the pause and reloads right away.
+ let snap = svc
+ .update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ assert!(snap.auto_reload.active);
+ let reloads = repo.reloads();
+ assert_eq!(reloads.len(), 2);
+ assert_eq!(reloads[1].status, CreditReloadStatus::Paid);
+ assert_eq!(reloads[1].amount_cents, 10_000);
+ assert_eq!(snap.credit_balance_cents, 10_000);
+}
+
+#[tokio::test]
+async fn enabling_auto_reload_validates_the_thresholds() {
+ let (svc, repo, payments, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+
+ for invalid in [
+ thresholds(0, 10_000, None),
+ thresholds(-1, 10_000, None),
+ thresholds(1_000, 1_049, None),
+ thresholds(1_000, 500_001, None),
+ thresholds(1_000, 10_000, Some(0)),
+ ] {
+ assert!(
+ matches!(
+ svc.update_auto_reload(&payer, true, invalid).await,
+ Err(BillingError::InvalidAutoReload(_))
+ ),
+ "{invalid:?} must be rejected"
+ );
+ }
+ let settings = repo.settings(&payer).await.unwrap();
+ assert!(!settings.overage_enabled);
+ assert_eq!(settings.auto_reload, AutoReloadThresholds::default());
+ assert!(repo.reloads().is_empty());
+ assert!(payments.opened_reloads().is_empty());
+
+ // Disabling never validates: the stored thresholds are kept as they are.
+ svc.update_auto_reload(&payer, false, thresholds(0, 0, Some(0)))
+ .await
+ .unwrap();
+ assert_eq!(
+ repo.settings(&payer).await.unwrap().auto_reload,
+ AutoReloadThresholds::default()
+ );
+}
+
+#[tokio::test]
+async fn enabling_auto_reload_turns_overage_on_clears_suspensions_and_settles() {
+ let (svc, repo, _, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+ {
+ let mut state = repo.state.lock().unwrap();
+ state.suspended = true;
+ state.auto_reload_suspended = true;
+ }
+
+ // No monthly limit: the overage cap is the most the dialog allows.
+ let snap = svc
+ .update_auto_reload(&payer, true, thresholds(2_000, 20_000, None))
+ .await
+ .unwrap();
+ assert!(snap.overage_enabled);
+ assert!(!snap.overage_suspended);
+ assert_eq!(snap.auto_reload.minimum_balance_cents, 2_000);
+ assert_eq!(snap.auto_reload.target_balance_cents, 20_000);
+ assert_eq!(snap.auto_reload.monthly_spend_limit_cents, None);
+ assert!(!snap.auto_reload.suspended);
+ assert!(snap.auto_reload.active);
+ assert_eq!(
+ repo.settings(&payer).await.unwrap().overage_limit_cents,
+ OVERAGE_LIMIT_MAX_CENTS
+ );
+ // Enabling settled, so the low balance reloaded at once.
+ assert_eq!(repo.reloads().len(), 1);
+ assert_eq!(repo.reloads()[0].amount_cents, 19_500);
+ assert_eq!(snap.credit_balance_cents, 20_000);
+
+ // A monthly limit becomes the overage cap, within the offered range; one
+ // under the cap minimum is rejected rather than raised.
+ assert!(matches!(
+ svc.update_auto_reload(&payer, true, thresholds(2_000, 20_000, Some(100)))
+ .await,
+ Err(BillingError::InvalidAutoReload(_))
+ ));
+ for (monthly_limit, overage_limit) in [
+ (OVERAGE_LIMIT_MIN_CENTS, OVERAGE_LIMIT_MIN_CENTS),
+ (25_000, 25_000),
+ (1_000_000, OVERAGE_LIMIT_MAX_CENTS),
+ ] {
+ let snap = svc
+ .update_auto_reload(&payer, true, thresholds(2_000, 20_000, Some(monthly_limit)))
+ .await
+ .unwrap();
+ assert_eq!(
+ snap.auto_reload.monthly_spend_limit_cents,
+ Some(monthly_limit)
+ );
+ assert_eq!(
+ repo.settings(&payer).await.unwrap().overage_limit_cents,
+ overage_limit
+ );
+ }
+ assert_eq!(repo.reloads().len(), 1);
+}
+
+#[tokio::test]
+async fn disabling_auto_reload_turns_overage_off_and_keeps_the_thresholds() {
+ let (svc, repo, _, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(10_000);
+ let custom = thresholds(2_000, 20_000, Some(30_000));
+ svc.update_auto_reload(&payer, true, custom).await.unwrap();
+
+ let snap = svc
+ .update_auto_reload(&payer, false, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ assert!(!snap.overage_enabled);
+ assert!(!snap.auto_reload.active);
+ assert_eq!(snap.auto_reload.minimum_balance_cents, 2_000);
+ assert_eq!(snap.auto_reload.target_balance_cents, 20_000);
+ assert_eq!(snap.auto_reload.monthly_spend_limit_cents, Some(30_000));
+ let settings = repo.settings(&payer).await.unwrap();
+ assert!(!settings.overage_enabled);
+ assert_eq!(settings.overage_limit_cents, 0);
+ assert_eq!(settings.auto_reload, custom);
+
+ // Off means off: a low balance no longer reloads.
+ repo.set_balance(500);
+ svc.settle(&payer).await.unwrap();
+ assert!(repo.reloads().is_empty());
+}
+
+#[tokio::test]
+async fn reload_invoice_webhooks_book_credits_once() {
+ // Collected synchronously: the webhook finds nothing left to book.
+ let (svc, repo, _, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+ svc.update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ let invoice = repo.reloads()[0].invoice.clone().unwrap();
+ assert_eq!(repo.state.lock().unwrap().balance, 10_000);
+ svc.mark_credit_reload_invoice(&invoice, true)
+ .await
+ .unwrap();
+ assert_eq!(repo.state.lock().unwrap().balance, 10_000);
+
+ // Declined at first, collected by Stripe's retry: the webhook books it.
+ let (svc, repo, payments, _) = premium_service(0);
+ repo.set_balance(500);
+ payments.set_pay(PayOutcome::Declined);
+ svc.update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ let invoice = repo.reloads()[0].invoice.clone().unwrap();
+ assert_eq!(repo.state.lock().unwrap().balance, 500);
+ svc.mark_credit_reload_invoice(&invoice, true)
+ .await
+ .unwrap();
+ assert_eq!(repo.reloads()[0].status, CreditReloadStatus::Paid);
+ assert_eq!(repo.state.lock().unwrap().balance, 10_000);
+
+ // Paid is terminal: a duplicate or a late failure changes nothing.
+ svc.mark_credit_reload_invoice(&invoice, true)
+ .await
+ .unwrap();
+ svc.mark_credit_reload_invoice(&invoice, false)
+ .await
+ .unwrap();
+ assert_eq!(repo.state.lock().unwrap().balance, 10_000);
+ assert_eq!(repo.reloads()[0].status, CreditReloadStatus::Paid);
+ assert!(!svc.snapshot(&payer).await.unwrap().auto_reload.suspended);
+
+ // Unknown invoices are ignored.
+ svc.mark_credit_reload_invoice("in_unknown", false)
+ .await
+ .unwrap();
+ assert!(!svc.snapshot(&payer).await.unwrap().auto_reload.suspended);
+}
+
+#[tokio::test]
+async fn a_failed_reload_invoice_webhook_pauses_reloads_only() {
+ let (svc, repo, payments, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(500);
+ payments.set_pay(PayOutcome::Declined);
+ svc.update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ let invoice = repo.reloads()[0].invoice.clone().unwrap();
+
+ svc.mark_credit_reload_invoice(&invoice, false)
+ .await
+ .unwrap();
+ assert_eq!(repo.reloads()[0].status, CreditReloadStatus::Failed);
+ let snap = svc.snapshot(&payer).await.unwrap();
+ assert!(snap.auto_reload.suspended);
+ assert!(!snap.auto_reload.active);
+ // Overage itself is untouched by a reload failure.
+ assert!(snap.overage_enabled);
+ assert!(!snap.overage_suspended);
+
+ // Paused: the low balance does not reload again.
+ payments.set_pay(PayOutcome::Paid);
+ svc.settle(&payer).await.unwrap();
+ assert_eq!(repo.reloads().len(), 1);
+ assert_eq!(repo.state.lock().unwrap().balance, 500);
+}
+
+#[tokio::test]
+async fn snapshot_reports_whether_automatic_reload_is_active() {
+ let (svc, repo, _, _) = premium_service(0);
+ let payer = user("[email protected]");
+ repo.set_balance(10_000);
+
+ let snap = svc.snapshot(&payer).await.unwrap();
+ assert!(!snap.auto_reload.active);
+ assert!(!snap.auto_reload.suspended);
+
+ let snap = svc
+ .update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ assert!(snap.auto_reload.active);
+
+ // Reloads ride on overage: an overage suspension stops them too.
+ repo.suspend_overage(&payer).await.unwrap();
+ let snap = svc.snapshot(&payer).await.unwrap();
+ assert!(snap.overage_suspended);
+ assert!(!snap.auto_reload.suspended);
+ assert!(!snap.auto_reload.active);
+
+ svc.update_auto_reload(&payer, false, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+ assert!(!svc.snapshot(&payer).await.unwrap().auto_reload.active);
+}
+
#[tokio::test]
async fn synced_period_anchors_the_snapshot() {
let (svc, ..) = premium_service(0);
@@ -1536,6 +2172,7 @@ async fn snapshot_freezes_the_open_period_allowance_and_refreshes_it() {
#[tokio::test]
async fn previous_period_overage_uses_the_frozen_allowance_not_the_live_one() {
let (svc, repo, payments, usage, _, payer, previous, current) = anchored_premium(0);
+ repo.pause_reloads();
svc.sync_period(&payer, current.start, current.end, None)
.await
.unwrap();
@@ -1573,6 +2210,7 @@ async fn previous_period_overage_uses_the_frozen_allowance_not_the_live_one() {
#[tokio::test]
async fn previous_period_does_not_charge_usage_its_frozen_allowance_included() {
let (svc, repo, payments, usage, _, payer, previous, current) = anchored_premium(0);
+ repo.pause_reloads();
svc.sync_period(&payer, current.start, current.end, None)
.await
.unwrap();
@@ -1596,6 +2234,32 @@ async fn previous_period_does_not_charge_usage_its_frozen_allowance_included() {
assert!(repo.charges().is_empty());
}
+#[tokio::test]
+async fn previous_period_usage_never_triggers_a_reload() {
+ let (svc, repo, payments, usage, _, payer, previous, current) = anchored_premium(0);
+ svc.sync_period(&payer, current.start, current.end, None)
+ .await
+ .unwrap();
+ // 2_000 cost over the closed period's allowance is 2_100 owed, with no
+ // credits on hand.
+ usage.add(&payer, previous.start + chrono::Duration::days(2), 4_000);
+
+ svc.update_auto_reload(&payer, true, AutoReloadThresholds::default())
+ .await
+ .unwrap();
+
+ // The closed period is collected as overage, not topped up with a
+ // reload; only the open period reloads, and only for its own usage.
+ let opened = payments.opened();
+ assert_eq!(opened.len(), 1);
+ assert_eq!(opened[0].amount_cents, 2_100);
+ assert_eq!(repo.charges()[0].period_start, previous.start);
+ let reloads = repo.reloads();
+ assert_eq!(reloads.len(), 1);
+ assert_eq!(reloads[0].amount_cents, 10_000);
+ assert_eq!(repo.state.lock().unwrap().balance, 10_000);
+}
+
#[tokio::test]
async fn previous_period_usage_uses_the_frozen_billed_users() {
let owner = user("[email protected]");
@@ -1660,6 +2324,7 @@ async fn previous_period_usage_uses_the_frozen_billed_users() {
50_000,
);
ents.set(new_team);
+ repo.pause_reloads();
svc.update_overage(&owner, true, 10_000).await.unwrap();
svc.settle(&owner).await.unwrap();
@@ -1676,6 +2341,7 @@ async fn previous_period_usage_uses_the_frozen_billed_users() {
#[tokio::test]
async fn current_period_uses_the_live_allowance_not_a_stale_freeze() {
let (svc, repo, payments, usage, _, payer, _, current) = anchored_premium(0);
+ repo.pause_reloads();
svc.sync_period(&payer, current.start, current.end, None)
.await
.unwrap();
diff --git a/crates/ai_billing/src/inbound/axum_router.rs b/crates/ai_billing/src/inbound/axum_router.rs
index 3d977ebc65..74c70c1367 100644
--- a/crates/ai_billing/src/inbound/axum_router.rs
+++ b/crates/ai_billing/src/inbound/axum_router.rs
@@ -3,8 +3,10 @@
//! hooks.
use crate::domain::{
- AiPricing, BillingError, BillingService, CREDIT_PACKS_CENTS, OVERAGE_LIMIT_MAX_CENTS,
- OVERAGE_LIMIT_MIN_CENTS, PaymentGateway, PlanTier, SubscriptionScope, UsageSnapshot,
+ AUTO_RELOAD_DEFAULT_MINIMUM_CENTS, AUTO_RELOAD_DEFAULT_TARGET_CENTS,
+ AUTO_RELOAD_TARGET_MAX_CENTS, AiPricing, AutoReloadThresholds, BillingError, BillingService,
+ CREDIT_PACKS_CENTS, OVERAGE_LIMIT_MAX_CENTS, OVERAGE_LIMIT_MIN_CENTS, PaymentGateway, PlanTier,
+ SubscriptionScope, UsageSnapshot,
};
use axum::{
Json, Router,
@@ -58,6 +60,19 @@ pub struct PlanCatalogResponse {
pub overage_limit_min_cents: i64,
/// Largest allowed overage cap, cents.
pub overage_limit_max_cents: i64,
+ /// Largest allowed automatic reload target, cents.
+ pub auto_reload_target_max_cents: i64,
+ /// Thresholds automatic reload starts from before the payer sets their own.
+ pub auto_reload_defaults: AutoReloadDefaults,
+}
+
+/// The automatic reload thresholds a payer starts from.
+#[derive(Debug, Clone, Serialize, ToSchema)]
+pub struct AutoReloadDefaults {
+ /// Balance below which a reload fires, cents.
+ pub minimum_balance_cents: i64,
+ /// Balance a reload tops up to, cents.
+ pub target_balance_cents: i64,
}
/// Request body for [`update_overage_handler`].
@@ -71,6 +86,36 @@ pub struct UpdateOverageRequest {
pub limit_cents: i64,
}
+/// Request body for [`update_auto_reload_handler`].
+#[derive(Debug, Deserialize, ToSchema)]
+#[serde(rename_all = "camelCase")]
+pub struct UpdateAutoReloadRequest {
+ /// Reload credits automatically, billing usage past allowance and
+ /// credits to the payer's card. Turning this off also turns off overage.
+ pub enabled: bool,
+ /// Reload once the balance drops below this, cents. Must be positive.
+ pub minimum_balance_cents: i64,
+ /// Reload the balance back up to this, cents. At least $0.50 above the
+ /// minimum and no more than the catalog's `auto_reload_target_max_cents`.
+ pub target_balance_cents: i64,
+ /// Most to reload per calendar month, cents. Omit or `null` for no limit.
+ /// Also serves as the per-period overage cap, so it must be at least the
+ /// catalog's `overage_limit_min_cents`; larger values are capped at
+ /// `overage_limit_max_cents`.
+ #[serde(default)]
+ pub monthly_spend_limit_cents: Option<i64>,
+}
+
+impl From<&UpdateAutoReloadRequest> for AutoReloadThresholds {
+ fn from(req: &UpdateAutoReloadRequest) -> Self {
+ Self {
+ minimum_cents: req.minimum_balance_cents,
+ target_cents: req.target_balance_cents,
+ monthly_limit_cents: req.monthly_spend_limit_cents,
+ }
+ }
+}
+
/// Request body for [`create_credit_checkout_handler`].
#[derive(Debug, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
@@ -257,6 +302,10 @@ where
"/ai-billing/overage",
patch(update_overage_handler::<B, Auth>),
)
+ .route(
+ "/ai-billing/auto-reload",
+ patch(update_auto_reload_handler::<B, Auth>),
+ )
.route(
"/ai-billing/credits/checkout",
post(create_credit_checkout_handler::<B, Auth>),
@@ -278,6 +327,7 @@ fn error_response(e: BillingError) -> Response {
BillingError::FreePlan => StatusCode::PAYMENT_REQUIRED,
BillingError::InvalidCreditAmount
| BillingError::InvalidOverageLimit
+ | BillingError::InvalidAutoReload(_)
| BillingError::NoStripeCustomer => StatusCode::BAD_REQUEST,
BillingError::Payment(_) | BillingError::Storage(_) | BillingError::Entitlement(_) => {
tracing::error!(error = ?e, "ai billing request failed");
@@ -323,7 +373,8 @@ pub async fn get_summary_handler<B: BillingService, Auth: MacroAuthorizationServ
}
}
-/// The plan catalog, credit packs, and overage cap bounds.
+/// The plan catalog, credit packs, overage cap bounds, and automatic reload
+/// defaults and bounds.
#[utoipa::path(
get,
path = "/ai-billing/plans",
@@ -349,6 +400,11 @@ pub async fn get_plans_handler(State(pricing): State<AiPricing>) -> Json<PlanCat
credit_packs_cents: CREDIT_PACKS_CENTS.to_vec(),
overage_limit_min_cents: OVERAGE_LIMIT_MIN_CENTS,
overage_limit_max_cents: OVERAGE_LIMIT_MAX_CENTS,
+ auto_reload_target_max_cents: AUTO_RELOAD_TARGET_MAX_CENTS,
+ auto_reload_defaults: AutoReloadDefaults {
+ minimum_balance_cents: AUTO_RELOAD_DEFAULT_MINIMUM_CENTS,
+ target_balance_cents: AUTO_RELOAD_DEFAULT_TARGET_CENTS,
+ },
})
}
@@ -387,6 +443,43 @@ pub async fn update_overage_handler<B: BillingService, Auth: MacroAuthorizationS
}
}
+/// Turn automatic credit reloads (and with them overage) on with the given
+/// thresholds, or off. Payer only. Enabling settles right away, so a balance
+/// already under the minimum reloads immediately.
+#[utoipa::path(
+ patch,
+ path = "/ai-billing/auto-reload",
+ operation_id = "update_ai_billing_auto_reload",
+ request_body = UpdateAutoReloadRequest,
+ responses(
+ (status = 200, description = "Updated position", body = UsageSnapshot),
+ (status = 400, description = "Invalid thresholds", body = AiBillingErrorBody),
+ (status = 401, description = "Unauthorized"),
+ (status = 402, description = "A paid plan is required", body = AiBillingErrorBody),
+ (status = 403, description = "Only the payer may change billing", body = AiBillingErrorBody),
+ (status = 500, description = "Internal server error", body = AiBillingErrorBody),
+ ),
+ tag = "ai_billing"
+)]
+#[tracing::instrument(skip(service, user), fields(user_id = %user.authorization.user.macro_user_id))]
+pub async fn update_auto_reload_handler<B: BillingService, Auth: MacroAuthorizationService>(
+ State(service): State<Arc<B>>,
+ user: MacroAuthorizationExtractor<Auth, UserOrInternal>,
+ Json(req): Json<UpdateAutoReloadRequest>,
+) -> Response {
+ match service
+ .update_auto_reload(
+ &user.authorization.user.macro_user_id,
+ req.enabled,
+ AutoReloadThresholds::from(&req),
+ )
+ .await
+ {
+ Ok(snapshot) => Json(snapshot).into_response(),
+ Err(e) => error_response(e),
+ }
+}
+
/// Start a Stripe Checkout for a credit pack. Payer only.
#[utoipa::path(
post,
diff --git a/crates/ai_billing/src/inbound/axum_router/test.rs b/crates/ai_billing/src/inbound/axum_router/test.rs
index 1952317de6..3737a15c91 100644
--- a/crates/ai_billing/src/inbound/axum_router/test.rs
+++ b/crates/ai_billing/src/inbound/axum_router/test.rs
@@ -1,8 +1,11 @@
use super::{
- ReturnUrlError, SettleRequest, SubscriptionPeriodQuery, get_plans_handler, scope_from_query,
- validate_return_url,
+ ReturnUrlError, SettleRequest, SubscriptionPeriodQuery, UpdateAutoReloadRequest,
+ get_plans_handler, scope_from_query, validate_return_url,
+};
+use crate::domain::{
+ AUTO_RELOAD_DEFAULT_MINIMUM_CENTS, AUTO_RELOAD_DEFAULT_TARGET_CENTS,
+ AUTO_RELOAD_TARGET_MAX_CENTS, AiPricing, AutoReloadThresholds, PlanTier, SubscriptionScope,
};
-use crate::domain::{AiPricing, PlanTier, SubscriptionScope};
use axum::extract::{Query, State};
use macro_uuid::Uuid;
@@ -55,8 +58,9 @@ fn return_urls_must_be_https_on_the_calling_origin() {
#[tokio::test]
async fn plan_catalog_lists_every_tier_and_marks_the_purchasable_ones() {
let pricing = AiPricing::testing();
- let plans = get_plans_handler(State(pricing)).await.0.plans;
- let summary = plans
+ let catalog = get_plans_handler(State(pricing)).await.0;
+ let summary = catalog
+ .plans
.iter()
.map(|plan| (plan.tier, plan.purchasable, plan.included_ai_cents_per_seat))
.collect::<Vec<_>>();
@@ -86,6 +90,50 @@ async fn plan_catalog_lists_every_tier_and_marks_the_purchasable_ones() {
assert_eq!(summary[0].2, 500);
assert_eq!(summary[1].2, 2_000);
assert_eq!(summary[2].2, 10_000);
+
+ // The Auto-Reload dialog reads its starting values and ceiling from here.
+ assert_eq!(
+ catalog.auto_reload_target_max_cents,
+ AUTO_RELOAD_TARGET_MAX_CENTS
+ );
+ assert_eq!(
+ catalog.auto_reload_defaults.minimum_balance_cents,
+ AUTO_RELOAD_DEFAULT_MINIMUM_CENTS
+ );
+ assert_eq!(
+ catalog.auto_reload_defaults.target_balance_cents,
+ AUTO_RELOAD_DEFAULT_TARGET_CENTS
+ );
+}
+
+#[test]
+fn auto_reload_request_reads_camel_case_and_defaults_the_monthly_limit() {
+ let with_limit: UpdateAutoReloadRequest = serde_json::from_str(
+ r#"{"enabled":true,"minimumBalanceCents":500,"targetBalanceCents":2000,"monthlySpendLimitCents":5000}"#,
+ )
+ .unwrap();
+ assert!(with_limit.enabled);
+ assert_eq!(
+ AutoReloadThresholds::from(&with_limit),
+ AutoReloadThresholds {
+ minimum_cents: 500,
+ target_cents: 2_000,
+ monthly_limit_cents: Some(5_000),
+ }
+ );
+
+ let without_limit: UpdateAutoReloadRequest = serde_json::from_str(
+ r#"{"enabled":false,"minimumBalanceCents":500,"targetBalanceCents":2000}"#,
+ )
+ .unwrap();
+ assert!(!without_limit.enabled);
+ assert_eq!(without_limit.monthly_spend_limit_cents, None);
+
+ let null_limit: UpdateAutoReloadRequest = serde_json::from_str(
+ r#"{"enabled":true,"minimumBalanceCents":500,"targetBalanceCents":2000,"monthlySpendLimitCents":null}"#,
+ )
+ .unwrap();
+ assert_eq!(null_limit.monthly_spend_limit_cents, None);
}
#[test]
diff --git a/crates/ai_billing/src/lib.rs b/crates/ai_billing/src/lib.rs
index 9b586bf60b..a7d85993c9 100644
--- a/crates/ai_billing/src/lib.rs
+++ b/crates/ai_billing/src/lib.rs
@@ -53,8 +53,8 @@ pub mod outbound;
pub use ai_usage::{AiFeature, AiUsageEnforcement};
pub use domain::{
AdmissionFuture, AiAdmissionError, AiAdmissionService, AiPricing, AiUsageBilling,
- AllowanceDecision, BillingAdmissionService, BillingError, BillingPeriod, BillingService,
- BillingSettings, CREDIT_PACKS_CENTS, DenyReason, DisabledAiAdmissionService, Entitlement,
- IncludedAllowanceCents, OverageMarkupPercent, PayerScope, PlanAllowances, PlanTier,
- PricingError, UsageSnapshot, cost_cents,
+ AllowanceDecision, AutoReloadSnapshot, AutoReloadThresholds, BillingAdmissionService,
+ BillingError, BillingPeriod, BillingService, BillingSettings, CREDIT_PACKS_CENTS, DenyReason,
+ DisabledAiAdmissionService, Entitlement, IncludedAllowanceCents, OverageMarkupPercent,
+ PayerScope, PlanAllowances, PlanTier, PricingError, UsageSnapshot, cost_cents,
};
diff --git a/crates/ai_billing/src/outbound/http_payment_gateway.rs b/crates/ai_billing/src/outbound/http_payment_gateway.rs
index 4ad4943525..81a5f8a17d 100644
--- a/crates/ai_billing/src/outbound/http_payment_gateway.rs
+++ b/crates/ai_billing/src/outbound/http_payment_gateway.rs
@@ -6,8 +6,8 @@ mod test;
use super::NoOpPaymentGateway;
use crate::domain::{
- BillingError, BillingPeriod, CreditCheckoutRequest, OverageChargeRequest, PaymentGateway,
- Result, SubscriptionScope,
+ BillingError, BillingPeriod, CreditCheckoutRequest, CreditReloadRequest, OverageChargeRequest,
+ PaymentGateway, Result, SubscriptionScope,
};
use authentication_service_client::AuthServiceClient;
use macro_uuid::Uuid;
@@ -44,6 +44,10 @@ impl PaymentGateway for HttpPaymentGateway {
NoOpPaymentGateway.open_overage_invoice(request).await
}
+ async fn open_credit_reload_invoice(&self, request: CreditReloadRequest) -> Result<String> {
+ NoOpPaymentGateway.open_credit_reload_invoice(request).await
+ }
+
async fn pay_overage_invoice(
&self,
charge_id: Uuid,
diff --git a/crates/ai_billing/src/outbound/pg_billing_repo.rs b/crates/ai_billing/src/outbound/pg_billing_repo.rs
index 9939be99ff..0d3970f8c6 100644
--- a/crates/ai_billing/src/outbound/pg_billing_repo.rs
+++ b/crates/ai_billing/src/outbound/pg_billing_repo.rs
@@ -1,5 +1,6 @@
//! Postgres adapter for the billing tables (`ai_billing_account`,
-//! `ai_credit_ledger`, `ai_overage_charge`, `ai_billing_period_allowance`).
+//! `ai_credit_ledger`, `ai_overage_charge`, `ai_credit_reload`,
+//! `ai_billing_period_allowance`).
//!
//! Frozen allowances live in `ai_billing_period_allowance.included_cost_cents_by_user`
//! (cost cents). The legacy `included_cents_by_user` column predates the at-cost
@@ -14,9 +15,11 @@ mod test;
use super::pg_funding_repo::{credit_commitments, lock_payer, postpaid_commitments};
use crate::domain::financial::legacy_cap_remaining;
use crate::domain::{
- AiPricing, AllowanceStore, BillingError, BillingRepo, BillingSettings, OpenPeriodStart,
- OverageChargeStatus, PendingCharge, PeriodAllowance, PeriodLedger, Result, SeatAllowance,
- SeatGeneration, SettlementOutcome, SettlementPolicy, SettlementState, plan_settlement,
+ AiPricing, AllowanceStore, AutoReloadThresholds, BillingError, BillingPeriod, BillingRepo,
+ BillingSettings, CreditReloadStatus, OpenPeriodStart, OverageChargeStatus, PendingCharge,
+ PendingReload, PeriodAllowance, PeriodLedger, ReloadState, ResolvedReload, Result,
+ SeatAllowance, SeatGeneration, SettlementOutcome, SettlementPolicy, SettlementState,
+ plan_reload, plan_settlement,
};
use chrono::{DateTime, Utc};
use macro_user_id::user_id::MacroUserIdStr;
@@ -47,6 +50,10 @@ fn funding_storage(e: ai_usage::domain::financial::FinancialError) -> BillingErr
BillingError::Storage(anyhow::anyhow!(e))
}
+fn invalid_payer(e: impl std::fmt::Display) -> BillingError {
+ BillingError::Storage(anyhow::anyhow!("invalid payer id: {e}"))
+}
+
impl BillingRepo for PgBillingRepo {
async fn legacy_seats(
&self,
@@ -78,6 +85,8 @@ impl BillingRepo for PgBillingRepo {
let row = sqlx::query!(
r#"
SELECT overage_enabled, overage_limit_cents, overage_suspended_at,
+ auto_reload_minimum_cents, auto_reload_target_cents,
+ auto_reload_monthly_limit_cents, auto_reload_suspended_at,
period_start, period_end, seat_generation
FROM ai_billing_account
WHERE user_id = $1
@@ -93,6 +102,12 @@ impl BillingRepo for PgBillingRepo {
overage_enabled: r.overage_enabled,
overage_limit_cents: r.overage_limit_cents,
overage_suspended_at: r.overage_suspended_at,
+ auto_reload: AutoReloadThresholds {
+ minimum_cents: r.auto_reload_minimum_cents,
+ target_cents: r.auto_reload_target_cents,
+ monthly_limit_cents: r.auto_reload_monthly_limit_cents,
+ },
+ auto_reload_suspended_at: r.auto_reload_suspended_at,
period_anchor: r.period_start.zip(r.period_end),
seat_generation: SeatGeneration::from_raw(r.seat_generation),
})
@@ -655,11 +670,8 @@ impl BillingRepo for PgBillingRepo {
.fetch_optional(&self.pool)
.await
.map_err(storage)?;
- row.map(|r| {
- MacroUserIdStr::try_from(r.user_id)
- .map_err(|e| BillingError::Storage(anyhow::anyhow!("invalid payer id: {e}")))
- })
- .transpose()
+ row.map(|r| MacroUserIdStr::try_from(r.user_id).map_err(invalid_payer))
+ .transpose()
}
async fn latest_charge_status(
@@ -687,6 +699,337 @@ impl BillingRepo for PgBillingRepo {
})
.transpose()
}
+
+ async fn update_auto_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ enabled: bool,
+ overage_limit_cents: i64,
+ thresholds: Option<&AutoReloadThresholds>,
+ ) -> Result<()> {
+ // A new row takes the defaults when no thresholds are given; an
+ // existing row keeps what it has.
+ let replace_thresholds = thresholds.is_some();
+ let thresholds = thresholds.copied().unwrap_or_default();
+ sqlx::query!(
+ r#"
+ INSERT INTO ai_billing_account (
+ user_id, overage_enabled, overage_limit_cents,
+ auto_reload_minimum_cents, auto_reload_target_cents,
+ auto_reload_monthly_limit_cents
+ )
+ VALUES ($1, $2, $3, $4, $5, $6)
+ ON CONFLICT (user_id) DO UPDATE
+ SET overage_enabled = EXCLUDED.overage_enabled,
+ overage_limit_cents = EXCLUDED.overage_limit_cents,
+ auto_reload_minimum_cents = CASE
+ WHEN $7 THEN EXCLUDED.auto_reload_minimum_cents
+ ELSE ai_billing_account.auto_reload_minimum_cents
+ END,
+ auto_reload_target_cents = CASE
+ WHEN $7 THEN EXCLUDED.auto_reload_target_cents
+ ELSE ai_billing_account.auto_reload_target_cents
+ END,
+ auto_reload_monthly_limit_cents = CASE
+ WHEN $7 THEN EXCLUDED.auto_reload_monthly_limit_cents
+ ELSE ai_billing_account.auto_reload_monthly_limit_cents
+ END,
+ overage_suspended_at = NULL,
+ auto_reload_suspended_at = NULL,
+ updated_at = NOW()
+ "#,
+ payer.as_ref(),
+ enabled,
+ overage_limit_cents,
+ thresholds.minimum_cents,
+ thresholds.target_cents,
+ thresholds.monthly_limit_cents,
+ replace_thresholds,
+ )
+ .execute(&self.pool)
+ .await
+ .map_err(storage)?;
+ Ok(())
+ }
+
+ async fn reserve_credit_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ period_start: DateTime<Utc>,
+ chargeable_customer_cents: i64,
+ now: DateTime<Utc>,
+ ) -> Result<Option<PendingReload>> {
+ let payer = payer.as_ref();
+ let mut tx = self.pool.begin().await.map_err(storage)?;
+
+ // Serialize reloads with settlements and purchases on the account row.
+ lock_payer(&mut tx, payer).await.map_err(funding_storage)?;
+ let account = sqlx::query!(
+ r#"
+ SELECT overage_enabled, overage_limit_cents, overage_suspended_at,
+ auto_reload_minimum_cents, auto_reload_target_cents,
+ auto_reload_monthly_limit_cents, auto_reload_suspended_at
+ FROM ai_billing_account
+ WHERE user_id = $1
+ "#,
+ payer,
+ )
+ .fetch_one(&mut *tx)
+ .await
+ .map_err(storage)?;
+ let settings = BillingSettings {
+ overage_enabled: account.overage_enabled,
+ overage_limit_cents: account.overage_limit_cents,
+ overage_suspended_at: account.overage_suspended_at,
+ auto_reload: AutoReloadThresholds {
+ minimum_cents: account.auto_reload_minimum_cents,
+ target_cents: account.auto_reload_target_cents,
+ monthly_limit_cents: account.auto_reload_monthly_limit_cents,
+ },
+ auto_reload_suspended_at: account.auto_reload_suspended_at,
+ ..Default::default()
+ };
+ if !settings.auto_reload_active() {
+ tx.rollback().await.map_err(storage)?;
+ return Ok(None);
+ }
+
+ // A reload still owed from an earlier pass comes first, so the retry
+ // reuses its id (and with it its Stripe idempotency keys and invoice)
+ // instead of reserving a second reload while the first can still
+ // collect. A pending reload whose collector died before opening an
+ // invoice is handed back as is. A failed reload that reached Stripe
+ // keeps its invoice open (`auto_advance`) and is retried on that same
+ // invoice now that the payer has re-enabled reloads. Any other
+ // pending reload is still with Stripe and blocks a new one until the
+ // webhook resolves it.
+ let open = sqlx::query!(
+ r#"
+ SELECT id, amount_cents, stripe_invoice_id, status::text AS "status!",
+ (status = 'pending'
+ AND stripe_invoice_id IS NULL
+ AND updated_at < NOW() - INTERVAL '10 minutes') AS "orphaned!"
+ FROM ai_credit_reload
+ WHERE user_id = $1
+ AND (status = 'pending'
+ OR (status = 'failed' AND stripe_invoice_id IS NOT NULL))
+ ORDER BY created_at
+ FOR UPDATE
+ "#,
+ payer,
+ )
+ .fetch_all(&mut *tx)
+ .await
+ .map_err(storage)?;
+ if let Some(row) = open.iter().find(|row| row.orphaned) {
+ tx.commit().await.map_err(storage)?;
+ return Ok(Some(PendingReload {
+ id: row.id,
+ amount_cents: row.amount_cents,
+ stripe_invoice_id: row.stripe_invoice_id.clone(),
+ }));
+ }
+ if let Some(row) = open.iter().find(|row| row.status == "failed") {
+ sqlx::query!(
+ r#"
+ UPDATE ai_credit_reload
+ SET status = 'pending', updated_at = NOW()
+ WHERE id = $1
+ "#,
+ row.id,
+ )
+ .execute(&mut *tx)
+ .await
+ .map_err(storage)?;
+ tx.commit().await.map_err(storage)?;
+ return Ok(Some(PendingReload {
+ id: row.id,
+ amount_cents: row.amount_cents,
+ stripe_invoice_id: row.stripe_invoice_id.clone(),
+ }));
+ }
+ if !open.is_empty() {
+ tx.rollback().await.map_err(storage)?;
+ return Ok(None);
+ }
+
+ // Same balance as settlement: ledger sum less V1 funding commitments.
+ let balance = sqlx::query_scalar!(
+ r#"
+ SELECT COALESCE(SUM(delta_cents), 0)::bigint AS "balance!"
+ FROM ai_credit_ledger
+ WHERE user_id = $1
+ "#,
+ payer,
+ )
+ .fetch_one(&mut *tx)
+ .await
+ .map_err(storage)?;
+ let commitments = credit_commitments(&mut tx, payer)
+ .await
+ .map_err(funding_storage)?;
+ let balance = commitments
+ .legacy_available_cents(balance)
+ .map_err(funding_storage)?;
+ let ledger = read_period_ledger(&mut tx, payer, period_start).await?;
+ let covered = ledger.credits_consumed_cents + ledger.overage_charged_cents;
+ let uncovered_cents = (chargeable_customer_cents - covered).max(0);
+ // A failed reload that reached Stripe may still be collected by its
+ // retries, so it counts against the limit like a pending one.
+ let month = BillingPeriod::calendar_month(now);
+ let spent_this_month_cents = sqlx::query_scalar!(
+ r#"
+ SELECT COALESCE(SUM(amount_cents), 0)::bigint AS "spent!"
+ FROM ai_credit_reload
+ WHERE user_id = $1
+ AND (status <> 'failed' OR stripe_invoice_id IS NOT NULL)
+ AND created_at >= $2
+ AND created_at < $3
+ "#,
+ payer,
+ month.start,
+ month.end,
+ )
+ .fetch_one(&mut *tx)
+ .await
+ .map_err(storage)?;
+
+ let amount_cents = plan_reload(
+ ReloadState {
+ credit_balance_cents: balance,
+ uncovered_cents,
+ spent_this_month_cents,
+ },
+ &settings.auto_reload,
+ );
+ let Some(amount_cents) = amount_cents else {
+ tx.rollback().await.map_err(storage)?;
+ return Ok(None);
+ };
+
+ let id = macro_uuid::generate_uuid_v7();
+ sqlx::query!(
+ r#"
+ INSERT INTO ai_credit_reload (id, user_id, amount_cents, status)
+ VALUES ($1, $2, $3, 'pending')
+ "#,
+ id,
+ payer,
+ amount_cents,
+ )
+ .execute(&mut *tx)
+ .await
+ .map_err(storage)?;
+ tx.commit().await.map_err(storage)?;
+ Ok(Some(PendingReload {
+ id,
+ amount_cents,
+ stripe_invoice_id: None,
+ }))
+ }
+
+ async fn finish_credit_reload(
+ &self,
+ reload_id: Uuid,
+ stripe_invoice_id: Option<&str>,
+ status: CreditReloadStatus,
+ ) -> Result<()> {
+ sqlx::query!(
+ r#"
+ UPDATE ai_credit_reload
+ SET stripe_invoice_id = COALESCE($2, stripe_invoice_id),
+ status = ($3::text)::ai_credit_reload_status,
+ updated_at = NOW()
+ WHERE id = $1
+ "#,
+ reload_id,
+ stripe_invoice_id,
+ status.to_string(),
+ )
+ .execute(&self.pool)
+ .await
+ .map_err(storage)?;
+ Ok(())
+ }
+
+ async fn record_credit_reload(
+ &self,
+ payer: &MacroUserIdStr<'_>,
+ amount_cents: i64,
+ stripe_invoice_id: &str,
+ ) -> Result<bool> {
+ let id = macro_uuid::generate_uuid_v7();
+ let mut tx = self.pool.begin().await.map_err(storage)?;
+ lock_payer(&mut tx, payer.as_ref())
+ .await
+ .map_err(funding_storage)?;
+ let result = sqlx::query!(
+ r#"
+ INSERT INTO ai_credit_ledger (id, user_id, kind, delta_cents, stripe_reference, note)
+ VALUES ($1, $2, 'purchase', $3, $4, 'Automatic reload')
+ ON CONFLICT (stripe_reference) WHERE stripe_reference IS NOT NULL DO NOTHING
+ "#,
+ id,
+ payer.as_ref(),
+ amount_cents,
+ stripe_invoice_id,
+ )
+ .execute(&mut *tx)
+ .await
+ .map_err(storage)?;
+ tx.commit().await.map_err(storage)?;
+ Ok(result.rows_affected() == 1)
+ }
+
+ async fn resolve_credit_reload_invoice(
+ &self,
+ stripe_invoice_id: &str,
+ status: CreditReloadStatus,
+ ) -> Result<Option<ResolvedReload>> {
+ // `paid` is terminal and re-reporting the current status changes
+ // nothing, so a late or duplicate webhook cannot un-pay a reload or
+ // book its credits twice.
+ let row = sqlx::query!(
+ r#"
+ UPDATE ai_credit_reload
+ SET status = ($2::text)::ai_credit_reload_status, updated_at = NOW()
+ WHERE stripe_invoice_id = $1
+ AND status <> 'paid'
+ AND status <> ($2::text)::ai_credit_reload_status
+ RETURNING user_id, amount_cents
+ "#,
+ stripe_invoice_id,
+ status.to_string(),
+ )
+ .fetch_optional(&self.pool)
+ .await
+ .map_err(storage)?;
+ row.map(|r| {
+ Ok(ResolvedReload {
+ payer: MacroUserIdStr::try_from(r.user_id).map_err(invalid_payer)?,
+ amount_cents: r.amount_cents,
+ })
+ })
+ .transpose()
+ }
+
+ async fn suspend_auto_reload(&self, payer: &MacroUserIdStr<'_>) -> Result<()> {
+ sqlx::query!(
+ r#"
+ INSERT INTO ai_billing_account (user_id, auto_reload_suspended_at)
+ VALUES ($1, NOW())
+ ON CONFLICT (user_id) DO UPDATE
+ SET auto_reload_suspended_at
+ = COALESCE(ai_billing_account.auto_reload_suspended_at, NOW()),
+ updated_at = NOW()
+ "#,
+ payer.as_ref(),
+ )
+ .execute(&self.pool)
+ .await
+ .map_err(storage)?;
+ Ok(())
+ }
}
/// Sum consumption and charges that can still collect for a period, on any
diff --git a/crates/ai_billing/src/outbound/pg_billing_repo/test.rs b/crates/ai_billing/src/outbound/pg_billing_repo/test.rs
index 29a706a8c1..00a2b958d9 100644
--- a/crates/ai_billing/src/outbound/pg_billing_repo/test.rs
+++ b/crates/ai_billing/src/outbound/pg_billing_repo/test.rs
@@ -571,6 +571,480 @@ async fn period_allowance_roundtrips_and_upserts_per_period(pool: PgPool) {
);
}
+/// Thresholds that reload a balance below $10 back up to $100.
+fn thresholds(monthly_limit_cents: Option<i64>) -> AutoReloadThresholds {
+ AutoReloadThresholds {
+ minimum_cents: 1_000,
+ target_cents: 10_000,
+ monthly_limit_cents,
+ }
+}
+
+/// Turn auto-reload on for the test payer with `thresholds`.
+async fn enable_auto_reload(repo: &PgBillingRepo, thresholds: &AutoReloadThresholds) {
+ repo.update_auto_reload(&payer(), true, 50_000, Some(thresholds))
+ .await
+ .unwrap();
+}
+
+/// How many `ai_credit_reload` rows the test payer has.
+async fn reload_rows(pool: &PgPool) -> i64 {
+ let payer = payer();
+ sqlx::query_scalar!(
+ r#"SELECT COUNT(*)::bigint AS "count!" FROM ai_credit_reload WHERE user_id = $1"#,
+ payer.as_ref(),
+ )
+ .fetch_one(pool)
+ .await
+ .unwrap()
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn auto_reload_defaults_when_no_account_row_exists(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool, AiPricing::testing());
+ let settings = repo.settings(&payer()).await.unwrap();
+ assert_eq!(
+ settings.auto_reload,
+ AutoReloadThresholds {
+ minimum_cents: 1_000,
+ target_cents: 10_000,
+ monthly_limit_cents: None,
+ }
+ );
+ assert!(settings.auto_reload_suspended_at.is_none());
+
+ // A row created by another write keeps the column defaults.
+ repo.set_period(
+ &payer(),
+ Utc::now(),
+ Utc::now() + chrono::Duration::days(30),
+ )
+ .await
+ .unwrap();
+ assert_eq!(
+ repo.settings(&payer()).await.unwrap().auto_reload,
+ AutoReloadThresholds::default()
+ );
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn update_auto_reload_persists_thresholds_and_clears_both_suspensions(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool, AiPricing::testing());
+ repo.suspend_overage(&payer()).await.unwrap();
+ repo.suspend_auto_reload(&payer()).await.unwrap();
+ let suspended = repo.settings(&payer()).await.unwrap();
+ assert!(suspended.overage_suspended_at.is_some());
+ assert!(suspended.auto_reload_suspended_at.is_some());
+
+ let custom = AutoReloadThresholds {
+ minimum_cents: 2_000,
+ target_cents: 15_000,
+ monthly_limit_cents: Some(30_000),
+ };
+ repo.update_auto_reload(&payer(), true, 30_000, Some(&custom))
+ .await
+ .unwrap();
+ let s = repo.settings(&payer()).await.unwrap();
+ assert!(s.overage_enabled);
+ assert_eq!(s.overage_limit_cents, 30_000);
+ assert_eq!(s.auto_reload, custom);
+ assert!(s.overage_suspended_at.is_none());
+ assert!(s.auto_reload_suspended_at.is_none());
+ assert!(s.auto_reload_active());
+
+ // Turning it off without thresholds keeps the stored ones.
+ repo.update_auto_reload(&payer(), false, 0, None)
+ .await
+ .unwrap();
+ let s = repo.settings(&payer()).await.unwrap();
+ assert!(!s.overage_enabled);
+ assert_eq!(s.overage_limit_cents, 0);
+ assert_eq!(s.auto_reload, custom);
+ assert!(!s.auto_reload_active());
+
+ // A `Some` with no monthly limit really clears the limit.
+ repo.update_auto_reload(&payer(), true, 50_000, Some(&thresholds(None)))
+ .await
+ .unwrap();
+ assert_eq!(
+ repo.settings(&payer()).await.unwrap().auto_reload,
+ thresholds(None)
+ );
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn reserve_credit_reload_requires_active_overage_and_unsuspended_reloads(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool.clone(), AiPricing::testing());
+ let now = Utc::now();
+ let period_start = now - chrono::Duration::days(10);
+ repo.record_credit_purchase(&payer(), 500, "cs_1")
+ .await
+ .unwrap();
+
+ // Overage off: no reload even though the balance is below the minimum.
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ // Overage on but suspended.
+ enable_auto_reload(&repo, &thresholds(None)).await;
+ repo.suspend_overage(&payer()).await.unwrap();
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ // Reloads suspended after a failed collection.
+ enable_auto_reload(&repo, &thresholds(None)).await;
+ repo.suspend_auto_reload(&payer()).await.unwrap();
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ assert_eq!(reload_rows(&pool).await, 0);
+
+ // Re-enabling lifts the reload suspension.
+ enable_auto_reload(&repo, &thresholds(None)).await;
+ let reload = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(reload.amount_cents, 9_500);
+ assert!(reload.stripe_invoice_id.is_none());
+ assert_eq!(reload_rows(&pool).await, 1);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn reserve_credit_reload_subtracts_usage_the_settlement_will_consume(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool, AiPricing::testing());
+ let now = Utc::now();
+ let period_start = now - chrono::Duration::days(10);
+ enable_auto_reload(&repo, &thresholds(None)).await;
+ repo.record_credit_purchase(&payer(), 5_000, "cs_1")
+ .await
+ .unwrap();
+
+ // 5_000 of credit is above the minimum on its own, but 4_500 of usage is
+ // about to be consumed from it: effective 500, reload 9_500.
+ let reload = repo
+ .reserve_credit_reload(&payer(), period_start, 4_500, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(reload.amount_cents, 9_500);
+ repo.finish_credit_reload(reload.id, Some("in_1"), CreditReloadStatus::Paid)
+ .await
+ .unwrap();
+
+ // Usage already booked against the period no longer counts as uncovered.
+ repo.apply_settlement(&payer(), period_start, 4_500, policy(false))
+ .await
+ .unwrap();
+ assert_eq!(repo.credit_balance_cents(&payer()).await.unwrap(), 500);
+ repo.record_credit_reload(&payer(), 9_500, "in_1")
+ .await
+ .unwrap();
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 4_500, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn reserve_credit_reload_honors_the_monthly_limit_including_pending_rows(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool.clone(), AiPricing::testing());
+ let now = Utc::now();
+ let period_start = now - chrono::Duration::days(10);
+ enable_auto_reload(&repo, &thresholds(Some(12_000))).await;
+
+ let first = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(first.amount_cents, 10_000);
+ // Pending rows count against the limit, so once Stripe resolves this one
+ // only 2_000 of room is left.
+ repo.finish_credit_reload(first.id, Some("in_1"), CreditReloadStatus::Paid)
+ .await
+ .unwrap();
+ let second = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(second.amount_cents, 2_000);
+ repo.finish_credit_reload(second.id, Some("in_2"), CreditReloadStatus::Paid)
+ .await
+ .unwrap();
+ // Limit spent: nothing more this month.
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ assert_eq!(reload_rows(&pool).await, 2);
+
+ // A failed reload does not count; a reload from last month does not either.
+ sqlx::query!(
+ "UPDATE ai_credit_reload SET created_at = $2 WHERE id = $1",
+ second.id,
+ BillingPeriod::calendar_month(now).start - chrono::Duration::hours(1),
+ )
+ .execute(&pool)
+ .await
+ .unwrap();
+ let third = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(third.amount_cents, 2_000);
+ repo.finish_credit_reload(third.id, None, CreditReloadStatus::Failed)
+ .await
+ .unwrap();
+ // Suspension is what stops reloads after a failure, not the ledger.
+ enable_auto_reload(&repo, &thresholds(Some(12_000))).await;
+ let fourth = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(fourth.amount_cents, 2_000);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn reserve_credit_reload_waits_for_a_pending_reload_but_recovers_an_orphan(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool.clone(), AiPricing::testing());
+ let now = Utc::now();
+ let period_start = now - chrono::Duration::days(10);
+ enable_auto_reload(&repo, &thresholds(None)).await;
+
+ let reserved = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ // Fresh reservations are left to their collector...
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ // ...and so is one whose invoice is with Stripe, however old.
+ repo.finish_credit_reload(reserved.id, Some("in_1"), CreditReloadStatus::Pending)
+ .await
+ .unwrap();
+ sqlx::query!(
+ "UPDATE ai_credit_reload SET updated_at = NOW() - INTERVAL '1 hour' WHERE id = $1",
+ reserved.id,
+ )
+ .execute(&pool)
+ .await
+ .unwrap();
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+
+ // One that never got an invoice after a while is handed back.
+ sqlx::query!(
+ "UPDATE ai_credit_reload SET stripe_invoice_id = NULL WHERE id = $1",
+ reserved.id,
+ )
+ .execute(&pool)
+ .await
+ .unwrap();
+ let orphan = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("orphaned reload handed back");
+ assert_eq!(orphan.id, reserved.id);
+ assert_eq!(orphan.amount_cents, reserved.amount_cents);
+ assert!(orphan.stripe_invoice_id.is_none());
+ assert_eq!(reload_rows(&pool).await, 1);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn reserve_credit_reload_retries_a_failed_reload_on_its_open_invoice(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool.clone(), AiPricing::testing());
+ let now = Utc::now();
+ let period_start = now - chrono::Duration::days(10);
+ enable_auto_reload(&repo, &thresholds(Some(12_000))).await;
+
+ let reserved = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ // The invoice reached Stripe, then collection failed and reloads were
+ // suspended. Stripe keeps retrying that invoice.
+ repo.finish_credit_reload(reserved.id, Some("in_1"), CreditReloadStatus::Failed)
+ .await
+ .unwrap();
+ repo.suspend_auto_reload(&payer()).await.unwrap();
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+
+ // Re-enabling hands back the same reload and invoice instead of opening a
+ // second one Stripe could also collect.
+ enable_auto_reload(&repo, &thresholds(Some(12_000))).await;
+ let retried = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("failed reload handed back");
+ assert_eq!(retried.id, reserved.id);
+ assert_eq!(retried.amount_cents, 10_000);
+ assert_eq!(retried.stripe_invoice_id.as_deref(), Some("in_1"));
+ assert_eq!(reload_rows(&pool).await, 1);
+ let status = sqlx::query_scalar!(
+ r#"SELECT status::text AS "status!" FROM ai_credit_reload WHERE id = $1"#,
+ reserved.id,
+ )
+ .fetch_one(&pool)
+ .await
+ .unwrap();
+ assert_eq!(status, "pending");
+
+ // While it is pending again it blocks new reloads, and once paid it
+ // still counts against the month, leaving 2_000 of room.
+ assert!(
+ repo.reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ repo.finish_credit_reload(retried.id, Some("in_1"), CreditReloadStatus::Paid)
+ .await
+ .unwrap();
+ let next = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ assert_eq!(next.amount_cents, 2_000);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn credit_reloads_are_idempotent_on_the_invoice(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool, AiPricing::testing());
+ assert!(
+ repo.record_credit_reload(&payer(), 9_500, "in_1")
+ .await
+ .unwrap()
+ );
+ assert_eq!(repo.credit_balance_cents(&payer()).await.unwrap(), 9_500);
+ // The collector and the webhook may both report the same invoice.
+ assert!(
+ !repo
+ .record_credit_reload(&payer(), 9_500, "in_1")
+ .await
+ .unwrap()
+ );
+ assert_eq!(repo.credit_balance_cents(&payer()).await.unwrap(), 9_500);
+ // A manual purchase under the same reference is the same booking.
+ assert!(
+ !repo
+ .record_credit_purchase(&payer(), 9_500, "in_1")
+ .await
+ .unwrap()
+ );
+ assert_eq!(repo.credit_balance_cents(&payer()).await.unwrap(), 9_500);
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn reload_invoice_webhooks_resolve_once_and_never_unpay(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool, AiPricing::testing());
+ let now = Utc::now();
+ let period_start = now - chrono::Duration::days(10);
+ enable_auto_reload(&repo, &thresholds(None)).await;
+ let reserved = repo
+ .reserve_credit_reload(&payer(), period_start, 0, now)
+ .await
+ .unwrap()
+ .expect("reload reserved");
+ repo.finish_credit_reload(reserved.id, Some("in_1"), CreditReloadStatus::Pending)
+ .await
+ .unwrap();
+
+ assert!(
+ repo.resolve_credit_reload_invoice("in_unknown", CreditReloadStatus::Paid)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ // Declined first; re-reporting it is a no-op.
+ let failed = repo
+ .resolve_credit_reload_invoice("in_1", CreditReloadStatus::Failed)
+ .await
+ .unwrap()
+ .expect("status changed");
+ assert_eq!(failed.payer.as_ref(), payer().as_ref());
+ assert_eq!(failed.amount_cents, 10_000);
+ assert!(
+ repo.resolve_credit_reload_invoice("in_1", CreditReloadStatus::Failed)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ // Stripe's retry collected it: reported exactly once.
+ let paid = repo
+ .resolve_credit_reload_invoice("in_1", CreditReloadStatus::Paid)
+ .await
+ .unwrap()
+ .expect("status changed");
+ assert_eq!(paid.payer.as_ref(), payer().as_ref());
+ assert_eq!(paid.amount_cents, 10_000);
+ assert!(
+ repo.resolve_credit_reload_invoice("in_1", CreditReloadStatus::Paid)
+ .await
+ .unwrap()
+ .is_none()
+ );
+ // A late or duplicate failure cannot un-pay it.
+ assert!(
+ repo.resolve_credit_reload_invoice("in_1", CreditReloadStatus::Failed)
+ .await
+ .unwrap()
+ .is_none()
+ );
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn suspend_auto_reload_keeps_the_first_timestamp(pool: PgPool) {
+ let repo = PgBillingRepo::new(pool, AiPricing::testing());
+ repo.suspend_auto_reload(&payer()).await.unwrap();
+ let first = repo
+ .settings(&payer())
+ .await
+ .unwrap()
+ .auto_reload_suspended_at
+ .expect("suspended");
+ repo.suspend_auto_reload(&payer()).await.unwrap();
+ let s = repo.settings(&payer()).await.unwrap();
+ assert_eq!(s.auto_reload_suspended_at, Some(first));
+ // Reload suspension leaves overage itself alone.
+ assert!(s.overage_suspended_at.is_none());
+}
+
struct RawAllowance {
billed_users: Vec<String>,
included_cents_by_user: Vec<i64>,
diff --git a/crates/ai_billing/src/outbound/settling_recorder/test.rs b/crates/ai_billing/src/outbound/settling_recorder/test.rs
index a3bd815441..d1d8f3e959 100644
--- a/crates/ai_billing/src/outbound/settling_recorder/test.rs
+++ b/crates/ai_billing/src/outbound/settling_recorder/test.rs
@@ -1,7 +1,7 @@
use super::*;
use crate::domain::{
- AiPricing, AllowanceDecision, BillingPeriod, BillingSettings, Entitlement, PlanTier, Result,
- UsageSnapshot, ledger::build_snapshot,
+ AiPricing, AllowanceDecision, AutoReloadThresholds, BillingPeriod, BillingSettings,
+ Entitlement, PlanTier, Result, UsageSnapshot, ledger::build_snapshot,
};
use ai_usage::domain::{Result as UsageResult, UsageError};
use ai_usage::{
@@ -75,6 +75,15 @@ impl BillingService for FakeBilling {
unreachable!()
}
+ async fn update_auto_reload(
+ &self,
+ _user: &MacroUserIdStr<'_>,
+ _enabled: bool,
+ _thresholds: AutoReloadThresholds,
+ ) -> Result<UsageSnapshot> {
+ unreachable!()
+ }
+
async fn create_credit_checkout(
&self,
_user: &MacroUserIdStr<'_>,
@@ -107,6 +116,14 @@ impl BillingService for FakeBilling {
async fn mark_overage_invoice(&self, _stripe_invoice_id: &str, _paid: bool) -> Result<()> {
unreachable!()
}
+
+ async fn mark_credit_reload_invoice(
+ &self,
+ _stripe_invoice_id: &str,
+ _paid: bool,
+ ) -> Result<()> {
+ unreachable!()
+ }
}
#[derive(Clone, Default)]
diff --git a/crates/ai_billing/src/outbound/stripe_gateway.rs b/crates/ai_billing/src/outbound/stripe_gateway.rs
index e50f437f3f..0ee943d681 100644
--- a/crates/ai_billing/src/outbound/stripe_gateway.rs
+++ b/crates/ai_billing/src/outbound/stripe_gateway.rs
@@ -1,14 +1,16 @@
//! Stripe adapter: one-off Checkout for credit packs, immediate invoices for
-//! overage chunks, and the current subscription period.
+//! overage chunks and automatic credit reloads, and the current subscription
+//! period.
#[cfg(test)]
mod test;
use crate::domain::{
- BillingError, BillingPeriod, CreditCheckoutRequest, OverageChargeRequest, PaymentGateway,
- Result, SubscriptionScope,
+ BillingError, BillingPeriod, CreditCheckoutRequest, CreditReloadRequest, OverageChargeRequest,
+ PaymentGateway, Result, SubscriptionScope,
};
use chrono::{DateTime, Utc};
+use macro_user_id::user_id::MacroUserIdStr;
use macro_uuid::Uuid;
use serde::Serialize;
use std::collections::HashMap;
@@ -29,10 +31,16 @@ pub const PURPOSE_METADATA_KEY: &str = "macro_purpose";
pub const PURPOSE_AI_CREDITS: &str = "ai_credits";
/// [`PURPOSE_METADATA_KEY`] value for an overage invoice.
pub const PURPOSE_AI_OVERAGE: &str = "ai_overage";
+/// [`PURPOSE_METADATA_KEY`] value for an automatic credit-reload invoice.
+pub const PURPOSE_AI_CREDIT_RELOAD: &str = "ai_credit_reload";
/// Metadata key carrying the payer's Macro user id.
pub const PAYER_METADATA_KEY: &str = "macro_user_id";
/// Metadata key carrying the `ai_overage_charge` id on overage invoices.
pub const CHARGE_METADATA_KEY: &str = "macro_charge_id";
+/// Metadata key carrying the `ai_credit_reload` id on reload invoices.
+pub const RELOAD_METADATA_KEY: &str = "macro_reload_id";
+const OVERAGE_INVOICE_DESCRIPTION: &str = "Macro AI usage beyond plan";
+const CREDIT_RELOAD_INVOICE_DESCRIPTION: &str = "Macro AI credits (automatic reload)";
const BILLING_SCOPE_METADATA_KEY: &str = "macro_billing_scope";
const PERSONAL_SCOPE_STAMP: &str = "personal";
const TEAM_ID_METADATA_KEY: &str = "team_id";
@@ -57,6 +65,85 @@ impl StripePaymentGateway {
.with_strategy(RequestStrategy::Idempotent(key))
}
+ /// Open and finalize an invoice for exactly one line item (and nothing
+ /// else pending on the customer). Idempotent on
+ /// [`OneOffInvoice::idempotency_prefix`]. Returns the invoice id.
+ async fn open_one_off_invoice(
+ &self,
+ customer: CustomerId,
+ scope: SubscriptionScope,
+ one_off: OneOffInvoice<'_>,
+ ) -> Result<String> {
+ let live_method = self.resolve_charge_method(&customer, scope).await?;
+ let key = one_off.idempotency_prefix;
+
+ // 1. An empty draft invoice that takes nothing else pending on the
+ // customer, so it can never bill more than this one charge.
+ // It cannot auto-finalize until routing and its line item are present.
+ let mut invoice = CreateInvoice::new();
+ invoice.customer = Some(customer.clone());
+ invoice.auto_advance = Some(false);
+ invoice.collection_method = Some(CollectionMethod::ChargeAutomatically);
+ invoice.pending_invoice_items_behavior = Some(InvoicePendingInvoiceItemsBehavior::Exclude);
+ invoice.description = Some(one_off.invoice_description);
+ invoice.metadata = Some(one_off.metadata.clone());
+ let invoice = Invoice::create(&self.idempotent(format!("{key}:invoice")), invoice)
+ .await
+ .map_err(payment)?;
+ // Stripe replays the original create response. Read the invoice again
+ // to observe routing written by an earlier attempt.
+ let invoice = Invoice::retrieve(&self.client, &invoice.id, &[])
+ .await
+ .map_err(payment)?;
+ // Finalization can collect before the caller persists this id. A retry
+ // must recover the paid invoice instead of attempting a forbidden update.
+ if invoice.status == Some(InvoiceStatus::Paid) {
+ return Ok(invoice.id.to_string());
+ }
+ let invoice_scope = stamped_scope(&invoice)?;
+ let effective_scope = invoice_scope.unwrap_or(scope);
+ let charge_method = if invoice_scope.is_some_and(|stamped| stamped != scope) {
+ self.resolve_charge_method(&customer, effective_scope)
+ .await?
+ } else {
+ live_method
+ };
+ let stored_method = payment_method_id(&invoice.default_payment_method);
+ let method = charge_method.select_payment_method(stored_method.as_ref())?;
+ self.client
+ .post_form::<Invoice, _>(
+ &format!("/invoices/{}", invoice.id),
+ &UpdateInvoice::new(effective_scope, method.as_ref()),
+ )
+ .await
+ .map_err(payment)?;
+
+ // 2. The line item, attached to that invoice rather than left pending
+ // on the customer where another invoice could sweep it up.
+ let mut item = CreateInvoiceItem::new(customer);
+ item.invoice = Some(invoice.id.clone());
+ item.amount = Some(one_off.amount_cents);
+ item.currency = Some(Currency::USD);
+ item.description = Some(one_off.line_description);
+ item.metadata = Some(one_off.metadata);
+ InvoiceItem::create(&self.idempotent(format!("{key}:item")), item)
+ .await
+ .map_err(payment)?;
+
+ // 3. Finalize so it is collectable now rather than in an hour.
+ Invoice::finalize(
+ &self.idempotent(format!("{key}:finalize")),
+ &invoice.id,
+ FinalizeInvoiceParams {
+ auto_advance: Some(true),
+ },
+ )
+ .await
+ .map_err(payment)?;
+
+ Ok(invoice.id.to_string())
+ }
+
async fn resolve_charge_method(
&self,
customer_id: &CustomerId,
@@ -125,6 +212,41 @@ fn dollars(cents: i64) -> String {
format!("${}.{:02}", cents / 100, cents % 100)
}
+/// What distinguishes one single-line invoice from another.
+struct OneOffInvoice<'a> {
+ /// Prefix of the idempotency keys for the create/item/finalize requests.
+ idempotency_prefix: String,
+ /// Stamped on both the invoice and its line item.
+ metadata: HashMap<String, String>,
+ /// The invoice-level description.
+ invoice_description: &'static str,
+ /// Amount, customer cents.
+ amount_cents: i64,
+ /// Line description shown on the invoice.
+ line_description: &'a str,
+}
+
+fn overage_metadata(charge_id: Uuid) -> HashMap<String, String> {
+ HashMap::from([
+ (
+ PURPOSE_METADATA_KEY.to_string(),
+ PURPOSE_AI_OVERAGE.to_string(),
+ ),
+ (CHARGE_METADATA_KEY.to_string(), charge_id.to_string()),
+ ])
+}
+
+fn credit_reload_metadata(reload_id: Uuid, payer: &MacroUserIdStr<'_>) -> HashMap<String, String> {
+ HashMap::from([
+ (
+ PURPOSE_METADATA_KEY.to_string(),
+ PURPOSE_AI_CREDIT_RELOAD.to_string(),
+ ),
+ (RELOAD_METADATA_KEY.to_string(), reload_id.to_string()),
+ (PAYER_METADATA_KEY.to_string(), payer.to_string()),
+ ])
+}
+
#[derive(PartialEq, Eq)]
enum ChargeMethod {
NoMatchingSubscription,
@@ -346,83 +468,35 @@ impl PaymentGateway for StripePaymentGateway {
#[tracing::instrument(skip(self, request), fields(charge = %request.charge_id, cents = request.amount_cents), err)]
async fn open_overage_invoice(&self, request: OverageChargeRequest) -> Result<String> {
let customer = parse_customer(&request.customer_id)?;
- let live_method = self.resolve_charge_method(&customer, request.scope).await?;
- let key = format!("ai_overage:{}", request.charge_id);
- let metadata: HashMap<String, String> = HashMap::from([
- (
- PURPOSE_METADATA_KEY.to_string(),
- PURPOSE_AI_OVERAGE.to_string(),
- ),
- (
- CHARGE_METADATA_KEY.to_string(),
- request.charge_id.to_string(),
- ),
- ]);
-
- // 1. An empty draft invoice that takes nothing else pending on the
- // customer, so it can never bill more than this one charge.
- // It cannot auto-finalize until routing and its line item are present.
- let mut invoice = CreateInvoice::new();
- invoice.customer = Some(customer.clone());
- invoice.auto_advance = Some(false);
- invoice.collection_method = Some(CollectionMethod::ChargeAutomatically);
- invoice.pending_invoice_items_behavior = Some(InvoicePendingInvoiceItemsBehavior::Exclude);
- invoice.description = Some("Macro AI usage beyond plan");
- invoice.metadata = Some(metadata.clone());
- let invoice = Invoice::create(&self.idempotent(format!("{key}:invoice")), invoice)
- .await
- .map_err(payment)?;
- // Stripe replays the original create response. Read the invoice again
- // to observe routing written by an earlier attempt.
- let invoice = Invoice::retrieve(&self.client, &invoice.id, &[])
- .await
- .map_err(payment)?;
- // Finalization can collect before the caller persists this id. A retry
- // must recover the paid invoice instead of attempting a forbidden update.
- if invoice.status == Some(InvoiceStatus::Paid) {
- return Ok(invoice.id.to_string());
- }
- let invoice_scope = stamped_scope(&invoice)?;
- let scope = invoice_scope.unwrap_or(request.scope);
- let charge_method = if invoice_scope.is_some_and(|scope| scope != request.scope) {
- self.resolve_charge_method(&customer, scope).await?
- } else {
- live_method
- };
- let stored_method = payment_method_id(&invoice.default_payment_method);
- let method = charge_method.select_payment_method(stored_method.as_ref())?;
- self.client
- .post_form::<Invoice, _>(
- &format!("/invoices/{}", invoice.id),
- &UpdateInvoice::new(scope, method.as_ref()),
- )
- .await
- .map_err(payment)?;
-
- // 2. The line item, attached to that invoice rather than left pending
- // on the customer where another invoice could sweep it up.
- let mut item = CreateInvoiceItem::new(customer);
- item.invoice = Some(invoice.id.clone());
- item.amount = Some(request.amount_cents);
- item.currency = Some(Currency::USD);
- item.description = Some(request.description.as_str());
- item.metadata = Some(metadata);
- InvoiceItem::create(&self.idempotent(format!("{key}:item")), item)
- .await
- .map_err(payment)?;
-
- // 3. Finalize so it is collectable now rather than in an hour.
- Invoice::finalize(
- &self.idempotent(format!("{key}:finalize")),
- &invoice.id,
- FinalizeInvoiceParams {
- auto_advance: Some(true),
+ self.open_one_off_invoice(
+ customer,
+ request.scope,
+ OneOffInvoice {
+ idempotency_prefix: format!("ai_overage:{}", request.charge_id),
+ metadata: overage_metadata(request.charge_id),
+ invoice_description: OVERAGE_INVOICE_DESCRIPTION,
+ amount_cents: request.amount_cents,
+ line_description: &request.description,
},
)
.await
- .map_err(payment)?;
+ }
- Ok(invoice.id.to_string())
+ #[tracing::instrument(skip(self, request), fields(reload = %request.reload_id, payer = %request.payer, cents = request.amount_cents), err)]
+ async fn open_credit_reload_invoice(&self, request: CreditReloadRequest) -> Result<String> {
+ let customer = parse_customer(&request.customer_id)?;
+ self.open_one_off_invoice(
+ customer,
+ request.scope,
+ OneOffInvoice {
+ idempotency_prefix: format!("ai_credit_reload:{}", request.reload_id),
+ metadata: credit_reload_metadata(request.reload_id, &request.payer),
+ invoice_description: CREDIT_RELOAD_INVOICE_DESCRIPTION,
+ amount_cents: request.amount_cents,
+ line_description: &request.description,
+ },
+ )
+ .await
}
#[tracing::instrument(skip(self), fields(charge = %charge_id, invoice = %invoice_id), err)]
@@ -542,6 +616,12 @@ impl PaymentGateway for NoOpPaymentGateway {
)))
}
+ async fn open_credit_reload_invoice(&self, _request: CreditReloadRequest) -> Result<String> {
+ Err(BillingError::Payment(anyhow::anyhow!(
+ "payments are not configured in this service"
+ )))
+ }
+
async fn pay_overage_invoice(
&self,
_charge_id: Uuid,
diff --git a/crates/ai_billing/src/outbound/stripe_gateway/test.rs b/crates/ai_billing/src/outbound/stripe_gateway/test.rs
index 8338654c77..fc500bfb48 100644
--- a/crates/ai_billing/src/outbound/stripe_gateway/test.rs
+++ b/crates/ai_billing/src/outbound/stripe_gateway/test.rs
@@ -950,6 +950,42 @@ async fn subscription_period_prefers_the_billable_subscription_to_an_unpaid_one(
);
}
+#[test]
+fn credit_reload_metadata_stamps_purpose_reload_and_payer() {
+ let payer = MacroUserIdStr::try_from("macro|[email protected]".to_string()).expect("payer");
+ let metadata = credit_reload_metadata(Uuid::from_u128(13), &payer);
+
+ assert_eq!(metadata.len(), 3);
+ assert_eq!(
+ metadata.get(PURPOSE_METADATA_KEY).map(String::as_str),
+ Some(PURPOSE_AI_CREDIT_RELOAD)
+ );
+ assert_eq!(
+ metadata.get(RELOAD_METADATA_KEY).map(String::as_str),
+ Some("00000000-0000-0000-0000-00000000000d")
+ );
+ assert_eq!(
+ metadata.get(PAYER_METADATA_KEY).map(String::as_str),
+ Some("macro|[email protected]")
+ );
+ assert!(!metadata.contains_key(CHARGE_METADATA_KEY));
+}
+
+#[test]
+fn overage_metadata_stamps_purpose_and_charge_only() {
+ let metadata = overage_metadata(Uuid::from_u128(1));
+
+ assert_eq!(metadata.len(), 2);
+ assert_eq!(
+ metadata.get(PURPOSE_METADATA_KEY).map(String::as_str),
+ Some(PURPOSE_AI_OVERAGE)
+ );
+ assert_eq!(
+ metadata.get(CHARGE_METADATA_KEY).map(String::as_str),
+ Some("00000000-0000-0000-0000-000000000001")
+ );
+}
+
#[tokio::test]
async fn subscription_period_reports_provider_errors() {
let server = MockServer::start().await;
diff --git a/crates/macro_db_client/migrations/20261006145825_ai_billing_auto_reload.sql b/crates/macro_db_client/migrations/20261006145825_ai_billing_auto_reload.sql
new file mode 100644
index 0000000000..1f364db2de
--- /dev/null
+++ b/crates/macro_db_client/migrations/20261006145825_ai_billing_auto_reload.sql
@@ -0,0 +1,60 @@
+-- AI billing: automatic credit reloads.
+--
+-- A payer who opts into overage ("extra usage") now also gets their prepaid
+-- credit balance topped up automatically: when settlement sees the balance
+-- about to drop below a per-payer minimum, it buys credits up to a per-payer
+-- target through a one-off Stripe invoice, before any overage chunk would be
+-- reserved. The thresholds live on ai_billing_account; the reloads themselves
+-- are tracked in ai_credit_reload, mirroring ai_overage_charge.
+
+-- ---------------------------------------------------------------------------
+-- 1. Per-payer reload thresholds, in list-rate cents. Defaults match the
+-- Usage page dialog ($10 minimum, $100 target, no monthly limit).
+-- ---------------------------------------------------------------------------
+ALTER TABLE ai_billing_account
+ -- Reload when the credit balance (after this settlement) falls below this.
+ ADD COLUMN auto_reload_minimum_cents BIGINT NOT NULL DEFAULT 1000,
+ -- Reload brings the credit balance back up to this.
+ ADD COLUMN auto_reload_target_cents BIGINT NOT NULL DEFAULT 10000,
+ -- Cap on reload spend per UTC calendar month. NULL means no limit.
+ ADD COLUMN auto_reload_monthly_limit_cents BIGINT,
+ -- Set when a reload failed to collect; reloads stay off until the payer
+ -- re-enables extra usage. Overage chunks remain the fallback meanwhile.
+ ADD COLUMN auto_reload_suspended_at TIMESTAMPTZ;
+
+-- ---------------------------------------------------------------------------
+-- 2. Credit reloads pushed to Stripe, in list-rate cents. `pending` rows block
+-- further reloads until Stripe resolves the invoice; `failed` rows suspend
+-- automatic reloads for the payer.
+-- ---------------------------------------------------------------------------
+CREATE TYPE ai_credit_reload_status AS ENUM ('pending', 'paid', 'failed');
+
+CREATE TABLE ai_credit_reload (
+ id UUID PRIMARY KEY,
+ user_id TEXT NOT NULL,
+ amount_cents BIGINT NOT NULL,
+ stripe_invoice_id TEXT,
+ status ai_credit_reload_status NOT NULL DEFAULT 'pending',
+ created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+ updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+
+CREATE UNIQUE INDEX ai_credit_reload_stripe_invoice_id_key
+ ON ai_credit_reload (stripe_invoice_id) WHERE stripe_invoice_id IS NOT NULL;
+CREATE INDEX ai_credit_reload_user_id_created_at_idx
+ ON ai_credit_reload (user_id, created_at DESC);
+
+-- ---------------------------------------------------------------------------
+-- 3. Safety reset. Overage has not been deployed to users yet, and from now on
+-- the overage opt-in also drives automatic reloads, so nobody should be
+-- opted in without having seen the new terms. Turn it off everywhere; the
+-- Usage page auto-reload dialog is the only way to turn it back on.
+-- ---------------------------------------------------------------------------
+UPDATE ai_billing_account
+SET overage_enabled = FALSE,
+ overage_limit_cents = 0,
+ overage_suspended_at = NULL,
+ updated_at = NOW()
+WHERE overage_enabled
+ OR overage_limit_cents <> 0
+ OR overage_suspended_at IS NOT NULL;
diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.md
index 6cd8626d31..a6f2c7fe73 100644
--- a/docs/AGENT_GUIDE/ai-chat.md
+++ b/docs/AGENT_GUIDE/ai-chat.md
@@ -620,7 +620,8 @@ answer 402 with code `ai_free_allowance_exhausted`. The dialog title is
`You've used this month's free AI`; it says `Subscribe to a paid plan to keep
going.` and offers `View plans`, which opens Billing. This upgrade path remains
available while the usage summary loads or fails. Free users cannot buy credits
-or enable Auto-Reload. The cap resets with the UTC calendar month.
+or enable Auto-Reload. Enabling Auto-Reload is how paid payers turn on usage
+billing. The cap resets with the UTC calendar month.
Each team seat has its own allowance; unused allowance never moves between
members. The team owner's prepaid credits and usage-billing cap are shared.
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index bf9cd565bf..50842dd305 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -2036,14 +2036,22 @@ those controls, with purchases disabled.
The **Automatic reload** switch opens **Auto-Reload** without toggling directly.
It contains Minimum balance (default `$10`), Target balance (default `$100`),
optional Maximum monthly spend (`No limit`), a payment-method management link,
-and the automatic-charge warning. Balance-triggered reload is not implemented
-by the backend yet, so saving is disabled outside its explicit developer preview.
-Existing postpaid usage billing is shown separately and can be turned off by the
-payer. Local **Developer tools** offer `Preview Free plan` and `Preview paid plan`
-to display either Usage page with sample usage, regardless of the signed-in
-account's tier. `Open Free usage-limit dialog` and `Open paid usage-limit dialog`
-open the corresponding exhausted-usage prompt directly. The previews also work
-before the usage summary loads or when it fails. The paid-plan preview allows
+and the automatic-charge warning. The dialog saves for paid payers:
+`Turn on auto-reload` enables usage billing with those thresholds (the monthly
+limit also caps usage billing per period), `Save` updates them while on, and
+`Turn off` disables usage billing. The **Automatic reload** switch reflects the
+saved state. Paid team members who are not the payer see
+`Only the account that pays for this plan can change automatic reload.` and
+cannot save. After a failed automatic reload the dialog shows `Your last
+automatic reload could not be charged. Update your payment method, then save to
+try again.`; saving retries. Existing postpaid usage billing is shown separately
+and can be turned off by the payer; while it is on, credits reload automatically
+when the balance drops below the minimum. Local **Developer tools** offer
+`Preview Free plan` and `Preview paid plan` to display either Usage page with
+sample usage, regardless of the signed-in account's tier.
+`Open Free usage-limit dialog` and `Open paid usage-limit dialog` open the
+corresponding exhausted-usage prompt directly. The previews also work before
+the usage summary loads or when it fails. The paid-plan preview allows
testing Auto-Reload settings. Purchases and payment management are disabled during any
preview; `Reset preview` restores server data and closes the usage-limit dialog.
`Preview production before Oct 8` shows the October 8 announcement and disables
diff --git a/docs/AI_QUOTA_ENFORCEMENT.md b/docs/AI_QUOTA_ENFORCEMENT.md
index 7c9914b682..60aeea346e 100644
--- a/docs/AI_QUOTA_ENFORCEMENT.md
+++ b/docs/AI_QUOTA_ENFORCEMENT.md
@@ -97,7 +97,7 @@ Only two hosts participate:
| Host | Gate | When disabled |
| --- | --- | --- |
-| Authentication service | [`BillingServiceImpl::settle`](../crates/ai_billing/src/domain/service.rs) guards every caller: summary reads, overage changes, credit-purchase webhooks, and the internal settle endpoint | Returns without reading entitlements, consuming credits, or touching Stripe. Credit purchases are still booked and remain unconsumed |
+| Authentication service | [`BillingServiceImpl::settle`](../crates/ai_billing/src/domain/service.rs) guards every caller: summary reads, overage and auto-reload changes, credit-purchase webhooks, and the internal settle endpoint. It also reserves and collects automatic credit reloads | Returns without reading entitlements, consuming credits, reloading credits, or touching Stripe. Credit purchases are still booked and remain unconsumed |
| Document cognition service | [`SettlingUsageRecorder`](../crates/ai_billing/src/outbound/settling_recorder.rs) requests settlement after counted usage lands | Usage is still recorded and counted; no settlement request is sent |
Every other host composes admission through
@@ -109,6 +109,37 @@ settles on summary reads, overage changes, and credit purchases. Enable both
together. Settlement without `ENABLE_AI_USAGE_ENFORCEMENT` finds nothing to
settle, because only counted rows are chargeable.
+Automatic credit reload is part of the same settlement. It fires only inside
+`BillingServiceImpl::settle`, so it shares the `ENABLE_AI_USAGE_BILLING` gate,
+and only for the current period, before an overage chunk is reserved: while
+overage is active (enabled, not suspended, cap above zero) and reloads are not
+reload-suspended, settlement compares the credit balance net of the period's
+uncovered usage with the payer's minimum balance and, below it, reloads up to the
+target balance. The minimum, target, and optional monthly spend limit are stored
+per payer on `ai_billing_account` (defaults `$10`, `$100`, and no limit). The
+monthly limit counts reloads Stripe may still collect (pending, paid, or failed
+with an invoice) within the UTC calendar month, independent of the Stripe period
+anchor; a remainder under the Stripe minimum charge is skipped. Each reload is one `ai_credit_reload` row reserved under the
+payer lock and collected as a one-off Stripe invoice stamped
+`macro_purpose = ai_credit_reload`; a paid invoice books an `ai_credit_ledger`
+purchase, idempotent on the invoice id. A declined invoice stays pending, which
+blocks further reloads, until the Stripe webhook reports it paid (credits are
+booked) or failed (reloads are suspended). A provider failure marks the reload
+failed and sets `auto_reload_suspended_at`; overage remains the fallback until
+the payer saves their settings again. A failed reload whose invoice reached
+Stripe keeps that invoice, and the next reservation after reloads are re-enabled
+retries it rather than opening a second one. `PATCH /ai-billing/auto-reload`
+(payer on a paid plan only) is how overage is turned on: enabling validates and
+stores the thresholds, sets `overage_enabled`, uses the monthly limit as the
+per-period overage cap (the offered maximum when there is no limit), clears both
+suspensions, and settles at once; disabling behaves like turning overage off and
+keeps the stored thresholds. A monthly limit must be at least the overage cap
+minimum (`$5`) so the cap is never raised above what the payer entered. The
+monthly limit bounds reload purchases per calendar month; the overage cap it
+seeds bounds how far *over* credits usage may run per Stripe period. They are
+not a combined budget. `GET /ai-billing/summary`
+reports `auto_reload` with the thresholds, `suspended`, and `active`.
+
The frontend is not tied to this flag. Settings → Usage and the shared usage-limit
dialog support all plans. Production activation follows the
`enable-ai-usage-billing` PostHog flag: while off or loading, Usage shows the
@@ -124,8 +155,8 @@ Plan allowance copy and comparisons follow the `enable-ai-usage-billing` PostHog
flag (`enableAiUsageBilling` in `apps/web/src/lib/core/constant/featureFlags.ts`),
which defaults on in development builds and follows PostHog elsewhere;
`VITE_ENABLE_AI_USAGE_BILLING` overrides it locally. Model usage multipliers have
-been removed. The Auto-Reload UI has no balance-triggered backend yet and cannot
-save outside its explicit display-only developer preview.
+been removed. The Auto-Reload dialog saves through `PATCH /ai-billing/auto-reload`
+and is the only surface that turns usage billing on.
## Public failure contracts
diff --git a/packages/sdk/generated/auth/index.ts b/packages/sdk/generated/auth/index.ts
index 0019e17488..921cc58820 100644
--- a/packages/sdk/generated/auth/index.ts
+++ b/packages/sdk/generated/auth/index.ts
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export { type Options, Sdk } from './sdk.gen';
-export type { AbGroup, AiBillingErrorBody, AppleLoginData, AppleLoginError, AppleLoginErrors, AppleLoginRequest, AppleLoginResponse, AppleLoginResponses, CancelCodexLoginData, CancelCodexLoginResponse, CancelCodexLoginResponses, ChangePlanData, ChangePlanError, ChangePlanErrors, ChangePlanRequest, ChangePlanResponse, ChangePlanResponse2, ChangePlanResponses, CheckGithubLinkStatusData, CheckGithubLinkStatusError, CheckGithubLinkStatusErrors, CheckGithubLinkStatusResponse, CheckGithubLinkStatusResponses, CheckGmailLinkStatusData, CheckGmailLinkStatusError, CheckGmailLinkStatusErrors, CheckGmailLinkStatusResponse, CheckGmailLinkStatusResponses, CheckoutSessionMetadata, CheckoutSessionV2Response, ClientOptions, CodexConfigRequest, CodexConnectionStatus, CodexEnvironment, CodexEnvironmentRepository, CodexLoginPoll, CodexLoginStart, CodexLoginState, ConfigureCodexData, ConfigureCodexResponse, ConfigureCodexResponses, CreateAccountMergeRequest, CreateAiCreditCheckoutData, CreateAiCreditCheckoutError, CreateAiCreditCheckoutErrors, CreateAiCreditCheckoutResponse, CreateAiCreditCheckoutResponses, CreateCheckoutSessionV2Data, CreateCheckoutSessionV2Error, CreateCheckoutSessionV2Errors, CreateCheckoutSessionV2Request, CreateCheckoutSessionV2Response, CreateCheckoutSessionV2Responses, CreateGtmInviteLinkData, CreateGtmInviteLinkError, CreateGtmInviteLinkErrors, CreateGtmInviteLinkRequest, CreateGtmInviteLinkResponse, CreateGtmInviteLinkResponses, CreateInProgressLinkData, CreateInProgressLinkError, CreateInProgressLinkErrors, CreateInProgressLinkResponse, CreateInProgressLinkResponse2, CreateInProgressLinkResponses, CreateMergeRequestData, CreateMergeRequestError, CreateMergeRequestErrors, CreateMergeRequestResponse, CreateMergeRequestResponses, CreatePortalSessionData, CreatePortalSessionError, CreatePortalSessionErrors, CreatePortalSessionRequest, CreatePortalSessionResponse, CreatePortalSessionResponses, CreateTeamData, CreateTeamError, CreateTeamErrors, CreateTeamRequest, CreateTeamResponse, CreateTeamResponses, CreateUserData, CreateUserError, CreateUserErrors, CreateUserRequest, CreateUserResponse, CreateUserResponses, CreditCheckoutRequestBody, CreditCheckoutResponse, CursorApiKeyStatus, CursorModelOption, CursorModelsResponse, DeleteCursorApiKeyData, DeleteCursorApiKeyError, DeleteCursorApiKeyErrors, DeleteCursorApiKeyResponse, DeleteCursorApiKeyResponses, DeleteGithubLinkData, DeleteGithubLinkError, DeleteGithubLinkErrors, DeleteGithubLinkResponse, DeleteGithubLinkResponses, DeleteTeamData, DeleteTeamError, DeleteTeamErrors, DeleteTeamInviteHandlerData, DeleteTeamInviteHandlerError, DeleteTeamInviteHandlerErrors, DeleteTeamInviteHandlerResponses, DeleteTeamResponses, DeleteUserData, DeleteUserError, DeleteUserErrors, DeleteUserResponse, DeleteUserResponses, DenyReason, DisconnectCodexData, DisconnectCodexResponse, DisconnectCodexResponses, EmptyResponse, EnrichedGithubPullRequest, EnrichGithubPullRequestsData, EnrichGithubPullRequestsError, EnrichGithubPullRequestsErrors, EnrichGithubPullRequestsProxyRequest, EnrichGithubPullRequestsResponse, EnrichGithubPullRequestsResponse2, EnrichGithubPullRequestsResponses, ErrorResponse, GenerateEmailLinkData, GenerateEmailLinkError, GenerateEmailLinkErrors, GenerateEmailLinkRequest, GenerateEmailLinkResponse, GenerateEmailLinkResponses, GenericSuccessResponse, GetAiBillingPlansData, GetAiBillingPlansResponse, GetAiBillingPlansResponses, GetAiBillingSummaryData, GetAiBillingSummaryError, GetAiBillingSummaryErrors, GetAiBillingSummaryResponse, GetAiBillingSummaryResponses, GetCodexConnectionData, GetCodexConnectionResponse, GetCodexConnectionResponses, GetCursorApiKeyData, GetCursorApiKeyError, GetCursorApiKeyErrors, GetCursorApiKeyResponse, GetCursorApiKeyResponses, GetGtmInviteOfferData, GetGtmInviteOfferError, GetGtmInviteOfferErrors, GetGtmInviteOfferResponse, GetGtmInviteOfferResponses, GetLegacyUserPermissionsData, GetLegacyUserPermissionsError, GetLegacyUserPermissionsErrors, GetLegacyUserPermissionsResponse, GetLegacyUserPermissionsResponse2, GetLegacyUserPermissionsResponses, GetNamesWithEmailRequestBody, GetPermissionsData, GetPermissionsError, GetPermissionsErrors, GetPermissionsResponse, GetPermissionsResponses, GetProfilePicturesRequestBody, GetReferralCodeData, GetReferralCodeError, GetReferralCodeErrors, GetReferralCodeResponse, GetReferralCodeResponses, GetTeamData, GetTeamError, GetTeamErrors, GetTeamInvitesData, GetTeamInvitesError, GetTeamInvitesErrors, GetTeamInvitesResponse, GetTeamInvitesResponses, GetTeamResponse, GetTeamResponses, GetUserInfo, GetUserInfoData, GetUserInfoError, GetUserInfoErrors, GetUserInfoResponse, GetUserInfoResponses, GetUserInvitesData, GetUserInvitesError, GetUserInvitesErrors, GetUserInvitesResponse, GetUserInvitesResponses, GetUserLinkExistsData, GetUserLinkExistsError, GetUserLinkExistsErrors, GetUserLinkExistsResponse, GetUserLinkExistsResponses, GetUserNameData, GetUserNameError, GetUserNameErrors, GetUserNameResponse, GetUserNameResponses, GetUserNamesData, GetUserNamesError, GetUserNamesErrors, GetUserNamesResponse, GetUserNamesResponses, GetUserNamesWithEmailData, GetUserNamesWithEmailError, GetUserNamesWithEmailErrors, GetUserNamesWithEmailResponse, GetUserNamesWithEmailResponses, GetUserOrganizationData, GetUserOrganizationError, GetUserOrganizationErrors, GetUserOrganizationResponse, GetUserOrganizationResponses, GetUserPermissionsData, GetUserPermissionsError, GetUserPermissionsErrors, GetUserPermissionsResponse, GetUserPermissionsResponses, GetUserQuotaData, GetUserQuotaError, GetUserQuotaErrors, GetUserQuotaResponse, GetUserQuotaResponses, GetUserTeamsData, GetUserTeamsError, GetUserTeamsErrors, GetUserTeamsResponse, GetUserTeamsResponses, GithubLinkStatusResponse, GithubMergeMethod, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestLabel, GithubPullRequestRef, GithubPullRequestReview, GithubPullRequestReviewState, GithubPullRequestStatus, GithubPullRequestUser, GmailLinkStatusResponse, GtmInviteLink, GtmInviteLinkList, GtmInviteLinkStatus, GtmInviteOffer, GtmInviteOfferStatus, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, InitGithubLinkData, InitGithubLinkError, InitGithubLinkErrors, InitGithubLinkResponse, InitGithubLinkResponse2, InitGithubLinkResponses, InitGmailLinkData, InitGmailLinkError, InitGmailLinkErrors, InitGmailLinkResponse, InitGmailLinkResponse2, InitGmailLinkResponses, InitOutlookLinkData, InitOutlookLinkError, InitOutlookLinkErrors, InitOutlookLinkResponse, InitOutlookLinkResponse2, InitOutlookLinkResponses, InviteEntry, InviteToTeamData, InviteToTeamError, InviteToTeamErrors, InviteToTeamRequest, InviteToTeamResponses, JoinTeamData, JoinTeamError, JoinTeamErrors, JoinTeamResponses, LinkShare, ListCodexEnvironmentsData, ListCodexEnvironmentsResponse, ListCodexEnvironmentsResponses, ListCursorModelsData, ListCursorModelsError, ListCursorModelsErrors, ListCursorModelsResponse, ListCursorModelsResponses, ListGtmInviteLinksData, ListGtmInviteLinksError, ListGtmInviteLinksErrors, ListGtmInviteLinksResponse, ListGtmInviteLinksResponses, LogoutData, LogoutResponse, LogoutResponses, MacroApiTokenData, MacroApiTokenError, MacroApiTokenErrors, MacroApiTokenResponse, MacroApiTokenResponse2, MacroApiTokenResponses, MergeGithubPullRequestData, MergeGithubPullRequestError, MergeGithubPullRequestErrors, MergeGithubPullRequestRequest, MergeGithubPullRequestResponse, MergeGithubPullRequestResponse2, MergeGithubPullRequestResponses, Oauth2CallbackData, Oauth2CallbackError, Oauth2CallbackErrors, Oauth2CallbackResponses, OauthRedirectData, OauthRedirectError, OauthRedirectErrors, OauthRedirectResponses, PasswordlessCallbackData, PasswordlessCallbackError, PasswordlessCallbackErrors, PasswordlessCallbackResponse, PasswordlessCallbackResponses, PasswordlessLoginData, PasswordlessLoginError, PasswordlessLoginErrors, PasswordlessLoginResponse, PasswordlessLoginResponses, PasswordlessRequest, PasswordlessStartedResponse, PasswordLoginData, PasswordLoginError, PasswordLoginErrors, PasswordLoginResponse, PasswordLoginResponses, PasswordRequest, PatchTeamCrmSettingsData, PatchTeamCrmSettingsError, PatchTeamCrmSettingsErrors, PatchTeamCrmSettingsRequest, PatchTeamCrmSettingsResponse, PatchTeamCrmSettingsResponse2, PatchTeamCrmSettingsResponses, PatchTeamData, PatchTeamError, PatchTeamErrors, PatchTeamMemberPlanData, PatchTeamMemberPlanError, PatchTeamMemberPlanErrors, PatchTeamMemberPlanRequest, PatchTeamMemberPlanResponse, PatchTeamMemberPlanResponses, PatchTeamRequest, PatchTeamResponses, PatchTeamUserRole, PatchUserGroupData, PatchUserGroupError, PatchUserGroupErrors, PatchUserGroupRequest, PatchUserGroupResponse, PatchUserGroupResponses, PatchUserOnboardingData, PatchUserOnboardingError, PatchUserOnboardingErrors, PatchUserOnboardingRequest, PatchUserOnboardingResponse, PatchUserOnboardingResponses, PatchUserTutorialData, PatchUserTutorialError, PatchUserTutorialErrors, PatchUserTutorialRequest, PatchUserTutorialResponse, PatchUserTutorialResponses, Permission, PlanCatalogEntry, PlanCatalogResponse, PlanTier, PollCodexLoginData, PollCodexLoginResponse, PollCodexLoginResponses, PostGetNamesRequestBody, PostProfilePicturesData, PostProfilePicturesError, PostProfilePicturesErrors, PostProfilePicturesResponse, PostProfilePicturesResponses, ProfilePictureQueryParams, ProfilePictures, PublicGtmInviteLink, PutCursorApiKeyData, PutCursorApiKeyError, PutCursorApiKeyErrors, PutCursorApiKeyRequest, PutCursorApiKeyResponse, PutCursorApiKeyResponses, PutCursorDefaultModelData, PutCursorDefaultModelError, PutCursorDefaultModelErrors, PutCursorDefaultModelRequest, PutCursorDefaultModelResponse, PutCursorDefaultModelResponses, PutProfilePictureData, PutProfilePictureError, PutProfilePictureErrors, PutProfilePictureResponse, PutProfilePictureResponses, PutUserNameData, PutUserNameError, PutUserNameErrors, PutUserNameQueryParams, PutUserNameResponse, PutUserNameResponses, RedeemGtmInviteLinkData, RedeemGtmInviteLinkError, RedeemGtmInviteLinkErrors, RedeemGtmInviteLinkRequest, RedeemGtmInviteLinkResponse, RedeemGtmInviteLinkResponses, RefreshData, RefreshError, RefreshErrors, RefreshResponse, RefreshResponses, RejectInvitationData, RejectInvitationError, RejectInvitationErrors, RejectInvitationResponses, RemoveUserFromTeamData, RemoveUserFromTeamError, RemoveUserFromTeamErrors, RemoveUserFromTeamResponses, ResendFusionauthVerifyUserEmailData, ResendFusionauthVerifyUserEmailError, ResendFusionauthVerifyUserEmailErrors, ResendFusionauthVerifyUserEmailRequest, ResendFusionauthVerifyUserEmailResponse, ResendFusionauthVerifyUserEmailResponses, ResolveGtmInviteLinkData, ResolveGtmInviteLinkError, ResolveGtmInviteLinkErrors, ResolveGtmInviteLinkResponse, ResolveGtmInviteLinkResponses, RevokeGtmInviteLinkData, RevokeGtmInviteLinkError, RevokeGtmInviteLinkErrors, RevokeGtmInviteLinkResponse, RevokeGtmInviteLinkResponses, SeatPlan, SendInviteBody, SendMobileWelcomeEmailData, SendMobileWelcomeEmailError, SendMobileWelcomeEmailErrors, SendMobileWelcomeEmailRequest, SendMobileWelcomeEmailResponse, SendMobileWelcomeEmailResponse2, SendMobileWelcomeEmailResponses, SendReferralCodeData, SendReferralCodeError, SendReferralCodeErrors, SendReferralCodeResponse, SendReferralCodeResponses, SessionCreationData, SessionCreationError, SessionCreationErrors, SessionCreationResponse, SessionCreationResponses, SessionLoginData, SessionLoginError, SessionLoginErrors, SessionLoginResponse, SessionLoginResponses, SsoLoginData, SsoLoginError, SsoLoginErrors, SsoLoginResponses, SsoRequiredResponse, StartCodexLoginData, StartCodexLoginResponse, StartCodexLoginResponses, StripeSessionResponse, Team, TeamInviteDetails, TeamInvitesResponse, TeamMember, TeamPlan, TeamRole, TeamWithMembers, ToggleAutoJoinDomainResponse, ToggleNonAdminInvitesResponse, ToggleTeamAutoJoinDomainData, ToggleTeamAutoJoinDomainError, ToggleTeamAutoJoinDomainErrors, ToggleTeamAutoJoinDomainResponse, ToggleTeamAutoJoinDomainResponses, ToggleTeamNonAdminInvitesData, ToggleTeamNonAdminInvitesError, ToggleTeamNonAdminInvitesErrors, ToggleTeamNonAdminInvitesResponse, ToggleTeamNonAdminInvitesResponses, UpdateAiBillingOverageData, UpdateAiBillingOverageError, UpdateAiBillingOverageErrors, UpdateAiBillingOverageResponse, UpdateAiBillingOverageResponses, UpdateOverageRequest, UsageSnapshot, UserLinkResponse, UserName, UserNames, UserOrganizationResponse, UserProfilePicture, UserQuota, UserTokensResponse, VerifyEmailLinkData, VerifyEmailLinkError, VerifyEmailLinkErrors, VerifyEmailLinkResponse, VerifyEmailLinkResponses, VerifyFusionauthUserEmailData, VerifyFusionauthUserEmailError, VerifyFusionauthUserEmailErrors, VerifyFusionauthUserEmailResponse, VerifyFusionauthUserEmailResponses, VerifyMergeRequestData, VerifyMergeRequestError, VerifyMergeRequestErrors, VerifyMergeRequestResponse, VerifyMergeRequestResponses } from './types.gen';
+export type { AbGroup, AiBillingErrorBody, AppleLoginData, AppleLoginError, AppleLoginErrors, AppleLoginRequest, AppleLoginResponse, AppleLoginResponses, AutoReloadDefaults, AutoReloadSnapshot, CancelCodexLoginData, CancelCodexLoginResponse, CancelCodexLoginResponses, ChangePlanData, ChangePlanError, ChangePlanErrors, ChangePlanRequest, ChangePlanResponse, ChangePlanResponse2, ChangePlanResponses, CheckGithubLinkStatusData, CheckGithubLinkStatusError, CheckGithubLinkStatusErrors, CheckGithubLinkStatusResponse, CheckGithubLinkStatusResponses, CheckGmailLinkStatusData, CheckGmailLinkStatusError, CheckGmailLinkStatusErrors, CheckGmailLinkStatusResponse, CheckGmailLinkStatusResponses, CheckoutSessionMetadata, CheckoutSessionV2Response, ClientOptions, CodexConfigRequest, CodexConnectionStatus, CodexEnvironment, CodexEnvironmentRepository, CodexLoginPoll, CodexLoginStart, CodexLoginState, ConfigureCodexData, ConfigureCodexResponse, ConfigureCodexResponses, CreateAccountMergeRequest, CreateAiCreditCheckoutData, CreateAiCreditCheckoutError, CreateAiCreditCheckoutErrors, CreateAiCreditCheckoutResponse, CreateAiCreditCheckoutResponses, CreateCheckoutSessionV2Data, CreateCheckoutSessionV2Error, CreateCheckoutSessionV2Errors, CreateCheckoutSessionV2Request, CreateCheckoutSessionV2Response, CreateCheckoutSessionV2Responses, CreateGtmInviteLinkData, CreateGtmInviteLinkError, CreateGtmInviteLinkErrors, CreateGtmInviteLinkRequest, CreateGtmInviteLinkResponse, CreateGtmInviteLinkResponses, CreateInProgressLinkData, CreateInProgressLinkError, CreateInProgressLinkErrors, CreateInProgressLinkResponse, CreateInProgressLinkResponse2, CreateInProgressLinkResponses, CreateMergeRequestData, CreateMergeRequestError, CreateMergeRequestErrors, CreateMergeRequestResponse, CreateMergeRequestResponses, CreatePortalSessionData, CreatePortalSessionError, CreatePortalSessionErrors, CreatePortalSessionRequest, CreatePortalSessionResponse, CreatePortalSessionResponses, CreateTeamData, CreateTeamError, CreateTeamErrors, CreateTeamRequest, CreateTeamResponse, CreateTeamResponses, CreateUserData, CreateUserError, CreateUserErrors, CreateUserRequest, CreateUserResponse, CreateUserResponses, CreditCheckoutRequestBody, CreditCheckoutResponse, CursorApiKeyStatus, CursorModelOption, CursorModelsResponse, DeleteCursorApiKeyData, DeleteCursorApiKeyError, DeleteCursorApiKeyErrors, DeleteCursorApiKeyResponse, DeleteCursorApiKeyResponses, DeleteGithubLinkData, DeleteGithubLinkError, DeleteGithubLinkErrors, DeleteGithubLinkResponse, DeleteGithubLinkResponses, DeleteTeamData, DeleteTeamError, DeleteTeamErrors, DeleteTeamInviteHandlerData, DeleteTeamInviteHandlerError, DeleteTeamInviteHandlerErrors, DeleteTeamInviteHandlerResponses, DeleteTeamResponses, DeleteUserData, DeleteUserError, DeleteUserErrors, DeleteUserResponse, DeleteUserResponses, DenyReason, DisconnectCodexData, DisconnectCodexResponse, DisconnectCodexResponses, EmptyResponse, EnrichedGithubPullRequest, EnrichGithubPullRequestsData, EnrichGithubPullRequestsError, EnrichGithubPullRequestsErrors, EnrichGithubPullRequestsProxyRequest, EnrichGithubPullRequestsResponse, EnrichGithubPullRequestsResponse2, EnrichGithubPullRequestsResponses, ErrorResponse, GenerateEmailLinkData, GenerateEmailLinkError, GenerateEmailLinkErrors, GenerateEmailLinkRequest, GenerateEmailLinkResponse, GenerateEmailLinkResponses, GenericSuccessResponse, GetAiBillingPlansData, GetAiBillingPlansResponse, GetAiBillingPlansResponses, GetAiBillingSummaryData, GetAiBillingSummaryError, GetAiBillingSummaryErrors, GetAiBillingSummaryResponse, GetAiBillingSummaryResponses, GetCodexConnectionData, GetCodexConnectionResponse, GetCodexConnectionResponses, GetCursorApiKeyData, GetCursorApiKeyError, GetCursorApiKeyErrors, GetCursorApiKeyResponse, GetCursorApiKeyResponses, GetGtmInviteOfferData, GetGtmInviteOfferError, GetGtmInviteOfferErrors, GetGtmInviteOfferResponse, GetGtmInviteOfferResponses, GetLegacyUserPermissionsData, GetLegacyUserPermissionsError, GetLegacyUserPermissionsErrors, GetLegacyUserPermissionsResponse, GetLegacyUserPermissionsResponse2, GetLegacyUserPermissionsResponses, GetNamesWithEmailRequestBody, GetPermissionsData, GetPermissionsError, GetPermissionsErrors, GetPermissionsResponse, GetPermissionsResponses, GetProfilePicturesRequestBody, GetReferralCodeData, GetReferralCodeError, GetReferralCodeErrors, GetReferralCodeResponse, GetReferralCodeResponses, GetTeamData, GetTeamError, GetTeamErrors, GetTeamInvitesData, GetTeamInvitesError, GetTeamInvitesErrors, GetTeamInvitesResponse, GetTeamInvitesResponses, GetTeamResponse, GetTeamResponses, GetUserInfo, GetUserInfoData, GetUserInfoError, GetUserInfoErrors, GetUserInfoResponse, GetUserInfoResponses, GetUserInvitesData, GetUserInvitesError, GetUserInvitesErrors, GetUserInvitesResponse, GetUserInvitesResponses, GetUserLinkExistsData, GetUserLinkExistsError, GetUserLinkExistsErrors, GetUserLinkExistsResponse, GetUserLinkExistsResponses, GetUserNameData, GetUserNameError, GetUserNameErrors, GetUserNameResponse, GetUserNameResponses, GetUserNamesData, GetUserNamesError, GetUserNamesErrors, GetUserNamesResponse, GetUserNamesResponses, GetUserNamesWithEmailData, GetUserNamesWithEmailError, GetUserNamesWithEmailErrors, GetUserNamesWithEmailResponse, GetUserNamesWithEmailResponses, GetUserOrganizationData, GetUserOrganizationError, GetUserOrganizationErrors, GetUserOrganizationResponse, GetUserOrganizationResponses, GetUserPermissionsData, GetUserPermissionsError, GetUserPermissionsErrors, GetUserPermissionsResponse, GetUserPermissionsResponses, GetUserQuotaData, GetUserQuotaError, GetUserQuotaErrors, GetUserQuotaResponse, GetUserQuotaResponses, GetUserTeamsData, GetUserTeamsError, GetUserTeamsErrors, GetUserTeamsResponse, GetUserTeamsResponses, GithubLinkStatusResponse, GithubMergeMethod, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestLabel, GithubPullRequestRef, GithubPullRequestReview, GithubPullRequestReviewState, GithubPullRequestStatus, GithubPullRequestUser, GmailLinkStatusResponse, GtmInviteLink, GtmInviteLinkList, GtmInviteLinkStatus, GtmInviteOffer, GtmInviteOfferStatus, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, InitGithubLinkData, InitGithubLinkError, InitGithubLinkErrors, InitGithubLinkResponse, InitGithubLinkResponse2, InitGithubLinkResponses, InitGmailLinkData, InitGmailLinkError, InitGmailLinkErrors, InitGmailLinkResponse, InitGmailLinkResponse2, InitGmailLinkResponses, InitOutlookLinkData, InitOutlookLinkError, InitOutlookLinkErrors, InitOutlookLinkResponse, InitOutlookLinkResponse2, InitOutlookLinkResponses, InviteEntry, InviteToTeamData, InviteToTeamError, InviteToTeamErrors, InviteToTeamRequest, InviteToTeamResponses, JoinTeamData, JoinTeamError, JoinTeamErrors, JoinTeamResponses, LinkShare, ListCodexEnvironmentsData, ListCodexEnvironmentsResponse, ListCodexEnvironmentsResponses, ListCursorModelsData, ListCursorModelsError, ListCursorModelsErrors, ListCursorModelsResponse, ListCursorModelsResponses, ListGtmInviteLinksData, ListGtmInviteLinksError, ListGtmInviteLinksErrors, ListGtmInviteLinksResponse, ListGtmInviteLinksResponses, LogoutData, LogoutResponse, LogoutResponses, MacroApiTokenData, MacroApiTokenError, MacroApiTokenErrors, MacroApiTokenResponse, MacroApiTokenResponse2, MacroApiTokenResponses, MergeGithubPullRequestData, MergeGithubPullRequestError, MergeGithubPullRequestErrors, MergeGithubPullRequestRequest, MergeGithubPullRequestResponse, MergeGithubPullRequestResponse2, MergeGithubPullRequestResponses, Oauth2CallbackData, Oauth2CallbackError, Oauth2CallbackErrors, Oauth2CallbackResponses, OauthRedirectData, OauthRedirectError, OauthRedirectErrors, OauthRedirectResponses, PasswordlessCallbackData, PasswordlessCallbackError, PasswordlessCallbackErrors, PasswordlessCallbackResponse, PasswordlessCallbackResponses, PasswordlessLoginData, PasswordlessLoginError, PasswordlessLoginErrors, PasswordlessLoginResponse, PasswordlessLoginResponses, PasswordlessRequest, PasswordlessStartedResponse, PasswordLoginData, PasswordLoginError, PasswordLoginErrors, PasswordLoginResponse, PasswordLoginResponses, PasswordRequest, PatchTeamCrmSettingsData, PatchTeamCrmSettingsError, PatchTeamCrmSettingsErrors, PatchTeamCrmSettingsRequest, PatchTeamCrmSettingsResponse, PatchTeamCrmSettingsResponse2, PatchTeamCrmSettingsResponses, PatchTeamData, PatchTeamError, PatchTeamErrors, PatchTeamMemberPlanData, PatchTeamMemberPlanError, PatchTeamMemberPlanErrors, PatchTeamMemberPlanRequest, PatchTeamMemberPlanResponse, PatchTeamMemberPlanResponses, PatchTeamRequest, PatchTeamResponses, PatchTeamUserRole, PatchUserGroupData, PatchUserGroupError, PatchUserGroupErrors, PatchUserGroupRequest, PatchUserGroupResponse, PatchUserGroupResponses, PatchUserOnboardingData, PatchUserOnboardingError, PatchUserOnboardingErrors, PatchUserOnboardingRequest, PatchUserOnboardingResponse, PatchUserOnboardingResponses, PatchUserTutorialData, PatchUserTutorialError, PatchUserTutorialErrors, PatchUserTutorialRequest, PatchUserTutorialResponse, PatchUserTutorialResponses, Permission, PlanCatalogEntry, PlanCatalogResponse, PlanTier, PollCodexLoginData, PollCodexLoginResponse, PollCodexLoginResponses, PostGetNamesRequestBody, PostProfilePicturesData, PostProfilePicturesError, PostProfilePicturesErrors, PostProfilePicturesResponse, PostProfilePicturesResponses, ProfilePictureQueryParams, ProfilePictures, PublicGtmInviteLink, PutCursorApiKeyData, PutCursorApiKeyError, PutCursorApiKeyErrors, PutCursorApiKeyRequest, PutCursorApiKeyResponse, PutCursorApiKeyResponses, PutCursorDefaultModelData, PutCursorDefaultModelError, PutCursorDefaultModelErrors, PutCursorDefaultModelRequest, PutCursorDefaultModelResponse, PutCursorDefaultModelResponses, PutProfilePictureData, PutProfilePictureError, PutProfilePictureErrors, PutProfilePictureResponse, PutProfilePictureResponses, PutUserNameData, PutUserNameError, PutUserNameErrors, PutUserNameQueryParams, PutUserNameResponse, PutUserNameResponses, RedeemGtmInviteLinkData, RedeemGtmInviteLinkError, RedeemGtmInviteLinkErrors, RedeemGtmInviteLinkRequest, RedeemGtmInviteLinkResponse, RedeemGtmInviteLinkResponses, RefreshData, RefreshError, RefreshErrors, RefreshResponse, RefreshResponses, RejectInvitationData, RejectInvitationError, RejectInvitationErrors, RejectInvitationResponses, RemoveUserFromTeamData, RemoveUserFromTeamError, RemoveUserFromTeamErrors, RemoveUserFromTeamResponses, ResendFusionauthVerifyUserEmailData, ResendFusionauthVerifyUserEmailError, ResendFusionauthVerifyUserEmailErrors, ResendFusionauthVerifyUserEmailRequest, ResendFusionauthVerifyUserEmailResponse, ResendFusionauthVerifyUserEmailResponses, ResolveGtmInviteLinkData, ResolveGtmInviteLinkError, ResolveGtmInviteLinkErrors, ResolveGtmInviteLinkResponse, ResolveGtmInviteLinkResponses, RevokeGtmInviteLinkData, RevokeGtmInviteLinkError, RevokeGtmInviteLinkErrors, RevokeGtmInviteLinkResponse, RevokeGtmInviteLinkResponses, SeatPlan, SendInviteBody, SendMobileWelcomeEmailData, SendMobileWelcomeEmailError, SendMobileWelcomeEmailErrors, SendMobileWelcomeEmailRequest, SendMobileWelcomeEmailResponse, SendMobileWelcomeEmailResponse2, SendMobileWelcomeEmailResponses, SendReferralCodeData, SendReferralCodeError, SendReferralCodeErrors, SendReferralCodeResponse, SendReferralCodeResponses, SessionCreationData, SessionCreationError, SessionCreationErrors, SessionCreationResponse, SessionCreationResponses, SessionLoginData, SessionLoginError, SessionLoginErrors, SessionLoginResponse, SessionLoginResponses, SsoLoginData, SsoLoginError, SsoLoginErrors, SsoLoginResponses, SsoRequiredResponse, StartCodexLoginData, StartCodexLoginResponse, StartCodexLoginResponses, StripeSessionResponse, Team, TeamInviteDetails, TeamInvitesResponse, TeamMember, TeamPlan, TeamRole, TeamWithMembers, ToggleAutoJoinDomainResponse, ToggleNonAdminInvitesResponse, ToggleTeamAutoJoinDomainData, ToggleTeamAutoJoinDomainError, ToggleTeamAutoJoinDomainErrors, ToggleTeamAutoJoinDomainResponse, ToggleTeamAutoJoinDomainResponses, ToggleTeamNonAdminInvitesData, ToggleTeamNonAdminInvitesError, ToggleTeamNonAdminInvitesErrors, ToggleTeamNonAdminInvitesResponse, ToggleTeamNonAdminInvitesResponses, UpdateAiBillingAutoReloadData, UpdateAiBillingAutoReloadError, UpdateAiBillingAutoReloadErrors, UpdateAiBillingAutoReloadResponse, UpdateAiBillingAutoReloadResponses, UpdateAiBillingOverageData, UpdateAiBillingOverageError, UpdateAiBillingOverageErrors, UpdateAiBillingOverageResponse, UpdateAiBillingOverageResponses, UpdateAutoReloadRequest, UpdateOverageRequest, UsageSnapshot, UserLinkResponse, UserName, UserNames, UserOrganizationResponse, UserProfilePicture, UserQuota, UserTokensResponse, VerifyEmailLinkData, VerifyEmailLinkError, VerifyEmailLinkErrors, VerifyEmailLinkResponse, VerifyEmailLinkResponses, VerifyFusionauthUserEmailData, VerifyFusionauthUserEmailError, VerifyFusionauthUserEmailErrors, VerifyFusionauthUserEmailResponse, VerifyFusionauthUserEmailResponses, VerifyMergeRequestData, VerifyMergeRequestError, VerifyMergeRequestErrors, VerifyMergeRequestResponse, VerifyMergeRequestResponses } from './types.gen';
diff --git a/packages/sdk/generated/auth/sdk.gen.ts b/packages/sdk/generated/auth/sdk.gen.ts
index 70d930e68b..2dd9181b48 100644
--- a/packages/sdk/generated/auth/sdk.gen.ts
+++ b/packages/sdk/generated/auth/sdk.gen.ts
@@ -2,7 +2,7 @@
import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
import { client } from './client.gen';
-import type { AppleLoginData, AppleLoginErrors, AppleLoginResponses, CancelCodexLoginData, CancelCodexLoginResponses, ChangePlanData, ChangePlanErrors, ChangePlanResponses, CheckGithubLinkStatusData, CheckGithubLinkStatusErrors, CheckGithubLinkStatusResponses, CheckGmailLinkStatusData, CheckGmailLinkStatusErrors, CheckGmailLinkStatusResponses, ConfigureCodexData, ConfigureCodexResponses, CreateAiCreditCheckoutData, CreateAiCreditCheckoutErrors, CreateAiCreditCheckoutResponses, CreateCheckoutSessionV2Data, CreateCheckoutSessionV2Errors, CreateCheckoutSessionV2Responses, CreateGtmInviteLinkData, CreateGtmInviteLinkErrors, CreateGtmInviteLinkResponses, CreateInProgressLinkData, CreateInProgressLinkErrors, CreateInProgressLinkResponses, CreateMergeRequestData, CreateMergeRequestErrors, CreateMergeRequestResponses, CreatePortalSessionData, CreatePortalSessionErrors, CreatePortalSessionResponses, CreateTeamData, CreateTeamErrors, CreateTeamResponses, CreateUserData, CreateUserErrors, CreateUserResponses, DeleteCursorApiKeyData, DeleteCursorApiKeyErrors, DeleteCursorApiKeyResponses, DeleteGithubLinkData, DeleteGithubLinkErrors, DeleteGithubLinkResponses, DeleteTeamData, DeleteTeamErrors, DeleteTeamInviteHandlerData, DeleteTeamInviteHandlerErrors, DeleteTeamInviteHandlerResponses, DeleteTeamResponses, DeleteUserData, DeleteUserErrors, DeleteUserResponses, DisconnectCodexData, DisconnectCodexResponses, EnrichGithubPullRequestsData, EnrichGithubPullRequestsErrors, EnrichGithubPullRequestsResponses, GenerateEmailLinkData, GenerateEmailLinkErrors, GenerateEmailLinkResponses, GetAiBillingPlansData, GetAiBillingPlansResponses, GetAiBillingSummaryData, GetAiBillingSummaryErrors, GetAiBillingSummaryResponses, GetCodexConnectionData, GetCodexConnectionResponses, GetCursorApiKeyData, GetCursorApiKeyErrors, GetCursorApiKeyResponses, GetGtmInviteOfferData, GetGtmInviteOfferErrors, GetGtmInviteOfferResponses, GetLegacyUserPermissionsData, GetLegacyUserPermissionsErrors, GetLegacyUserPermissionsResponses, GetPermissionsData, GetPermissionsErrors, GetPermissionsResponses, GetReferralCodeData, GetReferralCodeErrors, GetReferralCodeResponses, GetTeamData, GetTeamErrors, GetTeamInvitesData, GetTeamInvitesErrors, GetTeamInvitesResponses, GetTeamResponses, GetUserInfoData, GetUserInfoErrors, GetUserInfoResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserLinkExistsData, GetUserLinkExistsErrors, GetUserLinkExistsResponses, GetUserNameData, GetUserNameErrors, GetUserNameResponses, GetUserNamesData, GetUserNamesErrors, GetUserNamesResponses, GetUserNamesWithEmailData, GetUserNamesWithEmailErrors, GetUserNamesWithEmailResponses, GetUserOrganizationData, GetUserOrganizationErrors, GetUserOrganizationResponses, GetUserPermissionsData, GetUserPermissionsErrors, GetUserPermissionsResponses, GetUserQuotaData, GetUserQuotaErrors, GetUserQuotaResponses, GetUserTeamsData, GetUserTeamsErrors, GetUserTeamsResponses, HealthHandlerData, HealthHandlerResponses, InitGithubLinkData, InitGithubLinkErrors, InitGithubLinkResponses, InitGmailLinkData, InitGmailLinkErrors, InitGmailLinkResponses, InitOutlookLinkData, InitOutlookLinkErrors, InitOutlookLinkResponses, InviteToTeamData, InviteToTeamErrors, InviteToTeamResponses, JoinTeamData, JoinTeamErrors, JoinTeamResponses, ListCodexEnvironmentsData, ListCodexEnvironmentsResponses, ListCursorModelsData, ListCursorModelsErrors, ListCursorModelsResponses, ListGtmInviteLinksData, ListGtmInviteLinksErrors, ListGtmInviteLinksResponses, LogoutData, LogoutResponses, MacroApiTokenData, MacroApiTokenErrors, MacroApiTokenResponses, MergeGithubPullRequestData, MergeGithubPullRequestErrors, MergeGithubPullRequestResponses, Oauth2CallbackData, Oauth2CallbackErrors, Oauth2CallbackResponses, OauthRedirectData, OauthRedirectErrors, OauthRedirectResponses, PasswordlessCallbackData, PasswordlessCallbackErrors, PasswordlessCallbackResponses, PasswordlessLoginData, PasswordlessLoginErrors, PasswordlessLoginResponses, PasswordLoginData, PasswordLoginErrors, PasswordLoginResponses, PatchTeamCrmSettingsData, PatchTeamCrmSettingsErrors, PatchTeamCrmSettingsResponses, PatchTeamData, PatchTeamErrors, PatchTeamMemberPlanData, PatchTeamMemberPlanErrors, PatchTeamMemberPlanResponses, PatchTeamResponses, PatchUserGroupData, PatchUserGroupErrors, PatchUserGroupResponses, PatchUserOnboardingData, PatchUserOnboardingErrors, PatchUserOnboardingResponses, PatchUserTutorialData, PatchUserTutorialErrors, PatchUserTutorialResponses, PollCodexLoginData, PollCodexLoginResponses, PostProfilePicturesData, PostProfilePicturesErrors, PostProfilePicturesResponses, PutCursorApiKeyData, PutCursorApiKeyErrors, PutCursorApiKeyResponses, PutCursorDefaultModelData, PutCursorDefaultModelErrors, PutCursorDefaultModelResponses, PutProfilePictureData, PutProfilePictureErrors, PutProfilePictureResponses, PutUserNameData, PutUserNameErrors, PutUserNameResponses, RedeemGtmInviteLinkData, RedeemGtmInviteLinkErrors, RedeemGtmInviteLinkResponses, RefreshData, RefreshErrors, RefreshResponses, RejectInvitationData, RejectInvitationErrors, RejectInvitationResponses, RemoveUserFromTeamData, RemoveUserFromTeamErrors, RemoveUserFromTeamResponses, ResendFusionauthVerifyUserEmailData, ResendFusionauthVerifyUserEmailErrors, ResendFusionauthVerifyUserEmailResponses, ResolveGtmInviteLinkData, ResolveGtmInviteLinkErrors, ResolveGtmInviteLinkResponses, RevokeGtmInviteLinkData, RevokeGtmInviteLinkErrors, RevokeGtmInviteLinkResponses, SendMobileWelcomeEmailData, SendMobileWelcomeEmailErrors, SendMobileWelcomeEmailResponses, SendReferralCodeData, SendReferralCodeErrors, SendReferralCodeResponses, SessionCreationData, SessionCreationErrors, SessionCreationResponses, SessionLoginData, SessionLoginErrors, SessionLoginResponses, SsoLoginData, SsoLoginErrors, SsoLoginResponses, StartCodexLoginData, StartCodexLoginResponses, ToggleTeamAutoJoinDomainData, ToggleTeamAutoJoinDomainErrors, ToggleTeamAutoJoinDomainResponses, ToggleTeamNonAdminInvitesData, ToggleTeamNonAdminInvitesErrors, ToggleTeamNonAdminInvitesResponses, UpdateAiBillingOverageData, UpdateAiBillingOverageErrors, UpdateAiBillingOverageResponses, VerifyEmailLinkData, VerifyEmailLinkErrors, VerifyEmailLinkResponses, VerifyFusionauthUserEmailData, VerifyFusionauthUserEmailErrors, VerifyFusionauthUserEmailResponses, VerifyMergeRequestData, VerifyMergeRequestErrors, VerifyMergeRequestResponses } from './types.gen';
+import type { AppleLoginData, AppleLoginErrors, AppleLoginResponses, CancelCodexLoginData, CancelCodexLoginResponses, ChangePlanData, ChangePlanErrors, ChangePlanResponses, CheckGithubLinkStatusData, CheckGithubLinkStatusErrors, CheckGithubLinkStatusResponses, CheckGmailLinkStatusData, CheckGmailLinkStatusErrors, CheckGmailLinkStatusResponses, ConfigureCodexData, ConfigureCodexResponses, CreateAiCreditCheckoutData, CreateAiCreditCheckoutErrors, CreateAiCreditCheckoutResponses, CreateCheckoutSessionV2Data, CreateCheckoutSessionV2Errors, CreateCheckoutSessionV2Responses, CreateGtmInviteLinkData, CreateGtmInviteLinkErrors, CreateGtmInviteLinkResponses, CreateInProgressLinkData, CreateInProgressLinkErrors, CreateInProgressLinkResponses, CreateMergeRequestData, CreateMergeRequestErrors, CreateMergeRequestResponses, CreatePortalSessionData, CreatePortalSessionErrors, CreatePortalSessionResponses, CreateTeamData, CreateTeamErrors, CreateTeamResponses, CreateUserData, CreateUserErrors, CreateUserResponses, DeleteCursorApiKeyData, DeleteCursorApiKeyErrors, DeleteCursorApiKeyResponses, DeleteGithubLinkData, DeleteGithubLinkErrors, DeleteGithubLinkResponses, DeleteTeamData, DeleteTeamErrors, DeleteTeamInviteHandlerData, DeleteTeamInviteHandlerErrors, DeleteTeamInviteHandlerResponses, DeleteTeamResponses, DeleteUserData, DeleteUserErrors, DeleteUserResponses, DisconnectCodexData, DisconnectCodexResponses, EnrichGithubPullRequestsData, EnrichGithubPullRequestsErrors, EnrichGithubPullRequestsResponses, GenerateEmailLinkData, GenerateEmailLinkErrors, GenerateEmailLinkResponses, GetAiBillingPlansData, GetAiBillingPlansResponses, GetAiBillingSummaryData, GetAiBillingSummaryErrors, GetAiBillingSummaryResponses, GetCodexConnectionData, GetCodexConnectionResponses, GetCursorApiKeyData, GetCursorApiKeyErrors, GetCursorApiKeyResponses, GetGtmInviteOfferData, GetGtmInviteOfferErrors, GetGtmInviteOfferResponses, GetLegacyUserPermissionsData, GetLegacyUserPermissionsErrors, GetLegacyUserPermissionsResponses, GetPermissionsData, GetPermissionsErrors, GetPermissionsResponses, GetReferralCodeData, GetReferralCodeErrors, GetReferralCodeResponses, GetTeamData, GetTeamErrors, GetTeamInvitesData, GetTeamInvitesErrors, GetTeamInvitesResponses, GetTeamResponses, GetUserInfoData, GetUserInfoErrors, GetUserInfoResponses, GetUserInvitesData, GetUserInvitesErrors, GetUserInvitesResponses, GetUserLinkExistsData, GetUserLinkExistsErrors, GetUserLinkExistsResponses, GetUserNameData, GetUserNameErrors, GetUserNameResponses, GetUserNamesData, GetUserNamesErrors, GetUserNamesResponses, GetUserNamesWithEmailData, GetUserNamesWithEmailErrors, GetUserNamesWithEmailResponses, GetUserOrganizationData, GetUserOrganizationErrors, GetUserOrganizationResponses, GetUserPermissionsData, GetUserPermissionsErrors, GetUserPermissionsResponses, GetUserQuotaData, GetUserQuotaErrors, GetUserQuotaResponses, GetUserTeamsData, GetUserTeamsErrors, GetUserTeamsResponses, HealthHandlerData, HealthHandlerResponses, InitGithubLinkData, InitGithubLinkErrors, InitGithubLinkResponses, InitGmailLinkData, InitGmailLinkErrors, InitGmailLinkResponses, InitOutlookLinkData, InitOutlookLinkErrors, InitOutlookLinkResponses, InviteToTeamData, InviteToTeamErrors, InviteToTeamResponses, JoinTeamData, JoinTeamErrors, JoinTeamResponses, ListCodexEnvironmentsData, ListCodexEnvironmentsResponses, ListCursorModelsData, ListCursorModelsErrors, ListCursorModelsResponses, ListGtmInviteLinksData, ListGtmInviteLinksErrors, ListGtmInviteLinksResponses, LogoutData, LogoutResponses, MacroApiTokenData, MacroApiTokenErrors, MacroApiTokenResponses, MergeGithubPullRequestData, MergeGithubPullRequestErrors, MergeGithubPullRequestResponses, Oauth2CallbackData, Oauth2CallbackErrors, Oauth2CallbackResponses, OauthRedirectData, OauthRedirectErrors, OauthRedirectResponses, PasswordlessCallbackData, PasswordlessCallbackErrors, PasswordlessCallbackResponses, PasswordlessLoginData, PasswordlessLoginErrors, PasswordlessLoginResponses, PasswordLoginData, PasswordLoginErrors, PasswordLoginResponses, PatchTeamCrmSettingsData, PatchTeamCrmSettingsErrors, PatchTeamCrmSettingsResponses, PatchTeamData, PatchTeamErrors, PatchTeamMemberPlanData, PatchTeamMemberPlanErrors, PatchTeamMemberPlanResponses, PatchTeamResponses, PatchUserGroupData, PatchUserGroupErrors, PatchUserGroupResponses, PatchUserOnboardingData, PatchUserOnboardingErrors, PatchUserOnboardingResponses, PatchUserTutorialData, PatchUserTutorialErrors, PatchUserTutorialResponses, PollCodexLoginData, PollCodexLoginResponses, PostProfilePicturesData, PostProfilePicturesErrors, PostProfilePicturesResponses, PutCursorApiKeyData, PutCursorApiKeyErrors, PutCursorApiKeyResponses, PutCursorDefaultModelData, PutCursorDefaultModelErrors, PutCursorDefaultModelResponses, PutProfilePictureData, PutProfilePictureErrors, PutProfilePictureResponses, PutUserNameData, PutUserNameErrors, PutUserNameResponses, RedeemGtmInviteLinkData, RedeemGtmInviteLinkErrors, RedeemGtmInviteLinkResponses, RefreshData, RefreshErrors, RefreshResponses, RejectInvitationData, RejectInvitationErrors, RejectInvitationResponses, RemoveUserFromTeamData, RemoveUserFromTeamErrors, RemoveUserFromTeamResponses, ResendFusionauthVerifyUserEmailData, ResendFusionauthVerifyUserEmailErrors, ResendFusionauthVerifyUserEmailResponses, ResolveGtmInviteLinkData, ResolveGtmInviteLinkErrors, ResolveGtmInviteLinkResponses, RevokeGtmInviteLinkData, RevokeGtmInviteLinkErrors, RevokeGtmInviteLinkResponses, SendMobileWelcomeEmailData, SendMobileWelcomeEmailErrors, SendMobileWelcomeEmailResponses, SendReferralCodeData, SendReferralCodeErrors, SendReferralCodeResponses, SessionCreationData, SessionCreationErrors, SessionCreationResponses, SessionLoginData, SessionLoginErrors, SessionLoginResponses, SsoLoginData, SsoLoginErrors, SsoLoginResponses, StartCodexLoginData, StartCodexLoginResponses, ToggleTeamAutoJoinDomainData, ToggleTeamAutoJoinDomainErrors, ToggleTeamAutoJoinDomainResponses, ToggleTeamNonAdminInvitesData, ToggleTeamNonAdminInvitesErrors, ToggleTeamNonAdminInvitesResponses, UpdateAiBillingAutoReloadData, UpdateAiBillingAutoReloadErrors, UpdateAiBillingAutoReloadResponses, UpdateAiBillingOverageData, UpdateAiBillingOverageErrors, UpdateAiBillingOverageResponses, VerifyEmailLinkData, VerifyEmailLinkErrors, VerifyEmailLinkResponses, VerifyFusionauthUserEmailData, VerifyFusionauthUserEmailErrors, VerifyFusionauthUserEmailResponses, VerifyMergeRequestData, VerifyMergeRequestErrors, VerifyMergeRequestResponses } from './types.gen';
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
/**
@@ -57,6 +57,22 @@ export class Sdk extends HeyApiClient {
Sdk.__registry.set(this, args?.key);
}
+ /**
+ * Turn automatic credit reloads (and with them overage) on with the given
+ * thresholds, or off. Payer only. Enabling settles right away, so a balance
+ * already under the minimum reloads immediately.
+ */
+ public updateAiBillingAutoReload<ThrowOnError extends boolean = false>(options: Options<UpdateAiBillingAutoReloadData, ThrowOnError>): RequestResult<UpdateAiBillingAutoReloadResponses, UpdateAiBillingAutoReloadErrors, ThrowOnError> {
+ return (options.client ?? this.client).patch<UpdateAiBillingAutoReloadResponses, UpdateAiBillingAutoReloadErrors, ThrowOnError>({
+ url: '/ai-billing/auto-reload',
+ ...options,
+ headers: {
+ 'Content-Type': 'application/json',
+ ...options.headers
+ }
+ });
+ }
+
/**
* Start a Stripe Checkout for a credit pack. Payer only.
*/
@@ -86,7 +102,8 @@ export class Sdk extends HeyApiClient {
}
/**
- * The plan catalog, credit packs, and overage cap bounds.
+ * The plan catalog, credit packs, overage cap bounds, and automatic reload
+ * defaults and bounds.
*/
public getAiBillingPlans<ThrowOnError extends boolean = false>(options?: Options<GetAiBillingPlansData, ThrowOnError>): RequestResult<GetAiBillingPlansResponses, unknown, ThrowOnError> {
return (options?.client ?? this.client).get<GetAiBillingPlansResponses, unknown, ThrowOnError>({ url: '/ai-billing/plans', ...options });
diff --git a/packages/sdk/generated/auth/types.gen.ts b/packages/sdk/generated/auth/types.gen.ts
index 9511e21c84..ec7a869060 100644
--- a/packages/sdk/generated/auth/types.gen.ts
+++ b/packages/sdk/generated/auth/types.gen.ts
@@ -21,6 +21,47 @@ export type AppleLoginRequest = {
id_token: string;
};
+/**
+ * The automatic reload thresholds a payer starts from.
+ */
+export type AutoReloadDefaults = {
+ /**
+ * Balance below which a reload fires, cents.
+ */
+ minimum_balance_cents: number;
+ /**
+ * Balance a reload tops up to, cents.
+ */
+ target_balance_cents: number;
+};
+
+/**
+ * The payer's automatic reload settings, as shown in Billing settings.
+ */
+export type AutoReloadSnapshot = {
+ /**
+ * Whether reloads will fire: overage is on and reloads are not suspended.
+ */
+ active: boolean;
+ /**
+ * Reload once the effective balance drops below this, in customer cents.
+ */
+ minimum_balance_cents: number;
+ /**
+ * Most reloaded per UTC calendar month, in customer cents. `null` when
+ * there is no limit.
+ */
+ monthly_spend_limit_cents?: number | null;
+ /**
+ * Whether reloads are paused after a failed reload charge.
+ */
+ suspended: boolean;
+ /**
+ * Reload the balance back up to this, in customer cents.
+ */
+ target_balance_cents: number;
+};
+
/**
* Request body for switching plans
*/
@@ -1218,6 +1259,14 @@ export type PlanCatalogEntry = {
* The plan catalog and the knobs the billing UI offers.
*/
export type PlanCatalogResponse = {
+ /**
+ * Thresholds automatic reload starts from before the payer sets their own.
+ */
+ auto_reload_defaults: AutoReloadDefaults;
+ /**
+ * Largest allowed automatic reload target, cents.
+ */
+ auto_reload_target_max_cents: number;
/**
* Credit packs a payer may buy, cents.
*/
@@ -1514,6 +1563,33 @@ export type ToggleNonAdminInvitesResponse = {
allow_non_admin_invites: boolean;
};
+/**
+ * Request body for [`update_auto_reload_handler`].
+ */
+export type UpdateAutoReloadRequest = {
+ /**
+ * Reload credits automatically, billing usage past allowance and
+ * credits to the payer's card. Turning this off also turns off overage.
+ */
+ enabled: boolean;
+ /**
+ * Reload once the balance drops below this, cents. Must be positive.
+ */
+ minimumBalanceCents: number;
+ /**
+ * Most to reload per calendar month, cents. Omit or `null` for no limit.
+ * Also serves as the per-period overage cap, so it must be at least the
+ * catalog's `overage_limit_min_cents`; larger values are capped at
+ * `overage_limit_max_cents`.
+ */
+ monthlySpendLimitCents?: number | null;
+ /**
+ * Reload the balance back up to this, cents. At least $0.50 above the
+ * minimum and no more than the catalog's `auto_reload_target_max_cents`.
+ */
+ targetBalanceCents: number;
+};
+
/**
* Request body for [`update_overage_handler`].
*/
@@ -1533,6 +1609,11 @@ export type UpdateOverageRequest = {
* by the gate.
*/
export type UsageSnapshot = {
+ /**
+ * Automatic credit reload settings. `active` means overage is on and
+ * reloads are not suspended.
+ */
+ auto_reload: AutoReloadSnapshot;
blocked_reason?: null | DenyReason;
/**
* Whether the requesting user is the payer.
@@ -1675,6 +1756,47 @@ export type UserTokensResponse = {
refresh_token: string;
};
+export type UpdateAiBillingAutoReloadData = {
+ body: UpdateAutoReloadRequest;
+ path?: never;
+ query?: never;
+ url: '/ai-billing/auto-reload';
+};
+
+export type UpdateAiBillingAutoReloadErrors = {
+ /**
+ * Invalid thresholds
+ */
+ 400: AiBillingErrorBody;
+ /**
+ * Unauthorized
+ */
+ 401: unknown;
+ /**
+ * A paid plan is required
+ */
+ 402: AiBillingErrorBody;
+ /**
+ * Only the payer may change billing
+ */
+ 403: AiBillingErrorBody;
+ /**
+ * Internal server error
+ */
+ 500: AiBillingErrorBody;
+};
+
+export type UpdateAiBillingAutoReloadError = UpdateAiBillingAutoReloadErrors[keyof UpdateAiBillingAutoReloadErrors];
+
+export type UpdateAiBillingAutoReloadResponses = {
+ /**
+ * Updated position
+ */
+ 200: UsageSnapshot;
+};
+
+export type UpdateAiBillingAutoReloadResponse = UpdateAiBillingAutoReloadResponses[keyof UpdateAiBillingAutoReloadResponses];
+
export type CreateAiCreditCheckoutData = {
body: CreditCheckoutRequestBody;
path?: never;
diff --git a/packages/sdk/specs/auth.json b/packages/sdk/specs/auth.json
index ef26cc383d..e2e9aa3341 100644
--- a/packages/sdk/specs/auth.json
+++ b/packages/sdk/specs/auth.json
@@ -10,6 +10,78 @@
"version": "0.1.0"
},
"paths": {
+ "/ai-billing/auto-reload": {
+ "patch": {
+ "tags": ["ai_billing"],
+ "summary": "Turn automatic credit reloads (and with them overage) on with the given\nthresholds, or off. Payer only. Enabling settles right away, so a balance\nalready under the minimum reloads immediately.",
+ "operationId": "update_ai_billing_auto_reload",
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateAutoReloadRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "description": "Updated position",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UsageSnapshot"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid thresholds",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "402": {
+ "description": "A paid plan is required",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Only the payer may change billing",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/AiBillingErrorBody"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/ai-billing/credits/checkout": {
"post": {
"tags": ["ai_billing"],
@@ -157,7 +229,7 @@
"/ai-billing/plans": {
"get": {
"tags": ["ai_billing"],
- "summary": "The plan catalog, credit packs, and overage cap bounds.",
+ "summary": "The plan catalog, credit packs, overage cap bounds, and automatic reload\ndefaults and bounds.",
"operationId": "get_ai_billing_plans",
"responses": {
"200": {
@@ -4844,6 +4916,58 @@
}
}
},
+ "AutoReloadDefaults": {
+ "type": "object",
+ "description": "The automatic reload thresholds a payer starts from.",
+ "required": ["minimum_balance_cents", "target_balance_cents"],
+ "properties": {
+ "minimum_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Balance below which a reload fires, cents."
+ },
+ "target_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Balance a reload tops up to, cents."
+ }
+ }
+ },
+ "AutoReloadSnapshot": {
+ "type": "object",
+ "description": "The payer's automatic reload settings, as shown in Billing settings.",
+ "required": [
+ "minimum_balance_cents",
+ "target_balance_cents",
+ "suspended",
+ "active"
+ ],
+ "properties": {
+ "active": {
+ "type": "boolean",
+ "description": "Whether reloads will fire: overage is on and reloads are not suspended."
+ },
+ "minimum_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload once the effective balance drops below this, in customer cents."
+ },
+ "monthly_spend_limit_cents": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "Most reloaded per UTC calendar month, in customer cents. `null` when\nthere is no limit."
+ },
+ "suspended": {
+ "type": "boolean",
+ "description": "Whether reloads are paused after a failed reload charge."
+ },
+ "target_balance_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload the balance back up to this, in customer cents."
+ }
+ }
+ },
"ChangePlanRequest": {
"type": "object",
"description": "Request body for switching plans",
@@ -6360,9 +6484,20 @@
"plans",
"credit_packs_cents",
"overage_limit_min_cents",
- "overage_limit_max_cents"
+ "overage_limit_max_cents",
+ "auto_reload_target_max_cents",
+ "auto_reload_defaults"
],
"properties": {
+ "auto_reload_defaults": {
+ "$ref": "#/components/schemas/AutoReloadDefaults",
+ "description": "Thresholds automatic reload starts from before the payer sets their own."
+ },
+ "auto_reload_target_max_cents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Largest allowed automatic reload target, cents."
+ },
"credit_packs_cents": {
"type": "array",
"items": {
@@ -6750,6 +6885,32 @@
}
}
},
+ "UpdateAutoReloadRequest": {
+ "type": "object",
+ "description": "Request body for [`update_auto_reload_handler`].",
+ "required": ["enabled", "minimumBalanceCents", "targetBalanceCents"],
+ "properties": {
+ "enabled": {
+ "type": "boolean",
+ "description": "Reload credits automatically, billing usage past allowance and\ncredits to the payer's card. Turning this off also turns off overage."
+ },
+ "minimumBalanceCents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload once the balance drops below this, cents. Must be positive."
+ },
+ "monthlySpendLimitCents": {
+ "type": ["integer", "null"],
+ "format": "int64",
+ "description": "Most to reload per calendar month, cents. Omit or `null` for no limit.\nAlso serves as the per-period overage cap, so it must be at least the\ncatalog's `overage_limit_min_cents`; larger values are capped at\n`overage_limit_max_cents`."
+ },
+ "targetBalanceCents": {
+ "type": "integer",
+ "format": "int64",
+ "description": "Reload the balance back up to this, cents. At least $0.50 above the\nminimum and no more than the catalog's `auto_reload_target_max_cents`."
+ }
+ }
+ },
"UpdateOverageRequest": {
"type": "object",
"description": "Request body for [`update_overage_handler`].",
@@ -6785,10 +6946,15 @@
"overage_limit_cents",
"overage_charged_cents",
"overage_suspended",
+ "auto_reload",
"uncovered_cents",
"remaining_cents"
],
"properties": {
+ "auto_reload": {
+ "$ref": "#/components/schemas/AutoReloadSnapshot",
+ "description": "Automatic credit reload settings. `active` means overage is on and\nreloads are not suspended."
+ },
"blocked_reason": {
"oneOf": [
{
diff --git a/packages/sdk/src/coverage/skipped.ts b/packages/sdk/src/coverage/skipped.ts
index dbe7976916..ba943f3761 100644
--- a/packages/sdk/src/coverage/skipped.ts
+++ b/packages/sdk/src/coverage/skipped.ts
@@ -125,6 +125,7 @@ export const authExcluded = [
'startCodexLogin',
'toggleTeamAutoJoinDomain',
'toggleTeamNonAdminInvites',
+ 'updateAiBillingAutoReload',
'updateAiBillingOverage',
'verifyEmailLink',
'verifyFusionauthUserEmail',
diff --git a/services/authentication_service/src/api/swagger.rs b/services/authentication_service/src/api/swagger.rs
index 0b7d761c04..ffc215a018 100644
--- a/services/authentication_service/src/api/swagger.rs
+++ b/services/authentication_service/src/api/swagger.rs
@@ -148,6 +148,7 @@ use model::user::{
ai_billing::inbound::axum_router::get_summary_handler::<crate::api::context::AiBillingServiceType, crate::api::context::AuthorizationService>,
ai_billing::inbound::axum_router::get_plans_handler,
ai_billing::inbound::axum_router::update_overage_handler::<crate::api::context::AiBillingServiceType, crate::api::context::AuthorizationService>,
+ ai_billing::inbound::axum_router::update_auto_reload_handler::<crate::api::context::AiBillingServiceType, crate::api::context::AuthorizationService>,
ai_billing::inbound::axum_router::create_credit_checkout_handler::<crate::api::context::AiBillingServiceType, crate::api::context::AuthorizationService>,
/// /session
@@ -251,6 +252,9 @@ use model::user::{
ai_billing::inbound::axum_router::PlanCatalogEntry,
ai_billing::inbound::axum_router::PlanCatalogResponse,
ai_billing::inbound::axum_router::UpdateOverageRequest,
+ ai_billing::inbound::axum_router::UpdateAutoReloadRequest,
+ ai_billing::inbound::axum_router::AutoReloadDefaults,
+ ai_billing::AutoReloadSnapshot,
ai_billing::inbound::axum_router::CreditCheckoutRequestBody,
ai_billing::inbound::axum_router::CreditCheckoutResponse,
diff --git a/services/authentication_service/src/api/webhooks/user/stripe_webhook.rs b/services/authentication_service/src/api/webhooks/user/stripe_webhook.rs
index aa2ab9a3f1..9dc807edaf 100644
--- a/services/authentication_service/src/api/webhooks/user/stripe_webhook.rs
+++ b/services/authentication_service/src/api/webhooks/user/stripe_webhook.rs
@@ -5,7 +5,9 @@ use crate::api::context::ApiContext;
use crate::api::user::stripe::PaidPlan;
use ai_billing::BillingService;
-use ai_billing::outbound::stripe_gateway::{PURPOSE_AI_OVERAGE, PURPOSE_METADATA_KEY};
+use ai_billing::outbound::stripe_gateway::{
+ PURPOSE_AI_CREDIT_RELOAD, PURPOSE_AI_OVERAGE, PURPOSE_METADATA_KEY,
+};
use analytics_client::{AnalyticsClient, MetaActionSource, MetaUserData};
use anyhow::Context;
use axum::{
@@ -228,25 +230,45 @@ async fn handle_payment_event(
.as_ref()
.map(|subscription| subscription.id().as_str())
else {
- // Our own one-off invoices: AI overage chunks. Their outcome drives
- // whether the payer keeps overage; they never touch plan roles.
- let is_overage_invoice = invoice
+ // Our own one-off invoices: AI overage chunks and automatic credit
+ // reloads. Their outcome drives whether the payer keeps overage or
+ // automatic reloads; they never touch plan roles.
+ let macro_purpose = invoice
.metadata
.as_ref()
.and_then(|m| m.get(PURPOSE_METADATA_KEY))
- .is_some_and(|purpose| purpose == PURPOSE_AI_OVERAGE);
- if is_overage_invoice && let Some(invoice_id) = invoice.id.as_ref() {
- tracing::info!(
- event_type = ?event_type,
- invoice_id = %invoice_id,
- paid = !outcome.is_revoke(),
- "processing ai overage invoice event"
- );
- ctx.ai_billing_service
- .mark_overage_invoice(invoice_id.as_str(), !outcome.is_revoke())
- .await
- .context("failed to record ai overage invoice outcome")?;
- return Ok(());
+ .map(String::as_str);
+ let paid = !outcome.is_revoke();
+ if let Some(invoice_id) = invoice.id.as_ref() {
+ match macro_purpose {
+ Some(PURPOSE_AI_OVERAGE) => {
+ tracing::info!(
+ event_type = ?event_type,
+ invoice_id = %invoice_id,
+ paid,
+ "processing ai overage invoice event"
+ );
+ ctx.ai_billing_service
+ .mark_overage_invoice(invoice_id.as_str(), paid)
+ .await
+ .context("failed to record ai overage invoice outcome")?;
+ return Ok(());
+ }
+ Some(PURPOSE_AI_CREDIT_RELOAD) => {
+ tracing::info!(
+ event_type = ?event_type,
+ invoice_id = %invoice_id,
+ paid,
+ "processing ai credit reload invoice event"
+ );
+ ctx.ai_billing_service
+ .mark_credit_reload_invoice(invoice_id.as_str(), paid)
+ .await
+ .context("failed to record ai credit reload invoice outcome")?;
+ return Ok(());
+ }
+ _ => {}
+ }
}
tracing::info!(
event_type = ?event_type,
diff --git a/tooling/just/rust.just b/tooling/just/rust.just
index 97f929f3f2..26108b0a2d 100644
--- a/tooling/just/rust.just
+++ b/tooling/just/rust.just
@@ -123,6 +123,7 @@ setup_test_envs:
echo "DATABASE_URL={{ DATABASE_URL }}" >> ./crates/share_permission_db_utils/.env
echo "DATABASE_URL={{ DATABASE_URL }}" >> ./crates/ai_projections/.env
echo "DATABASE_URL={{ DATABASE_URL }}" >> ./services/ai_projections_refresh_handler/.env
+ echo "DATABASE_URL={{ DATABASE_URL }}" >> ./crates/ai_billing/.env
echo "DATABASE_URL={{ DATABASE_URL }}" >> ./crates/webhook/.env
echo "DATABASE_URL={{ DATABASE_URL }}" >> ./crates/calendar_events/.env
echo "DATABASE_URL={{ DATABASE_URL }}" >> ./services/email_service/.env