View Source Taxes.Organizer (Channex Taxes v0.3.2)

Module with methods to group taxes by markers

Summary

Functions

Method to recursive build tax tree

Method to recursive build tax tree based at level option

Method to convert taxes rate into float

Method to fetch marker from Tax.

Method to wrap taxes from list into tree structure with :inclusive and :exclusive keys at top level. This method modify incoming payload structure and add two new keys.

Method to group taxes by provided marker

Method to wrap into tree nested taxes

Functions

@spec build_taxes_tree([Taxes.Types.tax()]) :: [Taxes.tax()]

Method to recursive build tax tree

Link to this function

build_tree_by_level(taxes)

View Source

Method to recursive build tax tree based at level option

Link to this function

collect_taxes(taxes, taxes_for_level)

View Source
Link to this function

convert_tax_rate(taxes, exponent)

View Source
Link to this function

convert_taxes_rate(args)

View Source
@spec convert_taxes_rate(map()) :: map()

Method to convert taxes rate into float

Link to this function

get_mark_value(tax, field)

View Source
@spec get_mark_value(Taxes.Types.tax(), :atom | String.t()) :: any()

Method to fetch marker from Tax.

@spec group_taxes(Taxes.Types.payload()) :: Taxes.Types.payload()

Method to wrap taxes from list into tree structure with :inclusive and :exclusive keys at top level. This method modify incoming payload structure and add two new keys.

Link to this function

group_taxes_by(taxes, mark)

View Source
@spec group_taxes_by([Taxes.Types.tax()] | map(), :atom | String.t()) :: map()

Method to group taxes by provided marker

Link to this function

wrap_child_taxes_into_tree(tax)

View Source
@spec wrap_child_taxes_into_tree(Taxes.Types.tax()) :: Taxes.Types.tax()

Method to wrap into tree nested taxes