@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.
- package/build/src/modeling/helpers/Intelisense.d.ts +1 -0
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +1 -0
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/templates/index.d.ts +1 -0
- package/build/src/modeling/templates/index.d.ts.map +1 -1
- package/build/src/modeling/templates/index.js +2 -0
- package/build/src/modeling/templates/index.js.map +1 -1
- package/build/src/modeling/templates/meta/education-management-platform.json +1 -0
- package/build/src/modeling/templates/meta/financial-services-platform.json +1 -0
- package/build/src/modeling/templates/meta/gaming-platform.json +1 -0
- package/build/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
- package/build/src/modeling/templates/meta/hospitality-platform.json +1 -0
- package/build/src/modeling/templates/meta/index.d.ts +11 -3
- package/build/src/modeling/templates/meta/index.d.ts.map +1 -1
- package/build/src/modeling/templates/meta/index.js +61 -1
- package/build/src/modeling/templates/meta/index.js.map +1 -1
- package/build/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
- package/build/src/modeling/templates/meta/legal-services-platform.json +1 -0
- package/build/src/modeling/templates/meta/manufacturing-platform.json +1 -0
- package/build/src/modeling/templates/meta/non-profit-platform.json +1 -0
- package/build/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
- package/build/src/modeling/templates/template-registry.d.ts +14 -0
- package/build/src/modeling/templates/template-registry.d.ts.map +1 -1
- package/build/src/modeling/templates/template-registry.js +63 -0
- package/build/src/modeling/templates/template-registry.js.map +1 -1
- package/build/src/modeling/templates/{ecommerce-domain.d.ts → verticals/business-services/ecommerce-domain.d.ts} +2 -2
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/{ecommerce-domain.js → verticals/business-services/ecommerce-domain.js} +6 -6
- package/build/src/modeling/templates/verticals/business-services/ecommerce-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js +744 -0
- package/build/src/modeling/templates/verticals/business-services/financial-services-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts +45 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js +797 -0
- package/build/src/modeling/templates/verticals/business-services/hospitality-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/index.d.ts +21 -0
- package/build/src/modeling/templates/verticals/business-services/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/index.js +50 -0
- package/build/src/modeling/templates/verticals/business-services/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts +46 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js +837 -0
- package/build/src/modeling/templates/verticals/business-services/legal-services-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.js +725 -0
- package/build/src/modeling/templates/verticals/education-training/education-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/education-training/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/education-training/index.js +21 -0
- package/build/src/modeling/templates/verticals/education-training/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js +859 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js +21 -0
- package/build/src/modeling/templates/verticals/healthcare-life-sciences/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/index.d.ts +79 -0
- package/build/src/modeling/templates/verticals/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/index.js +186 -0
- package/build/src/modeling/templates/verticals/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js +22 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts +45 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js +710 -0
- package/build/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/public-sector/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/index.js +22 -0
- package/build/src/modeling/templates/verticals/public-sector/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts +47 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js +864 -0
- package/build/src/modeling/templates/verticals/public-sector/non-profit-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts +18 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js +21 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts +40 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js +727 -0
- package/build/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.js.map +1 -0
- package/build/src/modeling/templates/{blog-domain.d.ts → verticals/technology-media/blog-domain.d.ts} +2 -2
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/{blog-domain.js → verticals/technology-media/blog-domain.js} +5 -5
- package/build/src/modeling/templates/verticals/technology-media/blog-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts +46 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js +1033 -0
- package/build/src/modeling/templates/verticals/technology-media/gaming-domain.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts +21 -0
- package/build/src/modeling/templates/verticals/technology-media/index.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/index.js +42 -0
- package/build/src/modeling/templates/verticals/technology-media/index.js.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts +47 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.d.ts.map +1 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js +1027 -0
- package/build/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +23 -23
- package/package.json +1 -1
- package/src/modeling/helpers/Intelisense.ts +1 -0
- package/src/modeling/templates/meta/education-management-platform.json +1 -0
- package/src/modeling/templates/meta/financial-services-platform.json +1 -0
- package/src/modeling/templates/meta/gaming-platform.json +1 -0
- package/src/modeling/templates/meta/healthcare-management-platform.json +1 -0
- package/src/modeling/templates/meta/hospitality-platform.json +1 -0
- package/src/modeling/templates/meta/iot-smart-home-platform.json +1 -0
- package/src/modeling/templates/meta/legal-services-platform.json +1 -0
- package/src/modeling/templates/meta/manufacturing-platform.json +1 -0
- package/src/modeling/templates/meta/non-profit-platform.json +1 -0
- package/src/modeling/templates/meta/real-estate-management-platform.json +1 -0
- package/src/modeling/templates/readme.md +14 -0
- package/src/modeling/templates/template-registry.ts +73 -0
- package/src/modeling/templates/verticals/README.md +122 -0
- package/src/modeling/templates/{ecommerce-domain.ts → verticals/business-services/ecommerce-domain.ts} +7 -7
- package/src/modeling/templates/verticals/business-services/financial-services-domain.ts +943 -0
- package/src/modeling/templates/verticals/business-services/hospitality-domain.ts +994 -0
- package/src/modeling/templates/verticals/business-services/legal-services-domain.ts +1059 -0
- package/src/modeling/templates/verticals/education-training/education-domain.ts +922 -0
- package/src/modeling/templates/verticals/healthcare-life-sciences/healthcare-domain.ts +1111 -0
- package/src/modeling/templates/verticals/manufacturing-logistics/manufacturing-domain.ts +895 -0
- package/src/modeling/templates/verticals/public-sector/non-profit-domain.ts +1109 -0
- package/src/modeling/templates/verticals/real-estate-construction/real-estate-domain.ts +944 -0
- package/src/modeling/templates/{blog-domain.ts → verticals/technology-media/blog-domain.ts} +6 -6
- package/src/modeling/templates/verticals/technology-media/gaming-domain.ts +1290 -0
- package/src/modeling/templates/verticals/technology-media/iot-smart-home-domain.ts +1287 -0
- package/build/src/modeling/templates/blog-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/blog-domain.js.map +0 -1
- package/build/src/modeling/templates/ecommerce-domain.d.ts.map +0 -1
- package/build/src/modeling/templates/ecommerce-domain.js.map +0 -1
|
@@ -0,0 +1,1109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Non-Profit Domain Template
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive non-profit data domain following domain-driven design principles.
|
|
5
|
+
* This template covers the complete non-profit organization lifecycle including:
|
|
6
|
+
*
|
|
7
|
+
* - Donor Management: Donors, donations, campaigns, stewardship
|
|
8
|
+
* - Program Management: Programs, services, outcomes, impact
|
|
9
|
+
* - Volunteer Management: Volunteers, opportunities, scheduling
|
|
10
|
+
* - Grant Management: Grants, applications, reporting, compliance
|
|
11
|
+
* - Event Management: Fundraising events, registrations, logistics
|
|
12
|
+
* - Financial Management: Budgets, expenses, reporting
|
|
13
|
+
*
|
|
14
|
+
* Key Features:
|
|
15
|
+
* - Complete donor lifecycle management
|
|
16
|
+
* - Program and service delivery tracking
|
|
17
|
+
* - Volunteer coordination and scheduling
|
|
18
|
+
* - Grant application and compliance management
|
|
19
|
+
* - Event planning and fundraising
|
|
20
|
+
* - Financial management and reporting
|
|
21
|
+
* - Impact measurement and outcomes
|
|
22
|
+
*
|
|
23
|
+
* Use Cases:
|
|
24
|
+
* - Non-profit organizations
|
|
25
|
+
* - Charitable foundations
|
|
26
|
+
* - Community service organizations
|
|
27
|
+
* - Donor relationship management
|
|
28
|
+
* - Volunteer coordination
|
|
29
|
+
* - Grant management
|
|
30
|
+
* - Fundraising and events
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { DataDomain } from '../../../DataDomain.js'
|
|
34
|
+
import {
|
|
35
|
+
addIdField,
|
|
36
|
+
addNameField,
|
|
37
|
+
addDescriptionField,
|
|
38
|
+
addEmailField,
|
|
39
|
+
addPhoneField,
|
|
40
|
+
addCustomStatusField,
|
|
41
|
+
addCreatedAtField,
|
|
42
|
+
addUpdatedAtField,
|
|
43
|
+
addCurrencyAmountField,
|
|
44
|
+
} from '../../../helpers/Intelisense.js'
|
|
45
|
+
import type { CreateTemplateOptions } from '../../types.js'
|
|
46
|
+
|
|
47
|
+
function createDomain(): DataDomain {
|
|
48
|
+
return new DataDomain({
|
|
49
|
+
info: {
|
|
50
|
+
name: 'Non-Profit Platform',
|
|
51
|
+
displayName: 'Non-Profit Platform',
|
|
52
|
+
description:
|
|
53
|
+
'A comprehensive non-profit platform with donor management, programs, volunteers, ' +
|
|
54
|
+
'grants, events, and financial management',
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Creates a comprehensive non-profit data domain following domain-driven design principles.
|
|
61
|
+
*
|
|
62
|
+
* This function demonstrates the proper hierarchy and organization for a non-profit platform:
|
|
63
|
+
* 1. Creates the root DataDomain for the non-profit platform
|
|
64
|
+
* 2. Organizes functionality into logical namespaces (Donor Management, Program Management, etc.)
|
|
65
|
+
* 3. Groups related entities into models within each namespace
|
|
66
|
+
* 4. Defines entities with proper semantic annotations for non-profit workflows
|
|
67
|
+
* 5. Establishes associations with appropriate cardinality for non-profit relationships
|
|
68
|
+
*
|
|
69
|
+
* @returns A fully configured DataDomain with all non-profit entities and relationships
|
|
70
|
+
*/
|
|
71
|
+
export default function createNonProfitDomain(options: CreateTemplateOptions = {}): DataDomain {
|
|
72
|
+
// Ensure the root data domain
|
|
73
|
+
const domain = options.domain ?? createDomain()
|
|
74
|
+
|
|
75
|
+
//
|
|
76
|
+
// 1. DONOR MANAGEMENT NAMESPACE
|
|
77
|
+
//
|
|
78
|
+
const donorManagement = domain.addNamespace({
|
|
79
|
+
info: {
|
|
80
|
+
name: 'DonorManagement',
|
|
81
|
+
displayName: 'Donor Management',
|
|
82
|
+
description: 'Donors, donations, campaigns, and stewardship',
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
// Donor Model
|
|
87
|
+
const donorModel = donorManagement.addModel({
|
|
88
|
+
info: {
|
|
89
|
+
name: 'Donors',
|
|
90
|
+
displayName: 'Donor Management',
|
|
91
|
+
description: 'Donor profiles and relationships',
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
// Donor Entity
|
|
96
|
+
const donorEntity = donorModel.addEntity({
|
|
97
|
+
info: {
|
|
98
|
+
name: 'donor',
|
|
99
|
+
displayName: 'Donor',
|
|
100
|
+
description: 'Donor with profile and giving history',
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
addIdField(donorEntity, { displayName: 'Donor ID', description: 'Unique identifier for the donor' })
|
|
105
|
+
|
|
106
|
+
addNameField(donorEntity, { description: 'Donor name and title' })
|
|
107
|
+
|
|
108
|
+
addDescriptionField(donorEntity, { description: 'Donor description and notes' })
|
|
109
|
+
|
|
110
|
+
addEmailField(donorEntity, { description: 'Donor email address' })
|
|
111
|
+
|
|
112
|
+
addPhoneField(donorEntity, { description: 'Donor phone number' })
|
|
113
|
+
|
|
114
|
+
donorEntity.addProperty({
|
|
115
|
+
info: { name: 'donor_type', displayName: 'Donor Type', description: 'Type of donor' },
|
|
116
|
+
type: 'string',
|
|
117
|
+
required: true,
|
|
118
|
+
schema: {
|
|
119
|
+
enum: ['individual', 'corporation', 'foundation', 'government', 'anonymous'],
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
donorEntity.addProperty({
|
|
124
|
+
info: { name: 'address', displayName: 'Address', description: 'Donor address' },
|
|
125
|
+
type: 'string',
|
|
126
|
+
required: false,
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
donorEntity.addProperty({
|
|
130
|
+
info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Donor date of birth' },
|
|
131
|
+
type: 'date',
|
|
132
|
+
required: false,
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
donorEntity.addProperty({
|
|
136
|
+
info: { name: 'employer', displayName: 'Employer', description: 'Donor employer' },
|
|
137
|
+
type: 'string',
|
|
138
|
+
required: false,
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
addCustomStatusField(donorEntity, ['active', 'inactive', 'prospect', 'lapsed'], {
|
|
142
|
+
displayName: 'Donor Status',
|
|
143
|
+
description: 'Current status of the donor',
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
addCreatedAtField(donorEntity, { description: 'When the donor record was created' })
|
|
147
|
+
addUpdatedAtField(donorEntity, { description: 'When the donor record was last updated' })
|
|
148
|
+
|
|
149
|
+
// Donation Entity
|
|
150
|
+
const donationEntity = donorModel.addEntity({
|
|
151
|
+
info: {
|
|
152
|
+
name: 'donation',
|
|
153
|
+
displayName: 'Donation',
|
|
154
|
+
description: 'Donor contribution',
|
|
155
|
+
},
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
addIdField(donationEntity, { displayName: 'Donation ID', description: 'Unique identifier for the donation' })
|
|
159
|
+
|
|
160
|
+
addNameField(donationEntity, { description: 'Donation name and description' })
|
|
161
|
+
|
|
162
|
+
addDescriptionField(donationEntity, { description: 'Donation description and purpose' })
|
|
163
|
+
|
|
164
|
+
donationEntity.addProperty({
|
|
165
|
+
info: { name: 'donation_date', displayName: 'Donation Date', description: 'Date of the donation' },
|
|
166
|
+
type: 'date',
|
|
167
|
+
required: true,
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
donationEntity.addProperty({
|
|
171
|
+
info: { name: 'donation_type', displayName: 'Donation Type', description: 'Type of donation' },
|
|
172
|
+
type: 'string',
|
|
173
|
+
required: true,
|
|
174
|
+
schema: {
|
|
175
|
+
enum: ['one_time', 'recurring', 'pledge', 'in_kind', 'matching'],
|
|
176
|
+
},
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
donationEntity.addProperty({
|
|
180
|
+
info: { name: 'payment_method', displayName: 'Payment Method', description: 'Payment method used' },
|
|
181
|
+
type: 'string',
|
|
182
|
+
required: true,
|
|
183
|
+
schema: {
|
|
184
|
+
enum: ['check', 'credit_card', 'bank_transfer', 'cash', 'online', 'stock'],
|
|
185
|
+
},
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
addCurrencyAmountField(donationEntity, 'amount', 'Donation Amount', {
|
|
189
|
+
description: 'Donation amount',
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
addCustomStatusField(donationEntity, ['pending', 'received', 'acknowledged', 'thanked'], {
|
|
193
|
+
displayName: 'Donation Status',
|
|
194
|
+
description: 'Current status of the donation',
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
addCreatedAtField(donationEntity, { description: 'When the donation was created' })
|
|
198
|
+
|
|
199
|
+
// Donation-Donor Association (Many-to-One)
|
|
200
|
+
donationEntity.addAssociation(
|
|
201
|
+
{ key: donorEntity.key },
|
|
202
|
+
{
|
|
203
|
+
info: { name: 'donor', displayName: 'Donor', description: 'Donor for this donation' },
|
|
204
|
+
required: true,
|
|
205
|
+
multiple: false,
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
// Campaign Entity
|
|
210
|
+
const campaignEntity = donorModel.addEntity({
|
|
211
|
+
info: {
|
|
212
|
+
name: 'campaign',
|
|
213
|
+
displayName: 'Campaign',
|
|
214
|
+
description: 'Fundraising campaign',
|
|
215
|
+
},
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
addIdField(campaignEntity, { displayName: 'Campaign ID', description: 'Unique identifier for the campaign' })
|
|
219
|
+
|
|
220
|
+
addNameField(campaignEntity, { description: 'Campaign name and title' })
|
|
221
|
+
|
|
222
|
+
addDescriptionField(campaignEntity, { description: 'Campaign description and goals' })
|
|
223
|
+
|
|
224
|
+
campaignEntity.addProperty({
|
|
225
|
+
info: { name: 'campaign_type', displayName: 'Campaign Type', description: 'Type of campaign' },
|
|
226
|
+
type: 'string',
|
|
227
|
+
required: true,
|
|
228
|
+
schema: {
|
|
229
|
+
enum: ['annual', 'capital', 'emergency', 'special_event', 'online', 'mail'],
|
|
230
|
+
},
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
campaignEntity.addProperty({
|
|
234
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Campaign start date' },
|
|
235
|
+
type: 'date',
|
|
236
|
+
required: true,
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
campaignEntity.addProperty({
|
|
240
|
+
info: { name: 'end_date', displayName: 'End Date', description: 'Campaign end date' },
|
|
241
|
+
type: 'date',
|
|
242
|
+
required: true,
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
addCurrencyAmountField(campaignEntity, 'goal_amount', 'Goal Amount', {
|
|
246
|
+
description: 'Campaign fundraising goal',
|
|
247
|
+
})
|
|
248
|
+
|
|
249
|
+
addCurrencyAmountField(campaignEntity, 'raised_amount', 'Raised Amount', {
|
|
250
|
+
description: 'Amount raised so far',
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
addCustomStatusField(campaignEntity, ['planning', 'active', 'completed', 'cancelled'], {
|
|
254
|
+
displayName: 'Campaign Status',
|
|
255
|
+
description: 'Current status of the campaign',
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
addCreatedAtField(campaignEntity, { description: 'When the campaign was created' })
|
|
259
|
+
|
|
260
|
+
// Donation-Campaign Association (Many-to-One)
|
|
261
|
+
donationEntity.addAssociation(
|
|
262
|
+
{ key: campaignEntity.key },
|
|
263
|
+
{
|
|
264
|
+
info: { name: 'campaign', displayName: 'Campaign', description: 'Campaign for this donation' },
|
|
265
|
+
required: false,
|
|
266
|
+
multiple: false,
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
//
|
|
271
|
+
// 2. PROGRAM MANAGEMENT NAMESPACE
|
|
272
|
+
//
|
|
273
|
+
const programManagement = domain.addNamespace({
|
|
274
|
+
info: {
|
|
275
|
+
name: 'ProgramManagement',
|
|
276
|
+
displayName: 'Program Management',
|
|
277
|
+
description: 'Programs, services, outcomes, and impact',
|
|
278
|
+
},
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
// Program Model
|
|
282
|
+
const programModel = programManagement.addModel({
|
|
283
|
+
info: {
|
|
284
|
+
name: 'Programs',
|
|
285
|
+
displayName: 'Program Management',
|
|
286
|
+
description: 'Programs and services',
|
|
287
|
+
},
|
|
288
|
+
})
|
|
289
|
+
|
|
290
|
+
// Program Entity
|
|
291
|
+
const programEntity = programModel.addEntity({
|
|
292
|
+
info: {
|
|
293
|
+
name: 'program',
|
|
294
|
+
displayName: 'Program',
|
|
295
|
+
description: 'Non-profit program or service',
|
|
296
|
+
},
|
|
297
|
+
})
|
|
298
|
+
|
|
299
|
+
addIdField(programEntity, { displayName: 'Program ID', description: 'Unique identifier for the program' })
|
|
300
|
+
|
|
301
|
+
addNameField(programEntity, { description: 'Program name and title' })
|
|
302
|
+
|
|
303
|
+
addDescriptionField(programEntity, { description: 'Program description and objectives' })
|
|
304
|
+
|
|
305
|
+
programEntity.addProperty({
|
|
306
|
+
info: { name: 'program_type', displayName: 'Program Type', description: 'Type of program' },
|
|
307
|
+
type: 'string',
|
|
308
|
+
required: true,
|
|
309
|
+
schema: {
|
|
310
|
+
enum: ['education', 'healthcare', 'social_services', 'environmental', 'arts_culture', 'community_development'],
|
|
311
|
+
},
|
|
312
|
+
})
|
|
313
|
+
|
|
314
|
+
programEntity.addProperty({
|
|
315
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Program start date' },
|
|
316
|
+
type: 'date',
|
|
317
|
+
required: true,
|
|
318
|
+
})
|
|
319
|
+
|
|
320
|
+
programEntity.addProperty({
|
|
321
|
+
info: { name: 'end_date', displayName: 'End Date', description: 'Program end date' },
|
|
322
|
+
type: 'date',
|
|
323
|
+
required: false,
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
addCurrencyAmountField(programEntity, 'budget', 'Program Budget', {
|
|
327
|
+
description: 'Program budget amount',
|
|
328
|
+
})
|
|
329
|
+
|
|
330
|
+
programEntity.addProperty({
|
|
331
|
+
info: { name: 'target_population', displayName: 'Target Population', description: 'Target population served' },
|
|
332
|
+
type: 'string',
|
|
333
|
+
required: false,
|
|
334
|
+
})
|
|
335
|
+
|
|
336
|
+
addCustomStatusField(programEntity, ['planning', 'active', 'completed', 'suspended'], {
|
|
337
|
+
displayName: 'Program Status',
|
|
338
|
+
description: 'Current status of the program',
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
addCreatedAtField(programEntity, { description: 'When the program was created' })
|
|
342
|
+
addUpdatedAtField(programEntity, { description: 'When the program was last updated' })
|
|
343
|
+
|
|
344
|
+
// Service Entity
|
|
345
|
+
const serviceEntity = programModel.addEntity({
|
|
346
|
+
info: {
|
|
347
|
+
name: 'service',
|
|
348
|
+
displayName: 'Service',
|
|
349
|
+
description: 'Service provided by the program',
|
|
350
|
+
},
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
addIdField(serviceEntity, { displayName: 'Service ID', description: 'Unique identifier for the service' })
|
|
354
|
+
|
|
355
|
+
addNameField(serviceEntity, { description: 'Service name and title' })
|
|
356
|
+
|
|
357
|
+
addDescriptionField(serviceEntity, { description: 'Service description and details' })
|
|
358
|
+
|
|
359
|
+
serviceEntity.addProperty({
|
|
360
|
+
info: { name: 'service_type', displayName: 'Service Type', description: 'Type of service' },
|
|
361
|
+
type: 'string',
|
|
362
|
+
required: true,
|
|
363
|
+
schema: {
|
|
364
|
+
enum: ['direct_service', 'referral', 'advocacy', 'education', 'support', 'counseling'],
|
|
365
|
+
},
|
|
366
|
+
})
|
|
367
|
+
|
|
368
|
+
serviceEntity.addProperty({
|
|
369
|
+
info: { name: 'location', displayName: 'Location', description: 'Service location' },
|
|
370
|
+
type: 'string',
|
|
371
|
+
required: false,
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
addCustomStatusField(serviceEntity, ['available', 'unavailable', 'waitlist'], {
|
|
375
|
+
displayName: 'Service Status',
|
|
376
|
+
description: 'Current status of the service',
|
|
377
|
+
})
|
|
378
|
+
|
|
379
|
+
addCreatedAtField(serviceEntity, { description: 'When the service was created' })
|
|
380
|
+
|
|
381
|
+
// Service-Program Association (Many-to-One)
|
|
382
|
+
serviceEntity.addAssociation(
|
|
383
|
+
{ key: programEntity.key },
|
|
384
|
+
{
|
|
385
|
+
info: { name: 'program', displayName: 'Program', description: 'Program for this service' },
|
|
386
|
+
required: true,
|
|
387
|
+
multiple: false,
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
// Outcome Entity
|
|
392
|
+
const outcomeEntity = programModel.addEntity({
|
|
393
|
+
info: {
|
|
394
|
+
name: 'outcome',
|
|
395
|
+
displayName: 'Outcome',
|
|
396
|
+
description: 'Program outcomes and impact measurement',
|
|
397
|
+
},
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
addIdField(outcomeEntity, { displayName: 'Outcome ID', description: 'Unique identifier for the outcome' })
|
|
401
|
+
|
|
402
|
+
addNameField(outcomeEntity, { description: 'Outcome name and description' })
|
|
403
|
+
|
|
404
|
+
addDescriptionField(outcomeEntity, { description: 'Outcome description and measurement' })
|
|
405
|
+
|
|
406
|
+
outcomeEntity.addProperty({
|
|
407
|
+
info: { name: 'outcome_type', displayName: 'Outcome Type', description: 'Type of outcome' },
|
|
408
|
+
type: 'string',
|
|
409
|
+
required: true,
|
|
410
|
+
schema: {
|
|
411
|
+
enum: ['short_term', 'medium_term', 'long_term', 'impact', 'output'],
|
|
412
|
+
},
|
|
413
|
+
})
|
|
414
|
+
|
|
415
|
+
outcomeEntity.addProperty({
|
|
416
|
+
info: { name: 'measurement_unit', displayName: 'Measurement Unit', description: 'Unit of measurement' },
|
|
417
|
+
type: 'string',
|
|
418
|
+
required: true,
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
outcomeEntity.addProperty({
|
|
422
|
+
info: { name: 'target_value', displayName: 'Target Value', description: 'Target outcome value' },
|
|
423
|
+
type: 'number',
|
|
424
|
+
required: true,
|
|
425
|
+
})
|
|
426
|
+
|
|
427
|
+
outcomeEntity.addProperty({
|
|
428
|
+
info: { name: 'actual_value', displayName: 'Actual Value', description: 'Actual outcome value' },
|
|
429
|
+
type: 'number',
|
|
430
|
+
required: false,
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
addCustomStatusField(outcomeEntity, ['planned', 'in_progress', 'achieved', 'not_achieved'], {
|
|
434
|
+
displayName: 'Outcome Status',
|
|
435
|
+
description: 'Current status of the outcome',
|
|
436
|
+
})
|
|
437
|
+
|
|
438
|
+
addCreatedAtField(outcomeEntity, { description: 'When the outcome was created' })
|
|
439
|
+
|
|
440
|
+
// Outcome-Program Association (Many-to-One)
|
|
441
|
+
outcomeEntity.addAssociation(
|
|
442
|
+
{ key: programEntity.key },
|
|
443
|
+
{
|
|
444
|
+
info: { name: 'program', displayName: 'Program', description: 'Program for this outcome' },
|
|
445
|
+
required: true,
|
|
446
|
+
multiple: false,
|
|
447
|
+
}
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
//
|
|
451
|
+
// 3. VOLUNTEER MANAGEMENT NAMESPACE
|
|
452
|
+
//
|
|
453
|
+
const volunteerManagement = domain.addNamespace({
|
|
454
|
+
info: {
|
|
455
|
+
name: 'VolunteerManagement',
|
|
456
|
+
displayName: 'Volunteer Management',
|
|
457
|
+
description: 'Volunteers, opportunities, and scheduling',
|
|
458
|
+
},
|
|
459
|
+
})
|
|
460
|
+
|
|
461
|
+
// Volunteer Model
|
|
462
|
+
const volunteerModel = volunteerManagement.addModel({
|
|
463
|
+
info: {
|
|
464
|
+
name: 'Volunteers',
|
|
465
|
+
displayName: 'Volunteer Management',
|
|
466
|
+
description: 'Volunteer profiles and opportunities',
|
|
467
|
+
},
|
|
468
|
+
})
|
|
469
|
+
|
|
470
|
+
// Volunteer Entity
|
|
471
|
+
const volunteerEntity = volunteerModel.addEntity({
|
|
472
|
+
info: {
|
|
473
|
+
name: 'volunteer',
|
|
474
|
+
displayName: 'Volunteer',
|
|
475
|
+
description: 'Volunteer with profile and skills',
|
|
476
|
+
},
|
|
477
|
+
})
|
|
478
|
+
|
|
479
|
+
addIdField(volunteerEntity, { displayName: 'Volunteer ID', description: 'Unique identifier for the volunteer' })
|
|
480
|
+
|
|
481
|
+
addNameField(volunteerEntity, { description: 'Volunteer name and title' })
|
|
482
|
+
|
|
483
|
+
addDescriptionField(volunteerEntity, { description: 'Volunteer description and notes' })
|
|
484
|
+
|
|
485
|
+
addEmailField(volunteerEntity, { description: 'Volunteer email address' })
|
|
486
|
+
|
|
487
|
+
addPhoneField(volunteerEntity, { description: 'Volunteer phone number' })
|
|
488
|
+
|
|
489
|
+
volunteerEntity.addProperty({
|
|
490
|
+
info: { name: 'volunteer_type', displayName: 'Volunteer Type', description: 'Type of volunteer' },
|
|
491
|
+
type: 'string',
|
|
492
|
+
required: true,
|
|
493
|
+
schema: {
|
|
494
|
+
enum: ['individual', 'corporate', 'student', 'retired', 'professional'],
|
|
495
|
+
},
|
|
496
|
+
})
|
|
497
|
+
|
|
498
|
+
volunteerEntity.addProperty({
|
|
499
|
+
info: { name: 'skills', displayName: 'Skills', description: 'Volunteer skills and expertise' },
|
|
500
|
+
type: 'string',
|
|
501
|
+
required: false,
|
|
502
|
+
})
|
|
503
|
+
|
|
504
|
+
volunteerEntity.addProperty({
|
|
505
|
+
info: { name: 'availability', displayName: 'Availability', description: 'Volunteer availability' },
|
|
506
|
+
type: 'string',
|
|
507
|
+
required: false,
|
|
508
|
+
})
|
|
509
|
+
|
|
510
|
+
addCustomStatusField(volunteerEntity, ['active', 'inactive', 'pending', 'suspended'], {
|
|
511
|
+
displayName: 'Volunteer Status',
|
|
512
|
+
description: 'Current status of the volunteer',
|
|
513
|
+
})
|
|
514
|
+
|
|
515
|
+
addCreatedAtField(volunteerEntity, { description: 'When the volunteer record was created' })
|
|
516
|
+
addUpdatedAtField(volunteerEntity, { description: 'When the volunteer record was last updated' })
|
|
517
|
+
|
|
518
|
+
// Opportunity Entity
|
|
519
|
+
const opportunityEntity = volunteerModel.addEntity({
|
|
520
|
+
info: {
|
|
521
|
+
name: 'opportunity',
|
|
522
|
+
displayName: 'Opportunity',
|
|
523
|
+
description: 'Volunteer opportunity',
|
|
524
|
+
},
|
|
525
|
+
})
|
|
526
|
+
|
|
527
|
+
addIdField(opportunityEntity, {
|
|
528
|
+
displayName: 'Opportunity ID',
|
|
529
|
+
description: 'Unique identifier for the opportunity',
|
|
530
|
+
})
|
|
531
|
+
|
|
532
|
+
addNameField(opportunityEntity, { description: 'Opportunity name and title' })
|
|
533
|
+
|
|
534
|
+
addDescriptionField(opportunityEntity, { description: 'Opportunity description and requirements' })
|
|
535
|
+
|
|
536
|
+
opportunityEntity.addProperty({
|
|
537
|
+
info: { name: 'opportunity_type', displayName: 'Opportunity Type', description: 'Type of opportunity' },
|
|
538
|
+
type: 'string',
|
|
539
|
+
required: true,
|
|
540
|
+
schema: {
|
|
541
|
+
enum: ['event_support', 'program_delivery', 'administrative', 'fundraising', 'mentoring', 'outreach'],
|
|
542
|
+
},
|
|
543
|
+
})
|
|
544
|
+
|
|
545
|
+
opportunityEntity.addProperty({
|
|
546
|
+
info: { name: 'location', displayName: 'Location', description: 'Opportunity location' },
|
|
547
|
+
type: 'string',
|
|
548
|
+
required: false,
|
|
549
|
+
})
|
|
550
|
+
|
|
551
|
+
opportunityEntity.addProperty({
|
|
552
|
+
info: { name: 'required_skills', displayName: 'Required Skills', description: 'Skills required for opportunity' },
|
|
553
|
+
type: 'string',
|
|
554
|
+
required: false,
|
|
555
|
+
})
|
|
556
|
+
|
|
557
|
+
opportunityEntity.addProperty({
|
|
558
|
+
info: { name: 'duration', displayName: 'Duration', description: 'Opportunity duration' },
|
|
559
|
+
type: 'string',
|
|
560
|
+
required: false,
|
|
561
|
+
})
|
|
562
|
+
|
|
563
|
+
addCustomStatusField(opportunityEntity, ['open', 'filled', 'closed', 'cancelled'], {
|
|
564
|
+
displayName: 'Opportunity Status',
|
|
565
|
+
description: 'Current status of the opportunity',
|
|
566
|
+
})
|
|
567
|
+
|
|
568
|
+
addCreatedAtField(opportunityEntity, { description: 'When the opportunity was created' })
|
|
569
|
+
|
|
570
|
+
// Opportunity-Program Association (Many-to-One)
|
|
571
|
+
opportunityEntity.addAssociation(
|
|
572
|
+
{ key: programEntity.key },
|
|
573
|
+
{
|
|
574
|
+
info: { name: 'program', displayName: 'Program', description: 'Program for this opportunity' },
|
|
575
|
+
required: false,
|
|
576
|
+
multiple: false,
|
|
577
|
+
}
|
|
578
|
+
)
|
|
579
|
+
|
|
580
|
+
// Volunteer Assignment Entity
|
|
581
|
+
const volunteerAssignmentEntity = volunteerModel.addEntity({
|
|
582
|
+
info: {
|
|
583
|
+
name: 'volunteer_assignment',
|
|
584
|
+
displayName: 'Volunteer Assignment',
|
|
585
|
+
description: 'Volunteer assignments and scheduling',
|
|
586
|
+
},
|
|
587
|
+
})
|
|
588
|
+
|
|
589
|
+
addIdField(volunteerAssignmentEntity, {
|
|
590
|
+
displayName: 'Assignment ID',
|
|
591
|
+
description: 'Unique identifier for the volunteer assignment',
|
|
592
|
+
})
|
|
593
|
+
|
|
594
|
+
addNameField(volunteerAssignmentEntity, { description: 'Assignment name and description' })
|
|
595
|
+
|
|
596
|
+
volunteerAssignmentEntity.addProperty({
|
|
597
|
+
info: { name: 'assignment_date', displayName: 'Assignment Date', description: 'Assignment date' },
|
|
598
|
+
type: 'date',
|
|
599
|
+
required: true,
|
|
600
|
+
})
|
|
601
|
+
|
|
602
|
+
volunteerAssignmentEntity.addProperty({
|
|
603
|
+
info: { name: 'start_time', displayName: 'Start Time', description: 'Assignment start time' },
|
|
604
|
+
type: 'time',
|
|
605
|
+
required: true,
|
|
606
|
+
})
|
|
607
|
+
|
|
608
|
+
volunteerAssignmentEntity.addProperty({
|
|
609
|
+
info: { name: 'end_time', displayName: 'End Time', description: 'Assignment end time' },
|
|
610
|
+
type: 'time',
|
|
611
|
+
required: true,
|
|
612
|
+
})
|
|
613
|
+
|
|
614
|
+
volunteerAssignmentEntity.addProperty({
|
|
615
|
+
info: { name: 'hours_worked', displayName: 'Hours Worked', description: 'Hours worked on assignment' },
|
|
616
|
+
type: 'number',
|
|
617
|
+
required: false,
|
|
618
|
+
schema: {
|
|
619
|
+
minimum: 0,
|
|
620
|
+
},
|
|
621
|
+
})
|
|
622
|
+
|
|
623
|
+
addCustomStatusField(volunteerAssignmentEntity, ['scheduled', 'in_progress', 'completed', 'cancelled'], {
|
|
624
|
+
displayName: 'Assignment Status',
|
|
625
|
+
description: 'Current status of the volunteer assignment',
|
|
626
|
+
})
|
|
627
|
+
|
|
628
|
+
addCreatedAtField(volunteerAssignmentEntity, { description: 'When the assignment was created' })
|
|
629
|
+
|
|
630
|
+
// VolunteerAssignment-Volunteer Association (Many-to-One)
|
|
631
|
+
volunteerAssignmentEntity.addAssociation(
|
|
632
|
+
{ key: volunteerEntity.key },
|
|
633
|
+
{
|
|
634
|
+
info: { name: 'volunteer', displayName: 'Volunteer', description: 'Volunteer for this assignment' },
|
|
635
|
+
required: true,
|
|
636
|
+
multiple: false,
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
// VolunteerAssignment-Opportunity Association (Many-to-One)
|
|
641
|
+
volunteerAssignmentEntity.addAssociation(
|
|
642
|
+
{ key: opportunityEntity.key },
|
|
643
|
+
{
|
|
644
|
+
info: { name: 'opportunity', displayName: 'Opportunity', description: 'Opportunity for this assignment' },
|
|
645
|
+
required: true,
|
|
646
|
+
multiple: false,
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
//
|
|
651
|
+
// 4. GRANT MANAGEMENT NAMESPACE
|
|
652
|
+
//
|
|
653
|
+
const grantManagement = domain.addNamespace({
|
|
654
|
+
info: {
|
|
655
|
+
name: 'GrantManagement',
|
|
656
|
+
displayName: 'Grant Management',
|
|
657
|
+
description: 'Grants, applications, reporting, and compliance',
|
|
658
|
+
},
|
|
659
|
+
})
|
|
660
|
+
|
|
661
|
+
// Grant Model
|
|
662
|
+
const grantModel = grantManagement.addModel({
|
|
663
|
+
info: {
|
|
664
|
+
name: 'Grants',
|
|
665
|
+
displayName: 'Grant Management',
|
|
666
|
+
description: 'Grant applications and management',
|
|
667
|
+
},
|
|
668
|
+
})
|
|
669
|
+
|
|
670
|
+
// Grant Entity
|
|
671
|
+
const grantEntity = grantModel.addEntity({
|
|
672
|
+
info: {
|
|
673
|
+
name: 'grant',
|
|
674
|
+
displayName: 'Grant',
|
|
675
|
+
description: 'Grant application or award',
|
|
676
|
+
},
|
|
677
|
+
})
|
|
678
|
+
|
|
679
|
+
addIdField(grantEntity, { displayName: 'Grant ID', description: 'Unique identifier for the grant' })
|
|
680
|
+
|
|
681
|
+
addNameField(grantEntity, { description: 'Grant name and title' })
|
|
682
|
+
|
|
683
|
+
addDescriptionField(grantEntity, { description: 'Grant description and objectives' })
|
|
684
|
+
|
|
685
|
+
grantEntity.addProperty({
|
|
686
|
+
info: { name: 'grant_type', displayName: 'Grant Type', description: 'Type of grant' },
|
|
687
|
+
type: 'string',
|
|
688
|
+
required: true,
|
|
689
|
+
schema: {
|
|
690
|
+
enum: ['program', 'operating', 'capital', 'research', 'emergency', 'matching'],
|
|
691
|
+
},
|
|
692
|
+
})
|
|
693
|
+
|
|
694
|
+
grantEntity.addProperty({
|
|
695
|
+
info: { name: 'funder', displayName: 'Funder', description: 'Grant funder or foundation' },
|
|
696
|
+
type: 'string',
|
|
697
|
+
required: true,
|
|
698
|
+
})
|
|
699
|
+
|
|
700
|
+
grantEntity.addProperty({
|
|
701
|
+
info: { name: 'application_date', displayName: 'Application Date', description: 'Grant application date' },
|
|
702
|
+
type: 'date',
|
|
703
|
+
required: true,
|
|
704
|
+
})
|
|
705
|
+
|
|
706
|
+
grantEntity.addProperty({
|
|
707
|
+
info: { name: 'decision_date', displayName: 'Decision Date', description: 'Grant decision date' },
|
|
708
|
+
type: 'date',
|
|
709
|
+
required: false,
|
|
710
|
+
})
|
|
711
|
+
|
|
712
|
+
addCurrencyAmountField(grantEntity, 'requested_amount', 'Requested Amount', {
|
|
713
|
+
description: 'Amount requested in grant',
|
|
714
|
+
})
|
|
715
|
+
|
|
716
|
+
addCurrencyAmountField(grantEntity, 'awarded_amount', 'Awarded Amount', {
|
|
717
|
+
description: 'Amount awarded in grant',
|
|
718
|
+
})
|
|
719
|
+
|
|
720
|
+
addCustomStatusField(
|
|
721
|
+
grantEntity,
|
|
722
|
+
['draft', 'submitted', 'under_review', 'approved', 'rejected', 'active', 'completed'],
|
|
723
|
+
{
|
|
724
|
+
displayName: 'Grant Status',
|
|
725
|
+
description: 'Current status of the grant',
|
|
726
|
+
}
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
addCreatedAtField(grantEntity, { description: 'When the grant was created' })
|
|
730
|
+
|
|
731
|
+
// Grant-Program Association (Many-to-One)
|
|
732
|
+
grantEntity.addAssociation(
|
|
733
|
+
{ key: programEntity.key },
|
|
734
|
+
{
|
|
735
|
+
info: { name: 'program', displayName: 'Program', description: 'Program for this grant' },
|
|
736
|
+
required: true,
|
|
737
|
+
multiple: false,
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
// Grant Report Entity
|
|
742
|
+
const grantReportEntity = grantModel.addEntity({
|
|
743
|
+
info: {
|
|
744
|
+
name: 'grant_report',
|
|
745
|
+
displayName: 'Grant Report',
|
|
746
|
+
description: 'Grant reporting and compliance',
|
|
747
|
+
},
|
|
748
|
+
})
|
|
749
|
+
|
|
750
|
+
addIdField(grantReportEntity, {
|
|
751
|
+
displayName: 'Report ID',
|
|
752
|
+
description: 'Unique identifier for the grant report',
|
|
753
|
+
})
|
|
754
|
+
|
|
755
|
+
addNameField(grantReportEntity, { description: 'Report name and title' })
|
|
756
|
+
|
|
757
|
+
addDescriptionField(grantReportEntity, { description: 'Report description and content' })
|
|
758
|
+
|
|
759
|
+
grantReportEntity.addProperty({
|
|
760
|
+
info: { name: 'report_type', displayName: 'Report Type', description: 'Type of grant report' },
|
|
761
|
+
type: 'string',
|
|
762
|
+
required: true,
|
|
763
|
+
schema: {
|
|
764
|
+
enum: ['progress', 'final', 'financial', 'narrative', 'compliance'],
|
|
765
|
+
},
|
|
766
|
+
})
|
|
767
|
+
|
|
768
|
+
grantReportEntity.addProperty({
|
|
769
|
+
info: { name: 'due_date', displayName: 'Due Date', description: 'Report due date' },
|
|
770
|
+
type: 'date',
|
|
771
|
+
required: true,
|
|
772
|
+
})
|
|
773
|
+
|
|
774
|
+
grantReportEntity.addProperty({
|
|
775
|
+
info: { name: 'submission_date', displayName: 'Submission Date', description: 'Report submission date' },
|
|
776
|
+
type: 'date',
|
|
777
|
+
required: false,
|
|
778
|
+
})
|
|
779
|
+
|
|
780
|
+
addCustomStatusField(grantReportEntity, ['draft', 'submitted', 'approved', 'revision_requested'], {
|
|
781
|
+
displayName: 'Report Status',
|
|
782
|
+
description: 'Current status of the grant report',
|
|
783
|
+
})
|
|
784
|
+
|
|
785
|
+
addCreatedAtField(grantReportEntity, { description: 'When the report was created' })
|
|
786
|
+
|
|
787
|
+
// GrantReport-Grant Association (Many-to-One)
|
|
788
|
+
grantReportEntity.addAssociation(
|
|
789
|
+
{ key: grantEntity.key },
|
|
790
|
+
{
|
|
791
|
+
info: { name: 'grant', displayName: 'Grant', description: 'Grant for this report' },
|
|
792
|
+
required: true,
|
|
793
|
+
multiple: false,
|
|
794
|
+
}
|
|
795
|
+
)
|
|
796
|
+
|
|
797
|
+
//
|
|
798
|
+
// 5. EVENT MANAGEMENT NAMESPACE
|
|
799
|
+
//
|
|
800
|
+
const eventManagement = domain.addNamespace({
|
|
801
|
+
info: {
|
|
802
|
+
name: 'EventManagement',
|
|
803
|
+
displayName: 'Event Management',
|
|
804
|
+
description: 'Fundraising events, registrations, and logistics',
|
|
805
|
+
},
|
|
806
|
+
})
|
|
807
|
+
|
|
808
|
+
// Event Model
|
|
809
|
+
const eventModel = eventManagement.addModel({
|
|
810
|
+
info: {
|
|
811
|
+
name: 'Events',
|
|
812
|
+
displayName: 'Event Management',
|
|
813
|
+
description: 'Fundraising events and activities',
|
|
814
|
+
},
|
|
815
|
+
})
|
|
816
|
+
|
|
817
|
+
// Event Entity
|
|
818
|
+
const eventEntity = eventModel.addEntity({
|
|
819
|
+
info: {
|
|
820
|
+
name: 'event',
|
|
821
|
+
displayName: 'Event',
|
|
822
|
+
description: 'Fundraising event or activity',
|
|
823
|
+
},
|
|
824
|
+
})
|
|
825
|
+
|
|
826
|
+
addIdField(eventEntity, { displayName: 'Event ID', description: 'Unique identifier for the event' })
|
|
827
|
+
|
|
828
|
+
addNameField(eventEntity, { description: 'Event name and title' })
|
|
829
|
+
|
|
830
|
+
addDescriptionField(eventEntity, { description: 'Event description and details' })
|
|
831
|
+
|
|
832
|
+
eventEntity.addProperty({
|
|
833
|
+
info: { name: 'event_type', displayName: 'Event Type', description: 'Type of event' },
|
|
834
|
+
type: 'string',
|
|
835
|
+
required: true,
|
|
836
|
+
schema: {
|
|
837
|
+
enum: ['gala', 'auction', 'walk_run', 'golf_tournament', 'conference', 'workshop', 'volunteer_day'],
|
|
838
|
+
},
|
|
839
|
+
})
|
|
840
|
+
|
|
841
|
+
eventEntity.addProperty({
|
|
842
|
+
info: { name: 'event_date', displayName: 'Event Date', description: 'Event date' },
|
|
843
|
+
type: 'date',
|
|
844
|
+
required: true,
|
|
845
|
+
})
|
|
846
|
+
|
|
847
|
+
eventEntity.addProperty({
|
|
848
|
+
info: { name: 'start_time', displayName: 'Start Time', description: 'Event start time' },
|
|
849
|
+
type: 'time',
|
|
850
|
+
required: true,
|
|
851
|
+
})
|
|
852
|
+
|
|
853
|
+
eventEntity.addProperty({
|
|
854
|
+
info: { name: 'end_time', displayName: 'End Time', description: 'Event end time' },
|
|
855
|
+
type: 'time',
|
|
856
|
+
required: false,
|
|
857
|
+
})
|
|
858
|
+
|
|
859
|
+
eventEntity.addProperty({
|
|
860
|
+
info: { name: 'location', displayName: 'Location', description: 'Event location' },
|
|
861
|
+
type: 'string',
|
|
862
|
+
required: true,
|
|
863
|
+
})
|
|
864
|
+
|
|
865
|
+
eventEntity.addProperty({
|
|
866
|
+
info: { name: 'capacity', displayName: 'Capacity', description: 'Event capacity' },
|
|
867
|
+
type: 'number',
|
|
868
|
+
required: false,
|
|
869
|
+
schema: {
|
|
870
|
+
minimum: 1,
|
|
871
|
+
},
|
|
872
|
+
})
|
|
873
|
+
|
|
874
|
+
addCurrencyAmountField(eventEntity, 'goal_amount', 'Goal Amount', {
|
|
875
|
+
description: 'Event fundraising goal',
|
|
876
|
+
})
|
|
877
|
+
|
|
878
|
+
addCurrencyAmountField(eventEntity, 'raised_amount', 'Raised Amount', {
|
|
879
|
+
description: 'Amount raised from event',
|
|
880
|
+
})
|
|
881
|
+
|
|
882
|
+
addCustomStatusField(
|
|
883
|
+
eventEntity,
|
|
884
|
+
['planning', 'registration_open', 'registration_closed', 'in_progress', 'completed', 'cancelled'],
|
|
885
|
+
{
|
|
886
|
+
displayName: 'Event Status',
|
|
887
|
+
description: 'Current status of the event',
|
|
888
|
+
}
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
addCreatedAtField(eventEntity, { description: 'When the event was created' })
|
|
892
|
+
|
|
893
|
+
// Registration Entity
|
|
894
|
+
const registrationEntity = eventModel.addEntity({
|
|
895
|
+
info: {
|
|
896
|
+
name: 'registration',
|
|
897
|
+
displayName: 'Registration',
|
|
898
|
+
description: 'Event registration',
|
|
899
|
+
},
|
|
900
|
+
})
|
|
901
|
+
|
|
902
|
+
addIdField(registrationEntity, {
|
|
903
|
+
displayName: 'Registration ID',
|
|
904
|
+
description: 'Unique identifier for the registration',
|
|
905
|
+
})
|
|
906
|
+
|
|
907
|
+
addNameField(registrationEntity, { description: 'Registration name and description' })
|
|
908
|
+
|
|
909
|
+
registrationEntity.addProperty({
|
|
910
|
+
info: { name: 'registration_date', displayName: 'Registration Date', description: 'Registration date' },
|
|
911
|
+
type: 'date',
|
|
912
|
+
required: true,
|
|
913
|
+
})
|
|
914
|
+
|
|
915
|
+
registrationEntity.addProperty({
|
|
916
|
+
info: { name: 'registration_type', displayName: 'Registration Type', description: 'Type of registration' },
|
|
917
|
+
type: 'string',
|
|
918
|
+
required: true,
|
|
919
|
+
schema: {
|
|
920
|
+
enum: ['individual', 'group', 'sponsor', 'volunteer'],
|
|
921
|
+
},
|
|
922
|
+
})
|
|
923
|
+
|
|
924
|
+
registrationEntity.addProperty({
|
|
925
|
+
info: { name: 'number_of_attendees', displayName: 'Number of Attendees', description: 'Number of attendees' },
|
|
926
|
+
type: 'number',
|
|
927
|
+
required: true,
|
|
928
|
+
schema: {
|
|
929
|
+
minimum: 1,
|
|
930
|
+
},
|
|
931
|
+
})
|
|
932
|
+
|
|
933
|
+
addCurrencyAmountField(registrationEntity, 'registration_fee', 'Registration Fee', {
|
|
934
|
+
description: 'Registration fee amount',
|
|
935
|
+
})
|
|
936
|
+
|
|
937
|
+
addCustomStatusField(registrationEntity, ['pending', 'confirmed', 'cancelled', 'attended'], {
|
|
938
|
+
displayName: 'Registration Status',
|
|
939
|
+
description: 'Current status of the registration',
|
|
940
|
+
})
|
|
941
|
+
|
|
942
|
+
addCreatedAtField(registrationEntity, { description: 'When the registration was created' })
|
|
943
|
+
|
|
944
|
+
// Registration-Event Association (Many-to-One)
|
|
945
|
+
registrationEntity.addAssociation(
|
|
946
|
+
{ key: eventEntity.key },
|
|
947
|
+
{
|
|
948
|
+
info: { name: 'event', displayName: 'Event', description: 'Event for this registration' },
|
|
949
|
+
required: true,
|
|
950
|
+
multiple: false,
|
|
951
|
+
}
|
|
952
|
+
)
|
|
953
|
+
|
|
954
|
+
// Registration-Donor Association (Many-to-One)
|
|
955
|
+
registrationEntity.addAssociation(
|
|
956
|
+
{ key: donorEntity.key },
|
|
957
|
+
{
|
|
958
|
+
info: { name: 'donor', displayName: 'Donor', description: 'Donor for this registration' },
|
|
959
|
+
required: true,
|
|
960
|
+
multiple: false,
|
|
961
|
+
}
|
|
962
|
+
)
|
|
963
|
+
|
|
964
|
+
//
|
|
965
|
+
// 6. FINANCIAL MANAGEMENT NAMESPACE
|
|
966
|
+
//
|
|
967
|
+
const financialManagement = domain.addNamespace({
|
|
968
|
+
info: {
|
|
969
|
+
name: 'FinancialManagement',
|
|
970
|
+
displayName: 'Financial Management',
|
|
971
|
+
description: 'Budgets, expenses, and reporting',
|
|
972
|
+
},
|
|
973
|
+
})
|
|
974
|
+
|
|
975
|
+
// Financial Model
|
|
976
|
+
const financialModel = financialManagement.addModel({
|
|
977
|
+
info: {
|
|
978
|
+
name: 'Financial',
|
|
979
|
+
displayName: 'Financial Management',
|
|
980
|
+
description: 'Financial management and reporting',
|
|
981
|
+
},
|
|
982
|
+
})
|
|
983
|
+
|
|
984
|
+
// Budget Entity
|
|
985
|
+
const budgetEntity = financialModel.addEntity({
|
|
986
|
+
info: {
|
|
987
|
+
name: 'budget',
|
|
988
|
+
displayName: 'Budget',
|
|
989
|
+
description: 'Organization budget',
|
|
990
|
+
},
|
|
991
|
+
})
|
|
992
|
+
|
|
993
|
+
addIdField(budgetEntity, { displayName: 'Budget ID', description: 'Unique identifier for the budget' })
|
|
994
|
+
|
|
995
|
+
addNameField(budgetEntity, { description: 'Budget name and description' })
|
|
996
|
+
|
|
997
|
+
addDescriptionField(budgetEntity, { description: 'Budget description and notes' })
|
|
998
|
+
|
|
999
|
+
budgetEntity.addProperty({
|
|
1000
|
+
info: { name: 'budget_type', displayName: 'Budget Type', description: 'Type of budget' },
|
|
1001
|
+
type: 'string',
|
|
1002
|
+
required: true,
|
|
1003
|
+
schema: {
|
|
1004
|
+
enum: ['operating', 'program', 'capital', 'project', 'department'],
|
|
1005
|
+
},
|
|
1006
|
+
})
|
|
1007
|
+
|
|
1008
|
+
budgetEntity.addProperty({
|
|
1009
|
+
info: { name: 'fiscal_year', displayName: 'Fiscal Year', description: 'Budget fiscal year' },
|
|
1010
|
+
type: 'string',
|
|
1011
|
+
required: true,
|
|
1012
|
+
})
|
|
1013
|
+
|
|
1014
|
+
budgetEntity.addProperty({
|
|
1015
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Budget start date' },
|
|
1016
|
+
type: 'date',
|
|
1017
|
+
required: true,
|
|
1018
|
+
})
|
|
1019
|
+
|
|
1020
|
+
budgetEntity.addProperty({
|
|
1021
|
+
info: { name: 'end_date', displayName: 'End Date', description: 'Budget end date' },
|
|
1022
|
+
type: 'date',
|
|
1023
|
+
required: true,
|
|
1024
|
+
})
|
|
1025
|
+
|
|
1026
|
+
addCurrencyAmountField(budgetEntity, 'total_budget', 'Total Budget', {
|
|
1027
|
+
description: 'Total budget amount',
|
|
1028
|
+
})
|
|
1029
|
+
|
|
1030
|
+
addCurrencyAmountField(budgetEntity, 'spent_amount', 'Spent Amount', {
|
|
1031
|
+
description: 'Amount spent so far',
|
|
1032
|
+
})
|
|
1033
|
+
|
|
1034
|
+
addCustomStatusField(budgetEntity, ['draft', 'approved', 'active', 'closed'], {
|
|
1035
|
+
displayName: 'Budget Status',
|
|
1036
|
+
description: 'Current status of the budget',
|
|
1037
|
+
})
|
|
1038
|
+
|
|
1039
|
+
addCreatedAtField(budgetEntity, { description: 'When the budget was created' })
|
|
1040
|
+
|
|
1041
|
+
// Budget-Program Association (Many-to-One)
|
|
1042
|
+
budgetEntity.addAssociation(
|
|
1043
|
+
{ key: programEntity.key },
|
|
1044
|
+
{
|
|
1045
|
+
info: { name: 'program', displayName: 'Program', description: 'Program for this budget' },
|
|
1046
|
+
required: false,
|
|
1047
|
+
multiple: false,
|
|
1048
|
+
}
|
|
1049
|
+
)
|
|
1050
|
+
|
|
1051
|
+
// Expense Entity
|
|
1052
|
+
const expenseEntity = financialModel.addEntity({
|
|
1053
|
+
info: {
|
|
1054
|
+
name: 'expense',
|
|
1055
|
+
displayName: 'Expense',
|
|
1056
|
+
description: 'Organization expense',
|
|
1057
|
+
},
|
|
1058
|
+
})
|
|
1059
|
+
|
|
1060
|
+
addIdField(expenseEntity, { displayName: 'Expense ID', description: 'Unique identifier for the expense' })
|
|
1061
|
+
|
|
1062
|
+
addNameField(expenseEntity, { description: 'Expense name and description' })
|
|
1063
|
+
|
|
1064
|
+
addDescriptionField(expenseEntity, { description: 'Expense description and details' })
|
|
1065
|
+
|
|
1066
|
+
expenseEntity.addProperty({
|
|
1067
|
+
info: { name: 'expense_type', displayName: 'Expense Type', description: 'Type of expense' },
|
|
1068
|
+
type: 'string',
|
|
1069
|
+
required: true,
|
|
1070
|
+
schema: {
|
|
1071
|
+
enum: ['personnel', 'program', 'administrative', 'fundraising', 'facilities', 'equipment'],
|
|
1072
|
+
},
|
|
1073
|
+
})
|
|
1074
|
+
|
|
1075
|
+
expenseEntity.addProperty({
|
|
1076
|
+
info: { name: 'expense_date', displayName: 'Expense Date', description: 'Expense date' },
|
|
1077
|
+
type: 'date',
|
|
1078
|
+
required: true,
|
|
1079
|
+
})
|
|
1080
|
+
|
|
1081
|
+
expenseEntity.addProperty({
|
|
1082
|
+
info: { name: 'vendor', displayName: 'Vendor', description: 'Expense vendor' },
|
|
1083
|
+
type: 'string',
|
|
1084
|
+
required: false,
|
|
1085
|
+
})
|
|
1086
|
+
|
|
1087
|
+
addCurrencyAmountField(expenseEntity, 'amount', 'Expense Amount', {
|
|
1088
|
+
description: 'Expense amount',
|
|
1089
|
+
})
|
|
1090
|
+
|
|
1091
|
+
addCustomStatusField(expenseEntity, ['pending', 'approved', 'paid', 'rejected'], {
|
|
1092
|
+
displayName: 'Expense Status',
|
|
1093
|
+
description: 'Current status of the expense',
|
|
1094
|
+
})
|
|
1095
|
+
|
|
1096
|
+
addCreatedAtField(expenseEntity, { description: 'When the expense was created' })
|
|
1097
|
+
|
|
1098
|
+
// Expense-Budget Association (Many-to-One)
|
|
1099
|
+
expenseEntity.addAssociation(
|
|
1100
|
+
{ key: budgetEntity.key },
|
|
1101
|
+
{
|
|
1102
|
+
info: { name: 'budget', displayName: 'Budget', description: 'Budget for this expense' },
|
|
1103
|
+
required: true,
|
|
1104
|
+
multiple: false,
|
|
1105
|
+
}
|
|
1106
|
+
)
|
|
1107
|
+
|
|
1108
|
+
return domain
|
|
1109
|
+
}
|