Page MenuHomePhorge

Fix plan/package cost calculation
ClosedPublic

Authored by machniak on Apr 11 2023, 4:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 10:31 AM
Unknown Object (File)
Wed, Apr 17, 10:31 AM
Unknown Object (File)
Wed, Apr 17, 10:31 AM
Unknown Object (File)
Mon, Apr 15, 3:57 AM
Unknown Object (File)
Sun, Apr 14, 8:16 PM
Unknown Object (File)
Sat, Apr 13, 9:20 AM
Unknown Object (File)
Wed, Apr 3, 1:14 PM
Unknown Object (File)
Wed, Apr 3, 1:14 PM
Subscribers
Restricted Project

Details

Reviewers
mollekopf
Group Reviewers
Restricted Project
Commits
rKa657c85c7c96: Fix plan/package cost calculation
Summary

And tests for assignPackage() and assignSku()

Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

machniak created this revision.
mollekopf subscribed.

Looks reasonable, with some comments on the comments.

A description on *how* the cost calculation is fixed would be useful in the commit.

src/app/PackageSku.php
70

I think the confusing aspect is that we have entitlements.cost, sku.cost, sku_package.cost and it's not clear what is authoritative. The reason that we have those values is so the cost get's locked in when e.g. an entitlement is taken out, and doesn't change if sku prices are adjusted, but I think it would be good if the those relationsships would be documented someplace, which is also where we should document how discounts are applied.

src/app/Plan.php
88

I don't think we want the discount to apply here currently, so I would remove the comment unless you have something specific in mind that we need to take care of.

94–96

I don't think free months should have any effect here. This is about the cost per period of the plan.

This revision is now accepted and ready to land.Apr 17 2023, 10:02 AM
This revision was automatically updated to reflect the committed changes.