54 lines
1.4 KiB
Dart
54 lines
1.4 KiB
Dart
const String TransactionTableName = 'transactions';
|
|
const String TransactionColumnId = 'id';
|
|
const String TransactionColumnUuid = 'uuid';
|
|
const String TransactionColumnType = 'type';
|
|
const String TransactionColumnStatus = 'status';
|
|
const String TransactionColumnData = 'data';
|
|
const String TransactionColumnAppCompanyId = 'appCompanyId';
|
|
const String TransactionColumnCreatedAt = 'createdAt';
|
|
|
|
const int TransactionTypeSell = 1;
|
|
const int TransactionTypeBuy = 2;
|
|
|
|
const int TransactionStatusPrepare = 0;
|
|
|
|
|
|
class Transaction {
|
|
int? id;
|
|
String? uuid;
|
|
int? type;
|
|
int? status;
|
|
String? data;
|
|
int? appCompanyId;
|
|
String? createdAt;
|
|
|
|
Map<String, dynamic> toMap() {
|
|
var map = <String, dynamic>{
|
|
TransactionColumnUuid: uuid,
|
|
TransactionColumnType: type,
|
|
TransactionColumnStatus: status,
|
|
TransactionColumnData: data,
|
|
TransactionColumnAppCompanyId: appCompanyId,
|
|
TransactionColumnCreatedAt: createdAt,
|
|
};
|
|
if (id != null) {
|
|
map[TransactionColumnId] = id;
|
|
}
|
|
return map;
|
|
}
|
|
|
|
Transaction();
|
|
|
|
Transaction.fromMap(Map<String, dynamic> map) {
|
|
id = map[TransactionColumnId];
|
|
uuid = map[TransactionColumnUuid];
|
|
type = map[TransactionColumnType];
|
|
status = map[TransactionColumnStatus];
|
|
appCompanyId = map[TransactionColumnAppCompanyId];
|
|
data = map[TransactionColumnData];
|
|
createdAt = map[TransactionColumnCreatedAt];
|
|
}
|
|
|
|
}
|
|
|