31 lines
769 B
Dart
31 lines
769 B
Dart
import 'package:flutter_form_bloc/flutter_form_bloc.dart';
|
|
|
|
class Purchase {
|
|
int purchaseId;
|
|
int customerId;
|
|
int productId;
|
|
|
|
DateTime dateAdd;
|
|
double purchaseSum;
|
|
String currency;
|
|
|
|
Purchase.fromJson(Map json) {
|
|
this.purchaseId = json['purchaseId'];
|
|
this.customerId = json['customerId'];
|
|
this.productId = json['productId'];
|
|
this.dateAdd = json['dateAdd'];
|
|
this.purchaseSum = json['purchaseSum'];
|
|
this.customerId = json['currency'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() =>
|
|
{
|
|
"purchaseId": purchaseId,
|
|
"customerId": customerId,
|
|
"productId": productId,
|
|
"purchaseSum": purchaseSum,
|
|
"dateAdd": DateFormat('yyyy-MM-dd HH:mm:ss').format(this.dateAdd),
|
|
"currency": currency,
|
|
};
|
|
}
|