/* tslint:disable */
import { NgModule, ModuleWithProviders } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { OmsConfiguration, OmsConfigurationInterface } from './oms-configuration';

import { AbholfachService } from './services/abholfach.service';
import { OrderCheckoutService } from './services/order-checkout.service';
import { OrderService } from './services/order.service';
import { ReceiptService } from './services/receipt.service';

/**
 * Provider for all Oms services, plus OmsConfiguration
 */
@NgModule({
  imports: [
    HttpClientModule
  ],
  exports: [
    HttpClientModule
  ],
  declarations: [],
  providers: [
    OmsConfiguration,
    AbholfachService,
    OrderCheckoutService,
    OrderService,
    ReceiptService
  ],
})
export class OmsModule {
  static forRoot(customParams: OmsConfigurationInterface): ModuleWithProviders<OmsModule> {
    return {
      ngModule: OmsModule,
      providers: [
        {
          provide: OmsConfiguration,
          useValue: {rootUrl: customParams.rootUrl}
        }
      ]
    }
  }
}
