Display used and reserved limits capacity
This commit is contained in:
1 parent
ec43d34b4b
commit
2e81c43091
14 files changed
+287
-5
No files matched your search
@@ -10,6 +10,8 @@ class VisibleLimit {
|
||||
required this.verifiedMinor,
|
||||
required this.currentMinor,
|
||||
required this.remainingMinor,
|
||||
required this.usedMinor,
|
||||
required this.reservedMinor,
|
||||
});
|
||||
final LimitPeriod period;
|
||||
final String currency;
|
||||
@@ -17,6 +19,13 @@ class VisibleLimit {
|
||||
final int verifiedMinor;
|
||||
final int currentMinor;
|
||||
final int remainingMinor;
|
||||
final int usedMinor;
|
||||
final int reservedMinor;
|
||||
|
||||
/// Presentation only: remaining capacity and payment authorization stay server-owned.
|
||||
double get occupiedFraction => currentMinor <= 0
|
||||
? 0
|
||||
: ((usedMinor + reservedMinor) / currentMinor).clamp(0.0, 1.0);
|
||||
}
|
||||
|
||||
class Limits {
|
||||
|
||||
Reference in new issue
Block a user