@studious-lms/server 1.1.16 → 1.1.18

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.
@@ -0,0 +1,80 @@
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
+ earlyAccessRequest: import("@trpc/server").TRPCMutationProcedure<{
70
+ input: {
71
+ email: string;
72
+ institutionSize: string;
73
+ };
74
+ output: {
75
+ id: string;
76
+ };
77
+ meta: object;
78
+ }>;
79
+ }>>;
80
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgF1B,CAAC"}
@@ -0,0 +1,82 @@
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().slice(0, 4).toUpperCase();
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
+ earlyAccessRequest: publicProcedure
66
+ .input(z.object({
67
+ email: z.string(),
68
+ institutionSize: z.string(),
69
+ }))
70
+ .mutation(async ({ input }) => {
71
+ const { email, institutionSize } = input;
72
+ const earlyAccessRequest = await prisma.earlyAccessRequest.create({
73
+ data: {
74
+ email,
75
+ institutionSize,
76
+ },
77
+ });
78
+ return {
79
+ id: earlyAccessRequest.id,
80
+ };
81
+ }),
82
+ });
@@ -1 +1 @@
1
- {"version":3,"file":"seedDatabase.d.ts","sourceRoot":"","sources":["../src/seedDatabase.ts"],"names":[],"mappings":"AAIA,wBAAsB,aAAa,kBA2BlC;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,qBA6BxB,CAAC"}
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"}