Skip to content

biz.planner.models #

Constants #

const table_names = [
	'user',
	'customer',
	'project',
	'task',
	'sprint',
	'milestone',
	'issue',
	'team',
	'agenda',
	'chat',
]

Database table names (matching struct names in lowercase)

const indexed_fields = {
	'user':      ['email', 'username', 'status', 'role']
	'customer':  ['name', 'email', 'status', 'type']
	'project':   ['name', 'status', 'priority', 'customer_id', 'project_manager_id']
	'task':      ['title', 'status', 'priority', 'assignee_id', 'project_id', 'sprint_id']
	'sprint':    ['name', 'status', 'project_id', 'start_date', 'end_date']
	'milestone': ['name', 'status', 'priority', 'project_id', 'due_date']
	'issue':     ['title', 'status', 'priority', 'severity', 'assignee_id', 'project_id']
	'team':      ['name', 'status', 'team_type', 'manager_id']
	'agenda':    ['title', 'status', 'start_time', 'organizer_id', 'project_id']
	'chat':      ['name', 'chat_type', 'status', 'owner_id', 'project_id', 'team_id']
}

Searchable fields that should be indexed

const common_queries = {
	'active_projects':    'status IN ("planning", "active")'
	'overdue_tasks':      'due_date < NOW() AND status NOT IN ("done", "cancelled")'
	'current_sprints':    'status = "active" AND start_date <= NOW() AND end_date >= NOW()'
	'pending_milestones': 'status IN ("planning", "in_progress") AND due_date IS NOT NULL'
	'open_issues':        'status NOT IN ("resolved", "closed", "cancelled")'
	'active_teams':       'status = "performing"'
	'upcoming_meetings':  'start_time > NOW() AND status = "scheduled"'
	'active_chats':       'status = "active" AND last_activity > DATE_SUB(NOW(), INTERVAL 30 DAY)'
}

Common query patterns for efficient database access

const max_file_size = 100 * 1024 * 1024 // 100MB

System-wide constants

const max_message_length = 10000
const max_comment_length = 5000
const max_description_length = 10000
const default_page_size = 50
const max_page_size = 1000
const session_timeout_hours = 24
const password_min_length = 8
const username_min_length = 3
const team_max_members = 100
const project_max_tasks = 10000
const sprint_max_duration_days = 30
const chat_max_members = 1000
const health_weights = {
	'project':   {
		'budget':   0.25
		'schedule': 0.25
		'progress': 0.25
		'risk':     0.25
	}
	'sprint':    {
		'completion':  0.4
		'utilization': 0.3
		'impediments': 0.2
		'schedule':    0.1
	}
	'team':      {
		'utilization': 0.25
		'velocity':    0.25
		'goals':       0.25
		'stability':   0.25
	}
	'milestone': {
		'progress':   0.3
		'schedule':   0.25
		'budget':     0.2
		'conditions': 0.15
		'approvals':  0.1
	}
}

Health scoring weights for different metrics

const default_notifications = {
	'task_assigned':      true
	'task_due_soon':      true
	'task_overdue':       true
	'project_milestone':  true
	'sprint_started':     true
	'sprint_ended':       true
	'meeting_reminder':   true
	'chat_mention':       true
	'issue_assigned':     true
	'approval_requested': true
}

Default notification settings

const role_permissions = {
	'admin':   ['*'] // All permissions
	'manager': [
		'create_project',
		'edit_project',
		'delete_project',
		'create_team',
		'edit_team',
		'manage_team_members',
		'create_milestone',
		'edit_milestone',
		'view_reports',
		'export_data',
	]
	'lead':    [
		'create_task',
		'edit_task',
		'assign_task',
		'create_sprint',
		'edit_sprint',
		'create_issue',
		'edit_issue',
		'schedule_meeting',
		'create_chat',
	]
	'member':  [
		'view_project',
		'create_task',
		'edit_own_task',
		'create_issue',
		'comment',
		'upload_file',
		'join_meeting',
		'send_message',
	]
	'viewer':  [
		'view_project',
		'view_task',
		'view_issue',
		'view_meeting',
		'read_message',
	]
}

System roles and their default permissions

fn format_duration #

fn format_duration(minutes int) string

fn truncate_text #

fn truncate_text(text string, max_length int) string

Utility functions for common operations pub fn generate_slug(text string) string { return text.to_lower().replace(' ', '-').replace_each(['/', '\', '?', '#'], '-') }

fn validate_email #

fn validate_email(email string) bool

Validation helpers

fn validate_password #

fn validate_password(password string) bool

pub fn validate_username(username string) bool { return username.len >= username_min_length && username.is_alnum() }

enum ActionItemStatus #

enum ActionItemStatus {
	open
	in_progress
	completed
	cancelled
}

ActionItemStatus for action item tracking

enum AddressType #

enum AddressType {
	billing
	shipping
	office
	home
	other
}

Address types

enum AgendaItemStatus #

enum AgendaItemStatus {
	pending
	in_progress
	completed
	skipped
	deferred
}

AgendaItemStatus for tracking agenda item progress

enum AgendaItemType #

enum AgendaItemType {
	discussion
	presentation
	decision
	information
	brainstorming
	review
	planning
	update
	demo
	training
	break
}

AgendaItemType for categorizing agenda items

enum AgendaStatus #

enum AgendaStatus {
	draft
	scheduled
	confirmed
	in_progress
	completed
	cancelled
	postponed
	no_show
}

AgendaStatus for event lifecycle

enum AgendaType #

enum AgendaType {
	meeting
	appointment
	call
	interview
	presentation
	training
	workshop
	conference
	social
	break
	travel
	focus_time
	review
	planning
	retrospective
	standup
	demo
	one_on_one
	all_hands
	client_meeting
	vendor_meeting
}

AgendaType for categorizing events

enum ApprovalStatus #

enum ApprovalStatus {
	pending
	approved
	rejected
	conditional
	expired
}

ApprovalStatus for approval tracking

enum ApprovalType #

enum ApprovalType {
	technical
	business
	legal
	financial
	quality
	security
	regulatory
}

ApprovalType for categorizing approvals

enum AttendanceType #

enum AttendanceType {
	required
	optional
	informational
	presenter
	facilitator
	note_taker
}

AttendanceType for attendee requirements

enum AttendeeRole #

enum AttendeeRole {
	participant
	presenter
	facilitator
	note_taker
	observer
	decision_maker
	subject_matter_expert
}

AttendeeRole for meeting roles

enum BookingType #

enum BookingType {
	fixed
	flexible
	recurring
	tentative
	blocked
}

BookingType for different booking models

enum ButtonStyle #

enum ButtonStyle {
	default
	primary
	success
	warning
	danger
	link
}

ButtonStyle for button appearance

enum ChatPermission #

enum ChatPermission {
	read_messages
	send_messages
	send_files
	send_links
	mention_all
	delete_messages
	edit_messages
	pin_messages
	invite_members
	remove_members
	manage_settings
	manage_integrations
}

ChatPermission for granular permissions

enum ChatRole #

enum ChatRole {
	member
	moderator
	admin
	owner
	guest
	bot
}

ChatRole for member roles in chat

enum ChatStatus #

enum ChatStatus {
	active
	archived
	locked
	deleted
	suspended
}

ChatStatus for chat lifecycle

enum ChatType #

enum ChatType {
	direct_message
	group_chat
	channel
	announcement
	support
	project_chat
	team_chat
	customer_chat
	incident_chat
	meeting_chat
	thread
}

ChatType for categorizing chats

enum ChatVisibility #

enum ChatVisibility {
	public
	private
	restricted
	invite_only
}

ChatVisibility for access control

enum CommunicationType #

enum CommunicationType {
	update
	alert
	reminder
	announcement
	request
	escalation
}

CommunicationType for categorizing communications

enum ConditionStatus #

enum ConditionStatus {
	pending
	in_progress
	verified
	failed
}

Condition status for milestone requirements

enum ConditionType #

enum ConditionType {
	deliverable
	approval
	test_passed
	documentation
	training
	compliance
	quality_gate
	performance
	security
	legal
}

ConditionType for categorizing conditions

enum ContactType #

enum ContactType {
	primary
	technical
	billing
	support
	other
}

Contact types

enum CustomerStatus #

enum CustomerStatus {
	prospect
	lead
	qualified
	active
	inactive
	archived
}

Customer status in the sales pipeline

enum CustomerType #

enum CustomerType {
	individual
	company
	government
	nonprofit
	partner
}

Customer types for CRM

enum DecisionStatus #

enum DecisionStatus {
	pending
	approved
	rejected
	deferred
	implemented
	under_review
}

DecisionStatus for tracking decision implementation

enum DecisionType #

enum DecisionType {
	strategic
	tactical
	operational
	technical
	financial
	personnel
	process
	product
}

DecisionType for categorizing decisions

enum DeliverableStatus #

enum DeliverableStatus {
	not_started
	in_progress
	draft
	review
	approved
	delivered
	rejected
}

DeliverableStatus for deliverable tracking

enum DeliverableType #

enum DeliverableType {
	document
	software
	design
	report
	presentation
	training_material
	process
	template
	specification
	test_plan
}

DeliverableType for categorizing deliverables

enum DependencyType #

enum DependencyType {
	finish_to_start  // Most common: predecessor must finish before successor starts
	start_to_start   // Both tasks start at the same time
	finish_to_finish // Both tasks finish at the same time
	start_to_finish  // Successor can't finish until predecessor starts
}

DependencyType for task dependencies

enum EventVisibility #

enum EventVisibility {
	public
	private
	confidential
	team_only
	project_only
}

EventVisibility for privacy settings

enum ForecastType #

enum ForecastType {
	weekly
	monthly
	quarterly
	yearly
}

ForecastType for capacity forecasting

enum GoalStatus #

enum GoalStatus {
	draft
	active
	achieved
	missed
	cancelled
	deferred
}

GoalStatus for goal tracking

enum GoalType #

enum GoalType {
	performance
	quality
	delivery
	learning
	process
	culture
	business
	technical
}

GoalType for categorizing team goals

enum HolidayType #

enum HolidayType {
	public
	company
	team
	personal
	sick_leave
	vacation
	training
	conference
}

HolidayType for categorizing holidays

enum ImpedimentStatus #

enum ImpedimentStatus {
	open
	in_progress
	resolved
	cancelled
}

ImpedimentStatus for impediment tracking

enum IntegrationType #

enum IntegrationType {
	webhook
	slack
	teams
	discord
	telegram
	email
	sms
	jira
	github
	gitlab
	jenkins
	monitoring
	custom
}

IntegrationType for different integrations

enum IssueCategory #

enum IssueCategory {
	frontend
	backend
	database
	api
	ui_ux
	performance
	security
	infrastructure
	deployment
	configuration
	integration
	documentation
	testing
	accessibility
	mobile
	desktop
	web
}

IssueCategory for further categorization

enum IssueFrequency #

enum IssueFrequency {
	always
	often
	sometimes
	rarely
	once
	unknown
}

IssueFrequency for tracking how often an issue occurs

enum IssueLinkType #

enum IssueLinkType {
	blocks
	blocked_by
	relates_to
	duplicates
	duplicated_by
	causes
	caused_by
	parent_of
	child_of
	depends_on
	depended_by
	follows
	followed_by
}

IssueLinkType for different types of issue relationships

enum IssueResolution #

enum IssueResolution {
	unresolved
	fixed
	wont_fix
	duplicate
	invalid
	works_as_designed
	cannot_reproduce
	incomplete
	moved
	deferred
}

IssueResolution for tracking how issues were resolved

enum IssueSeverity #

enum IssueSeverity {
	low
	medium
	high
	critical
}

Issue severity levels

enum IssueStatus #

enum IssueStatus {
	open
	in_progress
	resolved
	closed
	reopened
}

Issue status for problem tracking

enum IssueType #

enum IssueType {
	bug
	feature_request
	improvement
	question
	documentation
	support
}

Issue types

enum LogLevel #

enum LogLevel {
	trace
	debug
	info
	warn
	error
	fatal
}

LogLevel for log entry severity

enum MemberStatus #

enum MemberStatus {
	active
	inactive
	on_leave
	temporary
	contractor
	intern
}

MemberStatus for team member status

enum MessageDeliveryStatus #

enum MessageDeliveryStatus {
	sending
	sent
	delivered
	read
	failed
}

MessageDeliveryStatus for tracking message delivery

enum MessagePriority #

enum MessagePriority {
	low
	normal
	high
	urgent
}

MessagePriority for message importance

enum MessageType #

enum MessageType {
	text
	file
	image
	video
	audio
	link
	code
	quote
	poll
	announcement
	system
	bot_response
	task_update
	issue_update
	project_update
	meeting_summary
	reminder
}

MessageType for categorizing messages

enum MetricStatus #

enum MetricStatus {
	not_measured
	measuring
	target_met
	target_exceeded
	target_missed
}

MetricStatus for metric tracking

enum MetricType #

enum MetricType {
	performance
	quality
	cost
	time
	satisfaction
	adoption
	revenue
	efficiency
}

MetricType for categorizing success metrics

enum MilestoneStatus #

enum MilestoneStatus {
	not_started
	in_progress
	completed
	overdue
}

Milestone status

enum MilestoneType #

enum MilestoneType {
	deliverable
	decision_point
	review
	release
	contract
	regulatory
	internal
	external
}

MilestoneType for categorizing milestones

enum NotificationType #

enum NotificationType {
	info
	warning
	error
	success
	task_assigned
	task_completed
	deadline_approaching
	milestone_reached
	comment_added
	mention
}

NotificationType for different kinds of notifications

enum Priority #

enum Priority {
	lowest
	low
	medium
	high
	highest
}

Priority levels used across tasks, issues, and projects

enum ProjectBillingType #

enum ProjectBillingType {
	fixed_price
	time_and_materials
	retainer
	milestone_based
}

ProjectBillingType for different billing models

enum ProjectMethodology #

enum ProjectMethodology {
	agile
	scrum
	kanban
	waterfall
	hybrid
}

ProjectMethodology for project management approach

enum ProjectStatus #

enum ProjectStatus {
	planning
	active
	on_hold
	completed
	cancelled
}

Status for projects

enum RecurrenceEndType #

enum RecurrenceEndType {
	never
	on_date
	after_occurrences
}

RecurrenceEndType for when recurrence ends

enum RecurrenceFrequency #

enum RecurrenceFrequency {
	none
	daily
	weekly
	monthly
	yearly
}

RecurrenceFrequency for agenda recurrence

enum RecurrencePattern #

enum RecurrencePattern {
	none
	daily
	weekly
	monthly
	yearly
	custom
}

RecurrencePattern for different recurrence types

enum ResourceStatus #

enum ResourceStatus {
	available
	booked
	maintenance
	unavailable
}

ResourceStatus for resource availability

enum ResourceType #

enum ResourceType {
	meeting_room
	conference_room
	phone_booth
	desk
	equipment
	vehicle
	catering
	av_equipment
	parking_space
}

ResourceType for categorizing resources

enum ResponseStatus #

enum ResponseStatus {
	pending
	accepted
	declined
	tentative
	no_response
}

ResponseStatus for meeting responses

enum ReviewStatus #

enum ReviewStatus {
	not_reviewed
	under_review
	approved
	rejected
	needs_revision
}

ReviewStatus for deliverable reviews

enum RiskLevel #

enum RiskLevel {
	low
	medium
	high
	critical
}

RiskLevel for project risk assessment

enum RiskStatus #

enum RiskStatus {
	identified
	analyzing
	mitigating
	monitoring
	closed
	realized
}

RiskStatus for risk tracking

enum RiskType #

enum RiskType {
	technical
	schedule
	budget
	resource
	quality
	external
	regulatory
	market
}

RiskType for categorizing risks

enum RitualFrequency #

enum RitualFrequency {
	daily
	weekly
	biweekly
	monthly
	quarterly
	ad_hoc
}

RitualFrequency for ritual scheduling

enum RitualType #

enum RitualType {
	standup
	retrospective
	planning
	review
	one_on_one
	team_meeting
	training
	social
	demo
	sync
}

RitualType for categorizing team rituals

enum SeniorityLevel #

enum SeniorityLevel {
	intern
	junior
	mid_level
	senior
	lead
	principal
	architect
}

SeniorityLevel for team member experience

enum SprintStatus #

enum SprintStatus {
	planning
	active
	completed
	cancelled
}

Sprint status for Scrum methodology

enum TaskStatus #

enum TaskStatus {
	todo
	in_progress
	in_review
	testing
	done
	blocked
}

Status for tasks

enum TaskType #

enum TaskType {
	story
	bug
	epic
	spike
	task
	feature
}

Task types for different kinds of work items

enum TeamStatus #

enum TeamStatus {
	forming
	storming
	norming
	performing
	adjourning
	disbanded
}

TeamStatus for team lifecycle

enum TeamType #

enum TeamType {
	development
	qa
	design
	product
	marketing
	sales
	support
	operations
	security
	data
	research
	management
	cross_functional
}

TeamType for categorizing teams

enum TestResult #

enum TestResult {
	not_executed
	passed
	failed
	blocked
	skipped
}

TestResult for test case results

enum TestType #

enum TestType {
	unit
	integration
	system
	acceptance
	regression
	performance
	security
	usability
	compatibility
}

TestType for categorizing test cases

enum TimeEntryType #

enum TimeEntryType {
	development
	testing
	meeting
	documentation
	support
	training
	other
}

Time entry types

enum ToolCategory #

enum ToolCategory {
	development
	testing
	design
	communication
	project_management
	documentation
	monitoring
	deployment
	security
	analytics
}

ToolCategory for categorizing team tools

enum UserRole #

enum UserRole {
	admin
	project_manager
	developer
	designer
	tester
	analyst
	client
	viewer
}

User roles in the system

enum UserStatus #

enum UserStatus {
	active
	inactive
	suspended
	pending
}

User status

enum WorkaroundComplexity #

enum WorkaroundComplexity {
	simple
	moderate
	complex
	expert_only
}

WorkaroundComplexity for rating workaround complexity

struct ActionButton #

struct ActionButton {
pub mut:
	id           string
	label        string
	style        ButtonStyle
	action       string
	url          string
	confirmation string
}

ActionButton for interactive messages

struct ActionItem #

struct ActionItem {
pub mut:
	description string
	assignee_id int
	due_date    time.Time
	status      ActionItemStatus
	created_at  time.Time
}

ActionItem for retrospective action items

struct Address #

struct Address {
pub mut:
	id          int
	type        AddressType
	label       string // e.g., "Main Office", "Warehouse"
	street      string
	street2     string // Additional address line
	city        string
	state       string
	postal_code string
	country     string
	is_primary  bool
	created_at  time.Time
	updated_at  time.Time
}

Address represents a physical address

struct Agenda #

struct Agenda {
	BaseModel
pub mut:
	title              string @[required]
	description        string
	agenda_type        AgendaType
	status             AgendaStatus
	priority           Priority
	start_time         time.Time
	end_time           time.Time
	all_day            bool
	location           string
	virtual_link       string
	organizer_id       int // User who organized the event
	attendees          []Attendee
	required_attendees []int      // User IDs who must attend
	optional_attendees []int      // User IDs who are optional
	resources          []Resource // Rooms, equipment, etc.
	project_id         int        // Links to Project (optional)
	task_id            int        // Links to Task (optional)
	milestone_id       int        // Links to Milestone (optional)
	sprint_id          int        // Links to Sprint (optional)
	team_id            int        // Links to Team (optional)
	customer_id        int        // Links to Customer (optional)
	recurrence         Recurrence
	reminders          []Reminder
	agenda_items       []AgendaItem
	attachments        []Attachment
	notes              string
	meeting_notes      string
	action_items       []ActionItem
	decisions          []Decision
	recording_url      string
	transcript         string
	follow_up_tasks    []int // Task IDs created from this meeting
	time_zone          string
	visibility         EventVisibility
	booking_type       BookingType
	cost               f64   // Cost of the meeting (room, catering, etc.)
	capacity           int   // Maximum attendees
	waiting_list       []int // User IDs on waiting list
	tags               []string
	custom_fields      map[string]string
}

Agenda represents a calendar event or meeting

fn (Agenda) get_duration #

fn (a Agenda) get_duration() int

get_duration returns the event duration in minutes

fn (Agenda) is_past #

fn (a Agenda) is_past() bool

is_past checks if the event is in the past

fn (Agenda) is_current #

fn (a Agenda) is_current() bool

is_current checks if the event is currently happening

fn (Agenda) is_upcoming #

fn (a Agenda) is_upcoming() bool

is_upcoming checks if the event is in the future

fn (Agenda) get_time_until_start #

fn (a Agenda) get_time_until_start() int

get_time_until_start returns minutes until the event starts

fn (Agenda) has_conflicts #

fn (a Agenda) has_conflicts(other Agenda) bool

has_conflicts checks if this event conflicts with another

fn (Agenda) get_attendee_count #

fn (a Agenda) get_attendee_count() int

get_attendee_count returns the number of attendees

fn (Agenda) get_confirmed_attendees #

fn (a Agenda) get_confirmed_attendees() []Attendee

get_confirmed_attendees returns attendees who have accepted

fn (Agenda) get_attendance_rate #

fn (a Agenda) get_attendance_rate() f32

get_attendance_rate returns the percentage of attendees who actually attended

fn (Agenda) add_attendee #

fn (mut a Agenda) add_attendee(user_id int, attendance_type AttendanceType, role AttendeeRole, by_user_id int)

add_attendee adds an attendee to the event

fn (Agenda) remove_attendee #

fn (mut a Agenda) remove_attendee(user_id int, by_user_id int)

remove_attendee removes an attendee from the event

fn (Agenda) respond_to_invitation #

fn (mut a Agenda) respond_to_invitation(user_id int, response ResponseStatus, note string, by_user_id int)

respond_to_invitation responds to a meeting invitation

fn (Agenda) check_in #

fn (mut a Agenda) check_in(user_id int, by_user_id int)

check_in marks an attendee as present

fn (Agenda) check_out #

fn (mut a Agenda) check_out(user_id int, by_user_id int)

check_out marks an attendee as leaving

fn (Agenda) add_resource #

fn (mut a Agenda) add_resource(resource Resource, by_user_id int)

add_resource adds a resource to the event

fn (Agenda) add_agenda_item #

fn (mut a Agenda) add_agenda_item(title string, description string, item_type AgendaItemType, presenter_id int, duration_minutes int, by_user_id int)

add_agenda_item adds an item to the meeting agenda

fn (Agenda) complete_agenda_item #

fn (mut a Agenda) complete_agenda_item(item_id int, notes string, by_user_id int)

complete_agenda_item marks an agenda item as completed

fn (Agenda) add_decision #

fn (mut a Agenda) add_decision(title string, description string, decision_type DecisionType, decision_maker_id int, participants []int, rationale string, by_user_id int)

add_decision records a decision made during the meeting

fn (Agenda) start_meeting #

fn (mut a Agenda) start_meeting(by_user_id int)

start_meeting starts the meeting

fn (Agenda) end_meeting #

fn (mut a Agenda) end_meeting(meeting_notes string, by_user_id int)

end_meeting ends the meeting

fn (Agenda) cancel_meeting #

fn (mut a Agenda) cancel_meeting(by_user_id int)

cancel_meeting cancels the meeting

fn (Agenda) postpone_meeting #

fn (mut a Agenda) postpone_meeting(new_start_time time.Time, new_end_time time.Time, by_user_id int)

postpone_meeting postpones the meeting

fn (Agenda) add_reminder #

fn (mut a Agenda) add_reminder(reminder_type ReminderType, minutes_before int, by_user_id int)

add_reminder adds a reminder for the event

fn (Agenda) calculate_cost #

fn (a Agenda) calculate_cost() f64

calculate_cost calculates the total cost of the meeting

fn (Agenda) get_next_occurrence #

fn (a Agenda) get_next_occurrence() ?time.Time

get_next_occurrence returns the next occurrence for recurring events

fn (Agenda) is_overbooked #

fn (a Agenda) is_overbooked() bool

is_overbooked checks if the event has more attendees than capacity

fn (Agenda) get_effectiveness_score #

fn (a Agenda) get_effectiveness_score() f32

get_effectiveness_score calculates meeting effectiveness

struct AgendaItem #

struct AgendaItem {
pub mut:
	id               int
	agenda_id        int
	title            string
	description      string
	item_type        AgendaItemType
	presenter_id     int
	duration_minutes int
	order_index      int
	status           AgendaItemStatus
	notes            string
	attachments      []Attachment
	action_items     []ActionItem
	decisions        []Decision
}

AgendaItem represents an item on the meeting agenda

struct Approval #

struct Approval {
pub mut:
	id            int
	milestone_id  int
	title         string
	description   string
	approver_id   int
	approval_type ApprovalType
	status        ApprovalStatus
	requested_at  time.Time
	requested_by  int
	responded_at  time.Time
	comments      string
	conditions    string
	expires_at    time.Time
}

Approval represents an approval required for milestone completion

struct Attachment #

struct Attachment {
pub mut:
	id            int
	filename      string @[required]
	original_name string
	file_path     string @[required]
	file_size     i64
	mime_type     string
	uploaded_by   int // User ID
	uploaded_at   time.Time
	description   string
	is_public     bool // Whether clients can see this attachment
}

Attachment represents a file attached to an entity

struct Attendee #

struct Attendee {
pub mut:
	user_id           int
	agenda_id         int
	attendance_type   AttendanceType
	response_status   ResponseStatus
	response_time     time.Time
	response_note     string
	actual_attendance bool
	check_in_time     time.Time
	check_out_time    time.Time
	role              AttendeeRole
	permissions       []string
	delegate_id       int // User ID if someone else attends on their behalf
	cost              f64 // Cost for this attendee (travel, accommodation, etc.)
}

Attendee represents a meeting attendee

struct AutoModerationSettings #

struct AutoModerationSettings {
pub mut:
	enabled               bool
	spam_detection        bool
	profanity_filter      bool
	link_filtering        bool
	caps_limit            int
	rate_limit_messages   int
	rate_limit_seconds    int
	auto_timeout_duration int
	escalation_threshold  int
}

AutoModerationSettings for automated moderation

struct BaseModel #

struct BaseModel {
pub mut:
	id         int       @[primary; sql: serial]
	created_at time.Time @[sql_type: 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP']
	updated_at time.Time @[sql_type: 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP']
	created_by int               // User ID who created this record
	updated_by int               // User ID who last updated this record
	version    int               // For optimistic locking
	tags       []string          // Flexible tagging system for categorization
	metadata   map[string]string // Extensible key-value data for custom fields
	is_active  bool = true // Soft delete flag
}

BaseModel provides common fields and functionality for all root objects

fn (BaseModel) update_timestamp #

fn (mut base BaseModel) update_timestamp(user_id int)

update_timestamp updates the updated_at field and version for optimistic locking

fn (BaseModel) add_tag #

fn (mut base BaseModel) add_tag(tag string)

add_tag adds a tag if it doesn't already exist

fn (BaseModel) remove_tag #

fn (mut base BaseModel) remove_tag(tag string)

remove_tag removes a tag if it exists

fn (BaseModel) has_tag #

fn (base BaseModel) has_tag(tag string) bool

has_tag checks if a tag exists

fn (BaseModel) set_metadata #

fn (mut base BaseModel) set_metadata(key string, value string)

set_metadata sets a metadata key-value pair

fn (BaseModel) get_metadata #

fn (base BaseModel) get_metadata(key string) ?string

get_metadata gets a metadata value by key

fn (BaseModel) soft_delete #

fn (mut base BaseModel) soft_delete(user_id int)

soft_delete marks the record as inactive instead of deleting it

fn (BaseModel) restore #

fn (mut base BaseModel) restore(user_id int)

restore reactivates a soft-deleted record

struct BurndownPoint #

struct BurndownPoint {
pub mut:
	date             time.Time
	remaining_points int
	remaining_hours  f32
	completed_points int
	added_points     int // Points added during sprint
	removed_points   int // Points removed during sprint
}

BurndownPoint for burndown chart data

struct CapacityForecast #

struct CapacityForecast {
pub mut:
	period_start       time.Time
	period_end         time.Time
	forecast_type      ForecastType
	total_capacity     f32
	available_capacity f32
	planned_allocation f32
	confidence_level   f32 // 0.0 to 1.0
	assumptions        []string
	risks              []string
}

CapacityForecast for future capacity planning

struct Card #

struct Card {
pub mut:
	title     string
	subtitle  string
	text      string
	image_url string
	actions   []ActionButton
	facts     []CardFact
}

Card for rich card content

struct CardFact #

struct CardFact {
pub mut:
	name  string
	value string
}

CardFact for key-value pairs in cards

struct Chat #

struct Chat {
	BaseModel
pub mut:
	name            string @[required]
	description     string
	chat_type       ChatType
	status          ChatStatus
	visibility      ChatVisibility
	owner_id        int // User who owns/created the chat
	members         []ChatMember
	messages        []Message
	project_id      int // Links to Project (optional)
	team_id         int // Links to Team (optional)
	customer_id     int // Links to Customer (optional)
	task_id         int // Links to Task (optional)
	issue_id        int // Links to Issue (optional)
	milestone_id    int // Links to Milestone (optional)
	sprint_id       int // Links to Sprint (optional)
	agenda_id       int // Links to Agenda (optional)
	settings        ChatSettings
	integrations    []ChatIntegration
	pinned_messages []int // Message IDs that are pinned
	archived_at     time.Time
	last_activity   time.Time
	message_count   int
	file_count      int
	custom_fields   map[string]string
}

Chat represents a communication channel or conversation

fn (Chat) get_unread_count #

fn (c Chat) get_unread_count(user_id int) int

get_unread_count returns unread message count for a user

fn (Chat) is_member #

fn (c Chat) is_member(user_id int) bool

is_member checks if a user is a member of the chat

fn (Chat) has_permission #

fn (c Chat) has_permission(user_id int, permission ChatPermission) bool

has_permission checks if a user has a specific permission

fn (Chat) get_member_role #

fn (c Chat) get_member_role(user_id int) ?ChatRole

get_member_role returns a user's role in the chat

fn (Chat) add_member #

fn (mut c Chat) add_member(user_id int, role ChatRole, permissions []ChatPermission, invited_by int, by_user_id int)

add_member adds a member to the chat

fn (Chat) remove_member #

fn (mut c Chat) remove_member(user_id int, by_user_id int)

remove_member removes a member from the chat

fn (Chat) send_message #

fn (mut c Chat) send_message(sender_id int, content string, message_type MessageType, thread_id int, reply_to_id int, mentions []int, attachments []Attachment, by_user_id int) int

send_message sends a message to the chat

fn (Chat) edit_message #

fn (mut c Chat) edit_message(message_id int, new_content string, by_user_id int) bool

edit_message edits an existing message

fn (Chat) delete_message #

fn (mut c Chat) delete_message(message_id int, by_user_id int) bool

delete_message deletes a message

fn (Chat) pin_message #

fn (mut c Chat) pin_message(message_id int, by_user_id int) bool

pin_message pins a message

fn (Chat) add_reaction #

fn (mut c Chat) add_reaction(message_id int, user_id int, emoji string, by_user_id int)

add_reaction adds a reaction to a message

fn (Chat) mark_as_read #

fn (mut c Chat) mark_as_read(user_id int, message_id int, by_user_id int)

mark_as_read marks messages as read for a user

fn (Chat) mute_chat #

fn (mut c Chat) mute_chat(user_id int, until time.Time, by_user_id int)

mute_chat mutes the chat for a user

fn (Chat) archive_chat #

fn (mut c Chat) archive_chat(by_user_id int)

archive_chat archives the chat

fn (Chat) add_integration #

fn (mut c Chat) add_integration(integration_type IntegrationType, name string, webhook_url string, settings map[string]string, by_user_id int)

add_integration adds an external integration

fn (Chat) get_activity_level #

fn (c Chat) get_activity_level() string

get_activity_level returns chat activity level

fn (Chat) get_engagement_score #

fn (c Chat) get_engagement_score() f32

get_engagement_score calculates engagement score

struct ChatIntegration #

struct ChatIntegration {
pub mut:
	id               int
	chat_id          int
	integration_type IntegrationType
	name             string
	description      string
	webhook_url      string
	api_key          string
	settings         map[string]string
	enabled          bool
	created_by       int
	created_at       time.Time
	last_used        time.Time
	error_count      int
	last_error       string
}

ChatIntegration for external service integrations

struct ChatMember #

struct ChatMember {
pub mut:
	user_id               int
	chat_id               int
	role                  ChatRole
	permissions           []ChatPermission
	joined_at             time.Time
	last_read_at          time.Time
	last_read_message_id  int
	notification_settings NotificationSettings
	status                MemberStatus
	invited_by            int
	muted                 bool
	muted_until           time.Time
	custom_title          string
}

ChatMember represents a member of a chat

struct ChatSettings #

struct ChatSettings {
pub mut:
	allow_guests           bool
	require_approval       bool
	message_retention_days int
	file_retention_days    int
	max_members            int
	slow_mode_seconds      int
	profanity_filter       bool
	link_preview           bool
	emoji_reactions        bool
	threading              bool
	message_editing        bool
	message_deletion       bool
	file_uploads           bool
	external_sharing       bool
	read_receipts          bool
	typing_indicators      bool
	welcome_message        string
	rules                  []string
	auto_moderation        AutoModerationSettings
}

ChatSettings for chat configuration

struct Comment #

struct Comment {
pub mut:
	id          int
	author_id   int    @[required]
	content     string @[required]
	timestamp   time.Time
	is_internal bool // Internal comments not visible to clients
	is_edited   bool
	edited_at   time.Time
	parent_id   int // For threaded comments
}

Comment represents a comment on tasks, issues, or other entities

struct Communication #

struct Communication {
pub mut:
	id                 int
	milestone_id       int
	title              string
	message            string
	communication_type CommunicationType
	sender_id          int
	recipients         []int
	sent_at            time.Time
	channel            string
	priority           Priority
	read_by            []int // User IDs who have read this communication
}

Communication represents communication about the milestone

struct Condition #

struct Condition {
pub mut:
	id                  int
	milestone_id        int
	title               string
	description         string
	condition_type      ConditionType
	status              ConditionStatus
	required            bool // Is this condition mandatory?
	weight              f32  // Weight in milestone completion (0.0 to 1.0)
	assigned_to         int  // User responsible for this condition
	due_date            time.Time
	completed_date      time.Time
	verification_method string
	evidence            []string // URLs, file paths, or descriptions of evidence
	notes               string
	created_at          time.Time
	created_by          int
}

Condition represents a condition that must be met for milestone completion

struct Condition1 #

struct Condition1 {
pub mut:
	id             int
	milestone_id   int    @[required]
	description    string @[required]
	status         ConditionStatus
	verification   string // How to verify this condition is met
	responsible_id int    // User ID responsible for this condition
	due_date       time.Time
	completed_at   time.Time
	notes          string
	created_at     time.Time
	updated_at     time.Time
}

Condition represents a requirement that must be met for a milestone

struct Contact #

struct Contact {
pub mut:
	id         int
	name       string @[required]
	email      string
	phone      string
	mobile     string
	role       string
	department string
	type       ContactType
	is_primary bool
	notes      string
	created_at time.Time
	updated_at time.Time
}

Contact represents a person associated with a customer or organization

struct Customer #

struct Customer {
	BaseModel
pub mut:
	name               string @[required]
	type               CustomerType
	status             CustomerStatus
	industry           string
	website            string
	description        string
	contacts           []Contact
	addresses          []Address
	projects           []int // Project IDs associated with this customer
	total_value        f64   // Total contract value
	annual_value       f64   // Annual recurring revenue
	payment_terms      string
	tax_id             string
	account_manager_id int // User ID of account manager
	lead_source        string
	acquisition_date   time.Time
	last_contact_date  time.Time
	next_followup_date time.Time
	credit_limit       f64
	payment_method     string
	billing_cycle      string // monthly, quarterly, annually
	notes              string
	logo_url           string
	social_media       map[string]string // platform -> URL
	custom_fields      map[string]string // Flexible custom data
}

Customer represents a client or prospect in the CRM system

fn (Customer) get_primary_contact #

fn (c Customer) get_primary_contact() ?Contact

get_primary_contact returns the primary contact for this customer

fn (Customer) get_primary_address #

fn (c Customer) get_primary_address() ?Address

get_primary_address returns the primary address for this customer

fn (Customer) add_contact #

fn (mut c Customer) add_contact(contact Contact)

add_contact adds a new contact to the customer

fn (Customer) update_contact #

fn (mut c Customer) update_contact(contact_id int, updated_contact Contact) bool

update_contact updates an existing contact

fn (Customer) remove_contact #

fn (mut c Customer) remove_contact(contact_id int) bool

remove_contact removes a contact by ID

fn (Customer) add_address #

fn (mut c Customer) add_address(address Address)

add_address adds a new address to the customer

fn (Customer) update_address #

fn (mut c Customer) update_address(address_id int, updated_address Address) bool

update_address updates an existing address

fn (Customer) remove_address #

fn (mut c Customer) remove_address(address_id int) bool

remove_address removes an address by ID

fn (Customer) add_project #

fn (mut c Customer) add_project(project_id int)

add_project associates a project with this customer

fn (Customer) remove_project #

fn (mut c Customer) remove_project(project_id int)

remove_project removes a project association

fn (Customer) has_project #

fn (c Customer) has_project(project_id int) bool

has_project checks if a project is associated with this customer

fn (Customer) is_active_customer #

fn (c Customer) is_active_customer() bool

is_active_customer checks if the customer is currently active

fn (Customer) is_prospect #

fn (c Customer) is_prospect() bool

is_prospect checks if the customer is still a prospect

fn (Customer) convert_to_customer #

fn (mut c Customer) convert_to_customer(by_user_id int)

convert_to_customer converts a prospect to an active customer

fn (Customer) update_last_contact #

fn (mut c Customer) update_last_contact(by_user_id int)

update_last_contact updates the last contact date

fn (Customer) set_next_followup #

fn (mut c Customer) set_next_followup(followup_date time.Time, by_user_id int)

set_next_followup sets the next followup date

fn (Customer) is_followup_due #

fn (c Customer) is_followup_due() bool

is_followup_due checks if a followup is due

fn (Customer) calculate_lifetime_value #

fn (c Customer) calculate_lifetime_value(projects []Project) f64

calculate_lifetime_value calculates the total value from all projects

fn (Customer) get_contact_by_type #

fn (c Customer) get_contact_by_type(contact_type ContactType) []Contact

get_contact_by_type returns contacts of a specific type

fn (Customer) get_address_by_type #

fn (c Customer) get_address_by_type(address_type AddressType) []Address

get_address_by_type returns addresses of a specific type

fn (Customer) set_account_manager #

fn (mut c Customer) set_account_manager(user_id int, by_user_id int)

set_account_manager assigns an account manager to this customer

fn (Customer) add_social_media #

fn (mut c Customer) add_social_media(platform string, url string)

add_social_media adds a social media link

fn (Customer) get_social_media #

fn (c Customer) get_social_media(platform string) ?string

get_social_media gets a social media URL by platform

fn (Customer) set_custom_field #

fn (mut c Customer) set_custom_field(field string, value string)

set_custom_field sets a custom field value

fn (Customer) get_custom_field #

fn (c Customer) get_custom_field(field string) ?string

get_custom_field gets a custom field value

struct DailyStandup #

struct DailyStandup {
pub mut:
	date             time.Time
	facilitator_id   int
	participants     []int // User IDs
	updates          []StandupUpdate
	impediments      []int // Impediment IDs discussed
	duration_minutes int
	notes            string
}

DailyStandup for daily standup meeting data

struct Decision #

struct Decision {
pub mut:
	id                  int
	agenda_id           int
	agenda_item_id      int
	title               string
	description         string
	decision_type       DecisionType
	decision_maker_id   int
	participants        []int // User IDs involved in decision
	rationale           string
	alternatives        []string
	impact              string
	implementation_date time.Time
	review_date         time.Time
	status              DecisionStatus
	follow_up_tasks     []int // Task IDs for implementation
	created_at          time.Time
	created_by          int
}

Decision represents a decision made during a meeting

struct Deliverable #

struct Deliverable {
pub mut:
	id                  int
	milestone_id        int
	name                string
	description         string
	deliverable_type    DeliverableType
	status              DeliverableStatus
	assigned_to         int
	due_date            time.Time
	completed_date      time.Time
	file_path           string
	url                 string
	size_estimate       string
	quality_criteria    []string
	acceptance_criteria []string
	review_status       ReviewStatus
	reviewer_id         int
	review_notes        string
	version             string
	created_at          time.Time
	created_by          int
}

Deliverable represents a specific deliverable for a milestone

struct Embed #

struct Embed {
pub mut:
	title         string
	description   string
	url           string
	thumbnail_url string
	image_url     string
	video_url     string
	author_name   string
	author_url    string
	color         string
	fields        []EmbedField
	footer_text   string
	timestamp     time.Time
}

Embed for rich content embeds

struct EmbedField #

struct EmbedField {
pub mut:
	name   string
	value  string
	inline bool
}

EmbedField for structured embed data

struct GoalMilestone #

struct GoalMilestone {
pub mut:
	title          string
	target_date    time.Time
	target_value   f64
	achieved       bool
	achieved_date  time.Time
	achieved_value f64
}

GoalMilestone represents milestones within team goals

struct Holiday #

struct Holiday {
pub mut:
	name            string
	date            time.Time
	end_date        time.Time // For multi-day holidays
	holiday_type    HolidayType
	affects_members []int // User IDs affected (empty = all)
	description     string
}

Holiday represents team holidays and time off

struct Impediment #

struct Impediment {
pub mut:
	id          int
	sprint_id   int
	title       string
	description string
	reported_by int
	assigned_to int
	status      ImpedimentStatus
	severity    Priority
	reported_at time.Time
	resolved_at time.Time
	resolution  string
}

Impediment for tracking sprint impediments

struct Issue #

struct Issue {
	BaseModel
pub mut:
	title                  string @[required]
	description            string
	project_id             int // Links to Project
	task_id                int // Links to Task (optional)
	sprint_id              int // Links to Sprint (optional)
	reporter_id            int // User who reported the issue
	assignee_id            int // User assigned to resolve the issue
	status                 IssueStatus
	priority               Priority
	severity               Severity
	issue_type             IssueType
	category               IssueCategory
	resolution             IssueResolution
	resolution_description string
	environment            string // Environment where issue occurred
	version                string // Version where issue was found
	fixed_version          string // Version where issue was fixed
	component              string // Component/module affected
	labels                 []int  // Label IDs
	affects_versions       []string
	fix_versions           []string
	due_date               time.Time
	resolved_date          time.Time
	closed_date            time.Time
	estimated_hours        f32
	actual_hours           f32
	story_points           int   // For estimation
	watchers               []int // User IDs watching this issue
	linked_issues          []IssueLink
	duplicates             []int // Issue IDs that are duplicates of this
	duplicated_by          int   // Issue ID that this duplicates
	parent_issue_id        int   // For sub-issues
	sub_issues             []int // Sub-issue IDs
	time_entries           []TimeEntry
	comments               []Comment
	attachments            []Attachment
	workarounds            []Workaround
	test_cases             []TestCase
	steps_to_reproduce     []string
	expected_behavior      string
	actual_behavior        string
	additional_info        string
	browser                string
	operating_system       string
	device_info            string
	network_info           string
	user_agent             string
	screen_resolution      string
	logs                   []LogEntry
	stack_trace            string
	error_message          string
	frequency              IssueFrequency
	impact_users           int // Number of users affected
	business_impact        string
	technical_debt         bool // Is this technical debt?
	security_issue         bool // Is this a security issue?
	performance_issue      bool // Is this a performance issue?
	accessibility_issue    bool // Is this an accessibility issue?
	regression             bool // Is this a regression?
	custom_fields          map[string]string
}

Issue represents a problem, bug, or concern in the system

fn (Issue) is_overdue #

fn (i Issue) is_overdue() bool

is_overdue checks if the issue is past its due date

fn (Issue) is_open #

fn (i Issue) is_open() bool

is_open checks if the issue is in an open state

fn (Issue) is_critical #

fn (i Issue) is_critical() bool

is_critical checks if the issue is critical

fn (Issue) get_age #

fn (i Issue) get_age() int

get_age returns the age of the issue in days

fn (Issue) get_resolution_time #

fn (i Issue) get_resolution_time() f32

get_resolution_time returns the time to resolve in hours

fn (Issue) get_time_to_close #

fn (i Issue) get_time_to_close() f32

get_time_to_close returns the time to close in hours

fn (Issue) assign_to #

fn (mut i Issue) assign_to(user_id int, by_user_id int)

assign_to assigns the issue to a user

fn (Issue) unassign #

fn (mut i Issue) unassign(by_user_id int)

unassign removes the assignee from the issue

fn (Issue) add_watcher #

fn (mut i Issue) add_watcher(user_id int, by_user_id int)

add_watcher adds a user to watch this issue

fn (Issue) remove_watcher #

fn (mut i Issue) remove_watcher(user_id int, by_user_id int)

remove_watcher removes a user from watching this issue

fn (Issue) start_work #

fn (mut i Issue) start_work(by_user_id int)

start_work starts work on the issue

fn (Issue) resolve_issue #

fn (mut i Issue) resolve_issue(resolution IssueResolution, resolution_description string, fixed_version string, by_user_id int)

resolve_issue resolves the issue

fn (Issue) close_issue #

fn (mut i Issue) close_issue(by_user_id int)

close_issue closes the issue

fn (Issue) reopen_issue #

fn (mut i Issue) reopen_issue(by_user_id int)

reopen_issue reopens a resolved/closed issue

fn (Issue) cancel_issue #

fn (mut i Issue) cancel_issue(by_user_id int)

cancel_issue cancels the issue

fn (Issue) mark_as_duplicate #

fn (mut i Issue) mark_as_duplicate(original_issue_id int, by_user_id int)

mark_as_duplicate marks this issue as a duplicate of another

fn (Issue) add_duplicate #

fn (mut i Issue) add_duplicate(duplicate_issue_id int, by_user_id int)

add_duplicate adds an issue as a duplicate of this one

fn (Issue) log_time #

fn (mut i Issue) log_time(user_id int, hours f32, description string, date time.Time, by_user_id int)

log_time adds a time entry to the issue

fn (Issue) add_comment #

fn (mut i Issue) add_comment(user_id int, content string, by_user_id int)

add_comment adds a comment to the issue

fn (Issue) add_attachment #

fn (mut i Issue) add_attachment(filename string, file_path string, file_size int, mime_type string, by_user_id int)

add_attachment adds an attachment to the issue

fn (Issue) add_workaround #

fn (mut i Issue) add_workaround(title string, description string, steps []string, effectiveness f32, complexity WorkaroundComplexity, temporary bool, by_user_id int)

add_workaround adds a workaround for the issue

fn (Issue) add_test_case #

fn (mut i Issue) add_test_case(title string, description string, preconditions []string, steps []string, expected_result string, test_type TestType, automated bool, by_user_id int)

add_test_case adds a test case for the issue

fn (Issue) add_log_entry #

fn (mut i Issue) add_log_entry(timestamp time.Time, level LogLevel, message string, source string, thread string, user_id int, session_id string, request_id string, additional_data map[string]string)

add_log_entry adds a log entry to the issue

fn (Issue) set_due_date #

fn (mut i Issue) set_due_date(due_date time.Time, by_user_id int)

set_due_date sets the due date for the issue

fn (Issue) escalate #

fn (mut i Issue) escalate(new_priority Priority, by_user_id int)

escalate escalates the issue priority

fn (Issue) calculate_priority_score #

fn (i Issue) calculate_priority_score() f32

calculate_priority_score calculates a priority score based on various factors

fn (Issue) get_sla_status #

fn (i Issue) get_sla_status() string

get_sla_status returns SLA compliance status

struct Label #

struct Label {
pub mut:
	id          int
	name        string @[required]
	color       string // Hex color code
	description string
	created_at  time.Time
}

Label for flexible categorization

struct LogEntry #

struct LogEntry {
pub mut:
	timestamp       time.Time
	level           LogLevel
	message         string
	source          string
	thread          string
	user_id         int
	session_id      string
	request_id      string
	additional_data map[string]string
}

LogEntry represents a log entry related to an issue

struct Message #

struct Message {
	BaseModel
pub mut:
	chat_id         int
	sender_id       int
	content         string
	message_type    MessageType
	thread_id       int   // For threaded conversations
	reply_to_id     int   // Message this is replying to
	mentions        []int // User IDs mentioned in message
	attachments     []Attachment
	reactions       []Reaction
	edited_at       time.Time
	edited_by       int
	deleted_at      time.Time
	deleted_by      int
	pinned          bool
	pinned_at       time.Time
	pinned_by       int
	forwarded_from  int       // Original message ID if forwarded
	scheduled_at    time.Time // For scheduled messages
	delivery_status MessageDeliveryStatus
	read_by         []MessageRead
	priority        MessagePriority
	expires_at      time.Time // For ephemeral messages
	rich_content    RichContent
	system_message  bool   // Is this a system-generated message?
	bot_message     bool   // Is this from a bot?
	external_id     string // ID from external system (Slack, Teams, etc.)
}

Message represents a chat message

struct Message1 #

struct Message1 {
pub mut:
	id           int
	chat_id      int    @[required]
	sender_id    int    @[required]
	content      string @[required]
	timestamp    time.Time
	message_type MessageType
	attachments  []Attachment
	reactions    []Reaction
	thread_id    int // For threaded conversations
	is_edited    bool
	edited_at    time.Time
	mentions     []int // User IDs mentioned in the message
}

Message represents a chat message

struct MessageRead #

struct MessageRead {
pub mut:
	user_id    int
	message_id int
	read_at    time.Time
	device     string
}

MessageRead tracks who has read a message

struct MetricDataPoint #

struct MetricDataPoint {
pub mut:
	timestamp time.Time
	value     f64
	period    string // "2024-Q1", "2024-01", etc.
}

MetricDataPoint for metric history

struct Milestone #

struct Milestone {
	BaseModel
pub mut:
	name                string @[required]
	description         string
	project_id          int // Links to Project
	status              MilestoneStatus
	priority            Priority
	milestone_type      MilestoneType
	due_date            time.Time
	completed_date      time.Time
	progress            f32         // 0.0 to 1.0
	owner_id            int         // User responsible for this milestone
	stakeholders        []int       // User IDs of stakeholders
	conditions          []Condition // Conditions that must be met
	deliverables        []Deliverable
	dependencies        []MilestoneDependency
	tasks               []int // Task IDs associated with this milestone
	budget              f64   // Budget allocated to this milestone
	actual_cost         f64   // Actual cost incurred
	estimated_hours     f32   // Estimated effort in hours
	actual_hours        f32   // Actual effort spent
	acceptance_criteria []string
	success_metrics     []SuccessMetric
	risks               []Risk
	approvals           []Approval
	communications      []Communication
	review_notes        string
	lessons_learned     string
	custom_fields       map[string]string
}

Milestone represents a significant project goal or deliverable

fn (Milestone) is_overdue #

fn (m Milestone) is_overdue() bool

is_overdue checks if the milestone is past its due date

fn (Milestone) get_completion_percentage #

fn (m Milestone) get_completion_percentage() f32

get_completion_percentage calculates completion based on conditions

fn (Milestone) get_days_until_due #

fn (m Milestone) get_days_until_due() int

get_days_until_due returns days until due date

fn (Milestone) get_budget_variance #

fn (m Milestone) get_budget_variance() f64

get_budget_variance returns budget variance

fn (Milestone) is_over_budget #

fn (m Milestone) is_over_budget() bool

is_over_budget checks if milestone is over budget

fn (Milestone) add_condition #

fn (mut m Milestone) add_condition(title string, description string, condition_type ConditionType, required bool, weight f32, assigned_to int, due_date time.Time, by_user_id int)

add_condition adds a condition to the milestone

fn (Milestone) complete_condition #

fn (mut m Milestone) complete_condition(condition_id int, evidence []string, notes string, by_user_id int) bool

complete_condition marks a condition as completed

fn (Milestone) add_deliverable #

fn (mut m Milestone) add_deliverable(name string, description string, deliverable_type DeliverableType, assigned_to int, due_date time.Time, by_user_id int)

add_deliverable adds a deliverable to the milestone

fn (Milestone) complete_deliverable #

fn (mut m Milestone) complete_deliverable(deliverable_id int, file_path string, url string, version string, by_user_id int) bool

complete_deliverable marks a deliverable as completed

fn (Milestone) add_dependency #

fn (mut m Milestone) add_dependency(depends_on_milestone_id int, dep_type DependencyType, by_user_id int)

add_dependency adds a dependency to this milestone

fn (Milestone) add_stakeholder #

fn (mut m Milestone) add_stakeholder(user_id int, by_user_id int)

add_stakeholder adds a stakeholder to the milestone

fn (Milestone) request_approval #

fn (mut m Milestone) request_approval(title string, description string, approver_id int, approval_type ApprovalType, expires_at time.Time, by_user_id int)

request_approval requests an approval for the milestone

fn (Milestone) approve #

fn (mut m Milestone) approve(approval_id int, comments string, conditions string, by_user_id int) bool

approve grants an approval

fn (Milestone) start_milestone #

fn (mut m Milestone) start_milestone(by_user_id int)

start_milestone starts work on the milestone

fn (Milestone) complete_milestone #

fn (mut m Milestone) complete_milestone(by_user_id int)

complete_milestone marks the milestone as completed

fn (Milestone) calculate_health #

fn (m Milestone) calculate_health() f32

calculate_health returns a health score for the milestone

fn (Milestone) get_health_status #

fn (m Milestone) get_health_status() string

get_health_status returns a human-readable health status

struct MilestoneDependency #

struct MilestoneDependency {
pub mut:
	milestone_id            int
	depends_on_milestone_id int
	dependency_type         DependencyType
	created_at              time.Time
	created_by              int
}

MilestoneDependency represents dependencies between milestones

struct Notification #

struct Notification {
pub mut:
	id          int
	user_id     int    @[required]
	title       string @[required]
	message     string @[required]
	type        NotificationType
	entity_type string // e.g., "task", "project", "issue"
	entity_id   int
	is_read     bool
	created_at  time.Time
	read_at     time.Time
}

Notification represents a system notification

struct NotificationSettings #

struct NotificationSettings {
pub mut:
	all_messages          bool
	mentions_only         bool
	direct_messages       bool
	keywords              []string
	mute_until            time.Time
	email_notifications   bool
	push_notifications    bool
	desktop_notifications bool
	sound_enabled         bool
	vibration_enabled     bool
}

NotificationSettings for member notification preferences

struct Poll #

struct Poll {
pub mut:
	id              int
	question        string
	options         []PollOption
	multiple_choice bool
	anonymous       bool
	expires_at      time.Time
	created_by      int
	created_at      time.Time
}

Poll for interactive polls

struct PollOption #

struct PollOption {
pub mut:
	id         int
	text       string
	votes      []PollVote
	vote_count int
}

PollOption for poll choices

struct PollVote #

struct PollVote {
pub mut:
	user_id   int
	option_id int
	voted_at  time.Time
}

PollVote for tracking poll votes

struct Project #

struct Project {
	BaseModel
pub mut:
	name               string @[required]
	description        string
	customer_id        int // Links to Customer
	status             ProjectStatus
	priority           Priority
	start_date         time.Time
	end_date           time.Time
	actual_start_date  time.Time
	actual_end_date    time.Time
	budget             f64
	actual_cost        f64
	estimated_hours    f32
	actual_hours       f32
	progress           f32           // 0.0 to 1.0
	milestones         []int         // Milestone IDs
	sprints            []int         // Sprint IDs
	tasks              []int         // Task IDs
	issues             []int         // Issue IDs
	team_members       []ProjectRole // Users and their roles in this project
	project_manager_id int           // User ID of project manager
	client_contact_id  int           // Contact ID from customer
	billing_type       ProjectBillingType
	hourly_rate        f64 // Default hourly rate for this project
	currency           string = 'USD'
	risk_level         RiskLevel
	methodology        ProjectMethodology
	repository_url     string
	documentation_url  string
	slack_channel      string
	custom_fields      map[string]string
	labels             []int // Label IDs
}

Project represents a project in the system

fn (Project) get_duration #

fn (p Project) get_duration() int

get_duration returns the planned duration in days

fn (Project) get_actual_duration #

fn (p Project) get_actual_duration() int

get_actual_duration returns the actual duration in days

fn (Project) is_overdue #

fn (p Project) is_overdue() bool

is_overdue checks if the project is past its end date

fn (Project) is_over_budget #

fn (p Project) is_over_budget() bool

is_over_budget checks if the project is over budget

fn (Project) get_budget_variance #

fn (p Project) get_budget_variance() f64

get_budget_variance returns the budget variance (positive = under budget, negative = over budget)

fn (Project) get_budget_variance_percentage #

fn (p Project) get_budget_variance_percentage() f64

get_budget_variance_percentage returns the budget variance as a percentage

fn (Project) get_schedule_variance #

fn (p Project) get_schedule_variance() int

get_schedule_variance returns schedule variance in days

fn (Project) add_team_member #

fn (mut p Project) add_team_member(user_id int, role string, permissions []string)

add_team_member adds a user to the project with a specific role

fn (Project) remove_team_member #

fn (mut p Project) remove_team_member(user_id int) bool

remove_team_member removes a user from the project

fn (Project) has_team_member #

fn (p Project) has_team_member(user_id int) bool

has_team_member checks if a user is a team member

fn (Project) get_team_member_role #

fn (p Project) get_team_member_role(user_id int) ?string

get_team_member_role returns the role of a team member

fn (Project) add_milestone #

fn (mut p Project) add_milestone(milestone_id int)

add_milestone adds a milestone to the project

fn (Project) remove_milestone #

fn (mut p Project) remove_milestone(milestone_id int)

remove_milestone removes a milestone from the project

fn (Project) add_sprint #

fn (mut p Project) add_sprint(sprint_id int)

add_sprint adds a sprint to the project

fn (Project) remove_sprint #

fn (mut p Project) remove_sprint(sprint_id int)

remove_sprint removes a sprint from the project

fn (Project) add_task #

fn (mut p Project) add_task(task_id int)

add_task adds a task to the project

fn (Project) remove_task #

fn (mut p Project) remove_task(task_id int)

remove_task removes a task from the project

fn (Project) add_issue #

fn (mut p Project) add_issue(issue_id int)

add_issue adds an issue to the project

fn (Project) remove_issue #

fn (mut p Project) remove_issue(issue_id int)

remove_issue removes an issue from the project

fn (Project) start_project #

fn (mut p Project) start_project(by_user_id int)

start_project marks the project as started

fn (Project) complete_project #

fn (mut p Project) complete_project(by_user_id int)

complete_project marks the project as completed

fn (Project) cancel_project #

fn (mut p Project) cancel_project(by_user_id int)

cancel_project marks the project as cancelled

fn (Project) put_on_hold #

fn (mut p Project) put_on_hold(by_user_id int)

put_on_hold puts the project on hold

fn (Project) update_progress #

fn (mut p Project) update_progress(progress f32, by_user_id int)

update_progress updates the project progress

fn (Project) add_cost #

fn (mut p Project) add_cost(amount f64, by_user_id int)

add_cost adds to the actual cost

fn (Project) add_hours #

fn (mut p Project) add_hours(hours f32, by_user_id int)

add_hours adds to the actual hours

fn (Project) calculate_health #

fn (p Project) calculate_health() f32

calculate_health returns a project health score based on various factors

fn (Project) get_health_status #

fn (p Project) get_health_status() string

get_health_status returns a human-readable health status

struct ProjectRole #

struct ProjectRole {
pub mut:
	user_id     int    @[required]
	project_id  int    @[required]
	role        string @[required] // e.g., "lead", "developer", "tester"
	permissions []string // Specific permissions for this project
	assigned_at time.Time
}

ProjectRole represents a user's role in a specific project

struct Reaction #

struct Reaction {
pub mut:
	id         int
	message_id int
	user_id    int
	emoji      string
	created_at time.Time
}

Reaction represents an emoji reaction to a message

struct Reaction1 #

struct Reaction1 {
pub mut:
	id         int
	message_id int    @[required]
	user_id    int    @[required]
	emoji      string @[required]
	timestamp  time.Time
}

Reaction represents an emoji reaction to a message

struct Recurrence #

struct Recurrence {
pub mut:
	pattern          RecurrencePattern
	interval         int   // Every N days/weeks/months
	days_of_week     []int // 0=Sunday, 1=Monday, etc.
	day_of_month     int   // For monthly recurrence
	week_of_month    int   // First, second, third, fourth, last week
	months           []int // For yearly recurrence
	end_type         RecurrenceEndType
	end_date         time.Time
	occurrence_count int
	exceptions       []time.Time // Dates to skip
	modifications    []RecurrenceModification
}

Recurrence represents recurring event patterns

struct RecurrenceModification #

struct RecurrenceModification {
pub mut:
	original_date     time.Time
	new_start_time    time.Time
	new_end_time      time.Time
	cancelled         bool
	title_override    string
	location_override string
}

RecurrenceModification for modifying specific occurrences

struct RecurrenceRule #

struct RecurrenceRule {
pub mut:
	frequency    RecurrenceFrequency
	interval     int = 1 // Every N frequency units
	end_date     time.Time
	count        int   // Number of occurrences
	days_of_week []int // 0=Sunday, 1=Monday, etc.
	day_of_month int
}

RecurrenceRule for recurring agenda items

struct Reminder #

struct Reminder {
pub mut:
	id        int
	agenda_id int @[required]
	user_id   int @[required]
	remind_at time.Time
	message   string
	is_sent   bool
	sent_at   time.Time
}

Reminder for agenda items

struct Resource #

struct Resource {
pub mut:
	id             int
	name           string
	resource_type  ResourceType
	location       string
	capacity       int
	cost_per_hour  f64
	booking_status ResourceStatus
	equipment      []string
	requirements   []string
	contact_person string
	booking_notes  string
}

Resource represents a bookable resource

struct RichContent #

struct RichContent {
pub mut:
	formatted_text string // HTML or markdown
	embeds         []Embed
	buttons        []ActionButton
	cards          []Card
	polls          []Poll
}

RichContent for rich message formatting

struct Risk #

struct Risk {
pub mut:
	id               int
	milestone_id     int
	title            string
	description      string
	risk_type        RiskType
	probability      f32 // 0.0 to 1.0
	impact           f32 // 0.0 to 1.0
	risk_score       f32 // probability * impact
	status           RiskStatus
	owner_id         int
	mitigation_plan  string
	contingency_plan string
	identified_at    time.Time
	identified_by    int
	reviewed_at      time.Time
	reviewed_by      int
}

Risk represents a risk associated with a milestone

struct Sprint #

struct Sprint {
	BaseModel
pub mut:
	name           string @[required]
	description    string
	project_id     int // Links to Project
	sprint_number  int // Sequential number within project
	status         SprintStatus
	start_date     time.Time
	end_date       time.Time
	goal           string         // Sprint goal
	capacity       f32            // Team capacity in hours
	commitment     int            // Story points committed
	completed      int            // Story points completed
	velocity       f32            // Actual velocity (story points / sprint duration)
	tasks          []int          // Task IDs in this sprint
	team_members   []SprintMember // Team members and their capacity
	retrospective  SprintRetrospective
	review_notes   string
	demo_url       string
	burndown_data  []BurndownPoint
	daily_standups []DailyStandup
	impediments    []Impediment
	custom_fields  map[string]string
}

Sprint represents a Scrum sprint

fn (Sprint) get_duration #

fn (s Sprint) get_duration() int

get_duration returns the sprint duration in days

fn (Sprint) get_days_remaining #

fn (s Sprint) get_days_remaining() int

get_days_remaining returns the number of days remaining in the sprint

fn (Sprint) get_days_elapsed #

fn (s Sprint) get_days_elapsed() int

get_days_elapsed returns the number of days elapsed in the sprint

fn (Sprint) is_active #

fn (s Sprint) is_active() bool

is_active checks if the sprint is currently active

fn (Sprint) is_overdue #

fn (s Sprint) is_overdue() bool

is_overdue checks if the sprint has passed its end date

fn (Sprint) get_completion_percentage #

fn (s Sprint) get_completion_percentage() f32

get_completion_percentage returns the completion percentage based on story points

fn (Sprint) get_velocity #

fn (s Sprint) get_velocity() f32

get_velocity calculates the actual velocity for the sprint

fn (Sprint) get_team_capacity #

fn (s Sprint) get_team_capacity() f32

get_team_capacity returns the total team capacity in hours

fn (Sprint) get_team_utilization #

fn (s Sprint) get_team_utilization() f32

get_team_utilization returns the team utilization percentage

fn (Sprint) add_task #

fn (mut s Sprint) add_task(task_id int, by_user_id int)

add_task adds a task to the sprint

fn (Sprint) remove_task #

fn (mut s Sprint) remove_task(task_id int, by_user_id int)

remove_task removes a task from the sprint

fn (Sprint) add_team_member #

fn (mut s Sprint) add_team_member(user_id int, capacity_hours f32, availability f32, role string, by_user_id int)

add_team_member adds a team member to the sprint

fn (Sprint) remove_team_member #

fn (mut s Sprint) remove_team_member(user_id int, by_user_id int)

remove_team_member removes a team member from the sprint

fn (Sprint) start_sprint #

fn (mut s Sprint) start_sprint(by_user_id int)

start_sprint starts the sprint

fn (Sprint) complete_sprint #

fn (mut s Sprint) complete_sprint(by_user_id int)

complete_sprint completes the sprint

fn (Sprint) cancel_sprint #

fn (mut s Sprint) cancel_sprint(by_user_id int)

cancel_sprint cancels the sprint

fn (Sprint) update_commitment #

fn (mut s Sprint) update_commitment(points int, by_user_id int)

update_commitment updates the story points commitment

fn (Sprint) update_completed #

fn (mut s Sprint) update_completed(points int, by_user_id int)

update_completed updates the completed story points

fn (Sprint) add_burndown_point #

fn (mut s Sprint) add_burndown_point(remaining_points int, remaining_hours f32, completed_points int, by_user_id int)

add_burndown_point adds a burndown chart data point

fn (Sprint) add_daily_standup #

fn (mut s Sprint) add_daily_standup(facilitator_id int, participants []int, updates []StandupUpdate, duration_minutes int, notes string, by_user_id int)

add_daily_standup adds a daily standup record

fn (Sprint) add_impediment #

fn (mut s Sprint) add_impediment(title string, description string, reported_by int, severity Priority, by_user_id int)

add_impediment adds an impediment to the sprint

fn (Sprint) resolve_impediment #

fn (mut s Sprint) resolve_impediment(impediment_id int, resolution string, by_user_id int)

resolve_impediment resolves an impediment

fn (Sprint) conduct_retrospective #

fn (mut s Sprint) conduct_retrospective(facilitator_id int, participants []int, went_well []string, went_wrong []string, action_items []ActionItem, team_mood f32, notes string, by_user_id int)

conduct_retrospective conducts a sprint retrospective

fn (Sprint) get_health_score #

fn (s Sprint) get_health_score() f32

get_health_score calculates a health score for the sprint

fn (Sprint) get_health_status #

fn (s Sprint) get_health_status() string

get_health_status returns a human-readable health status

struct SprintMember #

struct SprintMember {
pub mut:
	user_id         int
	sprint_id       int
	capacity_hours  f32 // Available hours for this sprint
	allocated_hours f32 // Hours allocated to tasks
	actual_hours    f32 // Hours actually worked
	availability    f32 // Percentage availability (0.0 to 1.0)
	role            string
	joined_at       time.Time
}

SprintMember represents a team member's participation in a sprint

struct SprintRetrospective #

struct SprintRetrospective {
pub mut:
	conducted_at    time.Time
	facilitator_id  int
	participants    []int // User IDs
	what_went_well  []string
	what_went_wrong []string
	action_items    []ActionItem
	team_mood       f32 // 1.0 to 5.0 scale
	notes           string
}

SprintRetrospective for sprint retrospective data

struct StandupUpdate #

struct StandupUpdate {
pub mut:
	user_id   int
	yesterday string // What did you do yesterday?
	today     string // What will you do today?
	blockers  string // Any blockers or impediments?
	mood      f32    // 1.0 to 5.0 scale
}

StandupUpdate for individual team member updates

struct SuccessMetric #

struct SuccessMetric {
pub mut:
	id                 int
	milestone_id       int
	name               string
	description        string
	metric_type        MetricType
	target_value       f64
	actual_value       f64
	unit               string
	measurement_method string
	status             MetricStatus
	measured_at        time.Time
	measured_by        int
}

SuccessMetric for measuring milestone success

struct TaskDependency #

struct TaskDependency {
pub mut:
	id              int
	task_id         int @[required] // The dependent task
	depends_on_id   int @[required] // The task it depends on
	dependency_type DependencyType
	created_at      time.Time
}

TaskDependency represents dependencies between tasks

struct Team #

struct Team {
	BaseModel
pub mut:
	name               string @[required]
	description        string
	team_type          TeamType
	status             TeamStatus
	manager_id         int // Team manager/lead
	members            []TeamMember
	projects           []int       // Project IDs this team works on
	skills             []TeamSkill // Skills available in this team
	capacity           TeamCapacity
	location           string
	time_zone          string
	working_hours      WorkingHours
	holidays           []Holiday
	rituals            []TeamRitual
	goals              []TeamGoal
	metrics            []TeamMetric
	budget             f64 // Team budget
	cost_per_hour      f64 // Average cost per hour
	utilization_target f32 // Target utilization percentage
	velocity_target    int // Target velocity (story points per sprint)
	slack_channel      string
	email_list         string
	wiki_url           string
	repository_urls    []string
	tools              []TeamTool
	custom_fields      map[string]string
}

Team represents a group of users working together

fn (Team) get_total_capacity #

fn (t Team) get_total_capacity() f32

get_total_capacity returns total team capacity in hours per week

fn (Team) get_available_capacity #

fn (t Team) get_available_capacity() f32

get_available_capacity returns available capacity considering current commitments

fn (Team) get_utilization #

fn (t Team) get_utilization() f32

get_utilization returns current team utilization percentage

fn (Team) get_member_count #

fn (t Team) get_member_count() int

get_member_count returns the number of active team members

fn (Team) get_average_seniority #

fn (t Team) get_average_seniority() f32

get_average_seniority returns the average seniority level

fn (Team) add_member #

fn (mut t Team) add_member(user_id int, role string, capacity_hours f32, allocation f32, hourly_rate f64, seniority_level SeniorityLevel, by_user_id int)

add_member adds a member to the team

fn (Team) remove_member #

fn (mut t Team) remove_member(user_id int, by_user_id int)

remove_member removes a member from the team

fn (Team) update_member_capacity #

fn (mut t Team) update_member_capacity(user_id int, capacity_hours f32, allocation f32, by_user_id int)

update_member_capacity updates a member's capacity

fn (Team) add_skill #

fn (mut t Team) add_skill(skill_id int, skill_name string, category string, demand f32, by_user_id int)

add_skill adds a skill to the team

fn (Team) update_skill_proficiency #

fn (mut t Team) update_skill_proficiency(skill_id int, user_id int, level SkillLevel, by_user_id int)

update_skill_proficiency updates a member's proficiency in a skill

fn (Team) add_goal #

fn (mut t Team) add_goal(title string, description string, goal_type GoalType, target_value f64, unit string, target_date time.Time, owner_id int, by_user_id int)

add_goal adds a goal to the team

fn (Team) update_goal_progress #

fn (mut t Team) update_goal_progress(goal_id int, current_value f64, by_user_id int)

update_goal_progress updates progress on a team goal

fn (Team) add_ritual #

fn (mut t Team) add_ritual(name string, description string, ritual_type RitualType, frequency RitualFrequency, duration_minutes int, facilitator_id int, by_user_id int)

add_ritual adds a recurring ritual to the team

fn (Team) calculate_team_health #

fn (t Team) calculate_team_health() f32

calculate_team_health returns a team health score

fn (Team) get_health_status #

fn (t Team) get_health_status() string

get_health_status returns a human-readable health status

fn (Team) get_cost_per_week #

fn (t Team) get_cost_per_week() f64

get_cost_per_week returns the team's cost per week

fn (Team) forecast_capacity #

fn (t Team) forecast_capacity(start_date time.Time, end_date time.Time, forecast_type ForecastType) CapacityForecast

forecast_capacity forecasts team capacity for a future period

struct TeamCapacity #

struct TeamCapacity {
pub mut:
	total_hours_per_week     f32
	available_hours_per_week f32
	committed_hours_per_week f32
	utilization_percentage   f32
	velocity_last_sprint     int
	velocity_average         int
	velocity_trend           f32            // Positive = improving, negative = declining
	capacity_by_skill        map[string]f32 // skill -> available hours
	capacity_forecast        []CapacityForecast
}

TeamCapacity represents team capacity planning

struct TeamGoal #

struct TeamGoal {
pub mut:
	id               int
	team_id          int
	title            string
	description      string
	goal_type        GoalType
	target_value     f64
	current_value    f64
	unit             string
	start_date       time.Time
	target_date      time.Time
	status           GoalStatus
	owner_id         int
	progress         f32 // 0.0 to 1.0
	milestones       []GoalMilestone
	success_criteria []string
}

TeamGoal represents team objectives

struct TeamMember #

struct TeamMember {
pub mut:
	user_id            int
	team_id            int
	role               string
	permissions        []string
	capacity_hours     f32 // Weekly capacity in hours
	allocation         f32 // Percentage allocation to this team (0.0 to 1.0)
	hourly_rate        f64 // Member's hourly rate
	start_date         time.Time
	end_date           time.Time // For temporary members
	status             MemberStatus
	skills             []int // Skill IDs
	certifications     []string
	seniority_level    SeniorityLevel
	performance_rating f32 // 1.0 to 5.0 scale
	last_review        time.Time
	notes              string
}

TeamMember represents a user's membership in a team

struct TeamMetric #

struct TeamMetric {
pub mut:
	id            int
	team_id       int
	name          string
	description   string
	metric_type   MetricType
	current_value f64
	target_value  f64
	unit          string
	trend         f32 // Positive = improving
	last_updated  time.Time
	history       []MetricDataPoint
	benchmark     f64 // Industry/company benchmark
}

TeamMetric represents team performance metrics

struct TeamRitual #

struct TeamRitual {
pub mut:
	id               int
	team_id          int
	name             string
	description      string
	ritual_type      RitualType
	frequency        RitualFrequency
	duration_minutes int
	participants     []int // User IDs
	facilitator_id   int
	location         string
	virtual_link     string
	agenda           string
	outcomes         []string
	next_occurrence  time.Time
	last_occurrence  time.Time
	active           bool
}

TeamRitual represents recurring team activities

struct TeamSkill #

struct TeamSkill {
pub mut:
	skill_id           int
	team_id            int
	skill_name         string
	category           string
	proficiency_levels map[int]SkillLevel // user_id -> proficiency level
	demand             f32                // How much this skill is needed (0.0 to 1.0)
	supply             f32                // How much this skill is available (0.0 to 1.0)
	gap                f32                // Skill gap (demand - supply)
	training_plan      string
}

TeamSkill represents a skill available in the team

struct TeamTool #

struct TeamTool {
pub mut:
	name                string
	category            ToolCategory
	url                 string
	description         string
	cost_per_month      f64
	licenses            int
	admin_contact       string
	renewal_date        time.Time
	satisfaction_rating f32 // 1.0 to 5.0
}

TeamTool represents tools used by the team

struct TestCase #

struct TestCase {
pub mut:
	id              int
	issue_id        int
	title           string
	description     string
	preconditions   []string
	steps           []string
	expected_result string
	test_data       string
	test_type       TestType
	automated       bool
	created_at      time.Time
	created_by      int
	last_executed   time.Time
	last_result     TestResult
}

TestCase represents a test case related to an issue

struct TimeEntry #

struct TimeEntry {
pub mut:
	id          int
	user_id     int @[required]
	task_id     int
	project_id  int
	start_time  time.Time
	end_time    time.Time
	duration    f32 // Hours (calculated or manual)
	description string
	type        TimeEntryType
	billable    bool
	hourly_rate f64
	created_at  time.Time
	updated_at  time.Time
}

TimeEntry represents time spent on tasks or projects

struct User #

struct User {
	BaseModel
pub mut:
	username      string @[required; unique]
	email         string @[required; unique]
	first_name    string @[required]
	last_name     string @[required]
	display_name  string
	avatar_url    string
	role          UserRole
	status        UserStatus
	timezone      string = 'UTC'
	preferences   UserPreferences
	teams         []int // Team IDs this user belongs to
	skills        []string
	hourly_rate   f64
	hire_date     time.Time
	last_login    time.Time
	password_hash string // For authentication
	phone         string
	mobile        string
	department    string
	job_title     string
	manager_id    int   // User ID of manager
	reports       []int // User IDs of direct reports
}

User represents a system user (employees, clients, etc.)

fn (User) get_full_name #

fn (u User) get_full_name() string

get_full_name returns the user's full name

fn (User) get_display_name #

fn (u User) get_display_name() string

get_display_name returns the display name or full name if display name is empty

fn (User) is_admin #

fn (u User) is_admin() bool

is_admin checks if the user has admin role

fn (User) is_project_manager #

fn (u User) is_project_manager() bool

is_project_manager checks if the user can manage projects

fn (User) can_manage_users #

fn (u User) can_manage_users() bool

can_manage_users checks if the user can manage other users

fn (User) add_skill #

fn (mut u User) add_skill(skill string)

add_skill adds a skill if it doesn't already exist

fn (User) remove_skill #

fn (mut u User) remove_skill(skill string)

remove_skill removes a skill if it exists

fn (User) has_skill #

fn (u User) has_skill(skill string) bool

has_skill checks if the user has a specific skill

fn (User) add_to_team #

fn (mut u User) add_to_team(team_id int)

add_to_team adds the user to a team

fn (User) remove_from_team #

fn (mut u User) remove_from_team(team_id int)

remove_from_team removes the user from a team

fn (User) is_in_team #

fn (u User) is_in_team(team_id int) bool

is_in_team checks if the user is in a specific team

fn (User) update_last_login #

fn (mut u User) update_last_login()

update_last_login updates the last login timestamp

fn (User) is_active #

fn (u User) is_active() bool

is_active checks if the user is active and not suspended

fn (User) suspend #

fn (mut u User) suspend(by_user_id int)

suspend suspends the user account

fn (User) activate #

fn (mut u User) activate(by_user_id int)

activate activates the user account

fn (User) set_manager #

fn (mut u User) set_manager(manager_id int, by_user_id int)

set_manager sets the user's manager

fn (User) add_report #

fn (mut u User) add_report(report_id int)

add_report adds a direct report

fn (User) remove_report #

fn (mut u User) remove_report(report_id int)

remove_report removes a direct report

fn (User) get_initials #

fn (u User) get_initials() string

get_initials returns the user's initials

fn (User) calculate_total_hours #

fn (u User) calculate_total_hours(start_date time.Time, end_date time.Time, time_entries []TimeEntry) f32

calculate_total_hours calculates total hours worked in a time period

fn (User) calculate_billable_hours #

fn (u User) calculate_billable_hours(start_date time.Time, end_date time.Time, time_entries []TimeEntry) f32

calculate_billable_hours calculates billable hours in a time period

struct UserPreferences #

struct UserPreferences {
pub mut:
	timezone            string = 'UTC'
	date_format         string = 'YYYY-MM-DD'
	time_format         string = '24h'
	language            string = 'en'
	theme               string = 'light'
	notifications_email bool   = true
	notifications_push  bool   = true
	default_view        string = 'kanban'
}

UserPreferences for user-specific settings

struct Workaround #

struct Workaround {
pub mut:
	id            int
	issue_id      int
	title         string
	description   string
	steps         []string
	effectiveness f32 // 0.0 to 1.0 scale
	complexity    WorkaroundComplexity
	temporary     bool // Is this a temporary workaround?
	created_at    time.Time
	created_by    int
	tested_by     []int // User IDs who tested this workaround
	success_rate  f32   // Success rate from testing
}

Workaround represents a temporary solution for an issue

struct WorkingHours #

struct WorkingHours {
pub mut:
	monday_start     string // "09:00"
	monday_end       string // "17:00"
	tuesday_start    string
	tuesday_end      string
	wednesday_start  string
	wednesday_end    string
	thursday_start   string
	thursday_end     string
	friday_start     string
	friday_end       string
	saturday_start   string
	saturday_end     string
	sunday_start     string
	sunday_end       string
	break_duration   int // Minutes
	lunch_duration   int // Minutes
	flexible_hours   bool
	core_hours_start string
	core_hours_end   string
}

WorkingHours represents team working schedule