create review and profile

This commit is contained in:
arifal
2026-04-20 00:25:05 +07:00
parent 7159e9108f
commit ba5f64ae0e
37 changed files with 3324 additions and 109 deletions
+23
View File
@@ -0,0 +1,23 @@
import { z } from "zod/v4";
import { LIMITS } from "@/lib/limits";
export const upsertReviewSchema = z.object({
tripId: z.string().min(1, "Trip tidak valid"),
rating: z.coerce
.number()
.int("Rating harus bilangan bulat")
.min(1, "Rating minimal 1")
.max(5, "Rating maksimal 5"),
comment: z
.string()
.max(
LIMITS.MAX_REVIEW_COMMENT,
`Komentar maksimal ${LIMITS.MAX_REVIEW_COMMENT} karakter`
)
.transform((s) => {
const t = s.trim();
return t === "" ? undefined : t;
}),
});
export type UpsertReviewInput = z.infer<typeof upsertReviewSchema>;