add: single_use products
This commit is contained in:
parent
7fbc732290
commit
e5e6d5cddb
12 changed files with 149 additions and 7 deletions
|
@ -29,6 +29,8 @@ pub struct Product {
|
|||
///
|
||||
/// A negative stock means the product has unlimited stock.
|
||||
pub stock: i32,
|
||||
/// If this product is limited to one purchase per person.
|
||||
pub single_use: bool,
|
||||
}
|
||||
|
||||
impl Product {
|
||||
|
@ -44,6 +46,7 @@ impl Product {
|
|||
on_sale: false,
|
||||
price: 0,
|
||||
stock: 0,
|
||||
single_use: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue