From 3cba259fc1d48e7dbca591e9a6eea0a9a1073bf1 Mon Sep 17 00:00:00 2001 From: apanizo Date: Sun, 13 May 2018 13:31:33 +0200 Subject: [PATCH] WA-238 DailyLimit Record types --- src/routes/safe/store/actions/addSafe.js | 3 ++- src/routes/safe/store/model/dailyLimit.js | 15 +++++++++++++++ src/routes/safe/store/model/safe.js | 15 ++------------- 3 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 src/routes/safe/store/model/dailyLimit.js diff --git a/src/routes/safe/store/actions/addSafe.js b/src/routes/safe/store/actions/addSafe.js index d5a3836c..ab7cf916 100644 --- a/src/routes/safe/store/actions/addSafe.js +++ b/src/routes/safe/store/actions/addSafe.js @@ -1,7 +1,8 @@ // @flow import { List } from 'immutable' import { createAction } from 'redux-actions' -import { makeDailyLimit, type DailyLimit, type SafeProps } from '~/routes/safe/store/model/safe' +import { makeDailyLimit, type DailyLimit } from '~/routes/safe/store/model/dailyLimit' +import { type SafeProps } from '~/routes/safe/store/model/safe' import { makeOwner, type Owner } from '~/routes/safe/store/model/owner' export const ADD_SAFE = 'ADD_SAFE' diff --git a/src/routes/safe/store/model/dailyLimit.js b/src/routes/safe/store/model/dailyLimit.js new file mode 100644 index 00000000..2345c243 --- /dev/null +++ b/src/routes/safe/store/model/dailyLimit.js @@ -0,0 +1,15 @@ +// @flow +import { Record } from 'immutable' +import type { RecordFactory, RecordOf } from 'immutable' + +export type DailyLimitProps = { + value: number, + spentToday: number, +} + +export const makeDailyLimit: RecordFactory = Record({ + value: 0, + spentToday: 0, +}) + +export type DailyLimit = RecordOf diff --git a/src/routes/safe/store/model/safe.js b/src/routes/safe/store/model/safe.js index cc9149d8..22e10581 100644 --- a/src/routes/safe/store/model/safe.js +++ b/src/routes/safe/store/model/safe.js @@ -1,26 +1,15 @@ // @flow import { List, Record } from 'immutable' import type { RecordFactory, RecordOf } from 'immutable' +import { type DailyLimit, makeDailyLimit } from '~/routes/safe/store/model/dailyLimit' import type { Owner } from '~/routes/safe/store/model/owner' -export type DailyLimitProps = { - value: number, - spentToday: number, -} - -export const makeDailyLimit: RecordFactory = Record({ - value: 0, - spentToday: 0, -}) - -export type DailyLimit = RecordOf - export type SafeProps = { name: string, address: string, confirmations: number, owners: List, - dailyLimit: number, + dailyLimit: DailyLimit, } export const makeSafe: RecordFactory = Record({