backbone_activity/exports/
types.rs1use serde::{Deserialize, Serialize};
9use uuid::Uuid;
10use chrono::{DateTime, Utc};
11use crate::domain::entity::*;
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
21pub struct ActivityId(pub Uuid);
22
23impl ActivityId {
24 pub fn new(id: Uuid) -> Self {
25 Self(id)
26 }
27
28 pub fn into_inner(self) -> Uuid {
29 self.0
30 }
31}
32
33impl From<Uuid> for ActivityId {
34 fn from(id: Uuid) -> Self {
35 Self(id)
36 }
37}
38
39impl From<ActivityId> for Uuid {
40 fn from(id: ActivityId) -> Self {
41 id.0
42 }
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
49pub struct ActivityDto {
50 pub id: ActivityId,
51 pub subject: String,
52 pub activity_type: ActivityType,
53 pub direction: Option<ActivityDirection>,
54 pub lead_id: Option<Uuid>,
55 pub opportunity_id: Option<Uuid>,
56 pub party_id: Option<Uuid>,
57 pub status: ActivityStatus,
58 pub scheduled_at: Option<DateTime<Utc>>,
59 pub occurred_at: Option<DateTime<Utc>>,
60 pub assignee_id: Option<Uuid>,
61 pub outcome: Option<String>,
62 pub notes: Option<String>,
63 pub metadata: serde_json::Value,
64}
65
66#[derive(Debug, Clone, Serialize, Deserialize)]
68pub struct ActivitySummary {
69 pub id: ActivityId,
70 pub status: ActivityStatus,
71}
72
73#[derive(Debug, Clone, Serialize, Deserialize)]
75pub struct ActivityRef {
76 pub id: ActivityId,
77}
78
79