Skip to content

Commit f4082e0

Browse files
committed
update project model
1 parent dca1c0d commit f4082e0

File tree

2 files changed

+59
-2
lines changed

2 files changed

+59
-2
lines changed

src/model/project.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,32 @@ pub struct Project {
3232
pub revenue_recognition_method: Option<RevenueRecognitionMethod>,
3333
pub fixed_fee: Option<i64>,
3434
pub fixed_recurring_fee: Option<i64>,
35-
pub fixed_recurring_start: Option<String>,
36-
pub fixed_recurring_end: Option<String>,
35+
pub fixed_recurring_start: Option<types::Date>,
36+
pub fixed_recurring_end: Option<types::Date>,
3737
pub use_roles: bool,
3838
pub use_budget: bool,
3939
pub budget_mode: Option<BudgetMode>,
4040
pub use_monthly_budget: bool,
4141
pub monthly_budget_mode: Option<MonthlyBudgetMode>,
42+
pub cap_max_member_hours_per_day: bool,
43+
pub max_member_hours_per_day: Option<i32>,
44+
pub cap_max_member_hours_per_week: bool,
45+
pub max_member_hours_per_week: Option<i32>,
46+
pub cap_max_member_hours_per_month: bool,
47+
pub max_member_hours_per_month: Option<i32>,
4248
pub requires_notes: bool,
4349
pub requires_tasks: bool,
4450
pub record_status_id: RecordStatus,
4551
pub is_productive: Option<bool>,
52+
pub lock_time_and_expenses: bool,
53+
pub track_time_to_assigned_roles: bool,
4654
pub created_at: types::Timestamp,
4755
pub client: shared::Client,
4856
pub practice: Practice,
4957
pub project_type: ProjectType,
5058
pub tags: Vec<Tag>,
59+
pub sales_representative: Option<SalesRepresentative>,
60+
pub business_unit: Option<BusinessUnit>,
5161
pub budget: Option<Budget>,
5262
pub monthly_budget: Option<MonthlyBudget>,
5363
}
@@ -73,6 +83,20 @@ pub struct Tag {
7383
pub name: String,
7484
}
7585

86+
#[derive(PartialEq, Deserialize, Serialize, Debug)]
87+
#[serde(rename_all = "camelCase")]
88+
pub struct SalesRepresentative {
89+
pub id: types::UUID,
90+
pub name: String,
91+
}
92+
93+
#[derive(PartialEq, Deserialize, Serialize, Debug)]
94+
#[serde(rename_all = "camelCase")]
95+
pub struct BusinessUnit {
96+
pub id: types::UUID,
97+
pub name: String,
98+
}
99+
76100
#[derive(PartialEq, Deserialize, Serialize, Debug)]
77101
#[serde(rename_all = "camelCase")]
78102
pub struct Budget {
@@ -101,6 +125,7 @@ pub struct MonthlyBudget {
101125
#[derive(PartialEq, Deserialize, Serialize, Debug)]
102126
#[serde(rename_all = "snake_case")]
103127
pub enum BillingType {
128+
#[serde(rename = "tm")]
104129
TimeAndMaterials,
105130
Fixed,
106131
FixedRecurring,

src/model/project/tests.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ fn test_project_deserialize() {
2626
"budgetMode": "detailed",
2727
"useMonthlyBudget": true,
2828
"monthlyBudgetMode": "detailed",
29+
"capMaxMemberHoursPerDay": false,
30+
"maxMemberHoursPerDay": null,
31+
"capMaxMemberHoursPerWeek": false,
32+
"maxMemberHoursPerWeek": null,
33+
"capMaxMemberHoursPerMonth": false,
34+
"maxMemberHoursPerMonth": null,
2935
"requiresNotes": true,
3036
"requiresTasks": true,
3137
"recordStatusId": "active",
3238
"isProductive": null,
39+
"lockTimeAndExpenses": false,
40+
"trackTimeToAssignedRoles": true,
3341
"createdAt": "2022-03-15T14:59:18.825Z",
3442
"client": {
3543
"id": "d5afaffe-09e5-4d73-b02c-905b40fc6c22",
@@ -53,6 +61,14 @@ fn test_project_deserialize() {
5361
"name": "Data Analytics"
5462
}
5563
],
64+
"salesRepresentative": {
65+
"id": "w6816355-8945-40aa-b798-b0d6fd89e437",
66+
"name": "Joe"
67+
},
68+
"businessUnit": {
69+
"id": "0e8351ea-6b3c-4307-97cc-196448de0ef1",
70+
"name": "Palermo North America"
71+
},
5672
"budget": {
5773
"revenue": 602500,
5874
"servicesRevenue": 600000,
@@ -99,10 +115,18 @@ fn test_project_deserialize() {
99115
budget_mode: Some(BudgetMode::Detailed),
100116
use_monthly_budget: true,
101117
monthly_budget_mode: Some(MonthlyBudgetMode::Detailed),
118+
cap_max_member_hours_per_day: false,
119+
max_member_hours_per_day: None,
120+
cap_max_member_hours_per_week: false,
121+
max_member_hours_per_week: None,
122+
cap_max_member_hours_per_month: false,
123+
max_member_hours_per_month: None,
102124
requires_notes: true,
103125
requires_tasks: true,
104126
record_status_id: RecordStatus::Active,
105127
is_productive: None,
128+
lock_time_and_expenses: false,
129+
track_time_to_assigned_roles: true,
106130
created_at: types::Timestamp(String::from("2022-03-15T14:59:18.825Z")),
107131
client: shared::Client {
108132
id: types::UUID(String::from("d5afaffe-09e5-4d73-b02c-905b40fc6c22")),
@@ -126,6 +150,14 @@ fn test_project_deserialize() {
126150
name: String::from("Data Analytics"),
127151
},
128152
],
153+
sales_representative: Some(SalesRepresentative {
154+
id: types::UUID(String::from("w6816355-8945-40aa-b798-b0d6fd89e437")),
155+
name: String::from("Joe"),
156+
}),
157+
business_unit: Some(BusinessUnit {
158+
id: types::UUID(String::from("0e8351ea-6b3c-4307-97cc-196448de0ef1")),
159+
name: String::from("Palermo North America"),
160+
}),
129161
budget: Some(Budget {
130162
revenue: 602500,
131163
services_revenue: 600000,

0 commit comments

Comments
 (0)