toko_libur

package
v1.1.71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveApplicationConfig added in v1.1.71

func SaveApplicationConfig(base pdc_application.BaseApplication, config *TokopediaTokoLiburConfig) error

Types

type AkunTokoLibur

type AkunTokoLibur struct {
	Username string `csv:"username" json:"username"`
	Password string `csv:"password" json:"password"`
	Secret   string `csv:"secret" json:"secret"`
}

type Application

type Application struct {
	Config *TokopediaTokoLiburConfig
	Report *Report
}

func InitApplication

func InitApplication(base pdc_application.BaseApplication) (*Application, error)

func NewApplication

func NewApplication(config *TokopediaTokoLiburConfig, report *Report) *Application

func (*Application) ProcessLibur

func (app *Application) ProcessLibur(item *ReportItem, tapi *api.TokopediaApi) error

func (*Application) Run

func (app *Application) Run() error

type Report

type Report struct {
	sync.Mutex

	Data []*ReportItem
	// contains filtered or unexported fields
}

func NewReport

func NewReport(config *TokopediaTokoLiburConfig) (*Report, error)

func (*Report) Iterate

func (r *Report) Iterate(
	handler func(
		item *ReportItem,
		updateitem func(handler func(item *ReportItem) error) error,
	) error,
) error

func (*Report) Save

func (r *Report) Save() error

type ReportItem

type ReportItem struct {
	*AkunTokoLibur
	StatusBefore string `csv:"status_before" json:"status_before"`
	StatusAfter  string `csv:"status_after" json:"status_after"`
	Message      string `csv:"message" json:"message"`
	Error        string `csv:"error" json:"error"`
}

func (*ReportItem) CreateDriver

func (item *ReportItem) CreateDriver() (*tokopedia_lib.DriverAccount, error)

func (*ReportItem) ReportError

func (r *ReportItem) ReportError(err error) error

type TokopediaTokoLiburConfig added in v1.1.71

type TokopediaTokoLiburConfig struct {
	BaseConfig pdc_application.BaseApplication `json:"-"`
	Libur      bool                            `json:"libur"`
	Report     string                          `json:"report"`
	Limit      int                             `json:"limit"`
	CloseStart int                             `json:"closeStart"`
	CloseEnd   int                             `json:"closeEnd"`
}

func (*TokopediaTokoLiburConfig) CreateCloseShopInput added in v1.1.71

func (c *TokopediaTokoLiburConfig) CreateCloseShopInput() *api.CloseShopScheduleInput

func (*TokopediaTokoLiburConfig) GetReportPath added in v1.1.71

func (c *TokopediaTokoLiburConfig) GetReportPath() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL