add services interface

This commit is contained in:
vergiLgood1 2025-03-13 15:25:33 +07:00
parent 44c330fca4
commit 18a7be5c19
6 changed files with 27 additions and 1 deletions

View File

@ -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();

View File

@ -0,0 +1,3 @@
export interface ICrashReporterService {
report(error: any): string;
}

View File

@ -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>;
}

View File

@ -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>;
}

View File

@ -0,0 +1,3 @@
export interface ITransaction {
rollback: () => void;
}