feat: add quantity to Product aggregate #36

Merged
realaravinth merged 2 commits from include-quantity-in-product into master 2024-07-15 19:58:05 +05:30
2 changed files with 25 additions and 1 deletions
Showing only changes of commit 0ddeec2374 - Show all commits

View file

@ -5,7 +5,7 @@
// aggregates
pub mod category_aggregate;
pub mod product_aggregate;
//pub mod stock_aggregate;
pub mod stock_aggregate;
pub mod store_aggregate;
// commands

View file

@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
use derive_builder::Builder;
use derive_getters::Getters;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use uuid::Uuid;
use super::product_aggregate::Quantity;
// stock keeping unit
// TODO: will implement later, have to figure out how to print SKU label and during billing.
#[derive(
Clone, Debug, Serialize, Deserialize, Eq, PartialEq, Ord, PartialOrd, Builder, Getters,
)]
pub struct SKU {
id: String,
product_id: Uuid,
expiry: Option<OffsetDateTime>,
sold: bool,
quantity: Quantity,
}