Skip to content

ActiveTotal

reference
1 min readUpdated

Kind: Class

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

Part of: 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

MethodSignatureReturns
GetStoredNameGetStoredName()string
SetStoredNameSetStoredName(name: string)void
GetFieldNameGetFieldName()string
SetFieldNameSetFieldName(name: string)void
GetTypeGetType()DeltaTypeEnum
SetTypeSetType(type: DeltaTypeEnum)void
GetCaptionGetCaption()string
SetCaptionSetCaption(input: string)void
SetDataTypeSetDataType(ty: DataTypeEnum)void
GetDataTypeGetDataType()DataTypeEnum
GetFieldNameTargetGetFieldNameTarget()string
SetFieldNameTargetSetFieldNameTarget(name: string)void
GetStoredNameTargetGetStoredNameTarget()string
SetStoredNameTargetSetStoredNameTarget(name: string)void

Properties

PropertyType
Typeany

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.

Was this page helpful?

Download as PDF