|
@@ -11,10 +11,19 @@ ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(Map<String, dynamic>
|
|
|
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;
|
|
@@ -52,6 +61,11 @@ ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(Map<String, dynamic>
|
|
|
if (estateUnit != null) {
|
|
|
serviceOrderDetailEntity.estateUnit = estateUnit;
|
|
|
}
|
|
|
+ final ServiceOrderDetailOrder? order = jsonConvert.convert<
|
|
|
+ ServiceOrderDetailOrder>(json['order']);
|
|
|
+ if (order != null) {
|
|
|
+ serviceOrderDetailEntity.order = order;
|
|
|
+ }
|
|
|
return serviceOrderDetailEntity;
|
|
|
}
|
|
|
|
|
@@ -60,6 +74,8 @@ Map<String, dynamic> $ServiceOrderDetailEntityToJson(ServiceOrderDetailEntity en
|
|
|
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();
|
|
@@ -69,6 +85,7 @@ Map<String, dynamic> $ServiceOrderDetailEntityToJson(ServiceOrderDetailEntity en
|
|
|
data['order_products'] = 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;
|
|
|
}
|
|
|
|
|
@@ -76,7 +93,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,
|
|
@@ -86,11 +105,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
|
|
@@ -99,13 +121,14 @@ 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;
|
|
|
}
|
|
@@ -135,7 +158,7 @@ Map<String, dynamic> $ServiceOrderDetailAccountToJson(ServiceOrderDetailAccount
|
|
|
|
|
|
extension ServiceOrderDetailAccountExtension on ServiceOrderDetailAccount {
|
|
|
ServiceOrderDetailAccount copyWith({
|
|
|
- int? id,
|
|
|
+ String? id,
|
|
|
String? name,
|
|
|
String? avatar,
|
|
|
String? phone,
|
|
@@ -150,7 +173,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;
|
|
|
}
|
|
@@ -158,7 +181,8 @@ ServiceOrderDetailOrderService $ServiceOrderDetailOrderServiceFromJson(Map<Strin
|
|
|
if (name != null) {
|
|
|
serviceOrderDetailOrderService.name = name;
|
|
|
}
|
|
|
- final double? evaluationsAvgScore = jsonConvert.convert<double>(json['evaluations_avg_score']);
|
|
|
+ final int? evaluationsAvgScore = jsonConvert.convert<int>(
|
|
|
+ json['evaluations_avg_score']);
|
|
|
if (evaluationsAvgScore != null) {
|
|
|
serviceOrderDetailOrderService.evaluationsAvgScore = evaluationsAvgScore;
|
|
|
}
|
|
@@ -175,9 +199,9 @@ Map<String, dynamic> $ServiceOrderDetailOrderServiceToJson(ServiceOrderDetailOrd
|
|
|
|
|
|
extension ServiceOrderDetailOrderServiceExtension on ServiceOrderDetailOrderService {
|
|
|
ServiceOrderDetailOrderService copyWith({
|
|
|
- int? id,
|
|
|
+ String? id,
|
|
|
String? name,
|
|
|
- double? evaluationsAvgScore,
|
|
|
+ int? evaluationsAvgScore,
|
|
|
}) {
|
|
|
return ServiceOrderDetailOrderService()
|
|
|
..id = id ?? this.id
|
|
@@ -272,27 +296,12 @@ ServiceOrderDetailOrderProducts $ServiceOrderDetailOrderProductsFromJson(Map<Str
|
|
|
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;
|
|
|
}
|
|
@@ -307,10 +316,6 @@ Map<String, dynamic> $ServiceOrderDetailOrderProductsToJson(ServiceOrderDetailOr
|
|
|
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;
|
|
@@ -321,21 +326,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;
|
|
@@ -409,4 +406,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;
|
|
|
+ }
|
|
|
}
|