)}
{user && (user.type === "developer" || user.type === "admin") && (
<>
@@ -111,6 +93,7 @@ export default function CodeGenerator({user}: {user: User}) {
)}
>
)}
+
();
@@ -159,7 +160,7 @@ export default function UserList({user, filter}: {user: User; filter?: (user: Us
onClick={() => updateAccountType(row.original, "corporate")}
className="text-sm !py-2 !px-4"
disabled={row.original.type === "corporate" || !PERMISSIONS.generateCode["corporate"].includes(user.type)}>
- Admin
+ Corporate
) as any,
- cell: (info) => capitalize(info.getValue()),
+ cell: (info) => USER_TYPE_LABELS[info.getValue()],
}),
columnHelper.accessor("subscriptionExpirationDate", {
header: (
diff --git a/src/pages/(register)/RegisterCorporate.tsx b/src/pages/(register)/RegisterCorporate.tsx
index 89d1af81..c9ff52f7 100644
--- a/src/pages/(register)/RegisterCorporate.tsx
+++ b/src/pages/(register)/RegisterCorporate.tsx
@@ -68,8 +68,6 @@ export default function RegisterCorporate({isLoading, setIsLoading, mutateUser,
userAmount: companyUsers,
},
referralAgent,
- allowedUserAmount: companyUsers,
- monthlyDuration: subscriptionDuration,
},
})
.then((response) => {
diff --git a/src/pages/api/register.ts b/src/pages/api/register.ts
index 36f5b709..f5b0348f 100644
--- a/src/pages/api/register.ts
+++ b/src/pages/api/register.ts
@@ -67,6 +67,7 @@ async function registerIndividual(req: NextApiRequest, res: NextApiResponse) {
type: codeData.type,
subscriptionExpirationDate: codeData.expiryDate,
registrationDate: new Date(),
+ status: code ? "active" : "paymentDue",
};
await setDoc(doc(db, "users", userId), user);
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 9c0659dc..7160f65e 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -26,6 +26,7 @@ import StudentDashboard from "@/dashboards/Student";
import AdminDashboard from "@/dashboards/Admin";
import CorporateDashboard from "@/dashboards/Corporate";
import TeacherDashboard from "@/dashboards/Teacher";
+import AgentDashboard from "@/dashboards/Agent";
export const getServerSideProps = withIronSessionSsr(({req, res}) => {
const user = req.session.user;
@@ -166,6 +167,7 @@ export default function Home() {
{user.type === "student" &&
}
{user.type === "teacher" &&
}
{user.type === "corporate" &&
}
+ {user.type === "agent" &&
}
{user.type === "admin" &&
}
{user.type === "developer" &&
}
diff --git a/src/pages/manage.tsx b/src/pages/settings.tsx
similarity index 97%
rename from src/pages/manage.tsx
rename to src/pages/settings.tsx
index 42fc5237..bbd43044 100644
--- a/src/pages/manage.tsx
+++ b/src/pages/settings.tsx
@@ -50,7 +50,7 @@ export default function Admin() {
return (
<>
-
Management Panel | EnCoach
+
Settings Panel | EnCoach