import { createActionGroup, emptyProps, props } from '@ngrx/store';
import { DashboardStats } from '../../models/dashboard.model';
import { Company } from '../../models/auth.model';

export const DashboardActions = createActionGroup({
  source: 'Dashboard',
  events: {
    'Load Dashboard': emptyProps(),
    'Load Dashboard Success': props<{ stats: DashboardStats; company: Company }>(),
    'Load Dashboard Failure': props<{ error: string }>(),
    'Load Company': emptyProps(),
    'Load Company Success': props<{ company: Company }>(),
    'Load Company Failure': props<{ error: string }>(),
    'Update Company': props<{ company: Partial<Company> }>(),
    'Update Company Success': props<{ company: Company }>(),
    'Update Company Failure': props<{ error: string }>(),
    'Clear Dashboard Error': emptyProps(),
  },
});
