Skip to content

Commit 5271f54

Browse files
agwoosignalagordn52
authored andcommitted
Merged in feature/WFA-7-reports-api (pull request #2)
Feature/WFA-7 reports api Approved-by: Anthony Gordon <ants52@aol.com>
2 parents ebeedfe + 60758ad commit 5271f54

File tree

8 files changed

+815
-48
lines changed

8 files changed

+815
-48
lines changed

.idea/libraries/Dart_Packages.xml

Lines changed: 162 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/libraries/Flutter_Plugins.xml

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/.flutter-plugins

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# This is a generated file; do not edit or check into version control.
2+
<<<<<<< HEAD
3+
device_info=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\device_info-0.4.2+10\\
4+
path_provider_linux=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\
5+
path_provider_windows=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.4+3\\
6+
shared_preferences=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences-0.5.12+4\\
7+
shared_preferences_linux=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_linux-0.0.2+4\\
8+
shared_preferences_macos=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_macos-0.0.1+6\\
9+
shared_preferences_web=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_web-0.1.2+4\\
10+
shared_preferences_windows=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_windows-0.0.1+3\\
11+
=======
212
device_info=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\device_info-0.4.2+9\\
313
path_provider_linux=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\
414
path_provider_windows=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.4+1\\
@@ -8,3 +18,4 @@ shared_preferences_macos=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\
818
shared_preferences_web=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_web-0.1.2+4\\
919
shared_preferences_windows=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\shared_preferences_windows-0.0.1+1\\
1020
sms_maintained=C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\sms_maintained-0.2.5\\
21+
>>>>>>> ebeedfe9758105ff6c3bed9973070b61b353c5c3
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
import 'dart:convert';
2+
3+
List<SalesReports> salesReportsFromJson(String str) => List<SalesReports>.from(
4+
json.decode(str).map((x) => SalesReports.fromJson(x)));
5+
6+
String salesReportsToJson(List<SalesReports> data) =>
7+
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
8+
9+
class SalesReports {
10+
SalesReports({
11+
this.totalSales,
12+
this.netSales,
13+
this.averageSales,
14+
this.totalOrders,
15+
this.totalItems,
16+
this.totalTax,
17+
this.totalShipping,
18+
this.totalRefunds,
19+
this.totalDiscount,
20+
this.totalsGroupedBy,
21+
this.totals,
22+
this.totalCustomers,
23+
this.links,
24+
});
25+
26+
String totalSales;
27+
String netSales;
28+
String averageSales;
29+
int totalOrders;
30+
int totalItems;
31+
String totalTax;
32+
String totalShipping;
33+
int totalRefunds;
34+
String totalDiscount;
35+
String totalsGroupedBy;
36+
Totals totals;
37+
int totalCustomers;
38+
Links links;
39+
40+
factory SalesReports.fromJson(Map<String, dynamic> json) => SalesReports(
41+
totalSales: json["total_sales"],
42+
netSales: json["net_sales"],
43+
averageSales: json["average_sales"],
44+
totalOrders: json["total_orders"],
45+
totalItems: json["total_items"],
46+
totalTax: json["total_tax"],
47+
totalShipping: json["total_shipping"],
48+
totalRefunds: json["total_refunds"],
49+
totalDiscount: json["total_discount"],
50+
totalsGroupedBy: json["totals_grouped_by"],
51+
totals: Totals.fromJson(json["totals"]),
52+
totalCustomers: json["total_customers"],
53+
links: Links.fromJson(json["_links"]),
54+
);
55+
56+
Map<String, dynamic> toJson() => {
57+
"total_sales": totalSales,
58+
"net_sales": netSales,
59+
"average_sales": averageSales,
60+
"total_orders": totalOrders,
61+
"total_items": totalItems,
62+
"total_tax": totalTax,
63+
"total_shipping": totalShipping,
64+
"total_refunds": totalRefunds,
65+
"total_discount": totalDiscount,
66+
"totals_grouped_by": totalsGroupedBy,
67+
"totals": totals.toJson(),
68+
"total_customers": totalCustomers,
69+
"_links": links.toJson(),
70+
};
71+
}
72+
73+
class Links {
74+
Links({
75+
this.about,
76+
});
77+
78+
List<About> about;
79+
80+
factory Links.fromJson(Map<String, dynamic> json) => Links(
81+
about: List<About>.from(json["about"].map((x) => About.fromJson(x))),
82+
);
83+
84+
Map<String, dynamic> toJson() => {
85+
"about": List<dynamic>.from(about.map((x) => x.toJson())),
86+
};
87+
}
88+
89+
class About {
90+
About({
91+
this.href,
92+
});
93+
94+
String href;
95+
96+
factory About.fromJson(Map<String, dynamic> json) => About(
97+
href: json["href"],
98+
);
99+
100+
Map<String, dynamic> toJson() => {
101+
"href": href,
102+
};
103+
}
104+
105+
class Totals {
106+
Totals({
107+
this.the20201108,
108+
});
109+
110+
The20201108 the20201108;
111+
112+
factory Totals.fromJson(Map<String, dynamic> json) => Totals(
113+
the20201108: The20201108.fromJson(json["2020-11-08"]),
114+
);
115+
116+
Map<String, dynamic> toJson() => {
117+
"2020-11-08": the20201108.toJson(),
118+
};
119+
}
120+
121+
class The20201108 {
122+
The20201108({
123+
this.sales,
124+
this.orders,
125+
this.items,
126+
this.tax,
127+
this.shipping,
128+
this.discount,
129+
this.customers,
130+
});
131+
132+
String sales;
133+
int orders;
134+
int items;
135+
String tax;
136+
String shipping;
137+
String discount;
138+
int customers;
139+
140+
factory The20201108.fromJson(Map<String, dynamic> json) => The20201108(
141+
sales: json["sales"],
142+
orders: json["orders"],
143+
items: json["items"],
144+
tax: json["tax"],
145+
shipping: json["shipping"],
146+
discount: json["discount"],
147+
customers: json["customers"],
148+
);
149+
150+
Map<String, dynamic> toJson() => {
151+
"sales": sales,
152+
"orders": orders,
153+
"items": items,
154+
"tax": tax,
155+
"shipping": shipping,
156+
"discount": discount,
157+
"customers": customers,
158+
};
159+
}

0 commit comments

Comments
 (0)