DDD DSL Editor
Open
Save
Export Document
Hide Validation
Help
investments.dsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
Type '/' for commands
//================== // Domain Definition //================== domain "Insurance Platform" version "1.0.0" last_updated "2025-06-16T11:45:00Z" experts "Steve van der Merwe (Architecture), Jane Doe (Business)" system_architecture { system_principles { system_principle "Single Source of Truth" is "All party-related data must originate from or be reconciled by Party Management to ensure consistency." system_principle "Security by Design" is "Sensitive personal identifiable information (PII) must be encrypted at rest and in transit, with access controlled by strict policies." system_principle "Event-Driven Communication" is "Changes to Party data should be published as domain events to allow other contexts to react asynchronously." system_principle "Auditability" is "All changes to party data, including who made the change and when, must be fully auditable." } system_non_functional_requirements { system_nfr "Availability" is "The Party Management service must maintain 99.99% availability during business hours." system_nfr "Scalability" is "The system must be able to handle up to 1 million new party registrations per month without performance degradation." system_nfr "Response Time" is "Retrieval of a Party's core details must be sub-200ms for 95% of requests." system_nfr "Data Residency" is "All personal data for South African citizens must reside within South Africa." } system_risks { system_risk "Data Breaches" is "High risk due to the sensitive nature of PII data managed. Mitigated by robust security controls and regular penetration testing." system_risk "Data Duplication" is "Risk of party data being duplicated across disparate systems if integration patterns are not strictly adhered to. Mitigated by promoting event-driven architecture and clear ownership." system_risk "Performance Bottlenecks" is "Potential for slow read/write operations if the data model or underlying database is not optimized for high transaction volumes. Mitigated by performance testing and indexing strategies." } system_notable_things { system_note "Integration with National ID Systems" is "Requires secure and resilient integration with external government services for identity verification." system_note "GDPR/POPIA Compliance" is "Strict adherence to data privacy regulations is paramount, influencing data retention and consent management." system_note "Immutable Event Log" is "Consider an event sourcing approach for key aggregates to enable historical reconstruction and simplified auditing." system_note "AI-driven Data Enrichment" is "Future consideration for leveraging AI to enrich party profiles with external data (e.g., public records) or to detect anomalies." } } //=================================== // Bounded Context: Party Management //=================================== context "Party Management" { description "Manages all parties interacting with the platform, including individuals, trusts, corporations, and advisors. This is the central source of truth for party identity and contact data." owner "Data & Onboarding Team" //----------------------- // Ubiquitous Language //----------------------- language { term "Party" is "A distinct, identifiable person or legal entity known to the platform." term "Individual" is "A natural person, identified by their personal details." term "Organization" is "A registered legal entity, such as a company, association, or trust." term "Relationship" is "A meaningful, time-bound connection between two Parties (e.g., Director of, Trustee for)." } //-------------------------------- // Tactical Design - Domain Model //-------------------------------- model { aggregate PartyAggregate on Party { description "Represents a single party and all its associated data. Forms the consistency boundary for any change to a party." } // Entities entity Party (abstract) { identity partyId: UUID properties { status: enum(PROSPECT, ACTIVE, INACTIVE) contactDetails: ContactInfo identifications: List<Identification> relationships: List<PartyRelationship> taxResidencies: List<TaxResidency> } } entity Individual extends Party { properties { firstName: string lastName: string dateOfBirth: date nationality: string occupation: string sourceOfFunds: string pepStatus: boolean } } entity Organization extends Party { properties { legalName: string registrationNumber: string registrationDate: date countryOfRegistration: string } } entity PartyRelationship { identity relationshipId: UUID properties { relatedPartyId: -> Party.partyId relationshipType: enum(TRUSTEE, DIRECTOR, BENEFICIARY, ADVISOR_FOR) effectiveFrom: date effectiveTo: date } } // Value Objects valueObject ContactInfo (immutable) { properties { email: EmailAddress phone: PhoneNumber physicalAddress: Address postalAddress: Address } } valueObject Address (immutable) { properties { line1: string line2: string city: string province: string postalCode: string countryCode: string } } valueObject Identification (immutable) { properties { type: enum(PASSPORT, NATIONAL_ID, DRIVERS_LICENSE) number: string issuingCountry: string expiryDate: Date } } valueObject TaxResidency (immutable) { properties { countryCode: string taxId: string } } // Invariants invariants on PartyAggregate { "An 'ACTIVE' party must have at least one verified identification." "An Individual must have a first name, last name, and date of birth." "An Organization must have a legal name and registration number." } // Commands & Events command RegisterIndividual for PartyAggregate emits IndividualRegistered { payload { firstName: string lastName: string dateOfBirth: date email: string } } event IndividualRegistered { payload { partyId: UUID registeredAt: Timestamp } } } //----------------- // Architecture //----------------- context_architecture { context_principles { context_principle "Single Source of Truth" is "All party-related data must originate from or be reconciled by Party Management to ensure consistency." context_principle "Security by Design" is "Sensitive personal identifiable information (PII) must be encrypted at rest and in transit, with access controlled by strict policies." context_principle "Event-Driven Communication" is "Changes to Party data should be published as domain events to allow other contexts to react asynchronously." context_principle "Auditability" is "All changes to party data, including who made the change and when, must be fully auditable." } context_non_functional_requirements { context_nfr "Availability" is "The Party Management service must maintain 99.99% availability during business hours." context_nfr "Scalability" is "The system must be able to handle up to 1 million new party registrations per month without performance degradation." context_nfr "Response Time" is "Retrieval of a Party's core details must be sub-200ms for 95% of requests." context_nfr "Data Residency" is "All personal data for South African citizens must reside within South Africa." } context_risks { context_risk "Data Breaches" is "High risk due to the sensitive nature of PII data managed. Mitigated by robust security controls and regular penetration testing." context_risk "Data Duplication" is "Risk of party data being duplicated across disparate systems if integration patterns are not strictly adhered to. Mitigated by promoting event-driven architecture and clear ownership." context_risk "Performance Bottlenecks" is "Potential for slow read/write operations if the data model or underlying database is not optimized for high transaction volumes. Mitigated by performance testing and indexing strategies." } context_notable_things { context_note "Integration with National ID Systems" is "Requires secure and resilient integration with external government services for identity verification." context_note "GDPR/POPIA Compliance" is "Strict adherence to data privacy regulations is paramount, influencing data retention and consent management." context_note "Immutable Event Log" is "Consider an event sourcing approach for key aggregates to enable historical reconstruction and simplified auditing." context_note "AI-driven Data Enrichment" is "Future consideration for leveraging AI to enrich party profiles with external data (e.g., public records) or to detect anomalies." } } }
Live Preview
🏗️
No Domain Model Available
Parse your DSL to see the interactive domain model visualization
Validation Messages
No validation messages