README.md

# Fretex

**TODO: Add description**

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `fretex` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:fretex, "~> 0.1.0"}
  ]
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at <https://hexdocs.pm/fretex>.

## How to use

```elixir
origin = %Fretex.Shipping.Address{ ... }
destination = %Fretex.Shipping.Address{ ... }

carrier = %Fretex.Carriers.Correios{
  ack: true,
  services: [
    %Fretex.CarrierService{
      name: "PAC",
      code: "04510"
    }
  ]
}

package = Fretex.Package.new(%{
  origin: origin,
  destination: destination,
  height: 10,
  width: 10,
  length: 10,
  grams: 1000,
  carriers: [carrier]
})

Fretex.calculate(package)

# =>
  [
    ok: %Fretex.Rate{
      currency: "BRL",
      description: nil,
      max_delivery_date: ~D[2022-11-09],
      min_delivery_date: ~D[2022-11-09],
      service_code: "04510",
      service_name: "PAC",
      total_price: 9390
    }
  ]
```