@quesmed/types 2.6.110 → 2.6.111

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.
@@ -4,7 +4,7 @@ import { IConcept } from './Concept';
4
4
  import { IMarksheet } from './Marksheet';
5
5
  import { INotification } from './Notification';
6
6
  import { IOsceStation } from './OsceStation';
7
- import { EProductType } from './Product';
7
+ import { EProductType, IEntitlement } from './Product';
8
8
  import { IQuestion } from './Question';
9
9
  import { ISubscription } from './Subscription';
10
10
  import { ITodo } from './Todo';
@@ -126,6 +126,7 @@ export interface IProductFeedback {
126
126
  rating: number | null;
127
127
  feedback: string | null;
128
128
  createdAt: number | Date;
129
+ product: IEntitlement;
129
130
  }
130
131
  export interface IUser {
131
132
  id: Id;
@@ -94,8 +94,13 @@ const optimisticAddProductFeedback = (input) => ({
94
94
  feedback: input.feedback || null,
95
95
  createdAt: new Date(),
96
96
  userId: 1,
97
- productId: 1,
97
+ productId: models_1.EProductType.QBANK,
98
98
  id: (0, utils_1.randomInt)(),
99
+ product: {
100
+ id: models_1.EProductType.QBANK,
101
+ index: 0,
102
+ name: models_1.EProductType[models_1.EProductType.QBANK],
103
+ },
99
104
  },
100
105
  },
101
106
  });
@@ -1,8 +1,9 @@
1
- import { EProductDuration, IEntitlement } from '../../../models';
1
+ import { EProductDuration, EProductType, IEntitlement, IProductFeedback, IUser } from '../../../models';
2
2
  import { AdminData } from '../../types';
3
3
  export declare const IMPORT_STATS: import("@apollo/client").DocumentNode;
4
4
  export interface IImportStats {
5
5
  totalBatches: number;
6
+ mockTestBatches: number;
6
7
  questionCount: number;
7
8
  stationCount: number;
8
9
  chapterCount: number;
@@ -64,3 +65,29 @@ export type IUserBreakdownVar = {
64
65
  force: boolean;
65
66
  };
66
67
  export type IUserBreakdownData = AdminData<IUserBreakdown, 'userBreakdown'>;
68
+ export declare const USER_FEEDBACKS: import("@apollo/client").DocumentNode;
69
+ export interface IFeedbackData {
70
+ user: IUser;
71
+ spends: number;
72
+ userId: number;
73
+ average: number;
74
+ reviews: Array<IProductFeedback>;
75
+ }
76
+ export interface IUserFeedback {
77
+ total: number;
78
+ feedbacks: Array<IFeedbackData>;
79
+ average: number;
80
+ ratings: Array<{
81
+ value: number;
82
+ count: number;
83
+ }>;
84
+ }
85
+ export type IUserFeedbackVar = {
86
+ from: Date | number | null;
87
+ to: Date | number | null;
88
+ force: boolean;
89
+ productId: EProductType;
90
+ rating: number | null;
91
+ description: boolean | null;
92
+ };
93
+ export type IUserFeedbackData = AdminData<IUserFeedback, 'userFeedbacks'>;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.USER_BREAKDOWN = exports.USER_STATUS = exports.EARNINGS = exports.IMPORT_STATS = void 0;
3
+ exports.USER_FEEDBACKS = exports.USER_BREAKDOWN = exports.USER_STATUS = exports.EARNINGS = exports.IMPORT_STATS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  exports.IMPORT_STATS = (0, client_1.gql) `
6
6
  query ImportStats($force: Boolean) {
7
7
  admin {
8
8
  importStats(force: $force) {
9
9
  totalBatches
10
+ mockTestBatches
10
11
  questionCount
11
12
  stationCount
12
13
  chapterCount
@@ -66,3 +67,54 @@ exports.USER_BREAKDOWN = (0, client_1.gql) `
66
67
  }
67
68
  }
68
69
  `;
70
+ exports.USER_FEEDBACKS = (0, client_1.gql) `
71
+ query UserFeedbacks(
72
+ $rating: Int
73
+ $productId: Int
74
+ $from: Date
75
+ $to: Date
76
+ $force: Boolean!
77
+ $description: Boolean
78
+ ) {
79
+ admin {
80
+ userFeedbacks(
81
+ from: $from
82
+ to: $to
83
+ force: $force
84
+ productId: $productId
85
+ rating: $rating
86
+ description: $description
87
+ ) {
88
+ total
89
+ average
90
+ ratings {
91
+ value
92
+ count
93
+ }
94
+ feedbacks {
95
+ user {
96
+ id
97
+ displayName
98
+ username
99
+ firstName
100
+ lastName
101
+ createdAt
102
+ }
103
+ spends
104
+ average
105
+ reviews {
106
+ id
107
+ userId
108
+ createdAt
109
+ rating
110
+ feedback
111
+ product {
112
+ id
113
+ name
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ `;
@@ -4,7 +4,7 @@ import { IConcept } from './Concept';
4
4
  import { IMarksheet } from './Marksheet';
5
5
  import { INotification } from './Notification';
6
6
  import { IOsceStation } from './OsceStation';
7
- import { EProductType } from './Product';
7
+ import { EProductType, IEntitlement } from './Product';
8
8
  import { IQuestion } from './Question';
9
9
  import { ISubscription } from './Subscription';
10
10
  import { ITodo } from './Todo';
@@ -126,6 +126,7 @@ export interface IProductFeedback {
126
126
  rating: number | null;
127
127
  feedback: string | null;
128
128
  createdAt: number | Date;
129
+ product: IEntitlement;
129
130
  }
130
131
  export interface IUser {
131
132
  id: Id;
@@ -1,5 +1,5 @@
1
1
  import { gql } from '@apollo/client';
2
- import { EUserLearningStatus, } from '../../../models';
2
+ import { EProductType, EUserLearningStatus, } from '../../../models';
3
3
  import { randomInt } from '../../../utils';
4
4
  import { UPDATE_USER_SETTINGS_FRAGMENT, USER_SETTINGS_FIELDS, } from '../../fragments';
5
5
  export const LOGOUT_USER = gql `
@@ -91,8 +91,13 @@ export const optimisticAddProductFeedback = (input) => ({
91
91
  feedback: input.feedback || null,
92
92
  createdAt: new Date(),
93
93
  userId: 1,
94
- productId: 1,
94
+ productId: EProductType.QBANK,
95
95
  id: randomInt(),
96
+ product: {
97
+ id: EProductType.QBANK,
98
+ index: 0,
99
+ name: EProductType[EProductType.QBANK],
100
+ },
96
101
  },
97
102
  },
98
103
  });
@@ -1,8 +1,9 @@
1
- import { EProductDuration, IEntitlement } from '../../../models';
1
+ import { EProductDuration, EProductType, IEntitlement, IProductFeedback, IUser } from '../../../models';
2
2
  import { AdminData } from '../../types';
3
3
  export declare const IMPORT_STATS: import("@apollo/client").DocumentNode;
4
4
  export interface IImportStats {
5
5
  totalBatches: number;
6
+ mockTestBatches: number;
6
7
  questionCount: number;
7
8
  stationCount: number;
8
9
  chapterCount: number;
@@ -64,3 +65,29 @@ export type IUserBreakdownVar = {
64
65
  force: boolean;
65
66
  };
66
67
  export type IUserBreakdownData = AdminData<IUserBreakdown, 'userBreakdown'>;
68
+ export declare const USER_FEEDBACKS: import("@apollo/client").DocumentNode;
69
+ export interface IFeedbackData {
70
+ user: IUser;
71
+ spends: number;
72
+ userId: number;
73
+ average: number;
74
+ reviews: Array<IProductFeedback>;
75
+ }
76
+ export interface IUserFeedback {
77
+ total: number;
78
+ feedbacks: Array<IFeedbackData>;
79
+ average: number;
80
+ ratings: Array<{
81
+ value: number;
82
+ count: number;
83
+ }>;
84
+ }
85
+ export type IUserFeedbackVar = {
86
+ from: Date | number | null;
87
+ to: Date | number | null;
88
+ force: boolean;
89
+ productId: EProductType;
90
+ rating: number | null;
91
+ description: boolean | null;
92
+ };
93
+ export type IUserFeedbackData = AdminData<IUserFeedback, 'userFeedbacks'>;
@@ -4,6 +4,7 @@ export const IMPORT_STATS = gql `
4
4
  admin {
5
5
  importStats(force: $force) {
6
6
  totalBatches
7
+ mockTestBatches
7
8
  questionCount
8
9
  stationCount
9
10
  chapterCount
@@ -63,3 +64,54 @@ export const USER_BREAKDOWN = gql `
63
64
  }
64
65
  }
65
66
  `;
67
+ export const USER_FEEDBACKS = gql `
68
+ query UserFeedbacks(
69
+ $rating: Int
70
+ $productId: Int
71
+ $from: Date
72
+ $to: Date
73
+ $force: Boolean!
74
+ $description: Boolean
75
+ ) {
76
+ admin {
77
+ userFeedbacks(
78
+ from: $from
79
+ to: $to
80
+ force: $force
81
+ productId: $productId
82
+ rating: $rating
83
+ description: $description
84
+ ) {
85
+ total
86
+ average
87
+ ratings {
88
+ value
89
+ count
90
+ }
91
+ feedbacks {
92
+ user {
93
+ id
94
+ displayName
95
+ username
96
+ firstName
97
+ lastName
98
+ createdAt
99
+ }
100
+ spends
101
+ average
102
+ reviews {
103
+ id
104
+ userId
105
+ createdAt
106
+ rating
107
+ feedback
108
+ product {
109
+ id
110
+ name
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.110",
3
+ "version": "2.6.111",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",