add: product types
This commit is contained in:
parent
2705608903
commit
ea13526515
9 changed files with 163 additions and 8 deletions
|
@ -176,6 +176,7 @@ bitflags! {
|
|||
const ADMINISTRATOR = 1 << 1;
|
||||
const MANAGE_DOMAINS = 1 << 2;
|
||||
const MANAGE_SERVICES = 1 << 3;
|
||||
const MANAGE_PRODUCTS = 1 << 4;
|
||||
|
||||
const _ = !0;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@ pub struct Product {
|
|||
pub id: usize,
|
||||
pub created: usize,
|
||||
pub owner: usize,
|
||||
pub title: String,
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub likes: usize,
|
||||
pub dislikes: usize,
|
||||
pub r#type: ProductType,
|
||||
pub likes: isize,
|
||||
pub dislikes: isize,
|
||||
pub product_type: ProductType,
|
||||
pub stripe_id: String,
|
||||
pub price: ProductPrice,
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ impl Product {
|
|||
/// Create a new [`Product`].
|
||||
pub fn new(
|
||||
owner: usize,
|
||||
title: String,
|
||||
name: String,
|
||||
description: String,
|
||||
price: ProductPrice,
|
||||
r#type: ProductType,
|
||||
|
@ -46,11 +46,11 @@ impl Product {
|
|||
id: Snowflake::new().to_string().parse::<usize>().unwrap(),
|
||||
created: unix_epoch_timestamp(),
|
||||
owner,
|
||||
title,
|
||||
name,
|
||||
description,
|
||||
likes: 0,
|
||||
dislikes: 0,
|
||||
r#type,
|
||||
product_type: r#type,
|
||||
stripe_id: String::new(),
|
||||
price,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue