πŸ“ JobClassification.cs Documentation


Table of Contents

  1. Overview & Purpose
  2. Key Functional Areas
  3. Dependencies & Technologies
  4. Data Model: JobClassification
  5. Sample Code Snippets & Usage
  6. UML Class Diagram
  7. Conclusion

1. Overview & Purpose

The JobClassification class is an Entity Framework (EF) data model that represents a classification entry tied to a specific job in the irby schema. This model captures details such as class numbers, fringe benefits, geographic location, cost codes, and OCR-extracted image data. It underpins features like cost reporting, payroll calculations, and document processing within the IrbyImaging domain.

Use Cases

  • Storing fringe benefit amounts per classification
  • Grouping cost codes by job
  • Persisting OCR results of classification documents
  • Soft-deleting obsolete classification records

2. Key Functional Areas

  • πŸ”— Entity Mapping: Tightly couples with irby.JobClassification table
  • πŸ’Ύ Data Persistence: CRUD operations via EF Core
  • 🏷️ Metadata Annotations: Data validation & display hints
  • πŸ“„ OCR Storage: Byte-array and text representation
  • 🚫 Soft Delete: IsDeleted flag

3. Dependencies & Technologies

Technology Usage
.NET Core / .NET 5+ Platform
Entity Framework Core ORM, attribute-based mapping ([Table], [Key], [ForeignKey])
DataAnnotations Validation & display ([Display])

4. Data Model: JobClassification

4.1 Schema Mapping

[Table("JobClassification", Schema = "irby")]
public class JobClassification
{ ... }
  • Table: irby.JobClassification
  • Primary Key: JobClassificationId (GUID)

4.2 Property Breakdown

Property Type Description
JobClassificationId Guid PK, unique identifier.
ClassNumber string Classification code/number.
Name string Human-readable name of the classification.
FringeAmount decimal Fringe benefit cost associated.
State, City, County string Geographic context for the classification.
SAMReference string SAM.gov contract reference.
ImageOCRContents byte[] Raw image bytes for OCR processing.
ImageOCRText string Extracted plain text from image.
JobId Guid FK to parent Job.
CostCodeNumber int Numeric cost code for financial tracking.
CostCodeName string Descriptive cost code name.
IsDeleted bool Soft-delete flagβ€”records not physically removed.

4.3 Navigation & Relationships

[ForeignKey("JobId")]
public Job Job { get; set; }
  • Job: Each classification belongs to one Job entity
  • Lazy/Eager Loading: Configurable via EF Core

5. Sample Code Snippets & Usage

5.1 Adding a New Classification

using (var context = new ImagingDbContext())
{
    var classification = new JobClassification
    {
        JobClassificationId = Guid.NewGuid(),
        ClassNumber       = "A-101",
        Name              = "Skilled Labor",
        FringeAmount      = 12.50m,
        State             = "TX",
        City              = "Dallas",
        County            = "Dallas",
        SAMReference      = "SAM-2022-0456",
        ImageOCRContents  = File.ReadAllBytes("class-doc.png"),
        JobId             = someJobId,
        CostCodeNumber    = 5001,
        CostCodeName      = "Labor",
        IsDeleted         = false
    };
    context.JobClassifications.Add(classification);
    context.SaveChanges();
}

5.2 Querying by Job

var classifications = context.JobClassifications
    .Where(jc => jc.JobId == targetJobId && !jc.IsDeleted)
    .OrderBy(jc => jc.CostCodeNumber)
    .ToList();

6. UML Class Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚       JobClassification       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ + JobClassificationId : Guid  β”‚
β”‚ + ClassNumber        : string β”‚
β”‚ + Name               : string β”‚
β”‚ + FringeAmount       : decimalβ”‚
β”‚ + State,City,County  : stringβ”‚
β”‚ + SAMReference       : string β”‚
β”‚ + ImageOCRContents   : byte[] β”‚
β”‚ + ImageOCRText       : string β”‚
β”‚ + JobId              : Guid   β”‚
β”‚ + CostCodeNumber     : int    β”‚
β”‚ + CostCodeName       : string β”‚
β”‚ + IsDeleted          : bool   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Β«FKΒ» Job : Job                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Multiplicity: 1 Job ❯❯ * JobClassifications

7. Conclusion

The JobClassification class is a cornerstone of the IrbyImaging domain, enabling detailed classification tracking, cost accounting, and OCR-backed document storage. By leveraging EF Core attributes and a clear property design, it provides a robust foundation for job-related data operations within the application ecosystem.

Feel free to integrate, extend, and customize this model to fit your reporting, payroll, or image-processing workflows! πŸš€