Context
avatharbe/bbDKP currently stores DKP points in fixed-column tables (memberdkp, adjustments) inherited from EQDKP. This was identified as fundamentally flawed in avatharbe/bbDKP#1 — the original issue that inspired bbAccounts.
Long-term goal: replace bbDKP's point storage with bbAccounts journal entries. bbDKP keeps raid management, item tracking, and game-specific features; bbAccounts owns the ledger.
Current bbDKP Architecture
memberdkp table — one row per member per DKP pool, columns for each point type (member_earned, member_spent, member_adjustment, member_time_bonus, etc.)
adjustments table — manual point corrections
items table — loot distribution records (stays)
raids / raiddetail tables — raid events and attendance (stays)
- Balance = earned − spent + adjustments (computed from columns, not transactions)
Problems (from bbDKP#1)
- New point type = new column
- Deleting a raid requires recalculating every participant's earned total
- No per-raid breakdown of time-based earnings (join/leave time varies per member)
- No audit trail of individual point mutations
Target Architecture
bbDKP (raid management, items, game integration)
└── depends on → bbAccounts (ledger)
What stays in bbDKP:
- Raid creation/management
- Raid attendance tracking
- Item/loot distribution
- Game-specific modules (WoW, FFXIV, etc.)
- DKP pool configuration
What moves to bbAccounts:
- All point storage → journal entries
- All balance queries → subledger balances
- Adjustments → manual journal entries
How bbDKP calls bbAccounts:
Raid earned (member avatharbe/bbAccounts-dev#42 earns 10 DKP for raid attendance):
DR 5100 DKP Earned — Raids 10.00
CR 2300 Member DKP Balance 10.00 (subledger: user avatharbe/bbAccounts-dev#42)
Item purchased (member avatharbe/bbAccounts-dev#42 spends 25 DKP on item):
DR 2300 Member DKP Balance 25.00 (subledger: user avatharbe/bbAccounts-dev#42)
CR 4100 DKP Spent — Items 25.00
Time bonus (member avatharbe/bbAccounts-dev#42, based on raid duration):
DR 5110 DKP Earned — Time Bonus 3.50
CR 2300 Member DKP Balance 3.50 (subledger: user avatharbe/bbAccounts-dev#42)
Manual adjustment:
DR 5120 DKP Adjustments 15.00
CR 2300 Member DKP Balance 15.00 (subledger: user avatharbe/bbAccounts-dev#42)
Deleting a raid = reversing entry for every participant's original earned entry. Clean, auditable, no recalculation needed.
EP/GP ratio = derived from SELECT SUM(debit), SUM(credit) on the relevant accounts, filtered by subledger_user_id.
Multiple DKP Pools
Each DKP pool could map to its own set of subledger control accounts (e.g., 2300 Pool A — Member Balance, 2310 Pool B — Member Balance), or use a dimension/tag on journal lines. TBD.
Prerequisites
Priority
Future milestone. Tracked here for architectural alignment — this is the original use case that inspired the whole system.
Tasks
Decomposition deferred until Phase 2 closes. The Phase 3 plan will be drafted after #2 (point-sources architectural decision) lands; that decision shapes the source-adapter interface every Phase 3 task will build on.
Context
avatharbe/bbDKP currently stores DKP points in fixed-column tables (
memberdkp,adjustments) inherited from EQDKP. This was identified as fundamentally flawed in avatharbe/bbDKP#1 — the original issue that inspired bbAccounts.Long-term goal: replace bbDKP's point storage with bbAccounts journal entries. bbDKP keeps raid management, item tracking, and game-specific features; bbAccounts owns the ledger.
Current bbDKP Architecture
memberdkptable — one row per member per DKP pool, columns for each point type (member_earned,member_spent,member_adjustment,member_time_bonus, etc.)adjustmentstable — manual point correctionsitemstable — loot distribution records (stays)raids/raiddetailtables — raid events and attendance (stays)Problems (from bbDKP#1)
Target Architecture
What stays in bbDKP:
What moves to bbAccounts:
How bbDKP calls bbAccounts:
Raid earned (member avatharbe/bbAccounts-dev#42 earns 10 DKP for raid attendance):
Item purchased (member avatharbe/bbAccounts-dev#42 spends 25 DKP on item):
Time bonus (member avatharbe/bbAccounts-dev#42, based on raid duration):
Manual adjustment:
Deleting a raid = reversing entry for every participant's original earned entry. Clean, auditable, no recalculation needed.
EP/GP ratio = derived from
SELECT SUM(debit), SUM(credit)on the relevant accounts, filtered by subledger_user_id.Multiple DKP Pools
Each DKP pool could map to its own set of subledger control accounts (e.g.,
2300 Pool A — Member Balance,2310 Pool B — Member Balance), or use a dimension/tag on journal lines. TBD.Prerequisites
Priority
Future milestone. Tracked here for architectural alignment — this is the original use case that inspired the whole system.
Tasks
Decomposition deferred until Phase 2 closes. The Phase 3 plan will be drafted after #2 (point-sources architectural decision) lands; that decision shapes the source-adapter interface every Phase 3 task will build on.
contrib/plans/will get abbaccounts-phase3-plan.md)