@api-client/core 0.18.20 → 0.18.22
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 +21 -0
- package/build/src/modeling/templates/index.d.ts.map +1 -0
- package/build/src/modeling/templates/index.js +176 -0
- package/build/src/modeling/templates/index.js.map +1 -0
- package/build/src/modeling/templates/meta/blog-publishing-platform.json +1 -0
- package/build/src/modeling/templates/meta/ecommerce-platform.json +1 -0
- 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 +56 -0
- package/build/src/modeling/templates/meta/index.d.ts.map +1 -0
- package/build/src/modeling/templates/meta/index.js +120 -0
- package/build/src/modeling/templates/meta/index.js.map +1 -0
- 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 +55 -0
- package/build/src/modeling/templates/template-registry.d.ts.map +1 -0
- package/build/src/modeling/templates/template-registry.js +111 -0
- package/build/src/modeling/templates/template-registry.js.map +1 -0
- package/build/src/modeling/templates/types.d.ts +158 -0
- package/build/src/modeling/templates/types.d.ts.map +1 -1
- package/build/src/modeling/templates/types.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 +6 -6
- package/package.json +1 -1
- package/src/modeling/helpers/Intelisense.ts +1 -0
- package/src/modeling/templates/meta/blog-publishing-platform.json +1 -0
- package/src/modeling/templates/meta/ecommerce-platform.json +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 +260 -0
- package/src/modeling/templates/template-registry.ts +140 -0
- package/src/modeling/templates/types.ts +166 -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,727 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real Estate Data Domain Example
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates how to create a comprehensive real estate data domain
|
|
5
|
+
* using the API Client Core modeling system. It follows the business-first approach
|
|
6
|
+
* and demonstrates proper use of namespaces, models, entities, properties,
|
|
7
|
+
* associations, and semantic annotations.
|
|
8
|
+
*
|
|
9
|
+
* The example includes:
|
|
10
|
+
* - Property Management with listings, properties, amenities, and photos
|
|
11
|
+
* - Client Management with buyers, sellers, agents, and leads
|
|
12
|
+
* - Transaction Management with offers, contracts, closings, and escrow
|
|
13
|
+
* - Market Analysis with comps, market data, and pricing models
|
|
14
|
+
* - Document Management with contracts, disclosures, and legal documents
|
|
15
|
+
* - Marketing with lead generation, campaigns, and follow-ups
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { createRealEstateDomain } from './real-estate-domain.js'
|
|
20
|
+
*
|
|
21
|
+
* const domain = createRealEstateDomain()
|
|
22
|
+
* console.log('Real Estate domain created with', domain.graph.nodeCount(), 'nodes')
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import { DataDomain } from '../../../DataDomain.js';
|
|
26
|
+
import { addIdField, addNameField, addDescriptionField, addEmailField, addFirstNameField, addLastNameField, addPhoneField, addCustomStatusField, addCreatedAtField, addUpdatedAtField, addBooleanField, addCurrencyAmountField, } from '../../../helpers/Intelisense.js';
|
|
27
|
+
function createDomain() {
|
|
28
|
+
return new DataDomain({
|
|
29
|
+
info: {
|
|
30
|
+
name: 'Real Estate Management Platform',
|
|
31
|
+
displayName: 'Real Estate Management Platform',
|
|
32
|
+
description: 'A comprehensive real estate management platform with property management, client management, ' +
|
|
33
|
+
'transaction management, market analysis, and marketing features',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a comprehensive real estate data domain following domain-driven design principles.
|
|
39
|
+
*
|
|
40
|
+
* This function demonstrates the proper hierarchy and organization for a real estate platform:
|
|
41
|
+
* 1. Creates the root DataDomain for the real estate platform
|
|
42
|
+
* 2. Organizes functionality into logical namespaces (Property Management, Client Management, etc.)
|
|
43
|
+
* 3. Groups related entities into models within each namespace
|
|
44
|
+
* 4. Defines entities with proper semantic annotations for real estate workflows
|
|
45
|
+
* 5. Establishes associations with appropriate cardinality for property-client relationships
|
|
46
|
+
*
|
|
47
|
+
* @returns A fully configured DataDomain with all real estate entities and relationships
|
|
48
|
+
*/
|
|
49
|
+
export default function createRealEstateDomain(options = {}) {
|
|
50
|
+
// Ensure the root data domain
|
|
51
|
+
const domain = options.domain ?? createDomain();
|
|
52
|
+
//
|
|
53
|
+
// 1. PROPERTY MANAGEMENT NAMESPACE
|
|
54
|
+
//
|
|
55
|
+
const propertyManagement = domain.addNamespace({
|
|
56
|
+
info: {
|
|
57
|
+
name: 'PropertyManagement',
|
|
58
|
+
displayName: 'Property Management',
|
|
59
|
+
description: 'Listings, properties, amenities, and photos',
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
// Property Model
|
|
63
|
+
const propertyModel = propertyManagement.addModel({
|
|
64
|
+
info: {
|
|
65
|
+
name: 'Properties',
|
|
66
|
+
displayName: 'Property Management',
|
|
67
|
+
description: 'Property information and listings',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
// Property Entity
|
|
71
|
+
const propertyEntity = propertyModel.addEntity({
|
|
72
|
+
info: {
|
|
73
|
+
name: 'property',
|
|
74
|
+
displayName: 'Property',
|
|
75
|
+
description: 'Real estate property information',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
addIdField(propertyEntity, { displayName: 'Property ID', description: 'Unique identifier for the property' });
|
|
79
|
+
addNameField(propertyEntity, { displayName: 'Property Name', description: 'Name or title of the property' });
|
|
80
|
+
addDescriptionField(propertyEntity, { description: 'Property description and features' });
|
|
81
|
+
propertyEntity.addProperty({
|
|
82
|
+
info: { name: 'address', displayName: 'Address', description: 'Property street address' },
|
|
83
|
+
type: 'string',
|
|
84
|
+
required: true,
|
|
85
|
+
});
|
|
86
|
+
propertyEntity.addProperty({
|
|
87
|
+
info: { name: 'city', displayName: 'City', description: 'Property city' },
|
|
88
|
+
type: 'string',
|
|
89
|
+
required: true,
|
|
90
|
+
});
|
|
91
|
+
propertyEntity.addProperty({
|
|
92
|
+
info: { name: 'state', displayName: 'State', description: 'Property state' },
|
|
93
|
+
type: 'string',
|
|
94
|
+
required: true,
|
|
95
|
+
});
|
|
96
|
+
propertyEntity.addProperty({
|
|
97
|
+
info: { name: 'zip_code', displayName: 'ZIP Code', description: 'Property ZIP code' },
|
|
98
|
+
type: 'string',
|
|
99
|
+
required: true,
|
|
100
|
+
});
|
|
101
|
+
propertyEntity.addProperty({
|
|
102
|
+
info: { name: 'square_feet', displayName: 'Square Feet', description: 'Property square footage' },
|
|
103
|
+
type: 'number',
|
|
104
|
+
required: true,
|
|
105
|
+
schema: {
|
|
106
|
+
minimum: 0,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
propertyEntity.addProperty({
|
|
110
|
+
info: { name: 'bedrooms', displayName: 'Bedrooms', description: 'Number of bedrooms' },
|
|
111
|
+
type: 'number',
|
|
112
|
+
required: true,
|
|
113
|
+
schema: {
|
|
114
|
+
minimum: 0,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
propertyEntity.addProperty({
|
|
118
|
+
info: { name: 'bathrooms', displayName: 'Bathrooms', description: 'Number of bathrooms' },
|
|
119
|
+
type: 'number',
|
|
120
|
+
required: true,
|
|
121
|
+
schema: {
|
|
122
|
+
minimum: 0,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
propertyEntity.addProperty({
|
|
126
|
+
info: { name: 'property_type', displayName: 'Property Type', description: 'Type of real estate property' },
|
|
127
|
+
type: 'string',
|
|
128
|
+
required: true,
|
|
129
|
+
schema: {
|
|
130
|
+
enum: ['residential', 'commercial', 'industrial', 'land', 'mixed_use'],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
addCustomStatusField(propertyEntity, ['for_sale', 'for_rent', 'sold', 'rented', 'off_market'], {
|
|
134
|
+
displayName: 'Listing Status',
|
|
135
|
+
description: 'Current listing status of the property',
|
|
136
|
+
});
|
|
137
|
+
addCurrencyAmountField(propertyEntity, 'list_price', 'List Price', {
|
|
138
|
+
description: 'Listing price of the property',
|
|
139
|
+
});
|
|
140
|
+
addCurrencyAmountField(propertyEntity, 'market_value', 'Market Value', {
|
|
141
|
+
description: 'Estimated market value of the property',
|
|
142
|
+
});
|
|
143
|
+
addCreatedAtField(propertyEntity, { description: 'When the property was created' });
|
|
144
|
+
addUpdatedAtField(propertyEntity, { description: 'When the property was last updated' });
|
|
145
|
+
// Listing Entity
|
|
146
|
+
const listingEntity = propertyModel.addEntity({
|
|
147
|
+
info: {
|
|
148
|
+
name: 'listing',
|
|
149
|
+
displayName: 'Listing',
|
|
150
|
+
description: 'Property listing information',
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
addIdField(listingEntity, { displayName: 'Listing ID', description: 'Unique identifier for the listing' });
|
|
154
|
+
addNameField(listingEntity, { displayName: 'Listing Title', description: 'Title of the listing' });
|
|
155
|
+
addDescriptionField(listingEntity, { description: 'Listing description and details' });
|
|
156
|
+
addCurrencyAmountField(listingEntity, 'price', 'Listing Price', {
|
|
157
|
+
description: 'Price for the listing',
|
|
158
|
+
});
|
|
159
|
+
listingEntity.addProperty({
|
|
160
|
+
info: { name: 'list_date', displayName: 'List Date', description: 'Date when property was listed' },
|
|
161
|
+
type: 'date',
|
|
162
|
+
required: true,
|
|
163
|
+
});
|
|
164
|
+
addCustomStatusField(listingEntity, ['active', 'pending', 'sold', 'expired', 'withdrawn'], {
|
|
165
|
+
displayName: 'Listing Status',
|
|
166
|
+
description: 'Current status of the listing',
|
|
167
|
+
});
|
|
168
|
+
addCreatedAtField(listingEntity, { description: 'When the listing was created' });
|
|
169
|
+
// Listing-Property Association (Many-to-One)
|
|
170
|
+
listingEntity.addAssociation({ key: propertyEntity.key }, {
|
|
171
|
+
info: { name: 'property', displayName: 'Property', description: 'Property for this listing' },
|
|
172
|
+
required: true,
|
|
173
|
+
multiple: false,
|
|
174
|
+
});
|
|
175
|
+
// Amenity Entity
|
|
176
|
+
const amenityEntity = propertyModel.addEntity({
|
|
177
|
+
info: {
|
|
178
|
+
name: 'amenity',
|
|
179
|
+
displayName: 'Amenity',
|
|
180
|
+
description: 'Property amenities and features',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
addIdField(amenityEntity, { displayName: 'Amenity ID', description: 'Unique identifier for the amenity' });
|
|
184
|
+
addNameField(amenityEntity, { displayName: 'Amenity Name', description: 'Name of the amenity' });
|
|
185
|
+
addDescriptionField(amenityEntity, { description: 'Amenity description and details' });
|
|
186
|
+
amenityEntity.addProperty({
|
|
187
|
+
info: { name: 'amenity_type', displayName: 'Amenity Type', description: 'Type of amenity' },
|
|
188
|
+
type: 'string',
|
|
189
|
+
required: true,
|
|
190
|
+
schema: {
|
|
191
|
+
enum: ['interior', 'exterior', 'community', 'utilities'],
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
addBooleanField(amenityEntity, 'available', 'true', {
|
|
195
|
+
displayName: 'Available',
|
|
196
|
+
description: 'Whether the amenity is available',
|
|
197
|
+
});
|
|
198
|
+
addCreatedAtField(amenityEntity, { description: 'When the amenity was created' });
|
|
199
|
+
// Property-Amenity Association (Many-to-Many)
|
|
200
|
+
propertyEntity.addAssociation({ key: amenityEntity.key }, {
|
|
201
|
+
info: { name: 'amenities', displayName: 'Amenities', description: 'Amenities available at this property' },
|
|
202
|
+
required: false,
|
|
203
|
+
multiple: true,
|
|
204
|
+
});
|
|
205
|
+
// Photo Entity
|
|
206
|
+
const photoEntity = propertyModel.addEntity({
|
|
207
|
+
info: {
|
|
208
|
+
name: 'photo',
|
|
209
|
+
displayName: 'Photo',
|
|
210
|
+
description: 'Property photos and images',
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
addIdField(photoEntity, { displayName: 'Photo ID', description: 'Unique identifier for the photo' });
|
|
214
|
+
photoEntity.addProperty({
|
|
215
|
+
info: { name: 'url', displayName: 'Photo URL', description: 'URL to the photo' },
|
|
216
|
+
type: 'string',
|
|
217
|
+
required: true,
|
|
218
|
+
});
|
|
219
|
+
addNameField(photoEntity, { displayName: 'Photo Title', description: 'Title or caption for the photo' });
|
|
220
|
+
addDescriptionField(photoEntity, { description: 'Photo description and details' });
|
|
221
|
+
photoEntity.addProperty({
|
|
222
|
+
info: { name: 'photo_type', displayName: 'Photo Type', description: 'Type of property photo' },
|
|
223
|
+
type: 'string',
|
|
224
|
+
required: true,
|
|
225
|
+
schema: {
|
|
226
|
+
enum: ['exterior', 'interior', 'kitchen', 'bathroom', 'bedroom', 'living_room'],
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
addBooleanField(photoEntity, 'featured', 'false', {
|
|
230
|
+
displayName: 'Featured',
|
|
231
|
+
description: 'Whether this is a featured photo',
|
|
232
|
+
});
|
|
233
|
+
addCreatedAtField(photoEntity, { description: 'When the photo was created' });
|
|
234
|
+
// Property-Photo Association (One-to-Many)
|
|
235
|
+
propertyEntity.addAssociation({ key: photoEntity.key }, {
|
|
236
|
+
info: { name: 'photos', displayName: 'Photos', description: 'Photos of this property' },
|
|
237
|
+
required: false,
|
|
238
|
+
multiple: true,
|
|
239
|
+
});
|
|
240
|
+
//
|
|
241
|
+
// 2. CLIENT MANAGEMENT NAMESPACE
|
|
242
|
+
//
|
|
243
|
+
const clientManagement = domain.addNamespace({
|
|
244
|
+
info: {
|
|
245
|
+
name: 'ClientManagement',
|
|
246
|
+
displayName: 'Client Management',
|
|
247
|
+
description: 'Buyers, sellers, agents, and leads',
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
// Client Model
|
|
251
|
+
const clientModel = clientManagement.addModel({
|
|
252
|
+
info: {
|
|
253
|
+
name: 'Clients',
|
|
254
|
+
displayName: 'Client Management',
|
|
255
|
+
description: 'Client information and relationships',
|
|
256
|
+
},
|
|
257
|
+
});
|
|
258
|
+
// Client Entity
|
|
259
|
+
const clientEntity = clientModel.addEntity({
|
|
260
|
+
info: {
|
|
261
|
+
name: 'client',
|
|
262
|
+
displayName: 'Client',
|
|
263
|
+
description: 'Real estate client (buyer or seller)',
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
addIdField(clientEntity, { displayName: 'Client ID', description: 'Unique identifier for the client' });
|
|
267
|
+
addFirstNameField(clientEntity, { description: 'Client first name' });
|
|
268
|
+
addLastNameField(clientEntity, { description: 'Client last name' });
|
|
269
|
+
addEmailField(clientEntity, { description: 'Client email address' });
|
|
270
|
+
addPhoneField(clientEntity, { description: 'Client phone number' });
|
|
271
|
+
clientEntity.addProperty({
|
|
272
|
+
info: { name: 'client_type', displayName: 'Client Type', description: 'Type of client (buyer, seller, or both)' },
|
|
273
|
+
type: 'string',
|
|
274
|
+
required: true,
|
|
275
|
+
schema: {
|
|
276
|
+
enum: ['buyer', 'seller', 'both'],
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
addCustomStatusField(clientEntity, ['active', 'inactive', 'prospect', 'closed'], {
|
|
280
|
+
displayName: 'Client Status',
|
|
281
|
+
description: 'Current status of the client',
|
|
282
|
+
});
|
|
283
|
+
addCurrencyAmountField(clientEntity, 'budget_min', 'Minimum Budget', {
|
|
284
|
+
description: 'Minimum budget for property purchase',
|
|
285
|
+
});
|
|
286
|
+
addCurrencyAmountField(clientEntity, 'budget_max', 'Maximum Budget', {
|
|
287
|
+
description: 'Maximum budget for property purchase',
|
|
288
|
+
});
|
|
289
|
+
addCreatedAtField(clientEntity, { description: 'When the client was created' });
|
|
290
|
+
addUpdatedAtField(clientEntity, { description: 'When the client was last updated' });
|
|
291
|
+
// Agent Entity
|
|
292
|
+
const agentEntity = clientModel.addEntity({
|
|
293
|
+
info: {
|
|
294
|
+
name: 'agent',
|
|
295
|
+
displayName: 'Agent',
|
|
296
|
+
description: 'Real estate agent information',
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
addIdField(agentEntity, { displayName: 'Agent ID', description: 'Unique identifier for the agent' });
|
|
300
|
+
addFirstNameField(agentEntity, { description: 'Agent first name' });
|
|
301
|
+
addLastNameField(agentEntity, { description: 'Agent last name' });
|
|
302
|
+
addEmailField(agentEntity, { description: 'Agent email address' });
|
|
303
|
+
addPhoneField(agentEntity, { description: 'Agent phone number' });
|
|
304
|
+
agentEntity.addProperty({
|
|
305
|
+
info: { name: 'license_number', displayName: 'License Number', description: 'Real estate license number' },
|
|
306
|
+
type: 'string',
|
|
307
|
+
required: true,
|
|
308
|
+
unique: true,
|
|
309
|
+
});
|
|
310
|
+
addCustomStatusField(agentEntity, ['active', 'inactive', 'suspended'], {
|
|
311
|
+
displayName: 'Agent Status',
|
|
312
|
+
description: 'Current status of the agent',
|
|
313
|
+
});
|
|
314
|
+
addCreatedAtField(agentEntity, { description: 'When the agent was created' });
|
|
315
|
+
// Client-Agent Association (Many-to-One)
|
|
316
|
+
clientEntity.addAssociation({ key: agentEntity.key }, {
|
|
317
|
+
info: { name: 'agent', displayName: 'Agent', description: 'Agent representing this client' },
|
|
318
|
+
required: true,
|
|
319
|
+
multiple: false,
|
|
320
|
+
});
|
|
321
|
+
// Lead Entity
|
|
322
|
+
const leadEntity = clientModel.addEntity({
|
|
323
|
+
info: {
|
|
324
|
+
name: 'lead',
|
|
325
|
+
displayName: 'Lead',
|
|
326
|
+
description: 'Sales leads and prospects',
|
|
327
|
+
},
|
|
328
|
+
});
|
|
329
|
+
addIdField(leadEntity, { displayName: 'Lead ID', description: 'Unique identifier for the lead' });
|
|
330
|
+
addFirstNameField(leadEntity, { description: 'Lead first name' });
|
|
331
|
+
addLastNameField(leadEntity, { description: 'Lead last name' });
|
|
332
|
+
addEmailField(leadEntity, { description: 'Lead email address' });
|
|
333
|
+
addPhoneField(leadEntity, { description: 'Lead phone number' });
|
|
334
|
+
addCustomStatusField(leadEntity, ['new', 'contacted', 'qualified', 'converted', 'lost'], {
|
|
335
|
+
displayName: 'Lead Status',
|
|
336
|
+
description: 'Current status of the lead',
|
|
337
|
+
});
|
|
338
|
+
leadEntity.addProperty({
|
|
339
|
+
info: { name: 'lead_source', displayName: 'Lead Source', description: 'Source of the lead' },
|
|
340
|
+
type: 'string',
|
|
341
|
+
required: true,
|
|
342
|
+
schema: {
|
|
343
|
+
enum: ['website', 'referral', 'social_media', 'cold_call', 'event'],
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
addDescriptionField(leadEntity, { description: 'Lead notes and information' });
|
|
347
|
+
addCreatedAtField(leadEntity, { description: 'When the lead was created' });
|
|
348
|
+
// Lead-Agent Association (Many-to-One)
|
|
349
|
+
leadEntity.addAssociation({ key: agentEntity.key }, {
|
|
350
|
+
info: { name: 'agent', displayName: 'Agent', description: 'Agent assigned to this lead' },
|
|
351
|
+
required: true,
|
|
352
|
+
multiple: false,
|
|
353
|
+
});
|
|
354
|
+
//
|
|
355
|
+
// 3. TRANSACTION MANAGEMENT NAMESPACE
|
|
356
|
+
//
|
|
357
|
+
const transactionManagement = domain.addNamespace({
|
|
358
|
+
info: {
|
|
359
|
+
name: 'TransactionManagement',
|
|
360
|
+
displayName: 'Transaction Management',
|
|
361
|
+
description: 'Offers, contracts, closings, and escrow',
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
// Transaction Model
|
|
365
|
+
const transactionModel = transactionManagement.addModel({
|
|
366
|
+
info: {
|
|
367
|
+
name: 'Transactions',
|
|
368
|
+
displayName: 'Transaction Management',
|
|
369
|
+
description: 'Real estate transactions and deals',
|
|
370
|
+
},
|
|
371
|
+
});
|
|
372
|
+
// Offer Entity
|
|
373
|
+
const offerEntity = transactionModel.addEntity({
|
|
374
|
+
info: {
|
|
375
|
+
name: 'offer',
|
|
376
|
+
displayName: 'Offer',
|
|
377
|
+
description: 'Property purchase offers',
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
addIdField(offerEntity, { displayName: 'Offer ID', description: 'Unique identifier for the offer' });
|
|
381
|
+
addCurrencyAmountField(offerEntity, 'offer_price', 'Offer Price', {
|
|
382
|
+
description: 'Price offered for the property',
|
|
383
|
+
});
|
|
384
|
+
offerEntity.addProperty({
|
|
385
|
+
info: { name: 'offer_date', displayName: 'Offer Date', description: 'Date when offer was made' },
|
|
386
|
+
type: 'date',
|
|
387
|
+
required: true,
|
|
388
|
+
});
|
|
389
|
+
addCustomStatusField(offerEntity, ['pending', 'accepted', 'rejected', 'countered', 'withdrawn'], {
|
|
390
|
+
displayName: 'Offer Status',
|
|
391
|
+
description: 'Current status of the offer',
|
|
392
|
+
});
|
|
393
|
+
addDescriptionField(offerEntity, { description: 'Offer terms and conditions' });
|
|
394
|
+
addCreatedAtField(offerEntity, { description: 'When the offer was created' });
|
|
395
|
+
// Offer-Property Association (Many-to-One)
|
|
396
|
+
offerEntity.addAssociation({ key: propertyEntity.key }, {
|
|
397
|
+
info: { name: 'property', displayName: 'Property', description: 'Property for this offer' },
|
|
398
|
+
required: true,
|
|
399
|
+
multiple: false,
|
|
400
|
+
});
|
|
401
|
+
// Offer-Client Association (Many-to-One)
|
|
402
|
+
offerEntity.addAssociation({ key: clientEntity.key }, {
|
|
403
|
+
info: { name: 'buyer', displayName: 'Buyer', description: 'Buyer making this offer' },
|
|
404
|
+
required: true,
|
|
405
|
+
multiple: false,
|
|
406
|
+
});
|
|
407
|
+
// Contract Entity
|
|
408
|
+
const contractEntity = transactionModel.addEntity({
|
|
409
|
+
info: {
|
|
410
|
+
name: 'contract',
|
|
411
|
+
displayName: 'Contract',
|
|
412
|
+
description: 'Real estate purchase contracts',
|
|
413
|
+
},
|
|
414
|
+
});
|
|
415
|
+
addIdField(contractEntity, { displayName: 'Contract ID', description: 'Unique identifier for the contract' });
|
|
416
|
+
addCurrencyAmountField(contractEntity, 'purchase_price', 'Purchase Price', {
|
|
417
|
+
description: 'Final purchase price',
|
|
418
|
+
});
|
|
419
|
+
contractEntity.addProperty({
|
|
420
|
+
info: { name: 'contract_date', displayName: 'Contract Date', description: 'Date when contract was signed' },
|
|
421
|
+
type: 'date',
|
|
422
|
+
required: true,
|
|
423
|
+
});
|
|
424
|
+
contractEntity.addProperty({
|
|
425
|
+
info: { name: 'closing_date', displayName: 'Closing Date', description: 'Scheduled closing date' },
|
|
426
|
+
type: 'date',
|
|
427
|
+
required: true,
|
|
428
|
+
});
|
|
429
|
+
addCustomStatusField(contractEntity, ['draft', 'signed', 'pending', 'closed', 'cancelled'], {
|
|
430
|
+
displayName: 'Contract Status',
|
|
431
|
+
description: 'Current status of the contract',
|
|
432
|
+
});
|
|
433
|
+
addCreatedAtField(contractEntity, { description: 'When the contract was created' });
|
|
434
|
+
// Contract-Property Association (Many-to-One)
|
|
435
|
+
contractEntity.addAssociation({ key: propertyEntity.key }, {
|
|
436
|
+
info: { name: 'property', displayName: 'Property', description: 'Property in this contract' },
|
|
437
|
+
required: true,
|
|
438
|
+
multiple: false,
|
|
439
|
+
});
|
|
440
|
+
// Contract-Buyer Association (Many-to-One)
|
|
441
|
+
contractEntity.addAssociation({ key: clientEntity.key }, {
|
|
442
|
+
info: { name: 'buyer', displayName: 'Buyer', description: 'Buyer in this contract' },
|
|
443
|
+
required: true,
|
|
444
|
+
multiple: false,
|
|
445
|
+
});
|
|
446
|
+
// Contract-Seller Association (Many-to-One)
|
|
447
|
+
contractEntity.addAssociation({ key: clientEntity.key }, {
|
|
448
|
+
info: { name: 'seller', displayName: 'Seller', description: 'Seller in this contract' },
|
|
449
|
+
required: true,
|
|
450
|
+
multiple: false,
|
|
451
|
+
});
|
|
452
|
+
// Escrow Entity
|
|
453
|
+
const escrowEntity = transactionModel.addEntity({
|
|
454
|
+
info: {
|
|
455
|
+
name: 'escrow',
|
|
456
|
+
displayName: 'Escrow',
|
|
457
|
+
description: 'Escrow account and transaction details',
|
|
458
|
+
},
|
|
459
|
+
});
|
|
460
|
+
addIdField(escrowEntity, { displayName: 'Escrow ID', description: 'Unique identifier for the escrow' });
|
|
461
|
+
addCurrencyAmountField(escrowEntity, 'escrow_amount', 'Escrow Amount', {
|
|
462
|
+
description: 'Amount held in escrow',
|
|
463
|
+
});
|
|
464
|
+
escrowEntity.addProperty({
|
|
465
|
+
info: { name: 'escrow_date', displayName: 'Escrow Date', description: 'Date when escrow was opened' },
|
|
466
|
+
type: 'date',
|
|
467
|
+
required: true,
|
|
468
|
+
});
|
|
469
|
+
addCustomStatusField(escrowEntity, ['open', 'funded', 'closed', 'cancelled'], {
|
|
470
|
+
displayName: 'Escrow Status',
|
|
471
|
+
description: 'Current status of the escrow',
|
|
472
|
+
});
|
|
473
|
+
addCreatedAtField(escrowEntity, { description: 'When the escrow was created' });
|
|
474
|
+
// Escrow-Contract Association (Many-to-One)
|
|
475
|
+
escrowEntity.addAssociation({ key: contractEntity.key }, {
|
|
476
|
+
info: { name: 'contract', displayName: 'Contract', description: 'Contract for this escrow' },
|
|
477
|
+
required: true,
|
|
478
|
+
multiple: false,
|
|
479
|
+
});
|
|
480
|
+
//
|
|
481
|
+
// 4. MARKET ANALYSIS NAMESPACE
|
|
482
|
+
//
|
|
483
|
+
const marketAnalysis = domain.addNamespace({
|
|
484
|
+
info: {
|
|
485
|
+
name: 'MarketAnalysis',
|
|
486
|
+
displayName: 'Market Analysis',
|
|
487
|
+
description: 'Comps, market data, and pricing models',
|
|
488
|
+
},
|
|
489
|
+
});
|
|
490
|
+
// Market Model
|
|
491
|
+
const marketModel = marketAnalysis.addModel({
|
|
492
|
+
info: {
|
|
493
|
+
name: 'Market',
|
|
494
|
+
displayName: 'Market Analysis',
|
|
495
|
+
description: 'Market data and analysis',
|
|
496
|
+
},
|
|
497
|
+
});
|
|
498
|
+
// Market Data Entity
|
|
499
|
+
const marketDataEntity = marketModel.addEntity({
|
|
500
|
+
info: {
|
|
501
|
+
name: 'market_data',
|
|
502
|
+
displayName: 'Market Data',
|
|
503
|
+
description: 'Real estate market data and trends',
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
addIdField(marketDataEntity, { displayName: 'Market Data ID', description: 'Unique identifier for the market data' });
|
|
507
|
+
marketDataEntity.addProperty({
|
|
508
|
+
info: { name: 'area', displayName: 'Area', description: 'Geographic area for market data' },
|
|
509
|
+
type: 'string',
|
|
510
|
+
required: true,
|
|
511
|
+
});
|
|
512
|
+
marketDataEntity.addProperty({
|
|
513
|
+
info: { name: 'data_date', displayName: 'Data Date', description: 'Date of market data' },
|
|
514
|
+
type: 'date',
|
|
515
|
+
required: true,
|
|
516
|
+
});
|
|
517
|
+
addCurrencyAmountField(marketDataEntity, 'avg_price', 'Average Price', {
|
|
518
|
+
description: 'Average property price in the area',
|
|
519
|
+
});
|
|
520
|
+
marketDataEntity.addProperty({
|
|
521
|
+
info: { name: 'days_on_market', displayName: 'Days on Market', description: 'Average days on market' },
|
|
522
|
+
type: 'number',
|
|
523
|
+
required: true,
|
|
524
|
+
schema: {
|
|
525
|
+
minimum: 0,
|
|
526
|
+
},
|
|
527
|
+
});
|
|
528
|
+
marketDataEntity.addProperty({
|
|
529
|
+
info: { name: 'inventory_count', displayName: 'Inventory Count', description: 'Number of properties for sale' },
|
|
530
|
+
type: 'number',
|
|
531
|
+
required: true,
|
|
532
|
+
schema: {
|
|
533
|
+
minimum: 0,
|
|
534
|
+
},
|
|
535
|
+
});
|
|
536
|
+
addCreatedAtField(marketDataEntity, { description: 'When the market data was created' });
|
|
537
|
+
// Comparable Entity
|
|
538
|
+
const comparableEntity = marketModel.addEntity({
|
|
539
|
+
info: {
|
|
540
|
+
name: 'comparable',
|
|
541
|
+
displayName: 'Comparable',
|
|
542
|
+
description: 'Comparable property sales data',
|
|
543
|
+
},
|
|
544
|
+
});
|
|
545
|
+
addIdField(comparableEntity, { displayName: 'Comparable ID', description: 'Unique identifier for the comparable' });
|
|
546
|
+
addNameField(comparableEntity, {
|
|
547
|
+
displayName: 'Comparable Name',
|
|
548
|
+
description: 'Name or address of comparable property',
|
|
549
|
+
});
|
|
550
|
+
addCurrencyAmountField(comparableEntity, 'sale_price', 'Sale Price', {
|
|
551
|
+
description: 'Sale price of the comparable property',
|
|
552
|
+
});
|
|
553
|
+
comparableEntity.addProperty({
|
|
554
|
+
info: { name: 'sale_date', displayName: 'Sale Date', description: 'Date when comparable property sold' },
|
|
555
|
+
type: 'date',
|
|
556
|
+
required: true,
|
|
557
|
+
});
|
|
558
|
+
comparableEntity.addProperty({
|
|
559
|
+
info: { name: 'square_feet', displayName: 'Square Feet', description: 'Square footage of comparable property' },
|
|
560
|
+
type: 'number',
|
|
561
|
+
required: true,
|
|
562
|
+
schema: {
|
|
563
|
+
minimum: 0,
|
|
564
|
+
},
|
|
565
|
+
});
|
|
566
|
+
addCreatedAtField(comparableEntity, { description: 'When the comparable was created' });
|
|
567
|
+
// Comparable-Property Association (Many-to-One)
|
|
568
|
+
comparableEntity.addAssociation({ key: propertyEntity.key }, {
|
|
569
|
+
info: { name: 'property', displayName: 'Property', description: 'Property for this comparable' },
|
|
570
|
+
required: true,
|
|
571
|
+
multiple: false,
|
|
572
|
+
});
|
|
573
|
+
//
|
|
574
|
+
// 5. DOCUMENT MANAGEMENT NAMESPACE
|
|
575
|
+
//
|
|
576
|
+
const documentManagement = domain.addNamespace({
|
|
577
|
+
info: {
|
|
578
|
+
name: 'DocumentManagement',
|
|
579
|
+
displayName: 'Document Management',
|
|
580
|
+
description: 'Contracts, disclosures, and legal documents',
|
|
581
|
+
},
|
|
582
|
+
});
|
|
583
|
+
// Document Model
|
|
584
|
+
const documentModel = documentManagement.addModel({
|
|
585
|
+
info: {
|
|
586
|
+
name: 'Documents',
|
|
587
|
+
displayName: 'Document Management',
|
|
588
|
+
description: 'Document storage and management',
|
|
589
|
+
},
|
|
590
|
+
});
|
|
591
|
+
// Document Entity
|
|
592
|
+
const documentEntity = documentModel.addEntity({
|
|
593
|
+
info: {
|
|
594
|
+
name: 'document',
|
|
595
|
+
displayName: 'Document',
|
|
596
|
+
description: 'Legal documents and contracts',
|
|
597
|
+
},
|
|
598
|
+
});
|
|
599
|
+
addIdField(documentEntity, { displayName: 'Document ID', description: 'Unique identifier for the document' });
|
|
600
|
+
addNameField(documentEntity, { displayName: 'Document Name', description: 'Name of the document' });
|
|
601
|
+
addDescriptionField(documentEntity, { description: 'Document description and details' });
|
|
602
|
+
documentEntity.addProperty({
|
|
603
|
+
info: { name: 'file_url', displayName: 'File URL', description: 'URL to the document file' },
|
|
604
|
+
type: 'string',
|
|
605
|
+
required: true,
|
|
606
|
+
});
|
|
607
|
+
documentEntity.addProperty({
|
|
608
|
+
info: { name: 'document_type', displayName: 'Document Type', description: 'Type of document' },
|
|
609
|
+
type: 'string',
|
|
610
|
+
required: true,
|
|
611
|
+
schema: {
|
|
612
|
+
enum: ['contract', 'disclosure', 'inspection', 'appraisal', 'title', 'other'],
|
|
613
|
+
},
|
|
614
|
+
});
|
|
615
|
+
addCustomStatusField(documentEntity, ['draft', 'pending', 'signed', 'archived'], {
|
|
616
|
+
displayName: 'Document Status',
|
|
617
|
+
description: 'Current status of the document',
|
|
618
|
+
});
|
|
619
|
+
addCreatedAtField(documentEntity, { description: 'When the document was created' });
|
|
620
|
+
// Document-Contract Association (Many-to-One)
|
|
621
|
+
documentEntity.addAssociation({ key: contractEntity.key }, {
|
|
622
|
+
info: { name: 'contract', displayName: 'Contract', description: 'Contract for this document' },
|
|
623
|
+
required: false,
|
|
624
|
+
multiple: false,
|
|
625
|
+
});
|
|
626
|
+
// Document-Property Association (Many-to-One)
|
|
627
|
+
documentEntity.addAssociation({ key: propertyEntity.key }, {
|
|
628
|
+
info: { name: 'property', displayName: 'Property', description: 'Property for this document' },
|
|
629
|
+
required: false,
|
|
630
|
+
multiple: false,
|
|
631
|
+
});
|
|
632
|
+
//
|
|
633
|
+
// 6. MARKETING NAMESPACE
|
|
634
|
+
//
|
|
635
|
+
const marketing = domain.addNamespace({
|
|
636
|
+
info: {
|
|
637
|
+
name: 'Marketing',
|
|
638
|
+
displayName: 'Marketing',
|
|
639
|
+
description: 'Lead generation, campaigns, and follow-ups',
|
|
640
|
+
},
|
|
641
|
+
});
|
|
642
|
+
// Marketing Model
|
|
643
|
+
const marketingModel = marketing.addModel({
|
|
644
|
+
info: {
|
|
645
|
+
name: 'Marketing',
|
|
646
|
+
displayName: 'Marketing Management',
|
|
647
|
+
description: 'Marketing campaigns and activities',
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
// Campaign Entity
|
|
651
|
+
const campaignEntity = marketingModel.addEntity({
|
|
652
|
+
info: {
|
|
653
|
+
name: 'campaign',
|
|
654
|
+
displayName: 'Campaign',
|
|
655
|
+
description: 'Marketing campaigns and promotions',
|
|
656
|
+
},
|
|
657
|
+
});
|
|
658
|
+
addIdField(campaignEntity, { displayName: 'Campaign ID', description: 'Unique identifier for the campaign' });
|
|
659
|
+
addNameField(campaignEntity, { displayName: 'Campaign Name', description: 'Name of the marketing campaign' });
|
|
660
|
+
addDescriptionField(campaignEntity, { description: 'Campaign description and objectives' });
|
|
661
|
+
campaignEntity.addProperty({
|
|
662
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Campaign start date' },
|
|
663
|
+
type: 'date',
|
|
664
|
+
required: true,
|
|
665
|
+
});
|
|
666
|
+
campaignEntity.addProperty({
|
|
667
|
+
info: { name: 'end_date', displayName: 'End Date', description: 'Campaign end date' },
|
|
668
|
+
type: 'date',
|
|
669
|
+
required: true,
|
|
670
|
+
});
|
|
671
|
+
addCustomStatusField(campaignEntity, ['draft', 'active', 'paused', 'completed', 'cancelled'], {
|
|
672
|
+
displayName: 'Campaign Status',
|
|
673
|
+
description: 'Current status of the campaign',
|
|
674
|
+
});
|
|
675
|
+
campaignEntity.addProperty({
|
|
676
|
+
info: { name: 'campaign_type', displayName: 'Campaign Type', description: 'Type of marketing campaign' },
|
|
677
|
+
type: 'string',
|
|
678
|
+
required: true,
|
|
679
|
+
schema: {
|
|
680
|
+
enum: ['email', 'social_media', 'print', 'digital', 'event'],
|
|
681
|
+
},
|
|
682
|
+
});
|
|
683
|
+
addCreatedAtField(campaignEntity, { description: 'When the campaign was created' });
|
|
684
|
+
// Follow-up Entity
|
|
685
|
+
const followUpEntity = marketingModel.addEntity({
|
|
686
|
+
info: {
|
|
687
|
+
name: 'follow_up',
|
|
688
|
+
displayName: 'Follow-up',
|
|
689
|
+
description: 'Client follow-up activities',
|
|
690
|
+
},
|
|
691
|
+
});
|
|
692
|
+
addIdField(followUpEntity, { displayName: 'Follow-up ID', description: 'Unique identifier for the follow-up' });
|
|
693
|
+
addNameField(followUpEntity, { displayName: 'Follow-up Title', description: 'Title of the follow-up activity' });
|
|
694
|
+
addDescriptionField(followUpEntity, { description: 'Follow-up notes and details' });
|
|
695
|
+
followUpEntity.addProperty({
|
|
696
|
+
info: { name: 'scheduled_date', displayName: 'Scheduled Date', description: 'Scheduled follow-up date' },
|
|
697
|
+
type: 'date',
|
|
698
|
+
required: true,
|
|
699
|
+
});
|
|
700
|
+
addCustomStatusField(followUpEntity, ['scheduled', 'completed', 'cancelled', 'overdue'], {
|
|
701
|
+
displayName: 'Follow-up Status',
|
|
702
|
+
description: 'Current status of the follow-up',
|
|
703
|
+
});
|
|
704
|
+
followUpEntity.addProperty({
|
|
705
|
+
info: { name: 'follow_up_type', displayName: 'Follow-up Type', description: 'Type of follow-up activity' },
|
|
706
|
+
type: 'string',
|
|
707
|
+
required: true,
|
|
708
|
+
schema: {
|
|
709
|
+
enum: ['phone_call', 'email', 'meeting', 'text', 'other'],
|
|
710
|
+
},
|
|
711
|
+
});
|
|
712
|
+
addCreatedAtField(followUpEntity, { description: 'When the follow-up was created' });
|
|
713
|
+
// Follow-up-Client Association (Many-to-One)
|
|
714
|
+
followUpEntity.addAssociation({ key: clientEntity.key }, {
|
|
715
|
+
info: { name: 'client', displayName: 'Client', description: 'Client for this follow-up' },
|
|
716
|
+
required: true,
|
|
717
|
+
multiple: false,
|
|
718
|
+
});
|
|
719
|
+
// Follow-up-Agent Association (Many-to-One)
|
|
720
|
+
followUpEntity.addAssociation({ key: agentEntity.key }, {
|
|
721
|
+
info: { name: 'agent', displayName: 'Agent', description: 'Agent responsible for this follow-up' },
|
|
722
|
+
required: true,
|
|
723
|
+
multiple: false,
|
|
724
|
+
});
|
|
725
|
+
return domain;
|
|
726
|
+
}
|
|
727
|
+
//# sourceMappingURL=real-estate-domain.js.map
|