feat(chat): persistance bornee du brouillon custom chat par projet/layout (#182)
This commit is contained in:
@ -35,6 +35,7 @@ use crate::background_task::{
|
||||
BackgroundTask, BackgroundTaskKind, BackgroundTaskResult, BackgroundTaskWakePolicy,
|
||||
};
|
||||
use crate::chat_attachment::{ChatAttachment, ChatAttachmentId, ChatAttachmentSourceKind};
|
||||
use crate::chat_draft::{ChatDraft, ChatDraftKey};
|
||||
use crate::device::{AuthenticatedDevice, DeviceId, PairedDevice};
|
||||
use crate::events::DomainEvent;
|
||||
use crate::ids::{
|
||||
@ -1251,6 +1252,23 @@ pub trait ChatAttachmentStore: Send + Sync {
|
||||
) -> Result<Vec<ChatAttachment>, ChatAttachmentStoreError>;
|
||||
}
|
||||
|
||||
/// Persistence port for project-scoped custom chat drafts.
|
||||
#[async_trait]
|
||||
pub trait ChatDraftStore: Send + Sync {
|
||||
/// Reads one draft. Missing entries return `Ok(None)`.
|
||||
async fn read(
|
||||
&self,
|
||||
root: &ProjectPath,
|
||||
key: ChatDraftKey,
|
||||
) -> Result<Option<ChatDraft>, StoreError>;
|
||||
|
||||
/// Saves or replaces one draft.
|
||||
async fn save(&self, root: &ProjectPath, draft: ChatDraft) -> Result<(), StoreError>;
|
||||
|
||||
/// Clears one draft. Missing entries are a no-op.
|
||||
async fn clear(&self, root: &ProjectPath, key: ChatDraftKey) -> Result<(), StoreError>;
|
||||
}
|
||||
|
||||
/// Errors from the sprint store.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Error)]
|
||||
pub enum SprintStoreError {
|
||||
|
||||
Reference in New Issue
Block a user