Initial Commit

This commit is contained in:
2024-12-19 13:54:15 +05:30
commit 970a972b11
17 changed files with 1487 additions and 0 deletions

18
src/user/user.service.ts Normal file
View File

@@ -0,0 +1,18 @@
import { generateId } from "../utils/id";
import { CreateUserInput, userModel } from "./user.schema";
export async function createUser(input: CreateUserInput) {
const user = await userModel.create({
tenantId: "abc",
pid: generateId(),
createdAt: new Date(),
...input,
});
return user;
}
export async function getUser(userId: string) {
const user = await userModel.findOne({ pid: userId });
return user;
}