53 lines
1.3 KiB
Dart
53 lines
1.3 KiB
Dart
import 'package:objectbox/objectbox.dart';
|
|
|
|
@Entity()
|
|
class SessionStatus {
|
|
@Id()
|
|
int id = 0;
|
|
|
|
late int custId;
|
|
late int hqId;
|
|
late int usrId;
|
|
late int crId;
|
|
late String sid;
|
|
late int vhtId;
|
|
late String locZip;
|
|
late String serverVersion;
|
|
late String serverInstance;
|
|
bool bwvEnabled = false;
|
|
|
|
SessionStatus();
|
|
|
|
factory SessionStatus.fromJson(Map<String, dynamic> json) {
|
|
final status = SessionStatus();
|
|
status.id = json['id'] as int? ?? 0;
|
|
status.custId = json['cust_id'] as int;
|
|
status.hqId = json['hq_id'] as int;
|
|
status.usrId = json['usr_id'] as int;
|
|
status.crId = json['cr_id'] as int;
|
|
status.sid = json['sid'] as String;
|
|
status.vhtId = json['vht_id'] as int;
|
|
status.locZip = json['loc_zip'] as String;
|
|
status.serverVersion = json['server_version'] as String;
|
|
status.serverInstance = json['server_instance'] as String;
|
|
status.bwvEnabled = json['bwv'] as bool? ?? false;
|
|
return status;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'cust_id': custId,
|
|
'hq_id': hqId,
|
|
'usr_id': usrId,
|
|
'cr_id': crId,
|
|
'sid': sid,
|
|
'vht_id': vhtId,
|
|
'loc_zip': locZip,
|
|
'server_version': serverVersion,
|
|
'server_instance': serverInstance,
|
|
'bwv': bwvEnabled,
|
|
};
|
|
}
|
|
}
|