package config

type ShipmentProvider struct {
	ShipmentEncryptPassphrase string `mapstructure:"SHIPMENT_ENCRYPT_PASSPHRASE"`

	FlashExpressTH FlashExpressTHShipment `mapstructure:",squash"`
	FlashExpressPH FlashExpressPHShipment `mapstructure:",squash"`
	NinjaVanSG     NinjaVanSGShipment     `mapstructure:",squash"`
	JTExpressTH    JTExpressTHShipment    `mapstructure:",squash"`
	JTExpressMY    JTExpressMYShipment    `mapstructure:",squash"`
	JTExpressSG    JTExpressSGShipment    `mapstructure:",squash"`
	KerryExpressTH KerryExpressTHShipment `mapstructure:",squash"`
}

type FlashExpressTHShipment struct {
	ApiURL         string `mapstructure:"FLASH_EXPRESS_API_URL"`
	ApiKey         string `mapstructure:"FLASH_EXPRESS_API_KEY"`
	ApiSecret      string `mapstructure:"FLASH_EXPRESS_API_SECRET"`
	LinkAccountURL string `mapstructure:"FLASH_EXPRESS_LINK_ACCOUNT_URL"`
	PlatformName   string `mapstructure:"FLASH_EXPRESS_PLATFORM_NAME"`
	TrackingUrl    string `mapstructure:"FLASH_EXPRESS_TRACKING_URL"`
}

type FlashExpressPHShipment struct {
	ApiURL            string `mapstructure:"FLASH_EXPRESS_PH_API_URL"`
	TrackingURL       string `mapstructure:"FLASH_EXPRESS_PH_TRACKING_URL"`
	WebhookStatusURL  string `mapstructure:"FLASH_EXPRESS_PH_WEBHOOK_STATUS_URL"`
	WebhookCourierURL string `mapstructure:"FLASH_EXPRESS_PH_WEBHOOK_COURIER_URL"`
}

type NinjaVanSGShipment struct {
	TrackingUrl  string `mapstructure:"NINJA_VAN_TRACKING_URL"`
	ApiUrl       string `mapstructure:"NINJA_VAN_API_URL"`
	ApiClientID  string `mapstructure:"NINJA_VAN_API_CLIENT_ID"`
	ApiClientKey string `mapstructure:"NINJA_VAN_API_CLIENT_KEY"`
}

type JTExpressTHShipment struct {
	TrackingUrl    string `mapstructure:"JT_EXPRESS_TRACKING_URL"`
	ApiURL         string `mapstructure:"JT_EXPRESS_API_URL"`
	ApiSecret      string `mapstructure:"JT_EXPRESS_API_SECRET"`
	ApiCustomerID  string `mapstructure:"JT_EXPRESS_API_CUSTOMER_ID"`
	ApiEccompanyID string `mapstructure:"JT_EXPRESS_API_ECCOMPANY_ID"`
}

type JTExpressMYShipment struct {
	WebhookSecret             string `mapstructure:"JT_EXPRESS_MY_WEBHOOK_SECRET"`
	WebhookLogisticProviderID string `mapstructure:"JT_EXPRESS_MY_WEBHOOK_LOGISTIC_PROVIDER_ID"`

	TrackingUrl       string `mapstructure:"JT_EXPRESS_MY_TRACKING_URL"`
	ApiKey            string `mapstructure:"JT_EXPRESS_MY_API_KEY"`
	ApiSecret         string `mapstructure:"JT_EXPRESS_MY_API_SECRET"`
	ApiUsername       string `mapstructure:"JT_EXPRESS_MY_API_USERNAME"`
	ApiUrlCreateOrder string `mapstructure:"JT_EXPRESS_MY_API_URL_CREATE_ORDER"`
	ApiUrlCancelOrder string `mapstructure:"JT_EXPRESS_MY_API_URL_CANCEL_ORDER"`

	TrackingApiSecret      string `mapstructure:"JT_EXPRESS_MY_TRACKING_API_SECRET"`
	TrackingApiUrl         string `mapstructure:"JT_EXPRESS_MY_TRACKING_API_URL"`
	TrackingApiEccompanyID string `mapstructure:"JT_EXPRESS_MY_TRACKING_API_ECCOMPANY_ID"`

	WaybillApiAccount  string `mapstructure:"JT_EXPRESS_MY_WAYBILL_API_ACCOUNT"`
	WaybillApiPassword string `mapstructure:"JT_EXPRESS_MY_WAYBILL_API_PASSWORD"`
	WaybillApiUrl      string `mapstructure:"JT_EXPRESS_MY_WAYBILL_API_URL"`

	PostcodeApiSecret string `mapstructure:"JT_EXPRESS_MY_POSTCODE_API_SECRET"`
	PostcodeApiUrl    string `mapstructure:"JT_EXPRESS_MY_POSTCODE_API_URL"`
}

type JTExpressSGShipment struct {
	ApiURL        string `mapstructure:"JT_EXPRESS_SG_API_URL"`
	ApiUsername   string `mapstructure:"JT_EXPRESS_SG_API_USERNAME"`
	ApiPassword   string `mapstructure:"JT_EXPRESS_SG_API_PASSWORD"`
	WebhookSecret string `mapstructure:"JT_EXPRESS_SG_WEBHOOK_SECRET"`
	TrackingUrl   string `mapstructure:"JT_EXPRESS_SG_TRACKING_URL"`
}

type KerryExpressTHShipment struct {
	ApiURL      string `mapstructure:"KERRY_EXPRESS_TH_API_URL"`
	ApiID       string `mapstructure:"KERRY_EXPRESS_TH_API_ID"`
	ApiKey      string `mapstructure:"KERRY_EXPRESS_TH_API_KEY"`
	TrackingUrl string `mapstructure:"KERRY_EXPRESS_TH_TRACKING_URL"`
}

func (c *configImpl) GetShipmentProviderConfig() ShipmentProvider {
	return c.systemConfig.ShipmentProvider
}
