---
title: "SQL-030: Create EmployeeAuthorityLimit via AddAuthorityLimit"
summary: Create operation against EmployeeAuthorityLimit via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-030: Create EmployeeAuthorityLimit via AddAuthorityLimit

This ORM statement performs a create operation on `EmployeeAuthorityLimit` via `AddAuthorityLimit`, executed from `Services/SAIF.Services/Claims/Authority/ClaimAuthorityService.cs` (L163).

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-030 |
| **Operation type** | Create |
| **Execution method** | ORM (IRepository.Add) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `EmployeeAuthorityLimit` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `AddAuthorityLimit` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Id` | Input | `long` | N/A | Identifier from `CL_CLM_EMP_BUS_FUN_LIM_SEQ.NEXTVAL` |
| `:AuthorizedByEmplid` | Input | `string` | N/A |  |
| `:EmployeeId` | Input | `string` | N/A |  |
| `:ExpirationDate` | Input | `DateTime?` | N/A |  |
| `:MaximumPaymentAmount` | Input | `decimal` | N/A |  |
| `:UpdateDate` | Input | `DateTime` | N/A |  |
| `:UpdateUser` | Input | `string` | N/A |  |
| `:UpdateNumber` | Input | `int` | N/A |  |
| `:PurposeType` | Input | `AuthorityPurposeTypes` | N/A | Custom type `EmployeeAuthorityLimit.AuthorityPurposeTypes` |
| `:BusinessProcess` | Input | `AuthorityBusinessProcessCode` | N/A | Identifier of the referenced `AuthorityBusinessProcessCode` entity (`References(x => x.BusinessProcess)`) |
| `:FunctionType` | Input | `AuthorityPaymentTypeCode` | N/A | Identifier of the referenced `AuthorityPaymentTypeCode` entity (`References(x => x.FunctionType)`) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CL_CLAIM_EMP_BUS_FUNC_LIMIT](../database-tables.md#cl_claim_emp_bus_func_limit) | INSERT | CL_CLM_EMP_BUS_FUN_LIM_SEQ_NUM, AUTHORIZED_BY_EMPLID, EMPLOYEE_EMPLID, EXP_DATE, MAX_AMOUNT, UPDATE_DATE, UPDATE_USER, UPDATE_NUM, CLAIM_AUTH_PURPOSE_CODE, CLAIM_BUS_PROCESS_CODE, CLAIM_BUS_FUNCTION_CODE (identifier from sequence `CL_CLM_EMP_BUS_FUN_LIM_SEQ.NEXTVAL`) |

## LINQ statement

Source: `Services/SAIF.Services/Claims/Authority/ClaimAuthorityService.cs:163`.

```csharp
// Services/SAIF.Services/Claims/Authority/ClaimAuthorityService.cs:163
_unitOfWork.GetRepository<EmployeeAuthorityLimit>().Add(newAuthorityLimit);
```

## Sample SQL

> **Inferred SQL:** This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT CL_CLM_EMP_BUS_FUN_LIM_SEQ.NEXTVAL
FROM DUAL

INSERT INTO CL_CLAIM_EMP_BUS_FUNC_LIMIT (
  CL_CLM_EMP_BUS_FUN_LIM_SEQ_NUM,
  AUTHORIZED_BY_EMPLID,
  EMPLOYEE_EMPLID,
  EXP_DATE,
  MAX_AMOUNT,
  UPDATE_DATE,
  UPDATE_USER,
  UPDATE_NUM,
  CLAIM_AUTH_PURPOSE_CODE,
  CLAIM_BUS_PROCESS_CODE,
  CLAIM_BUS_FUNCTION_CODE)
VALUES (
  :Id,
  :AuthorizedByEmplid,
  :EmployeeId,
  :ExpirationDate,
  :MaximumPaymentAmount,
  :UpdateDate,
  :UpdateUser,
  :UpdateNumber,
  :PurposeType,
  :BusinessProcess,
  :FunctionType)
```

Translation notes:
- `:Id` is the value fetched from sequence `CL_CLM_EMP_BUS_FUN_LIM_SEQ` (`GeneratedBy.Native("CL_CLM_EMP_BUS_FUN_LIM_SEQ")`) before the INSERT; NHibernate assigns it to `EmployeeAuthorityLimit.Id`.
- Reference FK values are bound from the associated entity's identifier; the referenced tables are **not** read or joined by this statement: `BusinessProcess` → `CLAIM_BUS_PROCESS_CODE` (entity table `CL_CLAIM_BUS_PROCESS_CODE` not accessed); `FunctionType` → `CLAIM_BUS_FUNCTION_CODE` (entity table `CL_CLAIM_BUS_FUNCTION_CODE` not accessed).

## Operations and processes
- ClaimAuthorityService.AddAuthorityLimit — see [Operations and processes](../operations-processes.md)

## Business rules
- [SVC-BR-CLM-001](<../business-rules.md#svc-br-clm-001-at-least-one-limit-(amount-%E2%89%A5-0%2C-or-an-expiration-date-that-is-set)-is-required>)
- [SVC-BR-CLM-002 A function type is required](../business-rules.md#svc-br-clm-002-a-function-type-is-required)
- [SVC-BR-CLM-003 The granting user must hold the same function type (in payment or reserve limits)](<../business-rules.md#svc-br-clm-003-the-granting-user-must-hold-the-same-function-type-(in-payment-or-reserve-limits)>)
- [SVC-BR-CLM-006 The limit must be > 0](../business-rules.md#svc-br-clm-006-the-limit-must-be-%3E-0)
- [SVC-BR-CLM-009 Value checks only run if the authorization checks pass (or override is set)](<../business-rules.md#svc-br-clm-009-value-checks-only-run-if-the-authorization-checks-pass-(or-override-is-set)>)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Services/SAIF.Services/Claims/Authority/ClaimAuthorityService.cs (L163)`
