-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from peaqnetwork/feature/1202839432398962_impl…
…ement-transaction-auto-approval Feature/1202839432398962 implement transaction auto approval
- Loading branch information
Showing
17 changed files
with
527 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,8 @@ enum LoadingStatus { | |
waiting, | ||
authorize, | ||
} | ||
|
||
enum TransactonType { | ||
spent, | ||
refund, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:charmev/common/models/enum.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'dart:convert'; | ||
|
||
part 'transaction.g.dart'; | ||
|
||
String? transactionTypeToString(TransactonType type) => | ||
_$TransactonTypeEnumMap[type]; | ||
|
||
@JsonSerializable(fieldRename: FieldRename.snake) | ||
class CEVTransactionDbModel { | ||
CEVTransactionDbModel({ | ||
required this.id, | ||
required this.data, | ||
required this.progress, | ||
required this.transactionType, | ||
required this.signatory, | ||
required this.date, | ||
}); | ||
|
||
factory CEVTransactionDbModel.fromJson(Map<String, dynamic> json) => | ||
_$CEVTransactionDbModelFromJson(json); | ||
|
||
Map<String, dynamic> toJson() => _$CEVTransactionDbModelToJson(this); | ||
|
||
String id; | ||
String data; | ||
double progress; | ||
String signatory; | ||
TransactonType transactionType; | ||
int date; | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
identical(this, other) || | ||
other is CEVTransactionDbModel && | ||
runtimeType == other.runtimeType && | ||
id == other.id; | ||
|
||
@override | ||
int get hashCode => id.hashCode; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.