# GroupOperation

**Kind:** Class

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

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

`GroupOperation` stores dashboard grouping field metadata, including stored name, field name, caption, group type, and data type. Dashboard code can populate it through setter methods and read configured values and visibility through getter methods and `isHidden()`.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `SetStoredName` | `SetStoredName(name: string)` | `void` |
| `GetFieldName` | `GetFieldName()` | `string` |
| `SetFieldName` | `SetFieldName(name: string)` | `void` |
| `GetType` | `GetType()` | `DateGroupEnum` |
| `SetType` | `SetType(type: DateGroupEnum)` | `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 |
|---|---|
| `CertainYear` | `number` |
| `GetStoredName` | `any` |

## Where it refuses work

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

## Diagram

```mermaid
graph LR
  Dashboard[Dashboard configuration] --> GroupOperation
  GroupOperation --> SetStoredName
  GroupOperation --> SetFieldName
  GroupOperation --> SetType
  GroupOperation --> SetCaption
  GroupOperation --> SetDataType
  GroupOperation --> GetFieldName
  GroupOperation --> GetType
  GroupOperation --> GetCaption
  GroupOperation --> GetDataType
  GroupOperation --> isHidden
```

## Usage

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

function createGroupOperation(
  storedName: string,
  groupType: DateGroupEnum,
  dataType: DataTypeEnum,
): GroupOperation {
  const operation = new GroupOperation();

  operation.SetStoredName(storedName);
  operation.SetFieldName(storedName);
  operation.SetCaption("Order date");
  operation.SetType(groupType);
  operation.SetDataType(dataType);

  if (!operation.isHidden()) {
    console.log(operation.GetCaption(), operation.GetFieldName());
  }

  return operation;
}
```

## AI Coding Instructions

- Set the stored name, field name, caption, type, and data type before passing a `GroupOperation` to dashboard rendering code.
- Pass values from `DateGroupEnum` to `SetType()` and values from `DataTypeEnum` to `SetDataType()`.
- Read configuration through `GetFieldName()`, `GetType()`, `GetCaption()`, and `GetDataType()` instead of duplicating field metadata elsewhere.
- Check `isHidden()` before showing the operation in dashboard field selectors or grouping controls.

## 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
