---
title: "Collections payment application"
summary: Operation implemented by CollectionsRepository.ApplyPayments
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.NHibernate
reference_type: package
operation_id: "OP-SDN-04"
trigger: "See steps below"
---


# Collections payment application

Collections payment application is implemented by `CollectionsRepository.ApplyPayments` and is documented as OP-SDN-04 in the Stage 1 analysis.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SDN-04 |
| **Trigger** | See steps below |
| **Primary components** | `CollectionsRepository.ApplyPayments` |

## Steps

1. `CreateSqlQuery("call WCIS_DBA.PK80010_LEGAL_COLLECTIONS.APPLYPAYMENTS(:inSeqNum, :pmt_date)")` with `ExecuteUpdate()`.
   - SQL: [SQL-053](../sql/SQL-053-collections-repository-apply-payments.md) (write).
   - Rule: [SDN-BR-010](../business-rules.md#sdn-br-010-collection-case-payments-are-applied-by-the-oracle-package-applypayments-for-the-case-and-payment-date).
   - The equivalent named query [SQL-052](../sql/SQL-052-applypayments-unused.md) is defined but not used.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Collections payment application"]) --> S1["`CollectionsRepository.ApplyPayments`"]
	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/CollectionsRepository.cs`
