package com.ruoyi.app.flashdelivery.dto;

import org.junit.jupiter.api.Test;

import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

class FlashDeliveryRiderOrderListViewTest {
    @Test
    void userListContainsOnlyFieldsRequiredByOrderCards() {
        Set<String> fields = Stream.of(FlashDeliveryUserOrderListView.class.getDeclaredFields())
                .map(java.lang.reflect.Field::getName).collect(Collectors.toSet());
        Set<String> expected = Set.of("id", "orderNo", "serviceType", "deliveryType", "status", "packageType",
                "quantity", "totalWeightKg", "baseDeliveryFee", "urgentFee", "tipAmount",
                "deliveryMode", "scheduledPickupStartAt", "scheduledPickupEndAt", "pickupAddress",
                "pickupDetailAddress", "deliveryAddress", "deliveryDetailAddress",
                "estimatedDurationSeconds", "amount", "currency", "deliveredAt", "createTime");
        org.junit.jupiter.api.Assertions.assertEquals(expected, fields);
    }

    @Test
    void riderListContainsOnlyFieldsRequiredByOrderCards() {
        Set<String> fields = Stream.of(FlashDeliveryRiderOrderListView.class.getDeclaredFields())
                .map(java.lang.reflect.Field::getName).collect(Collectors.toSet());
        Set<String> expected = Set.of("id", "orderNo", "serviceType", "deliveryType", "status", "packageType",
                "quantity", "totalWeightKg", "specification", "packageSize", "deliveryMode",
                "scheduledPickupStartAt", "scheduledPickupEndAt",
                "pinRequired", "pickupAddress", "pickupDetailAddress", "deliveryAddress",
                "deliveryDetailAddress", "pickupDistanceMeters", "distanceMeters",
                "estimatedDurationSeconds", "baseDeliveryFee", "distanceFee", "urgentFee",
                "tipAmount", "amount", "currency", "createTime");
        org.junit.jupiter.api.Assertions.assertEquals(expected, fields);
    }

    @Test
    void riderPageContainsOnlyPagingAndHeaderSummary() {
        Set<String> fields = Stream.of(FlashDeliveryRiderOrderPageView.class.getDeclaredFields())
                .map(java.lang.reflect.Field::getName).collect(Collectors.toSet());
        org.junit.jupiter.api.Assertions.assertEquals(Set.of("records", "total", "current", "size",
                "nearbyTaskCount", "highestOrderAmount"), fields);
    }
}
