Skip to content

Employee-Specific Classes

This page documents the classes that are specific to the Employee model. These classes are only used within the context of employee/agent information.

Note: For shared classes used across multiple models (Address, Image, etc.), see the Shared Classes documentation.


EmployeePosition

Represents an employee's position or role within the real estate organization. An employee can have multiple positions, each with its own type designation.

Usage in Employee:

employee.Positions = new List<EmployeePosition>();

Properties

Property Type Description Example
Type int? Position type as enum value (Vitec: type) 0, 1, 2

Example

employee.Positions = new List<EmployeePosition>();

// Add primary position
employee.Positions.Add(new EmployeePosition
{
    Type = 0  // Broker/Megler
});

// Add additional position (for employees with multiple roles)
employee.Positions.Add(new EmployeePosition
{
    Type = 1  // Manager/Leder
});

Position Types

The Type field stores an integer enum value from the source system (e.g., Vitec). These values need to be mapped to human-readable strings for display.

Common Position Type Values (examples):

Value English Norwegian
0 Broker Megler
1 Manager Leder
2 Assistant Assistent
3 Trainee Trainee
4 Senior Broker Seniormegler
5 Project Broker Prosjektmegler
6 Rental Broker Utleiemegler

Note: The exact enum mapping depends on the source system. See Vitec Enum Mappings for complete mapping tables.

Use Cases

1. Tracking Multiple Roles: An employee might be both a broker and a manager:

var employee = new Employee
{
    Name = "Karianne Westby Jensen",
    Title = "Senior Broker & Department Manager",
    Positions = new List<EmployeePosition>
    {
        new EmployeePosition { Type = 0 },  // Broker
        new EmployeePosition { Type = 1 }   // Manager
    }
};

2. Specialized Broker Types: Use positions to track specializations:

employee.Positions.Add(new EmployeePosition { Type = 5 });  // Project Broker
employee.IsProjectBroker = true;  // Also set the flag for easy filtering

3. Career Progression: While the current implementation doesn't track historical positions, the list structure allows for potential future enhancement to track position history.

Relationship to Employee Flags

The Employee model also has specialized boolean flags: - IsProjectBroker - Whether employee specializes in project sales - IsRentalBroker - Whether employee specializes in rental properties

These flags provide quick filtering capabilities, while the Positions list provides more detailed role information from the source system.

Example of using both:

var employee = new Employee
{
    Name = "Ole Hansen",
    Title = "Prosjektmegler",
    IsProjectBroker = true,  // Quick flag for filtering
    Positions = new List<EmployeePosition>
    {
        new EmployeePosition { Type = 5 }  // Detailed position type from Vitec
    }
};

// Quick filter: Find all project brokers
var projectBrokers = employees.Where(e => e.IsProjectBroker);

// Detailed filter: Find specific position types
var projectBrokersDetailed = employees.Where(e =>
    e.Positions != null &&
    e.Positions.Any(p => p.Type == 5)
);

Future Considerations

The EmployeePosition class is designed to be extensible. Future enhancements might include:

Employment Percentage (currently commented out):

public class EmployeePosition
{
    public int? Type { get; set; }
    public decimal? Percent { get; set; }  // 100 = full time, 50 = half time
}

This would allow tracking of part-time positions:

employee.Positions.Add(new EmployeePosition
{
    Type = 0,       // Broker
    Percent = 50m   // 50% employment
});

Historical Positions:

public class EmployeePosition
{
    public int? Type { get; set; }
    public DateTime? StartDate { get; set; }
    public DateTime? EndDate { get; set; }
}


Download