@aneuhold/be-ts-db-lib 4.1.2 → 4.2.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/CHANGELOG.md +18 -0
- package/README.md +1 -0
- package/lib/repositories/BaseRepository.d.ts +8 -1
- package/lib/repositories/BaseRepository.d.ts.map +1 -1
- package/lib/repositories/BaseRepository.js +13 -1
- package/lib/repositories/BaseRepository.js.map +1 -1
- package/lib/repositories/BaseRepository.ts +14 -1
- package/lib/repositories/common/UserRepository.d.ts.map +1 -1
- package/lib/repositories/common/UserRepository.js +12 -0
- package/lib/repositories/common/UserRepository.js.map +1 -1
- package/lib/repositories/common/UserRepository.ts +12 -0
- package/lib/repositories/dashboard/DashboardBaseWithUserIdRepository.d.ts +20 -0
- package/lib/repositories/dashboard/DashboardBaseWithUserIdRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardBaseWithUserIdRepository.js +36 -4
- package/lib/repositories/dashboard/DashboardBaseWithUserIdRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardBaseWithUserIdRepository.ts +39 -4
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.js +2 -12
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.ts +2 -16
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.js +2 -12
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.ts +2 -16
- package/lib/repositories/dashboard/DashboardTaskRepository.d.ts +14 -0
- package/lib/repositories/dashboard/DashboardTaskRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardTaskRepository.js +33 -35
- package/lib/repositories/dashboard/DashboardTaskRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardTaskRepository.ts +41 -45
- package/lib/repositories/dashboard/DashboardUserConfigRepository.d.ts +14 -0
- package/lib/repositories/dashboard/DashboardUserConfigRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardUserConfigRepository.js +26 -15
- package/lib/repositories/dashboard/DashboardUserConfigRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardUserConfigRepository.ts +38 -21
- package/lib/repositories/workout/WorkoutBaseRepository.d.ts +22 -0
- package/lib/repositories/workout/WorkoutBaseRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutBaseRepository.js +53 -0
- package/lib/repositories/workout/WorkoutBaseRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutBaseRepository.ts +85 -0
- package/lib/repositories/workout/WorkoutBaseWithUserIdRepository.d.ts +40 -0
- package/lib/repositories/workout/WorkoutBaseWithUserIdRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutBaseWithUserIdRepository.js +96 -0
- package/lib/repositories/workout/WorkoutBaseWithUserIdRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutBaseWithUserIdRepository.ts +134 -0
- package/lib/repositories/workout/WorkoutEquipmentTypeRepository.d.ts +17 -0
- package/lib/repositories/workout/WorkoutEquipmentTypeRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutEquipmentTypeRepository.js +34 -0
- package/lib/repositories/workout/WorkoutEquipmentTypeRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutEquipmentTypeRepository.ts +40 -0
- package/lib/repositories/workout/WorkoutExerciseCalibrationRepository.d.ts +31 -0
- package/lib/repositories/workout/WorkoutExerciseCalibrationRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutExerciseCalibrationRepository.js +70 -0
- package/lib/repositories/workout/WorkoutExerciseCalibrationRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutExerciseCalibrationRepository.ts +84 -0
- package/lib/repositories/workout/WorkoutExerciseRepository.d.ts +14 -0
- package/lib/repositories/workout/WorkoutExerciseRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutExerciseRepository.js +34 -0
- package/lib/repositories/workout/WorkoutExerciseRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutExerciseRepository.ts +40 -0
- package/lib/repositories/workout/WorkoutMesocycleRepository.d.ts +14 -0
- package/lib/repositories/workout/WorkoutMesocycleRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutMesocycleRepository.js +34 -0
- package/lib/repositories/workout/WorkoutMesocycleRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutMesocycleRepository.ts +40 -0
- package/lib/repositories/workout/WorkoutMicrocycleRepository.d.ts +31 -0
- package/lib/repositories/workout/WorkoutMicrocycleRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutMicrocycleRepository.js +72 -0
- package/lib/repositories/workout/WorkoutMicrocycleRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutMicrocycleRepository.ts +86 -0
- package/lib/repositories/workout/WorkoutMuscleGroupRepository.d.ts +20 -0
- package/lib/repositories/workout/WorkoutMuscleGroupRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutMuscleGroupRepository.js +37 -0
- package/lib/repositories/workout/WorkoutMuscleGroupRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutMuscleGroupRepository.ts +43 -0
- package/lib/repositories/workout/WorkoutSessionExerciseRepository.d.ts +31 -0
- package/lib/repositories/workout/WorkoutSessionExerciseRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutSessionExerciseRepository.js +72 -0
- package/lib/repositories/workout/WorkoutSessionExerciseRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutSessionExerciseRepository.ts +86 -0
- package/lib/repositories/workout/WorkoutSessionRepository.d.ts +31 -0
- package/lib/repositories/workout/WorkoutSessionRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutSessionRepository.js +72 -0
- package/lib/repositories/workout/WorkoutSessionRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutSessionRepository.ts +86 -0
- package/lib/repositories/workout/WorkoutSetRepository.d.ts +31 -0
- package/lib/repositories/workout/WorkoutSetRepository.d.ts.map +1 -0
- package/lib/repositories/workout/WorkoutSetRepository.js +69 -0
- package/lib/repositories/workout/WorkoutSetRepository.js.map +1 -0
- package/lib/repositories/workout/WorkoutSetRepository.ts +89 -0
- package/lib/util/DbSchemaUpdater.d.ts.map +1 -1
- package/lib/util/DbSchemaUpdater.js +25 -0
- package/lib/util/DbSchemaUpdater.js.map +1 -1
- package/lib/util/DbSchemaUpdater.ts +27 -0
- package/lib/util/DocumentCleaner.d.ts +2 -1
- package/lib/util/DocumentCleaner.d.ts.map +1 -1
- package/lib/util/DocumentCleaner.js +5 -0
- package/lib/util/DocumentCleaner.js.map +1 -1
- package/lib/util/DocumentCleaner.ts +14 -1
- package/lib/util/globalTestVariables.d.ts +8 -0
- package/lib/util/globalTestVariables.d.ts.map +1 -0
- package/lib/util/globalTestVariables.js +8 -0
- package/lib/util/globalTestVariables.js.map +1 -0
- package/lib/{tests → util}/globalTestVariables.ts +3 -0
- package/lib/validators/common/UserValidator.js +1 -1
- package/lib/validators/common/UserValidator.js.map +1 -1
- package/lib/validators/common/UserValidator.ts +1 -1
- package/lib/validators/workout/EquipmentTypeValidator.d.ts +9 -0
- package/lib/validators/workout/EquipmentTypeValidator.d.ts.map +1 -0
- package/lib/validators/workout/EquipmentTypeValidator.js +43 -0
- package/lib/validators/workout/EquipmentTypeValidator.js.map +1 -0
- package/lib/validators/workout/EquipmentTypeValidator.ts +56 -0
- package/lib/validators/workout/ExerciseCalibrationValidator.d.ts +9 -0
- package/lib/validators/workout/ExerciseCalibrationValidator.d.ts.map +1 -0
- package/lib/validators/workout/ExerciseCalibrationValidator.js +65 -0
- package/lib/validators/workout/ExerciseCalibrationValidator.js.map +1 -0
- package/lib/validators/workout/ExerciseCalibrationValidator.ts +85 -0
- package/lib/validators/workout/ExerciseValidator.d.ts +9 -0
- package/lib/validators/workout/ExerciseValidator.d.ts.map +1 -0
- package/lib/validators/workout/ExerciseValidator.js +117 -0
- package/lib/validators/workout/ExerciseValidator.js.map +1 -0
- package/lib/validators/workout/ExerciseValidator.ts +156 -0
- package/lib/validators/workout/MesocycleValidator.d.ts +9 -0
- package/lib/validators/workout/MesocycleValidator.d.ts.map +1 -0
- package/lib/validators/workout/MesocycleValidator.js +56 -0
- package/lib/validators/workout/MesocycleValidator.js.map +1 -0
- package/lib/validators/workout/MesocycleValidator.ts +73 -0
- package/lib/validators/workout/MicrocycleValidator.d.ts +9 -0
- package/lib/validators/workout/MicrocycleValidator.d.ts.map +1 -0
- package/lib/validators/workout/MicrocycleValidator.js +73 -0
- package/lib/validators/workout/MicrocycleValidator.js.map +1 -0
- package/lib/validators/workout/MicrocycleValidator.ts +91 -0
- package/lib/validators/workout/MuscleGroupValidator.d.ts +9 -0
- package/lib/validators/workout/MuscleGroupValidator.d.ts.map +1 -0
- package/lib/validators/workout/MuscleGroupValidator.js +43 -0
- package/lib/validators/workout/MuscleGroupValidator.js.map +1 -0
- package/lib/validators/workout/MuscleGroupValidator.ts +53 -0
- package/lib/validators/workout/SessionExerciseValidator.d.ts +9 -0
- package/lib/validators/workout/SessionExerciseValidator.d.ts.map +1 -0
- package/lib/validators/workout/SessionExerciseValidator.js +94 -0
- package/lib/validators/workout/SessionExerciseValidator.js.map +1 -0
- package/lib/validators/workout/SessionExerciseValidator.ts +117 -0
- package/lib/validators/workout/SessionValidator.d.ts +9 -0
- package/lib/validators/workout/SessionValidator.d.ts.map +1 -0
- package/lib/validators/workout/SessionValidator.js +73 -0
- package/lib/validators/workout/SessionValidator.js.map +1 -0
- package/lib/validators/workout/SessionValidator.ts +89 -0
- package/lib/validators/workout/SetValidator.d.ts +9 -0
- package/lib/validators/workout/SetValidator.d.ts.map +1 -0
- package/lib/validators/workout/SetValidator.js +69 -0
- package/lib/validators/workout/SetValidator.js.map +1 -0
- package/lib/validators/workout/SetValidator.ts +88 -0
- package/package.json +6 -5
- package/lib/tests/globalTestVariables.d.ts +0 -5
- package/lib/tests/globalTestVariables.d.ts.map +0 -1
- package/lib/tests/globalTestVariables.js +0 -5
- package/lib/tests/globalTestVariables.js.map +0 -1
- package/lib/tests/testsUtil.d.ts +0 -34
- package/lib/tests/testsUtil.d.ts.map +0 -1
- package/lib/tests/testsUtil.js +0 -60
- package/lib/tests/testsUtil.js.map +0 -1
- package/lib/tests/testsUtil.ts +0 -68
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import CleanDocument from '../../util/DocumentCleaner.js';
|
|
2
|
+
import WorkoutBaseRepository from './WorkoutBaseRepository.js';
|
|
3
|
+
/**
|
|
4
|
+
* A base repository for the `workout` collection that requires a `userId`.
|
|
5
|
+
*/
|
|
6
|
+
export default class WorkoutBaseWithUserIdRepository extends WorkoutBaseRepository {
|
|
7
|
+
constructor(docType, validator, updateCleaner) {
|
|
8
|
+
const defaultUpdateCleaner = (doc) => updateCleaner ? updateCleaner(CleanDocument.userId(doc)) : CleanDocument.userId(doc);
|
|
9
|
+
super(docType, validator, defaultUpdateCleaner);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Gets all items for a given user.
|
|
13
|
+
*
|
|
14
|
+
* @param userId - The user ID to get items for.
|
|
15
|
+
*/
|
|
16
|
+
async getAllForUser(userId) {
|
|
17
|
+
return this.getAllForUsers([userId]);
|
|
18
|
+
}
|
|
19
|
+
async getAllForUsers(userIds) {
|
|
20
|
+
const filter = {
|
|
21
|
+
userId: { $in: userIds }
|
|
22
|
+
};
|
|
23
|
+
return this.getListWithFilter(filter);
|
|
24
|
+
}
|
|
25
|
+
async insertNew(newDoc, meta) {
|
|
26
|
+
const result = await super.insertNew(newDoc, meta);
|
|
27
|
+
if (result) {
|
|
28
|
+
meta?.addAffectedUserIds([result.userId]);
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
async insertMany(newDocs, meta) {
|
|
33
|
+
const result = await super.insertMany(newDocs, meta);
|
|
34
|
+
meta?.addAffectedUserIds(result.map((d) => d.userId));
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
async update(updatedDoc, meta) {
|
|
38
|
+
if (meta && updatedDoc._id) {
|
|
39
|
+
const docs = await this.fetchAndCacheDocsForMeta([updatedDoc._id], meta);
|
|
40
|
+
if (docs.length > 0) {
|
|
41
|
+
meta.addAffectedUserIds([docs[0].userId]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return super.update(updatedDoc, meta);
|
|
45
|
+
}
|
|
46
|
+
async updateMany(updatedDocs, meta) {
|
|
47
|
+
if (meta && updatedDocs.length > 0) {
|
|
48
|
+
const docIds = updatedDocs.map((doc) => doc._id).filter((id) => id !== undefined);
|
|
49
|
+
const cachedDocs = await this.fetchAndCacheDocsForMeta(docIds, meta);
|
|
50
|
+
meta.addAffectedUserIds(cachedDocs.map((doc) => doc.userId));
|
|
51
|
+
}
|
|
52
|
+
return super.updateMany(updatedDocs, meta);
|
|
53
|
+
}
|
|
54
|
+
async delete(docId, meta) {
|
|
55
|
+
if (meta) {
|
|
56
|
+
const docs = await this.fetchAndCacheDocsForMeta([docId], meta);
|
|
57
|
+
if (docs.length > 0) {
|
|
58
|
+
meta.addAffectedUserIds([docs[0].userId]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return super.delete(docId, meta);
|
|
62
|
+
}
|
|
63
|
+
async deleteList(docIds, meta) {
|
|
64
|
+
if (meta) {
|
|
65
|
+
const cachedDocs = await this.fetchAndCacheDocsForMeta(docIds, meta);
|
|
66
|
+
meta.addAffectedUserIds(cachedDocs.map((doc) => doc.userId));
|
|
67
|
+
}
|
|
68
|
+
return super.deleteList(docIds, meta);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Deletes all documents for a specific user.
|
|
72
|
+
*
|
|
73
|
+
* @param userId - The user ID to delete documents for.
|
|
74
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
75
|
+
*/
|
|
76
|
+
async deleteAllForUser(userId, meta) {
|
|
77
|
+
return this.deleteAllForUsers([userId], meta);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Deletes all documents for specific users.
|
|
81
|
+
*
|
|
82
|
+
* @param userIds - The user IDs to delete documents for.
|
|
83
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
84
|
+
*/
|
|
85
|
+
async deleteAllForUsers(userIds, meta) {
|
|
86
|
+
// This does mean we are retrieving all documents twice, because deleteList also fetches them.
|
|
87
|
+
// That isn't very efficient, but at the moment of writing this, it seemed fine because this
|
|
88
|
+
// operation shouldn't be used very often at all.
|
|
89
|
+
const docsForUsers = await this.getAllForUsers(userIds);
|
|
90
|
+
meta?.recordDocTypeTouched(this.docType);
|
|
91
|
+
meta?.addAffectedUserIds(userIds);
|
|
92
|
+
const docIds = docsForUsers.map((doc) => doc._id);
|
|
93
|
+
return this.deleteList(docIds, meta);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=WorkoutBaseWithUserIdRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutBaseWithUserIdRepository.js","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutBaseWithUserIdRepository.ts"],"names":[],"mappings":"AAQA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAgB,+BAE5B,SAAQ,qBAAgC;IACxC,YACE,OAAe,EACf,SAAgC,EAChC,aAA+D;QAE/D,MAAM,oBAAoB,GAAG,CAAC,GAAuB,EAAE,EAAE,CACvD,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAA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|
6
|
+
import type { UUID } from 'crypto';
|
|
7
|
+
import type { BulkWriteResult, DeleteResult, Filter, UpdateResult } from 'mongodb';
|
|
8
|
+
import type DbOperationMetaData from '../../util/DbOperationMetaData.js';
|
|
9
|
+
import CleanDocument from '../../util/DocumentCleaner.js';
|
|
10
|
+
import type IValidator from '../../validators/BaseValidator.js';
|
|
11
|
+
import WorkoutBaseRepository from './WorkoutBaseRepository.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A base repository for the `workout` collection that requires a `userId`.
|
|
15
|
+
*/
|
|
16
|
+
export default abstract class WorkoutBaseWithUserIdRepository<
|
|
17
|
+
TBaseType extends BaseDocumentWithType & BaseDocumentWithUpdatedAndCreatedDates & RequiredUserId
|
|
18
|
+
> extends WorkoutBaseRepository<TBaseType> {
|
|
19
|
+
constructor(
|
|
20
|
+
docType: string,
|
|
21
|
+
validator: IValidator<TBaseType>,
|
|
22
|
+
updateCleaner?: (doc: Partial<TBaseType>) => Partial<TBaseType>
|
|
23
|
+
) {
|
|
24
|
+
const defaultUpdateCleaner = (doc: Partial<TBaseType>) =>
|
|
25
|
+
updateCleaner ? updateCleaner(CleanDocument.userId(doc)) : CleanDocument.userId(doc);
|
|
26
|
+
super(docType, validator, defaultUpdateCleaner);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Gets all items for a given user.
|
|
31
|
+
*
|
|
32
|
+
* @param userId - The user ID to get items for.
|
|
33
|
+
*/
|
|
34
|
+
async getAllForUser(userId: UUID): Promise<TBaseType[]> {
|
|
35
|
+
return this.getAllForUsers([userId]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async getAllForUsers(userIds: UUID[]): Promise<TBaseType[]> {
|
|
39
|
+
const filter = {
|
|
40
|
+
userId: { $in: userIds }
|
|
41
|
+
} as Filter<TBaseType>;
|
|
42
|
+
return this.getListWithFilter(filter);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override async insertNew(
|
|
46
|
+
newDoc: TBaseType,
|
|
47
|
+
meta?: DbOperationMetaData
|
|
48
|
+
): Promise<TBaseType | null> {
|
|
49
|
+
const result = await super.insertNew(newDoc, meta);
|
|
50
|
+
if (result) {
|
|
51
|
+
meta?.addAffectedUserIds([result.userId]);
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
override async insertMany(
|
|
57
|
+
newDocs: TBaseType[],
|
|
58
|
+
meta?: DbOperationMetaData
|
|
59
|
+
): Promise<TBaseType[]> {
|
|
60
|
+
const result = await super.insertMany(newDocs, meta);
|
|
61
|
+
meta?.addAffectedUserIds(result.map((d) => d.userId));
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override async update(
|
|
66
|
+
updatedDoc: Partial<TBaseType>,
|
|
67
|
+
meta?: DbOperationMetaData
|
|
68
|
+
): Promise<UpdateResult> {
|
|
69
|
+
if (meta && updatedDoc._id) {
|
|
70
|
+
const docs = await this.fetchAndCacheDocsForMeta([updatedDoc._id], meta);
|
|
71
|
+
if (docs.length > 0) {
|
|
72
|
+
meta.addAffectedUserIds([docs[0].userId]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return super.update(updatedDoc, meta);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
override async updateMany(
|
|
79
|
+
updatedDocs: Partial<TBaseType>[],
|
|
80
|
+
meta?: DbOperationMetaData
|
|
81
|
+
): Promise<BulkWriteResult> {
|
|
82
|
+
if (meta && updatedDocs.length > 0) {
|
|
83
|
+
const docIds = updatedDocs.map((doc) => doc._id).filter((id): id is UUID => id !== undefined);
|
|
84
|
+
const cachedDocs = await this.fetchAndCacheDocsForMeta(docIds, meta);
|
|
85
|
+
meta.addAffectedUserIds(cachedDocs.map((doc) => doc.userId));
|
|
86
|
+
}
|
|
87
|
+
return super.updateMany(updatedDocs, meta);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override async delete(docId: UUID, meta?: DbOperationMetaData): Promise<DeleteResult> {
|
|
91
|
+
if (meta) {
|
|
92
|
+
const docs = await this.fetchAndCacheDocsForMeta([docId], meta);
|
|
93
|
+
if (docs.length > 0) {
|
|
94
|
+
meta.addAffectedUserIds([docs[0].userId]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return super.delete(docId, meta);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
override async deleteList(docIds: UUID[], meta?: DbOperationMetaData): Promise<DeleteResult> {
|
|
101
|
+
if (meta) {
|
|
102
|
+
const cachedDocs = await this.fetchAndCacheDocsForMeta(docIds, meta);
|
|
103
|
+
meta.addAffectedUserIds(cachedDocs.map((doc) => doc.userId));
|
|
104
|
+
}
|
|
105
|
+
return super.deleteList(docIds, meta);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Deletes all documents for a specific user.
|
|
110
|
+
*
|
|
111
|
+
* @param userId - The user ID to delete documents for.
|
|
112
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
113
|
+
*/
|
|
114
|
+
async deleteAllForUser(userId: UUID, meta?: DbOperationMetaData): Promise<DeleteResult> {
|
|
115
|
+
return this.deleteAllForUsers([userId], meta);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Deletes all documents for specific users.
|
|
120
|
+
*
|
|
121
|
+
* @param userIds - The user IDs to delete documents for.
|
|
122
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
123
|
+
*/
|
|
124
|
+
async deleteAllForUsers(userIds: UUID[], meta?: DbOperationMetaData): Promise<DeleteResult> {
|
|
125
|
+
// This does mean we are retrieving all documents twice, because deleteList also fetches them.
|
|
126
|
+
// That isn't very efficient, but at the moment of writing this, it seemed fine because this
|
|
127
|
+
// operation shouldn't be used very often at all.
|
|
128
|
+
const docsForUsers = await this.getAllForUsers(userIds);
|
|
129
|
+
meta?.recordDocTypeTouched(this.docType);
|
|
130
|
+
meta?.addAffectedUserIds(userIds);
|
|
131
|
+
const docIds = docsForUsers.map((doc) => doc._id);
|
|
132
|
+
return this.deleteList(docIds, meta);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { User, WorkoutEquipmentType } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
3
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repository that contains {@link WorkoutEquipmentType} documents.
|
|
6
|
+
*/
|
|
7
|
+
export default class WorkoutEquipmentTypeRepository extends WorkoutBaseWithUserIdRepository<WorkoutEquipmentType> {
|
|
8
|
+
private static singletonInstance?;
|
|
9
|
+
private constructor();
|
|
10
|
+
static getListenersForUserRepo(): RepoListeners<User>;
|
|
11
|
+
protected setupSubscribers(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Gets the singleton instance of the {@link WorkoutEquipmentTypeRepository}.
|
|
14
|
+
*/
|
|
15
|
+
static getRepo(): WorkoutEquipmentTypeRepository;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=WorkoutEquipmentTypeRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutEquipmentTypeRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutEquipmentTypeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,8BAA+B,SAAQ,+BAA+B,CAAC,oBAAoB,CAAC;IAC/G,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAiC;IAElE,OAAO;IAIP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAYrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAElC;;OAEG;WACW,OAAO,IAAI,8BAA8B;CAMxD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WorkoutEquipmentType_docType } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import WorkoutEquipmentTypeValidator from '../../validators/workout/EquipmentTypeValidator.js';
|
|
3
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repository that contains {@link WorkoutEquipmentType} documents.
|
|
6
|
+
*/
|
|
7
|
+
export default class WorkoutEquipmentTypeRepository extends WorkoutBaseWithUserIdRepository {
|
|
8
|
+
static singletonInstance;
|
|
9
|
+
constructor() {
|
|
10
|
+
super(WorkoutEquipmentType_docType, new WorkoutEquipmentTypeValidator());
|
|
11
|
+
}
|
|
12
|
+
static getListenersForUserRepo() {
|
|
13
|
+
const equipmentTypeRepo = WorkoutEquipmentTypeRepository.getRepo();
|
|
14
|
+
return {
|
|
15
|
+
deleteOne: async (userId, meta) => {
|
|
16
|
+
await equipmentTypeRepo.deleteAllForUser(userId, meta);
|
|
17
|
+
},
|
|
18
|
+
deleteList: async (userIds, meta) => {
|
|
19
|
+
await equipmentTypeRepo.deleteAllForUsers(userIds, meta);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
setupSubscribers() { }
|
|
24
|
+
/**
|
|
25
|
+
* Gets the singleton instance of the {@link WorkoutEquipmentTypeRepository}.
|
|
26
|
+
*/
|
|
27
|
+
static getRepo() {
|
|
28
|
+
if (!WorkoutEquipmentTypeRepository.singletonInstance) {
|
|
29
|
+
WorkoutEquipmentTypeRepository.singletonInstance = new WorkoutEquipmentTypeRepository();
|
|
30
|
+
}
|
|
31
|
+
return WorkoutEquipmentTypeRepository.singletonInstance;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=WorkoutEquipmentTypeRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutEquipmentTypeRepository.js","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutEquipmentTypeRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,6BAA6B,MAAM,oDAAoD,CAAC;AAC/F,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,8BAA+B,SAAQ,+BAAqD;IACvG,MAAM,CAAC,iBAAiB,CAAkC;IAElE;QACE,KAAK,CAAC,4BAA4B,EAAE,IAAI,6BAA6B,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,iBAAiB,GAAG,8BAA8B,CAAC,OAAO,EAAE,CAAC;QACnE,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;gBAChC,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACzD,CAAC;YACD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;gBAClC,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YAC3D,CAAC;SACF,CAAC;IACJ,CAAC;IAES,gBAAgB,KAAU,CAAC;IAErC;;OAEG;IACI,MAAM,CAAC,OAAO;QACnB,IAAI,CAAC,8BAA8B,CAAC,iBAAiB,EAAE,CAAC;YACtD,8BAA8B,CAAC,iBAAiB,GAAG,IAAI,8BAA8B,EAAE,CAAC;QAC1F,CAAC;QACD,OAAO,8BAA8B,CAAC,iBAAiB,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { User, WorkoutEquipmentType } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import { WorkoutEquipmentType_docType } from '@aneuhold/core-ts-db-lib';
|
|
3
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
4
|
+
import WorkoutEquipmentTypeValidator from '../../validators/workout/EquipmentTypeValidator.js';
|
|
5
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The repository that contains {@link WorkoutEquipmentType} documents.
|
|
9
|
+
*/
|
|
10
|
+
export default class WorkoutEquipmentTypeRepository extends WorkoutBaseWithUserIdRepository<WorkoutEquipmentType> {
|
|
11
|
+
private static singletonInstance?: WorkoutEquipmentTypeRepository;
|
|
12
|
+
|
|
13
|
+
private constructor() {
|
|
14
|
+
super(WorkoutEquipmentType_docType, new WorkoutEquipmentTypeValidator());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static getListenersForUserRepo(): RepoListeners<User> {
|
|
18
|
+
const equipmentTypeRepo = WorkoutEquipmentTypeRepository.getRepo();
|
|
19
|
+
return {
|
|
20
|
+
deleteOne: async (userId, meta) => {
|
|
21
|
+
await equipmentTypeRepo.deleteAllForUser(userId, meta);
|
|
22
|
+
},
|
|
23
|
+
deleteList: async (userIds, meta) => {
|
|
24
|
+
await equipmentTypeRepo.deleteAllForUsers(userIds, meta);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
protected setupSubscribers(): void {}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Gets the singleton instance of the {@link WorkoutEquipmentTypeRepository}.
|
|
33
|
+
*/
|
|
34
|
+
public static getRepo(): WorkoutEquipmentTypeRepository {
|
|
35
|
+
if (!WorkoutEquipmentTypeRepository.singletonInstance) {
|
|
36
|
+
WorkoutEquipmentTypeRepository.singletonInstance = new WorkoutEquipmentTypeRepository();
|
|
37
|
+
}
|
|
38
|
+
return WorkoutEquipmentTypeRepository.singletonInstance;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { User, WorkoutExercise, WorkoutExerciseCalibration } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import type { UUID } from 'crypto';
|
|
3
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
4
|
+
import type DbOperationMetaData from '../../util/DbOperationMetaData.js';
|
|
5
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
6
|
+
/**
|
|
7
|
+
* The repository that contains {@link WorkoutExerciseCalibration} documents.
|
|
8
|
+
*/
|
|
9
|
+
export default class WorkoutExerciseCalibrationRepository extends WorkoutBaseWithUserIdRepository<WorkoutExerciseCalibration> {
|
|
10
|
+
private static singletonInstance?;
|
|
11
|
+
private constructor();
|
|
12
|
+
static getListenersForUserRepo(): RepoListeners<User>;
|
|
13
|
+
static getListenersForExerciseRepo(): RepoListeners<WorkoutExercise>;
|
|
14
|
+
protected setupSubscribers(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Deletes all calibrations for a specific exercise.
|
|
17
|
+
*
|
|
18
|
+
* @param exerciseId - The exercise ID to delete calibrations for.
|
|
19
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
20
|
+
*/
|
|
21
|
+
deleteAllForExercise(exerciseId: UUID, meta?: DbOperationMetaData): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Deletes all calibrations for specific exercises.
|
|
24
|
+
*
|
|
25
|
+
* @param exerciseIds - The exercise IDs to delete calibrations for.
|
|
26
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
27
|
+
*/
|
|
28
|
+
deleteAllForExercises(exerciseIds: UUID[], meta?: DbOperationMetaData): Promise<void>;
|
|
29
|
+
static getRepo(): WorkoutExerciseCalibrationRepository;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=WorkoutExerciseCalibrationRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutExerciseCalibrationRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutExerciseCalibrationRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAElG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,KAAK,mBAAmB,MAAM,mCAAmC,CAAC;AAEzE,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oCAAqC,SAAQ,+BAA+B,CAAC,0BAA0B,CAAC;IAC3H,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAuC;IAExE,OAAO;IAIP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAYrD,MAAM,CAAC,2BAA2B,IAAI,aAAa,CAAC,eAAe,CAAC;IAYpE,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAElC;;;;;OAKG;IACG,oBAAoB,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvF;;;;;OAKG;IACG,qBAAqB,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;WAgB7E,OAAO,IAAI,oCAAoC;CAO9D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { WorkoutExerciseCalibration_docType } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import WorkoutExerciseCalibrationValidator from '../../validators/workout/ExerciseCalibrationValidator.js';
|
|
3
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repository that contains {@link WorkoutExerciseCalibration} documents.
|
|
6
|
+
*/
|
|
7
|
+
export default class WorkoutExerciseCalibrationRepository extends WorkoutBaseWithUserIdRepository {
|
|
8
|
+
static singletonInstance;
|
|
9
|
+
constructor() {
|
|
10
|
+
super(WorkoutExerciseCalibration_docType, new WorkoutExerciseCalibrationValidator());
|
|
11
|
+
}
|
|
12
|
+
static getListenersForUserRepo() {
|
|
13
|
+
const calibrationRepo = WorkoutExerciseCalibrationRepository.getRepo();
|
|
14
|
+
return {
|
|
15
|
+
deleteOne: async (userId, meta) => {
|
|
16
|
+
await calibrationRepo.deleteAllForUser(userId, meta);
|
|
17
|
+
},
|
|
18
|
+
deleteList: async (userIds, meta) => {
|
|
19
|
+
await calibrationRepo.deleteAllForUsers(userIds, meta);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static getListenersForExerciseRepo() {
|
|
24
|
+
const calibrationRepo = WorkoutExerciseCalibrationRepository.getRepo();
|
|
25
|
+
return {
|
|
26
|
+
deleteOne: async (exerciseId, meta) => {
|
|
27
|
+
await calibrationRepo.deleteAllForExercise(exerciseId, meta);
|
|
28
|
+
},
|
|
29
|
+
deleteList: async (exerciseIds, meta) => {
|
|
30
|
+
await calibrationRepo.deleteAllForExercises(exerciseIds, meta);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
setupSubscribers() { }
|
|
35
|
+
/**
|
|
36
|
+
* Deletes all calibrations for a specific exercise.
|
|
37
|
+
*
|
|
38
|
+
* @param exerciseId - The exercise ID to delete calibrations for.
|
|
39
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
40
|
+
*/
|
|
41
|
+
async deleteAllForExercise(exerciseId, meta) {
|
|
42
|
+
await this.deleteAllForExercises([exerciseId], meta);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Deletes all calibrations for specific exercises.
|
|
46
|
+
*
|
|
47
|
+
* @param exerciseIds - The exercise IDs to delete calibrations for.
|
|
48
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
49
|
+
*/
|
|
50
|
+
async deleteAllForExercises(exerciseIds, meta) {
|
|
51
|
+
const calibrationsForExercises = await (await this.getCollection())
|
|
52
|
+
.find({
|
|
53
|
+
workoutExerciseId: { $in: exerciseIds },
|
|
54
|
+
docType: WorkoutExerciseCalibration_docType
|
|
55
|
+
})
|
|
56
|
+
.toArray();
|
|
57
|
+
const docIds = calibrationsForExercises.map((doc) => doc._id);
|
|
58
|
+
if (docIds.length > 0) {
|
|
59
|
+
await this.deleteList(docIds, meta);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
static getRepo() {
|
|
63
|
+
if (!WorkoutExerciseCalibrationRepository.singletonInstance) {
|
|
64
|
+
WorkoutExerciseCalibrationRepository.singletonInstance =
|
|
65
|
+
new WorkoutExerciseCalibrationRepository();
|
|
66
|
+
}
|
|
67
|
+
return WorkoutExerciseCalibrationRepository.singletonInstance;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=WorkoutExerciseCalibrationRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutExerciseCalibrationRepository.js","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutExerciseCalibrationRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAI9E,OAAO,mCAAmC,MAAM,0DAA0D,CAAC;AAC3G,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,oCAAqC,SAAQ,+BAA2D;IACnH,MAAM,CAAC,iBAAiB,CAAwC;IAExE;QACE,KAAK,CAAC,kCAAkC,EAAE,IAAI,mCAAmC,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,eAAe,GAAG,oCAAoC,CA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AC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,OAAO;QACnB,IAAI,CAAC,oCAAoC,CAAC,iBAAiB,EAAE,CAAC;YAC5D,oCAAoC,CAAC,iBAAiB;gBACpD,IAAI,oCAAoC,EAAE,CAAC;QAC/C,CAAC;QACD,OAAO,oCAAoC,CAAC,iBAAiB,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { User, WorkoutExercise, WorkoutExerciseCalibration } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import { WorkoutExerciseCalibration_docType } from '@aneuhold/core-ts-db-lib';
|
|
3
|
+
import type { UUID } from 'crypto';
|
|
4
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
5
|
+
import type DbOperationMetaData from '../../util/DbOperationMetaData.js';
|
|
6
|
+
import WorkoutExerciseCalibrationValidator from '../../validators/workout/ExerciseCalibrationValidator.js';
|
|
7
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The repository that contains {@link WorkoutExerciseCalibration} documents.
|
|
11
|
+
*/
|
|
12
|
+
export default class WorkoutExerciseCalibrationRepository extends WorkoutBaseWithUserIdRepository<WorkoutExerciseCalibration> {
|
|
13
|
+
private static singletonInstance?: WorkoutExerciseCalibrationRepository;
|
|
14
|
+
|
|
15
|
+
private constructor() {
|
|
16
|
+
super(WorkoutExerciseCalibration_docType, new WorkoutExerciseCalibrationValidator());
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static getListenersForUserRepo(): RepoListeners<User> {
|
|
20
|
+
const calibrationRepo = WorkoutExerciseCalibrationRepository.getRepo();
|
|
21
|
+
return {
|
|
22
|
+
deleteOne: async (userId, meta) => {
|
|
23
|
+
await calibrationRepo.deleteAllForUser(userId, meta);
|
|
24
|
+
},
|
|
25
|
+
deleteList: async (userIds, meta) => {
|
|
26
|
+
await calibrationRepo.deleteAllForUsers(userIds, meta);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static getListenersForExerciseRepo(): RepoListeners<WorkoutExercise> {
|
|
32
|
+
const calibrationRepo = WorkoutExerciseCalibrationRepository.getRepo();
|
|
33
|
+
return {
|
|
34
|
+
deleteOne: async (exerciseId, meta) => {
|
|
35
|
+
await calibrationRepo.deleteAllForExercise(exerciseId, meta);
|
|
36
|
+
},
|
|
37
|
+
deleteList: async (exerciseIds, meta) => {
|
|
38
|
+
await calibrationRepo.deleteAllForExercises(exerciseIds, meta);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
protected setupSubscribers(): void {}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Deletes all calibrations for a specific exercise.
|
|
47
|
+
*
|
|
48
|
+
* @param exerciseId - The exercise ID to delete calibrations for.
|
|
49
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
50
|
+
*/
|
|
51
|
+
async deleteAllForExercise(exerciseId: UUID, meta?: DbOperationMetaData): Promise<void> {
|
|
52
|
+
await this.deleteAllForExercises([exerciseId], meta);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Deletes all calibrations for specific exercises.
|
|
57
|
+
*
|
|
58
|
+
* @param exerciseIds - The exercise IDs to delete calibrations for.
|
|
59
|
+
* @param meta - Tracks database operation metadata for a single request.
|
|
60
|
+
*/
|
|
61
|
+
async deleteAllForExercises(exerciseIds: UUID[], meta?: DbOperationMetaData): Promise<void> {
|
|
62
|
+
const calibrationsForExercises = await (
|
|
63
|
+
await this.getCollection()
|
|
64
|
+
)
|
|
65
|
+
.find({
|
|
66
|
+
workoutExerciseId: { $in: exerciseIds },
|
|
67
|
+
docType: WorkoutExerciseCalibration_docType
|
|
68
|
+
})
|
|
69
|
+
.toArray();
|
|
70
|
+
|
|
71
|
+
const docIds = calibrationsForExercises.map((doc) => doc._id);
|
|
72
|
+
if (docIds.length > 0) {
|
|
73
|
+
await this.deleteList(docIds, meta);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public static getRepo(): WorkoutExerciseCalibrationRepository {
|
|
78
|
+
if (!WorkoutExerciseCalibrationRepository.singletonInstance) {
|
|
79
|
+
WorkoutExerciseCalibrationRepository.singletonInstance =
|
|
80
|
+
new WorkoutExerciseCalibrationRepository();
|
|
81
|
+
}
|
|
82
|
+
return WorkoutExerciseCalibrationRepository.singletonInstance;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { User, WorkoutExercise } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
3
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repository that contains {@link WorkoutExercise} documents.
|
|
6
|
+
*/
|
|
7
|
+
export default class WorkoutExerciseRepository extends WorkoutBaseWithUserIdRepository<WorkoutExercise> {
|
|
8
|
+
private static singletonInstance?;
|
|
9
|
+
private constructor();
|
|
10
|
+
static getListenersForUserRepo(): RepoListeners<User>;
|
|
11
|
+
protected setupSubscribers(): void;
|
|
12
|
+
static getRepo(): WorkoutExerciseRepository;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=WorkoutExerciseRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutExerciseRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutExerciseRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAGnF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,+BAA+B,CAAC,eAAe,CAAC;IACrG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAA4B;IAE7D,OAAO;IAIP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAYrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;WAIpB,OAAO,IAAI,yBAAyB;CAMnD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WorkoutExercise_docType } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import WorkoutExerciseValidator from '../../validators/workout/ExerciseValidator.js';
|
|
3
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
4
|
+
import WorkoutExerciseCalibrationRepository from './WorkoutExerciseCalibrationRepository.js';
|
|
5
|
+
/**
|
|
6
|
+
* The repository that contains {@link WorkoutExercise} documents.
|
|
7
|
+
*/
|
|
8
|
+
export default class WorkoutExerciseRepository extends WorkoutBaseWithUserIdRepository {
|
|
9
|
+
static singletonInstance;
|
|
10
|
+
constructor() {
|
|
11
|
+
super(WorkoutExercise_docType, new WorkoutExerciseValidator());
|
|
12
|
+
}
|
|
13
|
+
static getListenersForUserRepo() {
|
|
14
|
+
const exerciseRepo = WorkoutExerciseRepository.getRepo();
|
|
15
|
+
return {
|
|
16
|
+
deleteOne: async (userId, meta) => {
|
|
17
|
+
await exerciseRepo.deleteAllForUser(userId, meta);
|
|
18
|
+
},
|
|
19
|
+
deleteList: async (userIds, meta) => {
|
|
20
|
+
await exerciseRepo.deleteAllForUsers(userIds, meta);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
setupSubscribers() {
|
|
25
|
+
this.subscribeToChanges(WorkoutExerciseCalibrationRepository.getListenersForExerciseRepo());
|
|
26
|
+
}
|
|
27
|
+
static getRepo() {
|
|
28
|
+
if (!WorkoutExerciseRepository.singletonInstance) {
|
|
29
|
+
WorkoutExerciseRepository.singletonInstance = new WorkoutExerciseRepository();
|
|
30
|
+
}
|
|
31
|
+
return WorkoutExerciseRepository.singletonInstance;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=WorkoutExerciseRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutExerciseRepository.js","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutExerciseRepository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,wBAAwB,MAAM,+CAA+C,CAAC;AACrF,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AACnF,OAAO,oCAAoC,MAAM,2CAA2C,CAAC;AAE7F;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,+BAAgD;IAC7F,MAAM,CAAC,iBAAiB,CAA6B;IAE7D;QACE,KAAK,CAAC,uBAAuB,EAAE,IAAI,wBAAwB,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,YAAY,GAAG,yBAAyB,CAAC,OAAO,EAAE,CAAC;QACzD,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;gBAChC,MAAM,YAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACpD,CAAC;YACD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;gBAClC,MAAM,YAAY,CAAC,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACtD,CAAC;SACF,CAAC;IACJ,CAAC;IAES,gBAAgB;QACxB,IAAI,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,2BAA2B,EAAE,CAAC,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAC,OAAO;QACnB,IAAI,CAAC,yBAAyB,CAAC,iBAAiB,EAAE,CAAC;YACjD,yBAAyB,CAAC,iBAAiB,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAChF,CAAC;QACD,OAAO,yBAAyB,CAAC,iBAAiB,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { User, WorkoutExercise } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import { WorkoutExercise_docType } from '@aneuhold/core-ts-db-lib';
|
|
3
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
4
|
+
import WorkoutExerciseValidator from '../../validators/workout/ExerciseValidator.js';
|
|
5
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
6
|
+
import WorkoutExerciseCalibrationRepository from './WorkoutExerciseCalibrationRepository.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The repository that contains {@link WorkoutExercise} documents.
|
|
10
|
+
*/
|
|
11
|
+
export default class WorkoutExerciseRepository extends WorkoutBaseWithUserIdRepository<WorkoutExercise> {
|
|
12
|
+
private static singletonInstance?: WorkoutExerciseRepository;
|
|
13
|
+
|
|
14
|
+
private constructor() {
|
|
15
|
+
super(WorkoutExercise_docType, new WorkoutExerciseValidator());
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getListenersForUserRepo(): RepoListeners<User> {
|
|
19
|
+
const exerciseRepo = WorkoutExerciseRepository.getRepo();
|
|
20
|
+
return {
|
|
21
|
+
deleteOne: async (userId, meta) => {
|
|
22
|
+
await exerciseRepo.deleteAllForUser(userId, meta);
|
|
23
|
+
},
|
|
24
|
+
deleteList: async (userIds, meta) => {
|
|
25
|
+
await exerciseRepo.deleteAllForUsers(userIds, meta);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
protected setupSubscribers(): void {
|
|
31
|
+
this.subscribeToChanges(WorkoutExerciseCalibrationRepository.getListenersForExerciseRepo());
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public static getRepo(): WorkoutExerciseRepository {
|
|
35
|
+
if (!WorkoutExerciseRepository.singletonInstance) {
|
|
36
|
+
WorkoutExerciseRepository.singletonInstance = new WorkoutExerciseRepository();
|
|
37
|
+
}
|
|
38
|
+
return WorkoutExerciseRepository.singletonInstance;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { User, WorkoutMesocycle } from '@aneuhold/core-ts-db-lib';
|
|
2
|
+
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
3
|
+
import WorkoutBaseWithUserIdRepository from './WorkoutBaseWithUserIdRepository.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repository that contains {@link WorkoutMesocycle} documents.
|
|
6
|
+
*/
|
|
7
|
+
export default class WorkoutMesocycleRepository extends WorkoutBaseWithUserIdRepository<WorkoutMesocycle> {
|
|
8
|
+
private static singletonInstance?;
|
|
9
|
+
private constructor();
|
|
10
|
+
static getListenersForUserRepo(): RepoListeners<User>;
|
|
11
|
+
protected setupSubscribers(): void;
|
|
12
|
+
static getRepo(): WorkoutMesocycleRepository;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=WorkoutMesocycleRepository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkoutMesocycleRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/workout/WorkoutMesocycleRepository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,+BAA+B,MAAM,sCAAsC,CAAC;AAGnF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,+BAA+B,CAAC,gBAAgB,CAAC;IACvG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAA6B;IAE9D,OAAO;IAIP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAYrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;WAIpB,OAAO,IAAI,0BAA0B;CAMpD"}
|