Batch and import models
These models handle bulk transaction processing, imports, and batch operations in Chargeworx.ImportBatch
Tracks bulk transaction imports from external sources or file uploads.Key properties
| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique batch identifier |
| ProjectId | Guid | Associated project reference |
| FileName | String | Source file name |
| Status | String | Batch processing status |
| TotalRecords | Int | Total records in batch |
| ProcessedRecords | Int | Successfully processed records |
| FailedRecords | Int | Failed records |
| CreatedAt | DateTime | Batch creation timestamp |
| CompletedAt | DateTime? | Batch completion timestamp |
Relationships
- Belongs to a Project
- Has many TransferredTransactions
Batch statuses
| Status | Description |
|---|---|
| Pending | Batch queued for processing |
| Processing | Batch currently being processed |
| Completed | All records processed successfully |
| Partial | Some records failed |
| Failed | Batch processing failed |
TransferredTransaction
Represents individual transactions within an import batch.Key properties
| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique identifier |
| ImportBatchId | Guid | Associated batch reference |
| TransactionId | Guid? | Created transaction reference |
| SourceData | String | Original import data (JSON) |
| Status | String | Processing status |
| ErrorMessage | String | Error details if failed |
| ProcessedAt | DateTime? | Processing timestamp |
Relationships
- Belongs to an ImportBatch
- May reference a Transaction (if successfully created)
CreditCardBatch
Manages batch processing of credit card transactions for settlement.Key properties
| Property | Type | Description |
|---|---|---|
| Id | Guid | Unique batch identifier |
| ProjectId | Guid | Associated project reference |
| ProcessorBatchId | String | Processor batch reference |
| BatchDate | DateTime | Batch settlement date |
| TransactionCount | Int | Number of transactions |
| TotalAmount | Decimal | Total batch amount |
| Status | String | Batch status |
| SettledAt | DateTime? | Settlement timestamp |
Relationships
- Belongs to a Project
- Contains multiple Transactions
Batch lifecycle
- Open - Batch accepting transactions
- Closed - Batch closed for new transactions
- Submitted - Batch submitted to processor
- Settled - Funds settled to merchant account
- Rejected - Batch rejected by processor
Usage patterns
Importing transactions
Bulk transaction imports support CSV, JSON, and XML formats. Each import creates an ImportBatch record for tracking.Batch validation
Import records are validated before processing:- Required fields present
- Data format correctness
- Business rule compliance
Error handling
Failed records are tracked with detailed error messages. Partial batch completion allows successful records to process while flagging failures.Settlement batches
Credit card batches group transactions for settlement processing. Batches are automatically closed and submitted based on configured schedules.Best practices
- Validate import files before submission
- Monitor batch processing status
- Review failed records and error messages
- Schedule batch imports during low-traffic periods
- Maintain audit logs of all batch operations
