2022-11-07 16:28:51 +01:00
|
|
|
pub mod create_product_variant {
|
|
|
|
use model::v2::*;
|
|
|
|
|
2022-11-08 07:49:06 +01:00
|
|
|
use crate::stocks::Error;
|
|
|
|
|
2022-11-07 16:28:51 +01:00
|
|
|
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
|
|
|
pub struct Input {
|
|
|
|
pub product_id: ProductId,
|
|
|
|
pub name: ProductName,
|
|
|
|
pub short_description: ProductShortDesc,
|
|
|
|
pub long_description: ProductLongDesc,
|
|
|
|
pub price: Price,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
2022-11-08 07:49:06 +01:00
|
|
|
pub struct Details {
|
2022-11-07 16:28:51 +01:00
|
|
|
pub product_variant: ProductVariant,
|
|
|
|
}
|
2022-11-08 07:49:06 +01:00
|
|
|
|
|
|
|
pub type Output = Result<Details, Error>;
|
2022-11-07 16:28:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub mod update_product_variant {
|
|
|
|
use model::v2::*;
|
|
|
|
|
2022-11-08 07:49:06 +01:00
|
|
|
use crate::stocks::Error;
|
|
|
|
|
2022-11-07 16:28:51 +01:00
|
|
|
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
|
|
|
pub struct Input {
|
|
|
|
pub id: ProductVariantId,
|
|
|
|
pub product_id: ProductId,
|
|
|
|
pub name: ProductName,
|
|
|
|
pub short_description: ProductShortDesc,
|
|
|
|
pub long_description: ProductLongDesc,
|
|
|
|
pub price: Price,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
2022-11-08 07:49:06 +01:00
|
|
|
pub struct Details {
|
2022-11-07 16:28:51 +01:00
|
|
|
pub product_variant: ProductVariant,
|
|
|
|
}
|
2022-11-08 07:49:06 +01:00
|
|
|
|
|
|
|
pub type Output = Result<Details, Error>;
|
2022-11-07 16:28:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pub mod delete_product_variant {
|
|
|
|
use model::v2::*;
|
|
|
|
|
2022-11-08 07:49:06 +01:00
|
|
|
use crate::stocks::Error;
|
|
|
|
|
2022-11-07 16:28:51 +01:00
|
|
|
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
|
|
|
pub struct Input {
|
|
|
|
pub product_id: ProductId,
|
|
|
|
pub product_variant_id: ProductVariantId,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
2022-11-08 07:49:06 +01:00
|
|
|
pub struct Details {
|
2022-11-07 16:28:51 +01:00
|
|
|
pub product_id: ProductId,
|
|
|
|
pub product_variant_id: ProductVariantId,
|
|
|
|
}
|
2022-11-08 07:49:06 +01:00
|
|
|
|
|
|
|
pub type Output = Result<Details, Error>;
|
2022-11-07 16:28:51 +01:00
|
|
|
}
|