159 lines
3.5 KiB
Dart
159 lines
3.5 KiB
Dart
import 'package:niogu_ecommerce_v1/core/enums/approval_process.dart';
|
|
import 'package:niogu_ecommerce_v1/core/enums/delivery_fee_type.dart';
|
|
import 'package:niogu_ecommerce_v1/core/enums/delivery_type.dart';
|
|
import 'package:niogu_ecommerce_v1/core/enums/order_status.dart';
|
|
import 'package:niogu_ecommerce_v1/features/checkout/domain/entities/checkout.dart';
|
|
import 'package:niogu_ecommerce_v1/features/order/data/models/order_model.dart';
|
|
|
|
class OrderReport {
|
|
final String id;
|
|
|
|
final String orderNumber;
|
|
|
|
final int totalItems;
|
|
|
|
final List<String?> productImages;
|
|
|
|
final double totalAmount;
|
|
|
|
final OrderStatus orderStatus;
|
|
|
|
final String deliveryType;
|
|
|
|
final bool hasBeenAssessed;
|
|
|
|
final DateTime createdAt;
|
|
|
|
OrderReport({
|
|
required this.id,
|
|
required this.orderNumber,
|
|
required this.productImages,
|
|
required this.totalItems,
|
|
required this.totalAmount,
|
|
required this.orderStatus,
|
|
required this.deliveryType,
|
|
required this.hasBeenAssessed,
|
|
required this.createdAt,
|
|
});
|
|
}
|
|
|
|
class OrderInfo {
|
|
final String id;
|
|
|
|
final String orderNumber;
|
|
|
|
final DateTime createdAt;
|
|
|
|
final OrderStatus orderStatus;
|
|
|
|
final bool? isCancellation;
|
|
|
|
final bool? cancellationAccepted;
|
|
|
|
final ApprovalProcess? approvalProcess;
|
|
|
|
final DeliveryType deliveryType;
|
|
|
|
final String deliveryPreference;
|
|
|
|
final String outletNameSnapshot;
|
|
|
|
final OutletAddressSnapshot? outletAddressSnapshot;
|
|
|
|
final CustomerAddressSnapshot? customerAddressSnapshot;
|
|
|
|
final List<OrderItemInfo> orderItems;
|
|
|
|
final String paymentMethod;
|
|
|
|
final String? paymentProofUrl;
|
|
|
|
final double totalOrder;
|
|
|
|
final DeliveryFeeType? deliveryFeeType;
|
|
|
|
final double deliveryFee;
|
|
|
|
final double totalDeliveryFee;
|
|
|
|
final double totalAmount;
|
|
|
|
const OrderInfo({
|
|
required this.id,
|
|
required this.orderNumber,
|
|
required this.createdAt,
|
|
required this.orderStatus,
|
|
this.isCancellation,
|
|
this.cancellationAccepted,
|
|
this.approvalProcess,
|
|
required this.deliveryType,
|
|
required this.deliveryPreference,
|
|
required this.outletNameSnapshot,
|
|
this.outletAddressSnapshot,
|
|
this.customerAddressSnapshot,
|
|
required this.orderItems,
|
|
required this.paymentMethod,
|
|
required this.paymentProofUrl,
|
|
required this.totalOrder,
|
|
this.deliveryFeeType,
|
|
required this.deliveryFee,
|
|
required this.totalDeliveryFee,
|
|
required this.totalAmount,
|
|
});
|
|
}
|
|
|
|
class OrderItemInfo {
|
|
final String id;
|
|
final String? productImageUrlSnapshot;
|
|
final String productNameSnapshot;
|
|
final String? productVariantNameSnapshot;
|
|
final double sellingPriceSnapshot;
|
|
final int quantity;
|
|
|
|
const OrderItemInfo({
|
|
required this.id,
|
|
this.productImageUrlSnapshot,
|
|
required this.productNameSnapshot,
|
|
this.productVariantNameSnapshot,
|
|
required this.sellingPriceSnapshot,
|
|
required this.quantity,
|
|
});
|
|
}
|
|
|
|
class ProductReviewItem {
|
|
final String id;
|
|
final String? image;
|
|
final String name;
|
|
final String? variantName;
|
|
|
|
const ProductReviewItem({
|
|
required this.id,
|
|
this.image,
|
|
required this.name,
|
|
required this.variantName,
|
|
});
|
|
}
|
|
|
|
class ProductReview {
|
|
final String customerId;
|
|
final String productVariantId;
|
|
final int rating;
|
|
final String? comment;
|
|
|
|
const ProductReview({
|
|
required this.customerId,
|
|
required this.productVariantId,
|
|
required this.rating,
|
|
this.comment,
|
|
});
|
|
|
|
ProductReviewRequest toProductReviewRequest() {
|
|
return ProductReviewRequest(
|
|
customerId: customerId,
|
|
productVariantId: productVariantId,
|
|
rating: rating,
|
|
comment: comment,
|
|
);
|
|
}
|
|
}
|