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,38 @@
module biz
import freeflowuniverse.herolib.hero.models.core
// Company represents a business entity with all necessary details
pub struct Company {
core.Base
pub mut:
name string // Company legal name @[index: 'company_name_idx']
registration_number string // Official registration number @[index: 'company_reg_idx']
incorporation_date u64 // Unix timestamp
fiscal_year_end string // Format: MM-DD
email string
phone string
website string
address string
business_type BusinessType
industry string // Industry classification
description string // Company description
status CompanyStatus
}
// CompanyStatus tracks the operational state of a company
pub enum CompanyStatus {
pending_payment
active
suspended
inactive
}
// BusinessType categorizes the company structure
pub enum BusinessType {
coop
single
twin
starter
global
}

View File

@@ -0,0 +1,28 @@
module biz
import freeflowuniverse.herolib.hero.models.core
// Payment handles financial transactions for companies
pub struct Payment {
core.Base
pub mut:
payment_intent_id string // Stripe payment intent ID @[index: 'payment_intent_idx']
company_id u32 // Associated company @[index: 'payment_company_idx']
payment_plan string // monthly/yearly/two_year
setup_fee f64
monthly_fee f64
total_amount f64
currency string // Default: usd
status PaymentStatus
stripe_customer_id string
completed_at u64 // Unix timestamp
}
// PaymentStatus tracks the lifecycle of a payment
pub enum PaymentStatus {
pending
processing
completed
failed
refunded
}

View File

@@ -0,0 +1,39 @@
module biz
import freeflowuniverse.herolib.hero.models.core
// Product represents goods or services offered by a company
pub struct Product {
core.Base
pub mut:
name string
description string
price f64
type_ ProductType
category string
status ProductStatus
max_amount u16
purchase_till u64 // Unix timestamp
active_till u64 // Unix timestamp
components []ProductComponent
}
// ProductComponent represents sub-parts of a complex product
pub struct ProductComponent {
pub mut:
name string
description string
quantity u32
}
// ProductType differentiates between products and services
pub enum ProductType {
product
service
}
// ProductStatus indicates availability
pub enum ProductStatus {
available
unavailable
}

View File

@@ -0,0 +1,35 @@
module biz
import freeflowuniverse.herolib.hero.models.core
// Sale represents a transaction linking buyers to products
pub struct Sale {
core.Base
pub mut:
company_id u32
buyer_id u32
transaction_id u32
total_amount f64
status SaleStatus
sale_date u64 // Unix timestamp
items []SaleItem
notes string
}
// SaleItem captures product details at time of sale
pub struct SaleItem {
pub mut:
product_id u32
name string // Product name snapshot
quantity i32
unit_price f64
subtotal f64
service_active_until u64 // Optional service expiry
}
// SaleStatus tracks transaction state
pub enum SaleStatus {
pending
completed
cancelled
}

View File

@@ -0,0 +1,22 @@
module biz
import freeflowuniverse.herolib.hero.models.core
// Shareholder tracks company ownership details
pub struct Shareholder {
core.Base
pub mut:
company_id u32
user_id u32
name string
shares f64
percentage f64
type_ ShareholderType
since u64 // Unix timestamp
}
// ShareholderType distinguishes between individual and corporate owners
pub enum ShareholderType {
individual
corporate
}