---
title: "Group and category lookups"
summary: Operation implemented by GroupRepository
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.NHibernate
reference_type: package
operation_id: "OP-SDN-14"
trigger: "See steps below"
---


# Group and category lookups

Group and category lookups is implemented by `GroupRepository` and is documented as OP-SDN-14 in the Stage 1 analysis.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SDN-14 |
| **Trigger** | See steps below |
| **Primary components** | `GroupRepository` |

## Steps

1. `GroupFound`, `GetGroup`, `GetGroupOrDefault` query `GroupAssociation` (`group_association`).
2. `GetImageCategoryCodes` returns category codes where `FileCode == ImageFileCode.GroupImageFileCode` ("GROUP").
   - Rule: [SDN-BR-044](../business-rules.md#sdn-br-044-group-image-categories-are-those-with-file-code-%22group%22).
3. `ImageDocumentTypeFound` and `GetDocumentTypeOrDefault` look up by category and document type.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Group and category lookups"]) --> S1["`GroupRepository`"]
	S1 --> S2{"Rules satisfied?"}
	S2 -->|Yes| EndOk([Result returned])
	S2 -->|No| EndErr([Exception / empty result])
```

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupRepository.cs`
