...
This commit is contained in:
9
.kilocode/mcp.json
Normal file
9
.kilocode/mcp.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"chat.mcp.discovery.enabled": true,
|
||||||
|
"mcpServers": {
|
||||||
|
"VSCode": {
|
||||||
|
"type": "internal",
|
||||||
|
"tools": ["chat_send", "apply_edits", "read_file", "write_file", "get_file_tree"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
0
.kilocode/rules-orchestrator/rules.md
Normal file
0
.kilocode/rules-orchestrator/rules.md
Normal file
@@ -1,39 +0,0 @@
|
|||||||
generate specs for /Users/despiegk/code/github/freeflowuniverse/herolib/lib/circles/actions
|
|
||||||
|
|
||||||
use mcp
|
|
||||||
|
|
||||||
get the output of it un actions/specs.v
|
|
||||||
|
|
||||||
then use these specs.v
|
|
||||||
|
|
||||||
to generate play command instructions see @3_heroscript_vlang.md
|
|
||||||
|
|
||||||
this play command gets heroscript in and will then call the methods for actions as are ONLY in @lib/circles/actions/db
|
|
||||||
|
|
||||||
so the play only calls the methods in @lib/circles/actions/db
|
|
||||||
|
|
||||||
|
|
||||||
# put the play commands in
|
|
||||||
|
|
||||||
/Users/despiegk/code/github/freeflowuniverse/herolib/lib/circles/actions/play
|
|
||||||
|
|
||||||
do one file in the module per action
|
|
||||||
|
|
||||||
each method is an action
|
|
||||||
|
|
||||||
put them all on one Struct called Player
|
|
||||||
in this Player we have a method per action
|
|
||||||
|
|
||||||
Player has a property called actor: which is the name of the actor as is used in the heroscript
|
|
||||||
Player has also a output called return format which is enum for heroscript or json
|
|
||||||
|
|
||||||
input of the method - action is a params object
|
|
||||||
|
|
||||||
on player there is a method play which takes the text as input or playbook
|
|
||||||
|
|
||||||
if text then playbook is created
|
|
||||||
|
|
||||||
then we walk over all actions
|
|
||||||
|
|
||||||
all the ones starting with actions in this case are given to the right method
|
|
||||||
|
|
||||||
224
lib/hero/db/hero_db/hero_db.v
Normal file
224
lib/hero/db/hero_db/hero_db.v
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
module hero_db
|
||||||
|
|
||||||
|
import json
|
||||||
|
import freeflowuniverse.herolib.clients.postgresql_client
|
||||||
|
import freeflowuniverse.herolib.core.texttools
|
||||||
|
import time
|
||||||
|
|
||||||
|
// Generic database interface for Hero root objects
|
||||||
|
pub struct HeroDB[T] {
|
||||||
|
db_client &postgresql_client.PostgresClient
|
||||||
|
table_name string
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize a new HeroDB instance for a specific type
|
||||||
|
pub fn new[T](client &postgresql_client.PostgresClient) HeroDB[T] {
|
||||||
|
mut table_name := '${texttools.snake_case(T.name)}s'
|
||||||
|
// Map dirname from module path
|
||||||
|
module_path := T.name.split('.')
|
||||||
|
if module_path.len >= 2 {
|
||||||
|
dirname := texttools.snake_case(module_path[module_path.len - 2])
|
||||||
|
table_name = '${dirname}_${texttools.snake_case(T.name)}'
|
||||||
|
}
|
||||||
|
|
||||||
|
return HeroDB[T]{
|
||||||
|
db_client: client
|
||||||
|
table_name: table_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure table exists with proper schema
|
||||||
|
pub fn (mut self HeroDB[T]) ensure_table() ! {
|
||||||
|
// Get index fields from struct reflection
|
||||||
|
index_fields := self.get_index_fields()
|
||||||
|
|
||||||
|
// Build index column definitions
|
||||||
|
mut index_cols := []string{}
|
||||||
|
for field in index_fields {
|
||||||
|
index_cols << '${field} varchar(255)'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create table with JSON storage
|
||||||
|
create_sql := '
|
||||||
|
CREATE TABLE IF NOT EXISTS ${self.table_name} (
|
||||||
|
id serial PRIMARY KEY,
|
||||||
|
${index_cols.join(', ')},
|
||||||
|
data jsonb NOT NULL,
|
||||||
|
created_at timestamp DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at timestamp DEFAULT CURRENT_TIMESTAMP
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
|
self.db_client.exec(create_sql)!
|
||||||
|
|
||||||
|
// Create indexes on index fields
|
||||||
|
for field in index_fields {
|
||||||
|
index_sql := 'CREATE INDEX IF NOT EXISTS idx_${self.table_name}_${field} ON ${self.table_name}(${field})'
|
||||||
|
self.db_client.exec(index_sql)!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get index fields marked with @[index] from struct
|
||||||
|
fn (self HeroDB[T]) get_index_fields() []string {
|
||||||
|
mut fields := []string{}
|
||||||
|
$for field in T.fields {
|
||||||
|
$if field.attributes.len > 0 {
|
||||||
|
$for attr in field.attributes {
|
||||||
|
$if attr == 'index' {
|
||||||
|
fields << texttools.snake_case(field.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fields
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save object to database
|
||||||
|
pub fn (mut self HeroDB[T]) save(obj &T) ! {
|
||||||
|
// Get index values from object
|
||||||
|
index_data := self.extract_index_values(obj)
|
||||||
|
|
||||||
|
// Serialize to JSON
|
||||||
|
json_data := json.encode_pretty(obj)
|
||||||
|
|
||||||
|
// Check if object already exists
|
||||||
|
mut query := 'SELECT id FROM ${self.table_name} WHERE '
|
||||||
|
mut params := []string{}
|
||||||
|
|
||||||
|
// Build WHERE clause for unique lookup
|
||||||
|
for key, value in index_data {
|
||||||
|
params << '${key} = \'${value}\''
|
||||||
|
}
|
||||||
|
query += params.join(' AND ')
|
||||||
|
|
||||||
|
existing := self.db_client.exec(query)!
|
||||||
|
|
||||||
|
if existing.len > 0 {
|
||||||
|
// Update existing record
|
||||||
|
id := existing[0].vals[0].int()
|
||||||
|
update_sql := '
|
||||||
|
UPDATE ${self.table_name}
|
||||||
|
SET data = \$1, updated_at = CURRENT_TIMESTAMP
|
||||||
|
WHERE id = \$2
|
||||||
|
'
|
||||||
|
self.db_client.exec(update_sql.replace('\$1', "'${json_data}'").replace('\$2', id.str()))!
|
||||||
|
} else {
|
||||||
|
// Insert new record
|
||||||
|
mut columns := []string{}
|
||||||
|
mut values := []string{}
|
||||||
|
|
||||||
|
// Add index columns
|
||||||
|
for key, value in index_data {
|
||||||
|
columns << key
|
||||||
|
values << "'${value}'"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add JSON data
|
||||||
|
columns << 'data'
|
||||||
|
values << "'${json_data}'"
|
||||||
|
|
||||||
|
insert_sql := '
|
||||||
|
INSERT INTO ${self.table_name} (${columns.join(', ')})
|
||||||
|
VALUES (${values.join(', ')})
|
||||||
|
'
|
||||||
|
self.db_client.exec(insert_sql)!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get object by index values
|
||||||
|
pub fn (mut self HeroDB[T]) get_by_index(index_values map[string]string) !&T {
|
||||||
|
mut query := 'SELECT data FROM ${self.table_name} WHERE '
|
||||||
|
mut params := []string{}
|
||||||
|
|
||||||
|
for key, value in index_values {
|
||||||
|
params << '${key} = \'${value}\''
|
||||||
|
}
|
||||||
|
query += params.join(' AND ')
|
||||||
|
|
||||||
|
rows := self.db_client.exec(query)!
|
||||||
|
if rows.len == 0 {
|
||||||
|
return error('${T.name} not found with index values: ${index_values}')
|
||||||
|
}
|
||||||
|
|
||||||
|
json_data := rows[0].vals[0].str()
|
||||||
|
mut obj := json.decode(T, json_data) or {
|
||||||
|
return error('Failed to decode JSON: ${err}')
|
||||||
|
}
|
||||||
|
|
||||||
|
return &obj
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get all objects
|
||||||
|
pub fn (mut self HeroDB[T]) get_all() ![]&T {
|
||||||
|
query := 'SELECT data FROM ${self.table_name} ORDER BY id DESC'
|
||||||
|
rows := self.db_client.exec(query)!
|
||||||
|
|
||||||
|
mut results := []&T{}
|
||||||
|
for row in rows {
|
||||||
|
json_data := row.vals[0].str()
|
||||||
|
obj := json.decode(T, json_data) or {
|
||||||
|
continue // Skip invalid JSON
|
||||||
|
}
|
||||||
|
results << &obj
|
||||||
|
}
|
||||||
|
|
||||||
|
return results
|
||||||
|
}
|
||||||
|
|
||||||
|
// Search by index field
|
||||||
|
pub fn (mut self HeroDB[T]) search_by_index(field_name string, value string) ![]&T {
|
||||||
|
query := 'SELECT data FROM ${self.table_name} WHERE ${field_name} = \'${value}\' ORDER BY id DESC'
|
||||||
|
rows := self.db_client.exec(query)!
|
||||||
|
|
||||||
|
mut results := []&T{}
|
||||||
|
for row in rows {
|
||||||
|
json_data := row.vals[0].str()
|
||||||
|
obj := json.decode(T, json_data) or {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
results << &obj
|
||||||
|
}
|
||||||
|
|
||||||
|
return results
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete by index values
|
||||||
|
pub fn (mut self HeroDB[T]) delete_by_index(index_values map[string]string) ! {
|
||||||
|
mut query := 'DELETE FROM ${self.table_name} WHERE '
|
||||||
|
mut params := []string{}
|
||||||
|
|
||||||
|
for key, value in index_values {
|
||||||
|
params << '${key} = \'${value}\''
|
||||||
|
}
|
||||||
|
query += params.join(' AND ')
|
||||||
|
|
||||||
|
self.db_client.exec(query)!
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper to extract index values from object
|
||||||
|
fn (self HeroDB[T]) extract_index_values(obj &T) map[string]string {
|
||||||
|
mut index_data := map[string]string{}
|
||||||
|
|
||||||
|
$for field in T.fields {
|
||||||
|
$if field.attributes.len > 0 {
|
||||||
|
$for attr in field.attributes {
|
||||||
|
$if attr == 'index' {
|
||||||
|
field_name := texttools.snake_case(field.name)
|
||||||
|
$if field.typ is string {
|
||||||
|
value := obj.$(field.name).str()
|
||||||
|
index_data[field_name] = value
|
||||||
|
} $else $if field.typ is u32 || field.typ is u64 {
|
||||||
|
value := obj.$(field.name).str()
|
||||||
|
index_data[field_name] = value
|
||||||
|
} $else {
|
||||||
|
// Convert other types to string
|
||||||
|
value := obj.$(field.name).str()
|
||||||
|
index_data[field_name] = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return index_data
|
||||||
|
}
|
||||||
36
lib/hero/db/hero_db/readme.md
Normal file
36
lib/hero/db/hero_db/readme.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```v
|
||||||
|
// Example usage:
|
||||||
|
// Initialize database client
|
||||||
|
mut db_client := postgresql_client.get(name: "default")!
|
||||||
|
|
||||||
|
// Create HeroDB for Circle type
|
||||||
|
mut circle_db := hero_db.new[circle.Circle](db_client)!
|
||||||
|
circle_db.ensure_table()!
|
||||||
|
|
||||||
|
// Create and save a circle
|
||||||
|
mut my_circle := circle.Circle{
|
||||||
|
name: "Tech Community"
|
||||||
|
description: "A community for tech enthusiasts"
|
||||||
|
domain: "tech.example.com"
|
||||||
|
config: circle.CircleConfig{
|
||||||
|
max_members: 1000
|
||||||
|
allow_guests: true
|
||||||
|
auto_approve: false
|
||||||
|
theme: "modern"
|
||||||
|
}
|
||||||
|
status: circle.CircleStatus.active
|
||||||
|
}
|
||||||
|
|
||||||
|
circle_db.save(&my_circle)!
|
||||||
|
|
||||||
|
// Retrieve the circle
|
||||||
|
retrieved_circle := circle_db.get_by_index({
|
||||||
|
"domain": "tech.example.com"
|
||||||
|
})!
|
||||||
|
|
||||||
|
// Search circles by status
|
||||||
|
active_circles := circle_db.search_by_index("status", "active")!
|
||||||
|
```
|
||||||
@@ -4,35 +4,35 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Company represents a business entity with all necessary details
|
// Company represents a business entity with all necessary details
|
||||||
pub struct Company {
|
pub struct Company {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string // Company legal name @[index: 'company_name_idx']
|
name string // Company legal name @[index: 'company_name_idx']
|
||||||
registration_number string // Official registration number @[index: 'company_reg_idx']
|
registration_number string // Official registration number @[index: 'company_reg_idx']
|
||||||
incorporation_date u64 // Unix timestamp
|
incorporation_date u64 // Unix timestamp
|
||||||
fiscal_year_end string // Format: MM-DD
|
fiscal_year_end string // Format: MM-DD
|
||||||
email string
|
email string
|
||||||
phone string
|
phone string
|
||||||
website string
|
website string
|
||||||
address string
|
address string
|
||||||
business_type BusinessType
|
business_type BusinessType
|
||||||
industry string // Industry classification
|
industry string // Industry classification
|
||||||
description string // Company description
|
description string // Company description
|
||||||
status CompanyStatus
|
status CompanyStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompanyStatus tracks the operational state of a company
|
// CompanyStatus tracks the operational state of a company
|
||||||
pub enum CompanyStatus {
|
pub enum CompanyStatus {
|
||||||
pending_payment
|
pending_payment
|
||||||
active
|
active
|
||||||
suspended
|
suspended
|
||||||
inactive
|
inactive
|
||||||
}
|
}
|
||||||
|
|
||||||
// BusinessType categorizes the company structure
|
// BusinessType categorizes the company structure
|
||||||
pub enum BusinessType {
|
pub enum BusinessType {
|
||||||
coop
|
coop
|
||||||
single
|
single
|
||||||
twin
|
twin
|
||||||
starter
|
starter
|
||||||
global
|
global
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,25 +4,25 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Payment handles financial transactions for companies
|
// Payment handles financial transactions for companies
|
||||||
pub struct Payment {
|
pub struct Payment {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
payment_intent_id string // Stripe payment intent ID @[index: 'payment_intent_idx']
|
payment_intent_id string // Stripe payment intent ID @[index: 'payment_intent_idx']
|
||||||
company_id u32 // Associated company @[index: 'payment_company_idx']
|
company_id u32 // Associated company @[index: 'payment_company_idx']
|
||||||
payment_plan string // monthly/yearly/two_year
|
payment_plan string // monthly/yearly/two_year
|
||||||
setup_fee f64
|
setup_fee f64
|
||||||
monthly_fee f64
|
monthly_fee f64
|
||||||
total_amount f64
|
total_amount f64
|
||||||
currency string // Default: usd
|
currency string // Default: usd
|
||||||
status PaymentStatus
|
status PaymentStatus
|
||||||
stripe_customer_id string
|
stripe_customer_id string
|
||||||
completed_at u64 // Unix timestamp
|
completed_at u64 // Unix timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaymentStatus tracks the lifecycle of a payment
|
// PaymentStatus tracks the lifecycle of a payment
|
||||||
pub enum PaymentStatus {
|
pub enum PaymentStatus {
|
||||||
pending
|
pending
|
||||||
processing
|
processing
|
||||||
completed
|
completed
|
||||||
failed
|
failed
|
||||||
refunded
|
refunded
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,36 +4,36 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Product represents goods or services offered by a company
|
// Product represents goods or services offered by a company
|
||||||
pub struct Product {
|
pub struct Product {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string
|
name string
|
||||||
description string
|
description string
|
||||||
price f64
|
price f64
|
||||||
type_ ProductType
|
type_ ProductType
|
||||||
category string
|
category string
|
||||||
status ProductStatus
|
status ProductStatus
|
||||||
max_amount u16
|
max_amount u16
|
||||||
purchase_till u64 // Unix timestamp
|
purchase_till u64 // Unix timestamp
|
||||||
active_till u64 // Unix timestamp
|
active_till u64 // Unix timestamp
|
||||||
components []ProductComponent
|
components []ProductComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductComponent represents sub-parts of a complex product
|
// ProductComponent represents sub-parts of a complex product
|
||||||
pub struct ProductComponent {
|
pub struct ProductComponent {
|
||||||
pub mut:
|
pub mut:
|
||||||
name string
|
name string
|
||||||
description string
|
description string
|
||||||
quantity u32
|
quantity u32
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductType differentiates between products and services
|
// ProductType differentiates between products and services
|
||||||
pub enum ProductType {
|
pub enum ProductType {
|
||||||
product
|
product
|
||||||
service
|
service
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductStatus indicates availability
|
// ProductStatus indicates availability
|
||||||
pub enum ProductStatus {
|
pub enum ProductStatus {
|
||||||
available
|
available
|
||||||
unavailable
|
unavailable
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,32 +4,32 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Sale represents a transaction linking buyers to products
|
// Sale represents a transaction linking buyers to products
|
||||||
pub struct Sale {
|
pub struct Sale {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32
|
company_id u32
|
||||||
buyer_id u32
|
buyer_id u32
|
||||||
transaction_id u32
|
transaction_id u32
|
||||||
total_amount f64
|
total_amount f64
|
||||||
status SaleStatus
|
status SaleStatus
|
||||||
sale_date u64 // Unix timestamp
|
sale_date u64 // Unix timestamp
|
||||||
items []SaleItem
|
items []SaleItem
|
||||||
notes string
|
notes string
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaleItem captures product details at time of sale
|
// SaleItem captures product details at time of sale
|
||||||
pub struct SaleItem {
|
pub struct SaleItem {
|
||||||
pub mut:
|
pub mut:
|
||||||
product_id u32
|
product_id u32
|
||||||
name string // Product name snapshot
|
name string // Product name snapshot
|
||||||
quantity i32
|
quantity i32
|
||||||
unit_price f64
|
unit_price f64
|
||||||
subtotal f64
|
subtotal f64
|
||||||
service_active_until u64 // Optional service expiry
|
service_active_until u64 // Optional service expiry
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaleStatus tracks transaction state
|
// SaleStatus tracks transaction state
|
||||||
pub enum SaleStatus {
|
pub enum SaleStatus {
|
||||||
pending
|
pending
|
||||||
completed
|
completed
|
||||||
cancelled
|
cancelled
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Shareholder tracks company ownership details
|
// Shareholder tracks company ownership details
|
||||||
pub struct Shareholder {
|
pub struct Shareholder {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32
|
company_id u32
|
||||||
user_id u32
|
user_id u32
|
||||||
name string
|
name string
|
||||||
shares f64
|
shares f64
|
||||||
percentage f64
|
percentage f64
|
||||||
type_ ShareholderType
|
type_ ShareholderType
|
||||||
since u64 // Unix timestamp
|
since u64 // Unix timestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShareholderType distinguishes between individual and corporate owners
|
// ShareholderType distinguishes between individual and corporate owners
|
||||||
pub enum ShareholderType {
|
pub enum ShareholderType {
|
||||||
individual
|
individual
|
||||||
corporate
|
corporate
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Calendar represents a calendar with events and scheduling capabilities
|
// Calendar represents a calendar with events and scheduling capabilities
|
||||||
pub struct Calendar {
|
pub struct Calendar {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index]
|
name string @[index]
|
||||||
description string
|
description string
|
||||||
color string // hex color code
|
color string // hex color code
|
||||||
timezone string
|
timezone string
|
||||||
owner_id u32 @[index]
|
owner_id u32 @[index]
|
||||||
is_public bool
|
is_public bool
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,33 +4,33 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Contact represents a contact or address book entry
|
// Contact represents a contact or address book entry
|
||||||
pub struct Contact {
|
pub struct Contact {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index]
|
name string @[index]
|
||||||
email string @[index]
|
email string @[index]
|
||||||
phone string
|
phone string
|
||||||
address string
|
address string
|
||||||
company string
|
company string
|
||||||
job_title string
|
job_title string
|
||||||
notes string
|
notes string
|
||||||
tags []string
|
tags []string
|
||||||
birthday u64
|
birthday u64
|
||||||
is_favorite bool
|
is_favorite bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContactGroup represents a group of contacts
|
// ContactGroup represents a group of contacts
|
||||||
pub struct ContactGroup {
|
pub struct ContactGroup {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index]
|
name string @[index]
|
||||||
description string
|
description string
|
||||||
color string
|
color string
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContactGroupMembership links contacts to groups
|
// ContactGroupMembership links contacts to groups
|
||||||
pub struct ContactGroupMembership {
|
pub struct ContactGroupMembership {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
contact_id u32 @[index]
|
contact_id u32 @[index]
|
||||||
group_id u32 @[index]
|
group_id u32 @[index]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,50 +4,50 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// EventStatus represents the current status of an event
|
// EventStatus represents the current status of an event
|
||||||
pub enum EventStatus {
|
pub enum EventStatus {
|
||||||
scheduled
|
scheduled
|
||||||
ongoing
|
ongoing
|
||||||
completed
|
completed
|
||||||
cancelled
|
cancelled
|
||||||
postponed
|
postponed
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventType categorizes different types of events
|
// EventType categorizes different types of events
|
||||||
pub enum EventType {
|
pub enum EventType {
|
||||||
meeting
|
meeting
|
||||||
appointment
|
appointment
|
||||||
reminder
|
reminder
|
||||||
task
|
task
|
||||||
call
|
call
|
||||||
conference
|
conference
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event represents a calendar event
|
// Event represents a calendar event
|
||||||
pub struct Event {
|
pub struct Event {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
calendar_id u32 @[index]
|
calendar_id u32 @[index]
|
||||||
title string @[index]
|
title string @[index]
|
||||||
description string
|
description string
|
||||||
start_time u64 @[index]
|
start_time u64 @[index]
|
||||||
end_time u64 @[index]
|
end_time u64 @[index]
|
||||||
location string
|
location string
|
||||||
status EventStatus
|
status EventStatus
|
||||||
event_type EventType
|
event_type EventType
|
||||||
priority u8 // 1-5 scale
|
priority u8 // 1-5 scale
|
||||||
is_all_day bool
|
is_all_day bool
|
||||||
recurrence_rule string // RFC 5545 recurrence rule
|
recurrence_rule string // RFC 5545 recurrence rule
|
||||||
parent_event_id u32 // for recurring events
|
parent_event_id u32 // for recurring events
|
||||||
}
|
}
|
||||||
|
|
||||||
// EventParticipant represents a participant in an event
|
// EventParticipant represents a participant in an event
|
||||||
pub struct EventParticipant {
|
pub struct EventParticipant {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
event_id u32 @[index]
|
event_id u32 @[index]
|
||||||
user_id u32 @[index]
|
user_id u32 @[index]
|
||||||
email string @[index]
|
email string @[index]
|
||||||
name string
|
name string
|
||||||
role string // attendee, organizer, optional
|
role string // attendee, organizer, optional
|
||||||
status string // accepted, declined, tentative, pending
|
status string // accepted, declined, tentative, pending
|
||||||
response_time u64
|
response_time u64
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,46 +4,46 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// MessageStatus represents the delivery status of a message
|
// MessageStatus represents the delivery status of a message
|
||||||
pub enum MessageStatus {
|
pub enum MessageStatus {
|
||||||
draft
|
draft
|
||||||
sent
|
sent
|
||||||
delivered
|
delivered
|
||||||
read
|
read
|
||||||
failed
|
failed
|
||||||
}
|
}
|
||||||
|
|
||||||
// MessageType categorizes different types of messages
|
// MessageType categorizes different types of messages
|
||||||
pub enum MessageType {
|
pub enum MessageType {
|
||||||
email
|
email
|
||||||
sms
|
sms
|
||||||
notification
|
notification
|
||||||
reminder
|
reminder
|
||||||
}
|
}
|
||||||
|
|
||||||
// Message represents a communication message
|
// Message represents a communication message
|
||||||
pub struct Message {
|
pub struct Message {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
sender_id u32 @[index]
|
sender_id u32 @[index]
|
||||||
recipient_id u32 @[index]
|
recipient_id u32 @[index]
|
||||||
subject string
|
subject string
|
||||||
body string
|
body string
|
||||||
message_type MessageType
|
message_type MessageType
|
||||||
status MessageStatus
|
status MessageStatus
|
||||||
scheduled_at u64
|
scheduled_at u64
|
||||||
sent_at u64
|
sent_at u64
|
||||||
read_at u64
|
read_at u64
|
||||||
priority u8 // 1-5 scale
|
priority u8 // 1-5 scale
|
||||||
attachments []string // file paths or URLs
|
attachments []string // file paths or URLs
|
||||||
tags []string
|
tags []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reminder represents a scheduled reminder
|
// Reminder represents a scheduled reminder
|
||||||
pub struct Reminder {
|
pub struct Reminder {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
event_id u32 @[index]
|
event_id u32 @[index]
|
||||||
message string
|
message string
|
||||||
reminder_time u64 @[index]
|
reminder_time u64 @[index]
|
||||||
is_sent bool
|
is_sent bool
|
||||||
snooze_count u8
|
snooze_count u8
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,28 +4,28 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Circle represents a circle entity with configuration and metadata
|
// Circle represents a circle entity with configuration and metadata
|
||||||
pub struct Circle {
|
pub struct Circle {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string // Human-readable name of the circle
|
name string // Human-readable name of the circle
|
||||||
description string // Detailed description of the circle's purpose
|
description string // Detailed description of the circle's purpose
|
||||||
domain string // Primary domain name for the circle @[index]
|
domain string // Primary domain name for the circle @[index]
|
||||||
config CircleConfig // Configuration settings for the circle
|
config CircleConfig // Configuration settings for the circle
|
||||||
status CircleStatus // Current operational status
|
status CircleStatus // Current operational status
|
||||||
}
|
}
|
||||||
|
|
||||||
// CircleConfig holds configuration settings for a circle
|
// CircleConfig holds configuration settings for a circle
|
||||||
pub struct CircleConfig {
|
pub struct CircleConfig {
|
||||||
pub mut:
|
pub mut:
|
||||||
max_members u32 // Maximum number of members allowed
|
max_members u32 // Maximum number of members allowed
|
||||||
allow_guests bool // Whether to allow guest access
|
allow_guests bool // Whether to allow guest access
|
||||||
auto_approve bool // Whether new members are auto-approved
|
auto_approve bool // Whether new members are auto-approved
|
||||||
theme string // Visual theme identifier
|
theme string // Visual theme identifier
|
||||||
}
|
}
|
||||||
|
|
||||||
// CircleStatus represents the operational status of a circle
|
// CircleStatus represents the operational status of a circle
|
||||||
pub enum CircleStatus {
|
pub enum CircleStatus {
|
||||||
active
|
active
|
||||||
inactive
|
inactive
|
||||||
suspended
|
suspended
|
||||||
archived
|
archived
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,30 +4,30 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Member represents a member within a circle
|
// Member represents a member within a circle
|
||||||
pub struct Member {
|
pub struct Member {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
circle_id u32 // Reference to the circle this member belongs to @[index]
|
circle_id u32 // Reference to the circle this member belongs to @[index]
|
||||||
user_id u32 // Reference to the user entity @[index]
|
user_id u32 // Reference to the user entity @[index]
|
||||||
role MemberRole // Member's role within the circle
|
role MemberRole // Member's role within the circle
|
||||||
status MemberStatus // Current membership status
|
status MemberStatus // Current membership status
|
||||||
joined_at u64 // Unix timestamp when member joined
|
joined_at u64 // Unix timestamp when member joined
|
||||||
invited_by u32 // User ID of who invited this member
|
invited_by u32 // User ID of who invited this member
|
||||||
permissions []string // List of custom permissions
|
permissions []string // List of custom permissions
|
||||||
}
|
}
|
||||||
|
|
||||||
// MemberRole defines the possible roles a member can have
|
// MemberRole defines the possible roles a member can have
|
||||||
pub enum MemberRole {
|
pub enum MemberRole {
|
||||||
owner
|
owner
|
||||||
admin
|
admin
|
||||||
moderator
|
moderator
|
||||||
member
|
member
|
||||||
guest
|
guest
|
||||||
}
|
}
|
||||||
|
|
||||||
// MemberStatus represents the current status of membership
|
// MemberStatus represents the current status of membership
|
||||||
pub enum MemberStatus {
|
pub enum MemberStatus {
|
||||||
active
|
active
|
||||||
pending
|
pending
|
||||||
suspended
|
suspended
|
||||||
removed
|
removed
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,24 +4,24 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Name represents a domain name configuration for a circle
|
// Name represents a domain name configuration for a circle
|
||||||
pub struct Name {
|
pub struct Name {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
circle_id u32 // Reference to the circle this name belongs to @[index]
|
circle_id u32 // Reference to the circle this name belongs to @[index]
|
||||||
domain string // The actual domain name @[index]
|
domain string // The actual domain name @[index]
|
||||||
subdomain string // Optional subdomain
|
subdomain string // Optional subdomain
|
||||||
record_type NameType // Type of DNS record
|
record_type NameType // Type of DNS record
|
||||||
value string // DNS record value/target
|
value string // DNS record value/target
|
||||||
priority u32 // Priority for MX records
|
priority u32 // Priority for MX records
|
||||||
ttl u32 // Time to live in seconds
|
ttl u32 // Time to live in seconds
|
||||||
is_active bool // Whether this record is currently active
|
is_active bool // Whether this record is currently active
|
||||||
}
|
}
|
||||||
|
|
||||||
// NameType defines the supported DNS record types
|
// NameType defines the supported DNS record types
|
||||||
pub enum NameType {
|
pub enum NameType {
|
||||||
a
|
a
|
||||||
aaaa
|
aaaa
|
||||||
cname
|
cname
|
||||||
mx
|
mx
|
||||||
txt
|
txt
|
||||||
srv
|
srv
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,30 +4,30 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Wallet represents a wallet associated with a circle for financial operations
|
// Wallet represents a wallet associated with a circle for financial operations
|
||||||
pub struct Wallet {
|
pub struct Wallet {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
circle_id u32 // Reference to the circle this wallet belongs to @[index]
|
circle_id u32 // Reference to the circle this wallet belongs to @[index]
|
||||||
address string // Blockchain address for this wallet @[index]
|
address string // Blockchain address for this wallet @[index]
|
||||||
type WalletType // Type of wallet (custodial/non-custodial)
|
type WalletType // Type of wallet (custodial/non-custodial)
|
||||||
balance f64 // Current balance in the wallet
|
balance f64 // Current balance in the wallet
|
||||||
currency string // Currency type (e.g., "USD", "BTC", "ETH")
|
currency string // Currency type (e.g., "USD", "BTC", "ETH")
|
||||||
is_primary bool // Whether this is the primary wallet for the circle
|
is_primary bool // Whether this is the primary wallet for the circle
|
||||||
status WalletStatus // Current wallet status
|
status WalletStatus // Current wallet status
|
||||||
last_activity u64 // Unix timestamp of last transaction
|
last_activity u64 // Unix timestamp of last transaction
|
||||||
}
|
}
|
||||||
|
|
||||||
// WalletType defines the types of wallets supported
|
// WalletType defines the types of wallets supported
|
||||||
pub enum WalletType {
|
pub enum WalletType {
|
||||||
custodial
|
custodial
|
||||||
non_custodial
|
non_custodial
|
||||||
hardware
|
hardware
|
||||||
software
|
software
|
||||||
}
|
}
|
||||||
|
|
||||||
// WalletStatus represents the operational status of a wallet
|
// WalletStatus represents the operational status of a wallet
|
||||||
pub enum WalletStatus {
|
pub enum WalletStatus {
|
||||||
active
|
active
|
||||||
inactive
|
inactive
|
||||||
frozen
|
frozen
|
||||||
archived
|
archived
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ module core
|
|||||||
// BaseData provides common fields for all models
|
// BaseData provides common fields for all models
|
||||||
pub struct Base {
|
pub struct Base {
|
||||||
pub mut:
|
pub mut:
|
||||||
id u32
|
id u32
|
||||||
created u64 // Unix timestamp of creation
|
created u64 // Unix timestamp of creation
|
||||||
updated u64 // Unix timestamp of last update
|
updated u64 // Unix timestamp of last update
|
||||||
deleted bool
|
deleted bool
|
||||||
version u32
|
version u32
|
||||||
comments []Comment
|
comments []Comment
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ pub mut:
|
|||||||
// Optional ID of the parent comment for threaded conversations
|
// Optional ID of the parent comment for threaded conversations
|
||||||
// None indicates this is a top-level comment
|
// None indicates this is a top-level comment
|
||||||
parent_comment_id u32
|
parent_comment_id u32
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,23 +5,23 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
// Account represents a financial account for tracking balances and transactions
|
// Account represents a financial account for tracking balances and transactions
|
||||||
// Supports multiple account types (checking, savings, investment, etc.)
|
// Supports multiple account types (checking, savings, investment, etc.)
|
||||||
pub struct Account {
|
pub struct Account {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string // User-friendly account name
|
name string // User-friendly account name
|
||||||
account_type AccountType
|
account_type AccountType
|
||||||
balance f64 // Current balance in the account's currency
|
balance f64 // Current balance in the account's currency
|
||||||
currency string // Currency code (USD, EUR, etc.)
|
currency string // Currency code (USD, EUR, etc.)
|
||||||
description string // Optional description of the account
|
description string // Optional description of the account
|
||||||
is_active bool // Whether the account is currently active
|
is_active bool // Whether the account is currently active
|
||||||
}
|
}
|
||||||
|
|
||||||
// AccountType defines the different types of financial accounts
|
// AccountType defines the different types of financial accounts
|
||||||
pub enum AccountType {
|
pub enum AccountType {
|
||||||
checking
|
checking
|
||||||
savings
|
savings
|
||||||
investment
|
investment
|
||||||
credit
|
credit
|
||||||
loan
|
loan
|
||||||
crypto
|
crypto
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,30 +5,30 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
// Asset represents any valuable resource owned by an entity
|
// Asset represents any valuable resource owned by an entity
|
||||||
// Can be financial (stocks, bonds) or physical (real estate, commodities)
|
// Can be financial (stocks, bonds) or physical (real estate, commodities)
|
||||||
pub struct Asset {
|
pub struct Asset {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string // Asset name or identifier
|
name string // Asset name or identifier
|
||||||
symbol string // Trading symbol or identifier @[index]
|
symbol string // Trading symbol or identifier @[index]
|
||||||
asset_type AssetType
|
asset_type AssetType
|
||||||
quantity f64 // Amount of the asset held
|
quantity f64 // Amount of the asset held
|
||||||
unit_price f64 // Price per unit in the asset's currency
|
unit_price f64 // Price per unit in the asset's currency
|
||||||
total_value f64 // total_value = quantity * unit_price
|
total_value f64 // total_value = quantity * unit_price
|
||||||
currency string // Currency for pricing (USD, EUR, etc.)
|
currency string // Currency for pricing (USD, EUR, etc.)
|
||||||
category string // Asset category (stocks, bonds, crypto, etc.)
|
category string // Asset category (stocks, bonds, crypto, etc.)
|
||||||
exchange string // Exchange where asset is traded
|
exchange string // Exchange where asset is traded
|
||||||
description string // Detailed description of the asset
|
description string // Detailed description of the asset
|
||||||
is_active bool // Whether the asset is currently tracked
|
is_active bool // Whether the asset is currently tracked
|
||||||
purchase_date u64 // Unix timestamp of purchase/acquisition
|
purchase_date u64 // Unix timestamp of purchase/acquisition
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssetType defines the classification of assets
|
// AssetType defines the classification of assets
|
||||||
pub enum AssetType {
|
pub enum AssetType {
|
||||||
stock
|
stock
|
||||||
bond
|
bond
|
||||||
crypto
|
crypto
|
||||||
commodity
|
commodity
|
||||||
real_estate
|
real_estate
|
||||||
currency
|
currency
|
||||||
nft
|
nft
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,25 +5,25 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
// Marketplace represents a platform for buying and selling goods/services
|
// Marketplace represents a platform for buying and selling goods/services
|
||||||
// Can be internal or external marketplace configurations
|
// Can be internal or external marketplace configurations
|
||||||
pub struct Marketplace {
|
pub struct Marketplace {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string // Marketplace name (e.g., "Amazon", "eBay") @[index]
|
name string // Marketplace name (e.g., "Amazon", "eBay") @[index]
|
||||||
marketplace_type MarketplaceType
|
marketplace_type MarketplaceType
|
||||||
api_endpoint string // API endpoint for marketplace integration
|
api_endpoint string // API endpoint for marketplace integration
|
||||||
api_key string // Authentication key for API access
|
api_key string // Authentication key for API access
|
||||||
currency string // Default currency for transactions
|
currency string // Default currency for transactions
|
||||||
fee_percentage f64 // Marketplace fee as percentage (0.0-100.0)
|
fee_percentage f64 // Marketplace fee as percentage (0.0-100.0)
|
||||||
is_active bool // Whether marketplace is currently enabled
|
is_active bool // Whether marketplace is currently enabled
|
||||||
description string // Detailed marketplace description
|
description string // Detailed marketplace description
|
||||||
support_email string // Contact email for support issues
|
support_email string // Contact email for support issues
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarketplaceType defines the type of marketplace platform
|
// MarketplaceType defines the type of marketplace platform
|
||||||
pub enum MarketplaceType {
|
pub enum MarketplaceType {
|
||||||
centralized
|
centralized
|
||||||
decentralized
|
decentralized
|
||||||
peer_to_peer
|
peer_to_peer
|
||||||
auction
|
auction
|
||||||
classified
|
classified
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// CommitteeMember represents a member of a committee
|
// CommitteeMember represents a member of a committee
|
||||||
pub struct CommitteeMember {
|
pub struct CommitteeMember {
|
||||||
pub struct CommitteeMember {
|
core.Base
|
||||||
core.Base
|
|
||||||
pub mut:
|
pub mut:
|
||||||
user_id u32
|
user_id u32
|
||||||
name string
|
name string
|
||||||
@@ -18,8 +17,8 @@ pub mut:
|
|||||||
pub struct Committee {
|
pub struct Committee {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 @[index]
|
company_id u32 @[index]
|
||||||
name string @[index]
|
name string @[index]
|
||||||
description string
|
description string
|
||||||
members []CommitteeMember
|
members []CommitteeMember
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ pub mut:
|
|||||||
industry string
|
industry string
|
||||||
description string
|
description string
|
||||||
status CompanyStatus
|
status CompanyStatus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ pub mut:
|
|||||||
pub struct Meeting {
|
pub struct Meeting {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 @[index]
|
company_id u32 @[index]
|
||||||
title string @[index]
|
title string @[index]
|
||||||
description string
|
description string
|
||||||
meeting_type MeetingType
|
meeting_type MeetingType
|
||||||
status MeetingStatus
|
status MeetingStatus
|
||||||
start_time u64 // Unix timestamp
|
start_time u64 // Unix timestamp
|
||||||
end_time u64 // Unix timestamp
|
end_time u64 // Unix timestamp
|
||||||
location string
|
location string
|
||||||
agenda string
|
agenda string
|
||||||
minutes string
|
minutes string
|
||||||
attendees []Attendee
|
attendees []Attendee
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
pub struct Resolution {
|
pub struct Resolution {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 @[index]
|
company_id u32 @[index]
|
||||||
title string @[index]
|
title string @[index]
|
||||||
description string
|
description string
|
||||||
resolution_type ResolutionType
|
resolution_type ResolutionType
|
||||||
status ResolutionStatus
|
status ResolutionStatus
|
||||||
proposed_date u64 // Unix timestamp
|
proposed_date u64 // Unix timestamp
|
||||||
effective_date ?u64 // Unix timestamp
|
effective_date ?u64 // Unix timestamp
|
||||||
expiry_date ?u64 // Unix timestamp
|
expiry_date ?u64 // Unix timestamp
|
||||||
approvals []string
|
approvals []string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
pub struct Shareholder {
|
pub struct Shareholder {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 @[index]
|
company_id u32 @[index]
|
||||||
name string @[index]
|
name string @[index]
|
||||||
shareholder_type ShareholderType
|
shareholder_type ShareholderType
|
||||||
contact_info string @[index]
|
contact_info string @[index]
|
||||||
shares u32
|
shares u32
|
||||||
percentage f64
|
percentage f64
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,4 +79,4 @@ pub enum VoteOption {
|
|||||||
no
|
no
|
||||||
abstain
|
abstain
|
||||||
custom
|
custom
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ pub mut:
|
|||||||
name string @[index]
|
name string @[index]
|
||||||
email string @[index]
|
email string @[index]
|
||||||
role string
|
role string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ pub mut:
|
|||||||
pub struct Vote {
|
pub struct Vote {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 @[index]
|
company_id u32 @[index]
|
||||||
resolution_id u32 @[index]
|
resolution_id u32 @[index]
|
||||||
title string @[index]
|
title string @[index]
|
||||||
description string
|
description string
|
||||||
status VoteStatus
|
status VoteStatus
|
||||||
start_date u64 // Unix timestamp
|
start_date u64 // Unix timestamp
|
||||||
end_date u64 // Unix timestamp
|
end_date u64 // Unix timestamp
|
||||||
ballots []Ballot
|
ballots []Ballot
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,25 +2,24 @@ module governance
|
|||||||
|
|
||||||
import freeflowuniverse.herolib.hero.models.core
|
import freeflowuniverse.herolib.hero.models.core
|
||||||
|
|
||||||
|
|
||||||
pub struct GovernanceActivity {
|
pub struct GovernanceActivity {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 // Reference to company @[index]
|
company_id u32 // Reference to company @[index]
|
||||||
activity_type string // Type of activity (proposal, vote, meeting, etc.) @[index]
|
activity_type string // Type of activity (proposal, vote, meeting, etc.) @[index]
|
||||||
description string // Detailed description
|
description string // Detailed description
|
||||||
initiator_id u32 // User who initiated @[index]
|
initiator_id u32 // User who initiated @[index]
|
||||||
target_id u32 // Target entity ID
|
target_id u32 // Target entity ID
|
||||||
target_type string // Type of target (user, proposal, etc.)
|
target_type string // Type of target (user, proposal, etc.)
|
||||||
metadata string // JSON metadata
|
metadata string // JSON metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activity types
|
// Activity types
|
||||||
pub enum ActivityType {
|
pub enum ActivityType {
|
||||||
proposal_created
|
proposal_created
|
||||||
proposal_updated
|
proposal_updated
|
||||||
vote_cast
|
vote_cast
|
||||||
meeting_scheduled
|
meeting_scheduled
|
||||||
resolution_passed
|
resolution_passed
|
||||||
shareholder_added
|
shareholder_added
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// AttachedFile represents files attached to governance entities
|
// AttachedFile represents files attached to governance entities
|
||||||
pub struct AttachedFile {
|
pub struct AttachedFile {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
entity_id u32 // ID of entity this file is attached to @[index]
|
entity_id u32 // ID of entity this file is attached to @[index]
|
||||||
entity_type string // Type of entity (proposal, meeting, etc.) @[index]
|
entity_type string // Type of entity (proposal, meeting, etc.) @[index]
|
||||||
filename string // Original filename
|
filename string // Original filename
|
||||||
content_type string // MIME type
|
content_type string // MIME type
|
||||||
size u64 // File size in bytes
|
size u64 // File size in bytes
|
||||||
path string // Storage path
|
path string // Storage path
|
||||||
description string // Optional description
|
description string // Optional description
|
||||||
uploaded_by u32 // User who uploaded @[index]
|
uploaded_by u32 // User who uploaded @[index]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,36 +4,36 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// CommitteeType defines committee categories
|
// CommitteeType defines committee categories
|
||||||
pub enum CommitteeType {
|
pub enum CommitteeType {
|
||||||
board
|
board
|
||||||
executive
|
executive
|
||||||
audit
|
audit
|
||||||
compensation
|
compensation
|
||||||
nomination
|
nomination
|
||||||
governance
|
governance
|
||||||
finance
|
finance
|
||||||
risk
|
risk
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommitteeStatus tracks committee state
|
// CommitteeStatus tracks committee state
|
||||||
pub enum CommitteeStatus {
|
pub enum CommitteeStatus {
|
||||||
active
|
active
|
||||||
inactive
|
inactive
|
||||||
dissolved
|
dissolved
|
||||||
}
|
}
|
||||||
|
|
||||||
// Committee represents a governance committee
|
// Committee represents a governance committee
|
||||||
pub struct Committee {
|
pub struct Committee {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 // Reference to company @[index]
|
company_id u32 // Reference to company @[index]
|
||||||
name string // Committee name @[index]
|
name string // Committee name @[index]
|
||||||
committee_type CommitteeType // Type of committee
|
committee_type CommitteeType // Type of committee
|
||||||
description string // Detailed description
|
description string // Detailed description
|
||||||
status CommitteeStatus // Current state
|
status CommitteeStatus // Current state
|
||||||
chairman_id u32 // Committee chair @[index]
|
chairman_id u32 // Committee chair @[index]
|
||||||
term_start u64 // Start of term
|
term_start u64 // Start of term
|
||||||
term_end u64 // End of term
|
term_end u64 // End of term
|
||||||
meeting_frequency string // e.g., "monthly", "quarterly"
|
meeting_frequency string // e.g., "monthly", "quarterly"
|
||||||
quorum_size u32 // Minimum members for quorum
|
quorum_size u32 // Minimum members for quorum
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,42 +4,42 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// CompanyType categorizes companies
|
// CompanyType categorizes companies
|
||||||
pub enum CompanyType {
|
pub enum CompanyType {
|
||||||
corporation
|
corporation
|
||||||
llc
|
llc
|
||||||
partnership
|
partnership
|
||||||
cooperative
|
cooperative
|
||||||
nonprofit
|
nonprofit
|
||||||
}
|
}
|
||||||
|
|
||||||
// CompanyStatus tracks company state
|
// CompanyStatus tracks company state
|
||||||
pub enum CompanyStatus {
|
pub enum CompanyStatus {
|
||||||
active
|
active
|
||||||
inactive
|
inactive
|
||||||
dissolved
|
dissolved
|
||||||
merged
|
merged
|
||||||
acquired
|
acquired
|
||||||
}
|
}
|
||||||
|
|
||||||
// Company represents a governance entity
|
// Company represents a governance entity
|
||||||
pub struct Company {
|
pub struct Company {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string // Company name @[index]
|
name string // Company name @[index]
|
||||||
legal_name string // Legal entity name @[index]
|
legal_name string // Legal entity name @[index]
|
||||||
company_type CompanyType // Type of company
|
company_type CompanyType // Type of company
|
||||||
status CompanyStatus // Current state
|
status CompanyStatus // Current state
|
||||||
incorporation_date u64 // Unix timestamp
|
incorporation_date u64 // Unix timestamp
|
||||||
jurisdiction string // Country/state of incorporation
|
jurisdiction string // Country/state of incorporation
|
||||||
registration_number string // Government registration @[index]
|
registration_number string // Government registration @[index]
|
||||||
tax_id string // Tax identification
|
tax_id string // Tax identification
|
||||||
address string // Primary address
|
address string // Primary address
|
||||||
headquarters string // City/country of HQ
|
headquarters string // City/country of HQ
|
||||||
website string // Company website
|
website string // Company website
|
||||||
phone string // Contact phone
|
phone string // Contact phone
|
||||||
email string // Contact email
|
email string // Contact email
|
||||||
shares_authorized u64 // Total authorized shares
|
shares_authorized u64 // Total authorized shares
|
||||||
shares_issued u64 // Currently issued shares
|
shares_issued u64 // Currently issued shares
|
||||||
par_value f64 // Par value per share
|
par_value f64 // Par value per share
|
||||||
currency string // Currency code
|
currency string // Currency code
|
||||||
fiscal_year_end string // "MM-DD" format
|
fiscal_year_end string // "MM-DD" format
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,41 +4,41 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// MeetingType defines meeting categories
|
// MeetingType defines meeting categories
|
||||||
pub enum MeetingType {
|
pub enum MeetingType {
|
||||||
annual_general
|
annual_general
|
||||||
extraordinary_general
|
extraordinary_general
|
||||||
board
|
board
|
||||||
committee
|
committee
|
||||||
special
|
special
|
||||||
}
|
}
|
||||||
|
|
||||||
// MeetingStatus tracks meeting state
|
// MeetingStatus tracks meeting state
|
||||||
pub enum MeetingStatus {
|
pub enum MeetingStatus {
|
||||||
scheduled
|
scheduled
|
||||||
in_progress
|
in_progress
|
||||||
completed
|
completed
|
||||||
cancelled
|
cancelled
|
||||||
postponed
|
postponed
|
||||||
}
|
}
|
||||||
|
|
||||||
// Meeting represents a governance meeting
|
// Meeting represents a governance meeting
|
||||||
pub struct Meeting {
|
pub struct Meeting {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 // Reference to company @[index]
|
company_id u32 // Reference to company @[index]
|
||||||
committee_id u32 // Reference to committee @[index]
|
committee_id u32 // Reference to committee @[index]
|
||||||
meeting_type MeetingType // Type of meeting
|
meeting_type MeetingType // Type of meeting
|
||||||
title string // Meeting title @[index]
|
title string // Meeting title @[index]
|
||||||
description string // Detailed description
|
description string // Detailed description
|
||||||
status MeetingStatus // Current state
|
status MeetingStatus // Current state
|
||||||
scheduled_start u64 // Scheduled start time
|
scheduled_start u64 // Scheduled start time
|
||||||
scheduled_end u64 // Scheduled end time
|
scheduled_end u64 // Scheduled end time
|
||||||
actual_start u64 // Actual start time
|
actual_start u64 // Actual start time
|
||||||
actual_end u64 // Actual end time
|
actual_end u64 // Actual end time
|
||||||
location string // Physical/virtual location
|
location string // Physical/virtual location
|
||||||
meeting_url string // Video conference link
|
meeting_url string // Video conference link
|
||||||
agenda string // Meeting agenda
|
agenda string // Meeting agenda
|
||||||
minutes string // Meeting minutes
|
minutes string // Meeting minutes
|
||||||
quorum_required u32 // Members required for quorum
|
quorum_required u32 // Members required for quorum
|
||||||
quorum_present bool // Whether quorum was achieved
|
quorum_present bool // Whether quorum was achieved
|
||||||
created_by u32 // User who scheduled @[index]
|
created_by u32 // User who scheduled @[index]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,44 +4,44 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// ProposalStatus tracks the state of a governance proposal
|
// ProposalStatus tracks the state of a governance proposal
|
||||||
pub enum ProposalStatus {
|
pub enum ProposalStatus {
|
||||||
draft
|
draft
|
||||||
pending_review
|
pending_review
|
||||||
active
|
active
|
||||||
voting
|
voting
|
||||||
passed
|
passed
|
||||||
rejected
|
rejected
|
||||||
implemented
|
implemented
|
||||||
cancelled
|
cancelled
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProposalType categorizes proposals
|
// ProposalType categorizes proposals
|
||||||
pub enum ProposalType {
|
pub enum ProposalType {
|
||||||
constitutional
|
constitutional
|
||||||
policy
|
policy
|
||||||
budget
|
budget
|
||||||
election
|
election
|
||||||
merger
|
merger
|
||||||
dissolution
|
dissolution
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
|
||||||
// Proposal represents a governance proposal
|
// Proposal represents a governance proposal
|
||||||
pub struct Proposal {
|
pub struct Proposal {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 // Reference to company @[index]
|
company_id u32 // Reference to company @[index]
|
||||||
title string // Proposal title @[index]
|
title string // Proposal title @[index]
|
||||||
description string // Detailed description
|
description string // Detailed description
|
||||||
proposal_type ProposalType // Category of proposal
|
proposal_type ProposalType // Category of proposal
|
||||||
status ProposalStatus // Current state
|
status ProposalStatus // Current state
|
||||||
proposer_id u32 // User who created @[index]
|
proposer_id u32 // User who created @[index]
|
||||||
target_committee_id u32 // Target committee @[index]
|
target_committee_id u32 // Target committee @[index]
|
||||||
voting_start u64 // Start timestamp
|
voting_start u64 // Start timestamp
|
||||||
voting_end u64 // End timestamp
|
voting_end u64 // End timestamp
|
||||||
quorum_required f64 // Percentage required
|
quorum_required f64 // Percentage required
|
||||||
approval_threshold f64 // Percentage for approval
|
approval_threshold f64 // Percentage for approval
|
||||||
votes_for u32 // Votes in favor
|
votes_for u32 // Votes in favor
|
||||||
votes_against u32 // Votes against
|
votes_against u32 // Votes against
|
||||||
votes_abstain u32 // Abstention votes
|
votes_abstain u32 // Abstention votes
|
||||||
implementation_notes string // Post-implementation notes
|
implementation_notes string // Post-implementation notes
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,37 +4,37 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// ResolutionStatus tracks resolution state
|
// ResolutionStatus tracks resolution state
|
||||||
pub enum ResolutionStatus {
|
pub enum ResolutionStatus {
|
||||||
proposed
|
proposed
|
||||||
voting
|
voting
|
||||||
passed
|
passed
|
||||||
failed
|
failed
|
||||||
implemented
|
implemented
|
||||||
withdrawn
|
withdrawn
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResolutionType categorizes resolutions
|
// ResolutionType categorizes resolutions
|
||||||
pub enum ResolutionType {
|
pub enum ResolutionType {
|
||||||
ordinary
|
ordinary
|
||||||
special
|
special
|
||||||
unanimous
|
unanimous
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resolution represents a formal resolution
|
// Resolution represents a formal resolution
|
||||||
pub struct Resolution {
|
pub struct Resolution {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
company_id u32 // Reference to company @[index]
|
company_id u32 // Reference to company @[index]
|
||||||
meeting_id u32 // Reference to meeting @[index]
|
meeting_id u32 // Reference to meeting @[index]
|
||||||
proposal_id u32 // Reference to proposal @[index]
|
proposal_id u32 // Reference to proposal @[index]
|
||||||
resolution_number string // Unique resolution number @[index]
|
resolution_number string // Unique resolution number @[index]
|
||||||
title string // Resolution title @[index]
|
title string // Resolution title @[index]
|
||||||
description string // Detailed description
|
description string // Detailed description
|
||||||
resolution_type ResolutionType // Category
|
resolution_type ResolutionType // Category
|
||||||
status ResolutionStatus // Current state
|
status ResolutionStatus // Current state
|
||||||
mover_id u32 // Person who moved @[index]
|
mover_id u32 // Person who moved @[index]
|
||||||
seconder_id u32 // Person who seconded @[index]
|
seconder_id u32 // Person who seconded @[index]
|
||||||
votes_for u32 // Votes in favor
|
votes_for u32 // Votes in favor
|
||||||
votes_against u32 // Votes against
|
votes_against u32 // Votes against
|
||||||
votes_abstain u32 // Abstention votes
|
votes_abstain u32 // Abstention votes
|
||||||
effective_date u64 // When resolution takes effect
|
effective_date u64 // When resolution takes effect
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,45 +4,45 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// UserType defines user categories
|
// UserType defines user categories
|
||||||
pub enum UserType {
|
pub enum UserType {
|
||||||
individual
|
individual
|
||||||
corporate
|
corporate
|
||||||
system
|
system
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserStatus tracks user state
|
// UserStatus tracks user state
|
||||||
pub enum UserStatus {
|
pub enum UserStatus {
|
||||||
active
|
active
|
||||||
inactive
|
inactive
|
||||||
suspended
|
suspended
|
||||||
pending
|
pending
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserRole defines governance roles
|
// UserRole defines governance roles
|
||||||
pub enum UserRole {
|
pub enum UserRole {
|
||||||
shareholder
|
shareholder
|
||||||
director
|
director
|
||||||
officer
|
officer
|
||||||
employee
|
employee
|
||||||
auditor
|
auditor
|
||||||
consultant
|
consultant
|
||||||
administrator
|
administrator
|
||||||
}
|
}
|
||||||
|
|
||||||
// User represents a governance participant
|
// User represents a governance participant
|
||||||
pub struct User {
|
pub struct User {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
username string // Unique username @[index]
|
username string // Unique username @[index]
|
||||||
email string // Email address @[index]
|
email string // Email address @[index]
|
||||||
first_name string // First name
|
first_name string // First name
|
||||||
last_name string // Last name
|
last_name string // Last name
|
||||||
display_name string // Preferred display name
|
display_name string // Preferred display name
|
||||||
user_type UserType // Type of user
|
user_type UserType // Type of user
|
||||||
status UserStatus // Current state
|
status UserStatus // Current state
|
||||||
roles []UserRole // Governance roles
|
roles []UserRole // Governance roles
|
||||||
company_id u32 // Primary company @[index]
|
company_id u32 // Primary company @[index]
|
||||||
phone string // Contact phone
|
phone string // Contact phone
|
||||||
address string // Contact address
|
address string // Contact address
|
||||||
profile_picture string // Profile picture URL
|
profile_picture string // Profile picture URL
|
||||||
last_login u64 // Last login timestamp
|
last_login u64 // Last login timestamp
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,31 +4,31 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// VoteValue represents voting choices
|
// VoteValue represents voting choices
|
||||||
pub enum VoteValue {
|
pub enum VoteValue {
|
||||||
yes
|
yes
|
||||||
no
|
no
|
||||||
abstain
|
abstain
|
||||||
}
|
}
|
||||||
|
|
||||||
// VoteStatus tracks vote state
|
// VoteStatus tracks vote state
|
||||||
pub enum VoteStatus {
|
pub enum VoteStatus {
|
||||||
pending
|
pending
|
||||||
cast
|
cast
|
||||||
changed
|
changed
|
||||||
retracted
|
retracted
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vote represents a governance vote
|
// Vote represents a governance vote
|
||||||
pub struct Vote {
|
pub struct Vote {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
proposal_id u32 // Reference to proposal @[index]
|
proposal_id u32 // Reference to proposal @[index]
|
||||||
resolution_id u32 // Reference to resolution @[index]
|
resolution_id u32 // Reference to resolution @[index]
|
||||||
voter_id u32 // User who voted @[index]
|
voter_id u32 // User who voted @[index]
|
||||||
company_id u32 // Reference to company @[index]
|
company_id u32 // Reference to company @[index]
|
||||||
vote_value VoteValue // Voting choice
|
vote_value VoteValue // Voting choice
|
||||||
status VoteStatus // Current state
|
status VoteStatus // Current state
|
||||||
weight u32 // Vote weight (for weighted voting)
|
weight u32 // Vote weight (for weighted voting)
|
||||||
comments string // Optional comments
|
comments string // Optional comments
|
||||||
proxy_voter_id u32 // If voting by proxy @[index]
|
proxy_voter_id u32 // If voting by proxy @[index]
|
||||||
ip_address string // IP address for verification
|
ip_address string // IP address for verification
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,53 +4,52 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// ContractStatus represents the current state of a legal contract
|
// ContractStatus represents the current state of a legal contract
|
||||||
pub enum ContractStatus {
|
pub enum ContractStatus {
|
||||||
draft
|
draft
|
||||||
pending
|
pending
|
||||||
active
|
active
|
||||||
expired
|
expired
|
||||||
terminated
|
terminated
|
||||||
cancelled
|
cancelled
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContractType categorizes the type of legal agreement
|
// ContractType categorizes the type of legal agreement
|
||||||
pub enum ContractType {
|
pub enum ContractType {
|
||||||
service
|
service
|
||||||
sales
|
sales
|
||||||
lease
|
lease
|
||||||
employment
|
employment
|
||||||
partnership
|
partnership
|
||||||
nda
|
nda
|
||||||
other
|
other
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contract represents a legal agreement between parties
|
// Contract represents a legal agreement between parties
|
||||||
// This model stores essential information about contracts including parties, terms, and status
|
// This model stores essential information about contracts including parties, terms, and status
|
||||||
pub struct Contract {
|
pub struct Contract {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
title string // Human-readable title of the contract @[index]
|
title string // Human-readable title of the contract @[index]
|
||||||
contract_type ContractType // Type/category of the contract
|
contract_type ContractType // Type/category of the contract
|
||||||
status ContractStatus // Current status of the contract
|
status ContractStatus // Current status of the contract
|
||||||
party_a string // First party identifier (company, individual, etc.) @[index]
|
party_a string // First party identifier (company, individual, etc.) @[index]
|
||||||
party_b string // Second party identifier @[index]
|
party_b string // Second party identifier @[index]
|
||||||
effective_date u64 // Unix timestamp when contract becomes effective
|
effective_date u64 // Unix timestamp when contract becomes effective
|
||||||
|
|
||||||
expiration_date u64 // Unix timestamp when contract expires
|
expiration_date u64 // Unix timestamp when contract expires
|
||||||
|
|
||||||
total_value f64 // Monetary value of the contract
|
total_value f64 // Monetary value of the contract
|
||||||
|
|
||||||
currency string // Currency code (USD, EUR, etc.)
|
currency string // Currency code (USD, EUR, etc.)
|
||||||
|
|
||||||
terms string // Full text of the contract terms
|
terms string // Full text of the contract terms
|
||||||
|
|
||||||
signature_date u64 // Unix timestamp when contract was signed
|
signature_date u64 // Unix timestamp when contract was signed
|
||||||
|
|
||||||
|
version string // Version identifier for contract revisions
|
||||||
version string // Version identifier for contract revisions
|
|
||||||
|
parent_contract_id ?u32 // Optional reference to parent contract for amendments @[index]
|
||||||
parent_contract_id ?u32 // Optional reference to parent contract for amendments @[index]
|
|
||||||
|
attachment_urls []string // URLs or paths to attached documents
|
||||||
attachment_urls []string // URLs or paths to attached documents
|
|
||||||
|
notes string // Additional notes and comments
|
||||||
notes string // Additional notes and comments
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,29 +4,27 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// TocEntry represents a table of contents entry for a book
|
// TocEntry represents a table of contents entry for a book
|
||||||
pub struct TocEntry {
|
pub struct TocEntry {
|
||||||
// Title of the chapter/section
|
// Title of the chapter/section
|
||||||
title string
|
title string
|
||||||
|
|
||||||
// Page number (index in the pages array)
|
// Page number (index in the pages array)
|
||||||
page u32
|
page u32
|
||||||
|
|
||||||
// Optional subsections
|
// Optional subsections
|
||||||
subsections []TocEntry
|
subsections []TocEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
// Book represents a Book library item (collection of markdown pages with TOC)
|
// Book represents a Book library item (collection of markdown pages with TOC)
|
||||||
pub struct Book {
|
pub struct Book {
|
||||||
core.Base
|
core.Base // Title of the book
|
||||||
|
title string @[index]
|
||||||
// Title of the book
|
|
||||||
title string @[index]
|
// Optional description of the book
|
||||||
|
description ?string
|
||||||
// Optional description of the book
|
|
||||||
description ?string
|
// Table of contents
|
||||||
|
table_of_contents []TocEntry
|
||||||
// Table of contents
|
|
||||||
table_of_contents []TocEntry
|
// Pages content (markdown strings)
|
||||||
|
pages []string
|
||||||
// Pages content (markdown strings)
|
}
|
||||||
pages []string
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,26 +4,24 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Collection represents a collection of library items
|
// Collection represents a collection of library items
|
||||||
pub struct Collection {
|
pub struct Collection {
|
||||||
core.Base
|
core.Base // Title of the collection
|
||||||
|
title string @[index]
|
||||||
// Title of the collection
|
|
||||||
title string @[index]
|
// Optional description of the collection
|
||||||
|
description ?string
|
||||||
// Optional description of the collection
|
|
||||||
description ?string
|
// List of image item IDs belonging to this collection
|
||||||
|
images []u32
|
||||||
// List of image item IDs belonging to this collection
|
|
||||||
images []u32
|
// List of PDF item IDs belonging to this collection
|
||||||
|
pdfs []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 Markdown item IDs belonging to this collection
|
|
||||||
markdowns []u32
|
// List of Book item IDs belonging to this collection
|
||||||
|
books []u32
|
||||||
// List of Book item IDs belonging to this collection
|
|
||||||
books []u32
|
// List of Slides item IDs belonging to this collection
|
||||||
|
slides []u32
|
||||||
// List of Slides item IDs belonging to this collection
|
}
|
||||||
slides []u32
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,20 +4,18 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Image represents an Image library item
|
// Image represents an Image library item
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
core.Base
|
core.Base // Title of the image
|
||||||
|
title string @[index]
|
||||||
// Title of the image
|
|
||||||
title string @[index]
|
// Optional description of the image
|
||||||
|
description ?string
|
||||||
// Optional description of the image
|
|
||||||
description ?string
|
// URL of the image
|
||||||
|
url string
|
||||||
// URL of the image
|
|
||||||
url string
|
// Width of the image in pixels
|
||||||
|
width u32
|
||||||
// Width of the image in pixels
|
|
||||||
width u32
|
// Height of the image in pixels
|
||||||
|
height u32
|
||||||
// Height of the image in pixels
|
}
|
||||||
height u32
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,14 +4,12 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Markdown represents a Markdown document library item
|
// Markdown represents a Markdown document library item
|
||||||
pub struct Markdown {
|
pub struct Markdown {
|
||||||
core.Base
|
core.Base // Title of the document
|
||||||
|
title string @[index]
|
||||||
// Title of the document
|
|
||||||
title string @[index]
|
// Optional description of the document
|
||||||
|
description ?string
|
||||||
// Optional description of the document
|
|
||||||
description ?string
|
// The markdown content
|
||||||
|
content string
|
||||||
// The markdown content
|
}
|
||||||
content string
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,17 +4,15 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Pdf represents a PDF document library item
|
// Pdf represents a PDF document library item
|
||||||
pub struct Pdf {
|
pub struct Pdf {
|
||||||
core.Base
|
core.Base // Title of the PDF
|
||||||
|
title string @[index]
|
||||||
// Title of the PDF
|
|
||||||
title string @[index]
|
// Optional description of the PDF
|
||||||
|
description ?string
|
||||||
// Optional description of the PDF
|
|
||||||
description ?string
|
// URL of the PDF file
|
||||||
|
url string
|
||||||
// URL of the PDF file
|
|
||||||
url string
|
// Number of pages in the PDF
|
||||||
|
page_count u32
|
||||||
// Number of pages in the PDF
|
}
|
||||||
page_count u32
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,26 +4,24 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
|
|
||||||
// Slide represents a single slide in a slideshow
|
// Slide represents a single slide in a slideshow
|
||||||
pub struct Slide {
|
pub struct Slide {
|
||||||
// URL of the image for this slide
|
// URL of the image for this slide
|
||||||
image_url string
|
image_url string
|
||||||
|
|
||||||
// Optional title for the slide
|
// Optional title for the slide
|
||||||
title ?string
|
title ?string
|
||||||
|
|
||||||
// Optional description for the slide
|
// Optional description for the slide
|
||||||
description ?string
|
description ?string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Slideshow represents a Slideshow library item (collection of images for slideshow)
|
// Slideshow represents a Slideshow library item (collection of images for slideshow)
|
||||||
pub struct Slideshow {
|
pub struct Slideshow {
|
||||||
core.Base
|
core.Base // Title of the slideshow
|
||||||
|
title string @[index]
|
||||||
// Title of the slideshow
|
|
||||||
title string @[index]
|
// Optional description of the slideshow
|
||||||
|
description ?string
|
||||||
// Optional description of the slideshow
|
|
||||||
description ?string
|
// List of slides
|
||||||
|
slides []Slide
|
||||||
// List of slides
|
}
|
||||||
slides []Slide
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,23 +35,23 @@ pub enum ItemType {
|
|||||||
pub struct Project {
|
pub struct Project {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index] // Project name
|
name string @[index] // Project name
|
||||||
description string // Detailed project description
|
description string // Detailed project description
|
||||||
owner_id u64 @[index] // User ID of the project owner
|
owner_id u64 @[index] // User ID of the project owner
|
||||||
member_ids []u64 @[index] // List of user IDs who are members
|
member_ids []u64 @[index] // List of user IDs who are members
|
||||||
board_ids []u64 // List of associated board IDs
|
board_ids []u64 // List of associated board IDs
|
||||||
sprint_ids []u64 @[index] // List of sprint IDs in this project
|
sprint_ids []u64 @[index] // List of sprint IDs in this project
|
||||||
epic_ids []u64 @[index] // List of epic IDs in this project
|
epic_ids []u64 @[index] // List of epic IDs in this project
|
||||||
tags []string @[index] // Project tags for categorization
|
tags []string @[index] // Project tags for categorization
|
||||||
status Status @[index] // Current project status
|
status Status @[index] // Current project status
|
||||||
priority Priority @[index] // Project priority level
|
priority Priority @[index] // Project priority level
|
||||||
item_type ItemType @[index] // Type of project item
|
item_type ItemType @[index] // Type of project item
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label represents a tag with name and color for categorization
|
// Label represents a tag with name and color for categorization
|
||||||
pub struct Label {
|
pub struct Label {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index] // Label name
|
name string @[index] // Label name
|
||||||
color string @[index] // Hex color code for the label
|
color string @[index] // Hex color code for the label
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import freeflowuniverse.herolib.hero.models.core
|
|||||||
pub struct Epic {
|
pub struct Epic {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index] // Epic name
|
name string @[index] // Epic name
|
||||||
description string // Detailed epic description
|
description string // Detailed epic description
|
||||||
status Status @[index] // Current epic status
|
status Status @[index] // Current epic status
|
||||||
project_id u64 @[index] // Link to parent project
|
project_id u64 @[index] // Link to parent project
|
||||||
start_date u64 // Epic start timestamp (Unix)
|
start_date u64 // Epic start timestamp (Unix)
|
||||||
due_date u64 // Epic due timestamp (Unix)
|
due_date u64 // Epic due timestamp (Unix)
|
||||||
tags []string @[index] // Epic tags for categorization
|
tags []string @[index] // Epic tags for categorization
|
||||||
child_task_ids []u64 @[index] // List of task IDs belonging to this epic
|
child_task_ids []u64 @[index] // List of task IDs belonging to this epic
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ pub enum SprintStatus {
|
|||||||
pub struct Sprint {
|
pub struct Sprint {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
name string @[index] // Sprint name
|
name string @[index] // Sprint name
|
||||||
description string // Sprint description
|
description string // Sprint description
|
||||||
status SprintStatus @[index] // Current sprint status
|
status SprintStatus @[index] // Current sprint status
|
||||||
goal string // Sprint goal/objective
|
goal string // Sprint goal/objective
|
||||||
project_id u64 @[index] // Link to parent project
|
project_id u64 @[index] // Link to parent project
|
||||||
start_date u64 // Sprint start timestamp (Unix)
|
start_date u64 // Sprint start timestamp (Unix)
|
||||||
end_date u64 // Sprint end timestamp (Unix)
|
end_date u64 // Sprint end timestamp (Unix)
|
||||||
task_ids []u64 @[index] // List of task IDs in this sprint
|
task_ids []u64 @[index] // List of task IDs in this sprint
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,18 +25,18 @@ pub enum TaskPriority {
|
|||||||
pub struct Task {
|
pub struct Task {
|
||||||
core.Base
|
core.Base
|
||||||
pub mut:
|
pub mut:
|
||||||
title string @[index] // Task title
|
title string @[index] // Task title
|
||||||
description string // Task description
|
description string // Task description
|
||||||
status TaskStatus @[index] // Current task status
|
status TaskStatus @[index] // Current task status
|
||||||
priority TaskPriority @[index] // Task priority level
|
priority TaskPriority @[index] // Task priority level
|
||||||
assignee_id u64 @[index] // User ID of task assignee
|
assignee_id u64 @[index] // User ID of task assignee
|
||||||
reporter_id u64 @[index] // User ID of task reporter
|
reporter_id u64 @[index] // User ID of task reporter
|
||||||
parent_task_id u64 // For subtasks - parent task ID
|
parent_task_id u64 // For subtasks - parent task ID
|
||||||
epic_id u64 @[index] // Link to parent epic
|
epic_id u64 @[index] // Link to parent epic
|
||||||
sprint_id u64 @[index] // Link to parent sprint
|
sprint_id u64 @[index] // Link to parent sprint
|
||||||
project_id u64 @[index] // Link to parent project
|
project_id u64 @[index] // Link to parent project
|
||||||
due_date u64 // Task due timestamp (Unix)
|
due_date u64 // Task due timestamp (Unix)
|
||||||
estimated_time_hours f32 // Estimated hours to complete
|
estimated_time_hours f32 // Estimated hours to complete
|
||||||
logged_time_hours f32 // Actual hours logged
|
logged_time_hours f32 // Actual hours logged
|
||||||
tags []string @[index] // Task tags for categorization
|
tags []string @[index] // Task tags for categorization
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user