import { Dezrez } from '@dezrez/typings-rezi'; import { IAction } from '@dezrez/core'; import Enum = Dezrez.Core.DataContracts.External.Api.System.EnumDataContract; import LettingsRole = Dezrez.Core.DataContracts.External.Api.Role.Query.Get.Marketing.PropertyLettingRoleDataContract; import Role = Dezrez.Core.DataContracts.External.Api.Role.Query.Get.RoleDataContract; import SetDepositCommand = Dezrez.Core.DataContracts.External.Api.Role.Command.SetDeposit.SetDepositCommandDataContract; import SetInfoCommand = Dezrez.Core.DataContracts.External.Api.Role.Command.SetInfo.SetInfoCommandDataContract; export const ActionTypes = { GET: 'Get role', STORE: 'Store role', UPDATEDEPOSIT: 'Update deposit', UPDATELETTINGSINFO: 'Update lettings info', CLEAR: 'Clear role', }; export class RoleActions { public static store(role: Role): IAction { return { payload: { role }, type: ActionTypes.STORE }; } public static get(id: number): IAction { return { payload: id, type: ActionTypes.GET }; } public static updateDeposit(value: SetDepositCommand): IAction { return { payload: value, type: ActionTypes.UPDATEDEPOSIT }; } public static updateLettingInfo(value: LettingsRole): IAction { return { payload: value, type: ActionTypes.UPDATELETTINGSINFO }; } public static clear(): IAction { return { type: ActionTypes.CLEAR }; } }