import { createActionGroup, emptyProps, props } from '@ngrx/store';
import { CheckIssued, CreateCheckIssued, UpdateCheckIssued } from '../../models/check-issued.model';
import { PaginationMeta } from '../../models/api.model';

export const ChecksIssuedActions = createActionGroup({
  source: 'Checks Issued',
  events: {
    'Load Checks Issued': props<{ page?: number; perPage?: number; forceReload?: boolean }>(),
    'Load Checks Issued Success': props<{ checks: CheckIssued[]; meta: PaginationMeta }>(),
    'Load Checks Issued Failure': props<{ error: string }>(),
    'Create Check Issued': props<{ check: CreateCheckIssued }>(),
    'Create Check Issued Success': props<{ check: CheckIssued }>(),
    'Create Check Issued Failure': props<{ error: string }>(),
    'Update Check Issued': props<{ id: number; check: UpdateCheckIssued }>(),
    'Update Check Issued Success': props<{ check: CheckIssued }>(),
    'Update Check Issued Failure': props<{ error: string }>(),
    'Delete Check Issued': props<{ id: number }>(),
    'Delete Check Issued Success': props<{ id: number }>(),
    'Delete Check Issued Failure': props<{ error: string }>(),
    'Deliver Check Issued': props<{ id: number }>(),
    'Deliver Check Issued Success': props<{ check: CheckIssued }>(),
    'Deliver Check Issued Failure': props<{ error: string }>(),
    'Cash Check Issued': props<{ id: number }>(),
    'Cash Check Issued Success': props<{ check: CheckIssued }>(),
    'Cash Check Issued Failure': props<{ error: string }>(),
    'Cancel Check Issued': props<{ id: number }>(),
    'Cancel Check Issued Success': props<{ check: CheckIssued }>(),
    'Cancel Check Issued Failure': props<{ error: string }>(),
    'Clear Checks Issued Error': emptyProps(),
  },
});
