use async_trait::async_trait;
use crate::document::{Document, DocumentId, DocumentView, DocumentViewId};
use crate::schema::SchemaId;
use crate::storage_provider::error::DocumentStorageError;
#[async_trait]
pub trait DocumentStore {
async fn insert_document_view(
&self,
document_view: &DocumentView,
schema_id: &SchemaId,
) -> Result<(), DocumentStorageError>;
async fn get_document_view_by_id(
&self,
id: &DocumentViewId,
) -> Result<Option<DocumentView>, DocumentStorageError>;
async fn insert_document(&self, document: &Document) -> Result<(), DocumentStorageError>;
async fn get_document_by_id(
&self,
id: &DocumentId,
) -> Result<Option<DocumentView>, DocumentStorageError>;
async fn get_documents_by_schema(
&self,
schema_id: &SchemaId,
) -> Result<Vec<DocumentView>, DocumentStorageError>;
}