import { Action } from '@ngrx/store';
import { Customer } from 'src/app/models/customer.model';
import { ResultApi } from 'src/app/models/result-api.model';

export enum CustomerSaleActionTypes {
  SELECT_CUSTOMER = '[CUSTOMER] Select Customer',
  SELECT_CUSTOMER_SUCCESS = '[CUSTOMER] Select Customer Success',
  SELECT_CUSTOMER_FAILURE = '[CUSTOMER] Select Customer Failure',
  LOAD_CUSTOMER = '[CUSTOMER] Load Customer',
  LOAD_CUSTOMER_SUCCESS = '[CUSTOMER] Load Customer Success',
  LOAD_CUSTOMER_FAILURE = '[USTOMER] Load Customer Failure',
}


export class SelectCustomerAction implements Action {
  readonly type = CustomerSaleActionTypes.SELECT_CUSTOMER;

  constructor(public payload: Customer) { }
}
export class SelectCustomerSuccessAction implements Action {
  readonly type = CustomerSaleActionTypes.SELECT_CUSTOMER_SUCCESS;

  constructor(public payload: Customer) {}

}
export class SelectCustomerFailureAction implements Action {
  readonly type = CustomerSaleActionTypes.SELECT_CUSTOMER_FAILURE;
  constructor(public payload: Error) {}
}

export class LoadCustomerAction implements Action {
  readonly type = CustomerSaleActionTypes.LOAD_CUSTOMER;
  constructor() {}
}
export class LoadCustomerSuccessAction implements Action {
  readonly type = CustomerSaleActionTypes.LOAD_CUSTOMER_SUCCESS;
  constructor(public payload: Customer) {}

}
export class LoadCustomerFailureAction implements Action {
  readonly type = CustomerSaleActionTypes.LOAD_CUSTOMER_FAILURE;
  constructor(public payload: Error) {}
}



export type CustomerSaleAction = SelectCustomerAction |
  SelectCustomerSuccessAction |
  SelectCustomerFailureAction |
  LoadCustomerAction |
  LoadCustomerSuccessAction |
  LoadCustomerFailureAction;


