Update git remote URL from git.threefold.info to git.ourworld.tf
This commit is contained in:
@@ -1,17 +1,34 @@
|
||||
module biz
|
||||
import base
|
||||
|
||||
import freeflowuniverse.herolib.data.ourtime
|
||||
import freeflowuniverse.herolib.hero.models.core
|
||||
|
||||
|
||||
// CompanyStatus represents the status of a company
|
||||
pub enum CompanyStatus {
|
||||
active
|
||||
inactive
|
||||
suspended
|
||||
// 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
|
||||
}
|
||||
|
||||
// BusinessType represents the type of a business
|
||||
// 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
|
||||
@@ -19,25 +36,3 @@ pub enum BusinessType {
|
||||
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
|
||||
}
|
||||
|
28
specs/models/biz/payment.v
Normal file
28
specs/models/biz/payment.v
Normal 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
|
||||
}
|
@@ -1,44 +1,39 @@
|
||||
module biz
|
||||
import base
|
||||
|
||||
import freeflowuniverse.herolib.data.ourtime
|
||||
import freeflowuniverse.herolib.hero.models.core
|
||||
|
||||
import freeflowuniverse.herolib.data.currency
|
||||
// import freeflowuniverse.herolib.core.texttools { name_fix }
|
||||
// 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
|
||||
}
|
||||
|
||||
// ProductType represents the type of a product
|
||||
// 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 represents the status of a product
|
||||
// ProductStatus indicates availability
|
||||
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
|
||||
}
|
||||
|
@@ -1,43 +1,35 @@
|
||||
module biz
|
||||
import base
|
||||
|
||||
import freeflowuniverse.herolib.data.ourtime
|
||||
import freeflowuniverse.herolib.hero.models.core
|
||||
|
||||
import freeflowuniverse.herolib.data.currency
|
||||
// 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
|
||||
}
|
||||
|
||||
// SaleStatus represents the status of a sale
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
@@ -1,27 +1,22 @@
|
||||
module biz
|
||||
import base
|
||||
|
||||
import freeflowuniverse.herolib.data.ourtime
|
||||
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 represents the type of shareholder
|
||||
// ShareholderType distinguishes between individual and corporate owners
|
||||
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
|
||||
}
|
||||
|
@@ -1,5 +0,0 @@
|
||||
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