feat: place holder stock aggregate

This commit is contained in:
Aravinth Manivannan 2024-07-15 19:49:36 +05:30
parent ffa44dc399
commit 0ddeec2374
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 25 additions and 1 deletions

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,
}