TEMPORARY FIX TO TEST BUILD
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m15s

This commit is contained in:
2025-04-10 23:18:19 +05:00
parent e8296ae3f6
commit b932fcf03c
49 changed files with 8314 additions and 8858 deletions

View File

@ -1,5 +1,5 @@
import type { Device } from "@prisma/client";
import { atom, createStore } from "jotai";
import type { Device } from "./backend-types";
// Create a single store instance
export const store = createStore();

View File

@ -1,6 +1,6 @@
"use server";
import type { TNationalPerson } from "@/lib/types";
import type { User } from "@prisma/client";
import { User } from "./types/user";
export async function getNationalPerson({
idCard,
@ -18,26 +18,27 @@ export async function getNationalPerson({
}
export async function VerifyUserDetails({ user }: { user: User }) {
const phoneNumber = String(user.phoneNumber).slice(4);
console.log({ phoneNumber });
const nationalData = await getNationalPerson({ idCard: user.id_card ?? "" });
const dob = new Date(nationalData.dob);
const age = new Date().getFullYear() - dob.getFullYear();
console.log(user)
// const phoneNumber = String(user.phoneNumber).slice(4);
// console.log({ phoneNumber });
// const nationalData = await getNationalPerson({ idCard: user.id_card ?? "" });
// const dob = new Date(nationalData.dob);
// const age = new Date().getFullYear() - dob.getFullYear();
console.log("ID card", user.id_card === nationalData.nic);
console.log("name", user.name === nationalData.name_en);
console.log("house", user.address === nationalData.house_name_en);
console.log("phone", phoneNumber === nationalData.primary_contact);
console.log("db phone", phoneNumber);
console.log("national phone", nationalData.primary_contact);
// console.log("ID card", user.id_card === nationalData.nic);
// console.log("name", user.name === nationalData.name_en);
// console.log("house", user.address === nationalData.house_name_en);
// console.log("phone", phoneNumber === nationalData.primary_contact);
// console.log("db phone", phoneNumber);
// console.log("national phone", nationalData.primary_contact);
if (
user.id_card === nationalData.nic &&
user.name === nationalData.name_en &&
user.address === nationalData.house_name_en &&
age >= 18
) {
return true;
}
// if (
// user.id_card === nationalData.nic &&
// user.name === nationalData.name_en &&
// user.address === nationalData.house_name_en &&
// age >= 18
// ) {
// return true;
// }
return false;
}

View File

@ -19,6 +19,10 @@ export interface User {
user_permissions: Permission[];
first_name: string;
last_name: string;
id_card?: string;
address?: string;
verified?: boolean;
dob?: string;
mobile?: string;
wallet_balance?: number;
is_superuser: boolean;