@api-client/core 0.18.21 → 0.18.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/build/src/modeling/helpers/Intelisense.d.ts +1 -0
  2. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  3. package/build/src/modeling/helpers/Intelisense.js +1 -0
  4. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  5. package/build/src/modeling/templates/index.d.ts +1 -0
  6. package/build/src/modeling/templates/index.d.ts.map +1 -1
  7. package/build/src/modeling/templates/index.js +2 -0
  8. package/build/src/modeling/templates/index.js.map +1 -1
  9. package/build/src/modeling/templates/meta/education-management-platform.json +1 -0
  10. package/build/src/modeling/templates/meta/financial-services-platform.json +1 -0
  11. package/build/src/modeling/templates/meta/gaming-platform.json +1 -0
  12. package/build/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
  13. package/build/src/modeling/templates/meta/hospitality-platform.json +1 -0
  14. package/build/src/modeling/templates/meta/index.d.ts +11 -3
  15. package/build/src/modeling/templates/meta/index.d.ts.map +1 -1
  16. package/build/src/modeling/templates/meta/index.js +61 -1
  17. package/build/src/modeling/templates/meta/index.js.map +1 -1
  18. package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
  19. package/build/src/modeling/templates/meta/legal-services-platform.json +1 -0
  20. package/build/src/modeling/templates/meta/manufacturing-platform.json +1 -0
  21. package/build/src/modeling/templates/meta/non-profit-platform.json +1 -0
  22. package/build/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
  23. package/build/src/modeling/templates/template-registry.d.ts +14 -0
  24. package/build/src/modeling/templates/template-registry.d.ts.map +1 -1
  25. package/build/src/modeling/templates/template-registry.js +63 -0
  26. package/build/src/modeling/templates/template-registry.js.map +1 -1
  27. package/build/src/modeling/templates/{ecommerce-domain.d.ts → verticals/business-services/ecommerce-domain.d.ts} +2 -2
  28. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +1 -0
  29. package/build/src/modeling/templates/{ecommerce-domain.js → verticals/business-services/ecommerce-domain.js} +6 -6
  30. package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -0
  31. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +40 -0
  32. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -0
  33. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +744 -0
  34. package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -0
  35. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +45 -0
  36. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +1 -0
  37. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +797 -0
  38. package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +1 -0
  39. package/build/src/modeling/templates/verticals/business-services/index.d.ts +21 -0
  40. package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +1 -0
  41. package/build/src/modeling/templates/verticals/business-services/index.js +50 -0
  42. package/build/src/modeling/templates/verticals/business-services/index.js.map +1 -0
  43. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +46 -0
  44. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +1 -0
  45. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +837 -0
  46. package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +1 -0
  47. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +40 -0
  48. package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +1 -0
  49. package/build/src/modeling/templates/verticals/education-training/education-domain.js +725 -0
  50. package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +1 -0
  51. package/build/src/modeling/templates/verticals/education-training/index.d.ts +18 -0
  52. package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +1 -0
  53. package/build/src/modeling/templates/verticals/education-training/index.js +21 -0
  54. package/build/src/modeling/templates/verticals/education-training/index.js.map +1 -0
  55. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +40 -0
  56. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +1 -0
  57. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +859 -0
  58. package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +1 -0
  59. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +18 -0
  60. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +1 -0
  61. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +21 -0
  62. package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +1 -0
  63. package/build/src/modeling/templates/verticals/index.d.ts +79 -0
  64. package/build/src/modeling/templates/verticals/index.d.ts.map +1 -0
  65. package/build/src/modeling/templates/verticals/index.js +186 -0
  66. package/build/src/modeling/templates/verticals/index.js.map +1 -0
  67. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +18 -0
  68. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +1 -0
  69. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +22 -0
  70. package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +1 -0
  71. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +45 -0
  72. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +1 -0
  73. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +710 -0
  74. package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +1 -0
  75. package/build/src/modeling/templates/verticals/public-sector/index.d.ts +18 -0
  76. package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +1 -0
  77. package/build/src/modeling/templates/verticals/public-sector/index.js +22 -0
  78. package/build/src/modeling/templates/verticals/public-sector/index.js.map +1 -0
  79. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +47 -0
  80. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +1 -0
  81. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +864 -0
  82. package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +1 -0
  83. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +18 -0
  84. package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +1 -0
  85. package/build/src/modeling/templates/verticals/real-estate-construction/index.js +21 -0
  86. package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +1 -0
  87. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +40 -0
  88. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +1 -0
  89. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +727 -0
  90. package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +1 -0
  91. package/build/src/modeling/templates/{blog-domain.d.ts → verticals/technology-media/blog-domain.d.ts} +2 -2
  92. package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -0
  93. package/build/src/modeling/templates/{blog-domain.js → verticals/technology-media/blog-domain.js} +5 -5
  94. package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -0
  95. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +46 -0
  96. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +1 -0
  97. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +1033 -0
  98. package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +1 -0
  99. package/build/src/modeling/templates/verticals/technology-media/index.d.ts +21 -0
  100. package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +1 -0
  101. package/build/src/modeling/templates/verticals/technology-media/index.js +42 -0
  102. package/build/src/modeling/templates/verticals/technology-media/index.js.map +1 -0
  103. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +47 -0
  104. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -0
  105. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +1027 -0
  106. package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -0
  107. package/build/tsconfig.tsbuildinfo +1 -1
  108. package/data/models/example-generator-api.json +23 -23
  109. package/package.json +1 -1
  110. package/src/modeling/helpers/Intelisense.ts +1 -0
  111. package/src/modeling/templates/meta/education-management-platform.json +1 -0
  112. package/src/modeling/templates/meta/financial-services-platform.json +1 -0
  113. package/src/modeling/templates/meta/gaming-platform.json +1 -0
  114. package/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
  115. package/src/modeling/templates/meta/hospitality-platform.json +1 -0
  116. package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
  117. package/src/modeling/templates/meta/legal-services-platform.json +1 -0
  118. package/src/modeling/templates/meta/manufacturing-platform.json +1 -0
  119. package/src/modeling/templates/meta/non-profit-platform.json +1 -0
  120. package/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
  121. package/src/modeling/templates/readme.md +14 -0
  122. package/src/modeling/templates/template-registry.ts +73 -0
  123. package/src/modeling/templates/verticals/README.md +122 -0
  124. package/src/modeling/templates/{ecommerce-domain.ts → verticals/business-services/ecommerce-domain.ts} +7 -7
  125. package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +943 -0
  126. package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +994 -0
  127. package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +1059 -0
  128. package/src/modeling/templates/verticals/education-training/education-domain.ts +922 -0
  129. package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +1111 -0
  130. package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +895 -0
  131. package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +1109 -0
  132. package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +944 -0
  133. package/src/modeling/templates/{blog-domain.ts → verticals/technology-media/blog-domain.ts} +6 -6
  134. package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +1290 -0
  135. package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +1287 -0
  136. package/build/src/modeling/templates/blog-domain.d.ts.map +0 -1
  137. package/build/src/modeling/templates/blog-domain.js.map +0 -1
  138. package/build/src/modeling/templates/ecommerce-domain.d.ts.map +0 -1
  139. package/build/src/modeling/templates/ecommerce-domain.js.map +0 -1
@@ -0,0 +1,837 @@
1
+ /**
2
+ * Legal Services Domain Template
3
+ *
4
+ * A comprehensive legal services data domain following domain-driven design principles.
5
+ * This template covers the complete legal practice lifecycle including:
6
+ *
7
+ * - Case Management: Cases, matters, documents, timelines
8
+ * - Client Management: Clients, contacts, billing relationships
9
+ * - Document Management: Contracts, pleadings, evidence
10
+ * - Time Tracking: Billable hours, time entries, rates
11
+ * - Calendar Management: Court dates, deadlines, appointments
12
+ * - Billing & Accounting: Invoicing, payments, trust accounts
13
+ *
14
+ * Key Features:
15
+ * - Complete case lifecycle management
16
+ * - Client relationship management
17
+ * - Document and evidence tracking
18
+ * - Time and billing management
19
+ * - Calendar and deadline management
20
+ * - Trust account management
21
+ * - Legal practice operations
22
+ *
23
+ * Use Cases:
24
+ * - Law firms and legal practices
25
+ * - Legal case management
26
+ * - Client relationship management
27
+ * - Document management
28
+ * - Time and billing tracking
29
+ * - Legal calendar management
30
+ */
31
+ import { DataDomain } from '../../../DataDomain.js';
32
+ import { addIdField, addNameField, addDescriptionField, addEmailField, addPhoneField, addCustomStatusField, addCreatedAtField, addUpdatedAtField, addCurrencyAmountField, } from '../../../helpers/Intelisense.js';
33
+ function createDomain() {
34
+ return new DataDomain({
35
+ info: {
36
+ name: 'Legal Services Platform',
37
+ displayName: 'Legal Services Platform',
38
+ description: 'A comprehensive legal services platform with case management, client relationships, ' +
39
+ 'document management, time tracking, calendar management, and billing',
40
+ },
41
+ });
42
+ }
43
+ /**
44
+ * Creates a comprehensive legal services data domain following domain-driven design principles.
45
+ *
46
+ * This function demonstrates the proper hierarchy and organization for a legal services platform:
47
+ * 1. Creates the root DataDomain for the legal services platform
48
+ * 2. Organizes functionality into logical namespaces (Case Management, Client Management, etc.)
49
+ * 3. Groups related entities into models within each namespace
50
+ * 4. Defines entities with proper semantic annotations for legal workflows
51
+ * 5. Establishes associations with appropriate cardinality for legal relationships
52
+ *
53
+ * @returns A fully configured DataDomain with all legal services entities and relationships
54
+ */
55
+ export default function createLegalServicesDomain(options = {}) {
56
+ // Ensure the root data domain
57
+ const domain = options.domain ?? createDomain();
58
+ //
59
+ // 1. CASE MANAGEMENT NAMESPACE
60
+ //
61
+ const caseManagement = domain.addNamespace({
62
+ info: {
63
+ name: 'CaseManagement',
64
+ displayName: 'Case Management',
65
+ description: 'Cases, matters, documents, and timelines',
66
+ },
67
+ });
68
+ // Case Model
69
+ const caseModel = caseManagement.addModel({
70
+ info: {
71
+ name: 'Cases',
72
+ displayName: 'Case Management',
73
+ description: 'Legal cases and matters',
74
+ },
75
+ });
76
+ // Case Entity
77
+ const caseEntity = caseModel.addEntity({
78
+ info: {
79
+ name: 'case',
80
+ displayName: 'Case',
81
+ description: 'Legal case or matter',
82
+ },
83
+ });
84
+ addIdField(caseEntity, { displayName: 'Case ID', description: 'Unique identifier for the case' });
85
+ addNameField(caseEntity, { description: 'Case name and title' });
86
+ addDescriptionField(caseEntity, { description: 'Case description and summary' });
87
+ caseEntity.addProperty({
88
+ info: { name: 'case_number', displayName: 'Case Number', description: 'Official case number' },
89
+ type: 'string',
90
+ required: true,
91
+ unique: true,
92
+ });
93
+ caseEntity.addProperty({
94
+ info: { name: 'case_type', displayName: 'Case Type', description: 'Type of legal case' },
95
+ type: 'string',
96
+ required: true,
97
+ schema: {
98
+ enum: ['civil', 'criminal', 'family', 'corporate', 'real_estate', 'intellectual_property', 'bankruptcy'],
99
+ },
100
+ });
101
+ caseEntity.addProperty({
102
+ info: { name: 'practice_area', displayName: 'Practice Area', description: 'Legal practice area' },
103
+ type: 'string',
104
+ required: true,
105
+ schema: {
106
+ enum: [
107
+ 'litigation',
108
+ 'corporate',
109
+ 'real_estate',
110
+ 'family_law',
111
+ 'criminal_defense',
112
+ 'intellectual_property',
113
+ 'bankruptcy',
114
+ 'employment',
115
+ 'tax',
116
+ 'estate_planning',
117
+ ],
118
+ },
119
+ });
120
+ caseEntity.addProperty({
121
+ info: { name: 'filing_date', displayName: 'Filing Date', description: 'Case filing date' },
122
+ type: 'date',
123
+ required: false,
124
+ });
125
+ caseEntity.addProperty({
126
+ info: { name: 'court', displayName: 'Court', description: 'Court where case is filed' },
127
+ type: 'string',
128
+ required: false,
129
+ });
130
+ caseEntity.addProperty({
131
+ info: { name: 'judge', displayName: 'Judge', description: 'Assigned judge' },
132
+ type: 'string',
133
+ required: false,
134
+ });
135
+ addCustomStatusField(caseEntity, ['open', 'pending', 'settled', 'closed', 'appealed'], {
136
+ displayName: 'Case Status',
137
+ description: 'Current status of the case',
138
+ });
139
+ addCreatedAtField(caseEntity, { description: 'When the case was created' });
140
+ addUpdatedAtField(caseEntity, { description: 'When the case was last updated' });
141
+ // Matter Entity
142
+ const matterEntity = caseModel.addEntity({
143
+ info: {
144
+ name: 'matter',
145
+ displayName: 'Matter',
146
+ description: 'Legal matter or sub-case',
147
+ },
148
+ });
149
+ addIdField(matterEntity, { displayName: 'Matter ID', description: 'Unique identifier for the matter' });
150
+ addNameField(matterEntity, { description: 'Matter name and description' });
151
+ addDescriptionField(matterEntity, { description: 'Matter description and details' });
152
+ matterEntity.addProperty({
153
+ info: { name: 'matter_type', displayName: 'Matter Type', description: 'Type of legal matter' },
154
+ type: 'string',
155
+ required: true,
156
+ schema: {
157
+ enum: ['transaction', 'litigation', 'advisory', 'compliance', 'investigation'],
158
+ },
159
+ });
160
+ matterEntity.addProperty({
161
+ info: { name: 'priority', displayName: 'Priority', description: 'Matter priority level' },
162
+ type: 'string',
163
+ required: true,
164
+ schema: {
165
+ enum: ['low', 'medium', 'high', 'urgent'],
166
+ },
167
+ });
168
+ addCustomStatusField(matterEntity, ['active', 'pending', 'completed', 'on_hold'], {
169
+ displayName: 'Matter Status',
170
+ description: 'Current status of the matter',
171
+ });
172
+ addCreatedAtField(matterEntity, { description: 'When the matter was created' });
173
+ // Matter-Case Association (Many-to-One)
174
+ matterEntity.addAssociation({ key: caseEntity.key }, {
175
+ info: { name: 'case', displayName: 'Case', description: 'Case for this matter' },
176
+ required: true,
177
+ multiple: false,
178
+ });
179
+ // Timeline Event Entity
180
+ const timelineEventEntity = caseModel.addEntity({
181
+ info: {
182
+ name: 'timeline_event',
183
+ displayName: 'Timeline Event',
184
+ description: 'Case timeline events and milestones',
185
+ },
186
+ });
187
+ addIdField(timelineEventEntity, {
188
+ displayName: 'Event ID',
189
+ description: 'Unique identifier for the timeline event',
190
+ });
191
+ addNameField(timelineEventEntity, { description: 'Event name and description' });
192
+ addDescriptionField(timelineEventEntity, { description: 'Event description and details' });
193
+ timelineEventEntity.addProperty({
194
+ info: { name: 'event_type', displayName: 'Event Type', description: 'Type of timeline event' },
195
+ type: 'string',
196
+ required: true,
197
+ schema: {
198
+ enum: ['filing', 'hearing', 'discovery', 'settlement', 'trial', 'appeal', 'deadline'],
199
+ },
200
+ });
201
+ timelineEventEntity.addProperty({
202
+ info: { name: 'event_date', displayName: 'Event Date', description: 'Date of the event' },
203
+ type: 'date',
204
+ required: true,
205
+ });
206
+ timelineEventEntity.addProperty({
207
+ info: { name: 'event_time', displayName: 'Event Time', description: 'Time of the event' },
208
+ type: 'time',
209
+ required: false,
210
+ });
211
+ addCustomStatusField(timelineEventEntity, ['scheduled', 'completed', 'cancelled', 'postponed'], {
212
+ displayName: 'Event Status',
213
+ description: 'Current status of the timeline event',
214
+ });
215
+ addCreatedAtField(timelineEventEntity, { description: 'When the event was created' });
216
+ // TimelineEvent-Case Association (Many-to-One)
217
+ timelineEventEntity.addAssociation({ key: caseEntity.key }, {
218
+ info: { name: 'case', displayName: 'Case', description: 'Case for this timeline event' },
219
+ required: true,
220
+ multiple: false,
221
+ });
222
+ //
223
+ // 2. CLIENT MANAGEMENT NAMESPACE
224
+ //
225
+ const clientManagement = domain.addNamespace({
226
+ info: {
227
+ name: 'ClientManagement',
228
+ displayName: 'Client Management',
229
+ description: 'Clients, contacts, and billing relationships',
230
+ },
231
+ });
232
+ // Client Model
233
+ const clientModel = clientManagement.addModel({
234
+ info: {
235
+ name: 'Clients',
236
+ displayName: 'Client Management',
237
+ description: 'Client and contact management',
238
+ },
239
+ });
240
+ // Client Entity
241
+ const clientEntity = clientModel.addEntity({
242
+ info: {
243
+ name: 'client',
244
+ displayName: 'Client',
245
+ description: 'Legal client with contact information',
246
+ },
247
+ });
248
+ addIdField(clientEntity, { displayName: 'Client ID', description: 'Unique identifier for the client' });
249
+ addNameField(clientEntity, { description: 'Client name and title' });
250
+ addDescriptionField(clientEntity, { description: 'Client description and notes' });
251
+ addEmailField(clientEntity, { description: 'Client email address' });
252
+ addPhoneField(clientEntity, { description: 'Client phone number' });
253
+ clientEntity.addProperty({
254
+ info: { name: 'client_type', displayName: 'Client Type', description: 'Type of client' },
255
+ type: 'string',
256
+ required: true,
257
+ schema: {
258
+ enum: ['individual', 'corporation', 'partnership', 'government', 'non_profit'],
259
+ },
260
+ });
261
+ clientEntity.addProperty({
262
+ info: { name: 'address', displayName: 'Address', description: 'Client address' },
263
+ type: 'string',
264
+ required: false,
265
+ });
266
+ clientEntity.addProperty({
267
+ info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Client date of birth' },
268
+ type: 'date',
269
+ required: false,
270
+ });
271
+ addCustomStatusField(clientEntity, ['active', 'inactive', 'prospect', 'former'], {
272
+ displayName: 'Client Status',
273
+ description: 'Current status of the client',
274
+ });
275
+ addCreatedAtField(clientEntity, { description: 'When the client record was created' });
276
+ addUpdatedAtField(clientEntity, { description: 'When the client record was last updated' });
277
+ // Contact Entity
278
+ const contactEntity = clientModel.addEntity({
279
+ info: {
280
+ name: 'contact',
281
+ displayName: 'Contact',
282
+ description: 'Client contacts and representatives',
283
+ },
284
+ });
285
+ addIdField(contactEntity, { displayName: 'Contact ID', description: 'Unique identifier for the contact' });
286
+ addNameField(contactEntity, { description: 'Contact name and title' });
287
+ addEmailField(contactEntity, { description: 'Contact email address' });
288
+ addPhoneField(contactEntity, { description: 'Contact phone number' });
289
+ contactEntity.addProperty({
290
+ info: { name: 'contact_type', displayName: 'Contact Type', description: 'Type of contact' },
291
+ type: 'string',
292
+ required: true,
293
+ schema: {
294
+ enum: ['primary', 'secondary', 'emergency', 'billing', 'legal_representative'],
295
+ },
296
+ });
297
+ contactEntity.addProperty({
298
+ info: { name: 'position', displayName: 'Position', description: 'Contact position or role' },
299
+ type: 'string',
300
+ required: false,
301
+ });
302
+ addCustomStatusField(contactEntity, ['active', 'inactive'], {
303
+ displayName: 'Contact Status',
304
+ description: 'Current status of the contact',
305
+ });
306
+ addCreatedAtField(contactEntity, { description: 'When the contact was created' });
307
+ // Contact-Client Association (Many-to-One)
308
+ contactEntity.addAssociation({ key: clientEntity.key }, {
309
+ info: { name: 'client', displayName: 'Client', description: 'Client for this contact' },
310
+ required: true,
311
+ multiple: false,
312
+ });
313
+ // Case-Client Association (Many-to-One)
314
+ caseEntity.addAssociation({ key: clientEntity.key }, {
315
+ info: { name: 'client', displayName: 'Client', description: 'Client for this case' },
316
+ required: true,
317
+ multiple: false,
318
+ });
319
+ //
320
+ // 3. DOCUMENT MANAGEMENT NAMESPACE
321
+ //
322
+ const documentManagement = domain.addNamespace({
323
+ info: {
324
+ name: 'DocumentManagement',
325
+ displayName: 'Document Management',
326
+ description: 'Contracts, pleadings, evidence, and legal documents',
327
+ },
328
+ });
329
+ // Document Model
330
+ const documentModel = documentManagement.addModel({
331
+ info: {
332
+ name: 'Documents',
333
+ displayName: 'Document Management',
334
+ description: 'Legal documents and files',
335
+ },
336
+ });
337
+ // Document Entity
338
+ const documentEntity = documentModel.addEntity({
339
+ info: {
340
+ name: 'document',
341
+ displayName: 'Document',
342
+ description: 'Legal document or file',
343
+ },
344
+ });
345
+ addIdField(documentEntity, { displayName: 'Document ID', description: 'Unique identifier for the document' });
346
+ addNameField(documentEntity, { description: 'Document name and title' });
347
+ addDescriptionField(documentEntity, { description: 'Document description and summary' });
348
+ documentEntity.addProperty({
349
+ info: { name: 'document_type', displayName: 'Document Type', description: 'Type of legal document' },
350
+ type: 'string',
351
+ required: true,
352
+ schema: {
353
+ enum: [
354
+ 'contract',
355
+ 'pleading',
356
+ 'motion',
357
+ 'brief',
358
+ 'evidence',
359
+ 'correspondence',
360
+ 'court_order',
361
+ 'settlement_agreement',
362
+ 'legal_opinion',
363
+ 'affidavit',
364
+ ],
365
+ },
366
+ });
367
+ documentEntity.addProperty({
368
+ info: { name: 'file_path', displayName: 'File Path', description: 'Document file path' },
369
+ type: 'string',
370
+ required: true,
371
+ });
372
+ documentEntity.addProperty({
373
+ info: { name: 'file_size', displayName: 'File Size', description: 'Document file size in bytes' },
374
+ type: 'number',
375
+ required: false,
376
+ schema: {
377
+ minimum: 0,
378
+ },
379
+ });
380
+ documentEntity.addProperty({
381
+ info: { name: 'file_format', displayName: 'File Format', description: 'Document file format' },
382
+ type: 'string',
383
+ required: true,
384
+ schema: {
385
+ enum: ['pdf', 'doc', 'docx', 'txt', 'rtf', 'html', 'xml'],
386
+ },
387
+ });
388
+ documentEntity.addProperty({
389
+ info: { name: 'version', displayName: 'Version', description: 'Document version number' },
390
+ type: 'string',
391
+ required: true,
392
+ });
393
+ addCustomStatusField(documentEntity, ['draft', 'final', 'archived', 'superseded'], {
394
+ displayName: 'Document Status',
395
+ description: 'Current status of the document',
396
+ });
397
+ addCreatedAtField(documentEntity, { description: 'When the document was created' });
398
+ addUpdatedAtField(documentEntity, { description: 'When the document was last updated' });
399
+ // Document-Case Association (Many-to-One)
400
+ documentEntity.addAssociation({ key: caseEntity.key }, {
401
+ info: { name: 'case', displayName: 'Case', description: 'Case for this document' },
402
+ required: true,
403
+ multiple: false,
404
+ });
405
+ // Evidence Entity
406
+ const evidenceEntity = documentModel.addEntity({
407
+ info: {
408
+ name: 'evidence',
409
+ displayName: 'Evidence',
410
+ description: 'Legal evidence and exhibits',
411
+ },
412
+ });
413
+ addIdField(evidenceEntity, { displayName: 'Evidence ID', description: 'Unique identifier for the evidence' });
414
+ addNameField(evidenceEntity, { description: 'Evidence name and description' });
415
+ addDescriptionField(evidenceEntity, { description: 'Evidence description and details' });
416
+ evidenceEntity.addProperty({
417
+ info: { name: 'evidence_type', displayName: 'Evidence Type', description: 'Type of evidence' },
418
+ type: 'string',
419
+ required: true,
420
+ schema: {
421
+ enum: ['document', 'physical', 'digital', 'testimony', 'expert_report', 'photograph', 'video'],
422
+ },
423
+ });
424
+ evidenceEntity.addProperty({
425
+ info: { name: 'exhibit_number', displayName: 'Exhibit Number', description: 'Court exhibit number' },
426
+ type: 'string',
427
+ required: false,
428
+ });
429
+ evidenceEntity.addProperty({
430
+ info: { name: 'admitted', displayName: 'Admitted', description: 'Whether evidence was admitted' },
431
+ type: 'boolean',
432
+ required: false,
433
+ });
434
+ addCustomStatusField(evidenceEntity, ['pending', 'admitted', 'excluded', 'withdrawn'], {
435
+ displayName: 'Evidence Status',
436
+ description: 'Current status of the evidence',
437
+ });
438
+ addCreatedAtField(evidenceEntity, { description: 'When the evidence was created' });
439
+ // Evidence-Case Association (Many-to-One)
440
+ evidenceEntity.addAssociation({ key: caseEntity.key }, {
441
+ info: { name: 'case', displayName: 'Case', description: 'Case for this evidence' },
442
+ required: true,
443
+ multiple: false,
444
+ });
445
+ //
446
+ // 4. TIME TRACKING NAMESPACE
447
+ //
448
+ const timeTracking = domain.addNamespace({
449
+ info: {
450
+ name: 'TimeTracking',
451
+ displayName: 'Time Tracking',
452
+ description: 'Billable hours, time entries, and rates',
453
+ },
454
+ });
455
+ // Time Model
456
+ const timeModel = timeTracking.addModel({
457
+ info: {
458
+ name: 'Time',
459
+ displayName: 'Time Tracking',
460
+ description: 'Time tracking and billing',
461
+ },
462
+ });
463
+ // Time Entry Entity
464
+ const timeEntryEntity = timeModel.addEntity({
465
+ info: {
466
+ name: 'time_entry',
467
+ displayName: 'Time Entry',
468
+ description: 'Billable time entry',
469
+ },
470
+ });
471
+ addIdField(timeEntryEntity, { displayName: 'Entry ID', description: 'Unique identifier for the time entry' });
472
+ addNameField(timeEntryEntity, { description: 'Time entry description' });
473
+ timeEntryEntity.addProperty({
474
+ info: { name: 'entry_date', displayName: 'Entry Date', description: 'Date of the time entry' },
475
+ type: 'date',
476
+ required: true,
477
+ });
478
+ timeEntryEntity.addProperty({
479
+ info: { name: 'start_time', displayName: 'Start Time', description: 'Time entry start time' },
480
+ type: 'time',
481
+ required: true,
482
+ });
483
+ timeEntryEntity.addProperty({
484
+ info: { name: 'end_time', displayName: 'End Time', description: 'Time entry end time' },
485
+ type: 'time',
486
+ required: true,
487
+ });
488
+ timeEntryEntity.addProperty({
489
+ info: { name: 'hours', displayName: 'Hours', description: 'Total hours worked' },
490
+ type: 'number',
491
+ required: true,
492
+ schema: {
493
+ minimum: 0,
494
+ },
495
+ });
496
+ timeEntryEntity.addProperty({
497
+ info: { name: 'activity_type', displayName: 'Activity Type', description: 'Type of activity' },
498
+ type: 'string',
499
+ required: true,
500
+ schema: {
501
+ enum: ['research', 'drafting', 'review', 'meeting', 'court_appearance', 'client_communication', 'administrative'],
502
+ },
503
+ });
504
+ addCurrencyAmountField(timeEntryEntity, 'rate', 'Hourly Rate', {
505
+ description: 'Hourly billing rate',
506
+ });
507
+ addCurrencyAmountField(timeEntryEntity, 'amount', 'Total Amount', {
508
+ description: 'Total billable amount',
509
+ });
510
+ addCustomStatusField(timeEntryEntity, ['pending', 'approved', 'billed', 'paid'], {
511
+ displayName: 'Entry Status',
512
+ description: 'Current status of the time entry',
513
+ });
514
+ addCreatedAtField(timeEntryEntity, { description: 'When the time entry was created' });
515
+ // TimeEntry-Case Association (Many-to-One)
516
+ timeEntryEntity.addAssociation({ key: caseEntity.key }, {
517
+ info: { name: 'case', displayName: 'Case', description: 'Case for this time entry' },
518
+ required: true,
519
+ multiple: false,
520
+ });
521
+ // Billing Rate Entity
522
+ const billingRateEntity = timeModel.addEntity({
523
+ info: {
524
+ name: 'billing_rate',
525
+ displayName: 'Billing Rate',
526
+ description: 'Attorney billing rates',
527
+ },
528
+ });
529
+ addIdField(billingRateEntity, { displayName: 'Rate ID', description: 'Unique identifier for the billing rate' });
530
+ addNameField(billingRateEntity, { description: 'Rate name and description' });
531
+ billingRateEntity.addProperty({
532
+ info: { name: 'rate_type', displayName: 'Rate Type', description: 'Type of billing rate' },
533
+ type: 'string',
534
+ required: true,
535
+ schema: {
536
+ enum: ['hourly', 'flat_fee', 'contingency', 'retainer'],
537
+ },
538
+ });
539
+ billingRateEntity.addProperty({
540
+ info: { name: 'effective_date', displayName: 'Effective Date', description: 'Rate effective date' },
541
+ type: 'date',
542
+ required: true,
543
+ });
544
+ addCurrencyAmountField(billingRateEntity, 'rate_amount', 'Rate Amount', {
545
+ description: 'Billing rate amount',
546
+ });
547
+ addCustomStatusField(billingRateEntity, ['active', 'inactive', 'expired'], {
548
+ displayName: 'Rate Status',
549
+ description: 'Current status of the billing rate',
550
+ });
551
+ addCreatedAtField(billingRateEntity, { description: 'When the billing rate was created' });
552
+ //
553
+ // 5. CALENDAR MANAGEMENT NAMESPACE
554
+ //
555
+ const calendarManagement = domain.addNamespace({
556
+ info: {
557
+ name: 'CalendarManagement',
558
+ displayName: 'Calendar Management',
559
+ description: 'Court dates, deadlines, and appointments',
560
+ },
561
+ });
562
+ // Calendar Model
563
+ const calendarModel = calendarManagement.addModel({
564
+ info: {
565
+ name: 'Calendar',
566
+ displayName: 'Calendar Management',
567
+ description: 'Calendar events and scheduling',
568
+ },
569
+ });
570
+ // Calendar Event Entity
571
+ const calendarEventEntity = calendarModel.addEntity({
572
+ info: {
573
+ name: 'calendar_event',
574
+ displayName: 'Calendar Event',
575
+ description: 'Calendar event or appointment',
576
+ },
577
+ });
578
+ addIdField(calendarEventEntity, {
579
+ displayName: 'Event ID',
580
+ description: 'Unique identifier for the calendar event',
581
+ });
582
+ addNameField(calendarEventEntity, { description: 'Event name and title' });
583
+ addDescriptionField(calendarEventEntity, { description: 'Event description and details' });
584
+ calendarEventEntity.addProperty({
585
+ info: { name: 'event_type', displayName: 'Event Type', description: 'Type of calendar event' },
586
+ type: 'string',
587
+ required: true,
588
+ schema: {
589
+ enum: ['court_hearing', 'client_meeting', 'deadline', 'deposition', 'mediation', 'trial', 'appointment'],
590
+ },
591
+ });
592
+ calendarEventEntity.addProperty({
593
+ info: { name: 'event_date', displayName: 'Event Date', description: 'Date of the event' },
594
+ type: 'date',
595
+ required: true,
596
+ });
597
+ calendarEventEntity.addProperty({
598
+ info: { name: 'start_time', displayName: 'Start Time', description: 'Event start time' },
599
+ type: 'time',
600
+ required: true,
601
+ });
602
+ calendarEventEntity.addProperty({
603
+ info: { name: 'end_time', displayName: 'End Time', description: 'Event end time' },
604
+ type: 'time',
605
+ required: false,
606
+ });
607
+ calendarEventEntity.addProperty({
608
+ info: { name: 'location', displayName: 'Location', description: 'Event location' },
609
+ type: 'string',
610
+ required: false,
611
+ });
612
+ calendarEventEntity.addProperty({
613
+ info: { name: 'priority', displayName: 'Priority', description: 'Event priority level' },
614
+ type: 'string',
615
+ required: true,
616
+ schema: {
617
+ enum: ['low', 'medium', 'high', 'critical'],
618
+ },
619
+ });
620
+ addCustomStatusField(calendarEventEntity, ['scheduled', 'confirmed', 'completed', 'cancelled'], {
621
+ displayName: 'Event Status',
622
+ description: 'Current status of the calendar event',
623
+ });
624
+ addCreatedAtField(calendarEventEntity, { description: 'When the event was created' });
625
+ // CalendarEvent-Case Association (Many-to-One)
626
+ calendarEventEntity.addAssociation({ key: caseEntity.key }, {
627
+ info: { name: 'case', displayName: 'Case', description: 'Case for this calendar event' },
628
+ required: false,
629
+ multiple: false,
630
+ });
631
+ // CalendarEvent-Client Association (Many-to-One)
632
+ calendarEventEntity.addAssociation({ key: clientEntity.key }, {
633
+ info: { name: 'client', displayName: 'Client', description: 'Client for this calendar event' },
634
+ required: false,
635
+ multiple: false,
636
+ });
637
+ // Deadline Entity
638
+ const deadlineEntity = calendarModel.addEntity({
639
+ info: {
640
+ name: 'deadline',
641
+ displayName: 'Deadline',
642
+ description: 'Legal deadlines and important dates',
643
+ },
644
+ });
645
+ addIdField(deadlineEntity, { displayName: 'Deadline ID', description: 'Unique identifier for the deadline' });
646
+ addNameField(deadlineEntity, { description: 'Deadline name and description' });
647
+ addDescriptionField(deadlineEntity, { description: 'Deadline description and details' });
648
+ deadlineEntity.addProperty({
649
+ info: { name: 'deadline_type', displayName: 'Deadline Type', description: 'Type of deadline' },
650
+ type: 'string',
651
+ required: true,
652
+ schema: {
653
+ enum: ['filing', 'response', 'discovery', 'appeal', 'statute_of_limitations', 'contract'],
654
+ },
655
+ });
656
+ deadlineEntity.addProperty({
657
+ info: { name: 'due_date', displayName: 'Due Date', description: 'Deadline due date' },
658
+ type: 'date',
659
+ required: true,
660
+ });
661
+ deadlineEntity.addProperty({
662
+ info: { name: 'due_time', displayName: 'Due Time', description: 'Deadline due time' },
663
+ type: 'time',
664
+ required: false,
665
+ });
666
+ deadlineEntity.addProperty({
667
+ info: { name: 'priority', displayName: 'Priority', description: 'Deadline priority level' },
668
+ type: 'string',
669
+ required: true,
670
+ schema: {
671
+ enum: ['low', 'medium', 'high', 'critical'],
672
+ },
673
+ });
674
+ addCustomStatusField(deadlineEntity, ['pending', 'completed', 'missed', 'extended'], {
675
+ displayName: 'Deadline Status',
676
+ description: 'Current status of the deadline',
677
+ });
678
+ addCreatedAtField(deadlineEntity, { description: 'When the deadline was created' });
679
+ // Deadline-Case Association (Many-to-One)
680
+ deadlineEntity.addAssociation({ key: caseEntity.key }, {
681
+ info: { name: 'case', displayName: 'Case', description: 'Case for this deadline' },
682
+ required: true,
683
+ multiple: false,
684
+ });
685
+ //
686
+ // 6. BILLING & ACCOUNTING NAMESPACE
687
+ //
688
+ const billingAccounting = domain.addNamespace({
689
+ info: {
690
+ name: 'BillingAccounting',
691
+ displayName: 'Billing & Accounting',
692
+ description: 'Invoicing, payments, and trust accounts',
693
+ },
694
+ });
695
+ // Billing Model
696
+ const billingModel = billingAccounting.addModel({
697
+ info: {
698
+ name: 'Billing',
699
+ displayName: 'Billing & Accounting',
700
+ description: 'Billing and accounting management',
701
+ },
702
+ });
703
+ // Invoice Entity
704
+ const invoiceEntity = billingModel.addEntity({
705
+ info: {
706
+ name: 'invoice',
707
+ displayName: 'Invoice',
708
+ description: 'Client invoice',
709
+ },
710
+ });
711
+ addIdField(invoiceEntity, { displayName: 'Invoice ID', description: 'Unique identifier for the invoice' });
712
+ addNameField(invoiceEntity, { description: 'Invoice name and description' });
713
+ invoiceEntity.addProperty({
714
+ info: { name: 'invoice_number', displayName: 'Invoice Number', description: 'Invoice number' },
715
+ type: 'string',
716
+ required: true,
717
+ unique: true,
718
+ });
719
+ invoiceEntity.addProperty({
720
+ info: { name: 'invoice_date', displayName: 'Invoice Date', description: 'Invoice date' },
721
+ type: 'date',
722
+ required: true,
723
+ });
724
+ invoiceEntity.addProperty({
725
+ info: { name: 'due_date', displayName: 'Due Date', description: 'Invoice due date' },
726
+ type: 'date',
727
+ required: true,
728
+ });
729
+ addCurrencyAmountField(invoiceEntity, 'subtotal', 'Subtotal', {
730
+ description: 'Invoice subtotal amount',
731
+ });
732
+ addCurrencyAmountField(invoiceEntity, 'tax_amount', 'Tax Amount', {
733
+ description: 'Invoice tax amount',
734
+ });
735
+ addCurrencyAmountField(invoiceEntity, 'total_amount', 'Total Amount', {
736
+ description: 'Invoice total amount',
737
+ });
738
+ addCustomStatusField(invoiceEntity, ['draft', 'sent', 'paid', 'overdue', 'cancelled'], {
739
+ displayName: 'Invoice Status',
740
+ description: 'Current status of the invoice',
741
+ });
742
+ addCreatedAtField(invoiceEntity, { description: 'When the invoice was created' });
743
+ // Invoice-Client Association (Many-to-One)
744
+ invoiceEntity.addAssociation({ key: clientEntity.key }, {
745
+ info: { name: 'client', displayName: 'Client', description: 'Client for this invoice' },
746
+ required: true,
747
+ multiple: false,
748
+ });
749
+ // Invoice-Case Association (Many-to-One)
750
+ invoiceEntity.addAssociation({ key: caseEntity.key }, {
751
+ info: { name: 'case', displayName: 'Case', description: 'Case for this invoice' },
752
+ required: false,
753
+ multiple: false,
754
+ });
755
+ // Payment Entity
756
+ const paymentEntity = billingModel.addEntity({
757
+ info: {
758
+ name: 'payment',
759
+ displayName: 'Payment',
760
+ description: 'Client payment',
761
+ },
762
+ });
763
+ addIdField(paymentEntity, { displayName: 'Payment ID', description: 'Unique identifier for the payment' });
764
+ addNameField(paymentEntity, { description: 'Payment name and description' });
765
+ paymentEntity.addProperty({
766
+ info: { name: 'payment_date', displayName: 'Payment Date', description: 'Payment date' },
767
+ type: 'date',
768
+ required: true,
769
+ });
770
+ paymentEntity.addProperty({
771
+ info: { name: 'payment_method', displayName: 'Payment Method', description: 'Payment method' },
772
+ type: 'string',
773
+ required: true,
774
+ schema: {
775
+ enum: ['check', 'credit_card', 'bank_transfer', 'cash', 'online'],
776
+ },
777
+ });
778
+ paymentEntity.addProperty({
779
+ info: { name: 'reference_number', displayName: 'Reference Number', description: 'Payment reference number' },
780
+ type: 'string',
781
+ required: false,
782
+ });
783
+ addCurrencyAmountField(paymentEntity, 'amount', 'Payment Amount', {
784
+ description: 'Payment amount',
785
+ });
786
+ addCustomStatusField(paymentEntity, ['pending', 'completed', 'failed', 'refunded'], {
787
+ displayName: 'Payment Status',
788
+ description: 'Current status of the payment',
789
+ });
790
+ addCreatedAtField(paymentEntity, { description: 'When the payment was created' });
791
+ // Payment-Invoice Association (Many-to-One)
792
+ paymentEntity.addAssociation({ key: invoiceEntity.key }, {
793
+ info: { name: 'invoice', displayName: 'Invoice', description: 'Invoice for this payment' },
794
+ required: true,
795
+ multiple: false,
796
+ });
797
+ // Trust Account Entity
798
+ const trustAccountEntity = billingModel.addEntity({
799
+ info: {
800
+ name: 'trust_account',
801
+ displayName: 'Trust Account',
802
+ description: 'Client trust account',
803
+ },
804
+ });
805
+ addIdField(trustAccountEntity, {
806
+ displayName: 'Trust Account ID',
807
+ description: 'Unique identifier for the trust account',
808
+ });
809
+ addNameField(trustAccountEntity, { description: 'Trust account name and description' });
810
+ trustAccountEntity.addProperty({
811
+ info: { name: 'account_number', displayName: 'Account Number', description: 'Trust account number' },
812
+ type: 'string',
813
+ required: true,
814
+ unique: true,
815
+ });
816
+ trustAccountEntity.addProperty({
817
+ info: { name: 'bank_name', displayName: 'Bank Name', description: 'Bank name' },
818
+ type: 'string',
819
+ required: true,
820
+ });
821
+ addCurrencyAmountField(trustAccountEntity, 'balance', 'Account Balance', {
822
+ description: 'Trust account balance',
823
+ });
824
+ addCustomStatusField(trustAccountEntity, ['active', 'inactive', 'frozen'], {
825
+ displayName: 'Account Status',
826
+ description: 'Current status of the trust account',
827
+ });
828
+ addCreatedAtField(trustAccountEntity, { description: 'When the trust account was created' });
829
+ // TrustAccount-Client Association (Many-to-One)
830
+ trustAccountEntity.addAssociation({ key: clientEntity.key }, {
831
+ info: { name: 'client', displayName: 'Client', description: 'Client for this trust account' },
832
+ required: true,
833
+ multiple: false,
834
+ });
835
+ return domain;
836
+ }
837
+ //# sourceMappingURL=legal-services-domain.js.map