Standard Operating Procedure (SOP-05): Pronto POS Transaction Bulk Ingestion & Reconciliation Governance¶
Document ID: SOP-05-PRONTO-POS-INGESTION
Linked Ticket: STG-TICK-039, STG-TICK-047, STG-TICK-048 | Knowledge Base: KB-039, KB-047, KB-048
Owner: CPL Real Rewards Team (Business Owner) & ERP Operations
Technical Maintenance: Systems Developer
Effective Date: October 2026
Status: Approved & Operational Baseline
1. Purpose & Policy Statement¶
This Standard Operating Procedure establishes the governance protocol for ingesting daily Point of Sale (POS) retail transaction data exported from Pronto ERP into the CPL Real Rewards Loyalty Platform.
All POS transaction uploads must: 1. Guarantee mathematical invariance and idempotency across daily, weekly, and catch-up ingestion runs. 2. Maintain complete segregation of duties and auditable operator logs for every executed batch. 3. Execute asynchronously in isolated background worker threads to guarantee zero performance degradation or table lockouts on retail cash registers (till operations).
2. Roles and Responsibilities (RACI Matrix)¶
| Activity | ERP Administrator | ERP Operations Lead | Real Rewards Checker | Systems Developer |
|---|---|---|---|---|
| Extract POS Feeds from Pronto ERP | R | A | I | I |
| Upload & Launch Bulk Import Batch | R | R | I | I |
| Audit Import History Logs & Batch Status | R | R | C | I |
| Investigate File Formatting Errors / Rejections | R | A | C | C |
| Cross-Verify Member Loyalty Points Accrual | I | C | A | I |
| Technical Process Troubleshooting / Background Thread Inspection | C | C | I | R |
Legend: R = Responsible, A = Accountable, C = Consulted, I = Informed.
3. Operational Standards & Safeguards¶
Standard 1: Background Execution¶
- Bulk imports must be executed via CPL Real Rewards > Configuration > Bulk Upload (Zinrelo) using mode
POS Daily Transactions. - Once launched, the Odoo server spawns a dedicated background thread with an assigned Ubuntu OS PID and unique audit reference
PID <pid> / IMP-xxxxx. - Operators must allow the background worker to complete without re-submitting identical files while a batch is marked
Processing.
Standard 2: Mathematical Idempotency¶
- Incoming transaction keys (
pos_reference = POS/<store>/<order>) are validated against database unique constraints. - If a transaction was previously ingested, Odoo skips the row without modifying existing ledger balances.
- Ingestion runs can be audited at any time in Configuration > Import History Logs.
Standard 3: Retention and Archiving¶
- Daily CSV files and ZIP archives uploaded to the system are permanently cataloged in
ir.attachmentlinked to the correspondingreal.rewards.import.logrecord for audit trail preservation.
Standard 4: Concurrency Lock & Stale-Lock Auto-Expiry (STG-TICK-047)¶
- Single-Batch Concurrency Lock: Only one bulk POS import batch (
status = 'processing') may execute at a time. While a batch is running: - Opening the Bulk Upload POS Transactions wizard displays an active warning banner showing the running Batch ID, operator name, start time, and live progress counts.
- Clicking Start Import while a batch is active is blocked by a
ValidationErrorpopup and a PostgreSQL transaction-level advisory lock (pg_try_advisory_xact_lock). - 30-Minute Auto-Expiry & Admin Force Unlock:
- Any
In Progressimport log that has not updated for more than 30 minutes is automatically marked asFailed(Stale Import Lock Auto-Expired) so subsequent imports are never permanently blocked. - Head Office Checkers and Administrators can also manually clear a running/stuck lock at any time by opening the batch in Import History Logs and clicking Force Cancel / Unlock.
Standard 5: Per-Order Savepoint Isolation & 3-Stage Email Lifecycle (STG-TICK-047)¶
- Per-Order Savepoint Failsafe: Every order in a bulk CSV upload executes inside an isolated PostgreSQL savepoint (
with cr.savepoint():). If an individual order encounters a constraint or data error, only that single order is rolled back and recorded in the Isolated Order Errors & Warnings table, allowing the rest of the batch to finish with statusCompleted with Warnings(partial). - Unknown Card Quarantine: Transactions referencing unregistered or blocked card numbers are routed directly into
real.rewards.quarantine.queuewithout creating dummyres.partnerrecords. - 3-Stage Email Lifecycle:
- Started Email: Sent immediately upon launch with the Process ID, Operator, and uploaded file list.
- 50% Progress Milestone Email: Sent automatically at the halfway mark for large batches (
>= 1,000unique orders), alongside real-time UI toast notifications every 200 orders. - Final Completion / Warnings / Failure Email: Sent upon completion with per-file metrics, quarantine counts, and any isolated error details.
Standard 6: Pronto RR Report (.xlsx / .csv) & PS / PB / RD / RF Transaction Breakdown (STG-TICK-048)¶
- Multi-Format Upload Support: The Bulk Importer (
zinrelo.importer.wizard) natively accepts CSV (.csv), Excel (.xlsx), and ZIP (.zip) files for bothZN_DAILY_TRANSACTIONSexports and Pronto RR Reports (Whse Code,Store Description,Member ID,Card No,Trans Date,Cashier,Stock Code,Item Description,Points,Shipped Qty,Line cost,Type). - Pronto Transaction Code Classification (
pronto_code): PS(earn— Standard Points Earned): Standard1xpoints earned on eligible retail purchases (1 PGK = 1 Point).PB(bonus— Bonus / Double Points): Promotional double/bonus points (+1xbonus points paired with the1xPSstandard line on the same docket soPS + PB = 2xDouble Points, or2xdirectly if uploaded as a standalonePBline).RD(redeem— Voucher Redemption Deductions): Negative points deducted for reward redemptions.RF(return— Returned Items Deductions): Negative points deducted for merchandise returns/refunds.- Immediate Point Availability & Transaction Date Stamping:
- Every imported ledger entry (
real.rewards.loyalty.ledger) stampstransaction_datewith the physical POS docket date (Trans Date/order_timestamp). real_rewards.pending_clearance_daysdefaults to0so all imported Pronto POS points (PSandPB) are immediately credited to Available Points (loyalty_points_available) withPending Points = 0.- Members List & Member Form Visibility:
- The Members List (
res.partnertree view) and Member Form (Card & Points BreakdownandKPI's) explicitly displayStandard Points (PS),Bonus / Double Points (PB),Total Earned (PS+PB),Redeemed (RD), andAvailable Points.
4. Verification & Audit Checklist¶
Before signing off on daily ingestion, the ERP operator must verify:
- [ ] In Configuration > Import History Logs, the latest batch shows Status = Success.
- [ ] Number of Created orders matches the expected docket count from Pronto ERP.
- [ ] If Skipped (Duplicates) is non-zero, verify whether the batch was a resubmission.
- [ ] If Errors is greater than 0, inspect the Status Breakdown Report table to identify line-level syntax issues.
- [ ] Sample 2 member cards in Members > Customers to confirm real-time loyalty point updates.