This commit is contained in:
2025-08-21 17:26:40 +02:00
parent 58ed59cd12
commit 095a4d0c69
96 changed files with 1070 additions and 10 deletions

View File

@@ -0,0 +1,44 @@
module biz
import base
import freeflowuniverse.herolib.data.ourtime
import freeflowuniverse.herolib.data.currency
// import freeflowuniverse.herolib.core.texttools { name_fix }
// ProductType represents the type of a product
pub enum ProductType {
product
service
}
// ProductStatus represents the status of a product
pub enum ProductStatus {
available
unavailable
}
// ProductComponent represents a component or sub-part of a product.
// Its lifecycle is tied to the parent Product and it does not have its own independent ID.
pub struct ProductComponent {
pub mut:
name string
description string
quantity int
}
// Product represents a product or service offered
pub struct Product {
base.Base // Provides id u32, creation_time, mod_time, comments []u32
pub mut:
name string
description string
price currency.Currency
type_ ProductType
category string
status ProductStatus
max_amount u16 // Maximum available quantity of this product, if applicable
purchase_till ourtime.OurTime // Date until which this product can be purchased
active_till ourtime.OurTime // Date until which this product/service remains active (e.g., for subscriptions)
components []ProductComponent // List of components that make up this product
}