/**
 * Sales Return Module Factory
 * Creates properly configured service instances
 */

import { SalesReturnApplicationService } from '../application/sales-return-application-service';
import { JsonSalesReturnRepository } from './json-sales-return-repository';
import { DefaultSalesReturnAccountingPort } from './default-sales-return-accounting.port';
import { DefaultSalesReturnIdGeneratorPort } from './default-sales-return-id-generator.port';
import { DefaultSalesReturnSideEffectsPort } from './default-sales-return-side-effects.port';
import { DefaultSalesReturnReferenceDataPort } from './default-sales-return-reference-data.port';

export function createSalesReturnService(): SalesReturnApplicationService {
  const repository = new JsonSalesReturnRepository();
  const accounting = new DefaultSalesReturnAccountingPort();
  const sideEffects = new DefaultSalesReturnSideEffectsPort();
  const referenceData = new DefaultSalesReturnReferenceDataPort();
  const idGenerator = new DefaultSalesReturnIdGeneratorPort();

  return SalesReturnApplicationService.createDefault(
    repository,
    accounting,
    sideEffects,
    referenceData,
    idGenerator
  );
}
