package card_apple_account

import (
	"testing"

	"kami/api/commonApi"
	_ "kami/internal/logic/sys_user_payment"
	"kami/internal/model"

	_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
	_ "github.com/gogf/gf/contrib/nosql/redis/v2"

	"github.com/gogf/gf/v2/os/gctx"
	"github.com/gogf/gf/v2/test/gtest"
)

func Test_sAppleAccount_AddWalletAmount(t *testing.T) {
	gtest.C(t, func(t *gtest.T) {
		s := sAppleAccount{}
		ctx := gctx.New()
		_, _ = s.AddWalletAmount(ctx, &model.AppleCardWalletInfo{
			CommonStrId: commonApi.CommonStrId{
				ID: "8dccd550-a986-4c7a-bb8d-6694f863f309",
			},
			Amount:  100,
			OrderNo: "123456",
		}, nil)
	})
}

func Test_sAppleAccount_IsUnscopedTodayRepeatedByName(t *testing.T) {
	a := &sAppleAccount{}
	a.IsUnscopedTodayRepeatedByName(gctx.New(), "123456")
}

// func Test_sAppleAccount_GetAccordingAccount(t *testing.T) {
// 	ctx := gctx.New()
// 	result, err := New().GetAccordingAccount(ctx, "123456", decimal.NewFromInt(100))
// 	if err != nil {
// 		glog.Error(ctx, err)
// 	}
// 	glog.Info(ctx, "当前账号", result)
// }

// func Test_sAppleAccount_GetAccordingAccountV2(t *testing.T) {
// 	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("/manifest/config/config.yaml")
// 	ctx := gctx.New()
// 	data, err := New().GetAccordingAccountV2(ctx, "123456", decimal.NewFromInt(100))
// 	if err != nil {
// 		glog.Error(ctx, err)
// 	}
// 	glog.Info(ctx, "当前账号", data)
// }
