Get All Customer Lock Deposit Amount Query
Query amount locks across all deposit accounts system-wide with advanced filtering, search, date ranges, pagination, and export capabilities.
Overview​
The GetAllCustomerLockDepositAmountQuery retrieves amount locks across the entire banking system, not limited to a single account. This powerful query supports text search, date filtering, state filtering, pagination, and Excel export. It's used for system-wide monitoring, compliance reporting, reconciliation, and operational dashboards.
Key Capabilities​
- System-Wide Query: Searches across all deposit accounts
- Text Search: Search by account number, block reference, or reason
- Date Range Filtering: Filter by creation date range
- State Filtering: Include or exclude unlocked/seized locks
- Pagination Support: Handles thousands of locks efficiently
- Excel Export: Generate compliance reports
- Dynamic Filtering: Supports additional filter criteria
- Ordered Results: Returns locks in reverse chronological order
API Endpoint​
POST /api/bpm/cmd
Request Structure​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"searchText": "string",
"includeUnlocked": "boolean",
"isExport": "boolean",
"startDate": "string (yyyy-MM-dd)",
"endDate": "string (yyyy-MM-dd)",
"pageNumber": "integer",
"pageSize": "integer"
}
}
Request Fields​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
searchText | string | No | null | Search in account number, block reference, or lock reason |
includeUnlocked | boolean | No | false | Include UNLOCKED and SEIZED locks |
isExport | boolean | No | false | Export to Excel instead of JSON |
startDate | string | No | null | Filter locks created on or after this date (yyyy-MM-dd) |
endDate | string | No | null | Filter locks created on or before this date (yyyy-MM-dd) |
pageNumber | integer | No | 1 | Page number for pagination |
pageSize | integer | No | 10 | Number of records per page |
Response Structure​
Success Response (Paginated)​
{
"isSuccessful": true,
"message": "50/1250 records returned.",
"statusCode": "00",
"data": {
"items": [
{
"id": 12345,
"blockReference": "CARD-AUTH-20241217-001",
"lockAmount": 2500.00,
"lockReason": "Card pre-authorization",
"currencyCode": "USD",
"depositAccountNumber": "ACC001234567",
"state": "LOCKED",
"transactionKey": "8A3F2D1E9B5C4F7A6E8D2C1B3A9F5E7D",
"dateCreated": "2024-12-17T10:30:00Z",
"holdState": "HOLD"
}
],
"pageNumber": 1,
"pageSize": 50,
"totalPages": 25,
"totalRecords": 1250
},
"pages": 25,
"hasNext": true,
"hasPrevious": false,
"size": 50,
"count": 1250
}
Export Response​
When isExport is true, returns Excel file binary data with all matching records.
Sample Requests​
1. Get All Active Locks (Default)​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"pageNumber": 1,
"pageSize": 50
}
}
Use Case: System dashboard showing all current amount locks.
2. Search for Card Authorization Locks​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"searchText": "CARD-AUTH",
"pageNumber": 1,
"pageSize": 100
}
}
Use Case: Find all card pre-authorization locks for reconciliation.
3. Get Locks for Specific Date Range​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"startDate": "2024-12-01",
"endDate": "2024-12-31",
"includeUnlocked": true,
"pageNumber": 1,
"pageSize": 100
}
}
Use Case: Monthly lock activity report for compliance.
4. Export All Locks to Excel​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"includeUnlocked": true,
"isExport": true
}
}
Use Case: Generate Excel report for audit or management review.
5. Search Specific Account with Full History​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"searchText": "ACC001234567",
"includeUnlocked": true,
"pageNumber": 1,
"pageSize": 50
}
}
Use Case: Customer service looking up specific account's lock history.
6. Find Legal Holds This Year​
{
"commandName": "GetAllCustomerLockDepositAmountQuery",
"data": {
"searchText": "legal",
"startDate": "2024-01-01",
"endDate": "2024-12-31",
"includeUnlocked": true,
"pageNumber": 1,
"pageSize": 50
}
}
Use Case: Compliance reporting on legal holds and seizures.
Business Logic​
Processing Workflow​
Query Logic​
- Extract Parameters: Get all filter, search, and pagination parameters
- Dynamic Predicate Building: Start with base predicate from request.Data
- State Filter:
- If includeUnlocked = false: Add filter for LOCKED state only
- If includeUnlocked = true: Include all states
- Text Search Filter (if searchText provided):
- Search in DepositAccountNumber (contains)
- Search in BlockReference (contains)
- Search in LockReason (contains)
- Combined with OR logic
- Start Date Filter (if provided):
- Parse string to date
- Filter CBSTransaction.DateCreated >= startDate (date only, time ignored)
- End Date Filter (if provided):
- Parse string to date
- Add one day, subtract one tick for inclusive end-of-day
- Filter CBSTransaction.DateCreated less than or equal to endDateTime
- Data Retrieval:
- Include CBSTransaction relationship
- Order by DateCreated descending (newest first)
- Apply pagination (skip if export)
- Response Mapping: Project to simplified model
- Export Handling: Generate Excel using ExcelExporter if requested
- Success Response: Return paginated results or Excel file
Date Range Logic​
Implementation details removed for security.
Contact support for implementation guidance.
Text Search Logic​
Implementation details removed for security.
Contact support for implementation guidance.
Response Fields​
| Field | Type | Description |
|---|---|---|
id | integer | Lock transaction ID |
blockReference | string | Unique lock reference |
lockAmount | decimal | Amount locked |
lockReason | string | Reason for lock |
currencyCode | string | Currency code |
depositAccountNumber | string | Account number |
state | string | LOCKED / UNLOCKED / SEIZED |
transactionKey | string | Associated transaction key |
dateCreated | datetime | Lock creation date/time |
holdState | string | HOLD / CANCELLED / SETTLED |
Code Examples​
C# Implementation​
Implementation details removed for security.
Contact support for implementation guidance.
JavaScript Implementation​
async getAllLocks(options = {}) {
const request = {
commandName: 'GetAllCustomerLockDepositAmountQuery',
data: {
searchText: options.searchText,
includeUnlocked: options.includeUnlocked || false,
startDate: options.startDate, // 'yyyy-MM-dd' format
endDate: options.endDate,
pageNumber: options.pageNumber || 1,
pageSize: options.pageSize || 50
}
};
const response = await fetch(`${this.baseUrl}/api/bpm/cmd`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${this.accessToken}`,
'X-Tenant-ID': this.tenantId
},
body: JSON.stringify(request)
});
return await response.json();
}
Python Implementation​
def get_all_locks(
self,
search_text: Optional[str] = None,
include_unlocked: bool = False,
start_date: Optional[str] = None, # 'yyyy-MM-dd' format
end_date: Optional[str] = None,
page_number: int = 1,
page_size: int = 50
) -> LockQueryResponse:
request_data = {
'commandName': 'GetAllCustomerLockDepositAmountQuery',
'data': {
'searchText': search_text,
'includeUnlocked': include_unlocked,
'startDate': start_date,
'endDate': end_date,
'pageNumber': page_number,
'pageSize': page_size
}
}
response = requests.post(
f'{self.base_url}/api/bpm/cmd',
headers=self.headers,
json=request_data
)
return response.json()
Business Rules​
Validation Rules​
- No Required Fields: All fields are optional
- Valid Page Number: pageNumber must be >= 1
- Valid Page Size: pageSize must be > 0
- Date Format: Dates must be in yyyy-MM-dd format
Operational Rules​
- Default Behavior: Returns active locks only (LOCKED state)
- Include Unlocked: Set to true for full lock history
- Pagination: Default 10 records per page
- Ordering: Most recent locks first (descending by DateCreated)
- Export: isExport bypasses pagination and returns all matching records
- Text Search: Case-insensitive partial match on account, reference, or reason
- Date Range: Inclusive of both start and end dates
- Dynamic Filters: Supports additional filter criteria via DynamicPredicateBuilder
- Eager Loading: Loads CBSTransaction relationship for performance
- Read-Only: Query does not modify data (disableTracking: true)
Use Cases​
1. Compliance Dashboard​
Monitor all active locks across the system for regulatory reporting.
2. Fraud Investigation​
Search for suspicious lock patterns across multiple accounts.
3. Reconciliation​
Match bank locks with external system records using text search.
4. Operational Reporting​
Generate daily/monthly/yearly lock activity reports.
5. Customer Service​
Quickly find customer account locks when handling inquiries.
6. Legal Compliance​
Track all legal holds and seizures with date range filtering.
7. System Monitoring​
Monitor lock volume, trends, and anomalies.
Related Operations​
- GetLockDepositAmountQuery: Query locks for specific account
- LockDepositAmountCommand: Create amount locks
- DeleteDepositLockAmountCommand: Release locks
- SeizeDepositLockAmountCommand: Seize locks
Performance Considerations​
- Large Result Sets: Use pagination instead of export for better performance
- Date Filtering: Always use date range filters for large datasets
- Text Search: Add specific search text to limit results
- Export Caution: Exports can be slow with thousands of records
- Index Usage: Query uses indexes on DepositAccountNumber and DateCreated
Support​
For technical assistance: api-support@banklingo.com