WA-238 DailyLimit Record types

This commit is contained in:
apanizo 2018-05-13 13:31:33 +02:00
parent aa93a8301b
commit 3cba259fc1
3 changed files with 19 additions and 14 deletions

View File

@ -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'

View File

@ -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<DailyLimitProps> = Record({
value: 0,
spentToday: 0,
})
export type DailyLimit = RecordOf<DailyLimitProps>

View File

@ -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<DailyLimitProps> = Record({
value: 0,
spentToday: 0,
})
export type DailyLimit = RecordOf<DailyLimitProps>
export type SafeProps = {
name: string,
address: string,
confirmations: number,
owners: List<Owner>,
dailyLimit: number,
dailyLimit: DailyLimit,
}
export const makeSafe: RecordFactory<SafeProps> = Record({