Files
DP44/docs/ai/Common/DTS.Common.DataModel/Classes/TestMetaData.md

59 lines
4.4 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common.DataModel/Classes/TestMetaData/CustomerDetails.cs
- Common/DTS.Common.DataModel/Classes/TestMetaData/LabratoryDetails.cs
- Common/DTS.Common.DataModel/Classes/TestMetaData/TestEngineerDetails.cs
generated_at: "2026-04-17T15:40:07.281803+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "cadfbac004011276"
---
# Documentation: Test Metadata Data Models
## 1. Purpose
This module provides UI-facing data model wrappers for test metadata entities—`CustomerDetails`, `LabratoryDetails`, and `TestEngineerDetails`—that encapsulate underlying `DTS.Common.ISO` data objects. These classes implement property change notification via `BasePropertyChanged` to support WPF data binding, track modification state through a `_blank` flag, and expose static list management classes for CRUD operations against the ISO persistence layer. The module serves as an adapter between raw ISO data objects and the presentation layer.
---
## 2. Public Interface
### `CustomerDetails` (class, inherits `BasePropertyChanged`)
| Member | Signature | Description |
|--------|-----------|-------------|
| `Fields` | `public enum Fields` | Enum values: `Name`, `CustomerName`, `CustomerTestRefNumber`, `ProjectRefNumber`, `CustomerOrderNumber`, `CustomerCostUnit` |
| `Name` | `public string Name { get; set; }` | Gets/sets `_customerDetails.Name`; sets `_blank = false` on set; raises `OnPropertyChanged` |
| `CustomerName` | `public string CustomerName { get; set; }` | Gets/sets `_customerDetails.CustomerName` |
| `CustomerTestRefNumber` | `public string CustomerTestRefNumber { get; set; }` | Gets/sets `_customerDetails.CustomerTestRefNumber` |
| `ProjectRefNumber` | `public string ProjectRefNumber { get; set; }` | Gets/sets `_customerDetails.ProjectRefNumber` |
| `CustomerOrderNumber` | `public string CustomerOrderNumber { get; set; }` | Gets/sets `_customerDetails.CustomerOrderNumber` |
| `CustomerCostUnit` | `public string CustomerCostUnit { get; set; }` | Gets/sets `_customerDetails.CustomerCostUnit` |
| `LocalOnly` | `public bool LocalOnly { get; }` | Returns `_customerDetails.LocalOnly` |
| `LastModified` | `public DateTime LastModified { get; }` | Returns `_customerDetails.LastModified` |
| `LastModifiedBy` | `public string LastModifiedBy { get; }` | Returns `_customerDetails.LastModifiedBy` |
| `Version` | `public int Version { get; }` | Returns `_customerDetails.Version` |
| `IsBlank` | `public bool IsBlank()` | Returns `_blank` field |
| `HasBlankName` | `public bool HasBlankName()` | Returns `true` if `Name == StringResources.TestTemplate_EmptyListName` |
| `CustomerDetails()` | `public CustomerDetails()` | Default constructor; initializes new `DTS.Common.ISO.CustomerDetails` with `Name` set to `StringResources.TestTemplate_EmptyListName` |
| `CustomerDetails(DTS.Common.ISO.CustomerDetails)` | `public CustomerDetails(DTS.Common.ISO.CustomerDetails customerDetails)` | Copy constructor; sets `_blank = false` |
| `GetISOCustomer` | `public DTS.Common.ISO.CustomerDetails GetISOCustomer()` | Returns the wrapped ISO object |
| `ToString` | `public override string ToString()` | Returns `Name` |
### `CustomerDetailsList` (class, inherits `BasePropertyChanged`)
| Member | Signature | Description |
|--------|-----------|-------------|
| `Delete` | `public static void Delete(CustomerDetails customer)` | Calls `customer.GetISOCustomer().Delete(ApplicationProperties.CurrentUser.UserName)` |
| `Delete` | `public static void Delete(CustomerDetails[] customers)` | Iterates and calls `Delete` on each |
| `GetAllCustomers` | `public static CustomerDetails[] GetAllCustomers()` | Retrieves all customers via `DTS.Common.ISO.CustomerDetails.GetAllCustomerDetails()`, wraps them, sorts by `Name` (ordinal comparison) |
| `DeleteAll` | `public static void DeleteAll()` | Calls `DTS.Common.ISO.CustomerDetails.DeleteCustomerDetails()` |
| `GetCustomerDetail` | `public static CustomerDetails GetCustomerDetail(string name)` | Returns `null` if name is null/empty; otherwise retrieves via `DTS.Common.ISO.CustomerDetails.GetCustomerDetails(name)` |
| `AddCustomer` | `public static void AddCustomer(CustomerDetails customer)` | Calls `customer.GetISOCustomer().Commit(ApplicationProperties.CurrentUser.UserName)` |
### `LabratoryDetails` (class, inherits `BasePropertyChanged`)
| Member | Signature | Description |
|--------|-----------|-------------|
| `Tags` | `public enum Tags` | Enum values: `LabratoryName`, `Labr