From 3fd8483231772c23264a6b7bbd44e0a1f648e830 Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 11 Dec 2025 15:27:18 +0100 Subject: [PATCH] docs: small changes based on review --- docs/membership-fee-overview.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/membership-fee-overview.md b/docs/membership-fee-overview.md index 1ea0af8..229b73b 100644 --- a/docs/membership-fee-overview.md +++ b/docs/membership-fee-overview.md @@ -82,7 +82,6 @@ This document provides a comprehensive overview of the Membership Fees system. I - amount (Decimal) - Membership fee amount in Euro - interval (Enum) - :monthly, :quarterly, :half_yearly, :yearly - description (Text, optional) -- timestamps ``` **Important:** @@ -101,7 +100,6 @@ This document provides a comprehensive overview of the Membership Fees system. I - status (Enum) - :unpaid (default), :paid, :suspended - amount (Decimal) - Membership fee amount at generation time (history when type changes) - notes (Text, optional) - Admin notes -- timestamps ``` **Important:** @@ -169,11 +167,16 @@ value: UUID (Required) - Default membership fee type for new members **Algorithm:** +Lock the whole cycle table for the duration of the algorithm + 1. Get `member.membership_fee_start_date` and member's membership fee type -2. Calculate first cycle based on `membership_fee_start_date` -3. Generate all cycles from start to today (or `left_at` if present) -4. Skip existing cycles -5. Set `amount` to current membership fee type's amount +2. Generate cycles until today (or `left_at` if present): + - If no cycle exists: + - Generate all cycles from `membership_fee_start_date` + - else: + - Generate all cycles from last existing cycle + - use the interval to generate the cycles +3. Set `amount` to current membership fee type's amount **Example (Yearly):**