You've already forked AstralRinth
* Initial Anrok integration * Query cache, fmt, clippy * Fmt * Use payment intent function in edit_subscription * Attach Anrok client, use payments in index_billing * Integrate Anrok with refunds * Bug fixes * More bugfixes * Fix resubscriptions * Medal promotion bugfixes * Use stripe metadata constants everywhere * Pre-fill values in products_tax_identifiers * Cleanup billing route module * Cleanup * Email notification for tax charge * Don't charge tax on users which haven't been notified of tax change * Fix taxnotification.amount templates * Update .env.docker-compose * Update .env.local * Clippy * Fmt * Query cache * Periodically update tax amount on upcoming charges * Fix queries * Skip indexing tax amount on charges if no charges to process * chore: query cache, clippy, fmt * Fix a lot of things * Remove test code * chore: query cache, clippy, fmt * Fix money formatting * Fix conflicts * Extra documentation, handle tax association properly * Track loss in tax drift * chore: query cache, clippy, fmt * Add subscription.id variable * chore: query cache, clippy, fmt * chore: query cache, clippy, fmt
131 lines
3.4 KiB
JSON
131 lines
3.4 KiB
JSON
{
|
|
"db_name": "PostgreSQL",
|
|
"query": "\n SELECT\n charges.id, charges.user_id, charges.price_id, charges.amount, charges.currency_code, charges.status, charges.due, charges.last_attempt,\n charges.charge_type, charges.subscription_id, charges.tax_amount, charges.tax_platform_id,\n -- Workaround for https://github.com/launchbadge/sqlx/issues/3336\n charges.subscription_interval AS \"subscription_interval?\",\n charges.payment_platform,\n charges.payment_platform_id AS \"payment_platform_id?\",\n charges.parent_charge_id AS \"parent_charge_id?\",\n charges.net AS \"net?\",\n\t\t\t\tcharges.tax_last_updated AS \"tax_last_updated?\",\n\t\t\t\tcharges.tax_drift_loss AS \"tax_drift_loss?\"\n FROM charges\n \n WHERE\n charge_type = $1 AND\n (\n (status = 'open' AND due < NOW()) OR\n (status = 'failed' AND last_attempt < NOW() - INTERVAL '2 days')\n )\n ",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "id",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 1,
|
|
"name": "user_id",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 2,
|
|
"name": "price_id",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 3,
|
|
"name": "amount",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 4,
|
|
"name": "currency_code",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 5,
|
|
"name": "status",
|
|
"type_info": "Varchar"
|
|
},
|
|
{
|
|
"ordinal": 6,
|
|
"name": "due",
|
|
"type_info": "Timestamptz"
|
|
},
|
|
{
|
|
"ordinal": 7,
|
|
"name": "last_attempt",
|
|
"type_info": "Timestamptz"
|
|
},
|
|
{
|
|
"ordinal": 8,
|
|
"name": "charge_type",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 9,
|
|
"name": "subscription_id",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 10,
|
|
"name": "tax_amount",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 11,
|
|
"name": "tax_platform_id",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 12,
|
|
"name": "subscription_interval?",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 13,
|
|
"name": "payment_platform",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 14,
|
|
"name": "payment_platform_id?",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 15,
|
|
"name": "parent_charge_id?",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 16,
|
|
"name": "net?",
|
|
"type_info": "Int8"
|
|
},
|
|
{
|
|
"ordinal": 17,
|
|
"name": "tax_last_updated?",
|
|
"type_info": "Timestamptz"
|
|
},
|
|
{
|
|
"ordinal": 18,
|
|
"name": "tax_drift_loss?",
|
|
"type_info": "Int8"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Text"
|
|
]
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
false,
|
|
true,
|
|
false,
|
|
true,
|
|
false,
|
|
true,
|
|
true,
|
|
false,
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
true
|
|
]
|
|
},
|
|
"hash": "e2e58113bc3a3db6ffc75b5c5e10acd16403aa0679ef53330f2ce3e8a45f7b9f"
|
|
}
|