OrderModule

PackageAcme.Docs
Functions for constructing and pricing orders.

Summary

NameSignatureSynopsis
createcreate id subtotalCreates an order after validating its subtotal.
totaltotal taxRate orderCalculates the total including a fractional tax rate.

create

create id subtotal
Member
Creates an order after validating its subtotal.

Parameters

NameTypeDescription
idintStable order identifier.
subtotaldecimalPrice before tax.

Returns

Order

total

total taxRate order
Member
Calculates the total including a fractional tax rate.

Parameters

NameTypeDescription
taxRatedecimal
orderOrder

Returns

decimal

Verification Examples

CalculateTotal

> Acme.Docs.Order.create 7 20M |> Acme.Docs.Order.total 0.1M;;
val it: decimal = 22.0M