export interface ProductImage {
  cover: string;
  list: string[];
}

export interface ProductSpecification {
  title: string;
  values: string[];
}

export interface Brand {
  _id: string;
}

export interface Category {
  _id: string;
}

export interface Variant {
  _id: string;
}

export interface Product {
  _id: number;
  title_fa: string;
  title_en: string;
  seoTitle: string | null;
  seoDescription: string | null;
  source: string;
  description: string;
  metaDescription: string;
  tags: string[];
  advantages: string[];
  disAdvantages: string[];
  imagesUrl: ProductImage;
  isFake: string;
  voice: string | null;
  specifications: ProductSpecification[];
  brand: Brand;
  category: Category;
  variants: Variant[];
}

export interface Price {
  order_limit: number;
  retailPrice: number;
  selling_price: number;
  is_specialSale: boolean;
  discount_percent: number;
  specialSale_order_limit: number | null;
  specialSale_quantity: number | null;
  specialSale_endDate: string | null;
}

export interface Shop {
  _id: string;
}

export interface ProductVariant {
  _id: string;
  market_status: string;
  price: Price;
  stock: number;
  postingTime: number;
  isFreeShip: boolean;
  isWholeSale: boolean;
  shop: Shop;
  warranty: number;
  meterage?: number;
  size?: number;
}

export interface OrderItem {
  product: Product;
  variant: ProductVariant;
  quantity: number;
  cancelled_quantity: number;
  returned_quantity: number;
  selling_price: number;
  retail_price: number;
  discount_percent: number;
  shipmentCost: number;
}

export interface PaymentMethod {
  _id: string;
  title_fa: string;
  title_en: string;
  description: string;
  provider: string;
  isActive: boolean;
  type: string;
}

export interface PriceDetails {
  shipping_cost: number;
  process_cost: number;
  total_retail_price: number;
  total_payable_price: number;
  total_discount: number;
  coupon_discount: number;
}

export interface Payment {
  _id: string;
  transaction_id: string | null;
  payment_method: PaymentMethod;
  priceDetails: PriceDetails;
  totalPrice: number;
  paymentStatus: string;
  createdAt: string;
}

export interface ShipmentAddress {
  address: string;
  city: string;
  province: string;
  plaque: string;
  postalCode: string;
  phone: string;
}

export interface MappedOrder {
  orderId: number;
  orderItems: OrderItem[];
  payment: Payment;
  shipmentAddress: ShipmentAddress;
  orderStatus: string;
  createdAt: string;
}

export interface ShopDetails {
  _id: string;
  shopName: string;
  shopCode: number;
  owner: string;
  shopDescription: string;
  telephoneNumber: string;
  isChatActive: boolean;
  shopPostalCode: string;
  logo: string;
}

export interface ShipmentItem {
  product: Product;
  variant: ProductVariant;
  quantity: number;
  cancelled_quantity: number;
  returned_quantity: number;
  selling_price: number;
  retail_price: number;
  discount_percent: number;
  shipmentCost: number;
}

export interface OrderItemDetails {
  _id: string;
  shop: ShopDetails;
  shipmentItems: ShipmentItem[];
}

export interface Shipper {
  _id: number;
  name: string;
  description: string;
  deliveryTime: number;
  deliveryType: string;
}

export interface Order {
  _id: number;
  payment: Payment;
  orderItems: OrderItemDetails[];
  shipper: Shipper;
  trackCode: string | null;
  itemsCount: number;
  totalPaymentPrice: number;
  totalRetailPrice: number;
  totalSellingPrice: number;
  totalShipmentCost: number;
  postingDate: string | null;
  postingReceipt: string | null;
  status: string;
}

export interface User {
  _id: string;
  fullName: string;
  phoneNumber: string;
  dateOfBirth: string | null;
  address: {
    _id: string;
  };
  nationalCode: string | null;
  homeNumber: string | null;
}

export interface Warranty {
  _id: number;
  duration: string;
  logoUrl: string;
  name: string;
}

export interface Meterage {
  _id: number;
  value: string;
}

export interface Size {
  _id: number;
  value: string;
}

export interface ProductVariantDetail {
  _id: string;
  market_status: string;
  price: Price;
  stock: number;
  postingTime: number;
  isFreeShip: boolean;
  isWholeSale: boolean;
  shop: ShopDetails;
  warranty: Warranty;
  meterage?: Meterage;
  size?: Size;
}

export interface ShipmentItemDetail {
  _id: string;
  product: Product;
  variant: ProductVariantDetail;
  quantity: number;
  cancelled_quantity: number;
  returned_quantity: number;
  selling_price: number;
  retail_price: number;
  discount_percent: number;
  shipmentCost: number;
}

export interface OrderItemDetail {
  _id: string;
  order_id: number;
  shop: ShopDetails;
  shipmentItems: ShipmentItemDetail[];
  shipper: Shipper;
  trackCode: string | null;
  itemsCount: number;
  totalPaymentPrice: number;
  totalRetailPrice: number;
  totalSellingPrice: number;
  totalShipmentCost: number;
  postingDate: string | null;
  postingReceipt: string | null;
  status: string;
}

export interface CancelReason {
  _id: string;
  title: string;
  deleted: boolean;
}

export interface CancelReasonsResponse {
  status: number;
  success: boolean;
  results: {
    reasons: CancelReason[];
  };
}

export interface OrderDetail {
  _id: number;
  user: User;
  payment: Payment;
  orderItems: OrderItemDetail[];
  shipmentAddress: ShipmentAddress;
  orderStatus: string;
  createdAt: string;
  cancelReasons?: CancelReason[];
}

export interface OrderDetailResponse {
  status: number;
  success: boolean;
  results: {
    order: OrderDetail;
  };
}

export interface OrdersResponse {
  status: number;
  success: boolean;
  results: {
    mappedOrders: MappedOrder[];
    orders: Order[];
    shipmentAddress: ShipmentAddress;
    orderStatus: string;
    createdAt: string;
  };
}

export interface CancelOrderItem {
  orderItemId: string;
  shipmentItemId: string;
  quantity: number;
  comment: string;
  reason: string;
}

export interface CancelOrderType {
  orderId: number;
  items: CancelOrderItem[];
}

export interface ReturnReason {
  _id: string;
  title: string;
  deleted: boolean;
}

export interface ReturnReasonsResponse {
  status: number;
  success: boolean;
  results: {
    reasons: ReturnReason[];
  };
}

export interface ReturnOrderItem {
  orderItemId: string;
  shipmentItemId: string;
  quantity: number;
  comment: string;
  reason: string;
  images: string[];
}

export interface ReturnOrderType {
  orderId: number;
  items: ReturnOrderItem[];
}

export interface ReturnOrder {
  _id: string;
  order: number;
  user: string;
  status: string;
  total_price: number;
  createdAt: string;
  updatedAt: string;
}

export interface ReturnOrdersResponse {
  status: number;
  success: boolean;
  results: {
    returnOrders: ReturnOrder[];
  };
}
