Skip to main content

max / makenotwork

server: regenerate the sqlx query cache The offline build had been broken at HEAD: 19 queries in db/transactions/purchases.rs and revenue_stats.rs had no cached data, so cargo check --all-targets failed and the test suite could not be built. Cause was the prep database rather than the queries. mnw_sqlx_prep sat at migration 154 while the tree is at 169, so whoever last ran prepare could not have captured these. Migrated it to head and re-prepared: 20 stale entries drop, 18 land, all of them transactions queries. Offline check clean, 1887 lib tests and 1190 integration tests green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-22 00:59 UTC
Commit: de46409f6c59324d50765748ef1347468b207f50
Parent: 6d28b84
38 files changed, +2031 insertions, -2115 deletions
@@ -1,28 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n UPDATE transactions\n SET status = 'refunded'\n WHERE stripe_payment_intent_id = $1 AND status IN ('completed', 'refunding')\n RETURNING id AS \"id: super::TransactionId\", item_id AS \"item_id: ItemId\"\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: super::TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "item_id: ItemId",
14 - "type_info": "Uuid"
15 - }
16 - ],
17 - "parameters": {
18 - "Left": [
19 - "Text"
20 - ]
21 - },
22 - "nullable": [
23 - false,
24 - true
25 - ]
26 - },
27 - "hash": "0ed4c7b8dadd1fe7ae897775b6fa64b030834c4257ed59ee1fe58dea9e8192c1"
28 - }
@@ -1,149 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions WHERE seller_id = $1 ORDER BY created_at DESC LIMIT $2\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid",
120 - "Int8"
121 - ]
122 - },
123 - "nullable": [
124 - false,
125 - true,
126 - true,
127 - true,
128 - false,
129 - false,
130 - false,
131 - false,
132 - true,
133 - true,
134 - false,
135 - true,
136 - true,
137 - true,
138 - false,
139 - true,
140 - true,
141 - true,
142 - true,
143 - true,
144 - true,
145 - true
146 - ]
147 - },
148 - "hash": "0edcbc78d86e90f5845d72797f65ed8d1071327610ef8a51dd775b3f709bec66"
149 - }
@@ -0,0 +1,149 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions WHERE seller_id = $1 ORDER BY created_at DESC LIMIT $2\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Uuid",
120 + "Int8"
121 + ]
122 + },
123 + "nullable": [
124 + false,
125 + true,
126 + true,
127 + true,
128 + false,
129 + false,
130 + false,
131 + false,
132 + true,
133 + true,
134 + false,
135 + true,
136 + true,
137 + true,
138 + false,
139 + true,
140 + true,
141 + true,
142 + true,
143 + true,
144 + true,
145 + true
146 + ]
147 + },
148 + "hash": "0fd5031e6a0bd125edb16ca526b22688bf5774db87add91a1656ec871d50a764"
149 + }
@@ -1,150 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions WHERE buyer_id = $1\n ORDER BY created_at DESC, id DESC\n LIMIT $2 OFFSET $3\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid",
120 - "Int8",
121 - "Int8"
122 - ]
123 - },
124 - "nullable": [
125 - false,
126 - true,
127 - true,
128 - true,
129 - false,
130 - false,
131 - false,
132 - false,
133 - true,
134 - true,
135 - false,
136 - true,
137 - true,
138 - true,
139 - false,
140 - true,
141 - true,
142 - true,
143 - true,
144 - true,
145 - true,
146 - true
147 - ]
148 - },
149 - "hash": "17188cab9291709226c6f4586bccfbbd878a4c98b27bb844e8b48c56edd7981a"
150 - }
@@ -1,151 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n UPDATE transactions\n SET status = 'completed',\n stripe_payment_intent_id = $2,\n completed_at = NOW(),\n guest_email = $3,\n claim_token = $4,\n buyer_id = NULL\n WHERE stripe_checkout_session_id = $1\n AND status = 'pending'\n RETURNING\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Text",
120 - "Varchar",
121 - "Varchar",
122 - "Uuid"
123 - ]
124 - },
125 - "nullable": [
126 - false,
127 - true,
128 - true,
129 - true,
130 - false,
131 - false,
132 - false,
133 - false,
134 - true,
135 - true,
136 - false,
137 - true,
138 - true,
139 - true,
140 - false,
141 - true,
142 - true,
143 - true,
144 - true,
145 - true,
146 - true,
147 - true
148 - ]
149 - },
150 - "hash": "1e4b48db02316269e0452632c3f8e14247545c8b539fe03b8eed786f16655e61"
151 - }
@@ -1,148 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions WHERE id = $1\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid"
120 - ]
121 - },
122 - "nullable": [
123 - false,
124 - true,
125 - true,
126 - true,
127 - false,
128 - false,
129 - false,
130 - false,
131 - true,
132 - true,
133 - false,
134 - true,
135 - true,
136 - true,
137 - false,
138 - true,
139 - true,
140 - true,
141 - true,
142 - true,
143 - true,
144 - true
145 - ]
146 - },
147 - "hash": "2df9f7ba4fffec670698ab8b4b4c08d6aaf49e8688495e43117436cdb5413602"
148 - }
@@ -1,155 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n INSERT INTO transactions (buyer_id, seller_id, project_id, amount_cents, platform_fee_cents, stripe_checkout_session_id, item_title, seller_username, share_contact)\n VALUES ($1, $2, $3, $4, 0, $5, $6, $7, $8)\n RETURNING\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid",
120 - "Uuid",
121 - "Uuid",
122 - "Int4",
123 - "Varchar",
124 - "Varchar",
125 - "Varchar",
126 - "Bool"
127 - ]
128 - },
129 - "nullable": [
130 - false,
131 - true,
132 - true,
133 - true,
134 - false,
135 - false,
136 - false,
137 - false,
138 - true,
139 - true,
140 - false,
141 - true,
142 - true,
143 - true,
144 - false,
145 - true,
146 - true,
147 - true,
148 - true,
149 - true,
150 - true,
151 - true
152 - ]
153 - },
154 - "hash": "2f9493dff81cb0306fa06500539f3346294d3b0552ff46cc40d92ca1b2ab9525"
155 - }
@@ -0,0 +1,70 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n SELECT\n transaction_id AS \"transaction_id!: TransactionId\",\n item_id AS \"item_id!: ItemId\",\n title AS \"title!\",\n creator AS \"creator!\",\n item_type AS \"item_type!: crate::db::ItemType\",\n purchased_at AS \"purchased_at!: chrono::DateTime<chrono::Utc>\",\n is_free AS \"is_free!\",\n license_key_code AS \"license_key_code?: KeyCode\",\n has_new_version AS \"has_new_version!\"\n FROM (\n SELECT DISTINCT ON (p.item_id)\n p.transaction_id,\n p.item_id,\n i.title,\n u.username as creator,\n i.item_type,\n p.purchased_at,\n -- Badge from what the buyer actually paid, not the item's current\n -- price: a later re-price to $0 must not retroactively badge a paid\n -- purchase \"Free\" (nor vice-versa). The purchases view carries the\n -- transaction's own amount_cents.\n (p.amount_cents = 0) as is_free,\n lk.key_code as license_key_code,\n (vc.total_versions > 0 AND vc.total_versions > COALESCE(dc.downloaded_count, 0)) as has_new_version\n FROM purchases p\n JOIN items i ON p.item_id = i.id\n JOIN projects proj ON i.project_id = proj.id\n JOIN users u ON proj.user_id = u.id\n LEFT JOIN license_keys lk ON lk.item_id = p.item_id AND lk.owner_id = p.buyer_id AND lk.revoked_at IS NULL\n LEFT JOIN LATERAL (\n SELECT COUNT(*) AS total_versions\n FROM versions v\n WHERE v.item_id = i.id AND v.s3_key IS NOT NULL\n ) vc ON true\n LEFT JOIN LATERAL (\n SELECT COUNT(*) AS downloaded_count\n FROM user_downloads ud\n WHERE ud.user_id = p.buyer_id AND ud.item_id = i.id\n ) dc ON true\n WHERE p.buyer_id = $1\n ORDER BY p.item_id, p.purchased_at DESC\n ) deduped\n ORDER BY purchased_at DESC\n LIMIT 20\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "transaction_id!: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "item_id!: ItemId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "title!",
19 + "type_info": "Varchar"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "creator!",
24 + "type_info": "Varchar"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "item_type!: crate::db::ItemType",
29 + "type_info": "Varchar"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "purchased_at!: chrono::DateTime<chrono::Utc>",
34 + "type_info": "Timestamptz"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "is_free!",
39 + "type_info": "Bool"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "license_key_code?: KeyCode",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "has_new_version!",
49 + "type_info": "Bool"
50 + }
51 + ],
52 + "parameters": {
53 + "Left": [
54 + "Uuid"
55 + ]
56 + },
57 + "nullable": [
58 + true,
59 + true,
60 + false,
61 + false,
62 + false,
63 + true,
64 + null,
65 + false,
66 + null
67 + ]
68 + },
69 + "hash": "41c422f4a67885622c873a4340e02428504351b0af6f3ec8a504c6875837769a"
70 + }
@@ -1,23 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n DELETE FROM transactions\n WHERE buyer_id = $1 AND item_id = $2 AND status = 'pending'\n RETURNING promo_code_id AS \"promo_code_id: super::PromoCodeId\"\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "promo_code_id: super::PromoCodeId",
9 - "type_info": "Uuid"
10 - }
11 - ],
12 - "parameters": {
13 - "Left": [
14 - "Uuid",
15 - "Uuid"
16 - ]
17 - },
18 - "nullable": [
19 - true
20 - ]
21 - },
22 - "hash": "45104ff126ee3594229229440c2eaa5ecdee90cb623a29d8f1dd1a9721ac9f5f"
23 - }
@@ -0,0 +1,148 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions\n WHERE stripe_checkout_session_id = $1 AND status = 'completed'\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Text"
120 + ]
121 + },
122 + "nullable": [
123 + false,
124 + true,
125 + true,
126 + true,
127 + false,
128 + false,
129 + false,
130 + false,
131 + true,
132 + true,
133 + false,
134 + true,
135 + true,
136 + true,
137 + false,
138 + true,
139 + true,
140 + true,
141 + true,
142 + true,
143 + true,
144 + true
145 + ]
146 + },
147 + "hash": "4dcd947c2a6b61e2f1a62419834210bc696eb0d339a86fead534183afccf1abe"
148 + }
@@ -1,149 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n UPDATE transactions\n SET buyer_id = $2, claimed_by = $2, claim_token = NULL\n WHERE claim_token = $1\n AND buyer_id IS NULL\n AND status = 'completed'\n RETURNING\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid",
120 - "Uuid"
121 - ]
122 - },
123 - "nullable": [
124 - false,
125 - true,
126 - true,
127 - true,
128 - false,
129 - false,
130 - false,
131 - false,
132 - true,
133 - true,
134 - false,
135 - true,
136 - true,
137 - true,
138 - false,
139 - true,
140 - true,
141 - true,
142 - true,
143 - true,
144 - true,
145 - true
146 - ]
147 - },
148 - "hash": "5050ee2fc897968ac68657496e49ccbc48a5948a3b8b62646a1cdaf9023982fd"
149 - }
@@ -0,0 +1,149 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions\n WHERE item_id = $1 AND seller_id = $2\n AND status IN ('completed', 'refunded')\n ORDER BY created_at DESC\n LIMIT 200\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Uuid",
120 + "Uuid"
121 + ]
122 + },
123 + "nullable": [
124 + false,
125 + true,
126 + true,
127 + true,
128 + false,
129 + false,
130 + false,
131 + false,
132 + true,
133 + true,
134 + false,
135 + true,
136 + true,
137 + true,
138 + false,
139 + true,
140 + true,
141 + true,
142 + true,
143 + true,
144 + true,
145 + true
146 + ]
147 + },
148 + "hash": "51c059fc3b8df19b71b7b1938fd9111155df310e960bf37b95575614c4f0d8f2"
149 + }
@@ -0,0 +1,160 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n INSERT INTO transactions (buyer_id, seller_id, item_id, amount_cents, platform_fee_cents, stripe_checkout_session_id, item_title, seller_username, share_contact, project_id, promo_code_id, guest_email, platform_credit_cents)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)\n RETURNING\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Uuid",
120 + "Uuid",
121 + "Uuid",
122 + "Int4",
123 + "Int4",
124 + "Varchar",
125 + "Varchar",
126 + "Varchar",
127 + "Bool",
128 + "Uuid",
129 + "Uuid",
130 + "Varchar",
131 + "Int8"
132 + ]
133 + },
134 + "nullable": [
135 + false,
136 + true,
137 + true,
138 + true,
139 + false,
140 + false,
141 + false,
142 + false,
143 + true,
144 + true,
145 + false,
146 + true,
147 + true,
148 + true,
149 + false,
150 + true,
151 + true,
152 + true,
153 + true,
154 + true,
155 + true,
156 + true
157 + ]
158 + },
159 + "hash": "5c4e0da5632e7e126f826b01991424d4c6ea346781c958504b7a35805d96c9fe"
160 + }
@@ -0,0 +1,148 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions WHERE id = $1\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Uuid"
120 + ]
121 + },
122 + "nullable": [
123 + false,
124 + true,
125 + true,
126 + true,
127 + false,
128 + false,
129 + false,
130 + false,
131 + true,
132 + true,
133 + false,
134 + true,
135 + true,
136 + true,
137 + false,
138 + true,
139 + true,
140 + true,
141 + true,
142 + true,
143 + true,
144 + true
145 + ]
146 + },
147 + "hash": "5d1b0b86891356935ceb3f9857dad2d57e08597e916babf1667a0fc4e1ac05ad"
148 + }
@@ -0,0 +1,23 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n DELETE FROM transactions\n WHERE buyer_id = $1 AND item_id = $2 AND amount_cents = 0 AND status = 'completed'\n RETURNING promo_code_id AS \"promo_code_id: crate::db::PromoCodeId\"\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "promo_code_id: crate::db::PromoCodeId",
9 + "type_info": "Uuid"
10 + }
11 + ],
12 + "parameters": {
13 + "Left": [
14 + "Uuid",
15 + "Uuid"
16 + ]
17 + },
18 + "nullable": [
19 + true
20 + ]
21 + },
22 + "hash": "5fcb253fc99349b8e9d4b9ce7f7516611f073af529e2433c69f490da71704cd3"
23 + }
@@ -0,0 +1,149 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n UPDATE transactions\n SET buyer_id = $2, claimed_by = $2, claim_token = NULL\n WHERE claim_token = $1\n AND buyer_id IS NULL\n AND status = 'completed'\n RETURNING\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Uuid",
120 + "Uuid"
121 + ]
122 + },
123 + "nullable": [
124 + false,
125 + true,
126 + true,
127 + true,
128 + false,
129 + false,
130 + false,
131 + false,
132 + true,
133 + true,
134 + false,
135 + true,
136 + true,
137 + true,
138 + false,
139 + true,
140 + true,
141 + true,
142 + true,
143 + true,
144 + true,
145 + true
146 + ]
147 + },
148 + "hash": "6ab99bc96ab877001dfbe1bd4bf870e2208c2066301dd57d3fb705bfb995cc4c"
149 + }
@@ -1,149 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions\n WHERE item_id = $1 AND seller_id = $2\n AND status IN ('completed', 'refunded')\n ORDER BY created_at DESC\n LIMIT 200\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid",
120 - "Uuid"
121 - ]
122 - },
123 - "nullable": [
124 - false,
125 - true,
126 - true,
127 - true,
128 - false,
129 - false,
130 - false,
131 - false,
132 - true,
133 - true,
134 - false,
135 - true,
136 - true,
137 - true,
138 - false,
139 - true,
140 - true,
141 - true,
142 - true,
143 - true,
144 - true,
145 - true
146 - ]
147 - },
148 - "hash": "7fa83142c8cd2fdfcbde1402dbf8b33fabaa9e3150c6c9de3d635e94ab7da126"
149 - }
@@ -0,0 +1,28 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n UPDATE transactions\n SET status = 'refunded'\n WHERE id = $1 AND status IN ('completed', 'refunding')\n RETURNING id AS \"id: crate::db::TransactionId\", item_id AS \"item_id: ItemId\"\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: crate::db::TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "item_id: ItemId",
14 + "type_info": "Uuid"
15 + }
16 + ],
17 + "parameters": {
18 + "Left": [
19 + "Uuid"
20 + ]
21 + },
22 + "nullable": [
23 + false,
24 + true
25 + ]
26 + },
27 + "hash": "83c5ecce4995b45cd71e8f9d7eca7c6fae0b6ab61958be39ac9ff766452a86ee"
28 + }
@@ -0,0 +1,155 @@
1 + {
2 + "db_name": "PostgreSQL",
3 + "query": "\n INSERT INTO transactions (buyer_id, seller_id, project_id, amount_cents, platform_fee_cents, stripe_checkout_session_id, item_title, seller_username, share_contact)\n VALUES ($1, $2, $3, $4, 0, $5, $6, $7, $8)\n RETURNING\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: crate::db::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n ",
4 + "describe": {
5 + "columns": [
6 + {
7 + "ordinal": 0,
8 + "name": "id: TransactionId",
9 + "type_info": "Uuid"
10 + },
11 + {
12 + "ordinal": 1,
13 + "name": "buyer_id: UserId",
14 + "type_info": "Uuid"
15 + },
16 + {
17 + "ordinal": 2,
18 + "name": "seller_id: UserId",
19 + "type_info": "Uuid"
20 + },
21 + {
22 + "ordinal": 3,
23 + "name": "item_id: ItemId",
24 + "type_info": "Uuid"
25 + },
26 + {
27 + "ordinal": 4,
28 + "name": "amount_cents: Cents",
29 + "type_info": "Int4"
30 + },
31 + {
32 + "ordinal": 5,
33 + "name": "platform_fee_cents: Cents",
34 + "type_info": "Int4"
35 + },
36 + {
37 + "ordinal": 6,
38 + "name": "currency",
39 + "type_info": "Varchar"
40 + },
41 + {
42 + "ordinal": 7,
43 + "name": "status: crate::db::TransactionStatus",
44 + "type_info": "Varchar"
45 + },
46 + {
47 + "ordinal": 8,
48 + "name": "stripe_payment_intent_id",
49 + "type_info": "Varchar"
50 + },
51 + {
52 + "ordinal": 9,
53 + "name": "stripe_checkout_session_id",
54 + "type_info": "Varchar"
55 + },
56 + {
57 + "ordinal": 10,
58 + "name": "created_at: chrono::DateTime<chrono::Utc>",
59 + "type_info": "Timestamptz"
60 + },
61 + {
62 + "ordinal": 11,
63 + "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 + "type_info": "Timestamptz"
65 + },
66 + {
67 + "ordinal": 12,
68 + "name": "item_title",
69 + "type_info": "Varchar"
70 + },
71 + {
72 + "ordinal": 13,
73 + "name": "seller_username",
74 + "type_info": "Varchar"
75 + },
76 + {
77 + "ordinal": 14,
78 + "name": "share_contact",
79 + "type_info": "Bool"
80 + },
81 + {
82 + "ordinal": 15,
83 + "name": "project_id: ProjectId",
84 + "type_info": "Uuid"
85 + },
86 + {
87 + "ordinal": 16,
88 + "name": "parent_transaction_id: TransactionId",
89 + "type_info": "Uuid"
90 + },
91 + {
92 + "ordinal": 17,
93 + "name": "promo_code_id: PromoCodeId",
94 + "type_info": "Uuid"
95 + },
96 + {
97 + "ordinal": 18,
98 + "name": "guest_email",
99 + "type_info": "Varchar"
100 + },
101 + {
102 + "ordinal": 19,
103 + "name": "claim_token: ClaimToken",
104 + "type_info": "Uuid"
105 + },
106 + {
107 + "ordinal": 20,
108 + "name": "claimed_by: UserId",
109 + "type_info": "Uuid"
110 + },
111 + {
112 + "ordinal": 21,
113 + "name": "download_token: DownloadToken",
114 + "type_info": "Uuid"
115 + }
116 + ],
117 + "parameters": {
118 + "Left": [
119 + "Uuid",
120 + "Uuid",
121 + "Uuid",
122 + "Int4",
123 + "Varchar",
124 + "Varchar",
125 + "Varchar",
126 + "Bool"
127 + ]
128 + },
129 + "nullable": [
130 + false,
131 + true,
132 + true,
133 + true,
134 + false,
135 + false,
136 + false,
137 + false,
138 + true,
139 + true,
140 + false,
141 + true,
142 + true,
143 + true,
144 + false,
145 + true,
146 + true,
147 + true,
148 + true,
149 + true,
150 + true,
151 + true
152 + ]
153 + },
154 + "hash": "85188c0ab6f3ecfbece76bfce53a6b28a4525d732b2cd272d79e12a06d364001"
155 + }
@@ -1,148 +0,0 @@
1 - {
2 - "db_name": "PostgreSQL",
3 - "query": "\n SELECT\n id AS \"id: TransactionId\", buyer_id AS \"buyer_id: UserId\", seller_id AS \"seller_id: UserId\",\n item_id AS \"item_id: ItemId\", amount_cents AS \"amount_cents: Cents\", platform_fee_cents AS \"platform_fee_cents: Cents\",\n currency, status AS \"status: super::TransactionStatus\", stripe_payment_intent_id, stripe_checkout_session_id,\n created_at AS \"created_at: chrono::DateTime<chrono::Utc>\", completed_at AS \"completed_at: chrono::DateTime<chrono::Utc>\",\n item_title, seller_username, share_contact, project_id AS \"project_id: ProjectId\",\n parent_transaction_id AS \"parent_transaction_id: TransactionId\", promo_code_id AS \"promo_code_id: PromoCodeId\",\n guest_email, claim_token AS \"claim_token: ClaimToken\", claimed_by AS \"claimed_by: UserId\",\n download_token AS \"download_token: DownloadToken\"\n FROM transactions WHERE download_token = $1 AND status = 'completed'\n ",
4 - "describe": {
5 - "columns": [
6 - {
7 - "ordinal": 0,
8 - "name": "id: TransactionId",
9 - "type_info": "Uuid"
10 - },
11 - {
12 - "ordinal": 1,
13 - "name": "buyer_id: UserId",
14 - "type_info": "Uuid"
15 - },
16 - {
17 - "ordinal": 2,
18 - "name": "seller_id: UserId",
19 - "type_info": "Uuid"
20 - },
21 - {
22 - "ordinal": 3,
23 - "name": "item_id: ItemId",
24 - "type_info": "Uuid"
25 - },
26 - {
27 - "ordinal": 4,
28 - "name": "amount_cents: Cents",
29 - "type_info": "Int4"
30 - },
31 - {
32 - "ordinal": 5,
33 - "name": "platform_fee_cents: Cents",
34 - "type_info": "Int4"
35 - },
36 - {
37 - "ordinal": 6,
38 - "name": "currency",
39 - "type_info": "Varchar"
40 - },
41 - {
42 - "ordinal": 7,
43 - "name": "status: super::TransactionStatus",
44 - "type_info": "Varchar"
45 - },
46 - {
47 - "ordinal": 8,
48 - "name": "stripe_payment_intent_id",
49 - "type_info": "Varchar"
50 - },
51 - {
52 - "ordinal": 9,
53 - "name": "stripe_checkout_session_id",
54 - "type_info": "Varchar"
55 - },
56 - {
57 - "ordinal": 10,
58 - "name": "created_at: chrono::DateTime<chrono::Utc>",
59 - "type_info": "Timestamptz"
60 - },
61 - {
62 - "ordinal": 11,
63 - "name": "completed_at: chrono::DateTime<chrono::Utc>",
64 - "type_info": "Timestamptz"
65 - },
66 - {
67 - "ordinal": 12,
68 - "name": "item_title",
69 - "type_info": "Varchar"
70 - },
71 - {
72 - "ordinal": 13,
73 - "name": "seller_username",
74 - "type_info": "Varchar"
75 - },
76 - {
77 - "ordinal": 14,
78 - "name": "share_contact",
79 - "type_info": "Bool"
80 - },
81 - {
82 - "ordinal": 15,
83 - "name": "project_id: ProjectId",
84 - "type_info": "Uuid"
85 - },
86 - {
87 - "ordinal": 16,
88 - "name": "parent_transaction_id: TransactionId",
89 - "type_info": "Uuid"
90 - },
91 - {
92 - "ordinal": 17,
93 - "name": "promo_code_id: PromoCodeId",
94 - "type_info": "Uuid"
95 - },
96 - {
97 - "ordinal": 18,
98 - "name": "guest_email",
99 - "type_info": "Varchar"
100 - },
101 - {
102 - "ordinal": 19,
103 - "name": "claim_token: ClaimToken",
104 - "type_info": "Uuid"
105 - },
106 - {
107 - "ordinal": 20,
108 - "name": "claimed_by: UserId",
109 - "type_info": "Uuid"
110 - },
111 - {
112 - "ordinal": 21,
113 - "name": "download_token: DownloadToken",
114 - "type_info": "Uuid"
115 - }
116 - ],
117 - "parameters": {
118 - "Left": [
119 - "Uuid"
120 - ]
121 - },
122 - "nullable": [
123 - false,
124 - true,
125 - true,
126 - true,
127 - false,
128 - false,
129 - false,
130 - false,
131 - true,
132 - true,
133 - false,
134 - true,
135 - true,
136 - true,
137 - false,
138 - true,
139 - true,
140 - true,
141 - true,
142 - true,
143 - true,
144 - true
145 - ]
146 - },
147 - "hash": "90b061b46f562d1af9dd8faa7f1467be44abc08fb27706aaddb460f02ddb7f44"
148 - }