54 lines
1.5 KiB
Dart
54 lines
1.5 KiB
Dart
|
|
import 'package:aman_kassa_flutter/core/models/transaction_item.dart';
|
|
|
|
import 'halyk/halyk_close_day_dao.dart';
|
|
|
|
class CloseDayData {
|
|
final String title;
|
|
final num totalAmount;
|
|
final int totalCount;
|
|
final num paymentAmount;
|
|
final int paymentCount;
|
|
final num refundAmount;
|
|
final int refundCount;
|
|
final num cancelAmount;
|
|
final int cancelCount;
|
|
|
|
final List<TransactionBean> items;
|
|
CloseDayData({
|
|
this.title,
|
|
this.items,
|
|
this.totalAmount, this.totalCount,
|
|
this.paymentAmount, this.paymentCount,
|
|
this.refundAmount, this.refundCount,
|
|
this.cancelAmount, this.cancelCount
|
|
});
|
|
|
|
static CloseDayData fromJson(Map<String, dynamic> json) {
|
|
return CloseDayData(
|
|
title: json['title'],
|
|
totalAmount: json['totalAmount'],
|
|
totalCount: json['totalCount'],
|
|
paymentAmount: json['paymentAmount'],
|
|
paymentCount: json['paymentCount'],
|
|
refundAmount: json['refundAmount'],
|
|
refundCount: json['refundCount'],
|
|
cancelAmount: json['cancelAmount'],
|
|
cancelCount: json['cancelCount'],
|
|
items: (json['items'] as List).map((e) => TransactionBean.fromMap(e)).toList(),
|
|
);
|
|
}
|
|
Map<String, dynamic> toJson() =>
|
|
{
|
|
'title': title,
|
|
'totalAmount': totalAmount,
|
|
'totalCount': totalCount,
|
|
'paymentAmount': paymentAmount,
|
|
'paymentCount': paymentCount,
|
|
'refundAmount': refundAmount,
|
|
'refundCount': refundCount,
|
|
'cancelAmount': cancelAmount,
|
|
'cancelCount': cancelCount,
|
|
'items': items.map((e) => e.toJson()).toList(),
|
|
};
|
|
} |