@quesmed/types 2.2.55 → 2.2.58
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/cjs/models/Product.d.ts +17 -0
- package/dist/cjs/models/Product.js +9 -0
- package/dist/cjs/models/Promo.d.ts +1 -1
- package/dist/cjs/models/Subscription.d.ts +13 -12
- package/dist/cjs/models/Subscription.js +0 -7
- package/dist/cjs/models/User.d.ts +8 -16
- package/dist/cjs/models/User.js +5 -5
- package/dist/cjs/models/index.d.ts +2 -1
- package/dist/cjs/models/index.js +2 -1
- package/dist/cjs/resolvers/fragments/user.js +3 -6
- package/dist/cjs/resolvers/mutation/restricted/marksheet.d.ts +1 -1
- package/dist/cjs/resolvers/mutation/restricted/marksheet.js +8 -3
- package/dist/cjs/resolvers/query/index.d.ts +1 -1
- package/dist/cjs/resolvers/query/index.js +1 -1
- package/dist/cjs/resolvers/query/product.d.ts +4 -0
- package/dist/cjs/resolvers/query/{subscription.js → product.js} +4 -4
- package/dist/mjs/models/Product.d.ts +17 -0
- package/dist/mjs/models/Product.js +6 -0
- package/dist/mjs/models/Promo.d.ts +1 -1
- package/dist/mjs/models/Subscription.d.ts +13 -12
- package/dist/mjs/models/Subscription.js +1 -6
- package/dist/mjs/models/User.d.ts +8 -16
- package/dist/mjs/models/User.js +5 -5
- package/dist/mjs/models/index.d.ts +2 -1
- package/dist/mjs/models/index.js +2 -1
- package/dist/mjs/resolvers/fragments/user.js +3 -6
- package/dist/mjs/resolvers/mutation/restricted/marksheet.d.ts +1 -1
- package/dist/mjs/resolvers/mutation/restricted/marksheet.js +8 -3
- package/dist/mjs/resolvers/query/index.d.ts +1 -1
- package/dist/mjs/resolvers/query/index.js +1 -1
- package/dist/mjs/resolvers/query/product.d.ts +4 -0
- package/dist/mjs/resolvers/query/{subscription.js → product.js} +3 -3
- package/package.json +1 -1
- package/dist/cjs/resolvers/query/subscription.d.ts +0 -4
- package/dist/mjs/resolvers/query/subscription.d.ts +0 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Id } from './Type';
|
|
2
|
+
export declare enum EProductType {
|
|
3
|
+
QBANK = 1,
|
|
4
|
+
OSCE = 2,
|
|
5
|
+
BUNDLE = 3
|
|
6
|
+
}
|
|
7
|
+
export interface IProduct {
|
|
8
|
+
id: Id;
|
|
9
|
+
createdAt: number | Date;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
price: number;
|
|
13
|
+
stripePriceId: string;
|
|
14
|
+
duration: number;
|
|
15
|
+
public: boolean;
|
|
16
|
+
typeId: EProductType;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EProductType = void 0;
|
|
4
|
+
var EProductType;
|
|
5
|
+
(function (EProductType) {
|
|
6
|
+
EProductType[EProductType["QBANK"] = 1] = "QBANK";
|
|
7
|
+
EProductType[EProductType["OSCE"] = 2] = "OSCE";
|
|
8
|
+
EProductType[EProductType["BUNDLE"] = 3] = "BUNDLE";
|
|
9
|
+
})(EProductType = exports.EProductType || (exports.EProductType = {}));
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { IProduct } from './Product';
|
|
1
2
|
import { Id } from './Type';
|
|
3
|
+
import { IClassYear, IUser } from './User';
|
|
2
4
|
export interface ISubscription {
|
|
3
5
|
id: Id;
|
|
4
6
|
createdAt: number | Date;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
BUNDLE = 3
|
|
7
|
+
updatedAt: number | Date;
|
|
8
|
+
startedAt: number | Date;
|
|
9
|
+
endedAt: number | Date;
|
|
10
|
+
periodEndAt: number | Date;
|
|
11
|
+
stripeSubscriptionId: string;
|
|
12
|
+
userId: Id;
|
|
13
|
+
user?: IUser;
|
|
14
|
+
productId: Id;
|
|
15
|
+
product?: IProduct;
|
|
16
|
+
classYear: IClassYear;
|
|
17
|
+
invoiced: number;
|
|
17
18
|
}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ESubscriptionType = void 0;
|
|
4
|
-
var ESubscriptionType;
|
|
5
|
-
(function (ESubscriptionType) {
|
|
6
|
-
ESubscriptionType[ESubscriptionType["QBANK"] = 1] = "QBANK";
|
|
7
|
-
ESubscriptionType[ESubscriptionType["OSCE"] = 2] = "OSCE";
|
|
8
|
-
ESubscriptionType[ESubscriptionType["BUNDLE"] = 3] = "BUNDLE";
|
|
9
|
-
})(ESubscriptionType = exports.ESubscriptionType || (exports.ESubscriptionType = {}));
|
|
@@ -26,9 +26,9 @@ export interface IPayload {
|
|
|
26
26
|
accessLevel: IAccessLevel;
|
|
27
27
|
tocAccepted: boolean;
|
|
28
28
|
exp: number;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
qbankSubscriptionEndDate: number | null;
|
|
30
|
+
osceSubscriptionEndDate: number | null;
|
|
31
|
+
bundleSubscriptionEndDate: number | null;
|
|
32
32
|
}
|
|
33
33
|
export interface IDailyProgressInfo {
|
|
34
34
|
totalCount: number;
|
|
@@ -48,18 +48,6 @@ export interface IUser {
|
|
|
48
48
|
dailyFeedMax: number;
|
|
49
49
|
stripeCustomerId: string;
|
|
50
50
|
stripeLastSyncAt: number | Date | null;
|
|
51
|
-
qBankSubscriptionId: Id;
|
|
52
|
-
qBankSubscription: ISubscription | null;
|
|
53
|
-
stripeQBankSubscriptionId: string;
|
|
54
|
-
stripeQBankSubscriptionEndDate: number | Date;
|
|
55
|
-
osceSubscriptionId: Id;
|
|
56
|
-
osceSubscription: ISubscription | null;
|
|
57
|
-
stripeOsceSubscriptionId: string;
|
|
58
|
-
stripeOsceSubscriptionEndDate: number | Date;
|
|
59
|
-
bundleSubscriptionId: Id;
|
|
60
|
-
bundleSubscription: ISubscription | null;
|
|
61
|
-
stripeBundleSubscriptionId: string;
|
|
62
|
-
stripeBundleSubscriptionEndDate: number | Date;
|
|
63
51
|
referralCount: number;
|
|
64
52
|
classYear: IClassYear;
|
|
65
53
|
graduationYear: number;
|
|
@@ -82,8 +70,12 @@ export interface IUser {
|
|
|
82
70
|
dailyFeed: ITodo;
|
|
83
71
|
dailyProgress: IDailyProgressInfo[];
|
|
84
72
|
notifications: INotification[];
|
|
73
|
+
subscriptions: ISubscription[];
|
|
74
|
+
qbankSubscriptionEndDate: number | Date | null;
|
|
75
|
+
osceSubscriptionEndDate: number | Date | null;
|
|
76
|
+
bundleSubscriptionEndDate: number | Date | null;
|
|
85
77
|
}
|
|
86
|
-
export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear): IClassYear;
|
|
78
|
+
export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear, compareUnix?: number): IClassYear;
|
|
87
79
|
export declare function currentClassGroup(createdAtUnix: number, classYear: IClassYear): EClassYearGroup;
|
|
88
80
|
export interface IUserCompletedQuestion {
|
|
89
81
|
id: Id;
|
package/dist/cjs/models/User.js
CHANGED
|
@@ -26,7 +26,7 @@ exports.classYearGroup = {
|
|
|
26
26
|
MSc: EClassYearGroup.CLINICAL,
|
|
27
27
|
'Beta Tester': EClassYearGroup.CLINICAL,
|
|
28
28
|
};
|
|
29
|
-
function currentClassYear(createdAtUnix, classYear) {
|
|
29
|
+
function currentClassYear(createdAtUnix, classYear, compareUnix = new Date().getTime()) {
|
|
30
30
|
if (createdAtUnix === 0) {
|
|
31
31
|
throw new Error('createdAt not given in Unix');
|
|
32
32
|
}
|
|
@@ -38,10 +38,10 @@ function currentClassYear(createdAtUnix, classYear) {
|
|
|
38
38
|
if (classYearsIdx === -1) {
|
|
39
39
|
return exports.classYears[lastClassYearIdx];
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
const currentYear =
|
|
41
|
+
const compareDate = new Date(compareUnix * 1000);
|
|
42
|
+
const currentYear = compareDate.getFullYear();
|
|
43
43
|
const createdAt = new Date(createdAtUnix * 1000);
|
|
44
|
-
if (createdAt.getFullYear() >
|
|
44
|
+
if (createdAt.getFullYear() > compareDate.getFullYear()) {
|
|
45
45
|
throw new Error('createdAt not given in Unix');
|
|
46
46
|
}
|
|
47
47
|
const createdYear = createdAt.getFullYear();
|
|
@@ -51,7 +51,7 @@ function currentClassYear(createdAtUnix, classYear) {
|
|
|
51
51
|
if (createdAt > createdAcademicYear) {
|
|
52
52
|
yearsAdded--;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (compareDate > nowAcademicYear) {
|
|
55
55
|
yearsAdded++;
|
|
56
56
|
}
|
|
57
57
|
const newClassYearIdx = classYearsIdx + yearsAdded;
|
|
@@ -13,8 +13,10 @@ export * from './Notification';
|
|
|
13
13
|
export * from './OsceMarksheet';
|
|
14
14
|
export * from './OsceStation';
|
|
15
15
|
export * from './Picture';
|
|
16
|
+
export * from './Product';
|
|
16
17
|
export * from './Promo';
|
|
17
18
|
export * from './Question';
|
|
19
|
+
export * from './Referrals';
|
|
18
20
|
export * from './Subscription';
|
|
19
21
|
export * from './Todo';
|
|
20
22
|
export * from './Token';
|
|
@@ -23,4 +25,3 @@ export * from './Type';
|
|
|
23
25
|
export * from './University';
|
|
24
26
|
export * from './User';
|
|
25
27
|
export * from './Video';
|
|
26
|
-
export * from './Referrals';
|
package/dist/cjs/models/index.js
CHANGED
|
@@ -25,8 +25,10 @@ __exportStar(require("./Notification"), exports);
|
|
|
25
25
|
__exportStar(require("./OsceMarksheet"), exports);
|
|
26
26
|
__exportStar(require("./OsceStation"), exports);
|
|
27
27
|
__exportStar(require("./Picture"), exports);
|
|
28
|
+
__exportStar(require("./Product"), exports);
|
|
28
29
|
__exportStar(require("./Promo"), exports);
|
|
29
30
|
__exportStar(require("./Question"), exports);
|
|
31
|
+
__exportStar(require("./Referrals"), exports);
|
|
30
32
|
__exportStar(require("./Subscription"), exports);
|
|
31
33
|
__exportStar(require("./Todo"), exports);
|
|
32
34
|
__exportStar(require("./Token"), exports);
|
|
@@ -35,4 +37,3 @@ __exportStar(require("./Type"), exports);
|
|
|
35
37
|
__exportStar(require("./University"), exports);
|
|
36
38
|
__exportStar(require("./User"), exports);
|
|
37
39
|
__exportStar(require("./Video"), exports);
|
|
38
|
-
__exportStar(require("./Referrals"), exports);
|
|
@@ -18,12 +18,9 @@ exports.USER_FIELDS = (0, client_1.gql) `
|
|
|
18
18
|
dailyFeedResetTime
|
|
19
19
|
dailyFeedMax
|
|
20
20
|
stripeCustomerId
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
stripeOsceSubscriptionEndDate
|
|
25
|
-
stripeBundleSubscriptionId
|
|
26
|
-
stripeBundleSubscriptionEndDate
|
|
21
|
+
qbankSubscriptionEndDate
|
|
22
|
+
osceSubscriptionEndDate
|
|
23
|
+
bundleSubscriptionEndDate
|
|
27
24
|
|
|
28
25
|
# user-specific keys
|
|
29
26
|
# marksheets
|
|
@@ -188,7 +188,7 @@ export declare const LEAVE_MARKSHEET: import("@apollo/client").DocumentNode;
|
|
|
188
188
|
export interface IEndMarksheetVar {
|
|
189
189
|
marksheetId: Id;
|
|
190
190
|
}
|
|
191
|
-
export declare type IEndMarksheetData = RestrictedData<graphqlNormalize &
|
|
191
|
+
export declare type IEndMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'endMarksheet'>;
|
|
192
192
|
export declare const END_MARKSHEET: import("@apollo/client").DocumentNode;
|
|
193
193
|
/**
|
|
194
194
|
* toggleStrikeOptions
|
|
@@ -2427,6 +2427,7 @@ exports.REMOVE_FLAGGED_QUESTION = (0, client_1.gql) `
|
|
|
2427
2427
|
restricted {
|
|
2428
2428
|
removeFlaggedQuestion(questionId: $questionId) {
|
|
2429
2429
|
id
|
|
2430
|
+
markId
|
|
2430
2431
|
}
|
|
2431
2432
|
}
|
|
2432
2433
|
}
|
|
@@ -2487,8 +2488,8 @@ exports.START_OR_JOIN_MARKSHEET = (0, client_1.gql) `
|
|
|
2487
2488
|
questionChoiceId
|
|
2488
2489
|
marksheetId
|
|
2489
2490
|
timeTaken
|
|
2490
|
-
isAnswered
|
|
2491
2491
|
striked
|
|
2492
|
+
isAnswered
|
|
2492
2493
|
mark
|
|
2493
2494
|
question {
|
|
2494
2495
|
... on QuestionSBA {
|
|
@@ -3063,8 +3064,8 @@ exports.MODIFY_MARKSHEET_INFO = (0, client_1.gql) `
|
|
|
3063
3064
|
questionChoiceId
|
|
3064
3065
|
marksheetId
|
|
3065
3066
|
timeTaken
|
|
3066
|
-
isAnswered
|
|
3067
3067
|
striked
|
|
3068
|
+
isAnswered
|
|
3068
3069
|
mark
|
|
3069
3070
|
question {
|
|
3070
3071
|
... on QuestionSBA {
|
|
@@ -3586,7 +3587,11 @@ exports.LEAVE_MARKSHEET = (0, client_1.gql) `
|
|
|
3586
3587
|
exports.END_MARKSHEET = (0, client_1.gql) `
|
|
3587
3588
|
mutation EndMarksheet($marksheetId: Int!) {
|
|
3588
3589
|
restricted {
|
|
3589
|
-
endMarksheet(marksheetId: $marksheetId)
|
|
3590
|
+
endMarksheet(marksheetId: $marksheetId) {
|
|
3591
|
+
id
|
|
3592
|
+
timeTaken
|
|
3593
|
+
endedAt
|
|
3594
|
+
}
|
|
3590
3595
|
}
|
|
3591
3596
|
}
|
|
3592
3597
|
`;
|
|
@@ -3,9 +3,9 @@ export * from './author';
|
|
|
3
3
|
export * from './blog';
|
|
4
4
|
export * from './book';
|
|
5
5
|
export * from './feedback';
|
|
6
|
+
export * from './product';
|
|
6
7
|
export * as restricted from './restricted';
|
|
7
8
|
export * from './sample';
|
|
8
|
-
export * from './subscription';
|
|
9
9
|
export * from './university';
|
|
10
10
|
export * from './user';
|
|
11
11
|
export * from './video';
|
|
@@ -28,9 +28,9 @@ __exportStar(require("./author"), exports);
|
|
|
28
28
|
__exportStar(require("./blog"), exports);
|
|
29
29
|
__exportStar(require("./book"), exports);
|
|
30
30
|
__exportStar(require("./feedback"), exports);
|
|
31
|
+
__exportStar(require("./product"), exports);
|
|
31
32
|
exports.restricted = __importStar(require("./restricted"));
|
|
32
33
|
__exportStar(require("./sample"), exports);
|
|
33
|
-
__exportStar(require("./subscription"), exports);
|
|
34
34
|
__exportStar(require("./university"), exports);
|
|
35
35
|
__exportStar(require("./user"), exports);
|
|
36
36
|
__exportStar(require("./video"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PRODUCTS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
|
-
exports.
|
|
6
|
-
query
|
|
7
|
-
|
|
5
|
+
exports.PRODUCTS = (0, client_1.gql) `
|
|
6
|
+
query Products {
|
|
7
|
+
products {
|
|
8
8
|
id
|
|
9
9
|
createdAt
|
|
10
10
|
description
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Id } from './Type';
|
|
2
|
+
export declare enum EProductType {
|
|
3
|
+
QBANK = 1,
|
|
4
|
+
OSCE = 2,
|
|
5
|
+
BUNDLE = 3
|
|
6
|
+
}
|
|
7
|
+
export interface IProduct {
|
|
8
|
+
id: Id;
|
|
9
|
+
createdAt: number | Date;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
price: number;
|
|
13
|
+
stripePriceId: string;
|
|
14
|
+
duration: number;
|
|
15
|
+
public: boolean;
|
|
16
|
+
typeId: EProductType;
|
|
17
|
+
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { IProduct } from './Product';
|
|
1
2
|
import { Id } from './Type';
|
|
3
|
+
import { IClassYear, IUser } from './User';
|
|
2
4
|
export interface ISubscription {
|
|
3
5
|
id: Id;
|
|
4
6
|
createdAt: number | Date;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
BUNDLE = 3
|
|
7
|
+
updatedAt: number | Date;
|
|
8
|
+
startedAt: number | Date;
|
|
9
|
+
endedAt: number | Date;
|
|
10
|
+
periodEndAt: number | Date;
|
|
11
|
+
stripeSubscriptionId: string;
|
|
12
|
+
userId: Id;
|
|
13
|
+
user?: IUser;
|
|
14
|
+
productId: Id;
|
|
15
|
+
product?: IProduct;
|
|
16
|
+
classYear: IClassYear;
|
|
17
|
+
invoiced: number;
|
|
17
18
|
}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (ESubscriptionType) {
|
|
3
|
-
ESubscriptionType[ESubscriptionType["QBANK"] = 1] = "QBANK";
|
|
4
|
-
ESubscriptionType[ESubscriptionType["OSCE"] = 2] = "OSCE";
|
|
5
|
-
ESubscriptionType[ESubscriptionType["BUNDLE"] = 3] = "BUNDLE";
|
|
6
|
-
})(ESubscriptionType || (ESubscriptionType = {}));
|
|
1
|
+
export {};
|
|
@@ -26,9 +26,9 @@ export interface IPayload {
|
|
|
26
26
|
accessLevel: IAccessLevel;
|
|
27
27
|
tocAccepted: boolean;
|
|
28
28
|
exp: number;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
qbankSubscriptionEndDate: number | null;
|
|
30
|
+
osceSubscriptionEndDate: number | null;
|
|
31
|
+
bundleSubscriptionEndDate: number | null;
|
|
32
32
|
}
|
|
33
33
|
export interface IDailyProgressInfo {
|
|
34
34
|
totalCount: number;
|
|
@@ -48,18 +48,6 @@ export interface IUser {
|
|
|
48
48
|
dailyFeedMax: number;
|
|
49
49
|
stripeCustomerId: string;
|
|
50
50
|
stripeLastSyncAt: number | Date | null;
|
|
51
|
-
qBankSubscriptionId: Id;
|
|
52
|
-
qBankSubscription: ISubscription | null;
|
|
53
|
-
stripeQBankSubscriptionId: string;
|
|
54
|
-
stripeQBankSubscriptionEndDate: number | Date;
|
|
55
|
-
osceSubscriptionId: Id;
|
|
56
|
-
osceSubscription: ISubscription | null;
|
|
57
|
-
stripeOsceSubscriptionId: string;
|
|
58
|
-
stripeOsceSubscriptionEndDate: number | Date;
|
|
59
|
-
bundleSubscriptionId: Id;
|
|
60
|
-
bundleSubscription: ISubscription | null;
|
|
61
|
-
stripeBundleSubscriptionId: string;
|
|
62
|
-
stripeBundleSubscriptionEndDate: number | Date;
|
|
63
51
|
referralCount: number;
|
|
64
52
|
classYear: IClassYear;
|
|
65
53
|
graduationYear: number;
|
|
@@ -82,8 +70,12 @@ export interface IUser {
|
|
|
82
70
|
dailyFeed: ITodo;
|
|
83
71
|
dailyProgress: IDailyProgressInfo[];
|
|
84
72
|
notifications: INotification[];
|
|
73
|
+
subscriptions: ISubscription[];
|
|
74
|
+
qbankSubscriptionEndDate: number | Date | null;
|
|
75
|
+
osceSubscriptionEndDate: number | Date | null;
|
|
76
|
+
bundleSubscriptionEndDate: number | Date | null;
|
|
85
77
|
}
|
|
86
|
-
export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear): IClassYear;
|
|
78
|
+
export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear, compareUnix?: number): IClassYear;
|
|
87
79
|
export declare function currentClassGroup(createdAtUnix: number, classYear: IClassYear): EClassYearGroup;
|
|
88
80
|
export interface IUserCompletedQuestion {
|
|
89
81
|
id: Id;
|
package/dist/mjs/models/User.js
CHANGED
|
@@ -23,7 +23,7 @@ export const classYearGroup = {
|
|
|
23
23
|
MSc: EClassYearGroup.CLINICAL,
|
|
24
24
|
'Beta Tester': EClassYearGroup.CLINICAL,
|
|
25
25
|
};
|
|
26
|
-
export function currentClassYear(createdAtUnix, classYear) {
|
|
26
|
+
export function currentClassYear(createdAtUnix, classYear, compareUnix = new Date().getTime()) {
|
|
27
27
|
if (createdAtUnix === 0) {
|
|
28
28
|
throw new Error('createdAt not given in Unix');
|
|
29
29
|
}
|
|
@@ -35,10 +35,10 @@ export function currentClassYear(createdAtUnix, classYear) {
|
|
|
35
35
|
if (classYearsIdx === -1) {
|
|
36
36
|
return classYears[lastClassYearIdx];
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
const currentYear =
|
|
38
|
+
const compareDate = new Date(compareUnix * 1000);
|
|
39
|
+
const currentYear = compareDate.getFullYear();
|
|
40
40
|
const createdAt = new Date(createdAtUnix * 1000);
|
|
41
|
-
if (createdAt.getFullYear() >
|
|
41
|
+
if (createdAt.getFullYear() > compareDate.getFullYear()) {
|
|
42
42
|
throw new Error('createdAt not given in Unix');
|
|
43
43
|
}
|
|
44
44
|
const createdYear = createdAt.getFullYear();
|
|
@@ -48,7 +48,7 @@ export function currentClassYear(createdAtUnix, classYear) {
|
|
|
48
48
|
if (createdAt > createdAcademicYear) {
|
|
49
49
|
yearsAdded--;
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if (compareDate > nowAcademicYear) {
|
|
52
52
|
yearsAdded++;
|
|
53
53
|
}
|
|
54
54
|
const newClassYearIdx = classYearsIdx + yearsAdded;
|
|
@@ -13,8 +13,10 @@ export * from './Notification';
|
|
|
13
13
|
export * from './OsceMarksheet';
|
|
14
14
|
export * from './OsceStation';
|
|
15
15
|
export * from './Picture';
|
|
16
|
+
export * from './Product';
|
|
16
17
|
export * from './Promo';
|
|
17
18
|
export * from './Question';
|
|
19
|
+
export * from './Referrals';
|
|
18
20
|
export * from './Subscription';
|
|
19
21
|
export * from './Todo';
|
|
20
22
|
export * from './Token';
|
|
@@ -23,4 +25,3 @@ export * from './Type';
|
|
|
23
25
|
export * from './University';
|
|
24
26
|
export * from './User';
|
|
25
27
|
export * from './Video';
|
|
26
|
-
export * from './Referrals';
|
package/dist/mjs/models/index.js
CHANGED
|
@@ -13,8 +13,10 @@ export * from './Notification';
|
|
|
13
13
|
export * from './OsceMarksheet';
|
|
14
14
|
export * from './OsceStation';
|
|
15
15
|
export * from './Picture';
|
|
16
|
+
export * from './Product';
|
|
16
17
|
export * from './Promo';
|
|
17
18
|
export * from './Question';
|
|
19
|
+
export * from './Referrals';
|
|
18
20
|
export * from './Subscription';
|
|
19
21
|
export * from './Todo';
|
|
20
22
|
export * from './Token';
|
|
@@ -23,4 +25,3 @@ export * from './Type';
|
|
|
23
25
|
export * from './University';
|
|
24
26
|
export * from './User';
|
|
25
27
|
export * from './Video';
|
|
26
|
-
export * from './Referrals';
|
|
@@ -15,12 +15,9 @@ export const USER_FIELDS = gql `
|
|
|
15
15
|
dailyFeedResetTime
|
|
16
16
|
dailyFeedMax
|
|
17
17
|
stripeCustomerId
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
stripeOsceSubscriptionEndDate
|
|
22
|
-
stripeBundleSubscriptionId
|
|
23
|
-
stripeBundleSubscriptionEndDate
|
|
18
|
+
qbankSubscriptionEndDate
|
|
19
|
+
osceSubscriptionEndDate
|
|
20
|
+
bundleSubscriptionEndDate
|
|
24
21
|
|
|
25
22
|
# user-specific keys
|
|
26
23
|
# marksheets
|
|
@@ -188,7 +188,7 @@ export declare const LEAVE_MARKSHEET: import("@apollo/client").DocumentNode;
|
|
|
188
188
|
export interface IEndMarksheetVar {
|
|
189
189
|
marksheetId: Id;
|
|
190
190
|
}
|
|
191
|
-
export declare type IEndMarksheetData = RestrictedData<graphqlNormalize &
|
|
191
|
+
export declare type IEndMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'endMarksheet'>;
|
|
192
192
|
export declare const END_MARKSHEET: import("@apollo/client").DocumentNode;
|
|
193
193
|
/**
|
|
194
194
|
* toggleStrikeOptions
|
|
@@ -2422,6 +2422,7 @@ export const REMOVE_FLAGGED_QUESTION = gql `
|
|
|
2422
2422
|
restricted {
|
|
2423
2423
|
removeFlaggedQuestion(questionId: $questionId) {
|
|
2424
2424
|
id
|
|
2425
|
+
markId
|
|
2425
2426
|
}
|
|
2426
2427
|
}
|
|
2427
2428
|
}
|
|
@@ -2482,8 +2483,8 @@ export const START_OR_JOIN_MARKSHEET = gql `
|
|
|
2482
2483
|
questionChoiceId
|
|
2483
2484
|
marksheetId
|
|
2484
2485
|
timeTaken
|
|
2485
|
-
isAnswered
|
|
2486
2486
|
striked
|
|
2487
|
+
isAnswered
|
|
2487
2488
|
mark
|
|
2488
2489
|
question {
|
|
2489
2490
|
... on QuestionSBA {
|
|
@@ -3057,8 +3058,8 @@ export const MODIFY_MARKSHEET_INFO = gql `
|
|
|
3057
3058
|
questionChoiceId
|
|
3058
3059
|
marksheetId
|
|
3059
3060
|
timeTaken
|
|
3060
|
-
isAnswered
|
|
3061
3061
|
striked
|
|
3062
|
+
isAnswered
|
|
3062
3063
|
mark
|
|
3063
3064
|
question {
|
|
3064
3065
|
... on QuestionSBA {
|
|
@@ -3580,7 +3581,11 @@ export const LEAVE_MARKSHEET = gql `
|
|
|
3580
3581
|
export const END_MARKSHEET = gql `
|
|
3581
3582
|
mutation EndMarksheet($marksheetId: Int!) {
|
|
3582
3583
|
restricted {
|
|
3583
|
-
endMarksheet(marksheetId: $marksheetId)
|
|
3584
|
+
endMarksheet(marksheetId: $marksheetId) {
|
|
3585
|
+
id
|
|
3586
|
+
timeTaken
|
|
3587
|
+
endedAt
|
|
3588
|
+
}
|
|
3584
3589
|
}
|
|
3585
3590
|
}
|
|
3586
3591
|
`;
|
|
@@ -3,9 +3,9 @@ export * from './author';
|
|
|
3
3
|
export * from './blog';
|
|
4
4
|
export * from './book';
|
|
5
5
|
export * from './feedback';
|
|
6
|
+
export * from './product';
|
|
6
7
|
export * as restricted from './restricted';
|
|
7
8
|
export * from './sample';
|
|
8
|
-
export * from './subscription';
|
|
9
9
|
export * from './university';
|
|
10
10
|
export * from './user';
|
|
11
11
|
export * from './video';
|
|
@@ -3,9 +3,9 @@ export * from './author';
|
|
|
3
3
|
export * from './blog';
|
|
4
4
|
export * from './book';
|
|
5
5
|
export * from './feedback';
|
|
6
|
+
export * from './product';
|
|
6
7
|
export * as restricted from './restricted';
|
|
7
8
|
export * from './sample';
|
|
8
|
-
export * from './subscription';
|
|
9
9
|
export * from './university';
|
|
10
10
|
export * from './user';
|
|
11
11
|
export * from './video';
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ISubscription } from '../../models';
|
|
2
|
-
import { graphqlNormalize, RootData } from '../types';
|
|
3
|
-
export declare type ISubscriptionsData = RootData<(graphqlNormalize & ISubscription)[], 'subscriptions'>;
|
|
4
|
-
export declare const SUBSCRIPTIONS: import("@apollo/client").DocumentNode;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ISubscription } from '../../models';
|
|
2
|
-
import { graphqlNormalize, RootData } from '../types';
|
|
3
|
-
export declare type ISubscriptionsData = RootData<(graphqlNormalize & ISubscription)[], 'subscriptions'>;
|
|
4
|
-
export declare const SUBSCRIPTIONS: import("@apollo/client").DocumentNode;
|