Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HP-1751 Create configurations for billing types #93

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
818174f
HP-1751 Create configurations for billing types
VadymHrechukha Nov 28, 2024
7aa8fcc
HP-1751 Created Unit test for InvoiceDescriptionsBuilder class
VadymHrechukha Nov 28, 2024
d8d3535
HP-1751 Create configurations for billing types
VadymHrechukha Dec 6, 2024
59a8d47
HP-1751 Create configurations for billing types
VadymHrechukha Dec 6, 2024
cbc66f2
HP-1751 Create configurations for billing types
VadymHrechukha Dec 9, 2024
1e3d171
HP-1751 created product Type
VadymHrechukha Dec 9, 2024
a2e19d3
HP-1751 added stubs for all types in ServerTariff config
VadymHrechukha Dec 10, 2024
93d7fad
HP-1751 tiny
VadymHrechukha Dec 10, 2024
d678b94
HP-1751 tiny
VadymHrechukha Dec 10, 2024
75b747c
HP-1751 implemented BillingRegistry::getRepresentationsByType() method
VadymHrechukha Dec 10, 2024
f01cc94
HP-1751 fixed the case when we pass two sql for one type in AbstractL…
VadymHrechukha Dec 10, 2024
f7e6961
HP-1751 tiny
VadymHrechukha Dec 12, 2024
7ab9d97
HP-1751 added ability to extend PriceTypeDefinition class
VadymHrechukha Dec 12, 2024
0ab443b
HP-1751 Created QuantityFormatterDefinition for storing both the $for…
VadymHrechukha Dec 17, 2024
3209f16
HP-1751 created formatters
VadymHrechukha Dec 17, 2024
1853b86
HP-1751 configured QuantityFormatter
VadymHrechukha Dec 17, 2024
a9224f6
HP-1751 working on QuantityFormatter classes
VadymHrechukha Dec 18, 2024
3f8e530
HP-1751 created interface for easy get QuantityFormatter from Billing…
VadymHrechukha Dec 18, 2024
6548d55
HP-1751 changed signature of BillingRegistry::createQuantityFormatter…
VadymHrechukha Dec 19, 2024
a1c0436
HP-1751 added consumption config for TariffType
VadymHrechukha Dec 20, 2024
27b606f
HP-1751 added ability to fetch consumption columns and groups into Bi…
VadymHrechukha Dec 22, 2024
be007f7
HP-1751 added consumption classes
VadymHrechukha Dec 22, 2024
ab1f2f5
HP-1751 created BehaviorInterface
VadymHrechukha Dec 23, 2024
dd5e730
HP-1751 added aggregation to PriceTypeDefinition
VadymHrechukha Dec 23, 2024
73bf433
HP-1751 created BehaviorNotFoundException
VadymHrechukha Dec 23, 2024
4c4d0a5
HP-1751 removed Consumption from billing-registry
VadymHrechukha Dec 23, 2024
b414de3
HP-1751 created TariffType class and use it in Behavior
VadymHrechukha Dec 26, 2024
b6893c5
HP-1751 Throw BehaviorNotFoundException instead of returning null in …
VadymHrechukha Dec 27, 2024
f66e578
HP-1751 created ParentNodeDefinitionInterface
VadymHrechukha Dec 30, 2024
63f5327
HP-1751 changed directory of TariffType, Unit and FractionUnit
VadymHrechukha Dec 30, 2024
5c69b42
HP-1751 tiny
VadymHrechukha Dec 30, 2024
49989bf
HP-1751 tiny
VadymHrechukha Dec 30, 2024
1280f4c
HP-1751 added annotation for BillingRegistry::getBehavior() method
VadymHrechukha Dec 31, 2024
10cb39b
HP-1751 Implemented BillingRegistry::getAggregate() method
VadymHrechukha Jan 2, 2025
2a0421b
HP-1751 added ability to check if PriceTypeDefinition has specific be…
VadymHrechukha Jan 3, 2025
78380f0
HP-1751 tiny
VadymHrechukha Jan 6, 2025
da2c506
HP-1751 added TariffTypeDefinition::hasBehavior() method
VadymHrechukha Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
HP-1751 Created QuantityFormatterDefinition for storing both the $for…
…matterClass (a string) and the optional ?FractionUnit $unit within the PriceTypeDefinition class
VadymHrechukha committed Dec 17, 2024
commit 0ab443bd29c74d403a84e4781ecbd11f7dee947f
13 changes: 10 additions & 3 deletions src/product/PriceTypeDefinition.php
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@
use hiqdev\billing\registry\invoice\InvoiceRepresentationCollection;
use hiqdev\billing\registry\product\GType;
use hiqdev\billing\registry\product\PriceType;
use hiqdev\billing\registry\quantity\formatter\QuantityFormatterDefinition;
use hiqdev\billing\registry\unit\FractionUnit;
use hiqdev\php\units\Unit;

class PriceTypeDefinition
@@ -13,7 +15,7 @@ class PriceTypeDefinition

private string $description;

private string $quantityFormatter;
private QuantityFormatterDefinition $quantityFormatterDefinition;

private InvoiceRepresentationCollection $invoiceCollection;

@@ -46,13 +48,18 @@ public function description(string $description): self
return $this;
}

public function quantityFormatter(string $formatterClass): self
public function quantityFormatter(string $formatterClass, ?FractionUnit $unit = null): self
{
$this->quantityFormatter = $formatterClass;
$this->quantityFormatterDefinition = new QuantityFormatterDefinition($formatterClass, $unit);

return $this;
}

public function getQuantityFormatterDefinition(): ?QuantityFormatterDefinition
{
return $this->quantityFormatterDefinition;
}

public function end(): PriceTypesCollection
{
// Validate the PriceType and lock its state