π ODSEmployee Domain Class Documentation
π Table of Contents
- Overview & Purpose
- Dependencies & Technologies
- Entity Diagram (UML)
- Key Functional Areas
- Property Reference Table
- Usage Examples
- EF Core Mapping Snippet
- Sample Queries
- Conclusion
π 1. Overview & Purpose
The ODSEmployee class is a Plain Old CLR Object (POCO) representing an Employee record in the Oracle Data System (ODS) for the IrbyImaging application. It resides in the IrbyImaging.DomainClasses assembly and is designed for:
- Data Modeling: Mirrors the ODS_EMPLOYEE table (or view) structure.
- ORM Integration: Works seamlessly with Entity Framework Core or other ORMs for CRUD operations.
- Data Transfer: Travels between database, business logic, and presentation layers.
π οΈ 2. Dependencies & Technologies
| Technology / Package | Purpose |
|---|---|
| .NET Core / .NET Framework | Runtime environment |
| System.ComponentModel.DataAnnotations | DataAnnotations attributes (validation/mapping) |
| Entity Framework Core (optional) | ORM layer for mapping to database |
| PlantUML (for diagrams) | Documentation & modeling |
Note: Although the class imports
System.ComponentModel.DataAnnotations.Schema, no table-specific attributes are defined. Mapping can be performed via Fluent API.
π 3. Entity Diagram (UML)
@startuml
class ODSEmployee {
+ byte[] EMPLOYEE_ID
+ string ORG_BU
+ string ORG_OPU
+ string ORG_COMPANY
+ string ORG_INTDIVISION
+ string ORG_SBU
+ string NAME
+ string DISPLAY_NAME
+ DateTime? LAST_UPDATED
...
+ string MANAGER_DSC2
+ byte[] MANAGER
+ Guid? MANAGER_ID
}
@enduml
β Tip: Import this snippet into any PlantUML-compatible editor to visualize the class structure.
π― 4. Key Functional Areas
-
Identification
- EMPLOYEE_ID (binary key)
- EMPLOYEE_NUMBER / ALTERNATE_EMPLOYEE_NUMBER
-
Organization Structure
- ORG_BU, ORG_OPU, ORG_COMPANY, ORG_INTDIVISION, ORG_SBU
-
Personal Information
- FIRST_NAME, LAST_NAME, MIDDLE_NAME, FULL_NAME
- BIRTH_DATE, MARITAL_STATUS, GENDER, VETERAN, ETHNICITY, DISABILITY
-
Contact & Address
- WORK_EMAIL
- ADDRESS1β4, CITY, STATE, COUNTY, POSTAL_CODE
-
Employment & Job Details
- EMPLOYMENT_START_DATE, REHIRE_DATE, TERMINATED_DATE
- JOB_TYPE, JOB_STEP, LAST_JOB, HOURLY_RATE
- PAY_CLASS, PAY_STATUS, PAY_FREQUENCY, SHIFT
-
Management Hierarchy
- MANAGER (binary ref), MANAGER_ID (GUID)
- MANAGER_NAME
-
Audit & CDC
- LAST_UPDATED, CDC_OPERATION, SOURCE_SYSTEM, EFFECTIVE_DATE
-
Compensation & Benefits
- HOURLY_RATE, DISTRIBUTION_RATE
- PAY_START_DATE, PARTICIPATION_DATE
π 5. Property Reference Table
| Property Name | Type | Description |
|---|---|---|
| EMPLOYEE_ID | byte[] | Unique binary identifier (primary key) |
| EMPLOYEE_NUMBER | decimal | Numeric employee number |
| ALTERNATE_EMPLOYEE_NUMBER | string | Secondary employee number |
| NAME | string | Full display name |
| DISPLAY_NAME | string | Custom display label |
| LAST_UPDATED | DateTime? | Last change timestamp |
| CDC_OPERATION | string | Change Data Capture operation (I/U/D) |
| FIRST_NAME | string | Given name |
| LAST_NAME | string | Surname |
| MIDDLE_NAME | string | Middle initial or name |
| FULL_NAME | string | Combination of first, middle, last |
| MARITAL_STATUS_CODE | string | Code for marital status |
| MARITAL_STATUS_DESC | string | Human-readable marital status |
| GENDER_CODE | string | Code for gender |
| GENDER_DESC | string | Human-readable gender |
| WORK_EMAIL | string | Corporate email address |
| ADDRESS1β4 | string | Street address lines |
| CITY, STATE, COUNTY | string | Location details |
| POSTAL_CODE | string | ZIP or postal code |
| BIRTH_DATE | DateTime? | Date of birth |
| EMPLOYMENT_START_DATE | DateTime? | First hire date |
| REHIRE_DATE | DateTime? | Date of rehire |
| TERMINATED_DATE | DateTime? | Date of termination |
| LAST_JOB | string | Previous job title |
| LAST_WORKED_DATE | DateTime? | Last day on the job |
| JOB_TYPE_CODE / DESC | string | Code & description of job type |
| JOB_STEP_CODE / DESC | string | Code & description of job step |
| HOURLY_RATE | decimal | Hourly compensation |
| PAY_CLASS_CODE / DESC | string | Class & description for pay |
| UNION_CODE / DSC(2) | string | Union affiliation codes & descriptions |
| MANAGER | byte[] | Binary reference to managerβs EMPLOYEE_ID |
| MANAGER_ID | Guid? | Managerβs GUID (application-specific) |
| MANAGER_NAME | string | Managerβs display name |
| PAY_STATUS_CODE / DESC | string | Active / Inactive payroll status |
| SHIFT_CODE / DESC | string | Work shift code & description |
| PAY_FREQUENCY_CODE / DESC(2) | string | Frequency code & two-level description |
| VETERAN_CODE / DESC | string | Veteran status code & description |
| FLSA_EXEMPTION_CODE / DESC | string | FLSA exemption details |
| SENIORITY_DATE | DateTime? | Date for calculating tenure |
| ETHNICITY_CODE / DESC | string | Ethnicity details |
| DISABILITY_CODE / DESC | string | Disability status details |
| JOB_CATEGORY_CODE / DESC | string | Category of job |
| EFFECTIVE_DATE | DateTime? | Record effective date |
| SOURCE_SYSTEM | string | Origin system of record |
| DISTRIBUTION_RATE | decimal | Percentage of time allocation |
| RECORD_TYPE_CODE / DESC | string | Type & description of record (e.g., Current, Archive) |
| PAY_START_DATE | DateTime? | Payroll eligibility start |
| PARTICIPATION_DATE | DateTime? | Benefits participation start |
π‘ 6. Usage Examples
6.1 Instantiating a New Employee
var newEmployee = new ODSEmployee
{
EMPLOYEE_ID = Guid.NewGuid().ToByteArray(),
EMPLOYEE_NUMBER = 12345,
FIRST_NAME = "Jane",
LAST_NAME = "Doe",
FULL_NAME = "Jane A. Doe",
WORK_EMAIL = "[email protected]",
EMPLOYMENT_START_DATE= DateTime.UtcNow,
HOURLY_RATE = 29.75m,
SOURCE_SYSTEM = "HCM"
};
6.2 Validating Required Fields (DataAnnotations)
Note: Add
[Required],[MaxLength(x)]attributes as needed.
public class ODSEmployee
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public byte[] EMPLOYEE_ID { get; set; }
[Required, MaxLength(50)]
public string FIRST_NAME { get; set; }
[Required, MaxLength(50)]
public string LAST_NAME { get; set; }
// ...
}
ποΈ 7. EF Core Mapping Snippet
If you prefer Fluent API mapping in your DbContext:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<ODSEmployee>(entity =>
{
entity.ToTable("ODS_EMPLOYEE");
entity.HasKey(e => e.EMPLOYEE_ID);
entity.Property(e => e.EMPLOYEE_ID)
.HasColumnName("EMPLOYEE_ID")
.IsRequired()
.HasColumnType("RAW(16)");
entity.Property(e => e.FIRST_NAME)
.HasMaxLength(50)
.HasColumnName("FIRST_NAME");
// Map remaining properties...
});
}
π 8. Sample Queries
// 1. Retrieve all active employees in BU "North"
var northEmployees = await context.ODSEmployees
.Where(e => e.ORG_BU == "North" && e.RECORD_TYPE_CODE == "A")
.ToListAsync();
// 2. Find an employee by number
var employee = await context.ODSEmployees
.SingleOrDefaultAsync(e => e.EMPLOYEE_NUMBER == 12345);
// 3. Update an employeeβs hourly rate
employee.HOURLY_RATE = 32.00m;
context.Update(employee);
await context.SaveChangesAsync();
β 9. Conclusion
The ODSEmployee class forms the backbone of employee data management within the IrbyImaging solution:
- Rich Data Model covering identification, job, compensation, demographics, and hierarchy.
- ORM-friendly structure to speed up CRUD operations.
- Highly Extensible: Add data annotations, business logic, or partial classes for customized behavior.
π With this comprehensive documentation, you now have the context and examples needed to integrate
ODSEmployeeinto your data access layer, map it in EF Core, and leverage it in business workflows.
Happy coding! π