document types

This commit is contained in:
2025-10-31 00:13:16 +01:00
parent 3941ec61d3
commit 813ce24aeb
19 changed files with 1714 additions and 43 deletions
+18
View File
@@ -248,6 +248,23 @@ pub struct Document {
pub title: String,
pub current_version_id: Uuid,
pub tenant_id: Uuid,
pub document_type_id: Option<Uuid>,
}
#[derive(Debug, Clone, Queryable, Identifiable)]
#[diesel(table_name = document_types)]
pub struct DocumentType {
pub id: Uuid,
pub tenant_id: Uuid,
pub name: String,
}
#[derive(Debug, Insertable)]
#[diesel(table_name = document_types)]
pub struct NewDocumentType {
pub id: Uuid,
pub tenant_id: Uuid,
pub name: String,
}
#[derive(Debug, Insertable)]
@@ -263,6 +280,7 @@ pub struct NewDocument {
pub issued_at: Option<NaiveDateTime>,
pub title: String,
pub tenant_id: Uuid,
pub document_type_id: Option<Uuid>,
}
#[derive(Debug, Clone, Queryable, Identifiable, Associations)]