This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
---
source_files:
- Common/DTS.CommonCore/Interface/TestMetaData/ITestEngineerDetailsDbRecord.cs
- Common/DTS.CommonCore/Interface/TestMetaData/ICustomerDetailsDbRecord.cs
- Common/DTS.CommonCore/Interface/TestMetaData/ILabratoryDetailsDbRecord.cs
generated_at: "2026-04-16T12:13:05.880610+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "adb5cdc8cb4cf74e"
---
# Documentation: DTS.Common.Core Test Metadata Interfaces
## 1. Purpose
This module defines three data contract interfaces—`ITestEngineerDetailsDbRecord`, `ICustomerDetailsDbRecord`, and `ILabratoryDetailsDbRecord`—within the `DTS.Common.Interface.TestMetaData` namespace. These interfaces abstract the database schema for test metadata entities, mapping properties to specific database columns using `System.ComponentModel.DataAnnotations` attributes. They serve as the data access layer contracts for Test Engineer, Customer, and Laboratory records, likely supporting an ORM framework such as Entity Framework.
## 2. Public Interface
### `ITestEngineerDetailsDbRecord`
Defines the contract for a record in the `TestEngineerDetails` database table.
**Properties:**
* `int TestEngineerId { get; set; }`: The primary key for the record. Mapped to the column `TestEngineerId`.
* `string Name { get; set; }`: Mapped to the column `Name`.
* `string TestEngineerName { get; set; }`: Mapped to the column `TestEngineerName`.
* `string TestEngineerPhone { get; set; }`: Mapped to the column `TestEngineerPhone`.
* `string TestEngineerFax { get; set; }`: Mapped to the column `TestEngineerFax`.
* `string TestEngineerEmail { get; set; }`: Mapped to the column `TestEngineerEmail`.
* `bool LocalOnly { get; set; }`: Mapped to the column `LocalOnly`.
* `DateTime LastModified { get; set; }`: Mapped to the column `LastModified`.
* `string LastModifiedBy { get; set; }`: Mapped to the column `LastModifiedBy`.
* `int Version { get; set; }`: Mapped to the column `Version`.
### `ICustomerDetailsDbRecord`
Defines the contract for a record in the `CustomerDetails` database table.
**Properties:**
* `int CustomerId { get; set; }`: The primary key for the record. Mapped to the column `CustomerId`.
* `string Name { get; set; }`: Mapped to the column `Name`.
* `string CustomerName { get; set; }`: Mapped to the column `CustomerName`.
* `string CustomerTestRefNumber { get; set; }`: Mapped to the column `CustomerTestRefNumber`.
* `string ProjectRefNumber { get; set; }`: Mapped to the column `ProjectRefNumber`.
* `string CustomerOrderNumber { get; set; }`: Mapped to the column `CustomerOrderNumber`.
* `string CustomerCostUnit { get; set; }`: Mapped to the column `CustomerCostUnit`.
* `bool LocalOnly { get; set; }`: Mapped to the column `LocalOnly`.
* `DateTime LastModified { get; set; }`: Mapped to the column `LastModified`.
* `string LastModifiedBy { get; set; }`: Mapped to the column `LastModifiedBy`.
* `int Version { get; set; }`: Mapped to the column `Version`.
### `ILabratoryDetailsDbRecord`
Defines the contract for a record in the `LabratoryDetails` database table.
**Properties:**
* `int LabratoryId { get; set; }`: The primary key for the record. Mapped to the column `LabratoryId`.
* `string Name { get; set; }`: Mapped to the column `Name`.
* `string LabratoryName { get; set; }`: Mapped to the column `LabratoryName`.
* `string LabratoryContactName { get; set; }`: Mapped to the column `LabratoryContactName`.
* `string LabratoryContactPhone { get; set; }`: Mapped to the column `LabratoryContactPhone`.
* `string LabratoryContactFax { get; set; }`: Mapped to the column `LabratoryContactFax`.
* `string LabratoryContactEmail { get; set; }`: Mapped to the column `LabratoryContactEmail`.
* `string LabratoryTestRefNumber { get; set; }`: Mapped to the column `LabratoryTestRefNumber`.
* `string LabratoryProjectRefNumber { get; set; }`: Mapped to the column `LabratoryProjectRefNumber`.
* `DateTime LastModified { get; set; }`: Mapped to the column `LastModified`.
* `string LastModifiedBy { get; set; }`: Mapped to the column `LastModifiedBy`.
* `bool LocalOnly { get; set; }`: Mapped to the column `LocalOnly`.
* `int Version { get; set; }`: Mapped to the column `Version`.
## 3. Invariants
* **Primary Keys**: Each interface requires an integer-based primary key property (`TestEngineerId`, `CustomerId`, `LabratoryId`) decorated with the `[Key]` attribute.
* **Column Mapping**: All properties are explicitly mapped to database columns using the `[Column("...")]` attribute.
* **Audit Trail**: All three interfaces guarantee the existence of `LastModified` (DateTime), `LastModifiedBy` (string), and `Version` (int) properties.
* **Locality**: All three interfaces guarantee a `LocalOnly` boolean flag.
## 4. Dependencies
* **System.ComponentModel.DataAnnotations**: Used for the `[Key]` attribute.
* **System.ComponentModel.DataAnnotations.Schema**: Used for the `[Column]` attribute.
* **System**: Used for basic types (`String`, `Int32`, `DateTime`, `Boolean`).
* **Consumers**: Unknown from source alone, but these interfaces are likely implemented by concrete entity classes consumed by a database context (e.g., Entity Framework `DbContext`).
## 5. Gotchas
* **Spelling Error**: The interface `ILabratoryDetailsDbRecord` and its associated properties/columns (e.g., `LabratoryId`, `LabratoryName`) misspell "Laboratory" as "Labratory". This typo appears to be embedded in the codebase and likely mirrors a typo in the underlying database schema.
* **Redundant Name Fields**: Both `ITestEngineerDetailsDbRecord` and `ICustomerDetailsDbRecord` define a generic `Name` property alongside a more specific `TestEngineerName` or `CustomerName` property. The semantic difference between these two fields is unclear from the source code alone.
* **Nullable Reference Types**: The source code does not enable nullable reference types (no `#nullable enable` directive or `?` annotations on string properties). Consumers should assume strings are nullable or verify data integrity at runtime.