import { inject, Injectable } from '@angular/core';
import { HandleCommandService } from '../services';
import {
  FetchReceiptsByOrderItemSubsetIdsInput,
  HandleCommand,
} from '../schemas';

@Injectable()
export class HandleCommandFacade {
  #handleCommandService = inject(HandleCommandService);

  handle(params: HandleCommand) {
    return this.#handleCommandService.handle(params);
  }

  fetchReceiptsByOrderItemSubsetIds(
    params: FetchReceiptsByOrderItemSubsetIdsInput,
    abortSignal?: AbortSignal,
  ) {
    return this.#handleCommandService.fetchReceiptsByOrderItemSubsetIds(
      params,
      abortSignal,
    );
  }
}
