import { Action } from '@ngrx/store' ; import { KudosPollData , KudosPollGratitude } from './kudos-poll.models' ; export const LOAD_BASIC_DATA = 'kudos poll - load basic data' ; export const LOAD_DYNAMIC_DATA = 'kudos poll - load dynamic data' ; export const SET_DATA = 'kudos poll - set data' ; export const SET_BALANCE = 'kudos poll - set balance' ; export const SET_GRATITUDES = 'kudos poll - set gratitudes' ; export class LoadBasicDataAction implements Action { readonly type = LOAD_BASIC_DATA ; payload : { address : string ; force : boolean ; } ; constructor ( address , force = false ) { this . payload = { address , force } ; } } export class LoadDynamicDataAction implements Action { readonly type = LOAD_DYNAMIC_DATA ; payload : { address : string ; force : boolean ; } ; constructor ( address , force = false ) { this . payload = { address , force } ; } } export class SetPollDataAction implements Action { readonly type = SET_DATA ; payload : { address : string ; type : 'basic' | 'dynamic' | undefined ; data : Partial < KudosPollData > ; } ; constructor ( address , type , data ) { this . payload = { address , type , data } ; } } export class SetBalanceAction implements Action { readonly type = SET_BALANCE ; payload : { address : string ; account : string ; balance : number ; } ; constructor ( address , account , balance ) { this . payload = { address , account , balance } ; } } export class SetGratitudesAction implements Action { readonly type = SET_GRATITUDES ; payload : { address : string ; account : string ; gratitudes : KudosPollGratitude [ ] ; } ; constructor ( address , account , gratitudes ) { this . payload = { address , account , gratitudes } ; } } export type Actions = LoadBasicDataAction | LoadDynamicDataAction | SetPollDataAction | SetBalanceAction | SetGratitudesAction ;