#![deny(clippy::all)]
#![forbid(unsafe_code)]

pub mod addresses;
mod cents;
pub mod coupons;
pub mod i18n;
pub mod invoices;
pub mod line_item_options;
pub mod line_items;
pub mod orders;
mod views;

pub use cents::Cents;
pub use views::format_order_id;

pub trait ToView<T> {
    fn to_view(&self, fmt: &i18n::Formatter) -> T;
}

#[derive(Clone)]
pub struct OrderData {
    pub order: orders::Order,
    pub invoice: Option<invoices::Invoice>,
    pub invoice_address: addresses::Address,
    pub shipping_address: addresses::Address,
    pub line_items: Vec<(line_items::LineItem, Vec<line_item_options::LineItemOption>)>,
}
