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
}

View File

@@ -0,0 +1,15 @@
module calendar
import freeflowuniverse.herolib.hero.models.core
// Calendar represents a calendar with events and scheduling capabilities
pub struct Calendar {
core.Base
pub mut:
name string @[index]
description string
color string // hex color code
timezone string
owner_id u32 @[index]
is_public bool
}

View File

@@ -0,0 +1,36 @@
module calendar
import freeflowuniverse.herolib.hero.models.core
// Contact represents a contact or address book entry
pub struct Contact {
core.Base
pub mut:
name string @[index]
email string @[index]
phone string
address string
company string
job_title string
notes string
tags []string
birthday u64
is_favorite bool
}
// ContactGroup represents a group of contacts
pub struct ContactGroup {
core.Base
pub mut:
name string @[index]
description string
color string
}
// ContactGroupMembership links contacts to groups
pub struct ContactGroupMembership {
core.Base
pub mut:
contact_id u32 @[index]
group_id u32 @[index]
}

View File

@@ -0,0 +1,53 @@
module calendar
import freeflowuniverse.herolib.hero.models.core
// EventStatus represents the current status of an event
pub enum EventStatus {
scheduled
ongoing
completed
cancelled
postponed
}
// EventType categorizes different types of events
pub enum EventType {
meeting
appointment
reminder
task
call
conference
}
// Event represents a calendar event
pub struct Event {
core.Base
pub mut:
calendar_id u32 @[index]
title string @[index]
description string
start_time u64 @[index]
end_time u64 @[index]
location string
status EventStatus
event_type EventType
priority u8 // 1-5 scale
is_all_day bool
recurrence_rule string // RFC 5545 recurrence rule
parent_event_id u32 // for recurring events
}
// EventParticipant represents a participant in an event
pub struct EventParticipant {
core.Base
pub mut:
event_id u32 @[index]
user_id u32 @[index]
email string @[index]
name string
role string // attendee, organizer, optional
status string // accepted, declined, tentative, pending
response_time u64
}

View File

@@ -0,0 +1,49 @@
module calendar
import freeflowuniverse.herolib.hero.models.core
// MessageStatus represents the delivery status of a message
pub enum MessageStatus {
draft
sent
delivered
read
failed
}
// MessageType categorizes different types of messages
pub enum MessageType {
email
sms
notification
reminder
}
// Message represents a communication message
pub struct Message {
core.Base
pub mut:
sender_id u32 @[index]
recipient_id u32 @[index]
subject string
body string
message_type MessageType
status MessageStatus
scheduled_at u64
sent_at u64
read_at u64
priority u8 // 1-5 scale
attachments []string // file paths or URLs
tags []string
}
// Reminder represents a scheduled reminder
pub struct Reminder {
core.Base
pub mut:
event_id u32 @[index]
message string
reminder_time u64 @[index]
is_sent bool
snooze_count u8
}

View File

@@ -0,0 +1,32 @@
module circle
import freeflowuniverse.herolib.hero.models.core
// Circle represents a circle entity with configuration and metadata
@[heap]
pub struct Circle {
core.Base
pub mut:
name string // Human-readable name of the circle
description string // Detailed description of the circle's purpose
domain string // Primary domain name for the circle @[index]
config CircleConfig // Configuration settings for the circle
status CircleStatus // Current operational status
}
// CircleConfig holds configuration settings for a circle
pub struct CircleConfig {
pub mut:
max_members u32 // Maximum number of members allowed
allow_guests bool // Whether to allow guest access
auto_approve bool // Whether new members are auto-approved
theme string // Visual theme identifier
}
// CircleStatus represents the operational status of a circle
pub enum CircleStatus {
active
inactive
suspended
archived
}

View File

@@ -0,0 +1,33 @@
module circle
import freeflowuniverse.herolib.hero.models.core
// Member represents a member within a circle
pub struct Member {
core.Base
pub mut:
circle_id u32 // Reference to the circle this member belongs to @[index]
user_id u32 // Reference to the user entity @[index]
role MemberRole // Member's role within the circle
status MemberStatus // Current membership status
joined_at u64 // Unix timestamp when member joined
invited_by u32 // User ID of who invited this member
permissions []string // List of custom permissions
}
// MemberRole defines the possible roles a member can have
pub enum MemberRole {
owner
admin
moderator
member
guest
}
// MemberStatus represents the current status of membership
pub enum MemberStatus {
active
pending
suspended
removed
}

View File

@@ -0,0 +1,27 @@
module circle
import freeflowuniverse.herolib.hero.models.core
// Name represents a domain name configuration for a circle
pub struct Name {
core.Base
pub mut:
circle_id u32 // Reference to the circle this name belongs to @[index]
domain string // The actual domain name @[index]
subdomain string // Optional subdomain
record_type NameType // Type of DNS record
value string // DNS record value/target
priority u32 // Priority for MX records
ttl u32 // Time to live in seconds
is_active bool // Whether this record is currently active
}
// NameType defines the supported DNS record types
pub enum NameType {
a
aaaa
cname
mx
txt
srv
}

View File

@@ -0,0 +1,33 @@
module circle
import freeflowuniverse.herolib.hero.models.core
// Wallet represents a wallet associated with a circle for financial operations
pub struct Wallet {
core.Base
pub mut:
circle_id u32 // Reference to the circle this wallet belongs to @[index]
address string // Blockchain address for this wallet @[index]
type WalletType // Type of wallet (custodial/non-custodial)
balance f64 // Current balance in the wallet
currency string // Currency type (e.g., "USD", "BTC", "ETH")
is_primary bool // Whether this is the primary wallet for the circle
status WalletStatus // Current wallet status
last_activity u64 // Unix timestamp of last transaction
}
// WalletType defines the types of wallets supported
pub enum WalletType {
custodial
non_custodial
hardware
software
}
// WalletStatus represents the operational status of a wallet
pub enum WalletStatus {
active
inactive
frozen
archived
}

View File

@@ -0,0 +1,12 @@
module core
// BaseData provides common fields for all models
pub struct Base {
pub mut:
id u32
created u64 // Unix timestamp of creation
updated u64 // Unix timestamp of last update
deleted bool
version u32
comments []Comment
}

View File

@@ -0,0 +1,20 @@
module core
// Comment represents a generic comment that can be associated with any model
// It supports threaded conversations with parent/child relationships
pub struct Comment {
pub mut:
// Unique identifier for the comment
id u32 // Unique identifier for the comment @[index]
// Timestamp when the comment was created
created_at u64 // Timestamp when the comment was created
// Timestamp when the comment was last updated
updated_at u64 // Timestamp when the comment was last updated
// ID of the user who posted this comment
user_id u32 // ID of the user who posted this comment @[index]
// The actual text content of the comment
content string
// Optional ID of the parent comment for threaded conversations
// None indicates this is a top-level comment
parent_comment_id u32
}

View File

@@ -0,0 +1,27 @@
module finance
import freeflowuniverse.herolib.hero.models.core
// Account represents a financial account for tracking balances and transactions
// Supports multiple account types (checking, savings, investment, etc.)
pub struct Account {
core.Base
pub mut:
name string // User-friendly account name
account_type AccountType
balance f64 // Current balance in the account's currency
currency string // Currency code (USD, EUR, etc.)
description string // Optional description of the account
is_active bool // Whether the account is currently active
}
// AccountType defines the different types of financial accounts
pub enum AccountType {
checking
savings
investment
credit
loan
crypto
other
}

View File

@@ -0,0 +1,34 @@
module finance
import freeflowuniverse.herolib.hero.models.core
// Asset represents any valuable resource owned by an entity
// Can be financial (stocks, bonds) or physical (real estate, commodities)
pub struct Asset {
core.Base
pub mut:
name string // Asset name or identifier
symbol string // Trading symbol or identifier @[index]
asset_type AssetType
quantity f64 // Amount of the asset held
unit_price f64 // Price per unit in the asset's currency
total_value f64 // total_value = quantity * unit_price
currency string // Currency for pricing (USD, EUR, etc.)
category string // Asset category (stocks, bonds, crypto, etc.)
exchange string // Exchange where asset is traded
description string // Detailed description of the asset
is_active bool // Whether the asset is currently tracked
purchase_date u64 // Unix timestamp of purchase/acquisition
}
// AssetType defines the classification of assets
pub enum AssetType {
stock
bond
crypto
commodity
real_estate
currency
nft
other
}

View File

@@ -0,0 +1,29 @@
module finance
import freeflowuniverse.herolib.hero.models.core
// Marketplace represents a platform for buying and selling goods/services
// Can be internal or external marketplace configurations
pub struct Marketplace {
core.Base
pub mut:
name string // Marketplace name (e.g., "Amazon", "eBay") @[index]
marketplace_type MarketplaceType
api_endpoint string // API endpoint for marketplace integration
api_key string // Authentication key for API access
currency string // Default currency for transactions
fee_percentage f64 // Marketplace fee as percentage (0.0-100.0)
is_active bool // Whether marketplace is currently enabled
description string // Detailed marketplace description
support_email string // Contact email for support issues
}
// MarketplaceType defines the type of marketplace platform
pub enum MarketplaceType {
centralized
decentralized
peer_to_peer
auction
classified
other
}

View File

@@ -0,0 +1,24 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// CommitteeMember represents a member of a committee
pub struct CommitteeMember {
core.Base
pub mut:
user_id u32
name string
role CommitteeRole
joined_date u64 // Unix timestamp
notes string
}
// Committee represents a committee in the governance system
pub struct Committee {
core.Base
pub mut:
company_id u32 @[index]
name string @[index]
description string
members []CommitteeMember
}

View File

@@ -0,0 +1,28 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// BusinessType represents the type of a business
pub struct BusinessType {
pub mut:
type_name string
description string
}
// Company represents a company in the governance system
pub struct Company {
core.Base
pub mut:
name string @[index]
registration_number string @[index]
incorporation_date u64 // Unix timestamp
fiscal_year_end string
email string
phone string
website string
address string
business_type BusinessType
industry string
description string
status CompanyStatus
}

View File

@@ -0,0 +1,30 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// Attendee represents an attendee of a meeting
pub struct Attendee {
pub mut:
user_id u32
name string
role string
status AttendanceStatus
notes string
}
// Meeting represents a meeting in the governance system
pub struct Meeting {
core.Base
pub mut:
company_id u32 @[index]
title string @[index]
description string
meeting_type MeetingType
status MeetingStatus
start_time u64 // Unix timestamp
end_time u64 // Unix timestamp
location string
agenda string
minutes string
attendees []Attendee
}

View File

@@ -0,0 +1,18 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// Resolution represents a resolution in the governance system
pub struct Resolution {
core.Base
pub mut:
company_id u32 @[index]
title string @[index]
description string
resolution_type ResolutionType
status ResolutionStatus
proposed_date u64 // Unix timestamp
effective_date ?u64 // Unix timestamp
expiry_date ?u64 // Unix timestamp
approvals []string
}

View File

@@ -0,0 +1,15 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// Shareholder represents a shareholder in the governance system
pub struct Shareholder {
core.Base
pub mut:
company_id u32 @[index]
name string @[index]
shareholder_type ShareholderType
contact_info string @[index]
shares u32
percentage f64
}

View File

@@ -0,0 +1,82 @@
module gov
pub enum CompanyStatus {
active
inactive
dissolved
suspended
pending
}
pub enum ShareholderType {
individual
corporate
trust
partnership
government
other
}
pub enum CommitteeRole {
chair
vice_chair
secretary
treasurer
member
observer
advisor
}
pub enum MeetingStatus {
scheduled
in_progress
completed
cancelled
}
pub enum MeetingType {
board_meeting
committee_meeting
general_assembly
annual_general_meeting
extraordinary_general_meeting
other
}
pub enum AttendanceStatus {
invited
confirmed
declined
attended
absent
}
pub enum ResolutionStatus {
draft
proposed
approved
rejected
expired
}
pub enum ResolutionType {
ordinary
special
unanimous
written
other
}
pub enum VoteStatus {
draft
open
closed
cancelled
}
pub enum VoteOption {
yes
no
abstain
custom
}

View File

@@ -0,0 +1,12 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// User represents a user in the governance system
pub struct User {
core.Base
pub mut:
name string @[index]
email string @[index]
role string
}

View File

@@ -0,0 +1,27 @@
module gov
import freeflowuniverse.herolib.hero.models.core
// Ballot represents a ballot cast in a vote
pub struct Ballot {
pub mut:
user_id u32
option VoteOption
weight f64
cast_at u64 // Unix timestamp
notes string
}
// Vote represents a vote in the governance system
pub struct Vote {
core.Base
pub mut:
company_id u32 @[index]
resolution_id u32 @[index]
title string @[index]
description string
status VoteStatus
start_date u64 // Unix timestamp
end_date u64 // Unix timestamp
ballots []Ballot
}

View File

@@ -0,0 +1,25 @@
module governance
import freeflowuniverse.herolib.hero.models.core
pub struct GovernanceActivity {
core.Base
pub mut:
company_id u32 // Reference to company @[index]
activity_type string // Type of activity (proposal, vote, meeting, etc.) @[index]
description string // Detailed description
initiator_id u32 // User who initiated @[index]
target_id u32 // Target entity ID
target_type string // Type of target (user, proposal, etc.)
metadata string // JSON metadata
}
// Activity types
pub enum ActivityType {
proposal_created
proposal_updated
vote_cast
meeting_scheduled
resolution_passed
shareholder_added
}

View File

@@ -0,0 +1,17 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// AttachedFile represents files attached to governance entities
pub struct AttachedFile {
core.Base
pub mut:
entity_id u32 // ID of entity this file is attached to @[index]
entity_type string // Type of entity (proposal, meeting, etc.) @[index]
filename string // Original filename
content_type string // MIME type
size u64 // File size in bytes
path string // Storage path
description string // Optional description
uploaded_by u32 // User who uploaded @[index]
}

View File

@@ -0,0 +1,39 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// CommitteeType defines committee categories
pub enum CommitteeType {
board
executive
audit
compensation
nomination
governance
finance
risk
other
}
// CommitteeStatus tracks committee state
pub enum CommitteeStatus {
active
inactive
dissolved
}
// Committee represents a governance committee
pub struct Committee {
core.Base
pub mut:
company_id u32 // Reference to company @[index]
name string // Committee name @[index]
committee_type CommitteeType // Type of committee
description string // Detailed description
status CommitteeStatus // Current state
chairman_id u32 // Committee chair @[index]
term_start u64 // Start of term
term_end u64 // End of term
meeting_frequency string // e.g., "monthly", "quarterly"
quorum_size u32 // Minimum members for quorum
}

View File

@@ -0,0 +1,45 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// CompanyType categorizes companies
pub enum CompanyType {
corporation
llc
partnership
cooperative
nonprofit
}
// CompanyStatus tracks company state
pub enum CompanyStatus {
active
inactive
dissolved
merged
acquired
}
// Company represents a governance entity
pub struct Company {
core.Base
pub mut:
name string // Company name @[index]
legal_name string // Legal entity name @[index]
company_type CompanyType // Type of company
status CompanyStatus // Current state
incorporation_date u64 // Unix timestamp
jurisdiction string // Country/state of incorporation
registration_number string // Government registration @[index]
tax_id string // Tax identification
address string // Primary address
headquarters string // City/country of HQ
website string // Company website
phone string // Contact phone
email string // Contact email
shares_authorized u64 // Total authorized shares
shares_issued u64 // Currently issued shares
par_value f64 // Par value per share
currency string // Currency code
fiscal_year_end string // "MM-DD" format
}

View File

@@ -0,0 +1,44 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// MeetingType defines meeting categories
pub enum MeetingType {
annual_general
extraordinary_general
board
committee
special
}
// MeetingStatus tracks meeting state
pub enum MeetingStatus {
scheduled
in_progress
completed
cancelled
postponed
}
// Meeting represents a governance meeting
pub struct Meeting {
core.Base
pub mut:
company_id u32 // Reference to company @[index]
committee_id u32 // Reference to committee @[index]
meeting_type MeetingType // Type of meeting
title string // Meeting title @[index]
description string // Detailed description
status MeetingStatus // Current state
scheduled_start u64 // Scheduled start time
scheduled_end u64 // Scheduled end time
actual_start u64 // Actual start time
actual_end u64 // Actual end time
location string // Physical/virtual location
meeting_url string // Video conference link
agenda string // Meeting agenda
minutes string // Meeting minutes
quorum_required u32 // Members required for quorum
quorum_present bool // Whether quorum was achieved
created_by u32 // User who scheduled @[index]
}

View File

@@ -0,0 +1,47 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// ProposalStatus tracks the state of a governance proposal
pub enum ProposalStatus {
draft
pending_review
active
voting
passed
rejected
implemented
cancelled
}
// ProposalType categorizes proposals
pub enum ProposalType {
constitutional
policy
budget
election
merger
dissolution
other
}
// Proposal represents a governance proposal
pub struct Proposal {
core.Base
pub mut:
company_id u32 // Reference to company @[index]
title string // Proposal title @[index]
description string // Detailed description
proposal_type ProposalType // Category of proposal
status ProposalStatus // Current state
proposer_id u32 // User who created @[index]
target_committee_id u32 // Target committee @[index]
voting_start u64 // Start timestamp
voting_end u64 // End timestamp
quorum_required f64 // Percentage required
approval_threshold f64 // Percentage for approval
votes_for u32 // Votes in favor
votes_against u32 // Votes against
votes_abstain u32 // Abstention votes
implementation_notes string // Post-implementation notes
}

View File

@@ -0,0 +1,40 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// ResolutionStatus tracks resolution state
pub enum ResolutionStatus {
proposed
voting
passed
failed
implemented
withdrawn
}
// ResolutionType categorizes resolutions
pub enum ResolutionType {
ordinary
special
unanimous
}
// Resolution represents a formal resolution
pub struct Resolution {
core.Base
pub mut:
company_id u32 // Reference to company @[index]
meeting_id u32 // Reference to meeting @[index]
proposal_id u32 // Reference to proposal @[index]
resolution_number string // Unique resolution number @[index]
title string // Resolution title @[index]
description string // Detailed description
resolution_type ResolutionType // Category
status ResolutionStatus // Current state
mover_id u32 // Person who moved @[index]
seconder_id u32 // Person who seconded @[index]
votes_for u32 // Votes in favor
votes_against u32 // Votes against
votes_abstain u32 // Abstention votes
effective_date u64 // When resolution takes effect
}

View File

@@ -0,0 +1,48 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// UserType defines user categories
pub enum UserType {
individual
corporate
system
}
// UserStatus tracks user state
pub enum UserStatus {
active
inactive
suspended
pending
}
// UserRole defines governance roles
pub enum UserRole {
shareholder
director
officer
employee
auditor
consultant
administrator
}
// User represents a governance participant
pub struct User {
core.Base
pub mut:
username string // Unique username @[index]
email string // Email address @[index]
first_name string // First name
last_name string // Last name
display_name string // Preferred display name
user_type UserType // Type of user
status UserStatus // Current state
roles []UserRole // Governance roles
company_id u32 // Primary company @[index]
phone string // Contact phone
address string // Contact address
profile_picture string // Profile picture URL
last_login u64 // Last login timestamp
}

View File

@@ -0,0 +1,34 @@
module governance
import freeflowuniverse.herolib.hero.models.core
// VoteValue represents voting choices
pub enum VoteValue {
yes
no
abstain
}
// VoteStatus tracks vote state
pub enum VoteStatus {
pending
cast
changed
retracted
}
// Vote represents a governance vote
pub struct Vote {
core.Base
pub mut:
proposal_id u32 // Reference to proposal @[index]
resolution_id u32 // Reference to resolution @[index]
voter_id u32 // User who voted @[index]
company_id u32 // Reference to company @[index]
vote_value VoteValue // Voting choice
status VoteStatus // Current state
weight u32 // Vote weight (for weighted voting)
comments string // Optional comments
proxy_voter_id u32 // If voting by proxy @[index]
ip_address string // IP address for verification
}

View File

@@ -0,0 +1,55 @@
module legal
import freeflowuniverse.herolib.hero.models.core
// ContractStatus represents the current state of a legal contract
pub enum ContractStatus {
draft
pending
active
expired
terminated
cancelled
}
// ContractType categorizes the type of legal agreement
pub enum ContractType {
service
sales
lease
employment
partnership
nda
other
}
// Contract represents a legal agreement between parties
// This model stores essential information about contracts including parties, terms, and status
pub struct Contract {
core.Base
pub mut:
title string // Human-readable title of the contract @[index]
contract_type ContractType // Type/category of the contract
status ContractStatus // Current status of the contract
party_a string // First party identifier (company, individual, etc.) @[index]
party_b string // Second party identifier @[index]
effective_date u64 // Unix timestamp when contract becomes effective
expiration_date u64 // Unix timestamp when contract expires
total_value f64 // Monetary value of the contract
currency string // Currency code (USD, EUR, etc.)
terms string // Full text of the contract terms
signature_date u64 // Unix timestamp when contract was signed
version string // Version identifier for contract revisions
parent_contract_id ?u32 // Optional reference to parent contract for amendments @[index]
attachment_urls []string // URLs or paths to attached documents
notes string // Additional notes and comments
}

View File

@@ -0,0 +1,30 @@
module library
import freeflowuniverse.herolib.hero.models.core
// TocEntry represents a table of contents entry for a book
pub struct TocEntry {
// Title of the chapter/section
title string
// Page number (index in the pages array)
page u32
// Optional subsections
subsections []TocEntry
}
// Book represents a Book library item (collection of markdown pages with TOC)
pub struct Book {
core.Base // Title of the book
title string @[index]
// Optional description of the book
description ?string
// Table of contents
table_of_contents []TocEntry
// Pages content (markdown strings)
pages []string
}

View File

@@ -0,0 +1,27 @@
module library
import freeflowuniverse.herolib.hero.models.core
// Collection represents a collection of library items
pub struct Collection {
core.Base // Title of the collection
title string @[index]
// Optional description of the collection
description ?string
// List of image item IDs belonging to this collection
images []u32
// List of PDF item IDs belonging to this collection
pdfs []u32
// List of Markdown item IDs belonging to this collection
markdowns []u32
// List of Book item IDs belonging to this collection
books []u32
// List of Slides item IDs belonging to this collection
slides []u32
}

View File

@@ -0,0 +1,21 @@
module library
import freeflowuniverse.herolib.hero.models.core
// Image represents an Image library item
pub struct Image {
core.Base // Title of the image
title string @[index]
// Optional description of the image
description ?string
// URL of the image
url string
// Width of the image in pixels
width u32
// Height of the image in pixels
height u32
}

View File

@@ -0,0 +1,15 @@
module library
import freeflowuniverse.herolib.hero.models.core
// Markdown represents a Markdown document library item
pub struct Markdown {
core.Base // Title of the document
title string @[index]
// Optional description of the document
description ?string
// The markdown content
content string
}

View File

@@ -0,0 +1,18 @@
module library
import freeflowuniverse.herolib.hero.models.core
// Pdf represents a PDF document library item
pub struct Pdf {
core.Base // Title of the PDF
title string @[index]
// Optional description of the PDF
description ?string
// URL of the PDF file
url string
// Number of pages in the PDF
page_count u32
}

View File

@@ -0,0 +1,27 @@
module library
import freeflowuniverse.herolib.hero.models.core
// Slide represents a single slide in a slideshow
pub struct Slide {
// URL of the image for this slide
image_url string
// Optional title for the slide
title ?string
// Optional description for the slide
description ?string
}
// Slideshow represents a Slideshow library item (collection of images for slideshow)
pub struct Slideshow {
core.Base // Title of the slideshow
title string @[index]
// Optional description of the slideshow
description ?string
// List of slides
slides []Slide
}

View File

@@ -0,0 +1,57 @@
module projects
import freeflowuniverse.herolib.hero.models.core
// Priority levels for project items
pub enum Priority {
critical
high
medium
low
none
}
// Status values for project lifecycle
pub enum Status {
todo
in_progress
review
done
archived
}
// Types of items in the project hierarchy
pub enum ItemType {
epic
story
task
bug
improvement
feature
}
// Project represents a high-level container for organizing work
// A Project holds information about its members and contains lists of associated epics, sprints, and boards
pub struct Project {
core.Base
pub mut:
name string @[index] // Project name
description string // Detailed project description
owner_id u64 @[index] // User ID of the project owner
member_ids []u64 @[index] // List of user IDs who are members
board_ids []u64 // List of associated board IDs
sprint_ids []u64 @[index] // List of sprint IDs in this project
epic_ids []u64 @[index] // List of epic IDs in this project
tags []string @[index] // Project tags for categorization
status Status @[index] // Current project status
priority Priority @[index] // Project priority level
item_type ItemType @[index] // Type of project item
}
// Label represents a tag with name and color for categorization
pub struct Label {
core.Base
pub mut:
name string @[index] // Label name
color string @[index] // Hex color code for the label
}

View File

@@ -0,0 +1,18 @@
module projects
import freeflowuniverse.herolib.hero.models.core
// Epic represents a large body of work or major feature
// An Epic is broken down into smaller tasks and can be associated with a project
pub struct Epic {
core.Base
pub mut:
name string @[index] // Epic name
description string // Detailed epic description
status Status @[index] // Current epic status
project_id u64 @[index] // Link to parent project
start_date u64 // Epic start timestamp (Unix)
due_date u64 // Epic due timestamp (Unix)
tags []string @[index] // Epic tags for categorization
child_task_ids []u64 @[index] // List of task IDs belonging to this epic
}

View File

@@ -0,0 +1,26 @@
module projects
import freeflowuniverse.herolib.hero.models.core
// SprintStatus defines the possible states of a sprint
pub enum SprintStatus {
planning
active
completed
paused
}
// Sprint represents a time-boxed iteration for completing work
// Typically used in agile methodologies (e.g., two-week sprints)
pub struct Sprint {
core.Base
pub mut:
name string @[index] // Sprint name
description string // Sprint description
status SprintStatus @[index] // Current sprint status
goal string // Sprint goal/objective
project_id u64 @[index] // Link to parent project
start_date u64 // Sprint start timestamp (Unix)
end_date u64 // Sprint end timestamp (Unix)
task_ids []u64 @[index] // List of task IDs in this sprint
}

View File

@@ -0,0 +1,42 @@
module projects
import freeflowuniverse.herolib.hero.models.core
// TaskStatus defines the possible states of a task
pub enum TaskStatus {
todo
in_progress
in_review
done
blocked
backlog
}
// TaskPriority defines the priority levels for tasks
pub enum TaskPriority {
low
medium
high
urgent
}
// Task represents the most granular unit of work
// Tasks can be linked to projects, epics, and sprints
pub struct Task {
core.Base
pub mut:
title string @[index] // Task title
description string // Task description
status TaskStatus @[index] // Current task status
priority TaskPriority @[index] // Task priority level
assignee_id u64 @[index] // User ID of task assignee
reporter_id u64 @[index] // User ID of task reporter
parent_task_id u64 // For subtasks - parent task ID
epic_id u64 @[index] // Link to parent epic
sprint_id u64 @[index] // Link to parent sprint
project_id u64 @[index] // Link to parent project
due_date u64 // Task due timestamp (Unix)
estimated_time_hours f32 // Estimated hours to complete
logged_time_hours f32 // Actual hours logged
tags []string @[index] // Task tags for categorization
}