package jdapi

import (
	"testing"

	"git.rosy.net.cn/baseapi/utils"
)

func TestOrderDiscountQueryActivityInfoById(t *testing.T) {
	result, err := api.OrderDiscountQueryActivityInfoById(1297945, OrderDiscountActivityTypeManJian, 0, "test")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestQueryPromotionInfo(t *testing.T) {
	result, err := api.QueryPromotionInfo(43430316)
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestQueryPromotionSku(t *testing.T) {
	skuIDs := []int64{
		2022336911,
		// 2023335104,
		// 2023335088,
		// 2023335057,
		// 2023335098,
		// 2023335020,
	}
	for _, skuID := range skuIDs {
		list, err := api.QueryPromotionSku(PromotionTypeDirectDown, skuID, PromotionStateConfirmed)
		t.Log(utils.Format4Output(list, false))
		if err != nil {
			t.Fatal(err)
		}
		// for _, v := range list {
		// 	CancelPromotionSkuSingle()
		// }
	}
}
