# ActiveTotal

**Kind:** Class

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

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

`ActiveTotal` stores the field metadata used to represent an active total in dashboard data. It keeps the stored field name, display field name, caption, delta type, and data type together for dashboard rendering and data processing.

## 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 --> DeltaTypeEnum
  ActiveTotal --> DataTypeEnum
  Dashboard --> ActiveTotal
```

## Usage

```ts
function configureActiveTotal(
  activeTotal: ActiveTotal,
  storedName: string,
  fieldName: string,
  caption: string,
  type: DeltaTypeEnum,
  dataType: DataTypeEnum,
): void {
  activeTotal.SetStoredName(storedName);
  activeTotal.SetFieldName(fieldName);
  activeTotal.SetCaption(caption);
  activeTotal.SetType(type);
  activeTotal.SetDataType(dataType);

  console.log(activeTotal.GetCaption());
  console.log(activeTotal.GetFieldName());
}
```

## AI Coding Instructions

- Set all field metadata before passing an `ActiveTotal` instance to dashboard rendering or data-processing code.
- Use `GetStoredName()` for persisted or source-field references and `GetFieldName()` for the dashboard-facing field name.
- Keep `DeltaTypeEnum` and `DataTypeEnum` values aligned with the field’s actual calculation and source data.
- Use `GetCaption()` for display text rather than deriving labels from stored field names.
