# Group

## Extends

- `Group`

### payload

```ts
payload: Group;
```

The underlying payload data for this resource

#### Inherited from

```ts
Bkper.Group.payload
```

### create()

```ts
create(): Group;
```

Perform create new group.

#### Returns

`Group`

The created Group, for chainning.

#### Inherited from

```ts
Bkper.Group.create
```

***

### deleteProperty()

```ts
deleteProperty(key): this;
```

Deletes a custom property.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Group.deleteProperty
```

***

### getAccounts()

```ts
getAccounts(): Account[];
```

#### Returns

`Account`[]

All Accounts of this group.

#### Inherited from

```ts
Bkper.Group.getAccounts
```

***

### getChildren()

```ts
getChildren(): Group[];
```

#### Returns

`Group`[]

The children Groups

#### Inherited from

```ts
Bkper.Group.getChildren
```

***

### getDepth()

```ts
getDepth(): number;
```

#### Returns

`number`

The depth in the parent Group chain up to the root Group

#### Inherited from

```ts
Bkper.Group.getDepth
```

***

### getId()

```ts
getId(): string;
```

#### Returns

`string`

The id of this Group

#### Inherited from

```ts
Bkper.Group.getId
```

***

### getName()

```ts
getName(): string;
```

#### Returns

`string`

The name of this Group

#### Inherited from

```ts
Bkper.Group.getName
```

***

### getNormalizedName()

```ts
getNormalizedName(): string;
```

#### Returns

`string`

The name of this group without spaces and special characters

#### Inherited from

```ts
Bkper.Group.getNormalizedName
```

***

### getParent()

```ts
getParent(): Group;
```

#### Returns

`Group`

The parent Group

#### Inherited from

```ts
Bkper.Group.getParent
```

***

### getParentGroupsChain()

```ts
getParentGroupsChain(): Group[];
```

#### Returns

`Group`[]

The parent Groups chain up to the root Group

#### Inherited from

```ts
Bkper.Group.getParentGroupsChain
```

***

### getProperties()

```ts
getProperties(): object;
```

Gets the custom properties stored in this resource.

#### Returns

`object`

Object with key/value pair properties

#### Inherited from

```ts
Bkper.Group.getProperties
```

***

### getProperty()

```ts
getProperty(...keys): string;
```

Gets the property value for given keys. First property found will be retrieved.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| ...`keys` | `string`[] |

#### Returns

`string`

The property value or null if not found

#### Inherited from

```ts
Bkper.Group.getProperty
```

***

### getPropertyKeys()

```ts
getPropertyKeys(): string[];
```

Gets the custom properties keys stored in this resource.

#### Returns

`string`[]

Array of property keys sorted alphabetically

#### Inherited from

```ts
Bkper.Group.getPropertyKeys
```

***

### getRoot()

```ts
getRoot(): Group;
```

#### Returns

`Group`

The root Group

#### Inherited from

```ts
Bkper.Group.getRoot
```

***

### getType()

```ts
getType(): AccountType;
```

#### Returns

[`AccountType`](https://bkper.com/docs/api/bkper-gs/enumerations/accounttype.md)

The type of the group based on its accounts. Undefined if the group has accounts of different types

#### Inherited from

```ts
Bkper.Group.getType
```

***

### getVisibleProperties()

```ts
getVisibleProperties(): object;
```

Gets the visible custom properties stored in this resource.
Hidden properties (those ending with "_") are excluded from the result.

#### Returns

`object`

Object with key/value pair properties, excluding hidden properties

#### Inherited from

```ts
Bkper.Group.getVisibleProperties
```

***

### hasAccounts()

```ts
hasAccounts(): boolean;
```

#### Returns

`boolean`

True if this group has any account in it

#### Inherited from

```ts
Bkper.Group.hasAccounts
```

***

### hasChildren()

```ts
hasChildren(): boolean;
```

Tell if this group has any children

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Group.hasChildren
```

***

### isCredit()

```ts
isCredit(): boolean;
```

Tell if this is a credit (Incoming and Liabities) group

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Group.isCredit
```

***

### isHidden()

```ts
isHidden(): boolean;
```

Tell if the Group is hidden on main transactions menu

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Group.isHidden
```

***

### isLocked()

```ts
isLocked(): boolean;
```

#### Returns

`boolean`

True if the Group is locked by the Book owner.

#### Inherited from

```ts
Bkper.Group.isLocked
```

***

### isMixed()

```ts
isMixed(): boolean;
```

Tell if this is a mixed (Assets/Liabilities or Incoming/Outgoing) group

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Group.isMixed
```

***

### isPermanent()

```ts
isPermanent(): boolean;
```

Tell if this is a permanent (Assets and Liabilities) group

#### Returns

`boolean`

#### Inherited from

```ts
Bkper.Group.isPermanent
```

***

### json()

```ts
json(): Group;
```

Gets an immutable copy of the JSON payload for this resource.

#### Returns

`Group`

An immutable copy of the json payload

#### Inherited from

```ts
Bkper.Group.json
```

***

### remove()

```ts
remove(): Group;
```

Perform delete group.

#### Returns

`Group`

#### Inherited from

```ts
Bkper.Group.remove
```

***

### setHidden()

```ts
setHidden(hidden): Group;
```

Hide/Show group on main menu.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `hidden` | `boolean` |

#### Returns

`Group`

#### Inherited from

```ts
Bkper.Group.setHidden
```

***

### setLocked()

```ts
setLocked(locked): Group;
```

Sets the locked state of the Group.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `locked` | `boolean` |

#### Returns

`Group`

This Group, for chainning.

#### Inherited from

```ts
Bkper.Group.setLocked
```

***

### setName()

```ts
setName(name): Group;
```

Sets the name of the Group.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `name` | `string` |

#### Returns

`Group`

This Group, for chainning.

#### Inherited from

```ts
Bkper.Group.setName
```

***

### setParent()

```ts
setParent(group): Group;
```

Sets the parent Group.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `group` | `Group` \| `null` |

#### Returns

`Group`

This Group, for chainning.

#### Inherited from

```ts
Bkper.Group.setParent
```

***

### setProperties()

```ts
setProperties(properties): this;
```

Sets the custom properties of this resource.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Group.setProperties
```

***

### setProperty()

```ts
setProperty(key, value): this;
```

Sets a custom property in this resource.

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |
| `value` | `string` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Group.setProperty
```

***

### setVisibleProperties()

```ts
setVisibleProperties(properties): this;
```

Sets the custom properties of this resource, filtering out hidden properties.
Hidden properties are those whose keys end with an underscore "_".

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `properties` | \{ \[`key`: `string`\]: `string`; \} |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Group.setVisibleProperties
```

***

### setVisibleProperty()

```ts
setVisibleProperty(key, value): this;
```

Sets a custom property in this resource, filtering out hidden properties.
Hidden properties are those whose keys end with an underscore "_".

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `key` | `string` |
| `value` | `string` \| `null` |

#### Returns

`this`

This resource, for chaining

#### Inherited from

```ts
Bkper.Group.setVisibleProperty
```

***

### update()

```ts
update(): Group;
```

Perform update group, applying pending changes.

#### Returns

`Group`

#### Inherited from

```ts
Bkper.Group.update
```
