ldco-contract 0.1.15 → 0.1.17

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.
Files changed (87) hide show
  1. package/dist/index.d.ts +35 -0
  2. package/dist/ldco-contract.cjs.development.js +335 -0
  3. package/dist/ldco-contract.cjs.development.js.map +1 -1
  4. package/dist/ldco-contract.cjs.production.min.js +1 -1
  5. package/dist/ldco-contract.cjs.production.min.js.map +1 -1
  6. package/dist/ldco-contract.esm.js +318 -1
  7. package/dist/ldco-contract.esm.js.map +1 -1
  8. package/dist/lib/converters/toChoreographerDTO.d.ts +3 -0
  9. package/dist/lib/converters/toChoreographerModel.d.ts +3 -0
  10. package/dist/lib/converters/toCollectionsModel.d.ts +6 -0
  11. package/dist/lib/converters/toDanceDTO.d.ts +3 -0
  12. package/dist/lib/converters/toDanceModel.d.ts +5 -0
  13. package/dist/lib/converters/toInstructorDTO.d.ts +3 -0
  14. package/dist/lib/converters/toInstructorModel.d.ts +3 -0
  15. package/dist/lib/converters/toLessonDTO.d.ts +3 -0
  16. package/dist/lib/converters/toLessonModel.d.ts +4 -0
  17. package/dist/lib/converters/toTrackDTO.d.ts +3 -0
  18. package/dist/lib/converters/toTrackModel.d.ts +3 -0
  19. package/dist/lib/converters/toUserAcquaintanceDTO.d.ts +14 -0
  20. package/dist/lib/converters/toUserAcquaintanceModel.d.ts +7 -0
  21. package/dist/lib/converters/toUserDTO.d.ts +9 -0
  22. package/dist/lib/converters/toUserModel.d.ts +7 -0
  23. package/dist/lib/converters/toVenueDTO.d.ts +3 -0
  24. package/dist/lib/converters/toVenueModel.d.ts +5 -0
  25. package/dist/lib/itemArrayToItemRecords.d.ts +3 -0
  26. package/dist/types/dto/lesson.dto.d.ts +1 -0
  27. package/dist/types/entities/appeal_choreographer_user.entity.d.ts +8 -0
  28. package/dist/types/entities/appeal_instructor_user.entity.d.ts +8 -0
  29. package/dist/types/entities/cancelled_lesson.entity.d.ts +6 -0
  30. package/dist/types/entities/choreographer.entity.d.ts +5 -0
  31. package/dist/types/entities/dance.entity.d.ts +9 -0
  32. package/dist/types/entities/dance_collection.entity.d.ts +8 -0
  33. package/dist/types/entities/friend_request.entity.d.ts +7 -0
  34. package/dist/types/entities/instructor.entity.d.ts +5 -0
  35. package/dist/types/entities/lesson.entity.d.ts +13 -0
  36. package/dist/types/entities/track.entity.d.ts +9 -0
  37. package/dist/types/entities/user.entity.d.ts +9 -0
  38. package/dist/types/entities/user_collection.entity.d.ts +8 -0
  39. package/dist/types/entities/user_favorite_venue.entity.d.ts +5 -0
  40. package/dist/types/entities/user_follow.entity.d.ts +6 -0
  41. package/dist/types/entities/user_friend.entity.d.ts +6 -0
  42. package/dist/types/entities/user_marked_dance.entity.d.ts +6 -0
  43. package/dist/types/entities/venue.entity.d.ts +14 -0
  44. package/dist/types/model/collection.model.d.ts +1 -0
  45. package/dist/types/model/lesson.model.d.ts +1 -0
  46. package/package.json +1 -1
  47. package/src/index.ts +40 -1
  48. package/src/lib/converters/toChoreographerDTO.ts +14 -0
  49. package/src/lib/converters/toChoreographerModel.ts +13 -0
  50. package/src/lib/converters/toCollectionsModel.ts +26 -0
  51. package/src/lib/converters/toDanceDTO.ts +19 -0
  52. package/src/lib/converters/toDanceModel.ts +28 -0
  53. package/src/lib/converters/toInstructorDTO.ts +15 -0
  54. package/src/lib/converters/toInstructorModel.ts +14 -0
  55. package/src/lib/converters/toLessonDTO.ts +20 -0
  56. package/src/lib/converters/toLessonModel.ts +20 -0
  57. package/src/lib/converters/toTrackDTO.ts +15 -0
  58. package/src/lib/converters/toTrackModel.ts +15 -0
  59. package/src/lib/converters/toUserAcquaintanceDTO.ts +42 -0
  60. package/src/lib/converters/toUserAcquaintanceModel.ts +36 -0
  61. package/src/lib/converters/toUserDTO.ts +41 -0
  62. package/src/lib/converters/toUserModel.ts +43 -0
  63. package/src/lib/converters/toVenueDTO.ts +26 -0
  64. package/src/lib/converters/toVenueModel.ts +20 -0
  65. package/src/lib/itemArrayToItemRecords.ts +6 -0
  66. package/src/types/dto/lesson.dto.ts +1 -0
  67. package/src/types/entities/appeal_choreographer_user.entity.ts +8 -0
  68. package/src/types/entities/appeal_instructor_user.entity.ts +8 -0
  69. package/src/types/entities/cancelled_lesson.entity.ts +6 -0
  70. package/src/types/entities/choreographer.entity.ts +5 -0
  71. package/src/types/entities/dance.entity.ts +9 -0
  72. package/src/types/entities/dance_collection.entity.ts +8 -0
  73. package/src/types/entities/friend_request.entity.ts +7 -0
  74. package/src/types/entities/instructor.entity.ts +5 -0
  75. package/src/types/entities/lesson.entity.ts +13 -0
  76. package/src/types/entities/track.entity.ts +9 -0
  77. package/src/types/entities/user.entity.ts +9 -0
  78. package/src/types/entities/user_collection.entity.ts +8 -0
  79. package/src/types/entities/user_favorite_venue.entity.ts +5 -0
  80. package/src/types/entities/user_follow.entity.ts +6 -0
  81. package/src/types/entities/user_friend.entity.ts +6 -0
  82. package/src/types/entities/user_marked_dance.entity.ts +6 -0
  83. package/src/types/entities/venue.entity.ts +14 -0
  84. package/src/types/model/collection.model.ts +1 -0
  85. package/src/types/model/lesson.model.ts +1 -0
  86. package/dist/converter/userEntityToUser.d.ts +0 -10
  87. package/src/converter/userEntityToUser.ts +0 -76
@@ -14,5 +14,322 @@ function getAllUserDanceIds(userDances) {
14
14
  });
15
15
  }
16
16
 
17
- export { getAllUserDanceIds };
17
+ function itemArrayToItemRecords(arr) {
18
+ return arr.reduce(function (acc, item) {
19
+ acc[item._id] = item;
20
+ return acc;
21
+ }, {});
22
+ }
23
+
24
+ function toChoreographerDTO(choreographer, isVerified) {
25
+ return {
26
+ id: choreographer._id,
27
+ name: choreographer.name,
28
+ isVerified: isVerified
29
+ };
30
+ }
31
+
32
+ function toChoreographerModel(dto) {
33
+ return {
34
+ id: dto.id,
35
+ name: dto.name,
36
+ isVerified: dto.isVerified
37
+ };
38
+ }
39
+
40
+ function toTrackModel(dto) {
41
+ return {
42
+ id: dto.id,
43
+ name: dto.name,
44
+ artists: dto.artists,
45
+ isrc: dto.isrc,
46
+ uri: dto.uri,
47
+ duration_ms: dto.duration_ms,
48
+ explicit: dto.explicit,
49
+ isVerified: dto.isVerified
50
+ };
51
+ }
52
+
53
+ function toDanceModel(dto, trackMap, choreographerMap) {
54
+ var tracks = dto.tracks.map(function (id) {
55
+ return trackMap[id];
56
+ }).filter(Boolean);
57
+ return {
58
+ id: dto.id,
59
+ danceName: dto.danceName,
60
+ choreographers: dto.choreographers.map(function (id) {
61
+ return toChoreographerModel(choreographerMap[id]);
62
+ }),
63
+ stepsheet: dto.stepsheet,
64
+ difficulty: dto.difficulty,
65
+ primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),
66
+ tracks: tracks.map(toTrackModel),
67
+ isVerified: dto.isVerified
68
+ };
69
+ }
70
+
71
+ function toCollectionModel(dto, danceMap, trackMap, choreographerMap) {
72
+ var dances = dto.dances.map(function (id) {
73
+ return danceMap[id];
74
+ }).filter(Boolean);
75
+ return {
76
+ id: dto._id,
77
+ name: dto.name,
78
+ dances: dances.map(function (d) {
79
+ return toDanceModel(d, trackMap, choreographerMap);
80
+ }),
81
+ isVerified: dto.isVerified,
82
+ createdAt: dto.createdAt,
83
+ updatedAt: dto.updatedAt,
84
+ createdBy: dto.createdBy,
85
+ isCopyable: dto.isCopyable
86
+ };
87
+ }
88
+
89
+ function toDanceDTO(dance, isVerified) {
90
+ var _dance$choreographers, _dance$choreographers2, _dance$primaryTrack, _dance$tracks$map, _dance$tracks;
91
+ return {
92
+ id: dance._id,
93
+ danceName: dance.danceName,
94
+ choreographers: (_dance$choreographers = (_dance$choreographers2 = dance.choreographers) == null ? void 0 : _dance$choreographers2.map(function (id) {
95
+ return id;
96
+ })) != null ? _dance$choreographers : [],
97
+ stepsheet: dance.stepsheet,
98
+ difficulty: dance.difficulty,
99
+ primaryTrack: (_dance$primaryTrack = dance.primaryTrack) != null ? _dance$primaryTrack : '',
100
+ tracks: (_dance$tracks$map = (_dance$tracks = dance.tracks) == null ? void 0 : _dance$tracks.map(function (id) {
101
+ return id;
102
+ })) != null ? _dance$tracks$map : [],
103
+ isVerified: isVerified
104
+ };
105
+ }
106
+
107
+ function toInstructorDTO(instructor, isVerified) {
108
+ return {
109
+ id: instructor._id,
110
+ name: instructor.name,
111
+ userid: "leave this this empty for now and figure it out later...",
112
+ isVerified: isVerified
113
+ };
114
+ }
115
+
116
+ function toInstructorModel(dto) {
117
+ return {
118
+ id: dto.id,
119
+ name: dto.name,
120
+ userid: "leave this this empty for now and figure it out later...",
121
+ isVerified: dto.isVerified
122
+ };
123
+ }
124
+
125
+ function toLessonDTO(LessonEntity, isVerified) {
126
+ return {
127
+ id: LessonEntity._id,
128
+ lessonday: LessonEntity.lessonday,
129
+ lessonstart: LessonEntity.lessonstart,
130
+ instructors: LessonEntity.instructors,
131
+ duration: LessonEntity.duration,
132
+ lessoncost: LessonEntity.lessoncost,
133
+ notes: LessonEntity.notes,
134
+ difficulty: LessonEntity.difficulty,
135
+ isVerified: isVerified
136
+ };
137
+ }
138
+
139
+ function toLessonModel(lessonDTO, instructorMap) {
140
+ return {
141
+ id: lessonDTO.id,
142
+ lessonday: lessonDTO.lessonday,
143
+ lessonstart: lessonDTO.lessonstart,
144
+ instructors: lessonDTO.instructors.map(function (id) {
145
+ return instructorMap[id];
146
+ }).filter(Boolean),
147
+ duration: lessonDTO.duration,
148
+ lessoncost: lessonDTO.lessoncost,
149
+ notes: lessonDTO.notes,
150
+ difficulty: lessonDTO.difficulty
151
+ };
152
+ }
153
+
154
+ function toTrackDTO(dto, isVerified) {
155
+ return {
156
+ id: dto._id,
157
+ name: dto.name,
158
+ artists: dto.artists,
159
+ isrc: dto.isrc,
160
+ uri: dto.uri,
161
+ duration_ms: dto.duration_ms,
162
+ explicit: dto.explicit,
163
+ isVerified: isVerified
164
+ };
165
+ }
166
+
167
+ function toUserAcquaintanceDTO(user, isVerified, userProfile) {
168
+ var _user$links;
169
+ return {
170
+ id: user._id,
171
+ username: user.username || user.name || '',
172
+ image: user.image || '',
173
+ bio: user.bio || '',
174
+ isVerified: isVerified,
175
+ profile: {
176
+ dances: {
177
+ favorites: userProfile.favorites,
178
+ flagged: userProfile.flagged,
179
+ known: userProfile.known,
180
+ refresh: userProfile.refresh
181
+ },
182
+ collections: userProfile.collections,
183
+ venues: userProfile.venues,
184
+ friendsCount: userProfile.friendsCount,
185
+ followingCount: userProfile.followingCount,
186
+ followersCount: userProfile.followersCount,
187
+ mutualFriendsCount: userProfile.mutualFriendsCount,
188
+ links: (_user$links = user.links) != null ? _user$links : {}
189
+ }
190
+ };
191
+ }
192
+
193
+ function toUserAcquaintanceModel(dto, danceMap, trackMap, collectionMap, choreographerMap) {
194
+ return {
195
+ id: dto.id,
196
+ username: dto.username,
197
+ image: dto.image,
198
+ bio: dto.bio,
199
+ isVerified: dto.isVerified,
200
+ friendsCount: dto.profile.friendsCount,
201
+ followersCount: dto.profile.followersCount,
202
+ mutualFriendsCount: dto.profile.mutualFriendsCount,
203
+ links: dto.profile.links,
204
+ dances: {
205
+ favorites: dto.profile.dances.favorites.map(function (id) {
206
+ return toDanceModel(danceMap[id], trackMap, choreographerMap);
207
+ }),
208
+ flagged: dto.profile.dances.flagged.map(function (id) {
209
+ return toDanceModel(danceMap[id], trackMap, choreographerMap);
210
+ }),
211
+ known: dto.profile.dances.known.map(function (id) {
212
+ return toDanceModel(danceMap[id], trackMap, choreographerMap);
213
+ }),
214
+ refresh: dto.profile.dances.refresh.map(function (id) {
215
+ return toDanceModel(danceMap[id], trackMap, choreographerMap);
216
+ })
217
+ },
218
+ collections: dto.profile.collections.map(function (id) {
219
+ return toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap);
220
+ })
221
+ };
222
+ }
223
+
224
+ function toUserDTO(user, isVerified, danceIds, collections, venues, friends, following, friendsRequested, friendRequests) {
225
+ var _user$email, _user$name, _user$username, _user$image, _user$bio, _user$links;
226
+ if (venues === void 0) {
227
+ venues = [];
228
+ }
229
+ if (friends === void 0) {
230
+ friends = [];
231
+ }
232
+ if (following === void 0) {
233
+ following = [];
234
+ }
235
+ if (friendsRequested === void 0) {
236
+ friendsRequested = [];
237
+ }
238
+ if (friendRequests === void 0) {
239
+ friendRequests = [];
240
+ }
241
+ return {
242
+ _id: user._id.toString(),
243
+ email: (_user$email = user.email) != null ? _user$email : '',
244
+ name: (_user$name = user.name) != null ? _user$name : '',
245
+ username: (_user$username = user.username) != null ? _user$username : '',
246
+ image: (_user$image = user.image) != null ? _user$image : '',
247
+ bio: (_user$bio = user.bio) != null ? _user$bio : '',
248
+ isVerified: isVerified,
249
+ profile: {
250
+ danceIds: danceIds,
251
+ collections: collections,
252
+ venues: venues,
253
+ friends: friends,
254
+ following: following,
255
+ links: (_user$links = user.links) != null ? _user$links : {},
256
+ friendsRequested: friendsRequested,
257
+ friendRequests: friendRequests
258
+ }
259
+ };
260
+ }
261
+
262
+ function toUserModel(userDTO, danceMap, collectionMap, venueMap, friendsMap, followingMap) {
263
+ var expand = function expand(ids, map) {
264
+ return ids.map(function (id) {
265
+ return map[id];
266
+ }).filter(Boolean);
267
+ };
268
+ return {
269
+ _id: userDTO._id,
270
+ email: userDTO.email,
271
+ name: userDTO.name,
272
+ username: userDTO.username,
273
+ image: userDTO.image,
274
+ bio: userDTO.bio,
275
+ isVerified: userDTO.isVerified,
276
+ profile: {
277
+ dances: {
278
+ favorites: expand(userDTO.profile.danceIds.favorites, danceMap),
279
+ flagged: expand(userDTO.profile.danceIds.flagged, danceMap),
280
+ known: expand(userDTO.profile.danceIds.known, danceMap),
281
+ refresh: expand(userDTO.profile.danceIds.refresh, danceMap)
282
+ },
283
+ collections: expand(userDTO.profile.collections, collectionMap),
284
+ venues: expand(userDTO.profile.venues, venueMap),
285
+ friends: expand(userDTO.profile.friends, friendsMap),
286
+ following: expand(userDTO.profile.following, followingMap),
287
+ friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),
288
+ friendRequests: expand(userDTO.profile.friendRequests, friendsMap),
289
+ followersCount: userDTO.profile.followersCount || 0,
290
+ links: userDTO.profile.links
291
+ }
292
+ };
293
+ }
294
+
295
+ function toVenueDTO(venue, lessonIds, isVerified) {
296
+ var _venue$isDeleted, _venue$deletedAt, _venue$createdAt;
297
+ return {
298
+ id: venue._id,
299
+ venuename: venue.venuename,
300
+ venueaddress: venue.venueaddress,
301
+ geolocation: venue.geolocation,
302
+ phone: venue.phone,
303
+ website: venue.website,
304
+ contactEmail: venue.contactEmail,
305
+ contactName: venue.contactName,
306
+ contactPhone: venue.contactPhone,
307
+ lessonsIds: lessonIds,
308
+ isVerified: isVerified,
309
+ isDeleted: (_venue$isDeleted = venue.isDeleted) != null ? _venue$isDeleted : false,
310
+ deletedAt: (_venue$deletedAt = venue.deletedAt) != null ? _venue$deletedAt : null,
311
+ createdAt: (_venue$createdAt = venue.createdAt) != null ? _venue$createdAt : null
312
+ };
313
+ }
314
+
315
+ function _extends() {
316
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
317
+ for (var e = 1; e < arguments.length; e++) {
318
+ var t = arguments[e];
319
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
320
+ }
321
+ return n;
322
+ }, _extends.apply(null, arguments);
323
+ }
324
+
325
+ function toVenueModel(venueDTO, lessonMap, instructorMap) {
326
+ var expandedLessons = venueDTO.lessonsIds.map(function (id) {
327
+ return toLessonModel(lessonMap[id], instructorMap);
328
+ }).filter(Boolean);
329
+ return _extends({}, venueDTO, {
330
+ lessons: expandedLessons
331
+ });
332
+ }
333
+
334
+ export { getAllUserDanceIds, itemArrayToItemRecords, toChoreographerDTO, toChoreographerModel, toCollectionModel, toDanceDTO, toDanceModel, toInstructorDTO, toInstructorModel, toLessonDTO, toLessonModel, toTrackDTO, toTrackModel, toUserAcquaintanceDTO, toUserAcquaintanceModel, toUserDTO, toUserModel, toVenueDTO, toVenueModel };
18
335
  //# sourceMappingURL=ldco-contract.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ldco-contract.esm.js","sources":["../src/lib/getAllUserDanceIds.ts"],"sourcesContent":["import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf"],"mappings":"SAGgBA,kBAAkBA,CAACC,UAAsB;EACrD,IAAAC,IAAA,GAAmED,UAAU,WAAVA,UAAU,GAAI,EAAE;IAAAE,cAAA,GAAAD,IAAA,CAA3EE,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,EAAE,GAAAA,cAAA;IAAAE,YAAA,GAAAH,IAAA,CAAEI,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;IAAAE,UAAA,GAAAL,IAAA,CAAEM,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,EAAE,GAAAA,UAAA;IAAAE,YAAA,GAAAP,IAAA,CAAEQ,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,EAAE,GAAAA,YAAA;EAE9D,IAAME,GAAG,MAAAC,MAAA,CACFR,SAAS,EACTE,OAAO,EACPE,KAAK,EACLE,OAAO,CACb;EAED,OAAOC,GAAG,CAACE,MAAM,CAAC,UAACC,IAAI,EAAEC,KAAK;IAAA,OAAKJ,GAAG,CAACK,OAAO,CAACF,IAAI,CAAC,KAAKC,KAAK;IAAC;AACnE;;;;"}
1
+ {"version":3,"file":"ldco-contract.esm.js","sources":["../src/lib/getAllUserDanceIds.ts","../src/lib/itemArrayToItemRecords.ts","../src/lib/converters/toChoreographerDTO.ts","../src/lib/converters/toChoreographerModel.ts","../src/lib/converters/toTrackModel.ts","../src/lib/converters/toDanceModel.ts","../src/lib/converters/toCollectionsModel.ts","../src/lib/converters/toDanceDTO.ts","../src/lib/converters/toInstructorDTO.ts","../src/lib/converters/toInstructorModel.ts","../src/lib/converters/toLessonDTO.ts","../src/lib/converters/toLessonModel.ts","../src/lib/converters/toTrackDTO.ts","../src/lib/converters/toUserAcquaintanceDTO.ts","../src/lib/converters/toUserAcquaintanceModel.ts","../src/lib/converters/toUserDTO.ts","../src/lib/converters/toUserModel.ts","../src/lib/converters/toVenueDTO.ts","../src/lib/converters/toVenueModel.ts"],"sourcesContent":["import { DanceModel } from \"../types/model/dance.model\";\nimport { UserDances } from \"../types/model/userTypes/userDances\";\n\nexport function getAllUserDanceIds(userDances: UserDances): DanceModel[] {\n const { favorites = [], flagged = [], known = [], refresh = [] } = userDances ?? {};\n\n const all = [\n ...favorites,\n ...flagged,\n ...known,\n ...refresh,\n ];\n\n return all.filter((item, index) => all.indexOf(item) === index);\n}","export function itemArrayToItemRecords<T extends { _id: string }>(arr: T[]): Record<string, T> {\n return arr.reduce((acc, item) => {\n acc[item._id] = item;\n return acc;\n }, {} as Record<string, T>);\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { ChoreographerEntity } from '../../types/entities/choreographer.entity';\n\nexport function toChoreographerDTO(\n choreographer: ChoreographerEntity,\n isVerified: boolean\n): ChoreographerDTO {\n\n return {\n id: choreographer._id,\n name: choreographer.name,\n isVerified: isVerified\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { ChoreographerModel } from \"../../types/model/choreographer.model\";\n\nexport function toChoreographerModel(\n dto: ChoreographerDTO\n): ChoreographerModel {\n\n return {\n id: dto.id,\n name: dto.name,\n isVerified: dto.isVerified\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackModel } from \"../../types/model/track.model\";\n\nexport function toTrackModel(dto: TrackDTO): TrackModel {\n return {\n id: dto.id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { DanceModel } from '../../types/model/dance.model';\nimport { toChoreographerModel } from './toChoreographerModel';\nimport { toTrackModel } from './toTrackModel';\n\nexport function toDanceModel(\n dto: DanceDTO,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): DanceModel {\n\n const tracks = dto.tracks\n .map(id => trackMap[id])\n .filter(Boolean);\n\n return {\n id: dto.id,\n danceName: dto.danceName,\n choreographers: dto.choreographers.map(id => toChoreographerModel(choreographerMap[id])),\n stepsheet: dto.stepsheet,\n difficulty: dto.difficulty,\n primaryTrack: toTrackModel(trackMap[dto.primaryTrack]),\n tracks: tracks.map(toTrackModel),\n isVerified: dto.isVerified,\n };\n}\n","import { ChoreographerDTO } from '../../types/dto/choreographer.dto';\nimport { CollectionDTO } from '../../types/dto/collection.dto';\nimport { DanceDTO } from '../../types/dto/dance.dto';\nimport { TrackDTO } from '../../types/dto/track.dto';\nimport { CollectionModel } from '../../types/model/collection.model';\nimport { toDanceModel } from './toDanceModel';\n\nexport function toCollectionModel(\n dto: CollectionDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): CollectionModel {\n const dances = dto.dances.map(id => danceMap[id]).filter(Boolean);\n\n return {\n id: dto._id,\n name: dto.name,\n dances: dances.map(d => toDanceModel(d, trackMap, choreographerMap)),\n isVerified: dto.isVerified,\n createdAt: dto.createdAt,\n updatedAt: dto.updatedAt,\n createdBy: dto.createdBy,\n isCopyable: dto.isCopyable,\n };\n}\n","import { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { DanceEntity } from \"../../types/entities/dance.entity\";\n\nexport function toDanceDTO(\n dance: DanceEntity,\n isVerified: boolean\n): DanceDTO {\n\n return {\n id: dance._id,\n danceName: dance.danceName,\n choreographers: dance.choreographers?.map((id: string) => id) ?? [],\n stepsheet: dance.stepsheet,\n difficulty: dance.difficulty,\n primaryTrack: dance.primaryTrack ?? '',\n tracks: dance.tracks?.map((id: string) => id) ?? [],\n isVerified: isVerified\n };\n};\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorEntity } from \"../../types/entities/instructor.entity\";\n\nexport function toInstructorDTO(\n instructor: InstructorEntity,\n isVerified: boolean\n): InstructorDTO {\n\n return {\n id: instructor._id,\n name: instructor.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { InstructorModel } from \"../../types/model/instructor.model\";\n\nexport function toInstructorModel(\n dto: InstructorDTO, \n): InstructorModel {\n\n return {\n id: dto.id,\n name: dto.name,\n userid: \"leave this this empty for now and figure it out later...\",\n isVerified: dto.isVerified\n };\n}\n","import { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonEntity } from \"../../types/entities/lesson.entity\";\n\nexport function toLessonDTO(\n LessonEntity: LessonEntity,\n isVerified: boolean\n): LessonDTO {\n\n return {\n id: LessonEntity._id,\n lessonday: LessonEntity.lessonday,\n lessonstart: LessonEntity.lessonstart,\n instructors: LessonEntity.instructors,\n duration: LessonEntity.duration,\n lessoncost: LessonEntity.lessoncost,\n notes: LessonEntity.notes,\n difficulty: LessonEntity.difficulty,\n isVerified: isVerified\n };\n}\n","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { LessonModel } from \"../../types/model/lesson.model\";\n\nexport function toLessonModel(\n lessonDTO: LessonDTO,\n instructorMap: Record<string, InstructorDTO>\n): LessonModel {\n\n return {\n id: lessonDTO.id,\n lessonday: lessonDTO.lessonday,\n lessonstart: lessonDTO.lessonstart,\n instructors: lessonDTO.instructors.map(id => instructorMap[id]).filter(Boolean), // TODO: Do I need the converter?\n duration: lessonDTO.duration,\n lessoncost: lessonDTO.lessoncost,\n notes: lessonDTO.notes,\n difficulty: lessonDTO.difficulty,\n };\n}\n","import { TrackDTO } from \"../../types/dto/track.dto\";\nimport { TrackEntity } from \"../../types/entities/track.entity\";\n\nexport function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO {\n return {\n id: dto._id,\n name: dto.name,\n artists: dto.artists,\n isrc: dto.isrc,\n uri: dto.uri,\n duration_ms: dto.duration_ms,\n explicit: dto.explicit,\n isVerified: isVerified,\n };\n}\n","import { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserAcquaintanceDTO(\n user: UserEntity,\n isVerified: boolean,\n userProfile: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n collections: string[];\n venues: string[];\n friendsCount: number;\n followingCount: number;\n followersCount: number;\n mutualFriendsCount: number;\n }\n): UserAcquaintanceDTO {\n return {\n id: user._id,\n username: user.username || user.name || '',\n image: user.image || '',\n bio: user.bio || '',\n isVerified,\n profile: {\n dances: {\n favorites: userProfile.favorites,\n flagged: userProfile.flagged,\n known: userProfile.known,\n refresh: userProfile.refresh,\n },\n collections: userProfile.collections,\n venues: userProfile.venues,\n friendsCount: userProfile.friendsCount,\n followingCount: userProfile.followingCount,\n followersCount: userProfile.followersCount,\n mutualFriendsCount: userProfile.mutualFriendsCount,\n links: user.links ?? {},\n },\n };\n}\n","import { ChoreographerDTO } from \"../../types/dto/choreographer.dto\";\nimport { CollectionDTO } from \"../../types/dto/collection.dto\";\nimport { DanceDTO } from \"../../types/dto/dance.dto\";\nimport { TrackDTO } from \"../../types/dto/track.dto\";\nimport { UserAcquaintanceDTO } from \"../../types/dto/userAcquaintance.dto\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { toCollectionModel } from \"./toCollectionsModel\";\nimport { toDanceModel } from \"./toDanceModel\";\n\nexport function toUserAcquaintanceModel(\n dto: UserAcquaintanceDTO,\n danceMap: Record<string, DanceDTO>,\n trackMap: Record<string, TrackDTO>,\n collectionMap: Record<string, CollectionDTO>,\n choreographerMap: Record<string, ChoreographerDTO>\n): UserAcquaintanceModel {\n\n return {\n id: dto.id,\n username: dto.username,\n image: dto.image,\n bio: dto.bio,\n isVerified: dto.isVerified,\n friendsCount: dto.profile.friendsCount,\n followersCount: dto.profile.followersCount,\n mutualFriendsCount: dto.profile.mutualFriendsCount,\n links: dto.profile.links,\n dances: {\n favorites: dto.profile.dances.favorites.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n flagged: dto.profile.dances.flagged.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n known: dto.profile.dances.known.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap)),\n refresh: dto.profile.dances.refresh.map(id => toDanceModel(danceMap[id], trackMap, choreographerMap))\n },\n collections: dto.profile.collections.map(id => toCollectionModel(collectionMap[id], danceMap, trackMap, choreographerMap)),\n };\n}\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { UserEntity } from \"../../types/entities/user.entity\";\n\nexport function toUserDTO(\n user: UserEntity,\n isVerified: boolean,\n danceIds: {\n favorites: string[];\n flagged: string[];\n known: string[];\n refresh: string[];\n },\n collections: string[],\n venues: string[] = [],\n friends: string[] = [],\n following: string[] = [],\n friendsRequested: string[] = [],\n friendRequests: string[] = []\n): UserDTO {\n return {\n _id: user._id.toString(),\n email: user.email ?? '',\n name: user.name ?? '',\n username: user.username ?? '',\n image: user.image ?? '',\n bio: user.bio ?? '',\n isVerified,\n profile: {\n danceIds,\n collections,\n venues,\n friends,\n following,\n links: user.links ?? {},\n friendsRequested,\n friendRequests\n },\n };\n};\n\nexport default toUserDTO;\n","import { UserDTO } from \"../../types/dto/user.dto\";\nimport { CollectionModel } from \"../../types/model/collection.model\";\nimport { DanceModel } from \"../../types/model/dance.model\";\nimport { UserModel } from \"../../types/model/user.model\";\nimport { UserAcquaintanceModel } from \"../../types/model/userAcquaintance.model\";\nimport { VenueModel } from \"../../types/model/venue.model\";\n\nexport function toUserModel(\n userDTO: UserDTO,\n danceMap: Record<string, DanceModel>,\n collectionMap: Record<string, CollectionModel>,\n venueMap: Record<string, VenueModel>,\n friendsMap: Record<string, UserAcquaintanceModel>,\n followingMap: Record<string, UserAcquaintanceModel>\n): UserModel {\n const expand = <T>(ids: string[], map: Record<string, T>): T[] => ids.map(id => map[id]).filter(Boolean);\n\n return {\n _id: userDTO._id,\n email: userDTO.email,\n name: userDTO.name,\n username: userDTO.username,\n image: userDTO.image,\n bio: userDTO.bio,\n isVerified: userDTO.isVerified,\n profile: {\n dances: {\n favorites: expand(userDTO.profile.danceIds.favorites, danceMap),\n flagged: expand(userDTO.profile.danceIds.flagged, danceMap),\n known: expand(userDTO.profile.danceIds.known, danceMap),\n refresh: expand(userDTO.profile.danceIds.refresh, danceMap),\n },\n collections: expand(userDTO.profile.collections, collectionMap),\n venues: expand(userDTO.profile.venues, venueMap),\n friends: expand(userDTO.profile.friends, friendsMap),\n following: expand(userDTO.profile.following, followingMap),\n friendsRequested: expand(userDTO.profile.friendsRequested, friendsMap),\n friendRequests: expand(userDTO.profile.friendRequests, friendsMap),\n followersCount: userDTO.profile.followersCount || 0,\n links: userDTO.profile.links,\n },\n };\n}\n","import { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueEntity } from \"../../types/entities/venue.entity\";\n\nexport function toVenueDTO(\n venue: VenueEntity,\n lessonIds: string[],\n isVerified: boolean\n): VenueDTO {\n\n return {\n id: venue._id,\n venuename: venue.venuename,\n venueaddress: venue.venueaddress,\n geolocation: venue.geolocation,\n phone: venue.phone,\n website: venue.website,\n contactEmail: venue.contactEmail,\n contactName: venue.contactName,\n contactPhone: venue.contactPhone,\n lessonsIds: lessonIds,\n isVerified: isVerified,\n isDeleted: venue.isDeleted ?? false,\n deletedAt: venue.deletedAt ?? null,\n createdAt: venue.createdAt ?? null,\n };\n}","import { InstructorDTO } from \"../../types/dto/instructor.dto\";\nimport { LessonDTO } from \"../../types/dto/lesson.dto\";\nimport { VenueDTO } from \"../../types/dto/venue.dto\";\nimport { VenueModel } from \"../../types/model/venue.model\";\nimport { toLessonModel } from \"./toLessonModel\";\n\nexport function toVenueModel(\n venueDTO: VenueDTO,\n lessonMap: Record<string, LessonDTO>,\n instructorMap: Record<string, InstructorDTO>\n): VenueModel {\n const expandedLessons = venueDTO.lessonsIds\n .map(id => toLessonModel(lessonMap[id], instructorMap))\n .filter(Boolean);\n\n return {\n ...venueDTO,\n lessons: expandedLessons,\n };\n}\n"],"names":["getAllUserDanceIds","userDances","_ref","_ref$favorites","favorites","_ref$flagged","flagged","_ref$known","known","_ref$refresh","refresh","all","concat","filter","item","index","indexOf","itemArrayToItemRecords","arr","reduce","acc","_id","toChoreographerDTO","choreographer","isVerified","id","name","toChoreographerModel","dto","toTrackModel","artists","isrc","uri","duration_ms","explicit","toDanceModel","trackMap","choreographerMap","tracks","map","Boolean","danceName","choreographers","stepsheet","difficulty","primaryTrack","toCollectionModel","danceMap","dances","d","createdAt","updatedAt","createdBy","isCopyable","toDanceDTO","dance","_dance$choreographers","_dance$choreographers2","_dance$primaryTrack","_dance$tracks$map","_dance$tracks","toInstructorDTO","instructor","userid","toInstructorModel","toLessonDTO","LessonEntity","lessonday","lessonstart","instructors","duration","lessoncost","notes","toLessonModel","lessonDTO","instructorMap","toTrackDTO","toUserAcquaintanceDTO","user","userProfile","username","image","bio","profile","collections","venues","friendsCount","followingCount","followersCount","mutualFriendsCount","links","_user$links","toUserAcquaintanceModel","collectionMap","toUserDTO","danceIds","friends","following","friendsRequested","friendRequests","toString","email","_user$email","_user$name","_user$username","_user$image","_user$bio","toUserModel","userDTO","venueMap","friendsMap","followingMap","expand","ids","toVenueDTO","venue","lessonIds","venuename","venueaddress","geolocation","phone","website","contactEmail","contactName","contactPhone","lessonsIds","isDeleted","_venue$isDeleted","deletedAt","_venue$deletedAt","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K,CAACW,SAAS,YAAAC,gBAAA,GAAI,KAAK;IACnCC,SAAS,GAAAC,gBAAA,GAAEd,KAAK,CAACa,SAAS,YAAAC,gBAAA,GAAI,IAAI;IAClC/E,SAAS,GAAAgF,gBAAA,GAAEf,KAAK,CAACjE,SAAS,YAAAgF,gBAAA,GAAI;GACjC;AACL;;;;;;;;;;;;SCnBgBC,YAAYA,CACxBC,QAAkB,EAClBC,SAAoC,EACpC1D,aAA4C;EAE5C,IAAM2D,eAAe,GAAGF,QAAQ,CAACP,UAAU,CACtCtF,GAAG,CAAC,UAAAd,EAAE;IAAA,OAAIgD,aAAa,CAAC4D,SAAS,CAAC5G,EAAE,CAAC,EAAEkD,aAAa,CAAC;IAAC,CACtD9D,MAAM,CAAC2B,OAAO,CAAC;EAEpB,OAAA+F,QAAA,KACOH,QAAQ;IACXI,OAAO,EAAEF;;AAEjB;;;;"}
@@ -0,0 +1,3 @@
1
+ import { ChoreographerDTO } from '../../types/dto/choreographer.dto';
2
+ import { ChoreographerEntity } from '../../types/entities/choreographer.entity';
3
+ export declare function toChoreographerDTO(choreographer: ChoreographerEntity, isVerified: boolean): ChoreographerDTO;
@@ -0,0 +1,3 @@
1
+ import { ChoreographerDTO } from "../../types/dto/choreographer.dto";
2
+ import { ChoreographerModel } from "../../types/model/choreographer.model";
3
+ export declare function toChoreographerModel(dto: ChoreographerDTO): ChoreographerModel;
@@ -0,0 +1,6 @@
1
+ import { ChoreographerDTO } from '../../types/dto/choreographer.dto';
2
+ import { CollectionDTO } from '../../types/dto/collection.dto';
3
+ import { DanceDTO } from '../../types/dto/dance.dto';
4
+ import { TrackDTO } from '../../types/dto/track.dto';
5
+ import { CollectionModel } from '../../types/model/collection.model';
6
+ export declare function toCollectionModel(dto: CollectionDTO, danceMap: Record<string, DanceDTO>, trackMap: Record<string, TrackDTO>, choreographerMap: Record<string, ChoreographerDTO>): CollectionModel;
@@ -0,0 +1,3 @@
1
+ import { DanceDTO } from "../../types/dto/dance.dto";
2
+ import { DanceEntity } from "../../types/entities/dance.entity";
3
+ export declare function toDanceDTO(dance: DanceEntity, isVerified: boolean): DanceDTO;
@@ -0,0 +1,5 @@
1
+ import { ChoreographerDTO } from '../../types/dto/choreographer.dto';
2
+ import { DanceDTO } from '../../types/dto/dance.dto';
3
+ import { TrackDTO } from '../../types/dto/track.dto';
4
+ import { DanceModel } from '../../types/model/dance.model';
5
+ export declare function toDanceModel(dto: DanceDTO, trackMap: Record<string, TrackDTO>, choreographerMap: Record<string, ChoreographerDTO>): DanceModel;
@@ -0,0 +1,3 @@
1
+ import { InstructorDTO } from "../../types/dto/instructor.dto";
2
+ import { InstructorEntity } from "../../types/entities/instructor.entity";
3
+ export declare function toInstructorDTO(instructor: InstructorEntity, isVerified: boolean): InstructorDTO;
@@ -0,0 +1,3 @@
1
+ import { InstructorDTO } from "../../types/dto/instructor.dto";
2
+ import { InstructorModel } from "../../types/model/instructor.model";
3
+ export declare function toInstructorModel(dto: InstructorDTO): InstructorModel;
@@ -0,0 +1,3 @@
1
+ import { LessonDTO } from "../../types/dto/lesson.dto";
2
+ import { LessonEntity } from "../../types/entities/lesson.entity";
3
+ export declare function toLessonDTO(LessonEntity: LessonEntity, isVerified: boolean): LessonDTO;
@@ -0,0 +1,4 @@
1
+ import { InstructorDTO } from "../../types/dto/instructor.dto";
2
+ import { LessonDTO } from "../../types/dto/lesson.dto";
3
+ import { LessonModel } from "../../types/model/lesson.model";
4
+ export declare function toLessonModel(lessonDTO: LessonDTO, instructorMap: Record<string, InstructorDTO>): LessonModel;
@@ -0,0 +1,3 @@
1
+ import { TrackDTO } from "../../types/dto/track.dto";
2
+ import { TrackEntity } from "../../types/entities/track.entity";
3
+ export declare function toTrackDTO(dto: TrackEntity, isVerified: boolean): TrackDTO;
@@ -0,0 +1,3 @@
1
+ import { TrackDTO } from "../../types/dto/track.dto";
2
+ import { TrackModel } from "../../types/model/track.model";
3
+ export declare function toTrackModel(dto: TrackDTO): TrackModel;
@@ -0,0 +1,14 @@
1
+ import { UserAcquaintanceDTO } from "../../types/dto/userAcquaintance.dto";
2
+ import { UserEntity } from "../../types/entities/user.entity";
3
+ export declare function toUserAcquaintanceDTO(user: UserEntity, isVerified: boolean, userProfile: {
4
+ favorites: string[];
5
+ flagged: string[];
6
+ known: string[];
7
+ refresh: string[];
8
+ collections: string[];
9
+ venues: string[];
10
+ friendsCount: number;
11
+ followingCount: number;
12
+ followersCount: number;
13
+ mutualFriendsCount: number;
14
+ }): UserAcquaintanceDTO;
@@ -0,0 +1,7 @@
1
+ import { ChoreographerDTO } from "../../types/dto/choreographer.dto";
2
+ import { CollectionDTO } from "../../types/dto/collection.dto";
3
+ import { DanceDTO } from "../../types/dto/dance.dto";
4
+ import { TrackDTO } from "../../types/dto/track.dto";
5
+ import { UserAcquaintanceDTO } from "../../types/dto/userAcquaintance.dto";
6
+ import { UserAcquaintanceModel } from "../../types/model/userAcquaintance.model";
7
+ export declare function toUserAcquaintanceModel(dto: UserAcquaintanceDTO, danceMap: Record<string, DanceDTO>, trackMap: Record<string, TrackDTO>, collectionMap: Record<string, CollectionDTO>, choreographerMap: Record<string, ChoreographerDTO>): UserAcquaintanceModel;
@@ -0,0 +1,9 @@
1
+ import { UserDTO } from "../../types/dto/user.dto";
2
+ import { UserEntity } from "../../types/entities/user.entity";
3
+ export declare function toUserDTO(user: UserEntity, isVerified: boolean, danceIds: {
4
+ favorites: string[];
5
+ flagged: string[];
6
+ known: string[];
7
+ refresh: string[];
8
+ }, collections: string[], venues?: string[], friends?: string[], following?: string[], friendsRequested?: string[], friendRequests?: string[]): UserDTO;
9
+ export default toUserDTO;
@@ -0,0 +1,7 @@
1
+ import { UserDTO } from "../../types/dto/user.dto";
2
+ import { CollectionModel } from "../../types/model/collection.model";
3
+ import { DanceModel } from "../../types/model/dance.model";
4
+ import { UserModel } from "../../types/model/user.model";
5
+ import { UserAcquaintanceModel } from "../../types/model/userAcquaintance.model";
6
+ import { VenueModel } from "../../types/model/venue.model";
7
+ export declare function toUserModel(userDTO: UserDTO, danceMap: Record<string, DanceModel>, collectionMap: Record<string, CollectionModel>, venueMap: Record<string, VenueModel>, friendsMap: Record<string, UserAcquaintanceModel>, followingMap: Record<string, UserAcquaintanceModel>): UserModel;
@@ -0,0 +1,3 @@
1
+ import { VenueDTO } from "../../types/dto/venue.dto";
2
+ import { VenueEntity } from "../../types/entities/venue.entity";
3
+ export declare function toVenueDTO(venue: VenueEntity, lessonIds: string[], isVerified: boolean): VenueDTO;
@@ -0,0 +1,5 @@
1
+ import { InstructorDTO } from "../../types/dto/instructor.dto";
2
+ import { LessonDTO } from "../../types/dto/lesson.dto";
3
+ import { VenueDTO } from "../../types/dto/venue.dto";
4
+ import { VenueModel } from "../../types/model/venue.model";
5
+ export declare function toVenueModel(venueDTO: VenueDTO, lessonMap: Record<string, LessonDTO>, instructorMap: Record<string, InstructorDTO>): VenueModel;
@@ -0,0 +1,3 @@
1
+ export declare function itemArrayToItemRecords<T extends {
2
+ _id: string;
3
+ }>(arr: T[]): Record<string, T>;
@@ -1,4 +1,5 @@
1
1
  export interface LessonDTO {
2
+ id: string;
2
3
  lessonday: string;
3
4
  lessonstart: string;
4
5
  instructors: string[];
@@ -0,0 +1,8 @@
1
+ export interface AppealChoreographerUser {
2
+ userId: string;
3
+ choreographerId: string;
4
+ phoneNumber: string;
5
+ email: string;
6
+ createdAt: Date;
7
+ resolved: boolean;
8
+ }
@@ -0,0 +1,8 @@
1
+ export interface AppealInstructorUser {
2
+ userId: string;
3
+ instructorId: string;
4
+ phoneNumber: string;
5
+ email: string;
6
+ createdAt: Date;
7
+ resolved: boolean;
8
+ }
@@ -0,0 +1,6 @@
1
+ export interface CancelledLessonEntity {
2
+ _id?: string;
3
+ lessonId: string;
4
+ date: Date;
5
+ createdAt: Date;
6
+ }
@@ -0,0 +1,5 @@
1
+ export interface ChoreographerEntity {
2
+ _id: string;
3
+ associatedUserId: string;
4
+ name: string;
5
+ }
@@ -0,0 +1,9 @@
1
+ export interface DanceEntity {
2
+ _id: string;
3
+ danceName: string;
4
+ choreographers: string[];
5
+ stepsheet: string;
6
+ difficulty: string;
7
+ primaryTrack: string;
8
+ tracks: string[];
9
+ }
@@ -0,0 +1,8 @@
1
+ export interface DanceCollectionEntity {
2
+ _id: string;
3
+ name: string;
4
+ danceIds: string[];
5
+ createdBy: string;
6
+ createdAt: Date;
7
+ isPrivate: boolean;
8
+ }
@@ -0,0 +1,7 @@
1
+ export interface FriendRequestEntity {
2
+ _id: string;
3
+ requesterId: string;
4
+ requesteeId: string;
5
+ status: 'pending' | 'accepted' | 'declined';
6
+ createdAt: Date;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface InstructorEntity {
2
+ _id: string;
3
+ name: string;
4
+ associatedUserId: string | null;
5
+ }
@@ -0,0 +1,13 @@
1
+ export interface LessonEntity {
2
+ _id: string;
3
+ venueid: string;
4
+ title: string;
5
+ description: string;
6
+ lessonday: string;
7
+ lessonstart: string;
8
+ instructors: string[];
9
+ duration: string;
10
+ lessoncost: string;
11
+ notes: string;
12
+ difficulty: string;
13
+ }
@@ -0,0 +1,9 @@
1
+ export interface TrackEntity {
2
+ _id: string;
3
+ name: string;
4
+ artists: string[];
5
+ isrc: string;
6
+ uri: string;
7
+ duration_ms: number;
8
+ explicit: boolean;
9
+ }
@@ -0,0 +1,9 @@
1
+ export interface UserEntity {
2
+ _id: string;
3
+ email: string;
4
+ name: string;
5
+ username?: string;
6
+ image?: string;
7
+ bio?: string;
8
+ links?: Record<string, string>;
9
+ }
@@ -0,0 +1,8 @@
1
+ export interface UserCollectionEntity {
2
+ _id: string;
3
+ name: string;
4
+ danceIds: string[];
5
+ createdBy: string;
6
+ createdAt: Date;
7
+ isPrivate: boolean;
8
+ }
@@ -0,0 +1,5 @@
1
+ export interface UserFavoriteVenueEntity {
2
+ _id: string;
3
+ userId: string;
4
+ venueId: string;
5
+ }