import { Offer } from '../models';
enum ActionKey {
  NAVIGATE_TO_EMPLOYER_OFFER_DETAILS = 'NAV/NAVIGATE_TO_EMPLOYER_OFFER_DETAILS',
  NAVIGATE_TO_OFFER_EDIT_DETAILS = 'NAV/NAVIGATE_TO_OFFER_EDIT_DETAILS',
  NAVIGATE_TO_EMPLOYEE_DETAILS = 'NAV/NAVIGATE_TO_EMPLOYEE_DETAILS',
  NAVIGATE_TO_EMPLOYER_DETAILS = 'NAV/NAVIGATE_TO_EMPLOYER_DETAILS',
}

export type NavigateToEmployerOfferDetails = {
  type: ActionKey.NAVIGATE_TO_EMPLOYER_OFFER_DETAILS;
  offer: Offer;
};
export function navigateToEmployerOfferDetails(offer: Offer): NavigateToEmployerOfferDetails {
  return {
    type: ActionKey.NAVIGATE_TO_EMPLOYER_OFFER_DETAILS,
    offer,
  };
}

export type NavigateToOfferEditDetails = {
  type: ActionKey.NAVIGATE_TO_OFFER_EDIT_DETAILS;
  offer: Offer;
};
export function NavigateToOfferEditDetails(offer: Offer): NavigateToOfferEditDetails {
  return {
    type: ActionKey.NAVIGATE_TO_OFFER_EDIT_DETAILS,
    offer,
  };
}

export type NavigateToEmployeeDetails = {
  type: ActionKey.NAVIGATE_TO_EMPLOYEE_DETAILS;
  employeeId: string;
};
export function navigateToEmployeeDetails(employeeId: string): NavigateToEmployeeDetails {
  return {
    type: ActionKey.NAVIGATE_TO_EMPLOYEE_DETAILS,
    employeeId,
  };
}

export type NavigateToEmployerDetails = {
  type: ActionKey.NAVIGATE_TO_EMPLOYER_DETAILS;
  employerId: string;
};
export function navigateToEmployerDetails(employerId: string): NavigateToEmployerDetails {
  return {
    type: ActionKey.NAVIGATE_TO_EMPLOYER_DETAILS,
    employerId,
  };
}

type ActionType = NavigateToEmployerOfferDetails | NavigateToEmployeeDetails;

export { ActionKey, ActionType };
