import { createAction, props } from '@ngrx/store';
import {
  BulkInfoRequest,
  StatusBulkInfo,
  StatusNotification,
  StatusRequest,
  StatusResponse,
  MessageUpdateRequest
} from '@ucap-webmessenger/protocol-status';

export const bulkInfo = createAction(
  '[Messenger::Status] Bulk Info',
  props<BulkInfoRequest>()
);

export const bulkInfoSuccess = createAction(
  '[Messenger::Status] Bulk Info Success',
  props<{ statusBulkInfoList: StatusBulkInfo[] }>()
);

export const bulkInfoFailure = createAction(
  '[Messenger::Status] Bulk Info Failure',
  props<{ error: any }>()
);

export const statusNotification = createAction(
  '[Messenger::Status]  Status Notification',
  props<{ noti: StatusNotification }>()
);

export const status = createAction(
  '[Messenger::Status] Status',
  props<{ req: StatusRequest }>()
);
export const statusSuccess = createAction(
  '[Messenger::Status] Status Success',
  props<{
    res: StatusResponse;
  }>()
);
export const statusFailure = createAction(
  '[Messenger::Status] Status Failure',
  props<{ error: any }>()
);

export const changeMyIdleCheckTime = createAction(
  '[Messenger::Status] Change MyIdleCheckTime',
  props<{ checkTime: number }>()
);

export const messageUpdate = createAction(
  '[Messenger::Status] status message update of Others',
  props<MessageUpdateRequest>()
);
export const messageUpdateFailure = createAction(
  '[Messenger::Status] status message update of Others Failure',
  props<{ error: any }>()
);
