@@ -9,7 +9,7 @@ namespace Common.Entities.Entities.AuditLog
99 /// A copilot interaction event. May not be related to any file or meeting.
1010 /// Relates back to a common audit event.
1111 /// </summary>
12- [ Table ( "event_copilot_chats " ) ]
12+ [ Table ( "copilot_chats " ) ]
1313 public class CopilotChat : BaseOfficeEvent
1414 {
1515 [ Column ( "app_host" ) ]
@@ -20,6 +20,20 @@ public class CopilotChat : BaseOfficeEvent
2020 [ Column ( "agent_id" ) ]
2121 public int ? AgentId { get ; set ; }
2222 public CopilotAgent Agent { get ; set ; } = null ;
23+
24+ /// <summary>
25+ /// Estimated total Copilot Credits consumed for this interaction.
26+ /// Calculated from CopilotCreditEstimation in CopilotAuditLogContent.
27+ /// </summary>
28+ [ Column ( "copilot_credit_estimate_total" ) ]
29+ public int ? CopilotCreditEstimateTotal { get ; set ; }
30+
31+ /// <summary>
32+ /// JSON-serialized Copilot Credit estimation details from CopilotCreditEstimation.
33+ /// Contains breakdown of generative answers, tenant graph grounding, deep reasoning, etc.
34+ /// </summary>
35+ [ Column ( "copilot_credit_estimate_json" ) ]
36+ public string CopilotCreditEstimateJson { get ; set ; } = null ;
2337 }
2438
2539 /// <summary>
@@ -39,7 +53,7 @@ public abstract class BaseCopilotSpecificEvent
3953 }
4054
4155
42- [ Table ( "event_copilot_files " ) ]
56+ [ Table ( "copilot_event_files " ) ]
4357 public class CopilotEventMetadataFile : BaseCopilotSpecificEvent
4458 {
4559 [ ForeignKey ( nameof ( FileExtension ) ) ]
@@ -68,7 +82,7 @@ public override string GetEventDescription()
6882 }
6983 }
7084
71- [ Table ( "event_copilot_meetings " ) ]
85+ [ Table ( "copilot_event_meetings " ) ]
7286 public class CopilotEventMetadataMeeting : BaseCopilotSpecificEvent
7387 {
7488 [ ForeignKey ( nameof ( OnlineMeeting ) ) ]
@@ -90,5 +104,147 @@ public class CopilotAgent : AbstractEFEntityWithName
90104 public string AgentID { get ; set ; } = null ;
91105 }
92106
107+ /// <summary>
108+ /// Lookup table for accessed resource IDs
109+ /// </summary>
110+ [ Table ( "copilot_event_accessed_resource_ids" ) ]
111+ public class CopilotAccessedResourceId : AbstractEFEntity
112+ {
113+ [ Column ( "resource_id" ) ]
114+ [ MaxLength ( 5000 ) ]
115+ public string ResourceId { get ; set ; } = null ;
116+ }
117+
118+ /// <summary>
119+ /// Lookup table for accessed resource names
120+ /// </summary>
121+ [ Table ( "copilot_event_accessed_resource_names" ) ]
122+ public class CopilotAccessedResourceName : AbstractEFEntity
123+ {
124+ // Not using AbstractEFEntityWithName to allow longer names
125+ [ Column ( "name" ) ]
126+ public string Name { get ; set ; }
127+ }
128+
129+ /// <summary>
130+ /// Lookup table for accessed resource site URLs
131+ /// </summary>
132+ [ Table ( "copilot_event_accessed_resource_site_urls" ) ]
133+ public class CopilotAccessedResourceSiteUrl : AbstractEFEntity
134+ {
135+ [ Column ( "site_url" ) ]
136+ public string SiteUrl { get ; set ; }
137+ }
138+
139+ /// <summary>
140+ /// Lookup table for accessed resource types
141+ /// </summary>
142+ [ Table ( "copilot_event_accessed_resource_types" ) ]
143+ public class CopilotAccessedResourceType : AbstractEFEntityWithName
144+ {
145+ }
146+
147+ /// <summary>
148+ /// Lookup table for sensitivity label IDs.
149+ /// Shared across multiple event types (Copilot, SharePoint, etc.)
150+ /// </summary>
151+ [ Table ( "sensitivity_labels" ) ]
152+ public class SensitivityLabel : AbstractEFEntity
153+ {
154+ [ Column ( "label_id" ) ]
155+ [ MaxLength ( 100 ) ]
156+ public string LabelId { get ; set ; } = null ;
157+ }
158+
159+ /// <summary>
160+ /// Junction table linking copilot events to accessed resources
161+ /// </summary>
162+ [ Table ( "copilot_event_accessed_resources" ) ]
163+ public class CopilotEventAccessedResource : AbstractEFEntity
164+ {
165+ [ ForeignKey ( nameof ( RelatedChat ) ) ]
166+ [ Column ( "copilot_chat_id" ) ]
167+ public Guid ChatId { get ; set ; }
168+ public CopilotChat RelatedChat { get ; set ; } = null ;
169+
170+ [ ForeignKey ( nameof ( ResourceId ) ) ]
171+ [ Column ( "resource_id_id" ) ]
172+ public int ? ResourceIdId { get ; set ; }
173+ public CopilotAccessedResourceId ResourceId { get ; set ; } = null ;
174+
175+ [ ForeignKey ( nameof ( ResourceName ) ) ]
176+ [ Column ( "resource_name_id" ) ]
177+ public int ? ResourceNameId { get ; set ; }
178+ public CopilotAccessedResourceName ResourceName { get ; set ; } = null ;
179+
180+ [ ForeignKey ( nameof ( ResourceSiteUrl ) ) ]
181+ [ Column ( "resource_site_url_id" ) ]
182+ public int ? ResourceSiteUrlId { get ; set ; }
183+ public CopilotAccessedResourceSiteUrl ResourceSiteUrl { get ; set ; } = null ;
184+
185+ [ ForeignKey ( nameof ( ResourceType ) ) ]
186+ [ Column ( "resource_type_id" ) ]
187+ public int ? ResourceTypeId { get ; set ; }
188+ public CopilotAccessedResourceType ResourceType { get ; set ; } = null ;
189+
190+ [ ForeignKey ( nameof ( SensitivityLabel ) ) ]
191+ [ Column ( "sensitivity_label_id" ) ]
192+ public int ? SensitivityLabelId { get ; set ; }
193+ public SensitivityLabel SensitivityLabel { get ; set ; } = null ;
194+ }
195+
196+ #region Message Tracking Tables
197+
198+ /// <summary>
199+ /// Represents a Copilot response message in a conversation.
200+ /// Note: Only response messages (not user prompts) are tracked in the import process.
201+ /// </summary>
202+ [ Table ( "copilot_event_messages" ) ]
203+ public class CopilotMessage : AbstractEFEntity
204+ {
205+ [ ForeignKey ( nameof ( RelatedChat ) ) ]
206+ [ Column ( "copilot_chat_id" ) ]
207+ public Guid ChatId { get ; set ; }
208+ public CopilotChat RelatedChat { get ; set ; } = null ;
209+
210+ [ Column ( "message_id" ) ]
211+ [ MaxLength ( 500 ) ]
212+ public string MessageId { get ; set ; } = null ;
213+ }
214+
215+ #endregion
216+
217+ #region AI Model Transparency Tables
218+
219+ /// <summary>
220+ /// Lookup table for AI model names used in Copilot conversations.
221+ /// Stores unique model names like "DEEP_LEO" for deep reasoning.
222+ /// </summary>
223+ [ Table ( "copilot_ai_models" ) ]
224+ public class CopilotAIModel : AbstractEFEntityWithName
225+ {
226+ // Name inherited from AbstractEFEntityWithName
227+ }
228+
229+ /// <summary>
230+ /// Junction table linking Copilot events to the AI models used.
231+ /// Tracks which AI models were involved in generating responses for each conversation.
232+ /// </summary>
233+ [ Table ( "copilot_event_ai_models" ) ]
234+ public class CopilotEventAIModel : AbstractEFEntity
235+ {
236+ [ ForeignKey ( nameof ( RelatedChat ) ) ]
237+ [ Column ( "copilot_chat_id" ) ]
238+ public Guid ChatId { get ; set ; }
239+ public CopilotChat RelatedChat { get ; set ; } = null ;
240+
241+ [ ForeignKey ( nameof ( AIModel ) ) ]
242+ [ Column ( "model_id" ) ]
243+ public int ModelId { get ; set ; }
244+ public CopilotAIModel AIModel { get ; set ; } = null ;
245+ }
246+
247+ #endregion
248+
93249}
94250
0 commit comments