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)
Sun, May 19, 11:46 AM
Unknown Object (File)
Sun, May 19, 6:22 AM
Unknown Object (File)
Thu, May 16, 5:35 AM
Unknown Object (File)
Thu, May 16, 5:09 AM
Unknown Object (File)
Sun, May 12, 9:04 PM
Unknown Object (File)
Thu, May 9, 12:27 AM
Unknown Object (File)
Tue, May 7, 5:07 AM
Unknown Object (File)
Sun, May 5, 1:59 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.