---
title: PaymentsQueryProvider
summary: API reference for PaymentsQueryProvider.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# PaymentsQueryProvider

Query provider exposing 3 data-access operation(s) (`GetLastPaymentTransactionStatisic`, `GetPaymentTransactionStatisic`, `GetPaymentType`) against 2 distinct table(s); see [sql/index.md](../../sql/index.md) for the full ORM operation catalog.

## Purpose
- Provides read/write access to 2 table(s) via NHibernate `IQueryable<T>`/`GetRepository<T>()` calls documented in [sql/index.md](../../sql/index.md).
- Exposes 3 public query/command method(s) consumed by higher application layers; see [database-tables.md](../../database-tables.md) for the underlying schema.

## Context
- Namespace: `SAIF.Data.Queries.Payments`
- Assembly/package: `SAIF.Data`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| GetPaymentTransactionStatisic | `PaymentTransactionStatistic GetPaymentTransactionStatisic(long statId)` | Executes an ORM query ([SQL-191](../../sql/SQL-191-payments-query-provider-get-payment-transaction-statisic.md)) against [PAYMENT_TRANSACTION_STAT](../../database-tables.md#payment_transaction_stat). |
| GetLastPaymentTransactionStatisic | `PaymentTransactionStatistic GetLastPaymentTransactionStatisic(String code)` | Executes an ORM query ([SQL-192](../../sql/SQL-192-payments-query-provider-get-last-payment-transaction-statisic.md)) against [PAYMENT_TRANSACTION_STAT](../../database-tables.md#payment_transaction_stat), [PAYMENT_TRANSACTION_TYPE_CODE](../../database-tables.md#payment_transaction_type_code). |
| GetLastMedicalAuditPaymentTransactionStatisic | `PaymentTransactionStatistic GetLastMedicalAuditPaymentTransactionStatisic()` | Retrieves last medical audit payment transaction statisic.* |
| GetPaymentType | `PaymentTransactionTypeCode GetPaymentType(string type)` | Executes an ORM query ([SQL-193](../../sql/SQL-193-payments-query-provider-get-payment-type.md)) against [PAYMENT_TRANSACTION_TYPE_CODE](../../database-tables.md#payment_transaction_type_code). |
| GetMedicalAuditPaymentType | `PaymentTransactionTypeCode GetMedicalAuditPaymentType()` | Retrieves medical audit payment type.* |
| PaymentsQueryProvider(IRepositoryFactory factory) | `PaymentsQueryProvider(IRepositoryFactory factory)` | Initializes a new instance, wiring the repository factory used by this provider's query methods.* |

## Behavioral notes
- Query methods build LINQ expressions over `IQueryable<T>` obtained via `Factory.GetRepository<T>()` and execute them against the underlying NHibernate session.*

## Constraints and usage notes
- Instances are constructed with an `IRepositoryFactory` and are expected to be resolved through dependency injection rather than instantiated directly.*

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Data/SAIF.Data/Queries/Payments/PaymentsQueryProvider.cs`
