Project

General

Profile

Actions

Task #7796

open

Task #7761: uncloud v2

Solve the tricky part of recurrent period billings

Added by Nico Schottelius over 1 year ago. Updated 8 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/28/2020
Due date:
% Done:

0%

Estimated time:
PM Check date:

Description

  • monthly = 1..end_of_month
  • if bought within month
    • first bill = partial
      • assume month has 29 days
      • we bough on 12th
      • we charge ((29-12)/29)*recurring_price for the first month

Assumptions

  • One bill per month
  • the bill generator should be able to run anytime
  • but a definitive bill is only created at end-of-month
    • But user should be able to see consumption from this month
    • And user should be able to see balance at any point

Periods

  • Solve for all defined periods
  • second/minute/hour = no partial, but always full
    • second can be kicked if it is getting additional headache
    • 3m 1s = 4 minutes
    • 12 minutes on hourly basis = 1h
  • daily/weekly/monthly/yearly
    • daily: 1s to 23h 59m 59s = 1d
    • weekly: 1s to 6d 23h 59m 59s = 1w
  • monthly
    • this is tricky shit
    • end usage date is always last day of month, if period = monthly
      • even if you quit on 2nd, total month is billed
    • we calculate the used days per month and first
    • ((end date - start date)/days_per_month) * recurring_fee
    • if start date before first of month, then start date = 1st of month
    • stop algorithm.
Actions #1

Updated by Timothée Floure over 1 year ago

  • Status changed from New to In Progress

Monthly bills, one time price, hourly/daily/monthly billing is implement but there's nothing preventing for less-than-one-month monthly order yet.
Balance is there, consumption will be trivial to add: only count non-final bills.

=> The structure is there, what's remaining will be nice but not a hard requirement to get a working ordering workflow.

Actions #3

Updated by Timothée Floure 8 months ago

  • Assignee deleted (Timothée Floure)
  • Status changed from In Progress to New
Actions

Also available in: Atom PDF