kyc user and upload partial update encrypt nik and picture

This commit is contained in:
2026-04-27 21:48:24 +07:00
parent b31fe675ae
commit a92b4a8fd9
51 changed files with 5180 additions and 452 deletions
+8 -1
View File
@@ -2,7 +2,12 @@ import bcrypt from "bcryptjs";
import { userRepo } from "@/server/repositories/user.repo";
export const authService = {
async register(data: { name: string; email: string; password: string }) {
async register(data: {
name: string;
email: string;
password: string;
acceptedTermsAndPrivacy: boolean;
}) {
const existing = await userRepo.findByEmail(data.email);
if (existing) {
throw new Error("Email sudah terdaftar");
@@ -14,6 +19,8 @@ export const authService = {
name: data.name,
email: data.email,
password: hashedPassword,
acceptedTermsAndPrivacy: data.acceptedTermsAndPrivacy,
acceptedAt: data.acceptedTermsAndPrivacy ? new Date() : null,
});
return { id: user.id, name: user.name, email: user.email };