Employee¶
Employee resolves an internal staff member's display name, email, and phone/fax contact details for OP-DOM-20, falling back between two data sources: when a WcisEmployee record exists it supplies name/phone from that record (email is left blank), and when it does not, an IUserProfileService-resolved application-user profile supplies name, email, phone, and fax instead (DOM-BR-211).
Purpose¶
- Resolves an employee's identity by ID, preferring the WCIS employee record and falling back to the application user-profile service when the profile has a populated last name (DOM-BR-211).
- Formats the resolved phone/fax numbers so a blank extension falls back to repeating the number itself, keeping display formatting consistent regardless of which data source supplied the contact.
Context¶
- Namespace:
SAIF.Domain.Model.Employees - Assembly/package:
SAIF.Domain(packaged inSAIF.SAIFCode.Core)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| Employee (default constructor) | public Employee() |
Constructs an employee with no data (HasData is false); used to represent an unknown/absent employee. |
| Employee (constructor by id) | public Employee(string id, IEmployeeQueryProvider query) |
Loads the WCIS employee record for id; HasData reflects whether a record was found. |
| Employee (constructor by id with profile fallback) | public Employee(string id, IEmployeeQueryProvider query, IUserProfileService prof) |
Resolves the application user profile for id first; if the profile has no last name, falls back to loading the WCIS employee record instead, else treats the profile as the data source (DOM-BR-211). |
| HasData | public override bool HasData { get; } |
Reports whether an employee was actually resolved, by either constructor's lookup path. Overrides DomainQueryBase<TItem,TQueryProvider>.HasData (via DomainBase<TItem>). |
| Name | public PersonName Name { get; } |
The employee's name: from the WCIS record when present, else from the resolved user profile; an empty PersonName when there is no data. |
public string Email { get; } |
The employee's email address from the user profile; always empty when a WCIS record was used instead, since WCIS carries no email field. | |
| Phone | public PhoneNumber Phone { get; } |
The employee's primary phone, formatted so a blank extension repeats the phone number; sourced from the WCIS record when present, else the user profile. |
| Fax | public PhoneNumber Fax { get; } |
The employee's primary fax number from the user profile, formatted so a blank extension repeats the number; empty when there is no data or no profile was resolved. |
Behavioral notes¶
Emailis always empty when the WCIS record path was used (base.HasDatatrue), because WCIS employee data has no email field to surface*.Faxreturns empty whenever the WCIS record path was used, since fax is only ever sourced from the user profile*.- The three-argument constructor prefers the user-profile path whenever the profile's last name is non-blank, deferring to the WCIS lookup only when the profile is unnamed (DOM-BR-211).
Constraints and usage notes¶
- Callers using the two-argument (
id,query) constructor never get email or fax data populated, since that path only loads the WCIS record.
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
Domain/SAIF.Domain/Model/Employees/Employee.csDomain/SAIF.Domain/DomainQueryBase.csDomain/SAIF.Domain/DomainBase.cs