import { Context } from '@nuxt/types/app'
import { AnyJson, DataProviderArgs } from '~/types/interfaces'

class BaseProcessor {
  protected arguments!: DataProviderArgs;
  protected ctx!: Context;

  constructor (ctx: Context, args: DataProviderArgs) {
    this.arguments = args
    this.ctx = ctx
  }

  /**
   * Is the given argument a supported model
   * @param _args
   */
  public static support (_args: DataProviderArgs): boolean {
    throw new Error('Not implemented')
  }

  /**
   * Process and return the given data to the Provider
   *
   * @param _data
   */
  // eslint-disable-next-line require-await
  public async process (_data: AnyJson): Promise<any> {
    throw new Error('Not implemented')
  }
}

export default BaseProcessor
