...
This commit is contained in:
		
							
								
								
									
										43
									
								
								specs/models_older/biz/company.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								specs/models_older/biz/company.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
module biz
 | 
			
		||||
import base
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.data.ourtime
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// CompanyStatus represents the status of a company
 | 
			
		||||
pub enum CompanyStatus {
 | 
			
		||||
	active
 | 
			
		||||
	inactive
 | 
			
		||||
	suspended
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BusinessType represents the type of a business
 | 
			
		||||
pub enum BusinessType {
 | 
			
		||||
	coop
 | 
			
		||||
	single
 | 
			
		||||
	twin
 | 
			
		||||
	starter
 | 
			
		||||
	global
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Company represents a company registered in the Freezone
 | 
			
		||||
pub struct Company {
 | 
			
		||||
	base.Base // Provides id u32, creation_time, mod_time, comments []u32
 | 
			
		||||
pub mut:
 | 
			
		||||
	// id u32 is provided by base.Base
 | 
			
		||||
	name                string
 | 
			
		||||
	registration_number string
 | 
			
		||||
	incorporation_date  ourtime.OurTime
 | 
			
		||||
	fiscal_year_end     string
 | 
			
		||||
	email               string
 | 
			
		||||
	phone               string
 | 
			
		||||
	website             string
 | 
			
		||||
	address             string
 | 
			
		||||
	business_type       BusinessType
 | 
			
		||||
	industry            string
 | 
			
		||||
	description         string
 | 
			
		||||
	status              CompanyStatus
 | 
			
		||||
	// created_at is provided by base.Base.creation_time
 | 
			
		||||
	// updated_at is provided by base.Base.mod_time
 | 
			
		||||
	shareholders        []Shareholder
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								specs/models_older/biz/product.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								specs/models_older/biz/product.v
									
									
									
									
									
										Normal 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										43
									
								
								specs/models_older/biz/sale.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								specs/models_older/biz/sale.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
module biz
 | 
			
		||||
import base
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.data.ourtime
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.data.currency
 | 
			
		||||
 | 
			
		||||
// SaleStatus represents the status of a sale
 | 
			
		||||
pub enum SaleStatus {
 | 
			
		||||
	pending
 | 
			
		||||
	completed
 | 
			
		||||
	cancelled
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Sale represents a sale of products or services
 | 
			
		||||
pub struct Sale {
 | 
			
		||||
	base.Base // Provides id u32, creation_time, mod_time, comments []u32
 | 
			
		||||
pub mut:
 | 
			
		||||
	// id u32 is provided by base.Base
 | 
			
		||||
	company_id   u32                // Reference to Company.id that made the sale
 | 
			
		||||
	buyer_name   string
 | 
			
		||||
	buyer_email  string
 | 
			
		||||
	total_amount currency.Currency
 | 
			
		||||
	status       SaleStatus
 | 
			
		||||
	sale_date    ourtime.OurTime
 | 
			
		||||
	// created_at is provided by base.Base.creation_time
 | 
			
		||||
	// updated_at is provided by base.Base.mod_time
 | 
			
		||||
	items        []SaleItem
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SaleItem represents an individual item within a Sale.
 | 
			
		||||
// Its lifecycle is tied to the parent Sale.
 | 
			
		||||
pub struct SaleItem {
 | 
			
		||||
pub mut:
 | 
			
		||||
	// id u32 - Removed, component of Sale
 | 
			
		||||
	// sale_id u32 - Removed, implicit link to parent Sale
 | 
			
		||||
	product_id  u32                // Reference to Product.id
 | 
			
		||||
	name        string             // Denormalized product name at time of sale
 | 
			
		||||
	quantity    int
 | 
			
		||||
	unit_price  currency.Currency  // Price per unit at time of sale
 | 
			
		||||
	subtotal    currency.Currency
 | 
			
		||||
	service_active_until ourtime.OurTime? // Optional: For services, date until this specific purchased instance is active
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								specs/models_older/biz/shareholder.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								specs/models_older/biz/shareholder.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
module biz
 | 
			
		||||
import base
 | 
			
		||||
 | 
			
		||||
import freeflowuniverse.herolib.data.ourtime
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// ShareholderType represents the type of shareholder
 | 
			
		||||
pub enum ShareholderType {
 | 
			
		||||
	individual
 | 
			
		||||
	corporate
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Shareholder represents a shareholder of a company
 | 
			
		||||
pub struct Shareholder {
 | 
			
		||||
	base.Base // Provides id u32, creation_time, mod_time, comments []u32
 | 
			
		||||
pub mut:
 | 
			
		||||
	// id u32 is provided by base.Base
 | 
			
		||||
	company_id u32                // Reference to Company.id
 | 
			
		||||
	user_id    u32                // Reference to User.id (if individual) or another entity ID (if corporate)
 | 
			
		||||
	name       string             // Denormalized name of the shareholder (user or corporate entity)
 | 
			
		||||
	shares     f64                // Number of shares held
 | 
			
		||||
	percentage f64                // Percentage of ownership
 | 
			
		||||
	type_      ShareholderType
 | 
			
		||||
	since      ourtime.OurTime    // Date since becoming a shareholder
 | 
			
		||||
	// created_at is provided by base.Base.creation_time
 | 
			
		||||
	// updated_at is provided by base.Base.mod_time
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										5
									
								
								specs/models_older/biz/user.v
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								specs/models_older/biz/user.v
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
module biz
 | 
			
		||||
 | 
			
		||||
// DEPRECATED: This file is deprecated and should not be used.
 | 
			
		||||
// Please use circle.User instead, which has all the necessary fields for MCC functionality.
 | 
			
		||||
// The biz.User struct has been removed as per the specifications.
 | 
			
		||||
		Reference in New Issue
	
	Block a user