add: store coin transfer source

This commit is contained in:
trisua 2025-08-08 16:01:23 -04:00
parent a08552338b
commit 98426d0989
11 changed files with 105 additions and 9 deletions

View file

@ -556,6 +556,10 @@ input[type="checkbox"]:checked {
background-image: url("/icons/check.svg");
}
label {
cursor: pointer;
}
/* pillmenu */
.pillmenu {
display: flex;

View file

@ -89,7 +89,7 @@
(text "{%- endif %}"))
(text "{%- endif %} {%- endmacro %} {% macro full_username(user) -%} {% if user and user.username -%}")
(div
("class" "flex items_center")
("class" "flex flex_wrap items_center")
(a
("href" "/@{{ user.username }}")
("class" "flush flex gap_1")
@ -119,6 +119,12 @@
("style" "color: var(--color-primary);")
("class" "flex items_center")
(text "{{ icon \"star\" }}"))
(text "{%- endif %} {% if user.checkouts|length > 0 -%}")
(span
("title" "Donator")
("style" "color: var(--color-primary);")
("class" "flex items_center")
(text "{{ icon \"hand-heart\" }}"))
(text "{%- endif %} {% if user.permissions|has_staff_badge -%}")
(span
("title" "Staff")

View file

@ -92,7 +92,7 @@
(div
("class" "flex flex_col gap_1")
(label
("for" "title")
("for" "price")
(str (text "economy:label.price")))
(input
("type" "number")
@ -130,7 +130,7 @@
(div
("class" "flex flex_col gap_1")
(label
("for" "title")
("for" "stock")
(str (text "economy:label.stock")))
(input
("type" "number")

View file

@ -7,7 +7,7 @@ use axum::{
};
use tetratto_core::model::{
auth::{Notification, User},
economy::{CoinTransfer, CoinTransferMethod},
economy::{CoinTransfer, CoinTransferMethod, CoinTransferSource},
moderation::AuditLogEntry,
permissions::{FinePermission, SecondaryPermission},
ApiReturn, Error,
@ -635,6 +635,7 @@ pub async fn handle_stupid_fucking_checkout_success_session(
user.id,
100,
CoinTransferMethod::Transfer,
CoinTransferSource::Purchase,
),
true,
)
@ -651,6 +652,7 @@ pub async fn handle_stupid_fucking_checkout_success_session(
user.id,
400,
CoinTransferMethod::Transfer,
CoinTransferSource::Purchase,
),
true,
)

View file

@ -1,7 +1,7 @@
use crate::{get_user_from_token, State, cookie::CookieJar};
use axum::{response::IntoResponse, Extension, Json};
use tetratto_core::model::{
economy::{CoinTransfer, CoinTransferMethod},
economy::{CoinTransfer, CoinTransferMethod, CoinTransferSource},
oauth,
requests::{ActionData, ActionRequest, ActionType},
ApiReturn, Error,
@ -29,6 +29,7 @@ pub async fn create_request(
},
req.amount,
CoinTransferMethod::Transfer, // this endpoint is ONLY for regular transfers; products export a buy endpoint for the other method
CoinTransferSource::General,
),
true,
)