sample_shoe_co 0.0.1

A demo crate simulating a shoe company with basic inventory and order processing examples.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::product;
pub trait WarehouseItem<SKU>: product::ProductLine<SKU> {
    const MIN_ORDER_SIZE: u32 = 10;
    fn restock(&mut self, amount: u32);
    fn sell(&mut self, amount: u32);
    fn set_quantity(&mut self, amount: u32);
    fn inventory_min_quantity_if_restocked(&self) -> u32 {
        self.get_quantity() + Self::MIN_ORDER_SIZE
    }
    fn inventory_min_restock(&mut self) {
        self.set_quantity(Self::MIN_ORDER_SIZE + self.get_quantity());
    }
}