import { createActionGroup, emptyProps, props } from '@ngrx/store';
import { StaffSearch, StaffView } from '../models';

export const StaffsActions = createActionGroup({
  source: 'Staffs',
  events: {
    'Add Staff': props<{ staffId: number }>(),
    'Remove Staff': props<{ staffId: number }>(),
    'Load Staff': props<{criteria: StaffSearch}>(),
  },
});

export const StaffsApiActions = createActionGroup({
  source: 'Staffs API',
  events: {
    'LoadStaffSuccess': props<{ staffs: Array<StaffView>; staffLoad: boolean }>(),
    'LoadStaffFail': props<{ error: string }>(),
  },
});