mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-06 17:37:47 +08:00
fix(admin): make bulk wallet batches idempotent
This commit is contained in:
@@ -343,3 +343,17 @@ CREATE INDEX IF NOT EXISTS idx_redeem_codes_status ON public.redeem_codes USING
|
||||
CREATE INDEX IF NOT EXISTS idx_redeem_codes_redeemed_user ON public.redeem_codes USING btree (redeemed_by_user_id, redeemed_at);
|
||||
CREATE INDEX IF NOT EXISTS idx_redeem_codes_redeemed_order ON public.redeem_codes USING btree (redeemed_payment_order_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.admin_user_wallet_balance_batches (
|
||||
admin_user_id character varying(64) NOT NULL,
|
||||
idempotency_key character varying(128) NOT NULL,
|
||||
request_fingerprint character varying(64) NOT NULL,
|
||||
target_user_ids jsonb NOT NULL,
|
||||
missing_user_ids jsonb NOT NULL,
|
||||
warnings jsonb NOT NULL,
|
||||
user_outcomes jsonb NOT NULL,
|
||||
created_at_unix_secs bigint NOT NULL,
|
||||
updated_at_unix_secs bigint NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE ONLY public.admin_user_wallet_balance_batches ADD CONSTRAINT admin_user_wallet_balance_batches_pkey PRIMARY KEY (admin_user_id, idempotency_key);
|
||||
|
||||
|
||||
@@ -1366,3 +1366,47 @@ columns = ["redeemed_by_user_id", "redeemed_at"]
|
||||
[[table.redeem_codes.indexes]]
|
||||
name = "idx_redeem_codes_redeemed_order"
|
||||
columns = ["redeemed_payment_order_id"]
|
||||
|
||||
[table.admin_user_wallet_balance_batches]
|
||||
domain = "wallet_billing"
|
||||
order = 110
|
||||
primary_key = ["admin_user_id", "idempotency_key"]
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "admin_user_id"
|
||||
type = "text_id"
|
||||
length = 64
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "idempotency_key"
|
||||
type = "text"
|
||||
length = 128
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "request_fingerprint"
|
||||
type = "text"
|
||||
length = 64
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "target_user_ids"
|
||||
type = "json"
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "missing_user_ids"
|
||||
type = "json"
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "warnings"
|
||||
type = "json"
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "user_outcomes"
|
||||
type = "json"
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "created_at_unix_secs"
|
||||
type = "unix_seconds"
|
||||
|
||||
[[table.admin_user_wallet_balance_batches.columns]]
|
||||
name = "updated_at_unix_secs"
|
||||
type = "unix_seconds"
|
||||
|
||||
Reference in New Issue
Block a user