feat(tauri): add delete_meetings bulk delete command
- Add DeleteMeetingsRequest/Response types to core.rs - Implement delete_meetings method in gRPC client - Add delete_meetings Tauri command in meeting.rs - Register command in app handler Enables frontend to bulk delete meetings via single IPC call. Refs: mass-delete-meetings plan tasks 3-4
This commit is contained in:
@@ -90,3 +90,12 @@ pub async fn stop_meeting(state: State<'_, Arc<AppState>>, meeting_id: String) -
|
||||
pub async fn delete_meeting(state: State<'_, Arc<AppState>>, meeting_id: String) -> Result<bool> {
|
||||
state.grpc_client.delete_meeting(&meeting_id).await
|
||||
}
|
||||
|
||||
/// Delete multiple meetings in bulk.
|
||||
#[tauri::command(rename_all = "snake_case")]
|
||||
pub async fn delete_meetings(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
meeting_ids: Vec<String>,
|
||||
) -> Result<crate::grpc::types::core::DeleteMeetingsResponse> {
|
||||
state.grpc_client.delete_meetings(meeting_ids).await
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ use crate::grpc::types::core::{
|
||||
SummarizationTemplate,
|
||||
SummarizationTemplateMutationResult,
|
||||
Summary,
|
||||
DeleteMeetingsResponse,
|
||||
};
|
||||
|
||||
use super::converters::{
|
||||
@@ -131,6 +132,26 @@ impl GrpcClient {
|
||||
Ok(response.success)
|
||||
}
|
||||
|
||||
/// Delete multiple meetings in bulk.
|
||||
#[instrument(skip(self))]
|
||||
pub async fn delete_meetings(&self, meeting_ids: Vec<String>) -> Result<DeleteMeetingsResponse> {
|
||||
let mut client = self.get_client()?;
|
||||
let response = client
|
||||
.delete_meetings(pb::DeleteMeetingsRequest {
|
||||
meeting_ids,
|
||||
})
|
||||
.await?
|
||||
.into_inner();
|
||||
|
||||
Ok(DeleteMeetingsResponse {
|
||||
deleted_count: response.deleted_count,
|
||||
succeeded_ids: response.succeeded_ids,
|
||||
failed_ids: response.failed_ids,
|
||||
skipped_ids: response.skipped_ids,
|
||||
error_message: response.error_message,
|
||||
})
|
||||
}
|
||||
|
||||
/// Generate a summary for a meeting.
|
||||
#[instrument(skip(self, options))]
|
||||
pub async fn generate_summary(
|
||||
|
||||
@@ -230,6 +230,30 @@ pub struct DeleteMeetingResponse {
|
||||
pub success: bool,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct DeleteMeetingsRequest {
|
||||
/// Meeting IDs to delete
|
||||
#[prost(string, repeated, tag = "1")]
|
||||
pub meeting_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct DeleteMeetingsResponse {
|
||||
/// Number of meetings successfully deleted
|
||||
#[prost(int32, tag = "1")]
|
||||
pub deleted_count: i32,
|
||||
/// Meeting IDs that were successfully deleted
|
||||
#[prost(string, repeated, tag = "2")]
|
||||
pub succeeded_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
||||
/// Meeting IDs that failed to delete
|
||||
#[prost(string, repeated, tag = "3")]
|
||||
pub failed_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
||||
/// Meeting IDs that were skipped (e.g., active recordings)
|
||||
#[prost(string, repeated, tag = "4")]
|
||||
pub skipped_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
|
||||
/// Error message if batch operation failed
|
||||
#[prost(string, tag = "5")]
|
||||
pub error_message: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct Summary {
|
||||
/// Meeting this summary belongs to
|
||||
#[prost(string, tag = "1")]
|
||||
@@ -3511,6 +3535,30 @@ pub mod note_flow_service_client {
|
||||
.insert(GrpcMethod::new("noteflow.NoteFlowService", "DeleteMeeting"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
pub async fn delete_meetings(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::DeleteMeetingsRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::DeleteMeetingsResponse>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
.ready()
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tonic::Status::unknown(
|
||||
format!("Service was not ready: {}", e.into()),
|
||||
)
|
||||
})?;
|
||||
let codec = tonic::codec::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/noteflow.NoteFlowService/DeleteMeetings",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("noteflow.NoteFlowService", "DeleteMeetings"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Summary generation
|
||||
pub async fn generate_summary(
|
||||
&mut self,
|
||||
|
||||
@@ -348,3 +348,23 @@ pub struct CloudConsentStatus {
|
||||
pub summary_consent: bool,
|
||||
pub embedding_consent: bool,
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Bulk Delete Meetings
|
||||
// ============================================================================
|
||||
|
||||
/// Request to delete multiple meetings
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct DeleteMeetingsRequest {
|
||||
pub meeting_ids: Vec<String>,
|
||||
}
|
||||
|
||||
/// Response from bulk delete operation
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct DeleteMeetingsResponse {
|
||||
pub deleted_count: i32,
|
||||
pub succeeded_ids: Vec<String>,
|
||||
pub failed_ids: Vec<String>,
|
||||
pub skipped_ids: Vec<String>,
|
||||
pub error_message: String,
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ macro_rules! app_invoke_handler {
|
||||
commands::get_meeting,
|
||||
commands::stop_meeting,
|
||||
commands::delete_meeting,
|
||||
commands::delete_meetings,
|
||||
// Recording (5 commands)
|
||||
commands::recording::session::start::start_recording,
|
||||
commands::recording::session::stop::stop_recording,
|
||||
|
||||
Reference in New Issue
Block a user