mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-13 17:22:37 +02:00
ddd: create users repository
This commit is contained in:
parent
eac001527c
commit
219d4c7901
23 changed files with 220 additions and 134 deletions
|
|
@ -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>>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue