From idea to power plant: the project lifecycle in Finexswiss
Screening, contract, market and operations. How a solar project moves through four phases and three apps, why the owner starts with all shares, and how the backend keeps the phases honest.
Why the lifecycle matters
A solar plant on a roof is not a product you sell once. It is planned for months, built, financed and then operated for decades. The people involved change along the way, and so does what each of them is allowed to do.
The market for shares is the feature everybody thinks of first, but it is the smallest part. Most of the work happens before a single share is sold, and much of it after.
Four phases, three apps
The first two phases happen in the Flow app, where a project is developed. The Market app is only used if the owner decides to sell shares. The Operations app takes over when the plant is running.
Splitting the platform this way keeps each app focused. A project owner in the middle of contract negotiations doesn’t need a trading screen, and an investor collecting dividends doesn’t need the permit checklist.
Roles change with the phase
| Role | What they do | Where |
|---|---|---|
| Project owner | Owns the project and, after the contract, all of its shares | All apps |
| Analyst | Assesses site, yield, costs and risks during screening | Flow |
| Developer | The company that plans and builds the plant, with admins and team members | Flow |
| Partner | Gets a pre-emption right on the plant, agreed in the contract | Flow |
| Investor | Buys shares if the owner offers them | Market, Operations |
The same person can have different rights in different projects. A developer can be an admin in one project and not involved in another. So permissions are never global, they always depend on the project and its current phase.
Screening: decide early and cheaply
Screening answers one question: is this project worth pursuing? Site, expected yield, costs and permits are collected and assessed. Most of this is structured data and documents, and most projects that fail should fail here, before anybody has paid a lawyer.
For the software this means screening needs to be fast to start and easy to abandon. A project in screening has no shares, no contracts and no money attached to it.
Contract: everyone signs, then shares exist
The contract phase brings the owner, the developer and the partner together. The partner’s pre-emption right on the plant is part of the contract and is co-signed here.
Only when every required signature is in does the project move on. At that moment the shares are created, and all of them belong to the project owner. There is no moment where shares exist without an owner or before the contract is complete.
The market is optional
This was an important product decision. The owner starts with 100 % of the shares and decides whether to offer any of them, how many and when. Some owners want co-financing from their community. Others just want a clean digital register of a plant they own alone.
So the market is not a phase every project goes through. A project can go from contract straight to operations. The backend treats both paths as normal, not one as the default and the other as an exception.
Operations: the longest phase
A solar plant runs for 25 years or more. During that time there are dividends to distribute, decisions to vote on and reports to publish. If shares were sold, the shareholders change over time, and every dividend has to go to whoever owned the shares on the relevant date.
This is where the event history pays off. The register of who owned what, and since when, is not reconstructed from snapshots. It follows directly from the events.
How the backend keeps the phases honest
The project is an EventFlow aggregate, and its phase is part of its state. Moving to the next phase is a command, and the aggregate decides whether the conditions are met:
public IExecutionResult CompleteContract()
{
if (_phase != ProjectPhase.Contract)
return ExecutionResult.Failed($"Project is in {_phase}, not in the contract phase.");
var missing = _requiredSigners.Except(_signedBy).ToList();
if (missing.Count > 0)
return ExecutionResult.Failed($"Signatures missing from: {string.Join(", ", missing)}");
Emit(new ContractCompleted(_ownerId, _totalShares));
return ExecutionResult.Success();
}
ContractCompleted moves the project into its next phase and, through the outbox, triggers the creation of the shares for the owner. No other code path can create shares.
Permissions follow the same idea. Instead of checks spread across controllers, there is one table of which role may do what in which phase:
private static readonly Dictionary<(ProjectPhase, ProjectRole), ProjectAction[]> Permissions = new()
{
[(ProjectPhase.Screening, ProjectRole.Analyst)] = [ProjectAction.EditAssessment],
[(ProjectPhase.Screening, ProjectRole.Owner)] = [ProjectAction.EditAssessment, ProjectAction.StartContract],
[(ProjectPhase.Contract, ProjectRole.Partner)] = [ProjectAction.ReadContract, ProjectAction.Sign],
[(ProjectPhase.Contract, ProjectRole.Owner)] = [ProjectAction.EditContract, ProjectAction.Sign],
// ...
};
Every command handler asks this table before it loads the aggregate. When the business adds a role or changes a rule, there is exactly one place to change, and the table can be tested on its own.
What I take away
Model the lifecycle first, the features second. Most rules in a platform like this depend on two things: who you are in this project, and which phase the project is in. If both are explicit in the domain model, the rules become simple. If they are hidden in the UI, every new feature has to rediscover them.