Project-Specific Classes
This page documents the classes that are specific to the Project model. These classes are only used within the context of housing development projects.
Note: For shared classes used across multiple models (Address, Image, DescriptionSection, etc.), see the Shared Classes documentation.
Phase
Represents a construction phase within a housing project. Large projects are often divided into multiple phases (e.g., "Phase 1", "Phase 2"), where each phase may have its own construction timeline, sales period, and building completion dates.
Important:
Phaserepresents construction phases (Norwegian: "Trinn" or "Fase"), not the project's lifecycle stage. The overall project lifecycle (Planning → Sale → Building → Takeover) is tracked separately viaProjectLifecycleStatus.
Usage in Project:
Properties
| Property | Type | Description | Example |
|---|---|---|---|
Id |
string |
Unique identifier for the phase | "FASE-1", "PHASE-001" |
Name |
string |
Display name of the phase | "Fase 1", "Trinn 1" |
PhaseNumber |
int? |
Phase number for ordering | 1, 2, 3 |
Description |
string? |
Description of the phase | Full text description |
ExpectedStartDate |
DateTime? |
Expected start date for this phase | 2024-03-01 |
ExpectedCompletionDate |
DateTime? |
Expected completion date for this phase | 2025-12-01 |
Status |
string? |
Current status of the phase | "Planned", "Under Construction", "Completed", "Sold Out" |
TotalUnits |
int? |
Total number of units in this phase | 40 |
AvailableUnits |
int? |
Number of units still available for sale | 15 |
Images |
ImageCollection? |
Phase-specific images | List of Image objects |
Documents |
DocumentCollection? |
Phase-specific documents | List of PropertyDocument objects |
Example
project.Phases = new List<Phase>();
// Phase 1 - Completed and sold out
project.Phases.Add(new Phase
{
Id = "FASE-1",
Name = "Fase 1",
PhaseNumber = 1,
Description = "First phase with 40 apartments in two buildings",
ExpectedStartDate = DateTime.Parse("2023-03-01"),
ExpectedCompletionDate = DateTime.Parse("2024-12-01"),
Status = "Sold Out",
TotalUnits = 40,
AvailableUnits = 0,
Images = new List<Image>
{
new Image
{
Id = "FASE1-IMG-001",
OriginalUrl = "https://cdn.example.com/phase1-complete.jpg",
Caption = "Fase 1 ferdigstilt høsten 2024",
Category = "Completed Phase"
}
}
});
// Phase 2 - Under construction
project.Phases.Add(new Phase
{
Id = "FASE-2",
Name = "Fase 2",
PhaseNumber = 2,
Description = "Second phase with 60 apartments in three buildings",
ExpectedStartDate = DateTime.Parse("2024-09-01"),
ExpectedCompletionDate = DateTime.Parse("2026-06-30"),
Status = "Under Construction",
TotalUnits = 60,
AvailableUnits = 45
});
// Phase 3 - Planned for the future
project.Phases.Add(new Phase
{
Id = "FASE-3",
Name = "Fase 3",
PhaseNumber = 3,
Description = "Final phase with 50 apartments, pending approvals",
ExpectedStartDate = DateTime.Parse("2026-01-01"),
ExpectedCompletionDate = DateTime.Parse("2027-12-31"),
Status = "Planned",
TotalUnits = 50,
AvailableUnits = 50 // All units still available
});
Common Phase Statuses
| Status | Norwegian | Description |
|---|---|---|
Planned |
Planlagt | Phase is planned but construction hasn't started |
Under Construction |
Under bygging | Active construction phase |
Completed |
Ferdigstilt | Construction completed |
Sold Out |
Utsolgt | All units sold |
On Hold |
På vent | Temporarily paused |
Use Cases
1. Multi-Year Projects:
// Large development divided into phases over several years
var largeProject = new Project
{
Name = "Tribunen",
TotalUnits = 150,
Phases = new List<Phase>
{
new Phase { Name = "Fase 1", TotalUnits = 40, Status = "Sold Out" },
new Phase { Name = "Fase 2", TotalUnits = 60, Status = "Under Construction" },
new Phase { Name = "Fase 3", TotalUnits = 50, Status = "Planned" }
}
};
2. Tracking Availability Across Phases:
// Calculate total available units across all phases
var totalAvailable = project.Phases
.Where(p => p.AvailableUnits.HasValue)
.Sum(p => p.AvailableUnits.Value);
// Find phases with available units
var phasesWithAvailability = project.Phases
.Where(p => p.AvailableUnits > 0)
.OrderBy(p => p.PhaseNumber);
3. Timeline Planning:
// Find the next phase to start
var nextPhase = project.Phases
.Where(p => p.Status == "Planned")
.OrderBy(p => p.ExpectedStartDate)
.FirstOrDefault();
// Get current active phases
var activePhases = project.Phases
.Where(p => p.Status == "Under Construction");
Building
Represents an individual building within a project or phase. A project typically contains multiple buildings (e.g., "Building A", "Building B"), each with its own characteristics, units, and completion timeline.
Usage in Project:
Properties
| Property | Type | Description | Example |
|---|---|---|---|
Id |
string |
Unique identifier for the building | "BYGG-A", "BUILDING-12345" |
Name |
string |
Display name of the building | "Bygg A", "Sørbyhaugen" |
PhaseId |
string? |
Reference to the phase this building belongs to | "FASE-1" |
Description |
string? |
Description of the building | Full text description |
Address |
Address? |
Specific address for this building (if different from project) | Address object |
NumberOfFloors |
int? |
Number of floors in the building | 6 |
TotalUnits |
int? |
Total number of units/apartments in this building | 24 |
AvailableUnits |
int? |
Number of units still available for sale | 8 |
NumberOfEntrances |
int? |
Number of entrances/stairwells | 2 |
BuildingType |
string? |
Building type/category | "Apartment Block", "Townhouse" |
Status |
string? |
Current status of the building | "Under Construction", "Completed" |
ExpectedCompletionDate |
DateTime? |
Expected completion date for this building | 2025-12-01 |
Images |
ImageCollection? |
Building-specific images | List of Image objects |
Documents |
DocumentCollection? |
Building-specific documents | List of PropertyDocument objects |
Example
project.Buildings = new List<Building>();
// Building A - First building completed
project.Buildings.Add(new Building
{
Id = "BYGG-A",
Name = "Bygg A - Sørbyhaugen",
PhaseId = "FASE-1",
Description = "Modern apartment building with 24 units, featuring roof terrace and underground parking",
Address = new Address
{
Street = "Sørbyhaugen 1",
ZipCode = "7032",
City = "Trondheim"
},
NumberOfFloors = 6,
TotalUnits = 24,
AvailableUnits = 0, // Sold out
NumberOfEntrances = 2,
BuildingType = "Apartment Block",
Status = "Completed",
ExpectedCompletionDate = DateTime.Parse("2024-12-01"),
Images = new List<Image>
{
new Image
{
Id = "BYGG-A-001",
OriginalUrl = "https://cdn.example.com/building-a-facade.jpg",
Caption = "Bygg A fasade",
Category = "Building Exterior"
}
},
Documents = new List<PropertyDocument>
{
new PropertyDocument
{
Id = "BYGG-A-PLAN",
OriginalUrl = "https://cdn.example.com/building-a-floorplan.pdf",
Filename = "Bygg-A-Plantegninger.pdf",
Category = "Floor Plans"
}
}
});
// Building B - Under construction
project.Buildings.Add(new Building
{
Id = "BYGG-B",
Name = "Bygg B - Sørbyhaugen",
PhaseId = "FASE-2",
Description = "Larger building with 36 units and commercial space on ground floor",
Address = new Address
{
Street = "Sørbyhaugen 3",
ZipCode = "7032",
City = "Trondheim"
},
NumberOfFloors = 8,
TotalUnits = 36,
AvailableUnits = 18,
NumberOfEntrances = 3,
BuildingType = "Mixed Use",
Status = "Under Construction",
ExpectedCompletionDate = DateTime.Parse("2026-06-30")
});
Common Building Types
| Type | Norwegian | Description |
|---|---|---|
Apartment Block |
Leilighetskompleks | Multi-story residential building |
Townhouse |
Rekkehus | Row of attached houses |
Villa |
Villa | Detached single-family home |
Mixed Use |
Kombinert | Residential with commercial space |
Senior Housing |
Seniorbolig | Housing for elderly residents |
Common Building Statuses
| Status | Norwegian | Description |
|---|---|---|
Planned |
Planlagt | Building is planned but not started |
Foundation Work |
Grunnarbeid | Foundation construction underway |
Under Construction |
Under bygging | Main construction phase |
Roofed |
Taklagt | Structure complete, roof installed |
Interior Work |
Innvendig arbeid | Interior finishing underway |
Completed |
Ferdigstilt | Construction completed |
Ready for Move-in |
Innflyttingsklar | Fully completed and ready |
Use Cases
1. Organizing Buildings by Phase:
// Get all buildings in Phase 1
var phase1Buildings = project.Buildings
.Where(b => b.PhaseId == "FASE-1");
// Count total units in a specific phase
var phase1TotalUnits = phase1Buildings
.Sum(b => b.TotalUnits ?? 0);
2. Tracking Availability Across Buildings:
// Find buildings with available units
var buildingsWithAvailability = project.Buildings
.Where(b => b.AvailableUnits > 0)
.OrderBy(b => b.Name);
// Get total available units across all buildings
var totalAvailable = project.Buildings
.Sum(b => b.AvailableUnits ?? 0);
3. Construction Timeline Management:
// Find next building to complete
var nextCompletion = project.Buildings
.Where(b => b.Status == "Under Construction")
.OrderBy(b => b.ExpectedCompletionDate)
.FirstOrDefault();
// Get all buildings completed this year
var completedThisYear = project.Buildings
.Where(b => b.Status == "Completed" &&
b.ExpectedCompletionDate.HasValue &&
b.ExpectedCompletionDate.Value.Year == DateTime.Now.Year);
4. Grouping by Building Type:
// Group buildings by type
var buildingsByType = project.Buildings
.GroupBy(b => b.BuildingType)
.Select(g => new
{
Type = g.Key,
Count = g.Count(),
TotalUnits = g.Sum(b => b.TotalUnits ?? 0)
});
Relationship Between Phase and Building
A typical project hierarchy:
Project: "Tribunen"
├── Phase 1 (Completed)
│ ├── Building A (24 units)
│ └── Building B (16 units)
├── Phase 2 (Under Construction)
│ ├── Building C (36 units)
│ ├── Building D (24 units)
│ └── Building E (30 units)
└── Phase 3 (Planned)
└── Building F (50 units)
Example of Complete Hierarchy
var project = new Project
{
Id = "PROJ-TRIBUNEN",
Name = "Tribunen",
TotalUnits = 180,
// Define phases
Phases = new List<Phase>
{
new Phase
{
Id = "FASE-1",
Name = "Fase 1",
PhaseNumber = 1,
Status = "Completed",
TotalUnits = 40,
AvailableUnits = 0
},
new Phase
{
Id = "FASE-2",
Name = "Fase 2",
PhaseNumber = 2,
Status = "Under Construction",
TotalUnits = 90,
AvailableUnits = 54
},
new Phase
{
Id = "FASE-3",
Name = "Fase 3",
PhaseNumber = 3,
Status = "Planned",
TotalUnits = 50,
AvailableUnits = 50
}
},
// Define buildings
Buildings = new List<Building>
{
// Phase 1 Buildings
new Building
{
Id = "BYGG-A",
Name = "Bygg A",
PhaseId = "FASE-1",
TotalUnits = 24,
Status = "Completed"
},
new Building
{
Id = "BYGG-B",
Name = "Bygg B",
PhaseId = "FASE-1",
TotalUnits = 16,
Status = "Completed"
},
// Phase 2 Buildings
new Building
{
Id = "BYGG-C",
Name = "Bygg C",
PhaseId = "FASE-2",
TotalUnits = 36,
AvailableUnits = 18,
Status = "Under Construction"
},
new Building
{
Id = "BYGG-D",
Name = "Bygg D",
PhaseId = "FASE-2",
TotalUnits = 24,
AvailableUnits = 12,
Status = "Foundation Work"
},
new Building
{
Id = "BYGG-E",
Name = "Bygg E",
PhaseId = "FASE-2",
TotalUnits = 30,
AvailableUnits = 24,
Status = "Planned"
},
// Phase 3 Buildings
new Building
{
Id = "BYGG-F",
Name = "Bygg F",
PhaseId = "FASE-3",
TotalUnits = 50,
AvailableUnits = 50,
Status = "Planned"
}
}
};
// Query example: Get all buildings in active phases
var activePhasesBuildings = project.Buildings
.Where(b => project.Phases
.Any(p => p.Id == b.PhaseId && p.Status == "Under Construction"));