Update git remote URL from git.threefold.info to git.ourworld.tf

This commit is contained in:
2025-08-04 10:44:17 +02:00
parent 0cf66642a2
commit aa7e79d26c
85 changed files with 1865 additions and 392 deletions

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

@@ -1,62 +1,47 @@
module governance
import base
import freeflowuniverse.herolib.data.ourtime
// ProposalStatus enum is used from governance_enums.v in the same module
import freeflowuniverse.herolib.hero.models.core
// Proposal represents a governance proposal that can be voted upon.
// It now incorporates the voting mechanism from biz/vote.v.
pub struct Proposal {
base.Base // Provides Proposal's own ID, created_at, updated_at
pub mut:
// Fields from original Proposal struct
creator_id string // User ID of the proposal creator
title string // Title of the proposal
description string // Detailed description of the proposal
status ProposalStatus // Status of the proposal lifecycle (draft, active, approved etc.)
// Fields from biz/vote.v's Vote struct (representing the voting event aspects of the proposal)
vote_start_date ourtime.OurTime // When voting on this proposal starts
vote_end_date ourtime.OurTime // When voting on this proposal ends
vote_status VoteEventStatus // Status of the voting event (open, closed, cancelled)
options []VoteOption // The choices users can vote for
ballots []Ballot // The cast votes by users
private_group []u32 // Optional: list of user IDs who are eligible to vote
}
// ProposalStatus defines the lifecycle status of a governance proposal itself
// ProposalStatus tracks the state of a governance proposal
pub enum ProposalStatus {
draft // Proposal is being prepared
active // Proposal is active (might be pre-voting, during voting, or post-voting but not yet finalized)
approved // Proposal has been formally approved
rejected // Proposal has been formally rejected
cancelled// Proposal was cancelled
draft
pending_review
active
voting
passed
rejected
implemented
cancelled
}
// -- Structures from biz/vote.v, adapted for integration --
// VoteEventStatus represents the status of the voting process for a proposal
// Renamed from VoteStatus in biz/vote.v to avoid confusion with ProposalStatus
pub enum VoteEventStatus {
open // Voting is currently open
closed // Voting has finished
cancelled // The voting event was cancelled
// ProposalType categorizes proposals
pub enum ProposalType {
constitutional
policy
budget
election
merger
dissolution
other
}
// VoteOption represents a specific choice that can be voted on within a proposal's voting event
pub struct VoteOption {
// Proposal represents a governance proposal
pub struct Proposal {
core.Base
pub mut:
id u8 // Simple identifier for this option within this proposal's vote (e.g., 1, 2, 3)
text string // The descriptive text of the option (e.g., "Option A: Approve budget")
count int // How many votes this option has received
min_valid int // Optional: minimum votes needed for this option to be considered valid
}
// Ballot represents an individual vote cast by a user for a specific proposal
pub struct Ballot {
base.Base // Provides Ballot's own ID, created_at, updated_at
pub mut:
user_id u32 // The ID of the user who cast this ballot
vote_option_id u8 // The 'id' of the VoteOption chosen by the user
shares_count int // Number of shares/tokens/voting power used for this ballot
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
}