Menu

Prepaid session packages: why 'money received' and 'sessions owed' need separate ledgers
📰

Prepaid session packages: why 'money received' and 'sessions owed' need separate ledgers

DEV Community: javascript·Tidy Cents·about 23 hours ago
#sbdQpAWB
#devtojavascript#devto#dev#sessions#package
Reading 0:00
15s threshold

Session & Package Control — PAID $19 one-time, FREE demo: https://gettidycents.com/product/session-package-control

Trainers, tutors, studios and therapists sell packages: 10 sessions paid up front. The trap is treating the payment as income you have earned. Until the sessions are delivered, part of that money is a promise you still owe.

Two ledgers, one package

const pkg = { client : 'C-27' , sessions : 10 , priceCents : 90000 , paidOn : '2026-10-01' , expiresOn : '2027-01-01' , frozenDays : 0 , events : [ // attended | late_cancel | cancelled_ok | no_show { on : '2026-10-03' , type : 'attended' } , { on : '2026-10-10' , type : 'late_cancel' } , ] } ;

const COUNTS = { attended : 1 , late_cancel : 1 , no_show : 1 , cancelled_ok : 0 } ;

function used ( p ) { return p . events . reduce ( ( n , e ) => n + COUNTS [ e . type ] , 0 ) ; } function left ( p ) { return p . sessions - used ( p ) ; } // value of sessions still owed, in cents, rounded down per session function owedCents ( p ) { return Math .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.