add services interface
This commit is contained in:
parent
44c330fca4
commit
18a7be5c19
|
@ -2,7 +2,8 @@ import { createAdminClient } from "@/app/_utils/supabase/admin";
|
|||
import { createClient } from "@/app/_utils/supabase/client";
|
||||
import { CreateUserParams, InviteUserParams, UpdateUserParams, User, UserResponse } from "@/src/entities/models/users/users.model";
|
||||
import db from "@/prisma/db";
|
||||
import { DatabaseOperationError, NotFoundError, InputParseError, AuthenticationError, UnauthenticatedError, UnauthorizedError } from "@/path/to/custom/errors";
|
||||
import { DatabaseOperationError, NotFoundError } from "../entities/errors/common";
|
||||
import { AuthenticationError } from "../entities/errors/auth";
|
||||
|
||||
export class UsersRepository {
|
||||
private supabaseAdmin = createAdminClient();
|
|
@ -0,0 +1,3 @@
|
|||
export interface ICrashReporterService {
|
||||
report(error: any): string;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
export interface IInstrumentationService {
|
||||
startSpan<T>(
|
||||
options: { name: string; op?: string; attributes?: Record<string, any> },
|
||||
callback: () => T
|
||||
): T;
|
||||
instrumentServerAction<T>(
|
||||
name: string,
|
||||
options: Record<string, any>,
|
||||
callback: () => T
|
||||
): Promise<T>;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import type { ITransaction } from '@/src/entities/models/transaction.interface';
|
||||
|
||||
export interface ITransactionManagerService {
|
||||
startTransaction<T>(
|
||||
clb: (tx: ITransaction) => Promise<T>,
|
||||
parent?: ITransaction
|
||||
): Promise<T>;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
export interface ITransaction {
|
||||
rollback: () => void;
|
||||
}
|
Loading…
Reference in New Issue