import { Injectable } from '@angular/core';
import { CommonJournalListUiService } from '@common-object-list-ui/billing/journal/common-journal-list-ui.service';
import { IBaseFleioObjectModel } from '@fleio-api/base-model/base-fleio-object.model';
import { IPermissionsModel } from '@fleio-api/base-model/IPermissionsModel';
import { IObjectUIService } from '@objects-view/interfaces/object-ui-service';
import { IJournalEntryModel } from '@fleio-api/billing/model/journal-entry.model';
import { JournalUiService } from './journal-ui.service';

@Injectable({
  providedIn: 'root',
})
export class JournalListUiService extends CommonJournalListUiService {
  getObjectUIService(
    object: IBaseFleioObjectModel, permissions: IPermissionsModel, state: string
  ): IObjectUIService {
    return new JournalUiService(
      object as IJournalEntryModel, permissions, state, this.router, this.config,
      this.journalsApiService, this.matDialog, this.gatewayApiService,
      this.notificationService, this.journalEditTrackerService
    );
  }
}
