# `MishkaPay.TaxCalculation.Transaction`
[🔗](https://github.com/mishka-group/mishka_pay/blob/v0.0.1/nofile#L1)

A sale reported to the provider's tax records from a `MishkaPay.TaxCalculation`, with
`MishkaPay.record_tax/4`: the provider then counts its tax in the site's tax reports and
filings. A guarded_struct the provider fills in.

  * `:provider`, `:id` (`tax_...` at Stripe).
  * `:reference`: the caller's own id of the sale, such as an order id; one sale per reference.
  * `:calculation_id`: the calculation it was made from.
  * `:customer_id`: the provider customer, when the calculation named one.
  * `:posted_at`: when the tax counts as owed; `:created_at`: when the provider made it.

# `t`

```elixir
@type t() :: %MishkaPay.TaxCalculation.Transaction{
  calculation_id: String.t() | nil,
  created_at: DateTime.t() | nil,
  customer_id: String.t() | nil,
  id: String.t() | nil,
  posted_at: DateTime.t() | nil,
  provider: String.t() | nil,
  reference: String.t() | nil
}
```

The struct that `builder/1` returns.

| Field | Type | Required | Default | Description | Derives |
| --- | --- | --- | --- | --- | --- |
| `:provider` | `String.t()` \| `nil` | no |  |  | `validate(string)` |
| `:id` | `String.t()` \| `nil` | no |  |  | `validate(string)` |
| `:reference` | `String.t()` \| `nil` | no |  |  | `validate(string)` |
| `:calculation_id` | `String.t()` \| `nil` | no |  |  | `validate(string)` |
| `:customer_id` | `String.t()` \| `nil` | no |  |  | `validate(string)` |
| `:posted_at` | `DateTime.t()` \| `nil` | no |  |  | `validate(struct)` |
| `:created_at` | `DateTime.t()` \| `nil` | no |  |  | `validate(struct)` |

# `builder`

# `enforce_keys`

# `enforce_keys`

# `example`

A sample %MishkaPay.TaxCalculation.Transaction{} populated from defaults + type-based fallbacks.

# `keys`

# `keys`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
