import { type OrderStatus } from '@prisma/client';
import { type OrderEntity } from '../entities/order.entity';

export const ORDER_REPOSITORY = Symbol('ORDER_REPOSITORY');

export interface IOrderRepository {
  findById(id: string): Promise<OrderEntity | null>;
  findByIdempotencyKey(key: string): Promise<OrderEntity | null>;
  findByBuyerId(buyerId: string, options?: {
    status?: OrderStatus;
    limit?: number;
    offset?: number;
  }): Promise<{ items: OrderEntity[]; total: number }>;
  findBySellerId(sellerId: string, options?: {
    status?: OrderStatus;
    limit?: number;
    offset?: number;
  }): Promise<{ items: OrderEntity[]; total: number }>;
  save(order: OrderEntity): Promise<void>;
  update(order: OrderEntity): Promise<void>;
}
