backup. before shop update

This commit is contained in:
2021-08-31 13:28:33 -04:00
parent c378a6203c
commit 808ffa3211
292 changed files with 51551 additions and 695 deletions

41
lib/models/coupon.dart Normal file
View File

@@ -0,0 +1,41 @@
import 'dart:convert';
import 'business.dart';
class Coupon {
int id;
String code;
String description;
String expirationDate;
double minAmount;
Business store;
double valueAmount;
bool isPercentage;
Coupon.fromJson(Map<String, dynamic> json)
: id = json['id'],
code = json['code'].toString(),
description = json['description'],
expirationDate = json['expiration_date'],
minAmount = double.parse(json['min_amount'].toString()),
store = json['store'] != null ? Business.fromJson(json['store']) : null,
valueAmount = double.parse(json['value_amount'].toString()),
isPercentage = json['is_percentage'];
Map<String, dynamic> toJson() => {
'id': id,
'code': code,
'description': description,
'expiration_date': expirationDate,
'min_amount': minAmount,
'store': store,
'value_amount': valueAmount,
'is_percentage': isPercentage,
};
@override
String toString() {
return json.encode(this);
}
}