import { Action } from '@ngrx/store';

import { Block } from '../../models';

export enum BlockActionType {
    UPSERT_BLOCK = '[@module.class.name@ - Block] Upsert block',
    REMOVE_BLOCK = '[@module.class.name@ - Block] Remove block',
}

export class UpsertBlock implements Action {
    readonly type = BlockActionType.UPSERT_BLOCK;

    constructor(public payload: { block: Block }) {
    }
}

export class RemoveBlock implements Action {
    readonly type = BlockActionType.REMOVE_BLOCK;

    constructor(public payload: { id: string }) {
    }
}

export type BlockActions =
    UpsertBlock |
    RemoveBlock;
