Projects Module
The Projects module provides comprehensive project management capabilities for tracking business projects, organizing them into stages, and managing project payments and deliverables. This module is designed for managing complex projects with multiple phases and tracking financial progress.
Overview
The Projects module enables organizations to:
- Create and manage projects with counterparty (client) associations
- Organize projects into stages with individual budgets and timelines
- Track project progress through planned and actual dates
- Manage stage payments and link them to financial transactions
- Maintain project history with complete audit trails
Key Concepts
Projects
A project represents a comprehensive business engagement with a specific counterparty (client). Each project can contain multiple stages, each representing distinct phases of work.
Attributes:
ID: Unique project identifier (UUID)TenantID: Multi-tenant isolationCounterpartyID: Associated client/counterpartyName: Project name (unique per tenant)Description: Detailed project informationCreatedAt / UpdatedAt: Temporal tracking
Project Stages
Stages divide a project into manageable phases, each with its own budget, timeline, and deliverables. Stages are sequentially numbered within a project.
Attributes:
ID: Unique stage identifier (UUID)ProjectID: Parent project referenceStageNumber: Sequential order within project (unique per project)Description: Stage detailsTotalAmount: Stage budget in centsStartDate: Planned start datePlannedEndDate: Planned completion dateFactualEndDate: Actual completion date (nullable)CreatedAt / UpdatedAt: Temporal tracking
Project Stage Payments
Payments linked to project stages, creating an association between financial transactions and project phases.
Attributes:
ID: Unique payment link identifier (UUID)ProjectStageID: Parent stage referencePaymentID: Associated payment from finance moduleCreatedAt: Creation timestamp
Module Architecture
The Projects module follows Domain-Driven Design (DDD) principles with clear separation of concerns:
modules/projects/
├── domain/
│ ├── aggregates/
│ │ ├── project/
│ │ │ ├── project.go # Project aggregate interface
│ │ │ ├── project_impl.go # Project implementation
│ │ │ ├── project_repository.go # Repository interface
│ │ │ └── project_events.go # Domain events
│ │ └── project_stage/
│ │ ├── project_stage.go
│ │ ├── project_stage_impl.go
│ │ ├── project_stage_repository.go
│ │ └── project_stage_events.go
│ └── value_objects/
├── infrastructure/
│ ├── persistence/
│ │ ├── project_repository.go # Repository implementation
│ │ ├── project_stage_repository.go
│ │ ├── projects_mappers.go # Domain <-> Persistence mapping
│ │ ├── models/
│ │ │ └── models.go # Persistence models
│ │ └── queries/
│ └── query/
├── services/
│ ├── project_service.go # Business logic for projects
│ └── project_stage_service.go # Business logic for stages
├── presentation/
│ ├── controllers/ # HTTP handlers
│ ├── viewmodels/ # Data transformation
│ ├── templates/ # UI templates (Templ)
│ ├── locales/ # Translations (i18n)
│ └── mappers/ # DTO mappings
├── permissions/
│ └── constants.go # RBAC permissions
└── module.go # Module registration
Integration Points
With Finance Module
Projects integrate with the Finance module through:
- Counterparties: Projects are linked to specific counterparties (clients)
- Payments: Project stages can be associated with payment transactions
- Financial Tracking: Enable project-based financial reporting
With Core Module
- Multi-tenant: Complete tenant isolation
- RBAC: Permission-based access control
- Audit Logging: Action logging for compliance
Event Bus
Projects publish domain events for:
- Project creation, update, and deletion
- Stage creation, update, and deletion
- Payment linking and unlinking
Documentation Structure
- Business Requirements - Problem statement, workflows, and business rules
- Technical Architecture - Implementation details, patterns, and API contracts
- Data Model - Database schema, ERD diagrams, and relationships
Common Tasks
Creating a Project
- Ensure the counterparty (client) exists in the Finance module
- Call
ProjectService.Save()with a new Project aggregate - System publishes
ProjectCreatedEvent - UI updates in real-time via HTMX
Managing Project Stages
- Create stages with
ProjectStageService.Save() - Set sequential stage numbers and budgets
- Link payments as work progresses
- Update actual end dates upon completion
Querying Projects
ProjectService.GetAll()- All projects for tenantProjectService.GetPaginated()- Paginated results with sortingProjectService.GetByCounterpartyID()- Projects for specific client
Permissions
The Projects module enforces role-based access control:
project.view- View projects and stagesproject.create- Create new projectsproject.edit- Modify project and stage detailsproject.delete- Archive/delete projectsproject.manage- Full project administration
Next Steps
Explore the Business Requirements to understand workflows and constraints, then review Technical Architecture for implementation details.