@@ -68,11 +68,13 @@ data Action
68
68
69
69
data St f = St
70
70
{ stAssets :: [Asset f ],
71
- stPaymentMoney :: Money f ,
71
+ stAssetCurrency :: Currency f ,
72
+ stExchangeRate :: Field Rational f ,
73
+ stExchangeRateAt :: UTCTime ,
74
+ stMerchantCurrency :: Currency f ,
72
75
stMerchantTele :: Field Unicode f ,
73
76
stMerchantFeePercent :: Field Rational f ,
74
77
stOnlineOrOffline :: OnlineOrOffline ,
75
- stDefAssetCurrency :: Currency f ,
76
78
stFavName :: Field Unicode f ,
77
79
stPreview :: Field Unicode f ,
78
80
stScreen :: Screen
@@ -95,20 +97,24 @@ deriving via GenericType (St Identity) instance Binary (St Identity)
95
97
96
98
newSt :: (MonadIO m ) => m (St Unique )
97
99
newSt = do
100
+ assetCur <- newCurrency cny
101
+ rate <- newRatioField 1
102
+ ct <- getCurrentTime
103
+ merchantCur <- newCurrency rub
104
+ tele <- newTextField " Functora"
98
105
fee <- newRatioField 2
99
- paymentMoney <- newMoney 0 rub
100
- defAssetCur <- newCurrency cny
101
106
fav <- newTextField mempty
102
107
pre <- newTextField " Delivery Calculator"
103
- tele <- newTextField " Functora"
104
108
pure
105
109
St
106
110
{ stAssets = mempty ,
107
- stPaymentMoney = paymentMoney,
111
+ stAssetCurrency = assetCur,
112
+ stExchangeRate = rate,
113
+ stExchangeRateAt = ct,
114
+ stMerchantCurrency = merchantCur,
108
115
stMerchantTele = tele,
109
116
stMerchantFeePercent = fee,
110
117
stOnlineOrOffline = Online ,
111
- stDefAssetCurrency = defAssetCur,
112
118
stFavName = fav,
113
119
stPreview = pre & # fieldType .~ FieldTypeTitle ,
114
120
stScreen = Main
@@ -117,8 +123,8 @@ newSt = do
117
123
data Asset f = Asset
118
124
{ assetLink :: Field URI f ,
119
125
assetPhoto :: Field URI f ,
120
- assetPrice :: Money f ,
121
- assetQty :: Field Natural f
126
+ assetPrice :: Field Rational f ,
127
+ assetQty :: Field Rational f
122
128
}
123
129
deriving stock (Generic )
124
130
0 commit comments