@armoyu/core 1.0.0
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/dist/api/ApiClient.d.ts +16 -0
- package/dist/api/ApiClient.d.ts.map +1 -0
- package/dist/api/ApiClient.js +50 -0
- package/dist/api/ApiClient.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/models/auth/Role.d.ts +14 -0
- package/dist/models/auth/Role.d.ts.map +1 -0
- package/dist/models/auth/Role.js +28 -0
- package/dist/models/auth/Role.js.map +1 -0
- package/dist/models/auth/Session.d.ts +23 -0
- package/dist/models/auth/Session.d.ts.map +1 -0
- package/dist/models/auth/Session.js +43 -0
- package/dist/models/auth/Session.js.map +1 -0
- package/dist/models/auth/User.d.ts +52 -0
- package/dist/models/auth/User.d.ts.map +1 -0
- package/dist/models/auth/User.js +98 -0
- package/dist/models/auth/User.js.map +1 -0
- package/dist/models/community/Classroom.d.ts +18 -0
- package/dist/models/community/Classroom.d.ts.map +1 -0
- package/dist/models/community/Classroom.js +35 -0
- package/dist/models/community/Classroom.js.map +1 -0
- package/dist/models/community/Event.d.ts +26 -0
- package/dist/models/community/Event.d.ts.map +1 -0
- package/dist/models/community/Event.js +34 -0
- package/dist/models/community/Event.js.map +1 -0
- package/dist/models/community/Faculty.d.ts +16 -0
- package/dist/models/community/Faculty.d.ts.map +1 -0
- package/dist/models/community/Faculty.js +31 -0
- package/dist/models/community/Faculty.js.map +1 -0
- package/dist/models/community/Forum.d.ts +25 -0
- package/dist/models/community/Forum.d.ts.map +1 -0
- package/dist/models/community/Forum.js +37 -0
- package/dist/models/community/Forum.js.map +1 -0
- package/dist/models/community/Giveaway.d.ts +21 -0
- package/dist/models/community/Giveaway.d.ts.map +1 -0
- package/dist/models/community/Giveaway.js +40 -0
- package/dist/models/community/Giveaway.js.map +1 -0
- package/dist/models/community/Group.d.ts +37 -0
- package/dist/models/community/Group.d.ts.map +1 -0
- package/dist/models/community/Group.js +77 -0
- package/dist/models/community/Group.js.map +1 -0
- package/dist/models/community/School.d.ts +27 -0
- package/dist/models/community/School.d.ts.map +1 -0
- package/dist/models/community/School.js +50 -0
- package/dist/models/community/School.js.map +1 -0
- package/dist/models/community/SchoolTeam.d.ts +26 -0
- package/dist/models/community/SchoolTeam.d.ts.map +1 -0
- package/dist/models/community/SchoolTeam.js +43 -0
- package/dist/models/community/SchoolTeam.js.map +1 -0
- package/dist/models/community/Station.d.ts +68 -0
- package/dist/models/community/Station.d.ts.map +1 -0
- package/dist/models/community/Station.js +130 -0
- package/dist/models/community/Station.js.map +1 -0
- package/dist/models/community/Survey.d.ts +26 -0
- package/dist/models/community/Survey.d.ts.map +1 -0
- package/dist/models/community/Survey.js +53 -0
- package/dist/models/community/Survey.js.map +1 -0
- package/dist/models/community/SurveyAnswer.d.ts +14 -0
- package/dist/models/community/SurveyAnswer.d.ts.map +1 -0
- package/dist/models/community/SurveyAnswer.js +28 -0
- package/dist/models/community/SurveyAnswer.js.map +1 -0
- package/dist/models/community/Team.d.ts +12 -0
- package/dist/models/community/Team.d.ts.map +1 -0
- package/dist/models/community/Team.js +26 -0
- package/dist/models/community/Team.js.map +1 -0
- package/dist/models/community/Workplace.d.ts +17 -0
- package/dist/models/community/Workplace.d.ts.map +1 -0
- package/dist/models/community/Workplace.js +34 -0
- package/dist/models/community/Workplace.js.map +1 -0
- package/dist/models/content/Game.d.ts +18 -0
- package/dist/models/content/Game.d.ts.map +1 -0
- package/dist/models/content/Game.js +41 -0
- package/dist/models/content/Game.js.map +1 -0
- package/dist/models/content/Media.d.ts +16 -0
- package/dist/models/content/Media.d.ts.map +1 -0
- package/dist/models/content/Media.js +32 -0
- package/dist/models/content/Media.js.map +1 -0
- package/dist/models/content/Mod.d.ts +20 -0
- package/dist/models/content/Mod.d.ts.map +1 -0
- package/dist/models/content/Mod.js +39 -0
- package/dist/models/content/Mod.js.map +1 -0
- package/dist/models/content/News.d.ts +23 -0
- package/dist/models/content/News.d.ts.map +1 -0
- package/dist/models/content/News.js +43 -0
- package/dist/models/content/News.js.map +1 -0
- package/dist/models/content/Project.d.ts +26 -0
- package/dist/models/content/Project.d.ts.map +1 -0
- package/dist/models/content/Project.js +45 -0
- package/dist/models/content/Project.js.map +1 -0
- package/dist/models/core/PlatformStats.d.ts +41 -0
- package/dist/models/core/PlatformStats.d.ts.map +1 -0
- package/dist/models/core/PlatformStats.js +61 -0
- package/dist/models/core/PlatformStats.js.map +1 -0
- package/dist/models/core/SystemSettings.d.ts +33 -0
- package/dist/models/core/SystemSettings.d.ts.map +1 -0
- package/dist/models/core/SystemSettings.js +42 -0
- package/dist/models/core/SystemSettings.js.map +1 -0
- package/dist/models/index.d.ts +37 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +53 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/shop/CartItem.d.ts +13 -0
- package/dist/models/shop/CartItem.d.ts.map +1 -0
- package/dist/models/shop/CartItem.js +27 -0
- package/dist/models/shop/CartItem.js.map +1 -0
- package/dist/models/shop/Order.d.ts +19 -0
- package/dist/models/shop/Order.d.ts.map +1 -0
- package/dist/models/shop/Order.js +40 -0
- package/dist/models/shop/Order.js.map +1 -0
- package/dist/models/shop/Product.d.ts +19 -0
- package/dist/models/shop/Product.d.ts.map +1 -0
- package/dist/models/shop/Product.js +52 -0
- package/dist/models/shop/Product.js.map +1 -0
- package/dist/models/social/Chat.d.ts +25 -0
- package/dist/models/social/Chat.d.ts.map +1 -0
- package/dist/models/social/Chat.js +48 -0
- package/dist/models/social/Chat.js.map +1 -0
- package/dist/models/social/ChatMessage.d.ts +16 -0
- package/dist/models/social/ChatMessage.d.ts.map +1 -0
- package/dist/models/social/ChatMessage.js +31 -0
- package/dist/models/social/ChatMessage.js.map +1 -0
- package/dist/models/social/Comment.d.ts +20 -0
- package/dist/models/social/Comment.d.ts.map +1 -0
- package/dist/models/social/Comment.js +38 -0
- package/dist/models/social/Comment.js.map +1 -0
- package/dist/models/social/Group.d.ts +30 -0
- package/dist/models/social/Group.d.ts.map +1 -0
- package/dist/models/social/Group.js +66 -0
- package/dist/models/social/Group.js.map +1 -0
- package/dist/models/social/Leaderboard.d.ts +24 -0
- package/dist/models/social/Leaderboard.d.ts.map +1 -0
- package/dist/models/social/Leaderboard.js +56 -0
- package/dist/models/social/Leaderboard.js.map +1 -0
- package/dist/models/social/Note.d.ts +15 -0
- package/dist/models/social/Note.d.ts.map +1 -0
- package/dist/models/social/Note.js +29 -0
- package/dist/models/social/Note.js.map +1 -0
- package/dist/models/social/Notification.d.ts +30 -0
- package/dist/models/social/Notification.d.ts.map +1 -0
- package/dist/models/social/Notification.js +88 -0
- package/dist/models/social/Notification.js.map +1 -0
- package/dist/models/social/NotificationSender.d.ts +18 -0
- package/dist/models/social/NotificationSender.d.ts.map +1 -0
- package/dist/models/social/NotificationSender.js +27 -0
- package/dist/models/social/NotificationSender.js.map +1 -0
- package/dist/models/social/Post.d.ts +41 -0
- package/dist/models/social/Post.d.ts.map +1 -0
- package/dist/models/social/Post.js +53 -0
- package/dist/models/social/Post.js.map +1 -0
- package/dist/models/social/Story.d.ts +16 -0
- package/dist/models/social/Story.d.ts.map +1 -0
- package/dist/models/social/Story.js +31 -0
- package/dist/models/social/Story.js.map +1 -0
- package/dist/models/social/SupportTicket.d.ts +20 -0
- package/dist/models/social/SupportTicket.d.ts.map +1 -0
- package/dist/models/social/SupportTicket.js +38 -0
- package/dist/models/social/SupportTicket.js.map +1 -0
- package/dist/models/store/StoreItem.d.ts +17 -0
- package/dist/models/store/StoreItem.d.ts.map +1 -0
- package/dist/models/store/StoreItem.js +34 -0
- package/dist/models/store/StoreItem.js.map +1 -0
- package/dist/services/AuthService.d.ts +30 -0
- package/dist/services/AuthService.d.ts.map +1 -0
- package/dist/services/AuthService.js +88 -0
- package/dist/services/AuthService.js.map +1 -0
- package/dist/services/SocialService.d.ts +28 -0
- package/dist/services/SocialService.d.ts.map +1 -0
- package/dist/services/SocialService.js +91 -0
- package/dist/services/SocialService.js.map +1 -0
- package/dist/services/SocketService.d.ts +20 -0
- package/dist/services/SocketService.d.ts.map +1 -0
- package/dist/services/SocketService.js +122 -0
- package/dist/services/SocketService.js.map +1 -0
- package/dist/services/UserService.d.ts +23 -0
- package/dist/services/UserService.d.ts.map +1 -0
- package/dist/services/UserService.js +73 -0
- package/dist/services/UserService.js.map +1 -0
- package/dist/types/stats.d.ts +17 -0
- package/dist/types/stats.d.ts.map +1 -0
- package/dist/types/stats.js +2 -0
- package/dist/types/stats.js.map +1 -0
- package/package.json +21 -0
- package/src/api/ApiClient.ts +57 -0
- package/src/index.ts +24 -0
- package/src/models/auth/Role.ts +26 -0
- package/src/models/auth/Session.ts +50 -0
- package/src/models/auth/User.ts +111 -0
- package/src/models/community/Classroom.ts +34 -0
- package/src/models/community/Event.ts +32 -0
- package/src/models/community/Faculty.ts +30 -0
- package/src/models/community/Forum.ts +42 -0
- package/src/models/community/Giveaway.ts +39 -0
- package/src/models/community/Group.ts +78 -0
- package/src/models/community/School.ts +51 -0
- package/src/models/community/SchoolTeam.ts +49 -0
- package/src/models/community/Station.ts +145 -0
- package/src/models/community/Survey.ts +53 -0
- package/src/models/community/SurveyAnswer.ts +26 -0
- package/src/models/community/Team.ts +24 -0
- package/src/models/community/Workplace.ts +32 -0
- package/src/models/content/Game.ts +39 -0
- package/src/models/content/Media.ts +30 -0
- package/src/models/content/Mod.ts +38 -0
- package/src/models/content/News.ts +43 -0
- package/src/models/content/Project.ts +49 -0
- package/src/models/core/PlatformStats.ts +74 -0
- package/src/models/core/SystemSettings.ts +59 -0
- package/src/models/index.ts +37 -0
- package/src/models/shop/CartItem.ts +31 -0
- package/src/models/shop/Order.ts +48 -0
- package/src/models/shop/Product.ts +61 -0
- package/src/models/social/Chat.ts +47 -0
- package/src/models/social/ChatMessage.ts +30 -0
- package/src/models/social/Comment.ts +38 -0
- package/src/models/social/Group.ts +63 -0
- package/src/models/social/Leaderboard.ts +57 -0
- package/src/models/social/Note.ts +28 -0
- package/src/models/social/Notification.ts +99 -0
- package/src/models/social/NotificationSender.ts +36 -0
- package/src/models/social/Post.ts +75 -0
- package/src/models/social/Story.ts +30 -0
- package/src/models/social/SupportTicket.ts +38 -0
- package/src/models/store/StoreItem.ts +32 -0
- package/src/services/AuthService.ts +91 -0
- package/src/services/SocialService.ts +92 -0
- package/src/services/SocketService.ts +112 -0
- package/src/services/UserService.ts +69 -0
- package/src/types/stats.ts +17 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { User } from '../auth/User';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type of School Team (Traditional Sports or E-sports).
|
|
5
|
+
*/
|
|
6
|
+
export type TeamType = 'ESPORTS' | 'TRADITIONAL_SPORTS';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents a School Team (Okul Takımı) for specific games or sports.
|
|
10
|
+
*/
|
|
11
|
+
export class SchoolTeam {
|
|
12
|
+
id: string = '';
|
|
13
|
+
name: string = ''; // e.g., "UAV FB", "ARMOYU CS2"
|
|
14
|
+
gameOrSport: string = ''; // e.g., "Football", "Volleyball", "Counter-Strike 2"
|
|
15
|
+
type: TeamType = 'ESPORTS';
|
|
16
|
+
logo?: string = '';
|
|
17
|
+
|
|
18
|
+
schoolId: string = '';
|
|
19
|
+
captain: User | null = null;
|
|
20
|
+
coach: User | null = null;
|
|
21
|
+
members: User[] = [];
|
|
22
|
+
memberCount: number = 0;
|
|
23
|
+
|
|
24
|
+
achievements: string[] = [];
|
|
25
|
+
|
|
26
|
+
constructor(data: Partial<SchoolTeam>) {
|
|
27
|
+
Object.assign(this, data);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Instantiates a SchoolTeam object from a JSON object.
|
|
32
|
+
*/
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
static fromJSON(json: Record<string, any>): SchoolTeam {
|
|
35
|
+
return new SchoolTeam({
|
|
36
|
+
id: json.id || '',
|
|
37
|
+
name: json.name || '',
|
|
38
|
+
gameOrSport: json.gameOrSport || json.game_or_sport || '',
|
|
39
|
+
type: (json.type as TeamType) || 'ESPORTS',
|
|
40
|
+
logo: json.logo || '',
|
|
41
|
+
schoolId: json.schoolId || '',
|
|
42
|
+
captain: json.captain ? User.fromJSON(json.captain) : null,
|
|
43
|
+
coach: json.coach ? User.fromJSON(json.coach) : null,
|
|
44
|
+
members: Array.isArray(json.members) ? json.members.map(User.fromJSON) : [],
|
|
45
|
+
memberCount: json.memberCount || 0,
|
|
46
|
+
achievements: json.achievements || []
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { User } from '../auth/User';
|
|
2
|
+
|
|
3
|
+
export type StationType = 'YEMEK' | 'INTERNET_KAFE' | 'HALI_SAHA' | 'SPOR_KOMPLEKSI';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a menu item or a product in a station.
|
|
7
|
+
*/
|
|
8
|
+
export class StationProduct {
|
|
9
|
+
id: string = '';
|
|
10
|
+
name: string = '';
|
|
11
|
+
price: number = 0;
|
|
12
|
+
category: string = '';
|
|
13
|
+
image?: string;
|
|
14
|
+
isDeal?: boolean;
|
|
15
|
+
discountRate?: string;
|
|
16
|
+
|
|
17
|
+
constructor(data: Partial<StationProduct>) {
|
|
18
|
+
Object.assign(this, data);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static fromJSON(json: Record<string, any>): StationProduct {
|
|
22
|
+
return new StationProduct({
|
|
23
|
+
id: json.id || '',
|
|
24
|
+
name: json.name || '',
|
|
25
|
+
price: json.price || 0,
|
|
26
|
+
category: json.category || '',
|
|
27
|
+
image: json.image,
|
|
28
|
+
isDeal: json.isDeal,
|
|
29
|
+
discountRate: json.discountRate,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents detailed hardware/equipment in a workstation setup.
|
|
36
|
+
*/
|
|
37
|
+
export class WorkstationEquipment {
|
|
38
|
+
id: string = '';
|
|
39
|
+
name: string = 'Standart Masa'; // e.g., "VIP Oda #1"
|
|
40
|
+
cpu: string = '';
|
|
41
|
+
gpu: string = '';
|
|
42
|
+
ram: string = '';
|
|
43
|
+
monitor: string = '';
|
|
44
|
+
keyboard: string = '';
|
|
45
|
+
mouse: string = '';
|
|
46
|
+
isAvailable?: boolean = true;
|
|
47
|
+
|
|
48
|
+
constructor(data: Partial<WorkstationEquipment>) {
|
|
49
|
+
Object.assign(this, data);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static fromJSON(json: Record<string, any>): WorkstationEquipment {
|
|
53
|
+
return new WorkstationEquipment({
|
|
54
|
+
id: json.id || '',
|
|
55
|
+
name: json.name || '',
|
|
56
|
+
cpu: json.cpu || '',
|
|
57
|
+
gpu: json.gpu || '',
|
|
58
|
+
ram: json.ram || '',
|
|
59
|
+
monitor: json.monitor || '',
|
|
60
|
+
keyboard: json.keyboard || '',
|
|
61
|
+
mouse: json.mouse || '',
|
|
62
|
+
isAvailable: json.isAvailable ?? true,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface StationPricing {
|
|
68
|
+
label: string;
|
|
69
|
+
price: number;
|
|
70
|
+
unit: string; // 'saat', 'gün', 'seans' vb.
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class StationCoupon {
|
|
74
|
+
code: string = '';
|
|
75
|
+
discount: string = '';
|
|
76
|
+
expiryDate: string = '';
|
|
77
|
+
description: string = '';
|
|
78
|
+
|
|
79
|
+
constructor(data: Partial<StationCoupon>) {
|
|
80
|
+
Object.assign(this, data);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static fromJSON(json: Record<string, any>): StationCoupon {
|
|
84
|
+
return new StationCoupon({
|
|
85
|
+
code: json.code || '',
|
|
86
|
+
discount: json.discount || '',
|
|
87
|
+
expiryDate: json.expiryDate || '',
|
|
88
|
+
description: json.description || '',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Represents a Station (İstasyon) in the aramizdakioyuncu.com platform.
|
|
95
|
+
*/
|
|
96
|
+
export class Station {
|
|
97
|
+
id: string = '';
|
|
98
|
+
name: string = '';
|
|
99
|
+
slug: string = '';
|
|
100
|
+
type: StationType = 'YEMEK';
|
|
101
|
+
description: string = '';
|
|
102
|
+
location: string = '';
|
|
103
|
+
logo: string = '';
|
|
104
|
+
banner: string = '';
|
|
105
|
+
rating: number = 0;
|
|
106
|
+
reviewCount: number = 0;
|
|
107
|
+
owner: User | null = null;
|
|
108
|
+
|
|
109
|
+
// Refactored to unified classes
|
|
110
|
+
products?: StationProduct[] = [];
|
|
111
|
+
equipment?: WorkstationEquipment[] = [];
|
|
112
|
+
pricing?: StationPricing[] = [];
|
|
113
|
+
coupons?: StationCoupon[] = [];
|
|
114
|
+
facilities?: string[] = [];
|
|
115
|
+
|
|
116
|
+
constructor(data: Partial<Station>) {
|
|
117
|
+
Object.assign(this, data);
|
|
118
|
+
if (!this.slug && this.name) {
|
|
119
|
+
this.slug = this.name.toLowerCase()
|
|
120
|
+
.replace(/\s+/g, '-')
|
|
121
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
static fromJSON(json: Record<string, any>): Station {
|
|
126
|
+
return new Station({
|
|
127
|
+
id: json.id || '',
|
|
128
|
+
name: json.name || '',
|
|
129
|
+
slug: json.slug || '',
|
|
130
|
+
type: json.type || 'YEMEK',
|
|
131
|
+
description: json.description || '',
|
|
132
|
+
location: json.location || '',
|
|
133
|
+
logo: json.logo || '',
|
|
134
|
+
banner: json.banner || '',
|
|
135
|
+
rating: json.rating || 0,
|
|
136
|
+
reviewCount: json.reviewCount || 0,
|
|
137
|
+
owner: json.owner ? User.fromJSON(json.owner) : null,
|
|
138
|
+
products: json.products?.map((p: any) => StationProduct.fromJSON(p)) || [],
|
|
139
|
+
equipment: json.equipment?.map((e: any) => WorkstationEquipment.fromJSON(e)) || [],
|
|
140
|
+
pricing: json.pricing,
|
|
141
|
+
coupons: json.coupons?.map((c: any) => StationCoupon.fromJSON(c)) || [],
|
|
142
|
+
facilities: json.facilities,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { User } from '../auth/User';
|
|
2
|
+
import { SurveyAnswer } from './SurveyAnswer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a community Survey (Anket) in the aramizdakioyuncu.com platform.
|
|
6
|
+
*/
|
|
7
|
+
export class Survey {
|
|
8
|
+
id: string = '';
|
|
9
|
+
question: string = '';
|
|
10
|
+
description?: string = '';
|
|
11
|
+
options: SurveyAnswer[] = [];
|
|
12
|
+
author: User | null = null;
|
|
13
|
+
createdAt: string = '';
|
|
14
|
+
expiresAt?: string = '';
|
|
15
|
+
totalVotes: number = 0;
|
|
16
|
+
|
|
17
|
+
// Current user's interaction state
|
|
18
|
+
hasVoted: boolean = false;
|
|
19
|
+
myVoteId?: string = '';
|
|
20
|
+
|
|
21
|
+
constructor(data: Partial<Survey>) {
|
|
22
|
+
Object.assign(this, data);
|
|
23
|
+
this.totalVotes = this.options.reduce((sum, opt) => sum + opt.votes, 0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Helper to get percentage for a specific option.
|
|
28
|
+
*/
|
|
29
|
+
getOptionPercentage(optionId: string): number {
|
|
30
|
+
const option = this.options.find(o => o.id === optionId);
|
|
31
|
+
if (!option || this.totalVotes === 0) return 0;
|
|
32
|
+
return Math.round((option.votes / this.totalVotes) * 100);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Instantiates a Survey object from a JSON object.
|
|
37
|
+
*/
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
static fromJSON(json: Record<string, any>): Survey {
|
|
40
|
+
return new Survey({
|
|
41
|
+
id: json.id || '',
|
|
42
|
+
question: json.question || '',
|
|
43
|
+
description: json.description || '',
|
|
44
|
+
options: Array.isArray(json.options) ? json.options.map((o: any) => SurveyAnswer.fromJSON(o)) : [],
|
|
45
|
+
author: json.author ? User.fromJSON(json.author) : null,
|
|
46
|
+
createdAt: json.createdAt || '',
|
|
47
|
+
expiresAt: json.expiresAt || '',
|
|
48
|
+
totalVotes: json.totalVotes || 0,
|
|
49
|
+
hasVoted: json.hasVoted || false,
|
|
50
|
+
myVoteId: json.myVoteId || '',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an answer option in a Survey.
|
|
3
|
+
*/
|
|
4
|
+
export class SurveyAnswer {
|
|
5
|
+
id: string = '';
|
|
6
|
+
text: string = '';
|
|
7
|
+
votes: number = 0;
|
|
8
|
+
voterIds: string[] = [];
|
|
9
|
+
|
|
10
|
+
constructor(data: Partial<SurveyAnswer>) {
|
|
11
|
+
Object.assign(this, data);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Instantiates a SurveyAnswer object from a JSON object.
|
|
16
|
+
*/
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
static fromJSON(json: Record<string, any>): SurveyAnswer {
|
|
19
|
+
return new SurveyAnswer({
|
|
20
|
+
id: json.id || '',
|
|
21
|
+
text: json.text || '',
|
|
22
|
+
votes: json.votes || 0,
|
|
23
|
+
voterIds: json.voterIds || [],
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a Sports Team (Takım) in the aramizdakioyuncu.com platform.
|
|
3
|
+
*/
|
|
4
|
+
export class Team {
|
|
5
|
+
id: string = '';
|
|
6
|
+
name: string = '';
|
|
7
|
+
logo: string = '';
|
|
8
|
+
primaryColor: string = '';
|
|
9
|
+
shortName: string = '';
|
|
10
|
+
|
|
11
|
+
constructor(data: Partial<Team>) {
|
|
12
|
+
Object.assign(this, data);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static fromJSON(json: any): Team {
|
|
16
|
+
return new Team({
|
|
17
|
+
id: json.id || '',
|
|
18
|
+
name: json.name || '',
|
|
19
|
+
logo: json.logo || '',
|
|
20
|
+
primaryColor: json.primaryColor || '#1d4ed8',
|
|
21
|
+
shortName: json.shortName || ''
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a Workplace (İşyeri/Ofis) in the aramizdakioyuncu.com platform.
|
|
3
|
+
*/
|
|
4
|
+
export class Workplace {
|
|
5
|
+
id: string = '';
|
|
6
|
+
name: string = '';
|
|
7
|
+
description: string = '';
|
|
8
|
+
location: string = '';
|
|
9
|
+
logo: string = '';
|
|
10
|
+
website: string = '';
|
|
11
|
+
establishedDate: string = '';
|
|
12
|
+
|
|
13
|
+
constructor(data: Partial<Workplace>) {
|
|
14
|
+
Object.assign(this, data);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Instantiates a Workplace object from a JSON object.
|
|
19
|
+
*/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
static fromJSON(json: Record<string, any>): Workplace {
|
|
22
|
+
return new Workplace({
|
|
23
|
+
id: json.id || '',
|
|
24
|
+
name: json.name || json.title || '',
|
|
25
|
+
description: json.description || '',
|
|
26
|
+
location: json.location || json.address || '',
|
|
27
|
+
logo: json.logo || json.logo_url || '',
|
|
28
|
+
website: json.website || '',
|
|
29
|
+
establishedDate: json.establishedDate || json.created_at || '',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a Game in the aramizdakioyuncu.com platform.
|
|
3
|
+
*/
|
|
4
|
+
export class Game {
|
|
5
|
+
id: string = '';
|
|
6
|
+
name: string = '';
|
|
7
|
+
slug: string = '';
|
|
8
|
+
logo: string = '';
|
|
9
|
+
poster: string = '';
|
|
10
|
+
category: string = '';
|
|
11
|
+
developer: string = '';
|
|
12
|
+
description: string = '';
|
|
13
|
+
|
|
14
|
+
constructor(data: Partial<Game>) {
|
|
15
|
+
Object.assign(this, data);
|
|
16
|
+
if (!this.slug && this.name) {
|
|
17
|
+
this.slug = this.name.toLowerCase()
|
|
18
|
+
.replace(/\s+/g, '-')
|
|
19
|
+
.replace(/[^a-z0-9-]/g, '');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Instantiates a Game object from a JSON object.
|
|
25
|
+
*/
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
static fromJSON(json: Record<string, any>): Game {
|
|
28
|
+
return new Game({
|
|
29
|
+
id: json.id || '',
|
|
30
|
+
name: json.name || '',
|
|
31
|
+
slug: json.slug || '',
|
|
32
|
+
logo: json.logo || json.logo_url || '',
|
|
33
|
+
poster: json.poster || json.poster_url || '',
|
|
34
|
+
category: json.category || '',
|
|
35
|
+
developer: json.developer || '',
|
|
36
|
+
description: json.description || '',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a Media item (Fotoğraf/Video) in the aramizdakioyuncu.com platform.
|
|
3
|
+
*/
|
|
4
|
+
export class Media {
|
|
5
|
+
title: string = '';
|
|
6
|
+
count: number = 0;
|
|
7
|
+
author: string = '';
|
|
8
|
+
date: string = '';
|
|
9
|
+
category: string = '';
|
|
10
|
+
image: string = '';
|
|
11
|
+
|
|
12
|
+
constructor(data: Partial<Media>) {
|
|
13
|
+
Object.assign(this, data);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Instantiates a Media object from a JSON object.
|
|
18
|
+
*/
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
static fromJSON(json: Record<string, any>): Media {
|
|
21
|
+
return new Media({
|
|
22
|
+
title: json.title || '',
|
|
23
|
+
count: json.count || 0,
|
|
24
|
+
author: json.author || '',
|
|
25
|
+
date: json.date || '',
|
|
26
|
+
category: json.category || '',
|
|
27
|
+
image: json.image || json.thumb || '',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { User } from '../auth/User';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a Game Mod (Oyun Modu) in the aramizdakioyuncu.com platform.
|
|
5
|
+
*/
|
|
6
|
+
export class Mod {
|
|
7
|
+
id: string = '';
|
|
8
|
+
name: string = '';
|
|
9
|
+
game: string = '';
|
|
10
|
+
version: string = '';
|
|
11
|
+
author: User | null = null;
|
|
12
|
+
description: string = '';
|
|
13
|
+
downloads: string = '';
|
|
14
|
+
image: string = '';
|
|
15
|
+
isFeatured: boolean = false;
|
|
16
|
+
|
|
17
|
+
constructor(data: Partial<Mod>) {
|
|
18
|
+
Object.assign(this, data);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Instantiates a Mod object from a JSON object.
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
static fromJSON(json: Record<string, any>): Mod {
|
|
26
|
+
return new Mod({
|
|
27
|
+
id: json.id || '',
|
|
28
|
+
name: json.name || json.title || '',
|
|
29
|
+
game: json.game || '',
|
|
30
|
+
version: json.version || '',
|
|
31
|
+
author: json.author ? (json.author instanceof User ? json.author : User.fromJSON(json.author)) : (json.authorUsername ? new User({ username: json.authorUsername, displayName: json.authorName }) : null),
|
|
32
|
+
description: json.description || json.desc || '',
|
|
33
|
+
downloads: json.downloads || '0',
|
|
34
|
+
image: json.image || '',
|
|
35
|
+
isFeatured: json.isFeatured || false,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { User } from '../auth/User';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a News item (Haber) in the aramizdakioyuncu.com platform.
|
|
5
|
+
*/
|
|
6
|
+
export class News {
|
|
7
|
+
slug: string = '';
|
|
8
|
+
title: string = '';
|
|
9
|
+
excerpt: string = '';
|
|
10
|
+
content: string = '';
|
|
11
|
+
date: string = '';
|
|
12
|
+
category: string = '';
|
|
13
|
+
image: string = '';
|
|
14
|
+
author: User | null = null;
|
|
15
|
+
|
|
16
|
+
constructor(data: Partial<News>) {
|
|
17
|
+
Object.assign(this, data);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns the absolute URL to the news article.
|
|
22
|
+
*/
|
|
23
|
+
getUrl(): string {
|
|
24
|
+
return `/haberler/${this.slug}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Instantiates a News object from a JSON object.
|
|
29
|
+
*/
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
static fromJSON(json: Record<string, any>): News {
|
|
32
|
+
return new News({
|
|
33
|
+
slug: json.slug || '',
|
|
34
|
+
title: json.title || '',
|
|
35
|
+
excerpt: json.excerpt || json.summary || '',
|
|
36
|
+
content: json.content || '',
|
|
37
|
+
date: json.date || '',
|
|
38
|
+
category: json.category || '',
|
|
39
|
+
image: json.image || '',
|
|
40
|
+
author: json.author ? (json.author instanceof User ? json.author : User.fromJSON(json.author)) : (json.authorUsername ? new User({ username: json.authorUsername, displayName: json.authorName }) : null),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { User } from '../auth/User';
|
|
2
|
+
import { Group } from '../community/Group';
|
|
3
|
+
|
|
4
|
+
export interface ProjectAuthor {
|
|
5
|
+
user: User;
|
|
6
|
+
role: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents a Project in the aramizdakioyuncu.com platform.
|
|
11
|
+
*/
|
|
12
|
+
export class Project {
|
|
13
|
+
id: string = '';
|
|
14
|
+
name: string = '';
|
|
15
|
+
description: string = '';
|
|
16
|
+
status: string = '';
|
|
17
|
+
image: string = '';
|
|
18
|
+
url: string = '';
|
|
19
|
+
githubUrl: string = '';
|
|
20
|
+
authors: ProjectAuthor[] = [];
|
|
21
|
+
group: Group | null = null;
|
|
22
|
+
techStack: string[] = [];
|
|
23
|
+
|
|
24
|
+
constructor(data: Partial<Project>) {
|
|
25
|
+
Object.assign(this, data);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Instantiates a Project object from a JSON object.
|
|
30
|
+
*/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
+
static fromJSON(json: Record<string, any>): Project {
|
|
33
|
+
return new Project({
|
|
34
|
+
id: json.id || '',
|
|
35
|
+
name: json.name || json.title || '',
|
|
36
|
+
description: json.description || '',
|
|
37
|
+
status: json.status || '',
|
|
38
|
+
image: json.image || json.thumb || '',
|
|
39
|
+
url: json.url || json.demoUrl || '',
|
|
40
|
+
githubUrl: json.githubUrl || json.github || '',
|
|
41
|
+
authors: Array.isArray(json.authors) ? json.authors.map((a: any) => ({
|
|
42
|
+
user: a.user instanceof User ? a.user : User.fromJSON(a.user || a),
|
|
43
|
+
role: a.role || 'Geliştirici'
|
|
44
|
+
})) : [],
|
|
45
|
+
group: json.group ? (json.group instanceof Group ? json.group : Group.fromJSON(json.group)) : null,
|
|
46
|
+
techStack: Array.isArray(json.techStack) ? json.techStack : [],
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { GlobalStats } from '../../types/stats';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Platform Statistics Class
|
|
5
|
+
* Bu sınıf, GlobalStats verisini sarmalar ve platform analitiği için yardımcı metodlar sunar.
|
|
6
|
+
*/
|
|
7
|
+
export class PlatformStats implements GlobalStats {
|
|
8
|
+
totalPlayers: number;
|
|
9
|
+
malePlayers: number;
|
|
10
|
+
femalePlayers: number;
|
|
11
|
+
totalForums: number;
|
|
12
|
+
totalPolls: number;
|
|
13
|
+
activeUsers24h: number;
|
|
14
|
+
totalMatchesPlayed: number;
|
|
15
|
+
totalGuilds: number;
|
|
16
|
+
monthlyVisitors: number;
|
|
17
|
+
totalNews: number;
|
|
18
|
+
|
|
19
|
+
constructor(data: GlobalStats) {
|
|
20
|
+
this.totalPlayers = data.totalPlayers;
|
|
21
|
+
this.malePlayers = data.malePlayers;
|
|
22
|
+
this.femalePlayers = data.femalePlayers;
|
|
23
|
+
this.totalForums = data.totalForums;
|
|
24
|
+
this.totalPolls = data.totalPolls;
|
|
25
|
+
this.activeUsers24h = data.activeUsers24h;
|
|
26
|
+
this.totalMatchesPlayed = data.totalMatchesPlayed;
|
|
27
|
+
this.totalGuilds = data.totalGuilds;
|
|
28
|
+
this.monthlyVisitors = data.monthlyVisitors;
|
|
29
|
+
this.totalNews = data.totalNews;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Cinsiyet Dağılım Oranlarını Döndürür
|
|
34
|
+
*/
|
|
35
|
+
getGenderDistribution() {
|
|
36
|
+
const malePercent = Math.round((this.malePlayers / (this.malePlayers + this.femalePlayers)) * 100);
|
|
37
|
+
const femalePercent = 100 - malePercent;
|
|
38
|
+
return { malePercent, femalePercent };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Bir metrik için büyüme oranını hesaplar (Mock Veri)
|
|
43
|
+
*/
|
|
44
|
+
getGrowthRate(metric: keyof GlobalStats): number {
|
|
45
|
+
// Gerçek bir veritabanında bu, dünkü veriye göre hesaplanırdı.
|
|
46
|
+
// Şimdilik tutarlı olması için statik mock değerler dönüyoruz.
|
|
47
|
+
const growthMap: Partial<Record<keyof GlobalStats, number>> = {
|
|
48
|
+
totalPlayers: 12.4,
|
|
49
|
+
activeUsers24h: 8.2,
|
|
50
|
+
monthlyVisitors: 5.7,
|
|
51
|
+
totalNews: 3.1,
|
|
52
|
+
totalGuilds: 1.5,
|
|
53
|
+
};
|
|
54
|
+
return growthMap[metric] || 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Harita verisi için günlük ziyaretçi trendini döndürür (Mock Veri)
|
|
59
|
+
*/
|
|
60
|
+
getVisitorTrend() {
|
|
61
|
+
return [45, 52, 48, 70, 61, 85, 92]; // Son 7 günün büyüme trendi (%)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Forum, Anket ve Haberler bazında aktivite özeti
|
|
66
|
+
*/
|
|
67
|
+
getActivityBreakdown() {
|
|
68
|
+
return [
|
|
69
|
+
{ label: 'Forum Konuları', value: this.totalForums, color: '#3b82f6' },
|
|
70
|
+
{ label: 'Haber İçerikleri', value: this.totalNews, color: '#10b981' },
|
|
71
|
+
{ label: 'Aktif Anketler', value: this.totalPolls, color: '#f59e0b' },
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* System Settings Model
|
|
3
|
+
* Platform genelindeki tüm ayarları tek bir noktadan yönetmek için tasarlanmıştır.
|
|
4
|
+
*/
|
|
5
|
+
export class SystemSettings {
|
|
6
|
+
siteTitle: string;
|
|
7
|
+
siteDescription: string;
|
|
8
|
+
isMaintenanceMode: boolean;
|
|
9
|
+
isRegistrationOpen: boolean;
|
|
10
|
+
contactEmail: string;
|
|
11
|
+
version: string;
|
|
12
|
+
socialLinks: {
|
|
13
|
+
discord?: string;
|
|
14
|
+
youtube?: string;
|
|
15
|
+
instagram?: string;
|
|
16
|
+
twitter?: string;
|
|
17
|
+
github?: string;
|
|
18
|
+
};
|
|
19
|
+
branding: {
|
|
20
|
+
logoUrl?: string;
|
|
21
|
+
faviconUrl?: string;
|
|
22
|
+
primaryColor?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
constructor(data: Partial<SystemSettings> = {}) {
|
|
26
|
+
this.siteTitle = data.siteTitle || 'ARMOYU - Aramızdaki Oyuncu';
|
|
27
|
+
this.siteDescription = data.siteDescription || 'Türkiye\'nin en büyük oyun topluluğu ve gelişim platformu.';
|
|
28
|
+
this.isMaintenanceMode = data.isMaintenanceMode || false;
|
|
29
|
+
this.isRegistrationOpen = data.isRegistrationOpen || true;
|
|
30
|
+
this.contactEmail = data.contactEmail || 'iletisim@armoyu.com';
|
|
31
|
+
this.version = data.version || 'v3.4.2-beta';
|
|
32
|
+
this.socialLinks = data.socialLinks || {
|
|
33
|
+
discord: 'https://discord.gg/armoyu',
|
|
34
|
+
youtube: 'https://youtube.com/armoyu',
|
|
35
|
+
instagram: 'https://instagram.com/armoyu',
|
|
36
|
+
twitter: 'https://twitter.com/armoyu',
|
|
37
|
+
github: 'https://github.com/armoyu'
|
|
38
|
+
};
|
|
39
|
+
this.branding = data.branding || {
|
|
40
|
+
logoUrl: 'https://v3.armoyu.com/logo.png',
|
|
41
|
+
faviconUrl: 'https://v3.armoyu.com/favicon.ico',
|
|
42
|
+
primaryColor: '#3b82f6'
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Ayarların bir kopyasını oluşturur (State yönetimi için)
|
|
48
|
+
*/
|
|
49
|
+
clone(): SystemSettings {
|
|
50
|
+
return new SystemSettings(JSON.parse(JSON.stringify(this)));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Bakım modunu hızlıca değiştirir
|
|
55
|
+
*/
|
|
56
|
+
toggleMaintenance() {
|
|
57
|
+
this.isMaintenanceMode = !this.isMaintenanceMode;
|
|
58
|
+
}
|
|
59
|
+
}
|