funifier-mcp 0.2.0 → 0.2.4
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/.cursor/rules/funifier.mdc +91 -0
- package/.github/copilot-instructions.md +83 -0
- package/AGENTS.md +97 -0
- package/README.md +247 -78
- package/datasource-funifier-docs/knowledge/guides/aggregates.md +152 -152
- package/datasource-funifier-docs/knowledge/guides/database-access.md +132 -132
- package/datasource-funifier-docs/knowledge/guides/java-entities.md +373 -373
- package/datasource-funifier-docs/knowledge/guides/java-libraries.md +330 -330
- package/datasource-funifier-docs/knowledge/guides/java-managers.md +509 -509
- package/datasource-funifier-docs/knowledge/guides/triggers-guide.md +271 -271
- package/datasource-funifier-docs/knowledge/index.md +121 -121
- package/datasource-funifier-docs/knowledge/modules/achievement.md +46 -46
- package/datasource-funifier-docs/knowledge/modules/action-log.md +88 -88
- package/datasource-funifier-docs/knowledge/modules/action.md +80 -80
- package/datasource-funifier-docs/knowledge/modules/auth.md +104 -104
- package/datasource-funifier-docs/knowledge/modules/avatar.md +28 -28
- package/datasource-funifier-docs/knowledge/modules/backup.md +40 -40
- package/datasource-funifier-docs/knowledge/modules/challenge.md +91 -91
- package/datasource-funifier-docs/knowledge/modules/compact.md +40 -40
- package/datasource-funifier-docs/knowledge/modules/competition.md +149 -149
- package/datasource-funifier-docs/knowledge/modules/crossword.md +41 -41
- package/datasource-funifier-docs/knowledge/modules/csv-data.md +30 -30
- package/datasource-funifier-docs/knowledge/modules/custom-object.md +53 -53
- package/datasource-funifier-docs/knowledge/modules/database.md +241 -241
- package/datasource-funifier-docs/knowledge/modules/folder.md +111 -111
- package/datasource-funifier-docs/knowledge/modules/kpi-formulas.md +23 -23
- package/datasource-funifier-docs/knowledge/modules/lastmile.md +45 -45
- package/datasource-funifier-docs/knowledge/modules/leaderboard.md +98 -98
- package/datasource-funifier-docs/knowledge/modules/level.md +83 -83
- package/datasource-funifier-docs/knowledge/modules/lottery.md +112 -112
- package/datasource-funifier-docs/knowledge/modules/marketplace.md +27 -27
- package/datasource-funifier-docs/knowledge/modules/mystery.md +82 -82
- package/datasource-funifier-docs/knowledge/modules/notification.md +40 -40
- package/datasource-funifier-docs/knowledge/modules/patterns.md +1096 -1096
- package/datasource-funifier-docs/knowledge/modules/player.md +101 -101
- package/datasource-funifier-docs/knowledge/modules/point.md +67 -67
- package/datasource-funifier-docs/knowledge/modules/public.md +253 -253
- package/datasource-funifier-docs/knowledge/modules/question.md +136 -136
- package/datasource-funifier-docs/knowledge/modules/quiz.md +163 -163
- package/datasource-funifier-docs/knowledge/modules/scheduler.md +58 -58
- package/datasource-funifier-docs/knowledge/modules/security.md +169 -169
- package/datasource-funifier-docs/knowledge/modules/staging.md +28 -28
- package/datasource-funifier-docs/knowledge/modules/static-repo.md +41 -41
- package/datasource-funifier-docs/knowledge/modules/story.md +42 -42
- package/datasource-funifier-docs/knowledge/modules/studio-page.md +180 -180
- package/datasource-funifier-docs/knowledge/modules/swap.md +132 -132
- package/datasource-funifier-docs/knowledge/modules/team.md +75 -75
- package/datasource-funifier-docs/knowledge/modules/trigger.md +189 -189
- package/datasource-funifier-docs/knowledge/modules/upload.md +155 -155
- package/datasource-funifier-docs/knowledge/modules/virtual-good.md +99 -99
- package/datasource-funifier-docs/knowledge/modules/webhook.md +41 -41
- package/datasource-funifier-docs/knowledge/modules/websocket.md +41 -41
- package/datasource-funifier-docs/knowledge/modules/widget.md +42 -42
- package/datasource-funifier-docs/process-gtm-saas.md +143 -143
- package/datasource-funifier-docs/process-instagram.md +88 -88
- package/datasource-funifier-docs/process.md +1826 -1826
- package/datasource-funifier-docs/readme.md +132 -132
- package/dist/cli/config-writers.js +11 -11
- package/dist/mcp/bundle.js +82 -77
- package/package.json +70 -67
- package/skills/funifier-create-aggregate/SKILL.md +126 -126
- package/skills/funifier-create-custom-page/SKILL.md +126 -126
- package/skills/funifier-create-scheduler/SKILL.md +126 -126
- package/skills/funifier-create-trigger/SKILL.md +127 -127
|
@@ -1,373 +1,373 @@
|
|
|
1
|
-
# Java Entities — Referência
|
|
2
|
-
|
|
3
|
-
As entidades são os objetos Java (POJOs) que representam os dados armazenados no MongoDB. Cada entidade mapeia para uma coleção no banco de dados.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Entidades Principais
|
|
8
|
-
|
|
9
|
-
### Player
|
|
10
|
-
|
|
11
|
-
**Coleção MongoDB:** `player`
|
|
12
|
-
**Classe:** `com.funifier.engine.player.Player`
|
|
13
|
-
|
|
14
|
-
```java
|
|
15
|
-
// Campos principais
|
|
16
|
-
String _id; // ID do jogador (ex: "john")
|
|
17
|
-
String name; // Nome do jogador
|
|
18
|
-
String email; // Email
|
|
19
|
-
String password; // Senha (hash)
|
|
20
|
-
Map<String, Object> extra; // Campos customizados (ex: department, country)
|
|
21
|
-
List<String> teams; // IDs das equipes
|
|
22
|
-
List<String> friends; // IDs dos amigos
|
|
23
|
-
ImageSet image; // Imagens (small, medium, original)
|
|
24
|
-
Date created; // Data de cadastro
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
```json
|
|
28
|
-
{"_id": "john", "name": "John Travolta", "email": "john@funifier.com", "teams": ["sales"], "extra": {"country": "USA", "department": "IT"}, "image": {"small": {"url": "..."}, "medium": {"url": "..."}, "original": {"url": "..."}}}
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
### Achievement
|
|
34
|
-
|
|
35
|
-
**Coleção MongoDB:** `achievement`
|
|
36
|
-
**Classe:** `com.funifier.engine.achievement.Achievement`
|
|
37
|
-
|
|
38
|
-
Representa qualquer conquista do jogador: pontos ganhos, desafios completados, itens comprados, níveis alcançados.
|
|
39
|
-
|
|
40
|
-
```java
|
|
41
|
-
// Campos principais
|
|
42
|
-
String _id; // ID da conquista
|
|
43
|
-
String player; // ID do jogador
|
|
44
|
-
double total; // Quantidade (pontos, unidades)
|
|
45
|
-
int type; // Tipo (0=Point, 1=Challenge, 2=VirtualGood, 3=Level)
|
|
46
|
-
String item; // ID do item (point_category, challenge, catalog_item, level)
|
|
47
|
-
Date time; // Data da conquista
|
|
48
|
-
|
|
49
|
-
// Constantes de tipo
|
|
50
|
-
static final int TYPE_POINT = 0;
|
|
51
|
-
static final int TYPE_CHALLENGE = 1;
|
|
52
|
-
static final int TYPE_VIRTUAL_GOOD = 2;
|
|
53
|
-
static final int TYPE_LEVEL = 3;
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
{"_id": "64a5d2", "player": "john", "total": 25.0, "type": 0, "item": "xp", "time": {"$date": "2023-07-05T20:57:33.303Z"}}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
### ActionLog
|
|
63
|
-
|
|
64
|
-
**Coleção MongoDB:** `action_log`
|
|
65
|
-
**Classe:** `com.funifier.engine.action.ActionLog`
|
|
66
|
-
|
|
67
|
-
Registo de uma ação executada por um jogador.
|
|
68
|
-
|
|
69
|
-
```java
|
|
70
|
-
// Campos principais
|
|
71
|
-
String _id; // ID do log
|
|
72
|
-
String actionId; // ID da ação (ex: "sell")
|
|
73
|
-
String userId; // ID do jogador (ex: "john")
|
|
74
|
-
Date time; // Data da execução
|
|
75
|
-
Map<String, Object> attributes; // Atributos da ação (ex: product, price)
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
```json
|
|
79
|
-
{"_id": "64a5d92", "actionId": "sell", "userId": "john", "time": {"$date": "2023-07-05T20:57:33.303Z"}, "attributes": {"product": "book", "price": 120}}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
### Action
|
|
85
|
-
|
|
86
|
-
**Coleção MongoDB:** `action`
|
|
87
|
-
**Classe:** `com.funifier.engine.action.Action`
|
|
88
|
-
|
|
89
|
-
Definição de um tipo de ação.
|
|
90
|
-
|
|
91
|
-
```java
|
|
92
|
-
// Campos principais
|
|
93
|
-
String _id; // ID da ação (ex: "sell")
|
|
94
|
-
String action; // Nome da ação (ex: "Sell")
|
|
95
|
-
boolean active; // Se está ativa
|
|
96
|
-
List<ActionAttribute> attributes; // Definição dos atributos (name, type)
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{"_id": "sell", "action": "Sell", "attributes": [{"name": "product", "type": "String"}, {"name": "price", "type": "Number"}], "active": true}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
### Challenge
|
|
106
|
-
|
|
107
|
-
**Coleção MongoDB:** `challenge`
|
|
108
|
-
**Classe:** `com.funifier.engine.challenge.Challenge`
|
|
109
|
-
|
|
110
|
-
Definição de um desafio.
|
|
111
|
-
|
|
112
|
-
```java
|
|
113
|
-
// Campos principais
|
|
114
|
-
String _id; // ID do desafio
|
|
115
|
-
String challenge; // Nome do desafio
|
|
116
|
-
boolean active; // Se está ativo
|
|
117
|
-
List<Rule> rules; // Regras (ação, operador, total)
|
|
118
|
-
List<Reward> points; // Recompensas (pontos, operação)
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
```json
|
|
122
|
-
{"_id": "DTo8dS3", "challenge": "Watch Video", "active": true, "rules": [{"actionId": "watch_video", "operator": 5, "total": 0}], "points": [{"total": 10.0, "category": "xp", "operation": 0}]}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
### CatalogItem
|
|
128
|
-
|
|
129
|
-
**Coleção MongoDB:** `catalog_item`
|
|
130
|
-
**Classe:** `com.funifier.engine.catalog.CatalogItem`
|
|
131
|
-
|
|
132
|
-
Item da loja virtual.
|
|
133
|
-
|
|
134
|
-
```java
|
|
135
|
-
// Campos principais
|
|
136
|
-
String _id; // ID do item
|
|
137
|
-
String catalogId; // ID do catálogo
|
|
138
|
-
String name; // Nome do item
|
|
139
|
-
int amount; // Quantidade disponível
|
|
140
|
-
boolean active; // Se está ativo
|
|
141
|
-
Requirement[] requires; // Requisitos para compra (pontos necessários)
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
```json
|
|
145
|
-
{"_id": "prd1", "catalogId": "gifts", "name": "T-shirt", "amount": 100, "active": true, "requires": [{"total": 15, "type": 0, "item": "coin", "operation": 1}]}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
### Team
|
|
151
|
-
|
|
152
|
-
**Coleção MongoDB:** `team`
|
|
153
|
-
**Classe:** `com.funifier.engine.team.Team`
|
|
154
|
-
|
|
155
|
-
```java
|
|
156
|
-
String _id; // ID da equipe
|
|
157
|
-
String name; // Nome da equipe
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
### Level
|
|
163
|
-
|
|
164
|
-
**Coleção MongoDB:** `level`
|
|
165
|
-
**Classe:** `com.funifier.engine.level.Level`
|
|
166
|
-
|
|
167
|
-
```java
|
|
168
|
-
String _id; // ID do nível
|
|
169
|
-
String level; // Nome do nível
|
|
170
|
-
int position; // Posição (ordem)
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
### PointCategory
|
|
176
|
-
|
|
177
|
-
**Coleção MongoDB:** `point_category`
|
|
178
|
-
**Classe:** `com.funifier.engine.point.PointCategory`
|
|
179
|
-
|
|
180
|
-
```java
|
|
181
|
-
String _id; // ID da categoria (ex: "xp")
|
|
182
|
-
String category; // Nome (ex: "Experience Points")
|
|
183
|
-
String shortName; // Abreviação (ex: "XP")
|
|
184
|
-
Map extra; // Campos extras
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
### Lottery
|
|
190
|
-
|
|
191
|
-
**Coleção MongoDB:** `lottery`
|
|
192
|
-
**Classe:** `com.funifier.engine.lottery.Lottery`
|
|
193
|
-
|
|
194
|
-
```java
|
|
195
|
-
String _id; // ID do sorteio
|
|
196
|
-
String title; // Título
|
|
197
|
-
boolean active; // Se está ativo
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
### LotteryTicket
|
|
203
|
-
|
|
204
|
-
**Coleção MongoDB:** `lottery_ticket`
|
|
205
|
-
**Classe:** `com.funifier.engine.lottery.LotteryTicket`
|
|
206
|
-
|
|
207
|
-
```java
|
|
208
|
-
String _id; // ID do ticket
|
|
209
|
-
String lottery; // ID do sorteio
|
|
210
|
-
String player; // ID do jogador
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
### MysteryBox
|
|
216
|
-
|
|
217
|
-
**Coleção MongoDB:** `mystery_box`
|
|
218
|
-
**Classe:** `com.funifier.engine.mystery.MysteryBox`
|
|
219
|
-
|
|
220
|
-
```java
|
|
221
|
-
String _id; // ID da caixa
|
|
222
|
-
String title; // Título
|
|
223
|
-
boolean active; // Se está ativa
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Competition
|
|
229
|
-
|
|
230
|
-
**Coleção MongoDB:** `competition`
|
|
231
|
-
**Classe:** `com.funifier.engine.competition.Competition`
|
|
232
|
-
|
|
233
|
-
```java
|
|
234
|
-
String _id; // ID da competição
|
|
235
|
-
boolean active; // Se está ativa
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
### Question
|
|
241
|
-
|
|
242
|
-
**Coleção MongoDB:** `question`
|
|
243
|
-
**Classe:** `com.funifier.engine.question.Question`
|
|
244
|
-
|
|
245
|
-
```java
|
|
246
|
-
String _id; // ID da pergunta
|
|
247
|
-
String question; // Texto da pergunta
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
### QuestionLog
|
|
253
|
-
|
|
254
|
-
**Coleção MongoDB:** `question_log`
|
|
255
|
-
**Classe:** `com.funifier.engine.question.QuestionLog`
|
|
256
|
-
|
|
257
|
-
```java
|
|
258
|
-
String _id; // ID do log
|
|
259
|
-
String player; // ID do jogador
|
|
260
|
-
String question; // ID da pergunta
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
### Quiz / QuizLog
|
|
266
|
-
|
|
267
|
-
**Coleções:** `quiz` / `quiz_log`
|
|
268
|
-
|
|
269
|
-
---
|
|
270
|
-
|
|
271
|
-
### Notification
|
|
272
|
-
|
|
273
|
-
**Coleção MongoDB:** `notification`
|
|
274
|
-
**Classe:** `com.funifier.engine.notify.Notification`
|
|
275
|
-
|
|
276
|
-
```java
|
|
277
|
-
String _id; // ID da notificação
|
|
278
|
-
String player; // ID do jogador destino
|
|
279
|
-
String title; // Título
|
|
280
|
-
String message; // Mensagem
|
|
281
|
-
Date time; // Data
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
### Swap
|
|
287
|
-
|
|
288
|
-
**Coleção MongoDB:** `swap`
|
|
289
|
-
**Classe:** `com.funifier.engine.swap.Swap`
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
### Trigger
|
|
294
|
-
|
|
295
|
-
**Coleção MongoDB:** `trigger`
|
|
296
|
-
**Classe:** `com.funifier.engine.integration.trigger.Trigger`
|
|
297
|
-
|
|
298
|
-
```java
|
|
299
|
-
String _id; // ID da trigger
|
|
300
|
-
String name; // Nome
|
|
301
|
-
String entity; // Entidade (ex: "player", "achievement")
|
|
302
|
-
String event; // Evento (ex: "before_create", "after_win")
|
|
303
|
-
String script; // Código Java
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
### SchedulerConfig
|
|
309
|
-
|
|
310
|
-
**Coleção MongoDB:** `scheduler`
|
|
311
|
-
**Classe:** `com.funifier.engine.integration.scheduler.SchedulerConfig`
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
### PublicEndpoint
|
|
316
|
-
|
|
317
|
-
**Coleção MongoDB:** `public_endpoint`
|
|
318
|
-
**Classe:** `com.funifier.engine.pub.PublicEndpoint`
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
### Webhook
|
|
323
|
-
|
|
324
|
-
**Coleção MongoDB:** `webhook`
|
|
325
|
-
**Classe:** `com.funifier.engine.webhook.Webhook`
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## Mapeamento Completo Entidade → Coleção
|
|
330
|
-
|
|
331
|
-
| Entidade | Coleção MongoDB | Classe Java |
|
|
332
|
-
|----------|----------------|-------------|
|
|
333
|
-
| PLAYER | `player` | Player |
|
|
334
|
-
| PLAYER_STATUS | `player_status` | PlayerStatus |
|
|
335
|
-
| TEAM | `team` | Team |
|
|
336
|
-
| TEAM_PLAYER | `team_player` | TeamLink |
|
|
337
|
-
| ACHIEVEMENT | `achievement` | Achievement |
|
|
338
|
-
| CHALLENGE | `challenge` | Challenge |
|
|
339
|
-
| ACTION_LOG | `action_log` | ActionLog |
|
|
340
|
-
| ACTION | `action` | Action |
|
|
341
|
-
| CATALOG | `catalog` | Catalog |
|
|
342
|
-
| CATALOG_ITEM | `catalog_item` | CatalogItem |
|
|
343
|
-
| PURCHASE | `purchase` | Purchase |
|
|
344
|
-
| POINT_CATEGORY | `point_category` | PointCategory |
|
|
345
|
-
| LEVEL | `level` | Level |
|
|
346
|
-
| LEVEL_CONFIG | `level_config` | LevelConfig |
|
|
347
|
-
| LEADERBOARD | `leaderboard` | LeaderBoard_V2 |
|
|
348
|
-
| LEADER | `leader` | Leader |
|
|
349
|
-
| LOTTERY | `lottery` | Lottery |
|
|
350
|
-
| LOTTERY_TICKET | `lottery_ticket` | LotteryTicket |
|
|
351
|
-
| MYSTERY_BOX | `mystery_box` | MysteryBox |
|
|
352
|
-
| MYSTERY_BOX_LOG | `mystery_box_log` | MysteryBoxLog |
|
|
353
|
-
| NOTIFICATION | `notification` | Notification |
|
|
354
|
-
| QUESTION | `question` | Question |
|
|
355
|
-
| QUESTION_LOG | `question_log` | QuestionLog |
|
|
356
|
-
| QUIZ | `quiz` | Quiz |
|
|
357
|
-
| QUIZ_LOG | `quiz_log` | QuizLog |
|
|
358
|
-
| COMPETITION | `competition` | Competition |
|
|
359
|
-
| COMPETITION_JOIN | `competition_join` | CompetitionJoin |
|
|
360
|
-
| SWAP | `swap` | Swap |
|
|
361
|
-
| FOLDER | `folder` | Folder |
|
|
362
|
-
| TRIGGER | `trigger` | Trigger |
|
|
363
|
-
| TRIGGER_LOG | `trigger_log` | TriggerLog |
|
|
364
|
-
| SCHEDULER | `scheduler` | SchedulerConfig |
|
|
365
|
-
| SCHEDULER_LOG | `scheduler_log` | SchedulerLog |
|
|
366
|
-
| PUBLIC_ENDPOINT | `public_endpoint` | PublicEndpoint |
|
|
367
|
-
| WEBHOOK | `webhook` | Webhook |
|
|
368
|
-
| WEBSOCKET | `websocket` | WebSocket |
|
|
369
|
-
| STUDIO_PAGE | `studio_page` | StudioPage |
|
|
370
|
-
| BACKUP | `backup` | Backup |
|
|
371
|
-
| COMPACT | `compact` | Compact |
|
|
372
|
-
|
|
373
|
-
> **Nota:** Coleções customizadas (Custom Objects) usam o sufixo `__c` (ex: `car__c`, `email__c`) e são acessadas como `HashMap`.
|
|
1
|
+
# Java Entities — Referência
|
|
2
|
+
|
|
3
|
+
As entidades são os objetos Java (POJOs) que representam os dados armazenados no MongoDB. Cada entidade mapeia para uma coleção no banco de dados.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Entidades Principais
|
|
8
|
+
|
|
9
|
+
### Player
|
|
10
|
+
|
|
11
|
+
**Coleção MongoDB:** `player`
|
|
12
|
+
**Classe:** `com.funifier.engine.player.Player`
|
|
13
|
+
|
|
14
|
+
```java
|
|
15
|
+
// Campos principais
|
|
16
|
+
String _id; // ID do jogador (ex: "john")
|
|
17
|
+
String name; // Nome do jogador
|
|
18
|
+
String email; // Email
|
|
19
|
+
String password; // Senha (hash)
|
|
20
|
+
Map<String, Object> extra; // Campos customizados (ex: department, country)
|
|
21
|
+
List<String> teams; // IDs das equipes
|
|
22
|
+
List<String> friends; // IDs dos amigos
|
|
23
|
+
ImageSet image; // Imagens (small, medium, original)
|
|
24
|
+
Date created; // Data de cadastro
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{"_id": "john", "name": "John Travolta", "email": "john@funifier.com", "teams": ["sales"], "extra": {"country": "USA", "department": "IT"}, "image": {"small": {"url": "..."}, "medium": {"url": "..."}, "original": {"url": "..."}}}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### Achievement
|
|
34
|
+
|
|
35
|
+
**Coleção MongoDB:** `achievement`
|
|
36
|
+
**Classe:** `com.funifier.engine.achievement.Achievement`
|
|
37
|
+
|
|
38
|
+
Representa qualquer conquista do jogador: pontos ganhos, desafios completados, itens comprados, níveis alcançados.
|
|
39
|
+
|
|
40
|
+
```java
|
|
41
|
+
// Campos principais
|
|
42
|
+
String _id; // ID da conquista
|
|
43
|
+
String player; // ID do jogador
|
|
44
|
+
double total; // Quantidade (pontos, unidades)
|
|
45
|
+
int type; // Tipo (0=Point, 1=Challenge, 2=VirtualGood, 3=Level)
|
|
46
|
+
String item; // ID do item (point_category, challenge, catalog_item, level)
|
|
47
|
+
Date time; // Data da conquista
|
|
48
|
+
|
|
49
|
+
// Constantes de tipo
|
|
50
|
+
static final int TYPE_POINT = 0;
|
|
51
|
+
static final int TYPE_CHALLENGE = 1;
|
|
52
|
+
static final int TYPE_VIRTUAL_GOOD = 2;
|
|
53
|
+
static final int TYPE_LEVEL = 3;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{"_id": "64a5d2", "player": "john", "total": 25.0, "type": 0, "item": "xp", "time": {"$date": "2023-07-05T20:57:33.303Z"}}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### ActionLog
|
|
63
|
+
|
|
64
|
+
**Coleção MongoDB:** `action_log`
|
|
65
|
+
**Classe:** `com.funifier.engine.action.ActionLog`
|
|
66
|
+
|
|
67
|
+
Registo de uma ação executada por um jogador.
|
|
68
|
+
|
|
69
|
+
```java
|
|
70
|
+
// Campos principais
|
|
71
|
+
String _id; // ID do log
|
|
72
|
+
String actionId; // ID da ação (ex: "sell")
|
|
73
|
+
String userId; // ID do jogador (ex: "john")
|
|
74
|
+
Date time; // Data da execução
|
|
75
|
+
Map<String, Object> attributes; // Atributos da ação (ex: product, price)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{"_id": "64a5d92", "actionId": "sell", "userId": "john", "time": {"$date": "2023-07-05T20:57:33.303Z"}, "attributes": {"product": "book", "price": 120}}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### Action
|
|
85
|
+
|
|
86
|
+
**Coleção MongoDB:** `action`
|
|
87
|
+
**Classe:** `com.funifier.engine.action.Action`
|
|
88
|
+
|
|
89
|
+
Definição de um tipo de ação.
|
|
90
|
+
|
|
91
|
+
```java
|
|
92
|
+
// Campos principais
|
|
93
|
+
String _id; // ID da ação (ex: "sell")
|
|
94
|
+
String action; // Nome da ação (ex: "Sell")
|
|
95
|
+
boolean active; // Se está ativa
|
|
96
|
+
List<ActionAttribute> attributes; // Definição dos atributos (name, type)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{"_id": "sell", "action": "Sell", "attributes": [{"name": "product", "type": "String"}, {"name": "price", "type": "Number"}], "active": true}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### Challenge
|
|
106
|
+
|
|
107
|
+
**Coleção MongoDB:** `challenge`
|
|
108
|
+
**Classe:** `com.funifier.engine.challenge.Challenge`
|
|
109
|
+
|
|
110
|
+
Definição de um desafio.
|
|
111
|
+
|
|
112
|
+
```java
|
|
113
|
+
// Campos principais
|
|
114
|
+
String _id; // ID do desafio
|
|
115
|
+
String challenge; // Nome do desafio
|
|
116
|
+
boolean active; // Se está ativo
|
|
117
|
+
List<Rule> rules; // Regras (ação, operador, total)
|
|
118
|
+
List<Reward> points; // Recompensas (pontos, operação)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{"_id": "DTo8dS3", "challenge": "Watch Video", "active": true, "rules": [{"actionId": "watch_video", "operator": 5, "total": 0}], "points": [{"total": 10.0, "category": "xp", "operation": 0}]}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### CatalogItem
|
|
128
|
+
|
|
129
|
+
**Coleção MongoDB:** `catalog_item`
|
|
130
|
+
**Classe:** `com.funifier.engine.catalog.CatalogItem`
|
|
131
|
+
|
|
132
|
+
Item da loja virtual.
|
|
133
|
+
|
|
134
|
+
```java
|
|
135
|
+
// Campos principais
|
|
136
|
+
String _id; // ID do item
|
|
137
|
+
String catalogId; // ID do catálogo
|
|
138
|
+
String name; // Nome do item
|
|
139
|
+
int amount; // Quantidade disponível
|
|
140
|
+
boolean active; // Se está ativo
|
|
141
|
+
Requirement[] requires; // Requisitos para compra (pontos necessários)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{"_id": "prd1", "catalogId": "gifts", "name": "T-shirt", "amount": 100, "active": true, "requires": [{"total": 15, "type": 0, "item": "coin", "operation": 1}]}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Team
|
|
151
|
+
|
|
152
|
+
**Coleção MongoDB:** `team`
|
|
153
|
+
**Classe:** `com.funifier.engine.team.Team`
|
|
154
|
+
|
|
155
|
+
```java
|
|
156
|
+
String _id; // ID da equipe
|
|
157
|
+
String name; // Nome da equipe
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### Level
|
|
163
|
+
|
|
164
|
+
**Coleção MongoDB:** `level`
|
|
165
|
+
**Classe:** `com.funifier.engine.level.Level`
|
|
166
|
+
|
|
167
|
+
```java
|
|
168
|
+
String _id; // ID do nível
|
|
169
|
+
String level; // Nome do nível
|
|
170
|
+
int position; // Posição (ordem)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
### PointCategory
|
|
176
|
+
|
|
177
|
+
**Coleção MongoDB:** `point_category`
|
|
178
|
+
**Classe:** `com.funifier.engine.point.PointCategory`
|
|
179
|
+
|
|
180
|
+
```java
|
|
181
|
+
String _id; // ID da categoria (ex: "xp")
|
|
182
|
+
String category; // Nome (ex: "Experience Points")
|
|
183
|
+
String shortName; // Abreviação (ex: "XP")
|
|
184
|
+
Map extra; // Campos extras
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Lottery
|
|
190
|
+
|
|
191
|
+
**Coleção MongoDB:** `lottery`
|
|
192
|
+
**Classe:** `com.funifier.engine.lottery.Lottery`
|
|
193
|
+
|
|
194
|
+
```java
|
|
195
|
+
String _id; // ID do sorteio
|
|
196
|
+
String title; // Título
|
|
197
|
+
boolean active; // Se está ativo
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### LotteryTicket
|
|
203
|
+
|
|
204
|
+
**Coleção MongoDB:** `lottery_ticket`
|
|
205
|
+
**Classe:** `com.funifier.engine.lottery.LotteryTicket`
|
|
206
|
+
|
|
207
|
+
```java
|
|
208
|
+
String _id; // ID do ticket
|
|
209
|
+
String lottery; // ID do sorteio
|
|
210
|
+
String player; // ID do jogador
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### MysteryBox
|
|
216
|
+
|
|
217
|
+
**Coleção MongoDB:** `mystery_box`
|
|
218
|
+
**Classe:** `com.funifier.engine.mystery.MysteryBox`
|
|
219
|
+
|
|
220
|
+
```java
|
|
221
|
+
String _id; // ID da caixa
|
|
222
|
+
String title; // Título
|
|
223
|
+
boolean active; // Se está ativa
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### Competition
|
|
229
|
+
|
|
230
|
+
**Coleção MongoDB:** `competition`
|
|
231
|
+
**Classe:** `com.funifier.engine.competition.Competition`
|
|
232
|
+
|
|
233
|
+
```java
|
|
234
|
+
String _id; // ID da competição
|
|
235
|
+
boolean active; // Se está ativa
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
### Question
|
|
241
|
+
|
|
242
|
+
**Coleção MongoDB:** `question`
|
|
243
|
+
**Classe:** `com.funifier.engine.question.Question`
|
|
244
|
+
|
|
245
|
+
```java
|
|
246
|
+
String _id; // ID da pergunta
|
|
247
|
+
String question; // Texto da pergunta
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
### QuestionLog
|
|
253
|
+
|
|
254
|
+
**Coleção MongoDB:** `question_log`
|
|
255
|
+
**Classe:** `com.funifier.engine.question.QuestionLog`
|
|
256
|
+
|
|
257
|
+
```java
|
|
258
|
+
String _id; // ID do log
|
|
259
|
+
String player; // ID do jogador
|
|
260
|
+
String question; // ID da pergunta
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Quiz / QuizLog
|
|
266
|
+
|
|
267
|
+
**Coleções:** `quiz` / `quiz_log`
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### Notification
|
|
272
|
+
|
|
273
|
+
**Coleção MongoDB:** `notification`
|
|
274
|
+
**Classe:** `com.funifier.engine.notify.Notification`
|
|
275
|
+
|
|
276
|
+
```java
|
|
277
|
+
String _id; // ID da notificação
|
|
278
|
+
String player; // ID do jogador destino
|
|
279
|
+
String title; // Título
|
|
280
|
+
String message; // Mensagem
|
|
281
|
+
Date time; // Data
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### Swap
|
|
287
|
+
|
|
288
|
+
**Coleção MongoDB:** `swap`
|
|
289
|
+
**Classe:** `com.funifier.engine.swap.Swap`
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
### Trigger
|
|
294
|
+
|
|
295
|
+
**Coleção MongoDB:** `trigger`
|
|
296
|
+
**Classe:** `com.funifier.engine.integration.trigger.Trigger`
|
|
297
|
+
|
|
298
|
+
```java
|
|
299
|
+
String _id; // ID da trigger
|
|
300
|
+
String name; // Nome
|
|
301
|
+
String entity; // Entidade (ex: "player", "achievement")
|
|
302
|
+
String event; // Evento (ex: "before_create", "after_win")
|
|
303
|
+
String script; // Código Java
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
### SchedulerConfig
|
|
309
|
+
|
|
310
|
+
**Coleção MongoDB:** `scheduler`
|
|
311
|
+
**Classe:** `com.funifier.engine.integration.scheduler.SchedulerConfig`
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### PublicEndpoint
|
|
316
|
+
|
|
317
|
+
**Coleção MongoDB:** `public_endpoint`
|
|
318
|
+
**Classe:** `com.funifier.engine.pub.PublicEndpoint`
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
### Webhook
|
|
323
|
+
|
|
324
|
+
**Coleção MongoDB:** `webhook`
|
|
325
|
+
**Classe:** `com.funifier.engine.webhook.Webhook`
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Mapeamento Completo Entidade → Coleção
|
|
330
|
+
|
|
331
|
+
| Entidade | Coleção MongoDB | Classe Java |
|
|
332
|
+
|----------|----------------|-------------|
|
|
333
|
+
| PLAYER | `player` | Player |
|
|
334
|
+
| PLAYER_STATUS | `player_status` | PlayerStatus |
|
|
335
|
+
| TEAM | `team` | Team |
|
|
336
|
+
| TEAM_PLAYER | `team_player` | TeamLink |
|
|
337
|
+
| ACHIEVEMENT | `achievement` | Achievement |
|
|
338
|
+
| CHALLENGE | `challenge` | Challenge |
|
|
339
|
+
| ACTION_LOG | `action_log` | ActionLog |
|
|
340
|
+
| ACTION | `action` | Action |
|
|
341
|
+
| CATALOG | `catalog` | Catalog |
|
|
342
|
+
| CATALOG_ITEM | `catalog_item` | CatalogItem |
|
|
343
|
+
| PURCHASE | `purchase` | Purchase |
|
|
344
|
+
| POINT_CATEGORY | `point_category` | PointCategory |
|
|
345
|
+
| LEVEL | `level` | Level |
|
|
346
|
+
| LEVEL_CONFIG | `level_config` | LevelConfig |
|
|
347
|
+
| LEADERBOARD | `leaderboard` | LeaderBoard_V2 |
|
|
348
|
+
| LEADER | `leader` | Leader |
|
|
349
|
+
| LOTTERY | `lottery` | Lottery |
|
|
350
|
+
| LOTTERY_TICKET | `lottery_ticket` | LotteryTicket |
|
|
351
|
+
| MYSTERY_BOX | `mystery_box` | MysteryBox |
|
|
352
|
+
| MYSTERY_BOX_LOG | `mystery_box_log` | MysteryBoxLog |
|
|
353
|
+
| NOTIFICATION | `notification` | Notification |
|
|
354
|
+
| QUESTION | `question` | Question |
|
|
355
|
+
| QUESTION_LOG | `question_log` | QuestionLog |
|
|
356
|
+
| QUIZ | `quiz` | Quiz |
|
|
357
|
+
| QUIZ_LOG | `quiz_log` | QuizLog |
|
|
358
|
+
| COMPETITION | `competition` | Competition |
|
|
359
|
+
| COMPETITION_JOIN | `competition_join` | CompetitionJoin |
|
|
360
|
+
| SWAP | `swap` | Swap |
|
|
361
|
+
| FOLDER | `folder` | Folder |
|
|
362
|
+
| TRIGGER | `trigger` | Trigger |
|
|
363
|
+
| TRIGGER_LOG | `trigger_log` | TriggerLog |
|
|
364
|
+
| SCHEDULER | `scheduler` | SchedulerConfig |
|
|
365
|
+
| SCHEDULER_LOG | `scheduler_log` | SchedulerLog |
|
|
366
|
+
| PUBLIC_ENDPOINT | `public_endpoint` | PublicEndpoint |
|
|
367
|
+
| WEBHOOK | `webhook` | Webhook |
|
|
368
|
+
| WEBSOCKET | `websocket` | WebSocket |
|
|
369
|
+
| STUDIO_PAGE | `studio_page` | StudioPage |
|
|
370
|
+
| BACKUP | `backup` | Backup |
|
|
371
|
+
| COMPACT | `compact` | Compact |
|
|
372
|
+
|
|
373
|
+
> **Nota:** Coleções customizadas (Custom Objects) usam o sufixo `__c` (ex: `car__c`, `email__c`) e são acessadas como `HashMap`.
|