import { Injectable, inject } from '@angular/core';
import { CheckoutMetadataService } from '../services/checkout-metadata.service';
import { Branch } from '../schemas/branch.schema';

@Injectable({ providedIn: 'root' })
export class BranchFacade {
  #checkoutMetadataService = inject(CheckoutMetadataService);

  getSelectedBranch(tabId: number): Branch | undefined {
    return this.#checkoutMetadataService.getSelectedBranch(tabId);
  }

  setSelectedBranch(tabId: number, branch: Branch | undefined): void {
    this.#checkoutMetadataService.setSelectedBranch(tabId, branch);
  }
}
