import { createAction, props } from '@ngrx/store';
import { StrictHttpResponse, ResponseArgsOfIEnumerableOfArticleDTO } from '@swagger/eis';
import { ArticleDTO } from './defs';

const prefix = '[Branch] [Task Articles]';

export const getArticles = createAction(`${prefix} Get Articles`, props<{ taskId: number }>());

export const getArticlesRequest = createAction(`${prefix} Get Articles Request`, props<{ taskId: number }>());

export const getArticlesResponse = createAction(
  `${prefix} Get Articles Response`,
  props<{ taskId: number; response: StrictHttpResponse<ResponseArgsOfIEnumerableOfArticleDTO> }>()
);

export const addArticles = createAction(`${prefix} Add Articles`, props<{ taskId: number; articles: ArticleDTO[] }>());

export const clear = createAction(`${prefix} Clear`, props<{ taskId: number }>());

export const clearAll = createAction(`${prefix} Clear All`);
