ddd: create users repository

This commit is contained in:
Ramnique Singh 2025-08-23 08:15:58 +05:30
parent eac001527c
commit 219d4c7901
23 changed files with 220 additions and 134 deletions

View file

@ -0,0 +1,19 @@
import { z } from "zod";
import { User } from "@/src/entities/models/user";
export const CreateSchema = User.pick({
auth0Id: true,
email: true,
});
export interface IUsersRepository {
create(data: z.infer<typeof CreateSchema>): Promise<z.infer<typeof User>>;
fetch(id: string): Promise<z.infer<typeof User> | null>;
fetchByAuth0Id(auth0Id: string): Promise<z.infer<typeof User> | null>;
updateEmail(id: string, email: string): Promise<z.infer<typeof User>>;
updateBillingCustomerId(id: string, billingCustomerId: string): Promise<z.infer<typeof User>>;
}