@eliasrrosa/tutorhub-public-assets 0.5.0 → 0.7.1
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/domain/entities/Course.d.ts +2 -2
- package/dist/domain/entities/DateTimeSlot.d.ts +2 -4
- package/dist/domain/entities/RescheduleRequest.d.ts +2 -2
- package/dist/domain/entities/UserAuth.d.ts +2 -2
- package/dist/domain/entities/UserTimeSlot.d.ts +45 -0
- package/dist/domain/entities/UserTimeSlot.js +28 -0
- package/dist/domain/entities/UserTimeSlot.test.d.ts +1 -0
- package/dist/domain/entities/UserTimeSlot.test.js +31 -0
- package/dist/domain/entities/UserUnavailableTime.d.ts +6 -11
- package/dist/domain/entities/UserUnavailableTime.js +5 -10
- package/dist/domain/entities/UserUnavailableTime.test.js +4 -17
- package/dist/domain/repositories/UnavailableTimeRepository.d.ts +3 -3
- package/dist/index.cjs +8 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -12
- package/dist/infrastructure/restful/responses/GetFixedAvailableTimesResponseBody.d.ts +2 -2
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { IPayment } from "./Payment";
|
|
|
7
7
|
import { IPreApprovedUser } from "./PreApprovedUser";
|
|
8
8
|
import { ISchool } from "./School";
|
|
9
9
|
import { IUserAuth } from "./UserAuth";
|
|
10
|
-
import {
|
|
10
|
+
import { IUserTimeSlot } from "./UserTimeSlot";
|
|
11
11
|
export interface ICourse {
|
|
12
12
|
id: string;
|
|
13
13
|
title: string;
|
|
@@ -24,7 +24,7 @@ export interface ICourse {
|
|
|
24
24
|
classes?: IClass[];
|
|
25
25
|
payments?: IPayment[];
|
|
26
26
|
files?: IFile[];
|
|
27
|
-
availableTimes?:
|
|
27
|
+
availableTimes?: IUserTimeSlot[];
|
|
28
28
|
classRequests?: IClassRequest[];
|
|
29
29
|
meetingLink: string | null;
|
|
30
30
|
contracts?: IContract[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IClass } from "./Class";
|
|
2
2
|
import { IUserAuth } from "./UserAuth";
|
|
3
|
-
import {
|
|
3
|
+
import { IUserTimeSlot } from "./UserTimeSlot";
|
|
4
4
|
export interface IRescheduleRequest {
|
|
5
5
|
id: string;
|
|
6
6
|
isRecurrent: boolean;
|
|
@@ -10,7 +10,7 @@ export interface IRescheduleRequest {
|
|
|
10
10
|
createdAt: Date | null;
|
|
11
11
|
requester?: IUserAuth;
|
|
12
12
|
targetClass?: IClass;
|
|
13
|
-
targetAvailableTime?:
|
|
13
|
+
targetAvailableTime?: IUserTimeSlot;
|
|
14
14
|
usersThatAccepted?: IUserAuth[];
|
|
15
15
|
usersThatDenied?: IUserAuth[];
|
|
16
16
|
}
|
|
@@ -21,7 +21,7 @@ import { IUserPremium } from "./UserPremium";
|
|
|
21
21
|
import { IUserProfile } from "./UserProfile";
|
|
22
22
|
import { IUserRoles } from "./UserRoles";
|
|
23
23
|
import { IUserSharedFileTimestamps } from "./UserSharedFileTimestamps";
|
|
24
|
-
import {
|
|
24
|
+
import { IUserTimeSlot } from "./UserTimeSlot";
|
|
25
25
|
export interface IUserAuth {
|
|
26
26
|
id: string;
|
|
27
27
|
email: string;
|
|
@@ -42,7 +42,7 @@ export interface IUserAuth {
|
|
|
42
42
|
receivedConnectionRequests?: IUserConnectionRequest[];
|
|
43
43
|
connections1?: IUserConnection[];
|
|
44
44
|
connections2?: IUserConnection[];
|
|
45
|
-
unavailableTime?:
|
|
45
|
+
unavailableTime?: IUserTimeSlot[];
|
|
46
46
|
classRequestsSent?: IClassRequest[];
|
|
47
47
|
classRequestsReceived?: IClassRequest[];
|
|
48
48
|
notificationsSent?: IGenericNotification[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IUserAuth } from "./UserAuth";
|
|
2
|
+
import { ICourse } from "./Course";
|
|
3
|
+
import { IRescheduleRequest } from "./RescheduleRequest";
|
|
4
|
+
import { IDateTimeSlot } from "./DateTimeSlot";
|
|
5
|
+
export interface IUserTimeSlot {
|
|
6
|
+
id: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
user?: IUserAuth;
|
|
9
|
+
groupId: string;
|
|
10
|
+
dayOfTheWeek: number;
|
|
11
|
+
startDateTime: Date;
|
|
12
|
+
endDateTime: Date;
|
|
13
|
+
isAvailableTime: boolean;
|
|
14
|
+
course?: ICourse;
|
|
15
|
+
courseId: string | null;
|
|
16
|
+
rescheduleRequests?: IRescheduleRequest[];
|
|
17
|
+
getDateTimeSlot: () => IDateTimeSlot;
|
|
18
|
+
}
|
|
19
|
+
export declare class UserTimeSlot implements IUserTimeSlot {
|
|
20
|
+
id: string;
|
|
21
|
+
userId: string;
|
|
22
|
+
user?: IUserAuth;
|
|
23
|
+
groupId: string;
|
|
24
|
+
startDateTime: Date;
|
|
25
|
+
endDateTime: Date;
|
|
26
|
+
isAvailableTime: boolean;
|
|
27
|
+
dayOfTheWeek: number;
|
|
28
|
+
course?: ICourse;
|
|
29
|
+
courseId: string | null;
|
|
30
|
+
rescheduleRequests?: IRescheduleRequest[];
|
|
31
|
+
constructor(opts: {
|
|
32
|
+
id: string;
|
|
33
|
+
userId: string;
|
|
34
|
+
user?: IUserAuth;
|
|
35
|
+
groupId: string;
|
|
36
|
+
startDateTime: Date;
|
|
37
|
+
endDateTime: Date;
|
|
38
|
+
isAvailableTime: boolean;
|
|
39
|
+
course?: ICourse;
|
|
40
|
+
courseId: string | null;
|
|
41
|
+
rescheduleRequests?: IRescheduleRequest[];
|
|
42
|
+
});
|
|
43
|
+
private getDayOfTheWeek;
|
|
44
|
+
getDateTimeSlot: () => IDateTimeSlot;
|
|
45
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserTimeSlot = void 0;
|
|
4
|
+
class UserTimeSlot {
|
|
5
|
+
constructor(opts) {
|
|
6
|
+
this.getDateTimeSlot = () => {
|
|
7
|
+
return {
|
|
8
|
+
endDateTime: this.endDateTime,
|
|
9
|
+
startDateTime: this.startDateTime,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
this.id = opts.id;
|
|
13
|
+
this.userId = opts.userId;
|
|
14
|
+
this.user = opts.user;
|
|
15
|
+
this.groupId = opts.groupId;
|
|
16
|
+
this.startDateTime = opts.startDateTime;
|
|
17
|
+
this.endDateTime = opts.endDateTime;
|
|
18
|
+
this.dayOfTheWeek = this.getDayOfTheWeek();
|
|
19
|
+
this.isAvailableTime = opts.isAvailableTime;
|
|
20
|
+
this.course = opts.course;
|
|
21
|
+
this.courseId = opts.courseId;
|
|
22
|
+
this.rescheduleRequests = opts.rescheduleRequests;
|
|
23
|
+
}
|
|
24
|
+
getDayOfTheWeek() {
|
|
25
|
+
return this.startDateTime.getUTCDay();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.UserTimeSlot = UserTimeSlot;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const UserTimeSlot_1 = require("./UserTimeSlot");
|
|
4
|
+
describe("UserUnavailableTime", () => {
|
|
5
|
+
const availableTimeData = {
|
|
6
|
+
courseId: "courseId",
|
|
7
|
+
startDateTime: new Date("2025-01-01T14:00:00Z"),
|
|
8
|
+
endDateTime: new Date("2025-01-01T15:00:00Z"),
|
|
9
|
+
groupId: "groupId",
|
|
10
|
+
id: "id",
|
|
11
|
+
isAvailableTime: true,
|
|
12
|
+
userId: "userId",
|
|
13
|
+
};
|
|
14
|
+
describe("UserUnavailableTime constructor()", () => {
|
|
15
|
+
it("Should be instantiable.", () => {
|
|
16
|
+
const availableTime = new UserTimeSlot_1.UserTimeSlot(availableTimeData);
|
|
17
|
+
expect(availableTime).toBeDefined();
|
|
18
|
+
});
|
|
19
|
+
it("Should contain the proper dayOfTheWeek.", () => {
|
|
20
|
+
const availableTime = new UserTimeSlot_1.UserTimeSlot(availableTimeData);
|
|
21
|
+
expect(availableTime.dayOfTheWeek).toBe(3);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe("UserUnavailableTime.getDateTimeSlot()", () => {
|
|
25
|
+
const availableTime = new UserTimeSlot_1.UserTimeSlot(Object.assign({}, availableTimeData));
|
|
26
|
+
it("Should return an object of type IDateTimeSlot", () => {
|
|
27
|
+
expect(availableTime.getDateTimeSlot().startDateTime).toBeInstanceOf(Date);
|
|
28
|
+
expect(availableTime.getDateTimeSlot().endDateTime).toBeInstanceOf(Date);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -2,17 +2,14 @@ import { IUserAuth } from "./UserAuth";
|
|
|
2
2
|
import { ICourse } from "./Course";
|
|
3
3
|
import { IRescheduleRequest } from "./RescheduleRequest";
|
|
4
4
|
import { IDateTimeSlot } from "./DateTimeSlot";
|
|
5
|
-
import { IDate } from "./Date";
|
|
6
|
-
import { ITime } from "./Time";
|
|
7
5
|
export interface IUserUnavailableTime {
|
|
8
6
|
id: string;
|
|
9
7
|
userId: string;
|
|
10
8
|
user?: IUserAuth;
|
|
11
9
|
groupId: string;
|
|
12
|
-
date: IDate;
|
|
13
10
|
dayOfTheWeek: number;
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
startDateTime: Date;
|
|
12
|
+
endDateTime: Date;
|
|
16
13
|
isAvailableTime: boolean;
|
|
17
14
|
course?: ICourse;
|
|
18
15
|
courseId: string | null;
|
|
@@ -24,9 +21,8 @@ export declare class UserUnavailableTime implements IUserUnavailableTime {
|
|
|
24
21
|
userId: string;
|
|
25
22
|
user?: IUserAuth;
|
|
26
23
|
groupId: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
endTime: ITime;
|
|
24
|
+
startDateTime: Date;
|
|
25
|
+
endDateTime: Date;
|
|
30
26
|
isAvailableTime: boolean;
|
|
31
27
|
dayOfTheWeek: number;
|
|
32
28
|
course?: ICourse;
|
|
@@ -37,9 +33,8 @@ export declare class UserUnavailableTime implements IUserUnavailableTime {
|
|
|
37
33
|
userId: string;
|
|
38
34
|
user?: IUserAuth;
|
|
39
35
|
groupId: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
endTime: ITime | string;
|
|
36
|
+
startDateTime: Date;
|
|
37
|
+
endDateTime: Date;
|
|
43
38
|
isAvailableTime: boolean;
|
|
44
39
|
course?: ICourse;
|
|
45
40
|
courseId: string | null;
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserUnavailableTime = void 0;
|
|
4
|
-
const ISO8601Time_1 = require("./ISO8601Time");
|
|
5
4
|
class UserUnavailableTime {
|
|
6
5
|
constructor(opts) {
|
|
7
6
|
this.getDateTimeSlot = () => {
|
|
8
7
|
return {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
endTime: this.endTime,
|
|
12
|
-
startTime: this.startTime,
|
|
13
|
-
},
|
|
8
|
+
endDateTime: this.endDateTime,
|
|
9
|
+
startDateTime: this.startDateTime,
|
|
14
10
|
};
|
|
15
11
|
};
|
|
16
12
|
this.id = opts.id;
|
|
17
13
|
this.userId = opts.userId;
|
|
18
14
|
this.user = opts.user;
|
|
19
15
|
this.groupId = opts.groupId;
|
|
20
|
-
this.
|
|
16
|
+
this.startDateTime = opts.startDateTime;
|
|
17
|
+
this.endDateTime = opts.endDateTime;
|
|
21
18
|
this.dayOfTheWeek = this.getDayOfTheWeek();
|
|
22
|
-
this.startTime = typeof opts.startTime == "string" ? new ISO8601Time_1.ISO8601Time(opts.startTime) : opts.startTime;
|
|
23
|
-
this.endTime = typeof opts.endTime == "string" ? new ISO8601Time_1.ISO8601Time(opts.endTime) : opts.endTime;
|
|
24
19
|
this.isAvailableTime = opts.isAvailableTime;
|
|
25
20
|
this.course = opts.course;
|
|
26
21
|
this.courseId = opts.courseId;
|
|
27
22
|
this.rescheduleRequests = opts.rescheduleRequests;
|
|
28
23
|
}
|
|
29
24
|
getDayOfTheWeek() {
|
|
30
|
-
return this.
|
|
25
|
+
return this.startDateTime.getUTCDay();
|
|
31
26
|
}
|
|
32
27
|
}
|
|
33
28
|
exports.UserUnavailableTime = UserUnavailableTime;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ISO8601Date_1 = require("./ISO8601Date");
|
|
4
|
-
const ISO8601Time_1 = require("./ISO8601Time");
|
|
5
3
|
const UserUnavailableTime_1 = require("./UserUnavailableTime");
|
|
6
4
|
describe("UserUnavailableTime", () => {
|
|
7
5
|
const availableTimeData = {
|
|
8
6
|
courseId: "courseId",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
startTime: "14:00",
|
|
7
|
+
startDateTime: new Date("2025-01-01T14:00:00Z"),
|
|
8
|
+
endDateTime: new Date("2025-01-01T15:00:00Z"),
|
|
12
9
|
groupId: "groupId",
|
|
13
10
|
id: "id",
|
|
14
11
|
isAvailableTime: true,
|
|
@@ -23,22 +20,12 @@ describe("UserUnavailableTime", () => {
|
|
|
23
20
|
const availableTime = new UserUnavailableTime_1.UserUnavailableTime(availableTimeData);
|
|
24
21
|
expect(availableTime.dayOfTheWeek).toBe(3);
|
|
25
22
|
});
|
|
26
|
-
it("Should instantiate ISO8601Time for startTime and endTime", () => {
|
|
27
|
-
const availableTime = new UserUnavailableTime_1.UserUnavailableTime(availableTimeData);
|
|
28
|
-
expect(availableTime.startTime).toBeInstanceOf(ISO8601Time_1.ISO8601Time);
|
|
29
|
-
expect(availableTime.endTime).toBeInstanceOf(ISO8601Time_1.ISO8601Time);
|
|
30
|
-
});
|
|
31
|
-
it("Should throw given invalid startTime or endTime format", () => {
|
|
32
|
-
const availableTime = () => new UserUnavailableTime_1.UserUnavailableTime(Object.assign(Object.assign({}, availableTimeData), { startTime: "25:00:00" }));
|
|
33
|
-
expect(availableTime).toThrow();
|
|
34
|
-
});
|
|
35
23
|
});
|
|
36
24
|
describe("UserUnavailableTime.getDateTimeSlot()", () => {
|
|
37
25
|
const availableTime = new UserUnavailableTime_1.UserUnavailableTime(Object.assign({}, availableTimeData));
|
|
38
26
|
it("Should return an object of type IDateTimeSlot", () => {
|
|
39
|
-
expect(availableTime.getDateTimeSlot().
|
|
40
|
-
expect(availableTime.getDateTimeSlot().
|
|
41
|
-
expect(availableTime.getDateTimeSlot().timeSlot.startTime).toBeInstanceOf(ISO8601Time_1.ISO8601Time);
|
|
27
|
+
expect(availableTime.getDateTimeSlot().startDateTime).toBeInstanceOf(Date);
|
|
28
|
+
expect(availableTime.getDateTimeSlot().endDateTime).toBeInstanceOf(Date);
|
|
42
29
|
});
|
|
43
30
|
});
|
|
44
31
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IUserTimeSlot } from "../entities/UserTimeSlot";
|
|
2
2
|
export interface IUnavailableTimeRepository {
|
|
3
3
|
findAvailableTimesByTime: (opts: {
|
|
4
4
|
startTime: string;
|
|
@@ -7,7 +7,7 @@ export interface IUnavailableTimeRepository {
|
|
|
7
7
|
dateGreaterThanOrEqualTo?: Date | string;
|
|
8
8
|
dateGreaterThan?: Date | string;
|
|
9
9
|
dateLessThanOrEqualTo?: Date | string;
|
|
10
|
-
}) => Promise<
|
|
10
|
+
}) => Promise<IUserTimeSlot[]>;
|
|
11
11
|
/**Does not throw. Returns empty array if query fails. */
|
|
12
12
|
findAvailableTimesByDate: (opts: {
|
|
13
13
|
dateGreaterThanOrEqualTo?: string | Date;
|
|
@@ -16,5 +16,5 @@ export interface IUnavailableTimeRepository {
|
|
|
16
16
|
startTime?: string;
|
|
17
17
|
endTime?: string;
|
|
18
18
|
userId?: string;
|
|
19
|
-
}) => Promise<
|
|
19
|
+
}) => Promise<IUserTimeSlot[]>;
|
|
20
20
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -50,7 +50,7 @@ __export(index_exports, {
|
|
|
50
50
|
ISO8601DateValidator: () => ISO8601DateValidator,
|
|
51
51
|
ISO8601Time: () => ISO8601Time,
|
|
52
52
|
ISO8601TimeValidator: () => ISO8601TimeValidator,
|
|
53
|
-
UserUnavailableTime: () =>
|
|
53
|
+
UserUnavailableTime: () => UserTimeSlot,
|
|
54
54
|
filterAsync: () => filterAsync,
|
|
55
55
|
tryCatch: () => tryCatch,
|
|
56
56
|
tryCatchAsync: () => tryCatchAsync
|
|
@@ -561,33 +561,29 @@ var ClassCreationFormSchema = import_zod2.z.object({
|
|
|
561
561
|
var import_zod3 = require("zod");
|
|
562
562
|
var ClassCreationRecurrenceRuleSchema = import_zod3.z.literal("daily").or(import_zod3.z.literal("weekly")).or(import_zod3.z.literal("week days"));
|
|
563
563
|
|
|
564
|
-
// src/domain/entities/
|
|
565
|
-
var
|
|
564
|
+
// src/domain/entities/UserTimeSlot.ts
|
|
565
|
+
var UserTimeSlot = class {
|
|
566
566
|
constructor(opts) {
|
|
567
567
|
this.getDateTimeSlot = () => {
|
|
568
568
|
return {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
endTime: this.endTime,
|
|
572
|
-
startTime: this.startTime
|
|
573
|
-
}
|
|
569
|
+
endDateTime: this.endDateTime,
|
|
570
|
+
startDateTime: this.startDateTime
|
|
574
571
|
};
|
|
575
572
|
};
|
|
576
573
|
this.id = opts.id;
|
|
577
574
|
this.userId = opts.userId;
|
|
578
575
|
this.user = opts.user;
|
|
579
576
|
this.groupId = opts.groupId;
|
|
580
|
-
this.
|
|
577
|
+
this.startDateTime = opts.startDateTime;
|
|
578
|
+
this.endDateTime = opts.endDateTime;
|
|
581
579
|
this.dayOfTheWeek = this.getDayOfTheWeek();
|
|
582
|
-
this.startTime = typeof opts.startTime == "string" ? new ISO8601Time(opts.startTime) : opts.startTime;
|
|
583
|
-
this.endTime = typeof opts.endTime == "string" ? new ISO8601Time(opts.endTime) : opts.endTime;
|
|
584
580
|
this.isAvailableTime = opts.isAvailableTime;
|
|
585
581
|
this.course = opts.course;
|
|
586
582
|
this.courseId = opts.courseId;
|
|
587
583
|
this.rescheduleRequests = opts.rescheduleRequests;
|
|
588
584
|
}
|
|
589
585
|
getDayOfTheWeek() {
|
|
590
|
-
return this.
|
|
586
|
+
return this.startDateTime.getUTCDay();
|
|
591
587
|
}
|
|
592
588
|
};
|
|
593
589
|
|
package/dist/index.d.ts
CHANGED
|
@@ -47,8 +47,8 @@ import { ClassCreationForm, ClassCreationFormSchema } from "./infrastructure/res
|
|
|
47
47
|
import { ClassStatus, ClassStatusSchema } from "./domain/types/ClassStatus.js";
|
|
48
48
|
import { ClassCreationRecurrenceRule, ClassCreationRecurrenceRuleSchema } from "./domain/types/ClassCreationRecurrenceRule.js";
|
|
49
49
|
import { IClassStatus } from "./domain/entities/ClassStatus.js";
|
|
50
|
-
import {
|
|
50
|
+
import { IUserTimeSlot, UserTimeSlot } from "./domain/entities/UserTimeSlot.js";
|
|
51
51
|
import { IFreeDateTimeSlot, FreeDateTimeSlot } from "./domain/entities/FreeTimeSlot.js";
|
|
52
52
|
import { tryCatch, tryCatchAsync } from "./application/helpers/helpers/tryCatch.js";
|
|
53
53
|
import { filterAsync } from "./application/helpers/helpers/filterAsync.js";
|
|
54
|
-
export { filterAsync, tryCatchAsync, tryCatch, ClassStatus, AsaasCustomer, IClass, IClassRequest, IContract, ICourse, ICourseToSchoolConnectionRequest, IDate, IDateTimeSlot, IFreeDateTimeSlot, FreeDateTimeSlot, IUserUnavailableTime, UserUnavailableTime, IDateValidator, IFile, IGenericNotification, IGoogleAuth, IGoogleCalendar, IGoogleCalendarEvent, ISO8601Date, IDateTime, ISO8601DateValidator, ISO8601Time, ISO8601TimeValidator, IPasswordRecovery, IPayment, IPaymentRecognitionRequest, IPreApprovedUser, IRescheduleRequest, ISchool, ISchoolConnection, ISchoolConnectionRequest, ISchoolStudent, ISchoolTeacher, ITime, ITimeSlot, ITimeValidator, IUnauthorizedUser, IUserAuth, IUserConnection, IUserConnectionRequest, IUserCredentials, IUserNavigation, IUserPreferences, IUserPremium, IUserProfile, IUserRoles, IUserSharedFileTimestamps, IUnavailableTimeRepository, GetFixedAvailableTimeResponseBody, ISO8601DateTime, ClassCreationForm, ClassCreationRecurrenceRule, ClassCreationFormSchema, ClassCreationRecurrenceRuleSchema, ClassStatusSchema, IClassStatus };
|
|
54
|
+
export { filterAsync, tryCatchAsync, tryCatch, ClassStatus, AsaasCustomer, IClass, IClassRequest, IContract, ICourse, ICourseToSchoolConnectionRequest, IDate, IDateTimeSlot, IFreeDateTimeSlot, FreeDateTimeSlot, IUserTimeSlot as IUserUnavailableTime, UserTimeSlot as UserUnavailableTime, IDateValidator, IFile, IGenericNotification, IGoogleAuth, IGoogleCalendar, IGoogleCalendarEvent, ISO8601Date, IDateTime, ISO8601DateValidator, ISO8601Time, ISO8601TimeValidator, IPasswordRecovery, IPayment, IPaymentRecognitionRequest, IPreApprovedUser, IRescheduleRequest, ISchool, ISchoolConnection, ISchoolConnectionRequest, ISchoolStudent, ISchoolTeacher, ITime, ITimeSlot, ITimeValidator, IUnauthorizedUser, IUserAuth, IUserConnection, IUserConnectionRequest, IUserCredentials, IUserNavigation, IUserPreferences, IUserPremium, IUserProfile, IUserRoles, IUserSharedFileTimestamps, IUnavailableTimeRepository, GetFixedAvailableTimeResponseBody, ISO8601DateTime, ClassCreationForm, ClassCreationRecurrenceRule, ClassCreationFormSchema, ClassCreationRecurrenceRuleSchema, ClassStatusSchema, IClassStatus };
|
package/dist/index.js
CHANGED
|
@@ -523,33 +523,29 @@ var ClassCreationFormSchema = z2.object({
|
|
|
523
523
|
import { z as z3 } from "zod";
|
|
524
524
|
var ClassCreationRecurrenceRuleSchema = z3.literal("daily").or(z3.literal("weekly")).or(z3.literal("week days"));
|
|
525
525
|
|
|
526
|
-
// src/domain/entities/
|
|
527
|
-
var
|
|
526
|
+
// src/domain/entities/UserTimeSlot.ts
|
|
527
|
+
var UserTimeSlot = class {
|
|
528
528
|
constructor(opts) {
|
|
529
529
|
this.getDateTimeSlot = () => {
|
|
530
530
|
return {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
endTime: this.endTime,
|
|
534
|
-
startTime: this.startTime
|
|
535
|
-
}
|
|
531
|
+
endDateTime: this.endDateTime,
|
|
532
|
+
startDateTime: this.startDateTime
|
|
536
533
|
};
|
|
537
534
|
};
|
|
538
535
|
this.id = opts.id;
|
|
539
536
|
this.userId = opts.userId;
|
|
540
537
|
this.user = opts.user;
|
|
541
538
|
this.groupId = opts.groupId;
|
|
542
|
-
this.
|
|
539
|
+
this.startDateTime = opts.startDateTime;
|
|
540
|
+
this.endDateTime = opts.endDateTime;
|
|
543
541
|
this.dayOfTheWeek = this.getDayOfTheWeek();
|
|
544
|
-
this.startTime = typeof opts.startTime == "string" ? new ISO8601Time(opts.startTime) : opts.startTime;
|
|
545
|
-
this.endTime = typeof opts.endTime == "string" ? new ISO8601Time(opts.endTime) : opts.endTime;
|
|
546
542
|
this.isAvailableTime = opts.isAvailableTime;
|
|
547
543
|
this.course = opts.course;
|
|
548
544
|
this.courseId = opts.courseId;
|
|
549
545
|
this.rescheduleRequests = opts.rescheduleRequests;
|
|
550
546
|
}
|
|
551
547
|
getDayOfTheWeek() {
|
|
552
|
-
return this.
|
|
548
|
+
return this.startDateTime.getUTCDay();
|
|
553
549
|
}
|
|
554
550
|
};
|
|
555
551
|
|
|
@@ -598,7 +594,7 @@ export {
|
|
|
598
594
|
ISO8601DateValidator,
|
|
599
595
|
ISO8601Time,
|
|
600
596
|
ISO8601TimeValidator,
|
|
601
|
-
UserUnavailableTime,
|
|
597
|
+
UserTimeSlot as UserUnavailableTime,
|
|
602
598
|
filterAsync,
|
|
603
599
|
tryCatch,
|
|
604
600
|
tryCatchAsync
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IUserTimeSlot } from "../../../domain/entities/UserTimeSlot";
|
|
2
2
|
export type GetFixedAvailableTimeResponseBody = {
|
|
3
|
-
fixedAvailableTimes:
|
|
3
|
+
fixedAvailableTimes: IUserTimeSlot[];
|
|
4
4
|
shareableText?: string;
|
|
5
5
|
};
|