@eliasrrosa/tutorhub-public-assets 0.0.22 → 0.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/dist/application/helpers/helpers/filterAsync.d.ts +1 -0
- package/dist/application/helpers/helpers/filterAsync.js +18 -0
- package/dist/application/helpers/helpers/filterAsync.test.d.ts +1 -0
- package/dist/application/helpers/helpers/filterAsync.test.js +21 -0
- package/dist/application/helpers/helpers/tryCatch.d.ts +2 -0
- package/dist/application/helpers/helpers/tryCatch.js +31 -0
- package/dist/application/helpers/helpers/tryCatch.test.d.ts +1 -0
- package/dist/application/helpers/helpers/tryCatch.test.js +48 -0
- package/dist/domain/entities/Class.d.ts +10 -70
- package/dist/domain/entities/Class.js +0 -28
- package/dist/domain/entities/Class.test.d.ts +1 -0
- package/dist/domain/entities/Class.test.js +64 -0
- package/dist/domain/entities/ClassStatus.d.ts +4 -0
- package/dist/domain/entities/ClassStatus.js +2 -0
- package/dist/domain/entities/DateValidator.d.ts +1 -0
- package/dist/domain/entities/ISO8601Date.js +6 -1
- package/dist/domain/entities/ISO8601Date.test.js +8 -1
- package/dist/domain/entities/ISO8601DateTime.d.ts +2 -4
- package/dist/domain/entities/ISO8601DateValidator.d.ts +1 -0
- package/dist/domain/entities/ISO8601DateValidator.js +8 -1
- package/dist/domain/entities/ISO8601DateValidator.test.js +5 -1
- package/dist/domain/entities/User.d.ts +2 -0
- package/dist/domain/entities/User.js +2 -0
- package/dist/domain/types/Class.d.ts +2 -0
- package/dist/domain/types/Class.js +5 -0
- package/dist/index.cjs +67 -37
- package/dist/index.d.ts +5 -2
- package/dist/index.js +64 -35
- package/dist/infrastructure/restful/requests/forms/ClassCreationForm.d.ts +6 -9
- package/dist/infrastructure/restful/requests/forms/ClassCreationForm.js +2 -3
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function filterAsync<T>(arr: T[], predicate: (item: T) => Promise<boolean>): Promise<T[]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.filterAsync = filterAsync;
|
|
13
|
+
function filterAsync(arr, predicate) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const results = yield Promise.all(arr.map(predicate));
|
|
16
|
+
return arr.filter((_v, index) => results[index]);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const filterAsync_1 = require("./filterAsync");
|
|
13
|
+
describe("filterAsync", () => {
|
|
14
|
+
it("Should filter accepting async operations.", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const numbers = [1, 2, 3];
|
|
16
|
+
const filteredNumbers = yield (0, filterAsync_1.filterAsync)(numbers, (number) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
return number > 1;
|
|
18
|
+
}));
|
|
19
|
+
expect(filteredNumbers).toEqual([2, 3]);
|
|
20
|
+
}));
|
|
21
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.tryCatch = tryCatch;
|
|
13
|
+
exports.tryCatchAsync = tryCatchAsync;
|
|
14
|
+
function tryCatch(callback, fallback) {
|
|
15
|
+
try {
|
|
16
|
+
return callback();
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return fallback(error);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function tryCatchAsync(callback, fallback) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
try {
|
|
25
|
+
return yield callback();
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return yield fallback(error);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const tryCatch_1 = require("./tryCatch");
|
|
13
|
+
describe("tryCatch", () => {
|
|
14
|
+
it("Should return try return value if success.", () => {
|
|
15
|
+
const a = (0, tryCatch_1.tryCatch)(() => {
|
|
16
|
+
return "abc";
|
|
17
|
+
}, () => {
|
|
18
|
+
return new Error("Trycatch failed.");
|
|
19
|
+
});
|
|
20
|
+
expect(a).toEqual("abc");
|
|
21
|
+
});
|
|
22
|
+
it("Should return catch return value if error.", () => {
|
|
23
|
+
const a = (0, tryCatch_1.tryCatch)(() => {
|
|
24
|
+
throw new Error("Error!");
|
|
25
|
+
}, () => {
|
|
26
|
+
return new Error("Trycatch failed.");
|
|
27
|
+
});
|
|
28
|
+
expect(a).toBeInstanceOf(Error);
|
|
29
|
+
expect(a.message).toEqual("Trycatch failed.");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe("tryCatchAsync", () => {
|
|
33
|
+
it("Should return try return value if success.", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
const a = yield (0, tryCatch_1.tryCatchAsync)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
+
return "abc";
|
|
36
|
+
}), () => __awaiter(void 0, void 0, void 0, function* () { return new Error(); }));
|
|
37
|
+
expect(a).toEqual("abc");
|
|
38
|
+
}));
|
|
39
|
+
it("Should return catch return value if error.", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const a = yield (0, tryCatch_1.tryCatchAsync)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
throw new Error("Error!");
|
|
42
|
+
}), () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
return new Error("Trycatch failed.");
|
|
44
|
+
}));
|
|
45
|
+
expect(a).toBeInstanceOf(Error);
|
|
46
|
+
expect(a.message).toEqual("Trycatch failed.");
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
@@ -1,80 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICourse } from "./Course";
|
|
1
|
+
import { IClassStatus } from "./ClassStatus";
|
|
3
2
|
import { IDate } from "./Date";
|
|
4
|
-
import { IFile } from "./File";
|
|
5
|
-
import { IGoogleCalendarEvent } from "./GoogleCalendarEvent";
|
|
6
|
-
import { IPayment } from "./Payment";
|
|
7
|
-
import { IRescheduleRequest } from "./RescheduleRequest";
|
|
8
3
|
import { ITime } from "./Time";
|
|
9
4
|
export interface IClass {
|
|
10
5
|
id: string;
|
|
11
|
-
groupId: string | null;
|
|
12
6
|
title: string;
|
|
13
|
-
description: string | null;
|
|
14
|
-
createdAt: Date | null;
|
|
15
|
-
updatedAt: Date | null;
|
|
16
7
|
date: IDate;
|
|
17
|
-
|
|
8
|
+
startTime: ITime;
|
|
18
9
|
endTime: ITime;
|
|
19
|
-
endDate: IDate | null;
|
|
20
10
|
courseId: string;
|
|
21
|
-
paymentId: string | null;
|
|
22
|
-
status: string | null;
|
|
23
|
-
course?: ICourse;
|
|
24
|
-
payment?: IPayment;
|
|
25
|
-
files?: IFile[];
|
|
26
|
-
rescheduleRequests?: IRescheduleRequest[];
|
|
27
|
-
googleCalendarEvents?: IGoogleCalendarEvent[];
|
|
28
|
-
meetingLink: string | null;
|
|
29
|
-
contractId: string | null;
|
|
30
|
-
contract?: IContract;
|
|
31
11
|
ownerId: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
date: IDate;
|
|
41
|
-
time: ITime;
|
|
42
|
-
endTime: ITime;
|
|
43
|
-
endDate: IDate | null;
|
|
44
|
-
courseId: string;
|
|
45
|
-
paymentId: string | null;
|
|
46
|
-
status: string | null;
|
|
47
|
-
course?: ICourse;
|
|
48
|
-
payment?: IPayment;
|
|
49
|
-
files?: IFile[];
|
|
50
|
-
rescheduleRequests?: IRescheduleRequest[];
|
|
51
|
-
googleCalendarEvents?: IGoogleCalendarEvent[];
|
|
52
|
-
meetingLink: string | null;
|
|
53
|
-
contractId: string | null;
|
|
54
|
-
contract?: IContract;
|
|
55
|
-
ownerId: string;
|
|
56
|
-
constructor(params: {
|
|
57
|
-
id: string;
|
|
58
|
-
groupId?: string | null;
|
|
59
|
-
title: string;
|
|
60
|
-
description?: string | null;
|
|
61
|
-
createdAt?: Date | null;
|
|
62
|
-
updatedAt?: Date | null;
|
|
63
|
-
date: IDate;
|
|
64
|
-
time: ITime;
|
|
65
|
-
endTime: ITime;
|
|
66
|
-
endDate?: IDate | null;
|
|
67
|
-
courseId: string;
|
|
68
|
-
paymentId?: string | null;
|
|
69
|
-
status?: string | null;
|
|
70
|
-
course?: ICourse;
|
|
71
|
-
payment?: IPayment;
|
|
72
|
-
files?: IFile[];
|
|
73
|
-
rescheduleRequests?: IRescheduleRequest[];
|
|
74
|
-
googleCalendarEvents?: IGoogleCalendarEvent[];
|
|
75
|
-
meetingLink?: string | null;
|
|
76
|
-
contractId?: string | null;
|
|
77
|
-
contract?: IContract;
|
|
78
|
-
ownerId: string;
|
|
79
|
-
});
|
|
12
|
+
status: IClassStatus;
|
|
13
|
+
groupId?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
paymentId?: string;
|
|
18
|
+
meetingLink?: string;
|
|
19
|
+
contractId?: string;
|
|
80
20
|
}
|
|
@@ -1,30 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Class = void 0;
|
|
4
|
-
class Class {
|
|
5
|
-
constructor(params) {
|
|
6
|
-
this.id = params.id;
|
|
7
|
-
this.groupId = params.groupId ? params.groupId : null;
|
|
8
|
-
this.title = params.title;
|
|
9
|
-
this.description = params.description ? params.description : null;
|
|
10
|
-
this.createdAt = params.createdAt ? params.createdAt : null;
|
|
11
|
-
this.updatedAt = params.updatedAt ? params.updatedAt : null;
|
|
12
|
-
this.date = params.date;
|
|
13
|
-
this.time = params.time;
|
|
14
|
-
this.endTime = params.endTime;
|
|
15
|
-
this.endDate = params.endDate ? params.endDate : null;
|
|
16
|
-
this.courseId = params.courseId;
|
|
17
|
-
this.paymentId = params.paymentId ? params.paymentId : null;
|
|
18
|
-
this.status = params.status ? params.status : null;
|
|
19
|
-
this.course = params.course;
|
|
20
|
-
this.payment = params.payment;
|
|
21
|
-
this.files = params.files;
|
|
22
|
-
this.rescheduleRequests = params.rescheduleRequests;
|
|
23
|
-
this.googleCalendarEvents = params.googleCalendarEvents;
|
|
24
|
-
this.meetingLink = params.meetingLink ? params.meetingLink : null;
|
|
25
|
-
this.contractId = params.contractId ? params.contractId : null;
|
|
26
|
-
this.contract = params.contract;
|
|
27
|
-
this.ownerId = params.ownerId;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.Class = Class;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Class_1 = require("./Class");
|
|
4
|
+
describe("Class", () => {
|
|
5
|
+
describe("Class constructor", () => {
|
|
6
|
+
const classData = {
|
|
7
|
+
id: "id",
|
|
8
|
+
title: "title",
|
|
9
|
+
date: "2025-01-01",
|
|
10
|
+
startTime: "12:00:00+03:00",
|
|
11
|
+
endTime: "13:00:00+03:00",
|
|
12
|
+
courseId: "courseId",
|
|
13
|
+
ownerId: "ownerId",
|
|
14
|
+
status: "pending",
|
|
15
|
+
updatedAt: "2025-01-01T00:00:00Z",
|
|
16
|
+
createdAt: "2025-01-01T00:00:00Z",
|
|
17
|
+
groupId: "groupId",
|
|
18
|
+
description: "description",
|
|
19
|
+
paymentId: "paymentId",
|
|
20
|
+
meetingLink: "meetingLink",
|
|
21
|
+
contractId: "contractId",
|
|
22
|
+
};
|
|
23
|
+
it("Should not throw given correct arguments", () => {
|
|
24
|
+
const aClass = () => new Class_1.Class(classData);
|
|
25
|
+
expect(aClass).not.toThrow();
|
|
26
|
+
});
|
|
27
|
+
it("Should throw given incorrect startTime format", () => {
|
|
28
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { startTime: "12" }));
|
|
29
|
+
expect(aClass).toThrow();
|
|
30
|
+
});
|
|
31
|
+
it("Should throw given incorrect endTime format", () => {
|
|
32
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { endTime: "24:00:00" }));
|
|
33
|
+
expect(aClass).toThrow();
|
|
34
|
+
});
|
|
35
|
+
it("Should throw given startTime greater than endTime", () => {
|
|
36
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { startTime: "12:00:00", endTime: "11:59:00" }));
|
|
37
|
+
expect(aClass).toThrow();
|
|
38
|
+
});
|
|
39
|
+
it("Should throw given startTime equal to endTime", () => {
|
|
40
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { startTime: "12:00:00", endTime: "12:00:00" }));
|
|
41
|
+
expect(aClass).toThrow();
|
|
42
|
+
});
|
|
43
|
+
it("Should throw given invalid status", () => {
|
|
44
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { status: "invalid status" }));
|
|
45
|
+
expect(aClass).toThrow();
|
|
46
|
+
});
|
|
47
|
+
it("Should throw given empty title", () => {
|
|
48
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { title: "" }));
|
|
49
|
+
expect(aClass).toThrow();
|
|
50
|
+
});
|
|
51
|
+
it("Should throw given incorrect date format", () => {
|
|
52
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { date: "2025-13-01" }));
|
|
53
|
+
expect(aClass).toThrow();
|
|
54
|
+
});
|
|
55
|
+
it("Should not throw given date with time and timezone", () => {
|
|
56
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { date: "2025-02-01T00:00:00Z" }));
|
|
57
|
+
expect(aClass).not.toThrow();
|
|
58
|
+
});
|
|
59
|
+
it("Should throw given createdAt greater than updatedAt", () => {
|
|
60
|
+
const aClass = () => new Class_1.Class(Object.assign(Object.assign({}, classData), { createdAt: "2025-01-02", updatedAt: "2025-01-01" }));
|
|
61
|
+
expect(aClass).toThrow();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -49,7 +49,12 @@ class ISO8601Date {
|
|
|
49
49
|
const targetDate = date || this;
|
|
50
50
|
return targetDate.toUtcJsDateTime().getUTCDay();
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
const normalizedValue = value
|
|
53
|
+
? this.validator.match(value)
|
|
54
|
+
: this.getToday();
|
|
55
|
+
if (!normalizedValue)
|
|
56
|
+
throw new Error("Date format is invalid.");
|
|
57
|
+
this.value = normalizedValue;
|
|
53
58
|
this.throwIfFormatIsNotValid();
|
|
54
59
|
}
|
|
55
60
|
throwIfFormatIsNotValid() {
|
|
@@ -15,10 +15,17 @@ describe("ISO8601Date", () => {
|
|
|
15
15
|
});
|
|
16
16
|
it("Should throw if value is not valid", () => {
|
|
17
17
|
const instantiateDate = () => {
|
|
18
|
-
new ISO8601Date_1.ISO8601Date("2025-01-
|
|
18
|
+
new ISO8601Date_1.ISO8601Date("2025-01-m");
|
|
19
19
|
};
|
|
20
20
|
expect(instantiateDate).toThrow();
|
|
21
21
|
});
|
|
22
|
+
it("Should throw if value contains timezone or other strings", () => {
|
|
23
|
+
const instantiateDate = () => {
|
|
24
|
+
return new ISO8601Date_1.ISO8601Date("2025-01-01T00:00:00Z");
|
|
25
|
+
};
|
|
26
|
+
expect(instantiateDate).not.toThrow();
|
|
27
|
+
expect(instantiateDate().value).toEqual("2025-01-01");
|
|
28
|
+
});
|
|
22
29
|
it("Should construct with no arguments.", () => {
|
|
23
30
|
const date = new ISO8601Date_1.ISO8601Date();
|
|
24
31
|
expect(date).toBeDefined();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { IDate } from "./Date";
|
|
2
2
|
import { ITime } from "./Time";
|
|
3
3
|
export interface IDateTime {
|
|
4
|
-
date: IDate;
|
|
5
|
-
time: ITime;
|
|
6
4
|
getJSDateTime: () => Date;
|
|
7
5
|
/**
|
|
8
6
|
* Returns DateTime string with added Brazilian timezone (-03:00) without converting the date or time.
|
|
@@ -25,8 +23,8 @@ export interface IDateTime {
|
|
|
25
23
|
}) => string;
|
|
26
24
|
}
|
|
27
25
|
export declare class ISO8601DateTime implements IDateTime {
|
|
28
|
-
date
|
|
29
|
-
time
|
|
26
|
+
private date;
|
|
27
|
+
private time;
|
|
30
28
|
constructor(opts: {
|
|
31
29
|
date: IDate;
|
|
32
30
|
time: ITime;
|
|
@@ -8,7 +8,7 @@ exports.ISO8601DateValidator = void 0;
|
|
|
8
8
|
*/
|
|
9
9
|
class ISO8601DateValidator {
|
|
10
10
|
constructor() {
|
|
11
|
-
this.YYYYmmDD = new RegExp("^[0-9]{4}-([0][1-9]|[1][0-2])-([0][1-9]|[1-2][0-9]|[3][0-1])
|
|
11
|
+
this.YYYYmmDD = new RegExp("^[0-9]{4}-([0][1-9]|[1][0-2])-([0][1-9]|[1-2][0-9]|[3][0-1])");
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Accepted format: YYYY-MM-DD
|
|
@@ -16,5 +16,12 @@ class ISO8601DateValidator {
|
|
|
16
16
|
formatIsValid(date) {
|
|
17
17
|
return this.YYYYmmDD.test(date);
|
|
18
18
|
}
|
|
19
|
+
match(date) {
|
|
20
|
+
const matches = date.match(this.YYYYmmDD);
|
|
21
|
+
if (!matches || matches.length < 1) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return matches[0];
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
exports.ISO8601DateValidator = ISO8601DateValidator;
|
|
@@ -7,9 +7,13 @@ describe("ISO8601DateValidator", () => {
|
|
|
7
7
|
const date = new ISO8601DateValidator_1.ISO8601DateValidator();
|
|
8
8
|
expect(date.formatIsValid("2025-01-01")).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
it("Should return true if format is YYYY-MM-DD but has more characters.", () => {
|
|
11
|
+
const date = new ISO8601DateValidator_1.ISO8601DateValidator();
|
|
12
|
+
expect(date.formatIsValid("2025-01-01T00:00:00Z")).toBe(true);
|
|
13
|
+
});
|
|
10
14
|
it("Should return false if format is not YYYY-MM-DD.", () => {
|
|
11
15
|
const date = new ISO8601DateValidator_1.ISO8601DateValidator();
|
|
12
|
-
expect(date.formatIsValid("2025-01-
|
|
16
|
+
expect(date.formatIsValid("2025-01-m")).toBe(false);
|
|
13
17
|
});
|
|
14
18
|
});
|
|
15
19
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -16,12 +16,31 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var __async = (__this, __arguments, generator) => {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
var fulfilled = (value) => {
|
|
22
|
+
try {
|
|
23
|
+
step(generator.next(value));
|
|
24
|
+
} catch (e) {
|
|
25
|
+
reject(e);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var rejected = (value) => {
|
|
29
|
+
try {
|
|
30
|
+
step(generator.throw(value));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
reject(e);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
36
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
19
39
|
|
|
20
40
|
// src/index.ts
|
|
21
41
|
var index_exports = {};
|
|
22
42
|
__export(index_exports, {
|
|
23
43
|
AsaasCustomer: () => AsaasCustomer,
|
|
24
|
-
Class: () => Class,
|
|
25
44
|
ClassCreationFormSchema: () => ClassCreationFormSchema,
|
|
26
45
|
ClassCreationRecurrenceRuleSchema: () => ClassCreationRecurrenceRuleSchema,
|
|
27
46
|
ClassStatusSchema: () => ClassStatusSchema,
|
|
@@ -31,7 +50,10 @@ __export(index_exports, {
|
|
|
31
50
|
ISO8601DateValidator: () => ISO8601DateValidator,
|
|
32
51
|
ISO8601Time: () => ISO8601Time,
|
|
33
52
|
ISO8601TimeValidator: () => ISO8601TimeValidator,
|
|
34
|
-
UserUnavailableTime: () => UserUnavailableTime
|
|
53
|
+
UserUnavailableTime: () => UserUnavailableTime,
|
|
54
|
+
filterAsync: () => filterAsync,
|
|
55
|
+
tryCatch: () => tryCatch,
|
|
56
|
+
tryCatchAsync: () => tryCatchAsync
|
|
35
57
|
});
|
|
36
58
|
module.exports = __toCommonJS(index_exports);
|
|
37
59
|
|
|
@@ -46,39 +68,11 @@ var AsaasCustomer = class {
|
|
|
46
68
|
}
|
|
47
69
|
};
|
|
48
70
|
|
|
49
|
-
// src/domain/entities/Class.ts
|
|
50
|
-
var Class = class {
|
|
51
|
-
constructor(params) {
|
|
52
|
-
this.id = params.id;
|
|
53
|
-
this.groupId = params.groupId ? params.groupId : null;
|
|
54
|
-
this.title = params.title;
|
|
55
|
-
this.description = params.description ? params.description : null;
|
|
56
|
-
this.createdAt = params.createdAt ? params.createdAt : null;
|
|
57
|
-
this.updatedAt = params.updatedAt ? params.updatedAt : null;
|
|
58
|
-
this.date = params.date;
|
|
59
|
-
this.time = params.time;
|
|
60
|
-
this.endTime = params.endTime;
|
|
61
|
-
this.endDate = params.endDate ? params.endDate : null;
|
|
62
|
-
this.courseId = params.courseId;
|
|
63
|
-
this.paymentId = params.paymentId ? params.paymentId : null;
|
|
64
|
-
this.status = params.status ? params.status : null;
|
|
65
|
-
this.course = params.course;
|
|
66
|
-
this.payment = params.payment;
|
|
67
|
-
this.files = params.files;
|
|
68
|
-
this.rescheduleRequests = params.rescheduleRequests;
|
|
69
|
-
this.googleCalendarEvents = params.googleCalendarEvents;
|
|
70
|
-
this.meetingLink = params.meetingLink ? params.meetingLink : null;
|
|
71
|
-
this.contractId = params.contractId ? params.contractId : null;
|
|
72
|
-
this.contract = params.contract;
|
|
73
|
-
this.ownerId = params.ownerId;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
71
|
// src/domain/entities/ISO8601DateValidator.ts
|
|
78
72
|
var ISO8601DateValidator = class {
|
|
79
73
|
constructor() {
|
|
80
74
|
this.YYYYmmDD = new RegExp(
|
|
81
|
-
"^[0-9]{4}-([0][1-9]|[1][0-2])-([0][1-9]|[1-2][0-9]|[3][0-1])
|
|
75
|
+
"^[0-9]{4}-([0][1-9]|[1][0-2])-([0][1-9]|[1-2][0-9]|[3][0-1])"
|
|
82
76
|
);
|
|
83
77
|
}
|
|
84
78
|
/**
|
|
@@ -87,6 +81,13 @@ var ISO8601DateValidator = class {
|
|
|
87
81
|
formatIsValid(date) {
|
|
88
82
|
return this.YYYYmmDD.test(date);
|
|
89
83
|
}
|
|
84
|
+
match(date) {
|
|
85
|
+
const matches = date.match(this.YYYYmmDD);
|
|
86
|
+
if (!matches || matches.length < 1) {
|
|
87
|
+
return void 0;
|
|
88
|
+
}
|
|
89
|
+
return matches[0];
|
|
90
|
+
}
|
|
90
91
|
};
|
|
91
92
|
|
|
92
93
|
// src/domain/entities/ISO8601Date.ts
|
|
@@ -147,7 +148,9 @@ var _ISO8601Date = class _ISO8601Date {
|
|
|
147
148
|
const targetDate = date || this;
|
|
148
149
|
return targetDate.toUtcJsDateTime().getUTCDay();
|
|
149
150
|
};
|
|
150
|
-
|
|
151
|
+
const normalizedValue = value ? this.validator.match(value) : this.getToday();
|
|
152
|
+
if (!normalizedValue) throw new Error("Date format is invalid.");
|
|
153
|
+
this.value = normalizedValue;
|
|
151
154
|
this.throwIfFormatIsNotValid();
|
|
152
155
|
}
|
|
153
156
|
throwIfFormatIsNotValid() {
|
|
@@ -543,9 +546,8 @@ var ClassStatusSchema = import_zod.z.literal("pending").or(import_zod.z.literal(
|
|
|
543
546
|
// src/infrastructure/restful/requests/forms/ClassCreationForm.ts
|
|
544
547
|
var ClassCreationFormSchema = import_zod2.z.object({
|
|
545
548
|
title: import_zod2.z.string().min(1).max(255),
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
endTime: import_zod2.z.string(),
|
|
549
|
+
startDateTime: import_zod2.z.string().datetime(),
|
|
550
|
+
endDateTime: import_zod2.z.string().datetime(),
|
|
549
551
|
courseId: import_zod2.z.string().uuid(),
|
|
550
552
|
description: import_zod2.z.string().max(255).optional(),
|
|
551
553
|
status: ClassStatusSchema.optional(),
|
|
@@ -595,10 +597,35 @@ var FreeDateTimeSlot = class {
|
|
|
595
597
|
this.userId = opts.userId;
|
|
596
598
|
}
|
|
597
599
|
};
|
|
600
|
+
|
|
601
|
+
// src/application/helpers/helpers/tryCatch.ts
|
|
602
|
+
function tryCatch(callback, fallback) {
|
|
603
|
+
try {
|
|
604
|
+
return callback();
|
|
605
|
+
} catch (error) {
|
|
606
|
+
return fallback(error);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
function tryCatchAsync(callback, fallback) {
|
|
610
|
+
return __async(this, null, function* () {
|
|
611
|
+
try {
|
|
612
|
+
return yield callback();
|
|
613
|
+
} catch (error) {
|
|
614
|
+
return yield fallback(error);
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// src/application/helpers/helpers/filterAsync.ts
|
|
620
|
+
function filterAsync(arr, predicate) {
|
|
621
|
+
return __async(this, null, function* () {
|
|
622
|
+
const results = yield Promise.all(arr.map(predicate));
|
|
623
|
+
return arr.filter((_v, index) => results[index]);
|
|
624
|
+
});
|
|
625
|
+
}
|
|
598
626
|
// Annotate the CommonJS export names for ESM import in node:
|
|
599
627
|
0 && (module.exports = {
|
|
600
628
|
AsaasCustomer,
|
|
601
|
-
Class,
|
|
602
629
|
ClassCreationFormSchema,
|
|
603
630
|
ClassCreationRecurrenceRuleSchema,
|
|
604
631
|
ClassStatusSchema,
|
|
@@ -608,5 +635,8 @@ var FreeDateTimeSlot = class {
|
|
|
608
635
|
ISO8601DateValidator,
|
|
609
636
|
ISO8601Time,
|
|
610
637
|
ISO8601TimeValidator,
|
|
611
|
-
UserUnavailableTime
|
|
638
|
+
UserUnavailableTime,
|
|
639
|
+
filterAsync,
|
|
640
|
+
tryCatch,
|
|
641
|
+
tryCatchAsync
|
|
612
642
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsaasCustomer } from "./domain/entities/AsaasCustomer.js";
|
|
2
|
-
import {
|
|
2
|
+
import { IClass } from "./domain/entities/Class.js";
|
|
3
3
|
import { IClassRequest } from "./domain/entities/ClassRequest.js";
|
|
4
4
|
import { IContract } from "./domain/entities/Contract.js";
|
|
5
5
|
import { ICourse } from "./domain/entities/Course.js";
|
|
@@ -46,6 +46,9 @@ import { GetFixedAvailableTimeResponseBody } from "./infrastructure/restful/resp
|
|
|
46
46
|
import { ClassCreationForm, ClassCreationFormSchema } from "./infrastructure/restful/requests/forms/ClassCreationForm.js";
|
|
47
47
|
import { ClassStatus, ClassStatusSchema } from "./domain/types/ClassStatus.js";
|
|
48
48
|
import { ClassCreationRecurrenceRule, ClassCreationRecurrenceRuleSchema } from "./domain/types/ClassCreationRecurrenceRule.js";
|
|
49
|
+
import { IClassStatus } from "./domain/entities/ClassStatus.js";
|
|
49
50
|
import { IUserUnavailableTime, UserUnavailableTime } from "./domain/entities/UserUnavailableTime.js";
|
|
50
51
|
import { IFreeDateTimeSlot, FreeDateTimeSlot } from "./domain/entities/FreeTimeSlot.js";
|
|
51
|
-
|
|
52
|
+
import { tryCatch, tryCatchAsync } from "./application/helpers/helpers/tryCatch.js";
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
1
22
|
// src/domain/entities/AsaasCustomer.ts
|
|
2
23
|
var AsaasCustomer = class {
|
|
3
24
|
constructor(opts) {
|
|
@@ -9,39 +30,11 @@ var AsaasCustomer = class {
|
|
|
9
30
|
}
|
|
10
31
|
};
|
|
11
32
|
|
|
12
|
-
// src/domain/entities/Class.ts
|
|
13
|
-
var Class = class {
|
|
14
|
-
constructor(params) {
|
|
15
|
-
this.id = params.id;
|
|
16
|
-
this.groupId = params.groupId ? params.groupId : null;
|
|
17
|
-
this.title = params.title;
|
|
18
|
-
this.description = params.description ? params.description : null;
|
|
19
|
-
this.createdAt = params.createdAt ? params.createdAt : null;
|
|
20
|
-
this.updatedAt = params.updatedAt ? params.updatedAt : null;
|
|
21
|
-
this.date = params.date;
|
|
22
|
-
this.time = params.time;
|
|
23
|
-
this.endTime = params.endTime;
|
|
24
|
-
this.endDate = params.endDate ? params.endDate : null;
|
|
25
|
-
this.courseId = params.courseId;
|
|
26
|
-
this.paymentId = params.paymentId ? params.paymentId : null;
|
|
27
|
-
this.status = params.status ? params.status : null;
|
|
28
|
-
this.course = params.course;
|
|
29
|
-
this.payment = params.payment;
|
|
30
|
-
this.files = params.files;
|
|
31
|
-
this.rescheduleRequests = params.rescheduleRequests;
|
|
32
|
-
this.googleCalendarEvents = params.googleCalendarEvents;
|
|
33
|
-
this.meetingLink = params.meetingLink ? params.meetingLink : null;
|
|
34
|
-
this.contractId = params.contractId ? params.contractId : null;
|
|
35
|
-
this.contract = params.contract;
|
|
36
|
-
this.ownerId = params.ownerId;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
33
|
// src/domain/entities/ISO8601DateValidator.ts
|
|
41
34
|
var ISO8601DateValidator = class {
|
|
42
35
|
constructor() {
|
|
43
36
|
this.YYYYmmDD = new RegExp(
|
|
44
|
-
"^[0-9]{4}-([0][1-9]|[1][0-2])-([0][1-9]|[1-2][0-9]|[3][0-1])
|
|
37
|
+
"^[0-9]{4}-([0][1-9]|[1][0-2])-([0][1-9]|[1-2][0-9]|[3][0-1])"
|
|
45
38
|
);
|
|
46
39
|
}
|
|
47
40
|
/**
|
|
@@ -50,6 +43,13 @@ var ISO8601DateValidator = class {
|
|
|
50
43
|
formatIsValid(date) {
|
|
51
44
|
return this.YYYYmmDD.test(date);
|
|
52
45
|
}
|
|
46
|
+
match(date) {
|
|
47
|
+
const matches = date.match(this.YYYYmmDD);
|
|
48
|
+
if (!matches || matches.length < 1) {
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
return matches[0];
|
|
52
|
+
}
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
// src/domain/entities/ISO8601Date.ts
|
|
@@ -110,7 +110,9 @@ var _ISO8601Date = class _ISO8601Date {
|
|
|
110
110
|
const targetDate = date || this;
|
|
111
111
|
return targetDate.toUtcJsDateTime().getUTCDay();
|
|
112
112
|
};
|
|
113
|
-
|
|
113
|
+
const normalizedValue = value ? this.validator.match(value) : this.getToday();
|
|
114
|
+
if (!normalizedValue) throw new Error("Date format is invalid.");
|
|
115
|
+
this.value = normalizedValue;
|
|
114
116
|
this.throwIfFormatIsNotValid();
|
|
115
117
|
}
|
|
116
118
|
throwIfFormatIsNotValid() {
|
|
@@ -506,9 +508,8 @@ var ClassStatusSchema = z.literal("pending").or(z.literal("done")).or(z.literal(
|
|
|
506
508
|
// src/infrastructure/restful/requests/forms/ClassCreationForm.ts
|
|
507
509
|
var ClassCreationFormSchema = z2.object({
|
|
508
510
|
title: z2.string().min(1).max(255),
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
endTime: z2.string(),
|
|
511
|
+
startDateTime: z2.string().datetime(),
|
|
512
|
+
endDateTime: z2.string().datetime(),
|
|
512
513
|
courseId: z2.string().uuid(),
|
|
513
514
|
description: z2.string().max(255).optional(),
|
|
514
515
|
status: ClassStatusSchema.optional(),
|
|
@@ -558,9 +559,34 @@ var FreeDateTimeSlot = class {
|
|
|
558
559
|
this.userId = opts.userId;
|
|
559
560
|
}
|
|
560
561
|
};
|
|
562
|
+
|
|
563
|
+
// src/application/helpers/helpers/tryCatch.ts
|
|
564
|
+
function tryCatch(callback, fallback) {
|
|
565
|
+
try {
|
|
566
|
+
return callback();
|
|
567
|
+
} catch (error) {
|
|
568
|
+
return fallback(error);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function tryCatchAsync(callback, fallback) {
|
|
572
|
+
return __async(this, null, function* () {
|
|
573
|
+
try {
|
|
574
|
+
return yield callback();
|
|
575
|
+
} catch (error) {
|
|
576
|
+
return yield fallback(error);
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// src/application/helpers/helpers/filterAsync.ts
|
|
582
|
+
function filterAsync(arr, predicate) {
|
|
583
|
+
return __async(this, null, function* () {
|
|
584
|
+
const results = yield Promise.all(arr.map(predicate));
|
|
585
|
+
return arr.filter((_v, index) => results[index]);
|
|
586
|
+
});
|
|
587
|
+
}
|
|
561
588
|
export {
|
|
562
589
|
AsaasCustomer,
|
|
563
|
-
Class,
|
|
564
590
|
ClassCreationFormSchema,
|
|
565
591
|
ClassCreationRecurrenceRuleSchema,
|
|
566
592
|
ClassStatusSchema,
|
|
@@ -570,5 +596,8 @@ export {
|
|
|
570
596
|
ISO8601DateValidator,
|
|
571
597
|
ISO8601Time,
|
|
572
598
|
ISO8601TimeValidator,
|
|
573
|
-
UserUnavailableTime
|
|
599
|
+
UserUnavailableTime,
|
|
600
|
+
filterAsync,
|
|
601
|
+
tryCatch,
|
|
602
|
+
tryCatchAsync
|
|
574
603
|
};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const ClassCreationFormSchema: z.ZodObject<{
|
|
3
3
|
title: z.ZodString;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
endTime: z.ZodString;
|
|
4
|
+
startDateTime: z.ZodString;
|
|
5
|
+
endDateTime: z.ZodString;
|
|
7
6
|
courseId: z.ZodString;
|
|
8
7
|
description: z.ZodOptional<z.ZodString>;
|
|
9
8
|
status: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"pending">, z.ZodLiteral<"done">]>, z.ZodLiteral<"canceled">]>, z.ZodLiteral<"to reschedule">]>>;
|
|
10
9
|
meetingLink: z.ZodOptional<z.ZodString>;
|
|
11
10
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
date: string;
|
|
13
11
|
title: string;
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
startDateTime: string;
|
|
13
|
+
endDateTime: string;
|
|
16
14
|
courseId: string;
|
|
17
15
|
status?: "pending" | "done" | "canceled" | "to reschedule" | undefined;
|
|
18
16
|
description?: string | undefined;
|
|
19
17
|
meetingLink?: string | undefined;
|
|
20
18
|
}, {
|
|
21
|
-
date: string;
|
|
22
19
|
title: string;
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
startDateTime: string;
|
|
21
|
+
endDateTime: string;
|
|
25
22
|
courseId: string;
|
|
26
23
|
status?: "pending" | "done" | "canceled" | "to reschedule" | undefined;
|
|
27
24
|
description?: string | undefined;
|
|
@@ -5,9 +5,8 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const ClassStatus_1 = require("../../../../domain/types/ClassStatus");
|
|
6
6
|
exports.ClassCreationFormSchema = zod_1.z.object({
|
|
7
7
|
title: zod_1.z.string().min(1).max(255),
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
endTime: zod_1.z.string(),
|
|
8
|
+
startDateTime: zod_1.z.string().datetime(),
|
|
9
|
+
endDateTime: zod_1.z.string().datetime(),
|
|
11
10
|
courseId: zod_1.z.string().uuid(),
|
|
12
11
|
description: zod_1.z.string().max(255).optional(),
|
|
13
12
|
status: ClassStatus_1.ClassStatusSchema.optional(),
|