Skip to main content

ruddr/model/
cost.rs

1//! # Cost
2//!
3//! `model::cost` is a model for the Ruddr Cost period object. This module is not publically accessible, but the structs and members are public for reading from `interface::cost` returns.
4//! [API Documentation](https://ruddr.readme.io/reference/cost-period-object)
5use crate::model::types;
6use serde::Deserialize;
7
8/// Model for Costs used with List operations.
9#[derive(Debug, PartialEq, Deserialize)]
10#[serde(rename_all = "camelCase")]
11pub struct Costs {
12    pub results: Vec<Cost>,
13    pub has_more: bool,
14}
15
16/// Model for Cost used with Read operations.
17#[derive(Debug, PartialEq, Deserialize)]
18#[serde(rename_all = "camelCase")]
19pub struct Cost {
20    pub cost_per_hour: f64,
21    pub id: types::UUID,
22    pub start: types::Date,
23    pub created_at: types::Timestamp,
24    pub overhead_cost_per_hour: f64,
25    pub currency: String,
26    pub is_default: bool,
27    pub end: types::Date,
28    pub total_cost_per_hour: f64,
29}
30
31#[cfg(test)]
32mod tests;