@studious-lms/server 1.21.0 → 1.23.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.
Files changed (120) hide show
  1. package/dist/models/agenda.d.ts +6 -0
  2. package/dist/models/agenda.d.ts.map +1 -1
  3. package/dist/models/announcement.d.ts +2 -0
  4. package/dist/models/announcement.d.ts.map +1 -1
  5. package/dist/models/assignment.d.ts +27 -0
  6. package/dist/models/assignment.d.ts.map +1 -1
  7. package/dist/models/auth.d.ts +4 -0
  8. package/dist/models/auth.d.ts.map +1 -1
  9. package/dist/models/class.d.ts +14 -0
  10. package/dist/models/class.d.ts.map +1 -1
  11. package/dist/models/event.d.ts +11 -0
  12. package/dist/models/event.d.ts.map +1 -1
  13. package/dist/models/file.d.ts +19 -0
  14. package/dist/models/file.d.ts.map +1 -1
  15. package/dist/models/folder.d.ts +4 -0
  16. package/dist/models/folder.d.ts.map +1 -1
  17. package/dist/models/gradebook.d.ts +180 -0
  18. package/dist/models/gradebook.d.ts.map +1 -0
  19. package/dist/models/gradebook.js +88 -0
  20. package/dist/models/gradebook.js.map +1 -0
  21. package/dist/models/labChat.d.ts +4 -0
  22. package/dist/models/labChat.d.ts.map +1 -1
  23. package/dist/models/newtonChat.d.ts +2 -0
  24. package/dist/models/newtonChat.d.ts.map +1 -1
  25. package/dist/models/school.d.ts +177 -0
  26. package/dist/models/school.d.ts.map +1 -1
  27. package/dist/models/school.js +75 -2
  28. package/dist/models/school.js.map +1 -1
  29. package/dist/models/section.d.ts +3 -0
  30. package/dist/models/section.d.ts.map +1 -1
  31. package/dist/models/worksheet.d.ts +6 -0
  32. package/dist/models/worksheet.d.ts.map +1 -1
  33. package/dist/routers/_app.d.ts +1475 -73
  34. package/dist/routers/_app.d.ts.map +1 -1
  35. package/dist/routers/_app.js +4 -2
  36. package/dist/routers/_app.js.map +1 -1
  37. package/dist/routers/admin.d.ts +164 -0
  38. package/dist/routers/admin.d.ts.map +1 -1
  39. package/dist/routers/admin.js +23 -4
  40. package/dist/routers/admin.js.map +1 -1
  41. package/dist/routers/agenda.d.ts +6 -0
  42. package/dist/routers/agenda.d.ts.map +1 -1
  43. package/dist/routers/assignment.d.ts +30 -3
  44. package/dist/routers/assignment.d.ts.map +1 -1
  45. package/dist/routers/class.d.ts +17 -0
  46. package/dist/routers/class.d.ts.map +1 -1
  47. package/dist/routers/event.d.ts +4 -0
  48. package/dist/routers/event.d.ts.map +1 -1
  49. package/dist/routers/file.d.ts +66 -0
  50. package/dist/routers/file.d.ts.map +1 -1
  51. package/dist/routers/file.js +111 -2
  52. package/dist/routers/file.js.map +1 -1
  53. package/dist/routers/gradebook.d.ts +299 -0
  54. package/dist/routers/gradebook.d.ts.map +1 -0
  55. package/dist/routers/gradebook.js +107 -0
  56. package/dist/routers/gradebook.js.map +1 -0
  57. package/dist/routers/school.d.ts +118 -0
  58. package/dist/routers/school.d.ts.map +1 -1
  59. package/dist/routers/school.js +32 -3
  60. package/dist/routers/school.js.map +1 -1
  61. package/dist/routers/section.d.ts +1 -1
  62. package/dist/routers/worksheet.d.ts +3 -1
  63. package/dist/routers/worksheet.d.ts.map +1 -1
  64. package/dist/services/adminInstitution.d.ts +51 -0
  65. package/dist/services/adminInstitution.d.ts.map +1 -1
  66. package/dist/services/adminInstitution.js +52 -2
  67. package/dist/services/adminInstitution.js.map +1 -1
  68. package/dist/services/adminMetrics.d.ts +17 -0
  69. package/dist/services/adminMetrics.d.ts.map +1 -0
  70. package/dist/services/adminMetrics.js +37 -0
  71. package/dist/services/adminMetrics.js.map +1 -0
  72. package/dist/services/adminRunJob.d.ts +9 -0
  73. package/dist/services/adminRunJob.d.ts.map +1 -1
  74. package/dist/services/adminRunJob.js +18 -2
  75. package/dist/services/adminRunJob.js.map +1 -1
  76. package/dist/services/adminUser.d.ts +67 -0
  77. package/dist/services/adminUser.d.ts.map +1 -0
  78. package/dist/services/adminUser.js +87 -0
  79. package/dist/services/adminUser.js.map +1 -0
  80. package/dist/services/agenda.d.ts +6 -0
  81. package/dist/services/agenda.d.ts.map +1 -1
  82. package/dist/services/assignment.d.ts +27 -0
  83. package/dist/services/assignment.d.ts.map +1 -1
  84. package/dist/services/class.d.ts +17 -0
  85. package/dist/services/class.d.ts.map +1 -1
  86. package/dist/services/event.d.ts +4 -0
  87. package/dist/services/event.d.ts.map +1 -1
  88. package/dist/services/gradeCalculation.d.ts +70 -0
  89. package/dist/services/gradeCalculation.d.ts.map +1 -0
  90. package/dist/services/gradeCalculation.js +148 -0
  91. package/dist/services/gradeCalculation.js.map +1 -0
  92. package/dist/services/gradebook.d.ts +197 -0
  93. package/dist/services/gradebook.d.ts.map +1 -0
  94. package/dist/services/gradebook.js +263 -0
  95. package/dist/services/gradebook.js.map +1 -0
  96. package/dist/services/school.d.ts +98 -0
  97. package/dist/services/school.d.ts.map +1 -1
  98. package/dist/services/school.js +116 -4
  99. package/dist/services/school.js.map +1 -1
  100. package/dist/services/worksheet.d.ts +2 -0
  101. package/dist/services/worksheet.d.ts.map +1 -1
  102. package/package.json +1 -1
  103. package/prisma/migrations/20260708011629_add_gradebook_categories_columns_policies/migration.sql +78 -0
  104. package/prisma/migrations/20260723142314_make_file_annotation_submission_optional/migration.sql +2 -0
  105. package/prisma/schema.prisma +62 -2
  106. package/src/models/gradebook.ts +91 -0
  107. package/src/models/school.ts +89 -0
  108. package/src/routers/_app.ts +2 -0
  109. package/src/routers/admin.ts +28 -0
  110. package/src/routers/file.ts +128 -0
  111. package/src/routers/gradebook.ts +173 -0
  112. package/src/routers/school.ts +45 -0
  113. package/src/services/adminInstitution.ts +52 -0
  114. package/src/services/adminMetrics.ts +46 -0
  115. package/src/services/adminRunJob.ts +24 -0
  116. package/src/services/adminUser.ts +93 -0
  117. package/src/services/gradeCalculation.ts +253 -0
  118. package/src/services/gradebook.ts +383 -0
  119. package/src/services/school.ts +178 -1
  120. package/tests/unit/services/gradeCalculation.test.ts +206 -0
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Gradebook model – grade categories, custom gradebook columns/entries,
3
+ * and the queries backing the computed gradebook.
4
+ */
5
+ /** @returns Grade categories for a class, ordered by position. */
6
+ export declare function findGradeCategoriesByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
7
+ id: string;
8
+ name: string;
9
+ classId: string;
10
+ weight: number;
11
+ dropLowest: number;
12
+ position: number;
13
+ }[]>;
14
+ /** @returns A grade category scoped to a class. */
15
+ export declare function findGradeCategory(categoryId: string, classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
16
+ result: {
17
+ userProfile: {
18
+ profilePicture: () => {
19
+ needs: {
20
+ profilePicture: true;
21
+ };
22
+ compute(profile: {
23
+ profilePicture: string | null;
24
+ }): string | null;
25
+ };
26
+ profilePictureThumbnail: () => {
27
+ needs: {
28
+ profilePictureThumbnail: true;
29
+ };
30
+ compute(profile: {
31
+ profilePictureThumbnail: string | null;
32
+ }): string | null;
33
+ };
34
+ };
35
+ };
36
+ model: {};
37
+ query: {};
38
+ client: {};
39
+ }, {}>, "GradeCategory", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
40
+ id: string;
41
+ name: string;
42
+ classId: string;
43
+ weight: number;
44
+ dropLowest: number;
45
+ position: number;
46
+ } | null>;
47
+ /** @returns Custom gradebook columns for a class with their entries. */
48
+ export declare function findCustomGradeColumnsByClassId(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
49
+ entries: {
50
+ id: string;
51
+ points: number;
52
+ studentId: string;
53
+ note: string | null;
54
+ }[];
55
+ } & {
56
+ id: string;
57
+ name: string;
58
+ classId: string;
59
+ gradeCategoryId: string | null;
60
+ position: number;
61
+ maxPoints: number;
62
+ })[]>;
63
+ /** @returns A custom gradebook column scoped to a class. */
64
+ export declare function findCustomGradeColumn(columnId: string, classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
65
+ result: {
66
+ userProfile: {
67
+ profilePicture: () => {
68
+ needs: {
69
+ profilePicture: true;
70
+ };
71
+ compute(profile: {
72
+ profilePicture: string | null;
73
+ }): string | null;
74
+ };
75
+ profilePictureThumbnail: () => {
76
+ needs: {
77
+ profilePictureThumbnail: true;
78
+ };
79
+ compute(profile: {
80
+ profilePictureThumbnail: string | null;
81
+ }): string | null;
82
+ };
83
+ };
84
+ };
85
+ model: {};
86
+ query: {};
87
+ client: {};
88
+ }, {}>, "CustomGradeColumn", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
89
+ id: string;
90
+ name: string;
91
+ classId: string;
92
+ gradeCategoryId: string | null;
93
+ position: number;
94
+ maxPoints: number;
95
+ } | null>;
96
+ /** @returns Class data needed to compute the gradebook. */
97
+ export declare function findClassForGradebook(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
98
+ result: {
99
+ userProfile: {
100
+ profilePicture: () => {
101
+ needs: {
102
+ profilePicture: true;
103
+ };
104
+ compute(profile: {
105
+ profilePicture: string | null;
106
+ }): string | null;
107
+ };
108
+ profilePictureThumbnail: () => {
109
+ needs: {
110
+ profilePictureThumbnail: true;
111
+ };
112
+ compute(profile: {
113
+ profilePictureThumbnail: string | null;
114
+ }): string | null;
115
+ };
116
+ };
117
+ };
118
+ model: {};
119
+ query: {};
120
+ client: {};
121
+ }, {}>, "Class", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
122
+ id: string;
123
+ students: {
124
+ id: string;
125
+ username: string;
126
+ profile: {
127
+ displayName: string | null;
128
+ } | null;
129
+ }[];
130
+ assignments: {
131
+ id: string;
132
+ submissions: {
133
+ studentId: string;
134
+ gradeReceived: number | null;
135
+ }[];
136
+ title: string;
137
+ dueDate: Date;
138
+ maxGrade: number | null;
139
+ weight: number;
140
+ gradeCategoryId: string | null;
141
+ }[];
142
+ treatMissingAsZero: boolean;
143
+ gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
144
+ gradingBoundaries: {
145
+ id: string;
146
+ name: string | null;
147
+ structured: string;
148
+ }[];
149
+ } | null>;
150
+ /** @returns Grade policy fields for a class. */
151
+ export declare function findClassGradePolicies(classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
152
+ result: {
153
+ userProfile: {
154
+ profilePicture: () => {
155
+ needs: {
156
+ profilePicture: true;
157
+ };
158
+ compute(profile: {
159
+ profilePicture: string | null;
160
+ }): string | null;
161
+ };
162
+ profilePictureThumbnail: () => {
163
+ needs: {
164
+ profilePictureThumbnail: true;
165
+ };
166
+ compute(profile: {
167
+ profilePictureThumbnail: string | null;
168
+ }): string | null;
169
+ };
170
+ };
171
+ };
172
+ model: {};
173
+ query: {};
174
+ client: {};
175
+ }, {}>, "Class", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
176
+ id: string;
177
+ treatMissingAsZero: boolean;
178
+ gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
179
+ } | null>;
180
+ //# sourceMappingURL=gradebook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gradebook.d.ts","sourceRoot":"/","sources":["models/gradebook.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,kEAAkE;AAClE,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM;;;;;;;KAK3D;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIpE;AAED,wEAAwE;AACxE,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;MAU9D;AAED,4DAA4D;AAC5D,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAItE;AAED,2DAA2D;AAC3D,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAmCpD;AAED,gDAAgD;AAChD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;UASrD"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Gradebook model – grade categories, custom gradebook columns/entries,
3
+ * and the queries backing the computed gradebook.
4
+ */
5
+
6
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5726b866-9045-5e03-bdc6-65cfbe9f3113")}catch(e){}}();
7
+ import { prisma } from "../lib/prisma.js";
8
+ /** @returns Grade categories for a class, ordered by position. */
9
+ export function findGradeCategoriesByClassId(classId) {
10
+ return prisma.gradeCategory.findMany({
11
+ where: { classId },
12
+ orderBy: { position: "asc" },
13
+ });
14
+ }
15
+ /** @returns A grade category scoped to a class. */
16
+ export function findGradeCategory(categoryId, classId) {
17
+ return prisma.gradeCategory.findFirst({
18
+ where: { id: categoryId, classId },
19
+ });
20
+ }
21
+ /** @returns Custom gradebook columns for a class with their entries. */
22
+ export function findCustomGradeColumnsByClassId(classId) {
23
+ return prisma.customGradeColumn.findMany({
24
+ where: { classId },
25
+ orderBy: { position: "asc" },
26
+ include: {
27
+ entries: {
28
+ select: { id: true, studentId: true, points: true, note: true },
29
+ },
30
+ },
31
+ });
32
+ }
33
+ /** @returns A custom gradebook column scoped to a class. */
34
+ export function findCustomGradeColumn(columnId, classId) {
35
+ return prisma.customGradeColumn.findFirst({
36
+ where: { id: columnId, classId },
37
+ });
38
+ }
39
+ /** @returns Class data needed to compute the gradebook. */
40
+ export function findClassForGradebook(classId) {
41
+ return prisma.class.findUnique({
42
+ where: { id: classId },
43
+ select: {
44
+ id: true,
45
+ treatMissingAsZero: true,
46
+ gradeRoundingMode: true,
47
+ students: {
48
+ select: {
49
+ id: true,
50
+ username: true,
51
+ profile: { select: { displayName: true } },
52
+ },
53
+ },
54
+ gradingBoundaries: {
55
+ take: 1,
56
+ select: { id: true, name: true, structured: true },
57
+ },
58
+ assignments: {
59
+ where: { graded: true, template: false, inProgress: false },
60
+ orderBy: [{ order: "asc" }, { dueDate: "asc" }],
61
+ select: {
62
+ id: true,
63
+ title: true,
64
+ maxGrade: true,
65
+ weight: true,
66
+ gradeCategoryId: true,
67
+ dueDate: true,
68
+ submissions: {
69
+ select: { studentId: true, gradeReceived: true },
70
+ },
71
+ },
72
+ },
73
+ },
74
+ });
75
+ }
76
+ /** @returns Grade policy fields for a class. */
77
+ export function findClassGradePolicies(classId) {
78
+ return prisma.class.findUnique({
79
+ where: { id: classId },
80
+ select: {
81
+ id: true,
82
+ treatMissingAsZero: true,
83
+ gradeRoundingMode: true,
84
+ },
85
+ });
86
+ }
87
+ //# sourceMappingURL=gradebook.js.map
88
+ //# debugId=5726b866-9045-5e03-bdc6-65cfbe9f3113
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gradebook.js","sources":["models/gradebook.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Gradebook model – grade categories, custom gradebook columns/entries,\n * and the queries backing the computed gradebook.\n */\n\nimport { prisma } from \"../lib/prisma.js\";\n\n/** @returns Grade categories for a class, ordered by position. */\nexport function findGradeCategoriesByClassId(classId: string) {\n return prisma.gradeCategory.findMany({\n where: { classId },\n orderBy: { position: \"asc\" },\n });\n}\n\n/** @returns A grade category scoped to a class. */\nexport function findGradeCategory(categoryId: string, classId: string) {\n return prisma.gradeCategory.findFirst({\n where: { id: categoryId, classId },\n });\n}\n\n/** @returns Custom gradebook columns for a class with their entries. */\nexport function findCustomGradeColumnsByClassId(classId: string) {\n return prisma.customGradeColumn.findMany({\n where: { classId },\n orderBy: { position: \"asc\" },\n include: {\n entries: {\n select: { id: true, studentId: true, points: true, note: true },\n },\n },\n });\n}\n\n/** @returns A custom gradebook column scoped to a class. */\nexport function findCustomGradeColumn(columnId: string, classId: string) {\n return prisma.customGradeColumn.findFirst({\n where: { id: columnId, classId },\n });\n}\n\n/** @returns Class data needed to compute the gradebook. */\nexport function findClassForGradebook(classId: string) {\n return prisma.class.findUnique({\n where: { id: classId },\n select: {\n id: true,\n treatMissingAsZero: true,\n gradeRoundingMode: true,\n students: {\n select: {\n id: true,\n username: true,\n profile: { select: { displayName: true } },\n },\n },\n gradingBoundaries: {\n take: 1,\n select: { id: true, name: true, structured: true },\n },\n assignments: {\n where: { graded: true, template: false, inProgress: false },\n orderBy: [{ order: \"asc\" }, { dueDate: \"asc\" }],\n select: {\n id: true,\n title: true,\n maxGrade: true,\n weight: true,\n gradeCategoryId: true,\n dueDate: true,\n submissions: {\n select: { studentId: true, gradeReceived: true },\n },\n },\n },\n },\n });\n}\n\n/** @returns Grade policy fields for a class. */\nexport function findClassGradePolicies(classId: string) {\n return prisma.class.findUnique({\n where: { id: classId },\n select: {\n id: true,\n treatMissingAsZero: true,\n gradeRoundingMode: true,\n },\n });\n}\n"],"names":[],"mappings":"AAAA;;;GAGG;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,kEAAkE;AAClE,MAAM,UAAU,4BAA4B,CAAC,OAAe;IAC1D,OAAO,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;QACnC,KAAK,EAAE,EAAE,OAAO,EAAE;QAClB,OAAO,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC7B,CAAC,CAAC;AACL,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,iBAAiB,CAAC,UAAkB,EAAE,OAAe;IACnE,OAAO,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC;QACpC,KAA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;YACD,WAAW,EAAE;gBACX,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE;gBAC3D,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBAC/C,MAAM,EAAE;oBACN,EAAE,EAAE,IAAI;oBACR,KAAK,EAAE,IAAI;oBACX,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,IAAI;oBACZ,eAAe,EAAE,IAAI;oBACrB,OAAO,EAAE,IAAI;oBACb,WAAW,EAAE;wBACX,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;qBACjD;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACpD,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;QAC7B,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE;QACtB,MAAM,EAAE;YACN,EAAE,EAAE,IAAI;YACR,kBAAkB,EAAE,IAAI;YACxB,iBAAiB,EAAE,IAAI;SACxB;KACF,CAAC,CAAC;AACL,CAAC","debug_id":"5726b866-9045-5e03-bdc6-65cfbe9f3113"}
@@ -53,6 +53,8 @@ export declare function findClassWithTeachersForLab(classId: string, teacherId:
53
53
  discussionsEnabled: boolean;
54
54
  studentsCanCreateDiscussions: boolean;
55
55
  studentsCanReply: boolean;
56
+ treatMissingAsZero: boolean;
57
+ gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
56
58
  }) | null>;
57
59
  /** @returns Lab chat if user is a conversation member. */
58
60
  export declare function findLabChatByMember(labChatId: string, userId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
@@ -287,6 +289,8 @@ export declare function findClassMembership(classId: string, userId: string): im
287
289
  discussionsEnabled: boolean;
288
290
  studentsCanCreateDiscussions: boolean;
289
291
  studentsCanReply: boolean;
292
+ treatMissingAsZero: boolean;
293
+ gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
290
294
  } | null>;
291
295
  /** @returns Lab chats for a class. */
292
296
  export declare function findLabChatsByClass(classId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
@@ -1 +1 @@
1
- {"version":3,"file":"labChat.d.ts","sourceRoot":"/","sources":["models/labChat.ts"],"names":[],"mappings":"AAoDA,kEAAkE;AAClE,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAiC7E;AAED,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAUpE;AAED,kEAAkE;AAClE,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAYrE;AAED,+BAA+B;AAC/B,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAKhD;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOlE;AAED,sCAAsC;AACtC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAED,sCAAsC;AACtC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwClD;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAYnE;AAED,sDAAsD;AACtD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOrE;AAED,4DAA4D;AAC5D,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
@@ -36,6 +36,8 @@ export declare function findClassWithStudent(classId: string, studentId: string)
36
36
  discussionsEnabled: boolean;
37
37
  studentsCanCreateDiscussions: boolean;
38
38
  studentsCanReply: boolean;
39
+ treatMissingAsZero: boolean;
40
+ gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
39
41
  } | null>;
40
42
  /** @returns Submission for assignment and student. */
41
43
  export declare function findSubmissionByAssignmentAndStudent(assignmentId: string, studentId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
@@ -1 +1 @@
1
- {"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["models/newtonChat.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOtE;AAED,sDAAsD;AACtD,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQlB;AAED,kFAAkF;AAClF,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAyBf;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
1
+ {"version":3,"file":"newtonChat.d.ts","sourceRoot":"/","sources":["models/newtonChat.ts"],"names":[],"mappings":"AAKA,2CAA2C;AAC3C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOtE;AAED,sDAAsD;AACtD,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQlB;AAED,kFAAkF;AAClF,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAyBf;AAED,wDAAwD;AACxD,wBAAgB,gCAAgC,CAC9C,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EAAE;;;;;;;;;KAQlB"}
@@ -303,6 +303,181 @@ export declare function getSchoolOverview(schoolId: string): import("@prisma/cli
303
303
  subject: string;
304
304
  }[];
305
305
  } | null>;
306
+ export declare function listRecentSchoolMembers(schoolId: string, take?: number): import("@prisma/client/runtime/library.js").PrismaPromise<{
307
+ status: import(".prisma/client").$Enums.SchoolMembershipStatus;
308
+ user: {
309
+ id: string;
310
+ username: string;
311
+ email: string;
312
+ profile: {
313
+ profilePicture: string | null;
314
+ displayName: string | null;
315
+ profilePictureThumbnail: string | null;
316
+ } | null;
317
+ };
318
+ id: string;
319
+ createdAt: Date;
320
+ updatedAt: Date;
321
+ role: import(".prisma/client").$Enums.SchoolMembershipRole;
322
+ }[]>;
323
+ export declare function getSchoolMemberDetail(schoolId: string, memberUserId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
324
+ result: {
325
+ userProfile: {
326
+ profilePicture: () => {
327
+ needs: {
328
+ profilePicture: true;
329
+ };
330
+ compute(profile: {
331
+ profilePicture: string | null;
332
+ }): string | null;
333
+ };
334
+ profilePictureThumbnail: () => {
335
+ needs: {
336
+ profilePictureThumbnail: true;
337
+ };
338
+ compute(profile: {
339
+ profilePictureThumbnail: string | null;
340
+ }): string | null;
341
+ };
342
+ };
343
+ };
344
+ model: {};
345
+ query: {};
346
+ client: {};
347
+ }, {}>, "SchoolMembership", "findUnique", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
348
+ status: import(".prisma/client").$Enums.SchoolMembershipStatus;
349
+ user: {
350
+ id: string;
351
+ username: string;
352
+ email: string;
353
+ profile: {
354
+ profilePicture: string | null;
355
+ displayName: string | null;
356
+ profilePictureThumbnail: string | null;
357
+ } | null;
358
+ };
359
+ id: string;
360
+ createdAt: Date;
361
+ updatedAt: Date;
362
+ role: import(".prisma/client").$Enums.SchoolMembershipRole;
363
+ } | null>;
364
+ export declare function listMemberClasses(schoolId: string, memberUserId: string): Promise<[{
365
+ section: string;
366
+ id: string;
367
+ name: string;
368
+ _count: {
369
+ teachers: number;
370
+ students: number;
371
+ };
372
+ color: string | null;
373
+ subject: string;
374
+ }[], {
375
+ section: string;
376
+ id: string;
377
+ name: string;
378
+ _count: {
379
+ teachers: number;
380
+ students: number;
381
+ };
382
+ color: string | null;
383
+ subject: string;
384
+ }[]]>;
385
+ export declare function findSchoolClass(schoolId: string, classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
386
+ result: {
387
+ userProfile: {
388
+ profilePicture: () => {
389
+ needs: {
390
+ profilePicture: true;
391
+ };
392
+ compute(profile: {
393
+ profilePicture: string | null;
394
+ }): string | null;
395
+ };
396
+ profilePictureThumbnail: () => {
397
+ needs: {
398
+ profilePictureThumbnail: true;
399
+ };
400
+ compute(profile: {
401
+ profilePictureThumbnail: string | null;
402
+ }): string | null;
403
+ };
404
+ };
405
+ };
406
+ model: {};
407
+ query: {};
408
+ client: {};
409
+ }, {}>, "Class", "findFirst", null> & import("@prisma/client/runtime/library.js").PrismaPromise<{
410
+ id: string;
411
+ name: string;
412
+ } | null>;
413
+ export declare function deleteSchoolClassRecord(schoolId: string, classId: string): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
414
+ result: {
415
+ userProfile: {
416
+ profilePicture: () => {
417
+ needs: {
418
+ profilePicture: true;
419
+ };
420
+ compute(profile: {
421
+ profilePicture: string | null;
422
+ }): string | null;
423
+ };
424
+ profilePictureThumbnail: () => {
425
+ needs: {
426
+ profilePictureThumbnail: true;
427
+ };
428
+ compute(profile: {
429
+ profilePictureThumbnail: string | null;
430
+ }): string | null;
431
+ };
432
+ };
433
+ };
434
+ model: {};
435
+ query: {};
436
+ client: {};
437
+ }, {}>, "Class", "delete", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
438
+ id: string;
439
+ }>;
440
+ export declare function updateSchoolClassMembers(classId: string, data: {
441
+ addTeacherIds: string[];
442
+ removeTeacherIds: string[];
443
+ addStudentIds: string[];
444
+ removeStudentIds: string[];
445
+ }): import("@prisma/client/runtime/library.js").DynamicModelExtensionFluentApi<import(".prisma/client").Prisma.TypeMap<import("@prisma/client/runtime/library.js").InternalArgs & {
446
+ result: {
447
+ userProfile: {
448
+ profilePicture: () => {
449
+ needs: {
450
+ profilePicture: true;
451
+ };
452
+ compute(profile: {
453
+ profilePicture: string | null;
454
+ }): string | null;
455
+ };
456
+ profilePictureThumbnail: () => {
457
+ needs: {
458
+ profilePictureThumbnail: true;
459
+ };
460
+ compute(profile: {
461
+ profilePictureThumbnail: string | null;
462
+ }): string | null;
463
+ };
464
+ };
465
+ };
466
+ model: {};
467
+ query: {};
468
+ client: {};
469
+ }, {}>, "Class", "update", never> & import("@prisma/client/runtime/library.js").PrismaPromise<{
470
+ id: string;
471
+ _count: {
472
+ teachers: number;
473
+ students: number;
474
+ };
475
+ }>;
476
+ export declare function listActiveSchoolMemberships(schoolId: string, userIds: string[]): import("@prisma/client/runtime/library.js").PrismaPromise<{
477
+ status: import(".prisma/client").$Enums.SchoolMembershipStatus;
478
+ userId: string;
479
+ role: import(".prisma/client").$Enums.SchoolMembershipRole;
480
+ }[]>;
306
481
  export declare function listSchoolClasses(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<({
307
482
  teachers: {
308
483
  id: string;
@@ -334,6 +509,8 @@ export declare function listSchoolClasses(schoolId: string): import("@prisma/cli
334
509
  discussionsEnabled: boolean;
335
510
  studentsCanCreateDiscussions: boolean;
336
511
  studentsCanReply: boolean;
512
+ treatMissingAsZero: boolean;
513
+ gradeRoundingMode: import(".prisma/client").$Enums.GradeRoundingMode;
337
514
  })[]>;
338
515
  export declare function listSchoolMembers(schoolId: string): import("@prisma/client/runtime/library.js").PrismaPromise<{
339
516
  status: import(".prisma/client").$Enums.SchoolMembershipStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"school.d.ts","sourceRoot":"/","sources":["models/school.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAyBtD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIpE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MA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AM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAM3B;AAED,wBAAgB,uCAAuC,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;GAsBvF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,oBAAoB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;CACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOA;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;KAsBjD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQpE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAKrD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;GAuClE"}
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bd2b1d00-966b-5892-8ade-ebc1e7ff80a1")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5c8e9c5f-dac0-54dd-a99c-d7d124842bf3")}catch(e){}}();
3
3
  import { prisma } from "../lib/prisma.js";
4
4
  const memberSelect = {
5
5
  id: true,
@@ -151,6 +151,79 @@ export function getSchoolOverview(schoolId) {
151
151
  },
152
152
  });
153
153
  }
154
+ export function listRecentSchoolMembers(schoolId, take = 5) {
155
+ return prisma.schoolMembership.findMany({
156
+ where: { schoolId, status: "ACTIVE" },
157
+ select: memberSelect,
158
+ orderBy: { createdAt: "desc" },
159
+ take,
160
+ });
161
+ }
162
+ export function getSchoolMemberDetail(schoolId, memberUserId) {
163
+ return prisma.schoolMembership.findUnique({
164
+ where: { schoolId_userId: { schoolId, userId: memberUserId } },
165
+ select: memberSelect,
166
+ });
167
+ }
168
+ const memberClassSelect = {
169
+ id: true,
170
+ name: true,
171
+ section: true,
172
+ subject: true,
173
+ color: true,
174
+ _count: { select: { teachers: true, students: true } },
175
+ };
176
+ export function listMemberClasses(schoolId, memberUserId) {
177
+ return prisma.$transaction([
178
+ prisma.class.findMany({
179
+ where: { schoolId, teachers: { some: { id: memberUserId } } },
180
+ select: memberClassSelect,
181
+ orderBy: { name: "asc" },
182
+ }),
183
+ prisma.class.findMany({
184
+ where: { schoolId, students: { some: { id: memberUserId } } },
185
+ select: memberClassSelect,
186
+ orderBy: { name: "asc" },
187
+ }),
188
+ ]);
189
+ }
190
+ export function findSchoolClass(schoolId, classId) {
191
+ return prisma.class.findFirst({
192
+ where: { id: classId, schoolId },
193
+ select: { id: true, name: true },
194
+ });
195
+ }
196
+ export function deleteSchoolClassRecord(schoolId, classId) {
197
+ return prisma.class.delete({
198
+ where: { id: classId, schoolId },
199
+ select: { id: true },
200
+ });
201
+ }
202
+ export function updateSchoolClassMembers(classId, data) {
203
+ return prisma.class.update({
204
+ where: { id: classId },
205
+ data: {
206
+ teachers: {
207
+ connect: data.addTeacherIds.map((id) => ({ id })),
208
+ disconnect: data.removeTeacherIds.map((id) => ({ id })),
209
+ },
210
+ students: {
211
+ connect: data.addStudentIds.map((id) => ({ id })),
212
+ disconnect: data.removeStudentIds.map((id) => ({ id })),
213
+ },
214
+ },
215
+ select: {
216
+ id: true,
217
+ _count: { select: { teachers: true, students: true } },
218
+ },
219
+ });
220
+ }
221
+ export function listActiveSchoolMemberships(schoolId, userIds) {
222
+ return prisma.schoolMembership.findMany({
223
+ where: { schoolId, userId: { in: userIds }, status: "ACTIVE" },
224
+ select: { userId: true, role: true, status: true },
225
+ });
226
+ }
154
227
  export function listSchoolClasses(schoolId) {
155
228
  return prisma.class.findMany({
156
229
  where: { schoolId },
@@ -316,4 +389,4 @@ export function acceptSchoolInvite(inviteId, userId) {
316
389
  });
317
390
  }
318
391
  //# sourceMappingURL=school.js.map
319
- //# debugId=bd2b1d00-966b-5892-8ade-ebc1e7ff80a1
392
+ //# debugId=5c8e9c5f-dac0-54dd-a99c-d7d124842bf3