코드 검토 및 문서 반영
This commit is contained in:
+2
-10
@@ -3,7 +3,7 @@ import { z } from "zod";
|
||||
import { db } from "@/lib/db";
|
||||
import { logger } from "@/lib/logger";
|
||||
import { ApiError } from "@/lib/errors";
|
||||
import { ACTIVATE_STATUSES, ACCOUNT_TYPES } from "@/lib/constants";
|
||||
import { ACTIVATE_STATUSES, PAID_ACCOUNT_TYPE_VALUES } from "@/lib/constants";
|
||||
import type { Prisma } from "@/lib/generated/prisma/client";
|
||||
|
||||
const pageSizeOptions = [10, 20, 50, 100] as const;
|
||||
@@ -104,14 +104,6 @@ export type MaestroDetail = {
|
||||
}>;
|
||||
};
|
||||
|
||||
const paidAccountTypeValues = [
|
||||
ACCOUNT_TYPES.BASIC_20,
|
||||
ACCOUNT_TYPES.STANDARD_50,
|
||||
ACCOUNT_TYPES.PRO_100,
|
||||
ACCOUNT_TYPES.SCHOOL_500,
|
||||
ACCOUNT_TYPES.SCHOOL_1000,
|
||||
] as const;
|
||||
|
||||
const activateStatusValues = [
|
||||
ACTIVATE_STATUSES.PENDING,
|
||||
ACTIVATE_STATUSES.TRIAL,
|
||||
@@ -130,7 +122,7 @@ export const updateMaestroSchema = z.object({
|
||||
accountType: z.coerce
|
||||
.number()
|
||||
.int()
|
||||
.refine((v) => (paidAccountTypeValues as readonly number[]).includes(v))
|
||||
.refine((v) => (PAID_ACCOUNT_TYPE_VALUES as readonly number[]).includes(v))
|
||||
.optional(),
|
||||
availableActivateDateTime: z.string().min(1).optional(),
|
||||
allowEditEnterCode: z.coerce.number().int().min(0).max(1).optional(),
|
||||
|
||||
Reference in New Issue
Block a user