8.1 KiB
8.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T02:59:59.267381+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 5fb9e524b8a88a44 |
Documentation: Test Metadata Record Interfaces
1. Purpose
This module defines a set of interfaces that describe the schema of three database tables—TestEngineerDetails, CustomerDetails, and LabratoryDetails—used to store metadata for testing workflows. These interfaces serve as strongly-typed contracts for data access layers (e.g., Entity Framework ORM mappings) and ensure consistency between database records and domain models. They are part of the DTS.Common.Interface.TestMetaData namespace and are intended to be implemented by concrete data models used throughout the system for test configuration, reporting, and auditability.
2. Public Interface
ITestEngineerDetailsDbRecord
Represents a record in the TestEngineerDetails table.
int TestEngineerId { get; set; }— Primary key (mapped toTestEngineerIdcolumn).string Name { get; set; }— Generic name field (mapped toNamecolumn).string TestEngineerName { get; set; }— Full name of the test engineer (mapped toTestEngineerNamecolumn).string TestEngineerPhone { get; set; }— Phone number of the test engineer (mapped toTestEngineerPhonecolumn).string TestEngineerFax { get; set; }— Fax number of the test engineer (mapped toTestEngineerFaxcolumn).string TestEngineerEmail { get; set; }— Email address of the test engineer (mapped toTestEngineerEmailcolumn).bool LocalOnly { get; set; }— Flag indicating if the record is local-only (mapped toLocalOnlycolumn).DateTime LastModified { get; set; }— Timestamp of last modification (mapped toLastModifiedcolumn).string LastModifiedBy { get; set; }— User identifier who last modified the record (mapped toLastModifiedBycolumn).int Version { get; set; }— Concurrency token/version number (mapped toVersioncolumn).
ICustomerDetailsDbRecord
Represents a record in the CustomerDetails table.
int CustomerId { get; set; }— Primary key (mapped toCustomerIdcolumn).string Name { get; set; }— Generic name field (mapped toNamecolumn).string CustomerName { get; set; }— Full name of the customer (mapped toCustomerNamecolumn).string CustomerTestRefNumber { get; set; }— Customer-specific test reference number (mapped toCustomerTestRefNumbercolumn).string ProjectRefNumber { get; set; }— Project reference number (mapped toProjectRefNumbercolumn).string CustomerOrderNumber { get; set; }— Customer order number (mapped toCustomerOrderNumbercolumn).string CustomerCostUnit { get; set; }— Cost center or cost unit identifier (mapped toCustomerCostUnitcolumn).bool LocalOnly { get; set; }— Flag indicating if the record is local-only (mapped toLocalOnlycolumn).DateTime LastModified { get; set; }— Timestamp of last modification (mapped toLastModifiedcolumn).string LastModifiedBy { get; set; }— User identifier who last modified the record (mapped toLastModifiedBycolumn).int Version { get; set; }— Concurrency token/version number (mapped toVersioncolumn).
ILabratoryDetailsDbRecord
Represents a record in the LabratoryDetails table.
int LabratoryId { get; set; }— Primary key (mapped toLabratoryIdcolumn).string Name { get; set; }— Generic name field (mapped toNamecolumn).string LabratoryName { get; set; }— Full name of the laboratory (mapped toLabratoryNamecolumn).string LabratoryContactName { get; set; }— Name of the laboratory contact person (mapped toLabratoryContactNamecolumn).string LabratoryContactPhone { get; set; }— Contact phone number (mapped toLabratoryContactPhonecolumn).string LabratoryContactFax { get; set; }— Contact fax number (mapped toLabratoryContactFaxcolumn).string LabratoryContactEmail { get; set; }— Contact email address (mapped toLabratoryContactEmailcolumn).string LabratoryTestRefNumber { get; set; }— Laboratory test reference number (mapped toLabratoryTestRefNumbercolumn).string LabratoryProjectRefNumber { get; set; }— Laboratory project reference number (mapped toLabratoryProjectRefNumbercolumn).DateTime LastModified { get; set; }— Timestamp of last modification (mapped toLastModifiedcolumn).string LastModifiedBy { get; set; }— User identifier who last modified the record (mapped toLastModifiedBycolumn).bool LocalOnly { get; set; }— Flag indicating if the record is local-only (mapped toLocalOnlycolumn).int Version { get; set; }— Concurrency token/version number (mapped toVersioncolumn).
3. Invariants
- Primary Key: Each interface defines exactly one key property (
TestEngineerId,CustomerId,LabratoryId), marked with[Key]and mapped to a column of the same name. - Column Mapping: All properties are explicitly mapped to database columns via
[Column("...")]attributes; column names match the property names except for the key field (e.g.,TestEngineerId→TestEngineerId, butName→Name). - Required Fields: No
[Required]attributes are present, implying all string properties are nullable and optional at the database level. - Timestamps:
LastModifiedis a non-nullableDateTime;LastModifiedByandVersionare present in all interfaces, suggesting audit and concurrency control. - Local-Only Flag: All interfaces include a
LocalOnlyboolean field, likely used to distinguish between centrally managed and site-specific records. - Versioning: The
Versionfield (typeint) is present in all interfaces, likely used for optimistic concurrency control (e.g., EF Core row versioning).
4. Dependencies
- Dependencies:
System.ComponentModel.DataAnnotations(for[Key],[Column]attributes).System(forDateTime,string,bool,int).
- Depended upon:
- This module is part of
DTS.Common.Interface.TestMetaData, implying it is consumed by downstream modules (e.g., data access layers, UI view models, or service layers) that interact with test metadata. - Likely used by EF Core or similar ORMs to map database tables to domain models.
- No direct implementation is provided in the source files; implementations are expected in other modules (e.g.,
DTS.DataorDTS.Domain).
- This module is part of
5. Gotchas
- Typo in Namespace/Class Names: The interface
ILabratoryDetailsDbRecordand its associated table/column names use the misspelled "Labratory" (instead of "Laboratory"). This is consistent across all three files and likely reflects legacy naming; changing it would require database schema migration. - Redundant
NameField: All interfaces include both aNameproperty and a more specific name field (e.g.,TestEngineerName,CustomerName). The purpose ofNameis unclear—possibly a generic display name or fallback—but its semantics are not documented. - Missing Validation: No
[Required],[StringLength], or regex validation attributes are applied, so consumers must enforce business rules externally (e.g., in services or UI). LocalOnlySemantics: The meaning ofLocalOnlyis not specified beyond its presence; its usage (e.g., filtering, sync behavior) must be inferred from implementation code.- No Relationship Metadata: These interfaces define only scalar properties; foreign key relationships (e.g., to a
TestorProjecttable) are not expressed here and must be defined elsewhere. VersionField Type: TheVersionfield is anint, but EF Core typically usesbyte[]for row versioning. If used with EF Core, this may require explicit configuration or could indicate a custom concurrency mechanism.