builder

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AmountPrecisionDefault = int64(2)
)
View Source
const (
	LimitDefault = 100000
)

Variables

View Source
var (
	Builders = map[string]func(*Handler) BuildInterface{
		reporterpb.ReportTypeVat:                           newVatHandler,
		reporterpb.ReportTypeVatTransactions:               newVatTransactionsHandler,
		reporterpb.ReportTypeRoyalty:                       newRoyaltyHandler,
		reporterpb.ReportTypeRoyaltyTransactions:           newRoyaltyTransactionsHandler,
		reporterpb.ReportTypeTransactions:                  newTransactionsHandler,
		reporterpb.ReportTypePayout:                        newPayoutHandler,
		reporterpb.ReportTypeAgreement:                     newAgreementHandler,
		reporterpb.ReportTypeRoyaltyAccountant:             newRoyaltyHandler,
		reporterpb.ReportTypeRoyaltyTransactionsAccountant: newRoyaltyTransactionsAccountantHandler,
		reporterpb.ReportTypePayoutFinance:                 newPayoutHandler,
		reporterpb.ReportTypeActOfCompletion:               newActOfCompletion,
	}

	ErrorMethodNotSupported = errs.New("method not supported")
)

Functions

This section is empty.

Types

type ActOfCompletion added in v1.4.0

type ActOfCompletion struct {
	*DefaultHandler
	// contains filtered or unexported fields
}

func (*ActOfCompletion) Build added in v1.4.0

func (h *ActOfCompletion) Build() (interface{}, error)

func (*ActOfCompletion) GetPostProcessParams added in v1.4.0

func (h *ActOfCompletion) GetPostProcessParams() PostProcessParams

func (*ActOfCompletion) GetReportName added in v1.4.0

func (h *ActOfCompletion) GetReportName() (string, error)

func (*ActOfCompletion) PostProcess added in v1.4.0

func (h *ActOfCompletion) PostProcess(
	_ context.Context,
	_ string,
	_ string,
	_ int64,
	_ []byte,
	_ PostProcessParams,
) error

func (*ActOfCompletion) Validate added in v1.4.0

func (h *ActOfCompletion) Validate() error

type Agreement

type Agreement DefaultHandler

func (*Agreement) Build

func (h *Agreement) Build() (interface{}, error)

func (*Agreement) GetPostProcessParams added in v1.1.0

func (h *Agreement) GetPostProcessParams() PostProcessParams

func (*Agreement) GetReportName added in v1.1.0

func (h *Agreement) GetReportName() (string, error)

func (*Agreement) PostProcess

func (h *Agreement) PostProcess(
	ctx context.Context,
	_ string,
	fileName string,
	_ int64,
	_ []byte,
	_ PostProcessParams,
) error

func (*Agreement) Validate

func (h *Agreement) Validate() error

type AgreementInterface

type AgreementInterface interface {
	GetAgreementName(fileType string) (string, error)
}

type BuildInterface

type BuildInterface interface {
	Validate() error
	Build() (interface{}, error)
	PostProcess(context.Context, string, string, int64, []byte, PostProcessParams) error
	GetReportName() (string, error)
	GetPostProcessParams() PostProcessParams
}

type DefaultHandler

type DefaultHandler struct {
	*Handler
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(
	service micro.Service,
	report *reporterpb.ReportFile,
	billing billingpb.BillingService,
) *Handler

func (*Handler) ClearReportName added in v1.1.0

func (h *Handler) ClearReportName(name string) string

func (*Handler) GetBuilder

func (h *Handler) GetBuilder() (BuildInterface, error)

func (*Handler) GetMerchant added in v1.1.0

func (h *Handler) GetMerchant(ctx context.Context, merchantId string) (*billingpb.Merchant, error)

func (*Handler) GetOperatingCompany added in v1.1.0

func (h *Handler) GetOperatingCompany(
	ctx context.Context,
	companyId string,
) (*billingpb.OperatingCompany, error)

func (*Handler) GetParams

func (h *Handler) GetParams() (map[string]interface{}, error)

func (*Handler) GetRoyaltyReport added in v1.1.0

func (h *Handler) GetRoyaltyReport(
	ctx context.Context,
	royaltyReportId, merchantId string,
) (*billingpb.RoyaltyReport, error)

type Payout

type Payout struct {
	*DefaultHandler
	// contains filtered or unexported fields
}

func (*Payout) Build

func (h *Payout) Build() (interface{}, error)

func (*Payout) GetPostProcessParams added in v1.1.0

func (h *Payout) GetPostProcessParams() PostProcessParams

func (*Payout) GetReportName added in v1.1.0

func (h *Payout) GetReportName() (string, error)

func (*Payout) PostProcess

func (h *Payout) PostProcess(
	ctx context.Context,
	id string,
	fileName string,
	retentionTime int64,
	content []byte,
	params PostProcessParams,
) error

func (*Payout) Validate

func (h *Payout) Validate() error

type PostProcessParams added in v1.1.0

type PostProcessParams map[string]string

type Royalty

type Royalty struct {
	*DefaultHandler
	// contains filtered or unexported fields
}

func (*Royalty) Build

func (h *Royalty) Build() (interface{}, error)

func (*Royalty) GetPostProcessParams added in v1.1.0

func (h *Royalty) GetPostProcessParams() PostProcessParams

func (*Royalty) GetReportName added in v1.1.0

func (h *Royalty) GetReportName() (string, error)

func (*Royalty) PostProcess

func (h *Royalty) PostProcess(
	ctx context.Context,
	id string,
	fileName string,
	retentionTime int64,
	content []byte,
	params PostProcessParams,
) error

func (*Royalty) Validate

func (h *Royalty) Validate() error

type RoyaltyTransactions

type RoyaltyTransactions struct {
	*DefaultHandler
	// contains filtered or unexported fields
}

func (*RoyaltyTransactions) Build

func (h *RoyaltyTransactions) Build() (interface{}, error)

func (*RoyaltyTransactions) GetPostProcessParams added in v1.1.0

func (h *RoyaltyTransactions) GetPostProcessParams() PostProcessParams

func (*RoyaltyTransactions) GetReportName added in v1.1.0

func (h *RoyaltyTransactions) GetReportName() (string, error)

func (*RoyaltyTransactions) PostProcess

func (h *RoyaltyTransactions) PostProcess(_ context.Context, _, _ string, _ int64, _ []byte, _ PostProcessParams) error

func (*RoyaltyTransactions) Validate

func (h *RoyaltyTransactions) Validate() error

type RoyaltyTransactionsAccountant added in v1.1.0

type RoyaltyTransactionsAccountant struct {
	*DefaultHandler
	// contains filtered or unexported fields
}

func (*RoyaltyTransactionsAccountant) Build added in v1.1.0

func (m *RoyaltyTransactionsAccountant) Build() (interface{}, error)

func (*RoyaltyTransactionsAccountant) GetPostProcessParams added in v1.1.0

func (m *RoyaltyTransactionsAccountant) GetPostProcessParams() PostProcessParams

func (*RoyaltyTransactionsAccountant) GetReportName added in v1.1.0

func (m *RoyaltyTransactionsAccountant) GetReportName() (string, error)

func (*RoyaltyTransactionsAccountant) PostProcess added in v1.1.0

func (m *RoyaltyTransactionsAccountant) PostProcess(
	ctx context.Context,
	_ string,
	fileName string,
	_ int64,
	content []byte,
	params PostProcessParams,
) error

func (*RoyaltyTransactionsAccountant) Validate added in v1.1.0

func (m *RoyaltyTransactionsAccountant) Validate() error

type TariffPrintable

type TariffPrintable struct {
	Region                string `json:"payer_region"`
	MethodName            string `json:"method_name"`
	PaymentAmountMin      string `json:"payment_amount_min"`
	PaymentAmountMax      string `json:"payment_amount_max"`
	PaymentAmountCurrency string `json:"payment_amount_currency"`
	PsPercentFee          string `json:"ps_percent_fee"`
	PsFixedFee            string `json:"ps_fixed_fee"`
}

type Transactions

type Transactions DefaultHandler

func (*Transactions) Build

func (h *Transactions) Build() (interface{}, error)

func (*Transactions) GetPostProcessParams added in v1.1.0

func (h *Transactions) GetPostProcessParams() PostProcessParams

func (*Transactions) GetReportName added in v1.1.0

func (h *Transactions) GetReportName() (string, error)

func (*Transactions) PostProcess

func (h *Transactions) PostProcess(_ context.Context, _, _ string, _ int64, _ []byte, _ PostProcessParams) error

func (*Transactions) Validate

func (h *Transactions) Validate() error

type Vat

type Vat DefaultHandler

func (*Vat) Build

func (h *Vat) Build() (interface{}, error)

func (*Vat) GetPostProcessParams added in v1.1.0

func (h *Vat) GetPostProcessParams() PostProcessParams

func (*Vat) GetReportName added in v1.1.0

func (h *Vat) GetReportName() (string, error)

func (*Vat) PostProcess

func (h *Vat) PostProcess(_ context.Context, _, _ string, _ int64, _ []byte, _ PostProcessParams) error

func (*Vat) Validate

func (h *Vat) Validate() error

type VatTransactions

type VatTransactions DefaultHandler

func (*VatTransactions) Build

func (h *VatTransactions) Build() (interface{}, error)

func (*VatTransactions) GetPostProcessParams added in v1.1.0

func (h *VatTransactions) GetPostProcessParams() PostProcessParams

func (*VatTransactions) GetReportName added in v1.1.0

func (h *VatTransactions) GetReportName() (string, error)

func (*VatTransactions) PostProcess

func (h *VatTransactions) PostProcess(_ context.Context, _, _ string, _ int64, _ []byte, _ PostProcessParams) error

func (*VatTransactions) Validate

func (h *VatTransactions) Validate() error

Jump to

Keyboard shortcuts

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