import { Injectable } from '@angular/core';
import { ProductTemplateSyncProvider } from './sync/product-template-sync-provider';
import { ProductAttributeSyncProvider } from './sync/product-attribute-sync-provider';
import { ProductAttributeLineSyncProvider } from './sync/product-attribute-line-sync-provider';
import { ProductAttributeValueSyncProvider } from './sync/product-attribute-value-sync-provider';

@Injectable()    
export class SyncProvider {

    constructor(
        public productTemplateSync: ProductTemplateSyncProvider,
        public productAttributeSync: ProductAttributeSyncProvider, 
        public productAttributeLineSync: ProductAttributeLineSyncProvider,
        public productAttributeValueSync: ProductAttributeValueSyncProvider
    ) { }

    /**
     *
     */
    doSync(): Promise<any> {
        return Promise.all(
            [
                this.productTemplateSync.doSync(),
                this.productAttributeSync.doSync(),
                this.productAttributeLineSync.doSync(),
                this.productAttributeValueSync.doSync()
            ]
        );
    }
}