import { IIntegration } from "@ax/types";
import { SET_CURRENT_INTEGRATION, SET_INTEGRATIONS, SET_TOTAL_ITEMS, SET_COPY_INTEGRATION } from "./constants";

export interface ISetIntegrations {
	type: typeof SET_INTEGRATIONS;
	payload: { integrations: IIntegration[] };
}

export interface ISetTotalItems {
	type: typeof SET_TOTAL_ITEMS;
	payload: { totalItems: number };
}

export interface ISetCurrentIntegration {
	type: typeof SET_CURRENT_INTEGRATION;
	payload: { currentIntegration: IIntegration | null };
}

export interface ISetCopyIntegration {
	type: typeof SET_COPY_INTEGRATION;
	payload: { integrationCopy: { date: Date; integration: Partial<IIntegration> } | null };
}

export type IntegrationsActionsCreators =
	| ISetIntegrations
	| ISetTotalItems
	| ISetCurrentIntegration
	| ISetCopyIntegration;
