πŸ“„ ODSEmployee Domain Class Documentation


πŸš€ Table of Contents

  1. Overview & Purpose
  2. Dependencies & Technologies
  3. Entity Diagram (UML)
  4. Key Functional Areas
  5. Property Reference Table
  6. Usage Examples
  7. EF Core Mapping Snippet
  8. Sample Queries
  9. 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

  1. Identification

    • EMPLOYEE_ID (binary key)
    • EMPLOYEE_NUMBER / ALTERNATE_EMPLOYEE_NUMBER
  2. Organization Structure

    • ORG_BU, ORG_OPU, ORG_COMPANY, ORG_INTDIVISION, ORG_SBU
  3. Personal Information

    • FIRST_NAME, LAST_NAME, MIDDLE_NAME, FULL_NAME
    • BIRTH_DATE, MARITAL_STATUS, GENDER, VETERAN, ETHNICITY, DISABILITY
  4. Contact & Address

    • WORK_EMAIL
    • ADDRESS1–4, CITY, STATE, COUNTY, POSTAL_CODE
  5. 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
  6. Management Hierarchy

    • MANAGER (binary ref), MANAGER_ID (GUID)
    • MANAGER_NAME
  7. Audit & CDC

    • LAST_UPDATED, CDC_OPERATION, SOURCE_SYSTEM, EFFECTIVE_DATE
  8. 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 ODSEmployee into your data access layer, map it in EF Core, and leverage it in business workflows.


Happy coding! πŸš€