Skip to main content

remem/user_context/summary/
types.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone)]
4pub struct SummaryRequest<'a> {
5    pub owner_scope: Option<&'a str>,
6    pub owner_key: Option<&'a str>,
7    pub project: &'a str,
8}
9
10#[derive(Debug, Clone)]
11pub struct SummaryEditRequest<'a> {
12    pub owner_scope: Option<&'a str>,
13    pub owner_key: Option<&'a str>,
14    pub project: &'a str,
15    pub text: &'a str,
16}
17
18#[derive(Debug, Clone, Serialize)]
19pub struct UserContextSummary {
20    pub id: i64,
21    pub user_key: String,
22    pub owner_scope: String,
23    pub owner_key: String,
24    pub scope: String,
25    pub scope_key: Option<String>,
26    pub summary_text: String,
27    pub source_claim_ids: Vec<i64>,
28    pub source_memory_ids: Vec<i64>,
29    pub source_activity_refs: Vec<ActivityRef>,
30    pub status: String,
31    pub model: Option<String>,
32    pub version: i64,
33    pub created_at_epoch: i64,
34    pub updated_at_epoch: i64,
35}
36
37#[derive(Debug, Clone, Serialize)]
38pub struct SummarySources {
39    pub summary: Option<UserContextSummary>,
40    pub included_claims: Vec<SummaryClaimSource>,
41    pub included_memories: Vec<SummaryMemorySource>,
42    pub included_activity_refs: Vec<ActivityRef>,
43    pub dropped_claims: Vec<DroppedSource>,
44}
45
46#[derive(Debug, Clone, Serialize)]
47pub struct SummaryClaimSource {
48    pub id: i64,
49    pub claim_type: String,
50    pub claim_key: String,
51    pub claim_text: String,
52    pub owner_scope: String,
53    pub owner_key: String,
54    pub sensitivity: String,
55    pub status: String,
56}
57
58#[derive(Debug, Clone, Serialize)]
59pub struct SummaryMemorySource {
60    pub id: i64,
61    pub memory_type: String,
62    pub title: String,
63    pub preview: String,
64    pub owner_scope: Option<String>,
65    pub owner_key: Option<String>,
66    pub status: String,
67}
68
69#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
70pub struct ActivityRef {
71    pub kind: String,
72    pub id: i64,
73    pub label: String,
74}
75
76#[derive(Debug, Clone, Serialize)]
77pub struct DroppedSource {
78    pub kind: String,
79    pub id: i64,
80    pub reason: String,
81}
82
83pub(super) struct SourceBundle {
84    pub(super) claims: Vec<SummaryClaimSource>,
85    pub(super) memories: Vec<SummaryMemorySource>,
86    pub(super) activity_refs: Vec<ActivityRef>,
87    pub(super) dropped_claims: Vec<DroppedSource>,
88}
89
90pub(super) struct SummaryRow {
91    pub(super) id: i64,
92    pub(super) user_key: String,
93    pub(super) owner_scope: String,
94    pub(super) owner_key: String,
95    pub(super) scope: String,
96    pub(super) scope_key: Option<String>,
97    pub(super) summary_text: String,
98    pub(super) source_claim_ids_json: String,
99    pub(super) source_memory_ids_json: String,
100    pub(super) source_activity_refs_json: String,
101    pub(super) status: String,
102    pub(super) model: Option<String>,
103    pub(super) version: i64,
104    pub(super) created_at_epoch: i64,
105    pub(super) updated_at_epoch: i64,
106}
107
108pub(super) struct ClaimCandidate {
109    pub(super) id: i64,
110    pub(super) claim_type: String,
111    pub(super) claim_key: String,
112    pub(super) claim_text: String,
113    pub(super) owner_scope: String,
114    pub(super) owner_key: String,
115    pub(super) sensitivity: String,
116    pub(super) status: String,
117    pub(super) valid_from_epoch: Option<i64>,
118    pub(super) valid_to_epoch: Option<i64>,
119}