# expectationOperation

**Kind:** Class

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

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

`expectationOperation` represents expected metadata for a dashboard data field. It exposes accessors for the field name, caption, expected field type, data type, stored name, and hidden-state evaluation.

## Methods

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

## Properties

| Property | Type |
|---|---|
| `callback` | `callbackPRAny` |
| `CertainYear` | `number` |
| `GetStoredName` | `any` |

## Where it refuses work

- `expectationOperation` stops the work with an early return when `this.Field.StoredName`.
- `expectationOperation` stops the work with an early return when `this.Field.FieldName`.

## Diagram

```mermaid
graph LR
  Operation[expectationOperation]
  Operation --> StoredName[SetStoredName]
  Operation --> FieldName[GetFieldName / SetFieldName]
  Operation --> FieldType[GetType / SetType]
  Operation --> Caption[GetCaption / SetCaption]
  Operation --> DataType[GetDataType / SetDataType]
  Operation --> Hidden[isHidden]
```

## Usage

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

const operation = new expectationOperation();

operation.SetStoredName();
operation.SetFieldName();
operation.SetType();
operation.SetCaption();
operation.SetDataType();

const fieldName = operation.GetFieldName();
const caption = operation.GetCaption();
const fieldType = operation.GetType();
const dataType = operation.GetDataType();

if (!operation.isHidden()) {
  console.log({ fieldName, caption, fieldType, dataType });
}
```

## AI Coding Instructions

- Treat `expectationOperation` as the metadata model for expected dashboard fields.
- Use the getter methods when reading field names, captions, types, and data types instead of depending on internal state.
- Keep stored-name, field-name, type, caption, and data-type updates consistent when extending the model.
- Do not assume hidden-state behavior from the field name alone; use `isHidden()` for visibility checks.
- Preserve the existing method naming and casing when integrating with dashboard field processing code.
