# Delta

**Kind:** Class

**Source:** `Pams/Web/Pams.Web/Client/app/models/dashboard/dashboard-data-fields.ts` (line 323)

**Part of:** [Pams](subsystem-pams)

`Delta` models a dashboard data field and stores its visibility, stored name, field name, type, and caption. It exposes getter and setter methods so dashboard code can read and update field metadata.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `isHidden` | `isHidden()` | `boolean` |
| `setHidden` | `setHidden(flag: boolean)` | `void` |
| `GetStoredName` | `GetStoredName()` | `string` |
| `SetStoredName` | `SetStoredName(name: string)` | `void` |
| `GetFieldName` | `GetFieldName()` | `string` |
| `SetFieldName` | `SetFieldName(name: string)` | `void` |
| `GetType` | `GetType()` | `DeltaTypeEnum` |
| `SetType` | `SetType(type: DeltaTypeEnum)` | `void` |
| `GetCaption` | `GetCaption()` | `string` |
| `SetCaption` | `SetCaption(input: string)` | `void` |
| `SetDataType` | `SetDataType(ty: DataTypeEnum)` | `void` |
| `GetDataType` | `GetDataType()` | `DataTypeEnum` |
| `GetFieldNameTarget` | `GetFieldNameTarget()` | `string` |
| `SetFieldNameTarget` | `SetFieldNameTarget(name: string)` | `void` |
| `GetStoredNameTarget` | `GetStoredNameTarget()` | `string` |
| `SetStoredNameTarget` | `SetStoredNameTarget(name: string)` | `void` |

## Where it refuses work

- `Delta` stops the work with an early return when `this.FieldName`.

## Diagram

```mermaid
graph LR
  Delta[Delta]
  Hidden[Hidden state]
  StoredName[Stored name]
  FieldName[Field name]
  Type[DeltaTypeEnum]
  Caption[Caption]

  Delta --> Hidden
  Delta --> StoredName
  Delta --> FieldName
  Delta --> Type
  Delta --> Caption
```

## Usage

```ts
import { Delta } from "./dashboard-data-fields";

const field = new Delta();

field.setHidden();

const hidden = field.isHidden();
const storedName = field.GetStoredName();
const fieldName = field.GetFieldName();
const fieldType = field.GetType();
const caption = field.GetCaption();

if (hidden) {
  console.log(`Hidden dashboard field: ${caption ?? fieldName ?? storedName}`);
}

console.log(fieldType);
```

## AI Coding Instructions

- Keep the existing method casing, including `GetStoredName`, `SetStoredName`, and `setHidden`.
- Use `isHidden()` when reading visibility state and `setHidden()` when marking a field as hidden.
- Read field metadata through the matching getter methods rather than accessing internal state directly.
- Treat `DeltaTypeEnum` as the source for field type values when integrating dashboard field handling.
- Do not assume setter argument signatures without checking the implementation in `dashboard-data-fields.ts`.

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (1)

- `DashboardWidgetOperationsService` — `Pams/Web/Pams.Web/Client/app/services/dashboard/dashboard-widget-operations.service.ts`:1
