max / makenotwork
1 file changed,
+5 insertions,
-1 deletion
| @@ -794,7 +794,11 @@ pub async fn get_user_purchases(pool: &PgPool, user_id: UserId) -> Result<Vec<Db | |||
| 794 | 794 | u.username as creator, | |
| 795 | 795 | i.item_type, | |
| 796 | 796 | p.purchased_at, | |
| 797 | - | (i.price_cents = 0) as is_free, | |
| 797 | + | -- Badge from what the buyer actually paid, not the item's current | |
| 798 | + | -- price: a later re-price to $0 must not retroactively badge a paid | |
| 799 | + | -- purchase "Free" (nor vice-versa). The purchases view carries the | |
| 800 | + | -- transaction's own amount_cents. | |
| 801 | + | (p.amount_cents = 0) as is_free, | |
| 798 | 802 | lk.key_code as license_key_code, | |
| 799 | 803 | (vc.total_versions > 0 AND vc.total_versions > COALESCE(dc.downloaded_count, 0)) as has_new_version | |
| 800 | 804 | FROM purchases p |