@studious-lms/server 1.1.16 → 1.1.17
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/lib/jsonConversion.d.ts.map +1 -1
- package/dist/lib/jsonConversion.js +290 -124
- package/dist/routers/_app.d.ts +170 -0
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/_app.js +2 -0
- package/dist/routers/assignment.d.ts +15 -0
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/file.d.ts +2 -0
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/labChat.js +2 -1
- package/dist/routers/marketing.d.ts +70 -0
- package/dist/routers/marketing.d.ts.map +1 -0
- package/dist/routers/marketing.js +65 -0
- package/dist/seedDatabase.d.ts.map +1 -1
- package/dist/seedDatabase.js +1459 -24
- package/dist/utils/inference.js +2 -2
- package/package.json +2 -1
- package/prisma/schema.prisma +30 -0
- package/src/lib/NotoSans-Bold.ttf +0 -0
- package/src/lib/NotoSans-Italic.ttf +0 -0
- package/src/lib/NotoSans-Regular.ttf +0 -0
- package/src/lib/jsonConversion.ts +346 -135
- package/src/routers/_app.ts +2 -0
- package/src/routers/labChat.ts +4 -1
- package/src/routers/marketing.ts +69 -0
- package/src/seedDatabase.ts +1512 -21
- package/src/utils/inference.ts +2 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const marketingRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
3
|
+
ctx: import("../trpc.js").Context;
|
|
4
|
+
meta: object;
|
|
5
|
+
errorShape: {
|
|
6
|
+
data: {
|
|
7
|
+
zodError: z.typeToFlattenedError<any, string> | null;
|
|
8
|
+
prismaError: import("../utils/prismaErrorHandler.js").PrismaErrorInfo | null;
|
|
9
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
10
|
+
httpStatus: number;
|
|
11
|
+
path?: string;
|
|
12
|
+
stack?: string;
|
|
13
|
+
};
|
|
14
|
+
message: string;
|
|
15
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
16
|
+
};
|
|
17
|
+
transformer: false;
|
|
18
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
19
|
+
createSchoolDevelopementProgram: import("@trpc/server").TRPCMutationProcedure<{
|
|
20
|
+
input: {
|
|
21
|
+
type: string;
|
|
22
|
+
name: string;
|
|
23
|
+
address: string;
|
|
24
|
+
city: string;
|
|
25
|
+
country: string;
|
|
26
|
+
numberOfStudents: number;
|
|
27
|
+
numberOfTeachers: number;
|
|
28
|
+
website?: string | undefined;
|
|
29
|
+
contactName?: string | undefined;
|
|
30
|
+
contactRole?: string | undefined;
|
|
31
|
+
contactEmail?: string | undefined;
|
|
32
|
+
contactPhone?: string | undefined;
|
|
33
|
+
eligibilityInformation?: string | undefined;
|
|
34
|
+
whyHelp?: string | undefined;
|
|
35
|
+
additionalInformation?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
output: {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
meta: object;
|
|
41
|
+
}>;
|
|
42
|
+
searchSchoolDevelopementPrograms: import("@trpc/server").TRPCQueryProcedure<{
|
|
43
|
+
input: {
|
|
44
|
+
id: string;
|
|
45
|
+
};
|
|
46
|
+
output: {
|
|
47
|
+
type: string;
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
status: string;
|
|
51
|
+
website: string | null;
|
|
52
|
+
submittedAt: Date | null;
|
|
53
|
+
address: string;
|
|
54
|
+
city: string;
|
|
55
|
+
country: string;
|
|
56
|
+
numberOfStudents: number;
|
|
57
|
+
numberOfTeachers: number;
|
|
58
|
+
contactName: string | null;
|
|
59
|
+
contactRole: string | null;
|
|
60
|
+
contactEmail: string | null;
|
|
61
|
+
contactPhone: string | null;
|
|
62
|
+
eligibilityInformation: string | null;
|
|
63
|
+
whyHelp: string | null;
|
|
64
|
+
additionalInformation: string | null;
|
|
65
|
+
reviewedAt: Date | null;
|
|
66
|
+
} | null;
|
|
67
|
+
meta: object;
|
|
68
|
+
}>;
|
|
69
|
+
}>>;
|
|
70
|
+
//# sourceMappingURL=marketing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketing.d.ts","sourceRoot":"","sources":["../../src/routers/marketing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+D1B,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { createTRPCRouter, publicProcedure } from "../trpc.js";
|
|
3
|
+
import { prisma } from "../lib/prisma.js";
|
|
4
|
+
import { v4 } from "uuid";
|
|
5
|
+
export const marketingRouter = createTRPCRouter({
|
|
6
|
+
createSchoolDevelopementProgram: publicProcedure
|
|
7
|
+
.input(z.object({
|
|
8
|
+
name: z.string(),
|
|
9
|
+
type: z.string(),
|
|
10
|
+
address: z.string(),
|
|
11
|
+
city: z.string(),
|
|
12
|
+
country: z.string(),
|
|
13
|
+
numberOfStudents: z.number(),
|
|
14
|
+
numberOfTeachers: z.number(),
|
|
15
|
+
website: z.string().optional(),
|
|
16
|
+
contactName: z.string().optional(),
|
|
17
|
+
contactRole: z.string().optional(),
|
|
18
|
+
contactEmail: z.string().optional(),
|
|
19
|
+
contactPhone: z.string().optional(),
|
|
20
|
+
eligibilityInformation: z.string().optional(),
|
|
21
|
+
whyHelp: z.string().optional(),
|
|
22
|
+
additionalInformation: z.string().optional(),
|
|
23
|
+
}))
|
|
24
|
+
.mutation(async ({ ctx, input }) => {
|
|
25
|
+
const { name, type, address, city, country, numberOfStudents, numberOfTeachers, website, contactName, contactRole, contactEmail, contactPhone, eligibilityInformation, whyHelp, additionalInformation } = input;
|
|
26
|
+
const date = new Date();
|
|
27
|
+
const id = name.slice(0, 3).toUpperCase() + date.getFullYear() + '-' + v4();
|
|
28
|
+
const schoolDevelopementProgram = await prisma.schoolDevelopementProgram.create({
|
|
29
|
+
data: {
|
|
30
|
+
id,
|
|
31
|
+
name,
|
|
32
|
+
type,
|
|
33
|
+
address,
|
|
34
|
+
city,
|
|
35
|
+
country,
|
|
36
|
+
numberOfStudents,
|
|
37
|
+
numberOfTeachers,
|
|
38
|
+
website,
|
|
39
|
+
contactName,
|
|
40
|
+
contactRole,
|
|
41
|
+
contactEmail,
|
|
42
|
+
contactPhone,
|
|
43
|
+
eligibilityInformation,
|
|
44
|
+
whyHelp,
|
|
45
|
+
additionalInformation,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
id: schoolDevelopementProgram.id,
|
|
50
|
+
};
|
|
51
|
+
}),
|
|
52
|
+
searchSchoolDevelopementPrograms: publicProcedure
|
|
53
|
+
.input(z.object({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
}))
|
|
56
|
+
.query(async ({ input }) => {
|
|
57
|
+
const { id } = input;
|
|
58
|
+
const schoolDevelopementProgram = await prisma.schoolDevelopementProgram.findUnique({
|
|
59
|
+
where: {
|
|
60
|
+
id,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
return schoolDevelopementProgram;
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedDatabase.d.ts","sourceRoot":"","sources":["../src/seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,
|
|
1
|
+
{"version":3,"file":"seedDatabase.d.ts","sourceRoot":"","sources":["../src/seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,kBAsClC;AAED,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;GAOjF;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;GAQnF;AAED,eAAO,MAAM,YAAY,qBAq+CxB,CAAC"}
|