fkl_parser/mir/tactic/
domain_object.rs1use serde::Deserialize;
2use serde::Serialize;
3
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
5pub enum DomainObjectType {
6 ApplicationService,
7 AggregateRoot,
8 DomainEvent,
9 Entity,
10 ValueObject,
11}
12
13impl Default for DomainObjectType {
14 fn default() -> Self {
15 DomainObjectType::ValueObject
16 }
17}
18
19pub trait DomainObject {
20 fn name(&self) -> &str;
21 fn inline_doc(&self) -> &str;
22 fn object_type(&self) -> DomainObjectType;
23
24 fn is_aggregate_root(&self) -> bool;
25 fn has_unique_id(&self) -> bool;
26}