# ActiveTotal

**Kind:** Class

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

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

`ActiveTotal` models metadata for an active dashboard total, including its stored name, field name, caption, delta type, and data type. Dashboard code can read and update these values through paired getter and setter methods when assembling or rendering total fields.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `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` |

## Properties

| Property | Type |
|---|---|
| `Type` | `any` |

## Where it refuses work

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

## Diagram

```mermaid
graph LR
  ActiveTotal --> StoredName
  ActiveTotal --> FieldName
  ActiveTotal --> Caption
  ActiveTotal --> DeltaType[DeltaTypeEnum]
  ActiveTotal --> DataType[DataTypeEnum]

  GetStoredName --> StoredName
  SetStoredName --> StoredName
  GetFieldName --> FieldName
  SetFieldName --> FieldName
  GetCaption --> Caption
  SetCaption --> Caption
  GetType --> DeltaType
  SetType --> DeltaType
  GetDataType --> DataType
  SetDataType --> DataType
```

## Usage

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

const activeTotal = new ActiveTotal();

activeTotal.SetStoredName("OrderTotal");
activeTotal.SetFieldName("total");
activeTotal.SetCaption("Total");

const storedName = activeTotal.GetStoredName();
const fieldName = activeTotal.GetFieldName();
const caption = activeTotal.GetCaption();

console.log({ storedName, fieldName, caption });
```

## AI Coding Instructions

- Use the getter and setter pairs rather than reading or writing internal fields directly.
- Keep `StoredName` aligned with the dashboard payload field expected by the data source.
- Set `FieldName` and `Caption` separately when the display label differs from the source field name.
- Pass values from `DeltaTypeEnum` to `SetType` and values from `DataTypeEnum` to `SetDataType`.
