add: ProfileStyle products

This commit is contained in:
trisua 2025-08-08 23:44:45 -04:00
parent 077e9252e3
commit 95cb889080
19 changed files with 525 additions and 54 deletions

View file

@ -25,7 +25,7 @@ use axum::{
use serde::Deserialize;
use tetratto_core::model::{
apps::{AppDataSelectMode, AppDataSelectQuery, AppQuota, DeveloperPassStorageQuota},
auth::AchievementName,
auth::{AchievementName, AppliedConfigType},
communities::{
CommunityContext, CommunityJoinAccess, CommunityReadAccess, CommunityWriteAccess,
PollOption, PostContext,
@ -333,6 +333,14 @@ pub fn routes() -> Router {
"/auth/user/{id}/settings",
post(auth::profile::update_user_settings_request),
)
.route(
"/auth/user/{id}/applied_configuration",
post(auth::profile::add_applied_configuration_request),
)
.route(
"/auth/user/{id}/applied_configuration",
delete(auth::profile::remove_applied_configuration_request),
)
.route(
"/auth/user/{id}/role",
post(auth::profile::update_user_role_request),
@ -728,6 +736,7 @@ pub fn routes() -> Router {
"/products/{id}/description",
post(products::update_description_request),
)
.route("/products/{id}/data", post(products::update_data_request))
.route(
"/products/{id}/on_sale",
post(products::update_on_sale_request),
@ -1274,6 +1283,11 @@ pub struct UpdateProductDescription {
pub description: String,
}
#[derive(Deserialize)]
pub struct UpdateProductData {
pub data: String,
}
#[derive(Deserialize)]
pub struct UpdateProductOnSale {
pub on_sale: bool,
@ -1298,3 +1312,14 @@ pub struct UpdateProductMethod {
pub struct UpdateProductStock {
pub stock: i32,
}
#[derive(Deserialize)]
pub struct AddAppliedConfiguration {
pub r#type: AppliedConfigType,
pub id: String,
}
#[derive(Deserialize)]
pub struct RemoveAppliedConfiguration {
pub id: String,
}