package mysql_test

import (
	"context"
	"testing"

	"hyapp/pkg/appcode"
	roomservice "hyapp/services/room-service/internal/room/service"
	"hyapp/services/room-service/internal/testutil/mysqltest"
)

func TestAdminListRoomPinsEmptyTable(t *testing.T) {
	repo := mysqltest.NewRepository(t)
	ctx := appcode.WithContext(context.Background(), appcode.Default)

	items, total, err := repo.AdminListRoomPins(ctx, roomservice.AdminRoomPinQuery{
		Page:     1,
		PageSize: 20,
		Status:   "active",
		PinType:  "region",
		NowMS:    1000,
	})
	if err != nil {
		t.Fatalf("list empty room pins failed: %v", err)
	}
	if total != 0 || len(items) != 0 {
		t.Fatalf("empty room pins mismatch: total=%d len=%d", total, len(items))
	}
}
