11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T02:39:45.898460+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 7adaa8e0587cfc54 |
Documentation: Test Metadata Database Record Classes
1. Purpose
These three classes—TestEngineerDetailsDbRecord, CustomerDetailsDbRecord, and LabratoryDetailsDbRecord—represent immutable data transfer objects (DTOs) for loading and encapsulating metadata about test engineers, customers, and laboratories from a database. They implement the INotifyPropertyChanged pattern via inheritance from Base.BasePropertyChanged, enabling data binding in UI layers, and provide constructors to initialize from an IDataReader (for database hydration) or from another instance of the same interface type (for cloning). Each class serves as a strongly-typed, schema-bound representation of rows in corresponding database tables, used throughout the test execution and reporting pipeline to ensure consistent metadata access.
2. Public Interface
All three classes share a common structural pattern. Below, each class is documented individually.
TestEngineerDetailsDbRecord
- Namespace:
DTS.Common.Classes.TestEngineerDetails - Interface:
ITestEngineerDetailsDbRecord - Base Class:
Base.BasePropertyChanged
Constructors
TestEngineerDetailsDbRecord()
Default constructor; initializes all fields to their default values (-1for IDs,""for strings,falsefor booleans,DateTime.MinValuefor dates).TestEngineerDetailsDbRecord(ITestEngineerDetailsDbRecord testEngineerDetailsDbRecord)
Copy constructor; copies all property values from the provided interface instance.TestEngineerDetailsDbRecord(IDataReader reader)
Database constructor; reads values from anIDataReaderusingUtility.GetString,Utility.GetInt,Utility.GetDateTime, andUtility.GetBoolhelper methods.
Properties
| Property | Type | Attributes | Description |
|---|---|---|---|
TestEngineerId |
int |
[Browsable(false)], [ReadOnly(true)] |
Primary key identifier for the test engineer. Default: -1. |
Name |
string |
[Browsable(false)], [ReadOnly(true)] |
Internal/system name (e.g., login or DB key). Default: "". |
TestEngineerName |
string |
[DisplayResource("TestEngineerName")] |
Display-friendly name (e.g., full name). Default: "NOVALUE". |
TestEngineerPhone |
string |
[DisplayResource("TestEngineerPhone")] |
Contact phone number. Default: "NOVALUE". |
TestEngineerFax |
string |
[DisplayResource("TestEngineerFax")] |
Contact fax number. Default: "NOVALUE". |
TestEngineerEmail |
string |
[DisplayResource("TestEngineerEmail")] |
Contact email address. Default: "NOVALUE". |
LocalOnly |
bool |
[Browsable(false)], [ReadOnly(true)] |
Indicates if record is local-only (not synchronized). Default: false. |
LastModified |
DateTime |
[Browsable(false)], [ReadOnly(true)] |
Timestamp of last modification. Default: DateTime.MinValue. |
LastModifiedBy |
string |
[Browsable(false)], [ReadOnly(true)] |
User who last modified the record. Default: "". |
Version |
int |
[Browsable(false)], [ReadOnly(true)] |
Concurrency/version token. Default: -1. |
Methods
bool IsInvalidBlank()
ReturnstrueifNameisnull, empty, or whitespace; otherwisefalse.
CustomerDetailsDbRecord
- Namespace:
DTS.Common.Classes.CustomerDetails - Interface:
ICustomerDetailsDbRecord - Base Class:
Base.BasePropertyChanged
Constructors
CustomerDetailsDbRecord()
Default constructor.CustomerDetailsDbRecord(ICustomerDetailsDbRecord customerDetailsDbRecord)
Copy constructor.CustomerDetailsDbRecord(IDataReader reader)
Database constructor.
Properties
| Property | Type | Attributes | Description |
|---|---|---|---|
CustomerId |
int |
[Browsable(false)], [ReadOnly(true)] |
Primary key identifier. Default: -1. |
Name |
string |
[Browsable(false)], [ReadOnly(true)] |
Internal/system name. Default: "". |
CustomerName |
string |
[DisplayResource("CustomerName")] |
Display name. Default: "". |
CustomerTestRefNumber |
string |
[DisplayResource("CustomerTestRefNumber")] |
Customer-provided test reference number. Default: "". |
ProjectRefNumber |
string |
[DisplayResource("ProjectRefNumber")] |
Project reference number. Default: "NOVALUE". |
CustomerOrderNumber |
string |
[DisplayResource("CustomerOrderNumber")] |
Customer order number. Default: "NOVALUE". |
CustomerCostUnit |
string |
[DisplayResource("CustomerCostUnit")] |
Cost center/unit. Default: "NOVALUE". |
LocalOnly |
bool |
[Browsable(false)], [ReadOnly(true)] |
Local-only flag. Default: false. |
LastModified |
DateTime |
[Browsable(false)], [ReadOnly(true)] |
Last modification timestamp. Default: DateTime.MinValue. |
LastModifiedBy |
string |
[Browsable(false)], [ReadOnly(true)] |
Last modifier. Default: "". |
Version |
int |
[Browsable(false)], [ReadOnly(true)] |
Version token. Default: -1. |
Methods
bool IsInvalidBlank()
ReturnstrueifNameisnull, empty, or whitespace.
LabratoryDetailsDbRecord
- Namespace:
DTS.Common.Classes.LabratoryDetails - Interface:
ILabratoryDetailsDbRecord - Base Class:
Base.BasePropertyChanged
Constructors
LabratoryDetailsDbRecord()
Default constructor.LabratoryDetailsDbRecord(ILabratoryDetailsDbRecord labratoryDetailsDbRecord)
Copy constructor.LabratoryDetailsDbRecord(IDataReader reader)
Database constructor.
Properties
| Property | Type | Attributes | Description |
|---|---|---|---|
LabratoryId |
int |
[Browsable(false)], [ReadOnly(true)] |
Primary key identifier. Default: -1. |
Name |
string |
[Browsable(false)], [ReadOnly(true)] |
Internal/system name. Default: "". |
LabratoryName |
string |
[DisplayResource("LabratoryName")] |
Display name of lab. Default: "". |
LabratoryContactName |
string |
[DisplayResource("LabratoryContactName")] |
Primary contact name. Default: "". |
LabratoryContactPhone |
string |
[DisplayResource("LabratoryContactPhone")] |
Contact phone. Default: "NOVALUE". |
LabratoryContactFax |
string |
[DisplayResource("LabratoryContactFax")] |
Contact fax. Default: "NOVALUE". |
LabratoryContactEmail |
string |
[DisplayResource("LabratoryContactEmail")] |
Contact email. Default: "NOVALUE". |
LabratoryTestRefNumber |
string |
[DisplayResource("LabratoryTestRefNumber")] |
Lab-provided test reference. Default: "". |
LabratoryProjectRefNumber |
string |
[DisplayResource("LabratoryProjectRefNumber")] |
Lab project reference. Default: "". |
LocalOnly |
bool |
[Browsable(false)], [ReadOnly(true)] |
Local-only flag. Default: false. |
LastModified |
DateTime |
[Browsable(false)], [ReadOnly(true)] |
Last modification timestamp. Default: DateTime.MinValue. |
LastModifiedBy |
string |
[Browsable(false)], [ReadOnly(true)] |
Last modifier. Default: "". |
Version |
int |
[Browsable(false)], [ReadOnly(true)] |
Version token. Default: -1. |
Methods
bool IsInvalidBlank()
ReturnstrueifNameisnull, empty, or whitespace.
3. Invariants
Nameis required: All classes enforce thatNamemust be non-null and non-whitespace for a record to be considered valid. This is validated by theIsInvalidBlank()method.- Default sentinel values: String properties not marked with
[DisplayResource]default to""(e.g.,Name,LastModifiedBy). String properties with[DisplayResource]default to"NOVALUE"(exceptCustomerNameandCustomerTestRefNumber, which default to""). - Numeric defaults:
*IdandVersionfields default to-1;LastModifieddefaults toDateTime.MinValue. - Read-only metadata fields: Properties
*Id,Name,LocalOnly,LastModified,LastModifiedBy, andVersionare marked[ReadOnly(true)]and[Browsable(false)], indicating they are not intended for user editing in UI contexts. - Property change notification: All properties use
SetProperty, implyingINotifyPropertyChangedevents will fire on changes (via base classBase.BasePropertyChanged).
4. Dependencies
Internal Dependencies
DTS.Common.Base.Classes.BasePropertyChanged— Base class providingSetPropertyandINotifyPropertyChangedimplementation.DTS.Common.Interface.TestMetaData.*— InterfacesITestEngineerDetailsDbRecord,ICustomerDetailsDbRecord,ILabratoryDetailsDbRecord.DTS.Common.Utilities.Logging— Imported but not used in the provided code (likely legacy or for future use).System.Data— Required forIDataReaderconstructor.System.ComponentModel— Required for[Browsable],[ReadOnly],[DisplayResource]attributes.
External Dependencies
Utilityclass (static/internal) — Provides helper methods:GetString,GetInt,GetDateTime,GetBool. These are assumed to be safe null-handling wrappers aroundIDataReaderaccessors.
Inferred Usage
- These classes are likely consumed by:
- Data access layers (DALs) that populate them from database queries.
- UI layers (e.g., WPF) via data binding (justified by
INotifyPropertyChangedand[DisplayResource]attributes). - Serialization layers (e.g., XML via
XmlSerializer, inferred fromusing System.Xml.Serialization).
5. Gotchas
- Typo in namespace/class name: The namespace and class
LabratoryDetailsDbRecorduses the misspelled "Labratory" (should be "Laboratory"). This is consistent across files and may be intentional legacy, but is a potential source of confusion. - Inconsistent default values for
[DisplayResource]strings:CustomerNameandCustomerTestRefNumberdefault to"", while other[DisplayResource]fields default to"NOVALUE". This inconsistency may indicate incomplete refactoring or differing business semantics.
IsInvalidBlank()only checksName: Validation is minimal and only considers the internalNamefield. Other required fields (e.g.,TestEngineerNamefor engineers) are not validated, potentially allowing partially populated records.[DisplayResource]attribute behavior unknown: The[DisplayResource("...")]attribute is used, but its implementation and how it interacts with localization/resource loading are not visible here. Its effect is assumed to be runtime (e.g., via a customTypeConverteror binding converter), but this is not documented in the source.- No immutability enforcement: Despite being used as DTOs, properties have public setters and are not immutable. The
Copyconstructor does not prevent mutation of the source object. - No null-safety guarantees in
Utilitymethods: The behavior ofUtility.GetString,Utility.GetBool, etc., onDBNullor missing columns is not visible. Assumed safe (e.g., returning defaults), but not guaranteed by this code.
None identified beyond the above.