|
@@ -12,10 +12,19 @@ ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(
|
|
|
if (sn != null) {
|
|
|
serviceOrderDetailEntity.sn = sn;
|
|
|
}
|
|
|
- final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
|
|
|
+ final int? totalAmount = jsonConvert.convert<int>(json['total_amount']);
|
|
|
if (totalAmount != null) {
|
|
|
serviceOrderDetailEntity.totalAmount = totalAmount;
|
|
|
}
|
|
|
+ final int? orderStatus = jsonConvert.convert<int>(json['order_status']);
|
|
|
+ if (orderStatus != null) {
|
|
|
+ serviceOrderDetailEntity.orderStatus = orderStatus;
|
|
|
+ }
|
|
|
+ final String? cancelStatus = jsonConvert.convert<String>(
|
|
|
+ json['cancel_status']);
|
|
|
+ if (cancelStatus != null) {
|
|
|
+ serviceOrderDetailEntity.cancelStatus = cancelStatus;
|
|
|
+ }
|
|
|
final String? paidAt = jsonConvert.convert<String>(json['paid_at']);
|
|
|
if (paidAt != null) {
|
|
|
serviceOrderDetailEntity.paidAt = paidAt;
|
|
@@ -63,6 +72,11 @@ ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(
|
|
|
if (estateUnit != null) {
|
|
|
serviceOrderDetailEntity.estateUnit = estateUnit;
|
|
|
}
|
|
|
+ final ServiceOrderDetailOrder? order = jsonConvert.convert<
|
|
|
+ ServiceOrderDetailOrder>(json['order']);
|
|
|
+ if (order != null) {
|
|
|
+ serviceOrderDetailEntity.order = order;
|
|
|
+ }
|
|
|
return serviceOrderDetailEntity;
|
|
|
}
|
|
|
|
|
@@ -72,6 +86,8 @@ Map<String, dynamic> $ServiceOrderDetailEntityToJson(
|
|
|
data['id'] = entity.id;
|
|
|
data['sn'] = entity.sn;
|
|
|
data['total_amount'] = entity.totalAmount;
|
|
|
+ data['order_status'] = entity.orderStatus;
|
|
|
+ data['cancel_status'] = entity.cancelStatus;
|
|
|
data['paid_at'] = entity.paidAt;
|
|
|
data['notes'] = entity.notes;
|
|
|
data['account'] = entity.account?.toJson();
|
|
@@ -82,6 +98,7 @@ Map<String, dynamic> $ServiceOrderDetailEntityToJson(
|
|
|
entity.orderProducts?.map((v) => v.toJson()).toList();
|
|
|
data['estate'] = entity.estate?.toJson();
|
|
|
data['estate_unit'] = entity.estateUnit?.toJson();
|
|
|
+ data['order'] = entity.order?.toJson();
|
|
|
return data;
|
|
|
}
|
|
|
|
|
@@ -89,7 +106,9 @@ extension ServiceOrderDetailEntityExtension on ServiceOrderDetailEntity {
|
|
|
ServiceOrderDetailEntity copyWith({
|
|
|
String? id,
|
|
|
String? sn,
|
|
|
- String? totalAmount,
|
|
|
+ int? totalAmount,
|
|
|
+ int? orderStatus,
|
|
|
+ String? cancelStatus,
|
|
|
String? paidAt,
|
|
|
String? notes,
|
|
|
ServiceOrderDetailAccount? account,
|
|
@@ -99,11 +118,14 @@ extension ServiceOrderDetailEntityExtension on ServiceOrderDetailEntity {
|
|
|
List<ServiceOrderDetailOrderProducts>? orderProducts,
|
|
|
ServiceOrderDetailEstate? estate,
|
|
|
ServiceOrderDetailEstateUnit? estateUnit,
|
|
|
+ ServiceOrderDetailOrder? order,
|
|
|
}) {
|
|
|
return ServiceOrderDetailEntity()
|
|
|
..id = id ?? this.id
|
|
|
..sn = sn ?? this.sn
|
|
|
..totalAmount = totalAmount ?? this.totalAmount
|
|
|
+ ..orderStatus = orderStatus ?? this.orderStatus
|
|
|
+ ..cancelStatus = cancelStatus ?? this.cancelStatus
|
|
|
..paidAt = paidAt ?? this.paidAt
|
|
|
..notes = notes ?? this.notes
|
|
|
..account = account ?? this.account
|
|
@@ -112,14 +134,15 @@ extension ServiceOrderDetailEntityExtension on ServiceOrderDetailEntity {
|
|
|
..staff = staff ?? this.staff
|
|
|
..orderProducts = orderProducts ?? this.orderProducts
|
|
|
..estate = estate ?? this.estate
|
|
|
- ..estateUnit = estateUnit ?? this.estateUnit;
|
|
|
+ ..estateUnit = estateUnit ?? this.estateUnit
|
|
|
+ ..order = order ?? this.order;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ServiceOrderDetailAccount $ServiceOrderDetailAccountFromJson(
|
|
|
Map<String, dynamic> json) {
|
|
|
final ServiceOrderDetailAccount serviceOrderDetailAccount = ServiceOrderDetailAccount();
|
|
|
- final int? id = jsonConvert.convert<int>(json['id']);
|
|
|
+ final String? id = jsonConvert.convert<String>(json['id']);
|
|
|
if (id != null) {
|
|
|
serviceOrderDetailAccount.id = id;
|
|
|
}
|
|
@@ -150,7 +173,7 @@ Map<String, dynamic> $ServiceOrderDetailAccountToJson(
|
|
|
|
|
|
extension ServiceOrderDetailAccountExtension on ServiceOrderDetailAccount {
|
|
|
ServiceOrderDetailAccount copyWith({
|
|
|
- int? id,
|
|
|
+ String? id,
|
|
|
String? name,
|
|
|
String? avatar,
|
|
|
String? phone,
|
|
@@ -166,7 +189,7 @@ extension ServiceOrderDetailAccountExtension on ServiceOrderDetailAccount {
|
|
|
ServiceOrderDetailOrderService $ServiceOrderDetailOrderServiceFromJson(
|
|
|
Map<String, dynamic> json) {
|
|
|
final ServiceOrderDetailOrderService serviceOrderDetailOrderService = ServiceOrderDetailOrderService();
|
|
|
- final int? id = jsonConvert.convert<int>(json['id']);
|
|
|
+ final String? id = jsonConvert.convert<String>(json['id']);
|
|
|
if (id != null) {
|
|
|
serviceOrderDetailOrderService.id = id;
|
|
|
}
|
|
@@ -174,7 +197,7 @@ ServiceOrderDetailOrderService $ServiceOrderDetailOrderServiceFromJson(
|
|
|
if (name != null) {
|
|
|
serviceOrderDetailOrderService.name = name;
|
|
|
}
|
|
|
- final double? evaluationsAvgScore = jsonConvert.convert<double>(
|
|
|
+ final int? evaluationsAvgScore = jsonConvert.convert<int>(
|
|
|
json['evaluations_avg_score']);
|
|
|
if (evaluationsAvgScore != null) {
|
|
|
serviceOrderDetailOrderService.evaluationsAvgScore = evaluationsAvgScore;
|
|
@@ -193,9 +216,9 @@ Map<String, dynamic> $ServiceOrderDetailOrderServiceToJson(
|
|
|
|
|
|
extension ServiceOrderDetailOrderServiceExtension on ServiceOrderDetailOrderService {
|
|
|
ServiceOrderDetailOrderService copyWith({
|
|
|
- int? id,
|
|
|
+ String? id,
|
|
|
String? name,
|
|
|
- double? evaluationsAvgScore,
|
|
|
+ int? evaluationsAvgScore,
|
|
|
}) {
|
|
|
return ServiceOrderDetailOrderService()
|
|
|
..id = id ?? this.id
|
|
@@ -296,30 +319,11 @@ ServiceOrderDetailOrderProducts $ServiceOrderDetailOrderProductsFromJson(
|
|
|
if (productName != null) {
|
|
|
serviceOrderDetailOrderProducts.productName = productName;
|
|
|
}
|
|
|
- final String? productAmount = jsonConvert.convert<String>(
|
|
|
- json['product_amount']);
|
|
|
- if (productAmount != null) {
|
|
|
- serviceOrderDetailOrderProducts.productAmount = productAmount;
|
|
|
- }
|
|
|
- final String? urgentAmount = jsonConvert.convert<String>(
|
|
|
- json['urgent_amount']);
|
|
|
- if (urgentAmount != null) {
|
|
|
- serviceOrderDetailOrderProducts.urgentAmount = urgentAmount;
|
|
|
- }
|
|
|
- final String? holidayAmount = jsonConvert.convert<String>(
|
|
|
- json['holiday_amount']);
|
|
|
- if (holidayAmount != null) {
|
|
|
- serviceOrderDetailOrderProducts.holidayAmount = holidayAmount;
|
|
|
- }
|
|
|
- final String? nightAmount = jsonConvert.convert<String>(json['night_amount']);
|
|
|
- if (nightAmount != null) {
|
|
|
- serviceOrderDetailOrderProducts.nightAmount = nightAmount;
|
|
|
- }
|
|
|
final int? quantity = jsonConvert.convert<int>(json['quantity']);
|
|
|
if (quantity != null) {
|
|
|
serviceOrderDetailOrderProducts.quantity = quantity;
|
|
|
}
|
|
|
- final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
|
|
|
+ final int? totalAmount = jsonConvert.convert<int>(json['total_amount']);
|
|
|
if (totalAmount != null) {
|
|
|
serviceOrderDetailOrderProducts.totalAmount = totalAmount;
|
|
|
}
|
|
@@ -336,10 +340,6 @@ Map<String, dynamic> $ServiceOrderDetailOrderProductsToJson(
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
data['id'] = entity.id;
|
|
|
data['product_name'] = entity.productName;
|
|
|
- data['product_amount'] = entity.productAmount;
|
|
|
- data['urgent_amount'] = entity.urgentAmount;
|
|
|
- data['holiday_amount'] = entity.holidayAmount;
|
|
|
- data['night_amount'] = entity.nightAmount;
|
|
|
data['quantity'] = entity.quantity;
|
|
|
data['total_amount'] = entity.totalAmount;
|
|
|
data['planned_service_at'] = entity.plannedServiceAt;
|
|
@@ -350,21 +350,13 @@ extension ServiceOrderDetailOrderProductsExtension on ServiceOrderDetailOrderPro
|
|
|
ServiceOrderDetailOrderProducts copyWith({
|
|
|
String? id,
|
|
|
String? productName,
|
|
|
- String? productAmount,
|
|
|
- String? urgentAmount,
|
|
|
- String? holidayAmount,
|
|
|
- String? nightAmount,
|
|
|
int? quantity,
|
|
|
- String? totalAmount,
|
|
|
+ int? totalAmount,
|
|
|
String? plannedServiceAt,
|
|
|
}) {
|
|
|
return ServiceOrderDetailOrderProducts()
|
|
|
..id = id ?? this.id
|
|
|
..productName = productName ?? this.productName
|
|
|
- ..productAmount = productAmount ?? this.productAmount
|
|
|
- ..urgentAmount = urgentAmount ?? this.urgentAmount
|
|
|
- ..holidayAmount = holidayAmount ?? this.holidayAmount
|
|
|
- ..nightAmount = nightAmount ?? this.nightAmount
|
|
|
..quantity = quantity ?? this.quantity
|
|
|
..totalAmount = totalAmount ?? this.totalAmount
|
|
|
..plannedServiceAt = plannedServiceAt ?? this.plannedServiceAt;
|
|
@@ -442,4 +434,80 @@ extension ServiceOrderDetailEstateUnitExtension on ServiceOrderDetailEstateUnit
|
|
|
..unit = unit ?? this.unit
|
|
|
..address = address ?? this.address;
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+ServiceOrderDetailOrder $ServiceOrderDetailOrderFromJson(
|
|
|
+ Map<String, dynamic> json) {
|
|
|
+ final ServiceOrderDetailOrder serviceOrderDetailOrder = ServiceOrderDetailOrder();
|
|
|
+ final int? id = jsonConvert.convert<int>(json['id']);
|
|
|
+ if (id != null) {
|
|
|
+ serviceOrderDetailOrder.id = id;
|
|
|
+ }
|
|
|
+ final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
|
|
|
+ if (totalAmount != null) {
|
|
|
+ serviceOrderDetailOrder.totalAmount = totalAmount;
|
|
|
+ }
|
|
|
+ final String? orderAmount = jsonConvert.convert<String>(json['order_amount']);
|
|
|
+ if (orderAmount != null) {
|
|
|
+ serviceOrderDetailOrder.orderAmount = orderAmount;
|
|
|
+ }
|
|
|
+ final String? depositAmount = jsonConvert.convert<String>(
|
|
|
+ json['deposit_amount']);
|
|
|
+ if (depositAmount != null) {
|
|
|
+ serviceOrderDetailOrder.depositAmount = depositAmount;
|
|
|
+ }
|
|
|
+ final int? paymentStatus = jsonConvert.convert<int>(json['payment_status']);
|
|
|
+ if (paymentStatus != null) {
|
|
|
+ serviceOrderDetailOrder.paymentStatus = paymentStatus;
|
|
|
+ }
|
|
|
+ final String? paidAt = jsonConvert.convert<String>(json['paid_at']);
|
|
|
+ if (paidAt != null) {
|
|
|
+ serviceOrderDetailOrder.paidAt = paidAt;
|
|
|
+ }
|
|
|
+ final int? refundStatus = jsonConvert.convert<int>(json['refund_status']);
|
|
|
+ if (refundStatus != null) {
|
|
|
+ serviceOrderDetailOrder.refundStatus = refundStatus;
|
|
|
+ }
|
|
|
+ final String? refundedAt = jsonConvert.convert<String>(json['refunded_at']);
|
|
|
+ if (refundedAt != null) {
|
|
|
+ serviceOrderDetailOrder.refundedAt = refundedAt;
|
|
|
+ }
|
|
|
+ return serviceOrderDetailOrder;
|
|
|
+}
|
|
|
+
|
|
|
+Map<String, dynamic> $ServiceOrderDetailOrderToJson(
|
|
|
+ ServiceOrderDetailOrder entity) {
|
|
|
+ final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
+ data['id'] = entity.id;
|
|
|
+ data['total_amount'] = entity.totalAmount;
|
|
|
+ data['order_amount'] = entity.orderAmount;
|
|
|
+ data['deposit_amount'] = entity.depositAmount;
|
|
|
+ data['payment_status'] = entity.paymentStatus;
|
|
|
+ data['paid_at'] = entity.paidAt;
|
|
|
+ data['refund_status'] = entity.refundStatus;
|
|
|
+ data['refunded_at'] = entity.refundedAt;
|
|
|
+ return data;
|
|
|
+}
|
|
|
+
|
|
|
+extension ServiceOrderDetailOrderExtension on ServiceOrderDetailOrder {
|
|
|
+ ServiceOrderDetailOrder copyWith({
|
|
|
+ int? id,
|
|
|
+ String? totalAmount,
|
|
|
+ String? orderAmount,
|
|
|
+ String? depositAmount,
|
|
|
+ int? paymentStatus,
|
|
|
+ String? paidAt,
|
|
|
+ int? refundStatus,
|
|
|
+ String? refundedAt,
|
|
|
+ }) {
|
|
|
+ return ServiceOrderDetailOrder()
|
|
|
+ ..id = id ?? this.id
|
|
|
+ ..totalAmount = totalAmount ?? this.totalAmount
|
|
|
+ ..orderAmount = orderAmount ?? this.orderAmount
|
|
|
+ ..depositAmount = depositAmount ?? this.depositAmount
|
|
|
+ ..paymentStatus = paymentStatus ?? this.paymentStatus
|
|
|
+ ..paidAt = paidAt ?? this.paidAt
|
|
|
+ ..refundStatus = refundStatus ?? this.refundStatus
|
|
|
+ ..refundedAt = refundedAt ?? this.refundedAt;
|
|
|
+ }
|
|
|
}
|