import { inject, Injectable } from '@angular/core';
import { OrderRewardCollectService } from '../services';
import {
  FetchOrderItemSubsetSchemaInput,
  OrderLoyaltyCollectInput,
} from '../schemas';

@Injectable({ providedIn: 'root' })
export class OrderRewardCollectFacade {
  #orderRewardCollectService = inject(OrderRewardCollectService);

  async collect(params: OrderLoyaltyCollectInput) {
    return this.#orderRewardCollectService.collect(params);
  }

  async getOrderItemSubset(
    params: FetchOrderItemSubsetSchemaInput,
    abortSignal?: AbortSignal,
  ) {
    return this.#orderRewardCollectService.fetchOrderItemSubset(
      params,
      abortSignal,
    );
  }
}
