Expand description
Entity identity and auditing.
Provides the BaseEntity and BaseAuditableEntity traits plus the
concrete BaseEntityFields and BaseAuditableFields holders.
Implement BaseEntity on every SeaORM model to expose a uniform
id/uid/timestamp view used by queries, repositories, and seeders.
ⓘ
use shared_framework::data::BaseEntity;
struct MyModel { id: i64, uid: uuid::Uuid, created_at: chrono::DateTime<chrono::Utc>, updated_at: chrono::DateTime<chrono::Utc> }
impl BaseEntity for MyModel {
fn id(&self) -> i64 { self.id }
fn uid(&self) -> uuid::Uuid { self.uid }
fn created_at(&self) -> chrono::DateTime<chrono::Utc> { self.created_at }
fn updated_at(&self) -> chrono::DateTime<chrono::Utc> { self.updated_at }
}Structs§
- Base
Auditable Fields - Auditable extension that adds creator/updater tracking.
- Base
Entity Fields - Concrete holder for the common entity columns.
Traits§
- Base
Auditable Entity - Auditing view over a model that tracks creator and updater.
- Base
Entity - Uniform identity view over a model.