From 0ddeec23745f16b94e5748a94834f57718281dbb Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Mon, 15 Jul 2024 19:49:36 +0530 Subject: [PATCH] feat: place holder stock aggregate --- src/inventory/domain/mod.rs | 2 +- src/inventory/domain/stock_aggregate.rs | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/inventory/domain/stock_aggregate.rs diff --git a/src/inventory/domain/mod.rs b/src/inventory/domain/mod.rs index 89649c4..cb92726 100644 --- a/src/inventory/domain/mod.rs +++ b/src/inventory/domain/mod.rs @@ -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 diff --git a/src/inventory/domain/stock_aggregate.rs b/src/inventory/domain/stock_aggregate.rs new file mode 100644 index 0000000..cda309f --- /dev/null +++ b/src/inventory/domain/stock_aggregate.rs @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: 2024 Aravinth Manivannan +// +// 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, + sold: bool, + quantity: Quantity, +}