@api-client/core 0.18.21 → 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 +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 +2 -2
- package/build/src/modeling/templates/meta/index.d.ts.map +1 -1
- package/build/src/modeling/templates/meta/index.js +31 -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/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,1290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gaming Domain Template
|
|
3
|
+
*
|
|
4
|
+
* A comprehensive gaming data domain following domain-driven design principles.
|
|
5
|
+
* This template covers the complete gaming ecosystem lifecycle including:
|
|
6
|
+
*
|
|
7
|
+
* - Player Management: Player profiles, achievements, statistics
|
|
8
|
+
* - Game Content: Levels, items, characters, assets
|
|
9
|
+
* - Matchmaking: Multiplayer, teams, tournaments
|
|
10
|
+
* - Monetization: In-app purchases, subscriptions, advertising
|
|
11
|
+
* - Analytics: Player behavior, engagement, retention
|
|
12
|
+
* - Social Features: Friends, chat, leaderboards
|
|
13
|
+
*
|
|
14
|
+
* Key Features:
|
|
15
|
+
* - Complete player lifecycle management
|
|
16
|
+
* - Game content and asset management
|
|
17
|
+
* - Multiplayer matchmaking system
|
|
18
|
+
* - Monetization and revenue tracking
|
|
19
|
+
* - Player analytics and insights
|
|
20
|
+
* - Social gaming features
|
|
21
|
+
* - Gaming ecosystem management
|
|
22
|
+
*
|
|
23
|
+
* Use Cases:
|
|
24
|
+
* - Video game platforms
|
|
25
|
+
* - Mobile gaming apps
|
|
26
|
+
* - Online multiplayer games
|
|
27
|
+
* - Game development studios
|
|
28
|
+
* - Gaming analytics
|
|
29
|
+
* - Social gaming networks
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
import { DataDomain } from '../../../DataDomain.js'
|
|
33
|
+
import {
|
|
34
|
+
addIdField,
|
|
35
|
+
addNameField,
|
|
36
|
+
addDescriptionField,
|
|
37
|
+
addEmailField,
|
|
38
|
+
addCustomStatusField,
|
|
39
|
+
addCreatedAtField,
|
|
40
|
+
addUpdatedAtField,
|
|
41
|
+
addCurrencyAmountField,
|
|
42
|
+
} from '../../../helpers/Intelisense.js'
|
|
43
|
+
import type { CreateTemplateOptions } from '../../types.js'
|
|
44
|
+
|
|
45
|
+
function createDomain(): DataDomain {
|
|
46
|
+
return new DataDomain({
|
|
47
|
+
info: {
|
|
48
|
+
name: 'Gaming Platform',
|
|
49
|
+
displayName: 'Gaming Platform',
|
|
50
|
+
description:
|
|
51
|
+
'A comprehensive gaming platform with player management, game content, ' +
|
|
52
|
+
'matchmaking, monetization, analytics, and social features',
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Creates a comprehensive gaming data domain following domain-driven design principles.
|
|
59
|
+
*
|
|
60
|
+
* This function demonstrates the proper hierarchy and organization for a gaming platform:
|
|
61
|
+
* 1. Creates the root DataDomain for the gaming platform
|
|
62
|
+
* 2. Organizes functionality into logical namespaces (Player Management, Game Content, etc.)
|
|
63
|
+
* 3. Groups related entities into models within each namespace
|
|
64
|
+
* 4. Defines entities with proper semantic annotations for gaming workflows
|
|
65
|
+
* 5. Establishes associations with appropriate cardinality for gaming relationships
|
|
66
|
+
*
|
|
67
|
+
* @returns A fully configured DataDomain with all gaming entities and relationships
|
|
68
|
+
*/
|
|
69
|
+
export default function createGamingDomain(options: CreateTemplateOptions = {}): DataDomain {
|
|
70
|
+
// Ensure the root data domain
|
|
71
|
+
const domain = options.domain ?? createDomain()
|
|
72
|
+
|
|
73
|
+
//
|
|
74
|
+
// 1. PLAYER MANAGEMENT NAMESPACE
|
|
75
|
+
//
|
|
76
|
+
const playerManagement = domain.addNamespace({
|
|
77
|
+
info: {
|
|
78
|
+
name: 'PlayerManagement',
|
|
79
|
+
displayName: 'Player Management',
|
|
80
|
+
description: 'Player profiles, achievements, and statistics',
|
|
81
|
+
},
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
// Player Model
|
|
85
|
+
const playerModel = playerManagement.addModel({
|
|
86
|
+
info: {
|
|
87
|
+
name: 'Players',
|
|
88
|
+
displayName: 'Player Management',
|
|
89
|
+
description: 'Player profiles and management',
|
|
90
|
+
},
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
// Player Entity
|
|
94
|
+
const playerEntity = playerModel.addEntity({
|
|
95
|
+
info: {
|
|
96
|
+
name: 'player',
|
|
97
|
+
displayName: 'Player',
|
|
98
|
+
description: 'Game player with profile and statistics',
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
addIdField(playerEntity, { displayName: 'Player ID', description: 'Unique identifier for the player' })
|
|
103
|
+
|
|
104
|
+
addNameField(playerEntity, { description: 'Player name and display name' })
|
|
105
|
+
|
|
106
|
+
addDescriptionField(playerEntity, { description: 'Player description and bio' })
|
|
107
|
+
|
|
108
|
+
addEmailField(playerEntity, { description: 'Player email address' })
|
|
109
|
+
|
|
110
|
+
playerEntity.addProperty({
|
|
111
|
+
info: { name: 'username', displayName: 'Username', description: 'Player username' },
|
|
112
|
+
type: 'string',
|
|
113
|
+
required: true,
|
|
114
|
+
unique: true,
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
playerEntity.addProperty({
|
|
118
|
+
info: { name: 'player_type', displayName: 'Player Type', description: 'Type of player' },
|
|
119
|
+
type: 'string',
|
|
120
|
+
required: true,
|
|
121
|
+
schema: {
|
|
122
|
+
enum: ['casual', 'competitive', 'professional', 'streamer', 'content_creator'],
|
|
123
|
+
},
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
playerEntity.addProperty({
|
|
127
|
+
info: { name: 'date_of_birth', displayName: 'Date of Birth', description: 'Player date of birth' },
|
|
128
|
+
type: 'date',
|
|
129
|
+
required: false,
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
playerEntity.addProperty({
|
|
133
|
+
info: { name: 'country', displayName: 'Country', description: 'Player country' },
|
|
134
|
+
type: 'string',
|
|
135
|
+
required: false,
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
playerEntity.addProperty({
|
|
139
|
+
info: { name: 'timezone', displayName: 'Timezone', description: 'Player timezone' },
|
|
140
|
+
type: 'string',
|
|
141
|
+
required: false,
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
addCustomStatusField(playerEntity, ['active', 'inactive', 'banned', 'suspended'], {
|
|
145
|
+
displayName: 'Player Status',
|
|
146
|
+
description: 'Current status of the player',
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
addCreatedAtField(playerEntity, { description: 'When the player was created' })
|
|
150
|
+
addUpdatedAtField(playerEntity, { description: 'When the player was last updated' })
|
|
151
|
+
|
|
152
|
+
// Achievement Entity
|
|
153
|
+
const achievementEntity = playerModel.addEntity({
|
|
154
|
+
info: {
|
|
155
|
+
name: 'achievement',
|
|
156
|
+
displayName: 'Achievement',
|
|
157
|
+
description: 'Player achievements and accomplishments',
|
|
158
|
+
},
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
addIdField(achievementEntity, { displayName: 'Achievement ID', description: 'Unique identifier for the achievement' })
|
|
162
|
+
|
|
163
|
+
addNameField(achievementEntity, { description: 'Achievement name and title' })
|
|
164
|
+
|
|
165
|
+
addDescriptionField(achievementEntity, { description: 'Achievement description and requirements' })
|
|
166
|
+
|
|
167
|
+
achievementEntity.addProperty({
|
|
168
|
+
info: { name: 'achievement_type', displayName: 'Achievement Type', description: 'Type of achievement' },
|
|
169
|
+
type: 'string',
|
|
170
|
+
required: true,
|
|
171
|
+
schema: {
|
|
172
|
+
enum: ['milestone', 'collection', 'challenge', 'social', 'competitive', 'hidden'],
|
|
173
|
+
},
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
achievementEntity.addProperty({
|
|
177
|
+
info: { name: 'points', displayName: 'Points', description: 'Achievement points value' },
|
|
178
|
+
type: 'number',
|
|
179
|
+
required: true,
|
|
180
|
+
schema: {
|
|
181
|
+
minimum: 0,
|
|
182
|
+
},
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
achievementEntity.addProperty({
|
|
186
|
+
info: { name: 'rarity', displayName: 'Rarity', description: 'Achievement rarity level' },
|
|
187
|
+
type: 'string',
|
|
188
|
+
required: true,
|
|
189
|
+
schema: {
|
|
190
|
+
enum: ['common', 'uncommon', 'rare', 'epic', 'legendary'],
|
|
191
|
+
},
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
addCustomStatusField(achievementEntity, ['available', 'unlocked', 'locked'], {
|
|
195
|
+
displayName: 'Achievement Status',
|
|
196
|
+
description: 'Current status of the achievement',
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
addCreatedAtField(achievementEntity, { description: 'When the achievement was created' })
|
|
200
|
+
|
|
201
|
+
// Achievement-Player Association (Many-to-One)
|
|
202
|
+
achievementEntity.addAssociation(
|
|
203
|
+
{ key: playerEntity.key },
|
|
204
|
+
{
|
|
205
|
+
info: { name: 'player', displayName: 'Player', description: 'Player for this achievement' },
|
|
206
|
+
required: true,
|
|
207
|
+
multiple: false,
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
// Statistics Entity
|
|
212
|
+
const statisticsEntity = playerModel.addEntity({
|
|
213
|
+
info: {
|
|
214
|
+
name: 'statistics',
|
|
215
|
+
displayName: 'Statistics',
|
|
216
|
+
description: 'Player game statistics',
|
|
217
|
+
},
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
addIdField(statisticsEntity, { displayName: 'Statistics ID', description: 'Unique identifier for the statistics' })
|
|
221
|
+
|
|
222
|
+
addNameField(statisticsEntity, { description: 'Statistics name and description' })
|
|
223
|
+
|
|
224
|
+
statisticsEntity.addProperty({
|
|
225
|
+
info: { name: 'stat_type', displayName: 'Stat Type', description: 'Type of statistic' },
|
|
226
|
+
type: 'string',
|
|
227
|
+
required: true,
|
|
228
|
+
schema: {
|
|
229
|
+
enum: ['score', 'time_played', 'wins', 'losses', 'accuracy', 'level', 'experience'],
|
|
230
|
+
},
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
statisticsEntity.addProperty({
|
|
234
|
+
info: { name: 'value', displayName: 'Value', description: 'Statistic value' },
|
|
235
|
+
type: 'number',
|
|
236
|
+
required: true,
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
statisticsEntity.addProperty({
|
|
240
|
+
info: { name: 'unit', displayName: 'Unit', description: 'Statistic unit' },
|
|
241
|
+
type: 'string',
|
|
242
|
+
required: false,
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
addCustomStatusField(statisticsEntity, ['current', 'historical', 'best'], {
|
|
246
|
+
displayName: 'Statistics Status',
|
|
247
|
+
description: 'Current status of the statistics',
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
addCreatedAtField(statisticsEntity, { description: 'When the statistics was created' })
|
|
251
|
+
|
|
252
|
+
// Statistics-Player Association (Many-to-One)
|
|
253
|
+
statisticsEntity.addAssociation(
|
|
254
|
+
{ key: playerEntity.key },
|
|
255
|
+
{
|
|
256
|
+
info: { name: 'player', displayName: 'Player', description: 'Player for this statistics' },
|
|
257
|
+
required: true,
|
|
258
|
+
multiple: false,
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
//
|
|
263
|
+
// 2. GAME CONTENT NAMESPACE
|
|
264
|
+
//
|
|
265
|
+
const gameContent = domain.addNamespace({
|
|
266
|
+
info: {
|
|
267
|
+
name: 'GameContent',
|
|
268
|
+
displayName: 'Game Content',
|
|
269
|
+
description: 'Levels, items, characters, and assets',
|
|
270
|
+
},
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
// Content Model
|
|
274
|
+
const contentModel = gameContent.addModel({
|
|
275
|
+
info: {
|
|
276
|
+
name: 'Content',
|
|
277
|
+
displayName: 'Game Content Management',
|
|
278
|
+
description: 'Game content and assets',
|
|
279
|
+
},
|
|
280
|
+
})
|
|
281
|
+
|
|
282
|
+
// Level Entity
|
|
283
|
+
const levelEntity = contentModel.addEntity({
|
|
284
|
+
info: {
|
|
285
|
+
name: 'level',
|
|
286
|
+
displayName: 'Level',
|
|
287
|
+
description: 'Game level or stage',
|
|
288
|
+
},
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
addIdField(levelEntity, { displayName: 'Level ID', description: 'Unique identifier for the level' })
|
|
292
|
+
|
|
293
|
+
addNameField(levelEntity, { description: 'Level name and title' })
|
|
294
|
+
|
|
295
|
+
addDescriptionField(levelEntity, { description: 'Level description and objectives' })
|
|
296
|
+
|
|
297
|
+
levelEntity.addProperty({
|
|
298
|
+
info: { name: 'level_type', displayName: 'Level Type', description: 'Type of level' },
|
|
299
|
+
type: 'string',
|
|
300
|
+
required: true,
|
|
301
|
+
schema: {
|
|
302
|
+
enum: ['tutorial', 'story', 'challenge', 'boss', 'multiplayer', 'custom'],
|
|
303
|
+
},
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
levelEntity.addProperty({
|
|
307
|
+
info: { name: 'difficulty', displayName: 'Difficulty', description: 'Level difficulty' },
|
|
308
|
+
type: 'string',
|
|
309
|
+
required: true,
|
|
310
|
+
schema: {
|
|
311
|
+
enum: ['easy', 'normal', 'hard', 'expert', 'nightmare'],
|
|
312
|
+
},
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
levelEntity.addProperty({
|
|
316
|
+
info: { name: 'order', displayName: 'Order', description: 'Level order in sequence' },
|
|
317
|
+
type: 'number',
|
|
318
|
+
required: true,
|
|
319
|
+
schema: {
|
|
320
|
+
minimum: 1,
|
|
321
|
+
},
|
|
322
|
+
})
|
|
323
|
+
|
|
324
|
+
levelEntity.addProperty({
|
|
325
|
+
info: { name: 'time_limit', displayName: 'Time Limit', description: 'Level time limit in seconds' },
|
|
326
|
+
type: 'number',
|
|
327
|
+
required: false,
|
|
328
|
+
schema: {
|
|
329
|
+
minimum: 0,
|
|
330
|
+
},
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
addCustomStatusField(levelEntity, ['draft', 'testing', 'published', 'archived'], {
|
|
334
|
+
displayName: 'Level Status',
|
|
335
|
+
description: 'Current status of the level',
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
addCreatedAtField(levelEntity, { description: 'When the level was created' })
|
|
339
|
+
|
|
340
|
+
// Item Entity
|
|
341
|
+
const itemEntity = contentModel.addEntity({
|
|
342
|
+
info: {
|
|
343
|
+
name: 'item',
|
|
344
|
+
displayName: 'Item',
|
|
345
|
+
description: 'Game item or collectible',
|
|
346
|
+
},
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
addIdField(itemEntity, { displayName: 'Item ID', description: 'Unique identifier for the item' })
|
|
350
|
+
|
|
351
|
+
addNameField(itemEntity, { description: 'Item name and title' })
|
|
352
|
+
|
|
353
|
+
addDescriptionField(itemEntity, { description: 'Item description and effects' })
|
|
354
|
+
|
|
355
|
+
itemEntity.addProperty({
|
|
356
|
+
info: { name: 'item_type', displayName: 'Item Type', description: 'Type of item' },
|
|
357
|
+
type: 'string',
|
|
358
|
+
required: true,
|
|
359
|
+
schema: {
|
|
360
|
+
enum: ['weapon', 'armor', 'consumable', 'collectible', 'currency', 'cosmetic'],
|
|
361
|
+
},
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
itemEntity.addProperty({
|
|
365
|
+
info: { name: 'rarity', displayName: 'Rarity', description: 'Item rarity level' },
|
|
366
|
+
type: 'string',
|
|
367
|
+
required: true,
|
|
368
|
+
schema: {
|
|
369
|
+
enum: ['common', 'uncommon', 'rare', 'epic', 'legendary'],
|
|
370
|
+
},
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
itemEntity.addProperty({
|
|
374
|
+
info: { name: 'value', displayName: 'Value', description: 'Item value or cost' },
|
|
375
|
+
type: 'number',
|
|
376
|
+
required: false,
|
|
377
|
+
schema: {
|
|
378
|
+
minimum: 0,
|
|
379
|
+
},
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
addCustomStatusField(itemEntity, ['available', 'unlocked', 'locked', 'consumed'], {
|
|
383
|
+
displayName: 'Item Status',
|
|
384
|
+
description: 'Current status of the item',
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
addCreatedAtField(itemEntity, { description: 'When the item was created' })
|
|
388
|
+
|
|
389
|
+
// Character Entity
|
|
390
|
+
const characterEntity = contentModel.addEntity({
|
|
391
|
+
info: {
|
|
392
|
+
name: 'character',
|
|
393
|
+
displayName: 'Character',
|
|
394
|
+
description: 'Game character or avatar',
|
|
395
|
+
},
|
|
396
|
+
})
|
|
397
|
+
|
|
398
|
+
addIdField(characterEntity, { displayName: 'Character ID', description: 'Unique identifier for the character' })
|
|
399
|
+
|
|
400
|
+
addNameField(characterEntity, { description: 'Character name and title' })
|
|
401
|
+
|
|
402
|
+
addDescriptionField(characterEntity, { description: 'Character description and backstory' })
|
|
403
|
+
|
|
404
|
+
characterEntity.addProperty({
|
|
405
|
+
info: { name: 'character_type', displayName: 'Character Type', description: 'Type of character' },
|
|
406
|
+
type: 'string',
|
|
407
|
+
required: true,
|
|
408
|
+
schema: {
|
|
409
|
+
enum: ['hero', 'villain', 'npc', 'boss', 'companion', 'custom'],
|
|
410
|
+
},
|
|
411
|
+
})
|
|
412
|
+
|
|
413
|
+
characterEntity.addProperty({
|
|
414
|
+
info: { name: 'class', displayName: 'Class', description: 'Character class or role' },
|
|
415
|
+
type: 'string',
|
|
416
|
+
required: false,
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
characterEntity.addProperty({
|
|
420
|
+
info: { name: 'level', displayName: 'Level', description: 'Character level' },
|
|
421
|
+
type: 'number',
|
|
422
|
+
required: true,
|
|
423
|
+
schema: {
|
|
424
|
+
minimum: 1,
|
|
425
|
+
},
|
|
426
|
+
})
|
|
427
|
+
|
|
428
|
+
addCustomStatusField(characterEntity, ['available', 'unlocked', 'locked'], {
|
|
429
|
+
displayName: 'Character Status',
|
|
430
|
+
description: 'Current status of the character',
|
|
431
|
+
})
|
|
432
|
+
|
|
433
|
+
addCreatedAtField(characterEntity, { description: 'When the character was created' })
|
|
434
|
+
|
|
435
|
+
// Asset Entity
|
|
436
|
+
const assetEntity = contentModel.addEntity({
|
|
437
|
+
info: {
|
|
438
|
+
name: 'asset',
|
|
439
|
+
displayName: 'Asset',
|
|
440
|
+
description: 'Game asset (image, sound, model)',
|
|
441
|
+
},
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
addIdField(assetEntity, { displayName: 'Asset ID', description: 'Unique identifier for the asset' })
|
|
445
|
+
|
|
446
|
+
addNameField(assetEntity, { description: 'Asset name and title' })
|
|
447
|
+
|
|
448
|
+
addDescriptionField(assetEntity, { description: 'Asset description and usage' })
|
|
449
|
+
|
|
450
|
+
assetEntity.addProperty({
|
|
451
|
+
info: { name: 'asset_type', displayName: 'Asset Type', description: 'Type of asset' },
|
|
452
|
+
type: 'string',
|
|
453
|
+
required: true,
|
|
454
|
+
schema: {
|
|
455
|
+
enum: ['image', 'sound', 'model', 'animation', 'texture', 'video'],
|
|
456
|
+
},
|
|
457
|
+
})
|
|
458
|
+
|
|
459
|
+
assetEntity.addProperty({
|
|
460
|
+
info: { name: 'file_path', displayName: 'File Path', description: 'Asset file path' },
|
|
461
|
+
type: 'string',
|
|
462
|
+
required: true,
|
|
463
|
+
})
|
|
464
|
+
|
|
465
|
+
assetEntity.addProperty({
|
|
466
|
+
info: { name: 'file_size', displayName: 'File Size', description: 'Asset file size in bytes' },
|
|
467
|
+
type: 'number',
|
|
468
|
+
required: true,
|
|
469
|
+
schema: {
|
|
470
|
+
minimum: 0,
|
|
471
|
+
},
|
|
472
|
+
})
|
|
473
|
+
|
|
474
|
+
assetEntity.addProperty({
|
|
475
|
+
info: { name: 'format', displayName: 'Format', description: 'Asset file format' },
|
|
476
|
+
type: 'string',
|
|
477
|
+
required: true,
|
|
478
|
+
})
|
|
479
|
+
|
|
480
|
+
addCustomStatusField(assetEntity, ['draft', 'review', 'approved', 'published'], {
|
|
481
|
+
displayName: 'Asset Status',
|
|
482
|
+
description: 'Current status of the asset',
|
|
483
|
+
})
|
|
484
|
+
|
|
485
|
+
addCreatedAtField(assetEntity, { description: 'When the asset was created' })
|
|
486
|
+
|
|
487
|
+
//
|
|
488
|
+
// 3. MATCHMAKING NAMESPACE
|
|
489
|
+
//
|
|
490
|
+
const matchmaking = domain.addNamespace({
|
|
491
|
+
info: {
|
|
492
|
+
name: 'Matchmaking',
|
|
493
|
+
displayName: 'Matchmaking',
|
|
494
|
+
description: 'Multiplayer, teams, and tournaments',
|
|
495
|
+
},
|
|
496
|
+
})
|
|
497
|
+
|
|
498
|
+
// Matchmaking Model
|
|
499
|
+
const matchmakingModel = matchmaking.addModel({
|
|
500
|
+
info: {
|
|
501
|
+
name: 'Matchmaking',
|
|
502
|
+
displayName: 'Matchmaking Management',
|
|
503
|
+
description: 'Multiplayer matchmaking and teams',
|
|
504
|
+
},
|
|
505
|
+
})
|
|
506
|
+
|
|
507
|
+
// Match Entity
|
|
508
|
+
const matchEntity = matchmakingModel.addEntity({
|
|
509
|
+
info: {
|
|
510
|
+
name: 'match',
|
|
511
|
+
displayName: 'Match',
|
|
512
|
+
description: 'Game match or session',
|
|
513
|
+
},
|
|
514
|
+
})
|
|
515
|
+
|
|
516
|
+
addIdField(matchEntity, { displayName: 'Match ID', description: 'Unique identifier for the match' })
|
|
517
|
+
|
|
518
|
+
addNameField(matchEntity, { description: 'Match name and description' })
|
|
519
|
+
|
|
520
|
+
addDescriptionField(matchEntity, { description: 'Match description and details' })
|
|
521
|
+
|
|
522
|
+
matchEntity.addProperty({
|
|
523
|
+
info: { name: 'match_type', displayName: 'Match Type', description: 'Type of match' },
|
|
524
|
+
type: 'string',
|
|
525
|
+
required: true,
|
|
526
|
+
schema: {
|
|
527
|
+
enum: ['casual', 'ranked', 'tournament', 'private', 'practice'],
|
|
528
|
+
},
|
|
529
|
+
})
|
|
530
|
+
|
|
531
|
+
matchEntity.addProperty({
|
|
532
|
+
info: { name: 'game_mode', displayName: 'Game Mode', description: 'Game mode' },
|
|
533
|
+
type: 'string',
|
|
534
|
+
required: true,
|
|
535
|
+
schema: {
|
|
536
|
+
enum: ['deathmatch', 'team_deathmatch', 'capture_the_flag', 'domination', 'survival'],
|
|
537
|
+
},
|
|
538
|
+
})
|
|
539
|
+
|
|
540
|
+
matchEntity.addProperty({
|
|
541
|
+
info: { name: 'start_time', displayName: 'Start Time', description: 'Match start time' },
|
|
542
|
+
type: 'datetime',
|
|
543
|
+
required: true,
|
|
544
|
+
})
|
|
545
|
+
|
|
546
|
+
matchEntity.addProperty({
|
|
547
|
+
info: { name: 'end_time', displayName: 'End Time', description: 'Match end time' },
|
|
548
|
+
type: 'datetime',
|
|
549
|
+
required: false,
|
|
550
|
+
})
|
|
551
|
+
|
|
552
|
+
matchEntity.addProperty({
|
|
553
|
+
info: { name: 'max_players', displayName: 'Max Players', description: 'Maximum players in match' },
|
|
554
|
+
type: 'number',
|
|
555
|
+
required: true,
|
|
556
|
+
schema: {
|
|
557
|
+
minimum: 1,
|
|
558
|
+
},
|
|
559
|
+
})
|
|
560
|
+
|
|
561
|
+
addCustomStatusField(matchEntity, ['waiting', 'in_progress', 'completed', 'cancelled'], {
|
|
562
|
+
displayName: 'Match Status',
|
|
563
|
+
description: 'Current status of the match',
|
|
564
|
+
})
|
|
565
|
+
|
|
566
|
+
addCreatedAtField(matchEntity, { description: 'When the match was created' })
|
|
567
|
+
|
|
568
|
+
// Match-Player Association (Many-to-Many)
|
|
569
|
+
matchEntity.addAssociation(
|
|
570
|
+
{ key: playerEntity.key },
|
|
571
|
+
{
|
|
572
|
+
info: { name: 'players', displayName: 'Players', description: 'Players in this match' },
|
|
573
|
+
required: true,
|
|
574
|
+
multiple: true,
|
|
575
|
+
}
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
// Team Entity
|
|
579
|
+
const teamEntity = matchmakingModel.addEntity({
|
|
580
|
+
info: {
|
|
581
|
+
name: 'team',
|
|
582
|
+
displayName: 'Team',
|
|
583
|
+
description: 'Player team or squad',
|
|
584
|
+
},
|
|
585
|
+
})
|
|
586
|
+
|
|
587
|
+
addIdField(teamEntity, { displayName: 'Team ID', description: 'Unique identifier for the team' })
|
|
588
|
+
|
|
589
|
+
addNameField(teamEntity, { description: 'Team name and title' })
|
|
590
|
+
|
|
591
|
+
addDescriptionField(teamEntity, { description: 'Team description and objectives' })
|
|
592
|
+
|
|
593
|
+
teamEntity.addProperty({
|
|
594
|
+
info: { name: 'team_type', displayName: 'Team Type', description: 'Type of team' },
|
|
595
|
+
type: 'string',
|
|
596
|
+
required: true,
|
|
597
|
+
schema: {
|
|
598
|
+
enum: ['casual', 'competitive', 'clan', 'guild', 'tournament'],
|
|
599
|
+
},
|
|
600
|
+
})
|
|
601
|
+
|
|
602
|
+
teamEntity.addProperty({
|
|
603
|
+
info: { name: 'max_members', displayName: 'Max Members', description: 'Maximum team members' },
|
|
604
|
+
type: 'number',
|
|
605
|
+
required: true,
|
|
606
|
+
schema: {
|
|
607
|
+
minimum: 1,
|
|
608
|
+
},
|
|
609
|
+
})
|
|
610
|
+
|
|
611
|
+
addCustomStatusField(teamEntity, ['active', 'inactive', 'disbanded'], {
|
|
612
|
+
displayName: 'Team Status',
|
|
613
|
+
description: 'Current status of the team',
|
|
614
|
+
})
|
|
615
|
+
|
|
616
|
+
addCreatedAtField(teamEntity, { description: 'When the team was created' })
|
|
617
|
+
|
|
618
|
+
// Team-Player Association (Many-to-Many)
|
|
619
|
+
teamEntity.addAssociation(
|
|
620
|
+
{ key: playerEntity.key },
|
|
621
|
+
{
|
|
622
|
+
info: { name: 'members', displayName: 'Members', description: 'Team members' },
|
|
623
|
+
required: true,
|
|
624
|
+
multiple: true,
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
// Tournament Entity
|
|
629
|
+
const tournamentEntity = matchmakingModel.addEntity({
|
|
630
|
+
info: {
|
|
631
|
+
name: 'tournament',
|
|
632
|
+
displayName: 'Tournament',
|
|
633
|
+
description: 'Game tournament or competition',
|
|
634
|
+
},
|
|
635
|
+
})
|
|
636
|
+
|
|
637
|
+
addIdField(tournamentEntity, { displayName: 'Tournament ID', description: 'Unique identifier for the tournament' })
|
|
638
|
+
|
|
639
|
+
addNameField(tournamentEntity, { description: 'Tournament name and title' })
|
|
640
|
+
|
|
641
|
+
addDescriptionField(tournamentEntity, { description: 'Tournament description and rules' })
|
|
642
|
+
|
|
643
|
+
tournamentEntity.addProperty({
|
|
644
|
+
info: { name: 'tournament_type', displayName: 'Tournament Type', description: 'Type of tournament' },
|
|
645
|
+
type: 'string',
|
|
646
|
+
required: true,
|
|
647
|
+
schema: {
|
|
648
|
+
enum: ['single_elimination', 'double_elimination', 'round_robin', 'swiss', 'bracket'],
|
|
649
|
+
},
|
|
650
|
+
})
|
|
651
|
+
|
|
652
|
+
tournamentEntity.addProperty({
|
|
653
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Tournament start date' },
|
|
654
|
+
type: 'date',
|
|
655
|
+
required: true,
|
|
656
|
+
})
|
|
657
|
+
|
|
658
|
+
tournamentEntity.addProperty({
|
|
659
|
+
info: { name: 'end_date', displayName: 'End Date', description: 'Tournament end date' },
|
|
660
|
+
type: 'date',
|
|
661
|
+
required: true,
|
|
662
|
+
})
|
|
663
|
+
|
|
664
|
+
tournamentEntity.addProperty({
|
|
665
|
+
info: { name: 'max_participants', displayName: 'Max Participants', description: 'Maximum participants' },
|
|
666
|
+
type: 'number',
|
|
667
|
+
required: true,
|
|
668
|
+
schema: {
|
|
669
|
+
minimum: 2,
|
|
670
|
+
},
|
|
671
|
+
})
|
|
672
|
+
|
|
673
|
+
addCurrencyAmountField(tournamentEntity, 'prize_pool', 'Prize Pool', {
|
|
674
|
+
description: 'Tournament prize pool amount',
|
|
675
|
+
})
|
|
676
|
+
|
|
677
|
+
addCustomStatusField(tournamentEntity, ['registration_open', 'in_progress', 'completed', 'cancelled'], {
|
|
678
|
+
displayName: 'Tournament Status',
|
|
679
|
+
description: 'Current status of the tournament',
|
|
680
|
+
})
|
|
681
|
+
|
|
682
|
+
addCreatedAtField(tournamentEntity, { description: 'When the tournament was created' })
|
|
683
|
+
|
|
684
|
+
// Tournament-Player Association (Many-to-Many)
|
|
685
|
+
tournamentEntity.addAssociation(
|
|
686
|
+
{ key: playerEntity.key },
|
|
687
|
+
{
|
|
688
|
+
info: { name: 'participants', displayName: 'Participants', description: 'Tournament participants' },
|
|
689
|
+
required: true,
|
|
690
|
+
multiple: true,
|
|
691
|
+
}
|
|
692
|
+
)
|
|
693
|
+
|
|
694
|
+
//
|
|
695
|
+
// 4. MONETIZATION NAMESPACE
|
|
696
|
+
//
|
|
697
|
+
const monetization = domain.addNamespace({
|
|
698
|
+
info: {
|
|
699
|
+
name: 'Monetization',
|
|
700
|
+
displayName: 'Monetization',
|
|
701
|
+
description: 'In-app purchases, subscriptions, and advertising',
|
|
702
|
+
},
|
|
703
|
+
})
|
|
704
|
+
|
|
705
|
+
// Monetization Model
|
|
706
|
+
const monetizationModel = monetization.addModel({
|
|
707
|
+
info: {
|
|
708
|
+
name: 'Monetization',
|
|
709
|
+
displayName: 'Monetization Management',
|
|
710
|
+
description: 'Revenue and monetization tracking',
|
|
711
|
+
},
|
|
712
|
+
})
|
|
713
|
+
|
|
714
|
+
// Purchase Entity
|
|
715
|
+
const purchaseEntity = monetizationModel.addEntity({
|
|
716
|
+
info: {
|
|
717
|
+
name: 'purchase',
|
|
718
|
+
displayName: 'Purchase',
|
|
719
|
+
description: 'In-app purchase transaction',
|
|
720
|
+
},
|
|
721
|
+
})
|
|
722
|
+
|
|
723
|
+
addIdField(purchaseEntity, { displayName: 'Purchase ID', description: 'Unique identifier for the purchase' })
|
|
724
|
+
|
|
725
|
+
addNameField(purchaseEntity, { description: 'Purchase name and description' })
|
|
726
|
+
|
|
727
|
+
purchaseEntity.addProperty({
|
|
728
|
+
info: { name: 'purchase_type', displayName: 'Purchase Type', description: 'Type of purchase' },
|
|
729
|
+
type: 'string',
|
|
730
|
+
required: true,
|
|
731
|
+
schema: {
|
|
732
|
+
enum: ['item', 'currency', 'subscription', 'battle_pass', 'cosmetic'],
|
|
733
|
+
},
|
|
734
|
+
})
|
|
735
|
+
|
|
736
|
+
purchaseEntity.addProperty({
|
|
737
|
+
info: { name: 'purchase_date', displayName: 'Purchase Date', description: 'Purchase date' },
|
|
738
|
+
type: 'datetime',
|
|
739
|
+
required: true,
|
|
740
|
+
})
|
|
741
|
+
|
|
742
|
+
purchaseEntity.addProperty({
|
|
743
|
+
info: { name: 'payment_method', displayName: 'Payment Method', description: 'Payment method used' },
|
|
744
|
+
type: 'string',
|
|
745
|
+
required: true,
|
|
746
|
+
schema: {
|
|
747
|
+
enum: ['credit_card', 'paypal', 'apple_pay', 'google_pay', 'gift_card'],
|
|
748
|
+
},
|
|
749
|
+
})
|
|
750
|
+
|
|
751
|
+
addCurrencyAmountField(purchaseEntity, 'amount', 'Purchase Amount', {
|
|
752
|
+
description: 'Purchase amount',
|
|
753
|
+
})
|
|
754
|
+
|
|
755
|
+
addCustomStatusField(purchaseEntity, ['pending', 'completed', 'failed', 'refunded'], {
|
|
756
|
+
displayName: 'Purchase Status',
|
|
757
|
+
description: 'Current status of the purchase',
|
|
758
|
+
})
|
|
759
|
+
|
|
760
|
+
addCreatedAtField(purchaseEntity, { description: 'When the purchase was created' })
|
|
761
|
+
|
|
762
|
+
// Purchase-Player Association (Many-to-One)
|
|
763
|
+
purchaseEntity.addAssociation(
|
|
764
|
+
{ key: playerEntity.key },
|
|
765
|
+
{
|
|
766
|
+
info: { name: 'player', displayName: 'Player', description: 'Player for this purchase' },
|
|
767
|
+
required: true,
|
|
768
|
+
multiple: false,
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
|
|
772
|
+
// Subscription Entity
|
|
773
|
+
const subscriptionEntity = monetizationModel.addEntity({
|
|
774
|
+
info: {
|
|
775
|
+
name: 'subscription',
|
|
776
|
+
displayName: 'Subscription',
|
|
777
|
+
description: 'Player subscription',
|
|
778
|
+
},
|
|
779
|
+
})
|
|
780
|
+
|
|
781
|
+
addIdField(subscriptionEntity, {
|
|
782
|
+
displayName: 'Subscription ID',
|
|
783
|
+
description: 'Unique identifier for the subscription',
|
|
784
|
+
})
|
|
785
|
+
|
|
786
|
+
addNameField(subscriptionEntity, { description: 'Subscription name and description' })
|
|
787
|
+
|
|
788
|
+
subscriptionEntity.addProperty({
|
|
789
|
+
info: { name: 'subscription_type', displayName: 'Subscription Type', description: 'Type of subscription' },
|
|
790
|
+
type: 'string',
|
|
791
|
+
required: true,
|
|
792
|
+
schema: {
|
|
793
|
+
enum: ['monthly', 'quarterly', 'annual', 'lifetime', 'premium'],
|
|
794
|
+
},
|
|
795
|
+
})
|
|
796
|
+
|
|
797
|
+
subscriptionEntity.addProperty({
|
|
798
|
+
info: { name: 'start_date', displayName: 'Start Date', description: 'Subscription start date' },
|
|
799
|
+
type: 'date',
|
|
800
|
+
required: true,
|
|
801
|
+
})
|
|
802
|
+
|
|
803
|
+
subscriptionEntity.addProperty({
|
|
804
|
+
info: { name: 'end_date', displayName: 'End Date', description: 'Subscription end date' },
|
|
805
|
+
type: 'date',
|
|
806
|
+
required: true,
|
|
807
|
+
})
|
|
808
|
+
|
|
809
|
+
addCurrencyAmountField(subscriptionEntity, 'amount', 'Subscription Amount', {
|
|
810
|
+
description: 'Subscription amount',
|
|
811
|
+
})
|
|
812
|
+
|
|
813
|
+
addCustomStatusField(subscriptionEntity, ['active', 'expired', 'cancelled', 'pending'], {
|
|
814
|
+
displayName: 'Subscription Status',
|
|
815
|
+
description: 'Current status of the subscription',
|
|
816
|
+
})
|
|
817
|
+
|
|
818
|
+
addCreatedAtField(subscriptionEntity, { description: 'When the subscription was created' })
|
|
819
|
+
|
|
820
|
+
// Subscription-Player Association (Many-to-One)
|
|
821
|
+
subscriptionEntity.addAssociation(
|
|
822
|
+
{ key: playerEntity.key },
|
|
823
|
+
{
|
|
824
|
+
info: { name: 'player', displayName: 'Player', description: 'Player for this subscription' },
|
|
825
|
+
required: true,
|
|
826
|
+
multiple: false,
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
|
|
830
|
+
// Advertisement Entity
|
|
831
|
+
const advertisementEntity = monetizationModel.addEntity({
|
|
832
|
+
info: {
|
|
833
|
+
name: 'advertisement',
|
|
834
|
+
displayName: 'Advertisement',
|
|
835
|
+
description: 'Game advertisement',
|
|
836
|
+
},
|
|
837
|
+
})
|
|
838
|
+
|
|
839
|
+
addIdField(advertisementEntity, { displayName: 'Ad ID', description: 'Unique identifier for the advertisement' })
|
|
840
|
+
|
|
841
|
+
addNameField(advertisementEntity, { description: 'Advertisement name and title' })
|
|
842
|
+
|
|
843
|
+
addDescriptionField(advertisementEntity, { description: 'Advertisement description and content' })
|
|
844
|
+
|
|
845
|
+
advertisementEntity.addProperty({
|
|
846
|
+
info: { name: 'ad_type', displayName: 'Ad Type', description: 'Type of advertisement' },
|
|
847
|
+
type: 'string',
|
|
848
|
+
required: true,
|
|
849
|
+
schema: {
|
|
850
|
+
enum: ['banner', 'interstitial', 'rewarded', 'native', 'video'],
|
|
851
|
+
},
|
|
852
|
+
})
|
|
853
|
+
|
|
854
|
+
advertisementEntity.addProperty({
|
|
855
|
+
info: { name: 'placement', displayName: 'Placement', description: 'Ad placement location' },
|
|
856
|
+
type: 'string',
|
|
857
|
+
required: true,
|
|
858
|
+
})
|
|
859
|
+
|
|
860
|
+
advertisementEntity.addProperty({
|
|
861
|
+
info: { name: 'impressions', displayName: 'Impressions', description: 'Number of ad impressions' },
|
|
862
|
+
type: 'number',
|
|
863
|
+
required: true,
|
|
864
|
+
schema: {
|
|
865
|
+
minimum: 0,
|
|
866
|
+
},
|
|
867
|
+
})
|
|
868
|
+
|
|
869
|
+
advertisementEntity.addProperty({
|
|
870
|
+
info: { name: 'clicks', displayName: 'Clicks', description: 'Number of ad clicks' },
|
|
871
|
+
type: 'number',
|
|
872
|
+
required: true,
|
|
873
|
+
schema: {
|
|
874
|
+
minimum: 0,
|
|
875
|
+
},
|
|
876
|
+
})
|
|
877
|
+
|
|
878
|
+
addCurrencyAmountField(advertisementEntity, 'revenue', 'Ad Revenue', {
|
|
879
|
+
description: 'Advertisement revenue',
|
|
880
|
+
})
|
|
881
|
+
|
|
882
|
+
addCustomStatusField(advertisementEntity, ['active', 'paused', 'completed', 'cancelled'], {
|
|
883
|
+
displayName: 'Ad Status',
|
|
884
|
+
description: 'Current status of the advertisement',
|
|
885
|
+
})
|
|
886
|
+
|
|
887
|
+
addCreatedAtField(advertisementEntity, { description: 'When the advertisement was created' })
|
|
888
|
+
|
|
889
|
+
//
|
|
890
|
+
// 5. ANALYTICS NAMESPACE
|
|
891
|
+
//
|
|
892
|
+
const analytics = domain.addNamespace({
|
|
893
|
+
info: {
|
|
894
|
+
name: 'Analytics',
|
|
895
|
+
displayName: 'Analytics',
|
|
896
|
+
description: 'Player behavior, engagement, and retention',
|
|
897
|
+
},
|
|
898
|
+
})
|
|
899
|
+
|
|
900
|
+
// Analytics Model
|
|
901
|
+
const analyticsModel = analytics.addModel({
|
|
902
|
+
info: {
|
|
903
|
+
name: 'Analytics',
|
|
904
|
+
displayName: 'Analytics Management',
|
|
905
|
+
description: 'Player analytics and insights',
|
|
906
|
+
},
|
|
907
|
+
})
|
|
908
|
+
|
|
909
|
+
// Player Behavior Entity
|
|
910
|
+
const playerBehaviorEntity = analyticsModel.addEntity({
|
|
911
|
+
info: {
|
|
912
|
+
name: 'player_behavior',
|
|
913
|
+
displayName: 'Player Behavior',
|
|
914
|
+
description: 'Player behavior analytics',
|
|
915
|
+
},
|
|
916
|
+
})
|
|
917
|
+
|
|
918
|
+
addIdField(playerBehaviorEntity, {
|
|
919
|
+
displayName: 'Behavior ID',
|
|
920
|
+
description: 'Unique identifier for the player behavior',
|
|
921
|
+
})
|
|
922
|
+
|
|
923
|
+
addNameField(playerBehaviorEntity, { description: 'Behavior name and description' })
|
|
924
|
+
|
|
925
|
+
playerBehaviorEntity.addProperty({
|
|
926
|
+
info: { name: 'behavior_type', displayName: 'Behavior Type', description: 'Type of behavior' },
|
|
927
|
+
type: 'string',
|
|
928
|
+
required: true,
|
|
929
|
+
schema: {
|
|
930
|
+
enum: ['session_duration', 'purchase_frequency', 'game_completion', 'social_interaction', 'feature_usage'],
|
|
931
|
+
},
|
|
932
|
+
})
|
|
933
|
+
|
|
934
|
+
playerBehaviorEntity.addProperty({
|
|
935
|
+
info: { name: 'session_date', displayName: 'Session Date', description: 'Behavior session date' },
|
|
936
|
+
type: 'date',
|
|
937
|
+
required: true,
|
|
938
|
+
})
|
|
939
|
+
|
|
940
|
+
playerBehaviorEntity.addProperty({
|
|
941
|
+
info: { name: 'duration', displayName: 'Duration', description: 'Behavior duration in minutes' },
|
|
942
|
+
type: 'number',
|
|
943
|
+
required: true,
|
|
944
|
+
schema: {
|
|
945
|
+
minimum: 0,
|
|
946
|
+
},
|
|
947
|
+
})
|
|
948
|
+
|
|
949
|
+
addCustomStatusField(playerBehaviorEntity, ['tracked', 'analyzed', 'reported'], {
|
|
950
|
+
displayName: 'Behavior Status',
|
|
951
|
+
description: 'Current status of the behavior tracking',
|
|
952
|
+
})
|
|
953
|
+
|
|
954
|
+
addCreatedAtField(playerBehaviorEntity, { description: 'When the behavior was created' })
|
|
955
|
+
|
|
956
|
+
// PlayerBehavior-Player Association (Many-to-One)
|
|
957
|
+
playerBehaviorEntity.addAssociation(
|
|
958
|
+
{ key: playerEntity.key },
|
|
959
|
+
{
|
|
960
|
+
info: { name: 'player', displayName: 'Player', description: 'Player for this behavior' },
|
|
961
|
+
required: true,
|
|
962
|
+
multiple: false,
|
|
963
|
+
}
|
|
964
|
+
)
|
|
965
|
+
|
|
966
|
+
// Engagement Entity
|
|
967
|
+
const engagementEntity = analyticsModel.addEntity({
|
|
968
|
+
info: {
|
|
969
|
+
name: 'engagement',
|
|
970
|
+
displayName: 'Engagement',
|
|
971
|
+
description: 'Player engagement metrics',
|
|
972
|
+
},
|
|
973
|
+
})
|
|
974
|
+
|
|
975
|
+
addIdField(engagementEntity, { displayName: 'Engagement ID', description: 'Unique identifier for the engagement' })
|
|
976
|
+
|
|
977
|
+
addNameField(engagementEntity, { description: 'Engagement name and description' })
|
|
978
|
+
|
|
979
|
+
engagementEntity.addProperty({
|
|
980
|
+
info: { name: 'engagement_type', displayName: 'Engagement Type', description: 'Type of engagement' },
|
|
981
|
+
type: 'string',
|
|
982
|
+
required: true,
|
|
983
|
+
schema: {
|
|
984
|
+
enum: ['daily_active', 'weekly_active', 'monthly_active', 'session_count', 'feature_usage'],
|
|
985
|
+
},
|
|
986
|
+
})
|
|
987
|
+
|
|
988
|
+
engagementEntity.addProperty({
|
|
989
|
+
info: { name: 'metric_date', displayName: 'Metric Date', description: 'Engagement metric date' },
|
|
990
|
+
type: 'date',
|
|
991
|
+
required: true,
|
|
992
|
+
})
|
|
993
|
+
|
|
994
|
+
engagementEntity.addProperty({
|
|
995
|
+
info: { name: 'value', displayName: 'Value', description: 'Engagement metric value' },
|
|
996
|
+
type: 'number',
|
|
997
|
+
required: true,
|
|
998
|
+
})
|
|
999
|
+
|
|
1000
|
+
addCustomStatusField(engagementEntity, ['tracked', 'analyzed', 'reported'], {
|
|
1001
|
+
displayName: 'Engagement Status',
|
|
1002
|
+
description: 'Current status of the engagement tracking',
|
|
1003
|
+
})
|
|
1004
|
+
|
|
1005
|
+
addCreatedAtField(engagementEntity, { description: 'When the engagement was created' })
|
|
1006
|
+
|
|
1007
|
+
// Retention Entity
|
|
1008
|
+
const retentionEntity = analyticsModel.addEntity({
|
|
1009
|
+
info: {
|
|
1010
|
+
name: 'retention',
|
|
1011
|
+
displayName: 'Retention',
|
|
1012
|
+
description: 'Player retention analytics',
|
|
1013
|
+
},
|
|
1014
|
+
})
|
|
1015
|
+
|
|
1016
|
+
addIdField(retentionEntity, { displayName: 'Retention ID', description: 'Unique identifier for the retention' })
|
|
1017
|
+
|
|
1018
|
+
addNameField(retentionEntity, { description: 'Retention name and description' })
|
|
1019
|
+
|
|
1020
|
+
retentionEntity.addProperty({
|
|
1021
|
+
info: { name: 'retention_type', displayName: 'Retention Type', description: 'Type of retention' },
|
|
1022
|
+
type: 'string',
|
|
1023
|
+
required: true,
|
|
1024
|
+
schema: {
|
|
1025
|
+
enum: ['day_1', 'day_7', 'day_30', 'day_90', 'churn_rate'],
|
|
1026
|
+
},
|
|
1027
|
+
})
|
|
1028
|
+
|
|
1029
|
+
retentionEntity.addProperty({
|
|
1030
|
+
info: { name: 'cohort_date', displayName: 'Cohort Date', description: 'Retention cohort date' },
|
|
1031
|
+
type: 'date',
|
|
1032
|
+
required: true,
|
|
1033
|
+
})
|
|
1034
|
+
|
|
1035
|
+
retentionEntity.addProperty({
|
|
1036
|
+
info: { name: 'rate', displayName: 'Rate', description: 'Retention rate percentage' },
|
|
1037
|
+
type: 'number',
|
|
1038
|
+
required: true,
|
|
1039
|
+
schema: {
|
|
1040
|
+
minimum: 0,
|
|
1041
|
+
maximum: 100,
|
|
1042
|
+
},
|
|
1043
|
+
})
|
|
1044
|
+
|
|
1045
|
+
addCustomStatusField(retentionEntity, ['tracked', 'analyzed', 'reported'], {
|
|
1046
|
+
displayName: 'Retention Status',
|
|
1047
|
+
description: 'Current status of the retention tracking',
|
|
1048
|
+
})
|
|
1049
|
+
|
|
1050
|
+
addCreatedAtField(retentionEntity, { description: 'When the retention was created' })
|
|
1051
|
+
|
|
1052
|
+
//
|
|
1053
|
+
// 6. SOCIAL FEATURES NAMESPACE
|
|
1054
|
+
//
|
|
1055
|
+
const socialFeatures = domain.addNamespace({
|
|
1056
|
+
info: {
|
|
1057
|
+
name: 'SocialFeatures',
|
|
1058
|
+
displayName: 'Social Features',
|
|
1059
|
+
description: 'Friends, chat, and leaderboards',
|
|
1060
|
+
},
|
|
1061
|
+
})
|
|
1062
|
+
|
|
1063
|
+
// Social Model
|
|
1064
|
+
const socialModel = socialFeatures.addModel({
|
|
1065
|
+
info: {
|
|
1066
|
+
name: 'Social',
|
|
1067
|
+
displayName: 'Social Features Management',
|
|
1068
|
+
description: 'Social gaming features',
|
|
1069
|
+
},
|
|
1070
|
+
})
|
|
1071
|
+
|
|
1072
|
+
// Friend Entity
|
|
1073
|
+
const friendEntity = socialModel.addEntity({
|
|
1074
|
+
info: {
|
|
1075
|
+
name: 'friend',
|
|
1076
|
+
displayName: 'Friend',
|
|
1077
|
+
description: 'Player friendship relationship',
|
|
1078
|
+
},
|
|
1079
|
+
})
|
|
1080
|
+
|
|
1081
|
+
addIdField(friendEntity, { displayName: 'Friend ID', description: 'Unique identifier for the friend relationship' })
|
|
1082
|
+
|
|
1083
|
+
addNameField(friendEntity, { description: 'Friend relationship name' })
|
|
1084
|
+
|
|
1085
|
+
friendEntity.addProperty({
|
|
1086
|
+
info: { name: 'friend_type', displayName: 'Friend Type', description: 'Type of friendship' },
|
|
1087
|
+
type: 'string',
|
|
1088
|
+
required: true,
|
|
1089
|
+
schema: {
|
|
1090
|
+
enum: ['mutual', 'pending', 'blocked', 'favorite'],
|
|
1091
|
+
},
|
|
1092
|
+
})
|
|
1093
|
+
|
|
1094
|
+
friendEntity.addProperty({
|
|
1095
|
+
info: { name: 'friend_date', displayName: 'Friend Date', description: 'Friendship start date' },
|
|
1096
|
+
type: 'date',
|
|
1097
|
+
required: true,
|
|
1098
|
+
})
|
|
1099
|
+
|
|
1100
|
+
addCustomStatusField(friendEntity, ['active', 'inactive', 'blocked'], {
|
|
1101
|
+
displayName: 'Friend Status',
|
|
1102
|
+
description: 'Current status of the friendship',
|
|
1103
|
+
})
|
|
1104
|
+
|
|
1105
|
+
addCreatedAtField(friendEntity, { description: 'When the friendship was created' })
|
|
1106
|
+
|
|
1107
|
+
// Friend-Player Association (Many-to-Many)
|
|
1108
|
+
friendEntity.addAssociation(
|
|
1109
|
+
{ key: playerEntity.key },
|
|
1110
|
+
{
|
|
1111
|
+
info: { name: 'players', displayName: 'Players', description: 'Players in this friendship' },
|
|
1112
|
+
required: true,
|
|
1113
|
+
multiple: true,
|
|
1114
|
+
}
|
|
1115
|
+
)
|
|
1116
|
+
|
|
1117
|
+
// Chat Message Entity
|
|
1118
|
+
const chatMessageEntity = socialModel.addEntity({
|
|
1119
|
+
info: {
|
|
1120
|
+
name: 'chat_message',
|
|
1121
|
+
displayName: 'Chat Message',
|
|
1122
|
+
description: 'Player chat message',
|
|
1123
|
+
},
|
|
1124
|
+
})
|
|
1125
|
+
|
|
1126
|
+
addIdField(chatMessageEntity, {
|
|
1127
|
+
displayName: 'Message ID',
|
|
1128
|
+
description: 'Unique identifier for the chat message',
|
|
1129
|
+
})
|
|
1130
|
+
|
|
1131
|
+
addNameField(chatMessageEntity, { description: 'Message name and description' })
|
|
1132
|
+
|
|
1133
|
+
addDescriptionField(chatMessageEntity, { description: 'Message content' })
|
|
1134
|
+
|
|
1135
|
+
chatMessageEntity.addProperty({
|
|
1136
|
+
info: { name: 'message_type', displayName: 'Message Type', description: 'Type of message' },
|
|
1137
|
+
type: 'string',
|
|
1138
|
+
required: true,
|
|
1139
|
+
schema: {
|
|
1140
|
+
enum: ['text', 'voice', 'image', 'system', 'notification'],
|
|
1141
|
+
},
|
|
1142
|
+
})
|
|
1143
|
+
|
|
1144
|
+
chatMessageEntity.addProperty({
|
|
1145
|
+
info: { name: 'channel', displayName: 'Channel', description: 'Chat channel' },
|
|
1146
|
+
type: 'string',
|
|
1147
|
+
required: true,
|
|
1148
|
+
})
|
|
1149
|
+
|
|
1150
|
+
chatMessageEntity.addProperty({
|
|
1151
|
+
info: { name: 'sent_time', displayName: 'Sent Time', description: 'Message sent time' },
|
|
1152
|
+
type: 'datetime',
|
|
1153
|
+
required: true,
|
|
1154
|
+
})
|
|
1155
|
+
|
|
1156
|
+
addCustomStatusField(chatMessageEntity, ['sent', 'delivered', 'read', 'deleted'], {
|
|
1157
|
+
displayName: 'Message Status',
|
|
1158
|
+
description: 'Current status of the message',
|
|
1159
|
+
})
|
|
1160
|
+
|
|
1161
|
+
addCreatedAtField(chatMessageEntity, { description: 'When the message was created' })
|
|
1162
|
+
|
|
1163
|
+
// ChatMessage-Player Association (Many-to-One)
|
|
1164
|
+
chatMessageEntity.addAssociation(
|
|
1165
|
+
{ key: playerEntity.key },
|
|
1166
|
+
{
|
|
1167
|
+
info: { name: 'sender', displayName: 'Sender', description: 'Message sender' },
|
|
1168
|
+
required: true,
|
|
1169
|
+
multiple: false,
|
|
1170
|
+
}
|
|
1171
|
+
)
|
|
1172
|
+
|
|
1173
|
+
// Leaderboard Entity
|
|
1174
|
+
const leaderboardEntity = socialModel.addEntity({
|
|
1175
|
+
info: {
|
|
1176
|
+
name: 'leaderboard',
|
|
1177
|
+
displayName: 'Leaderboard',
|
|
1178
|
+
description: 'Game leaderboard',
|
|
1179
|
+
},
|
|
1180
|
+
})
|
|
1181
|
+
|
|
1182
|
+
addIdField(leaderboardEntity, {
|
|
1183
|
+
displayName: 'Leaderboard ID',
|
|
1184
|
+
description: 'Unique identifier for the leaderboard',
|
|
1185
|
+
})
|
|
1186
|
+
|
|
1187
|
+
addNameField(leaderboardEntity, { description: 'Leaderboard name and title' })
|
|
1188
|
+
|
|
1189
|
+
addDescriptionField(leaderboardEntity, { description: 'Leaderboard description and criteria' })
|
|
1190
|
+
|
|
1191
|
+
leaderboardEntity.addProperty({
|
|
1192
|
+
info: { name: 'leaderboard_type', displayName: 'Leaderboard Type', description: 'Type of leaderboard' },
|
|
1193
|
+
type: 'string',
|
|
1194
|
+
required: true,
|
|
1195
|
+
schema: {
|
|
1196
|
+
enum: ['score', 'time', 'achievements', 'wins', 'level', 'custom'],
|
|
1197
|
+
},
|
|
1198
|
+
})
|
|
1199
|
+
|
|
1200
|
+
leaderboardEntity.addProperty({
|
|
1201
|
+
info: { name: 'time_period', displayName: 'Time Period', description: 'Leaderboard time period' },
|
|
1202
|
+
type: 'string',
|
|
1203
|
+
required: true,
|
|
1204
|
+
schema: {
|
|
1205
|
+
enum: ['daily', 'weekly', 'monthly', 'all_time', 'season'],
|
|
1206
|
+
},
|
|
1207
|
+
})
|
|
1208
|
+
|
|
1209
|
+
leaderboardEntity.addProperty({
|
|
1210
|
+
info: { name: 'max_entries', displayName: 'Max Entries', description: 'Maximum leaderboard entries' },
|
|
1211
|
+
type: 'number',
|
|
1212
|
+
required: true,
|
|
1213
|
+
schema: {
|
|
1214
|
+
minimum: 1,
|
|
1215
|
+
},
|
|
1216
|
+
})
|
|
1217
|
+
|
|
1218
|
+
addCustomStatusField(leaderboardEntity, ['active', 'inactive', 'archived'], {
|
|
1219
|
+
displayName: 'Leaderboard Status',
|
|
1220
|
+
description: 'Current status of the leaderboard',
|
|
1221
|
+
})
|
|
1222
|
+
|
|
1223
|
+
addCreatedAtField(leaderboardEntity, { description: 'When the leaderboard was created' })
|
|
1224
|
+
|
|
1225
|
+
// LeaderboardEntry Entity
|
|
1226
|
+
const leaderboardEntryEntity = socialModel.addEntity({
|
|
1227
|
+
info: {
|
|
1228
|
+
name: 'leaderboard_entry',
|
|
1229
|
+
displayName: 'Leaderboard Entry',
|
|
1230
|
+
description: 'Player leaderboard entry',
|
|
1231
|
+
},
|
|
1232
|
+
})
|
|
1233
|
+
|
|
1234
|
+
addIdField(leaderboardEntryEntity, {
|
|
1235
|
+
displayName: 'Entry ID',
|
|
1236
|
+
description: 'Unique identifier for the leaderboard entry',
|
|
1237
|
+
})
|
|
1238
|
+
|
|
1239
|
+
addNameField(leaderboardEntryEntity, { description: 'Entry name and description' })
|
|
1240
|
+
|
|
1241
|
+
leaderboardEntryEntity.addProperty({
|
|
1242
|
+
info: { name: 'rank', displayName: 'Rank', description: 'Entry rank position' },
|
|
1243
|
+
type: 'number',
|
|
1244
|
+
required: true,
|
|
1245
|
+
schema: {
|
|
1246
|
+
minimum: 1,
|
|
1247
|
+
},
|
|
1248
|
+
})
|
|
1249
|
+
|
|
1250
|
+
leaderboardEntryEntity.addProperty({
|
|
1251
|
+
info: { name: 'score', displayName: 'Score', description: 'Entry score value' },
|
|
1252
|
+
type: 'number',
|
|
1253
|
+
required: true,
|
|
1254
|
+
})
|
|
1255
|
+
|
|
1256
|
+
leaderboardEntryEntity.addProperty({
|
|
1257
|
+
info: { name: 'entry_date', displayName: 'Entry Date', description: 'Entry date' },
|
|
1258
|
+
type: 'date',
|
|
1259
|
+
required: true,
|
|
1260
|
+
})
|
|
1261
|
+
|
|
1262
|
+
addCustomStatusField(leaderboardEntryEntity, ['active', 'archived'], {
|
|
1263
|
+
displayName: 'Entry Status',
|
|
1264
|
+
description: 'Current status of the leaderboard entry',
|
|
1265
|
+
})
|
|
1266
|
+
|
|
1267
|
+
addCreatedAtField(leaderboardEntryEntity, { description: 'When the entry was created' })
|
|
1268
|
+
|
|
1269
|
+
// LeaderboardEntry-Player Association (Many-to-One)
|
|
1270
|
+
leaderboardEntryEntity.addAssociation(
|
|
1271
|
+
{ key: playerEntity.key },
|
|
1272
|
+
{
|
|
1273
|
+
info: { name: 'player', displayName: 'Player', description: 'Player for this entry' },
|
|
1274
|
+
required: true,
|
|
1275
|
+
multiple: false,
|
|
1276
|
+
}
|
|
1277
|
+
)
|
|
1278
|
+
|
|
1279
|
+
// LeaderboardEntry-Leaderboard Association (Many-to-One)
|
|
1280
|
+
leaderboardEntryEntity.addAssociation(
|
|
1281
|
+
{ key: leaderboardEntity.key },
|
|
1282
|
+
{
|
|
1283
|
+
info: { name: 'leaderboard', displayName: 'Leaderboard', description: 'Leaderboard for this entry' },
|
|
1284
|
+
required: true,
|
|
1285
|
+
multiple: false,
|
|
1286
|
+
}
|
|
1287
|
+
)
|
|
1288
|
+
|
|
1289
|
+
return domain
|
|
1290
|
+
}
|