package fnpsapi

import (
	"testing"

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

func TestCreateStore(t *testing.T) {
	err := api.CreateStore(&CreateStoreParam{
		ChainStoreCode: "667281",
		ChainStoreName: "测试西南交大店",
		ChainStoreType: 2,
		ContactPhone:   "18160030913",
		Address:        "成都市金牛区交大路银桂桥二巷60号",
		PositionSource: 3,
		Longitude:      "104.047773",
		Latitude:       "30.695838",
		ServiceCode:    "1",
	})
	if err != nil {
		t.Fatal(err)
	}
	// t.Log(utils.Format4Output(result, false))
}

func TestGetStore(t *testing.T) {
	result, err := api.GetStore("667281")
	if err != nil {
		t.Fatal(err)
	}
	t.Log(utils.Format4Output(result, false))
}

func TestUpdateStore(t *testing.T) {
	err := api.UpdateStore(&CreateStoreParam{
		ChainStoreCode: "667281",
		Address:        "1111111",
	})
	if err != nil {
		t.Fatal(err)
	}
	// t.Log(utils.Format4Output(result, false))
}
