fix: add ledger refund uniqueness guard

This commit is contained in:
QiuSW
2026-07-02 16:59:02 +08:00
parent be97a35360
commit 4e8c1b45a4
7 changed files with 93 additions and 8 deletions
+4
View File
@@ -192,6 +192,10 @@ class PointsLedger(models.Model):
condition=~Q(points_delta=0),
name="points_ledger_points_delta_non_zero",
),
models.UniqueConstraint(
fields=("ref_call", "change_type"),
name="unique_ledger_change_type_per_call",
),
]
indexes = [
models.Index(fields=("user", "created_at")),