billing

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright © 2021-2023 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2023 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2023 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021-2023 Nikita Ivanovski info@slnt-opp.xyz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	RabbitMQConn string
)

Functions

This section is empty.

Types

type BillingServiceServer

type BillingServiceServer struct {
	pb.UnimplementedBillingServiceServer
	// contains filtered or unexported fields
}

func NewBillingServiceServer

func NewBillingServiceServer(logger *zap.Logger, db driver.Database) *BillingServiceServer

func (*BillingServiceServer) CreatePlan

func (s *BillingServiceServer) CreatePlan(ctx context.Context, plan *pb.Plan) (*pb.Plan, error)

func (*BillingServiceServer) CreateTransaction

func (s *BillingServiceServer) CreateTransaction(ctx context.Context, t *pb.Transaction) (*pb.Transaction, error)

func (*BillingServiceServer) DeletePlan

func (s *BillingServiceServer) DeletePlan(ctx context.Context, plan *pb.Plan) (*pb.Plan, error)

func (*BillingServiceServer) GenTransactions added in v0.0.18

func (s *BillingServiceServer) GenTransactions(ctx context.Context, log *zap.Logger, tick time.Time,
	currencyConf CurrencyConf, roundingConf RoundingConf)

func (*BillingServiceServer) GenTransactionsRoutine

func (s *BillingServiceServer) GenTransactionsRoutine(ctx context.Context)

func (*BillingServiceServer) GenTransactionsRoutineState

func (s *BillingServiceServer) GenTransactionsRoutineState() []*hpb.RoutineStatus

func (*BillingServiceServer) GetInstancesReports added in v0.0.18

func (*BillingServiceServer) GetInstancesReportsCount added in v0.0.18

func (*BillingServiceServer) GetPlan

func (s *BillingServiceServer) GetPlan(ctx context.Context, plan *pb.Plan) (*pb.Plan, error)

func (*BillingServiceServer) GetRecords

func (s *BillingServiceServer) GetRecords(ctx context.Context, req *pb.Transaction) (*pb.Records, error)

func (*BillingServiceServer) GetRecordsReports added in v0.0.18

func (*BillingServiceServer) GetRecordsReportsCount added in v0.0.18

func (*BillingServiceServer) GetTransactions

func (*BillingServiceServer) GetTransactionsCount added in v0.0.18

func (*BillingServiceServer) ListPlans

func (s *BillingServiceServer) ListPlans(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)

func (*BillingServiceServer) ListPlansInstances added in v0.0.18

func (*BillingServiceServer) Reprocess

func (*BillingServiceServer) SuspendAccountsRoutine added in v0.0.18

func (s *BillingServiceServer) SuspendAccountsRoutine(ctx context.Context)

func (*BillingServiceServer) SuspendAccountsRoutineState added in v0.0.18

func (s *BillingServiceServer) SuspendAccountsRoutineState() *hpb.RoutineStatus

func (*BillingServiceServer) UpdatePlan

func (s *BillingServiceServer) UpdatePlan(ctx context.Context, plan *pb.Plan) (*pb.Plan, error)

func (*BillingServiceServer) UpdateTransaction added in v0.0.18

type CurrencyConf added in v0.0.18

type CurrencyConf struct {
	Currency int32 `json:"currency"` // Default currency for platform
}

func MakeCurrencyConf added in v0.0.18

func MakeCurrencyConf(ctx context.Context, log *zap.Logger) (conf CurrencyConf)

type CurrencyServiceServer

type CurrencyServiceServer struct {
	pb.UnimplementedCurrencyServiceServer
	// contains filtered or unexported fields
}

func NewCurrencyServiceServer

func NewCurrencyServiceServer(log *zap.Logger, db driver.Database) *CurrencyServiceServer

func (*CurrencyServiceServer) Convert

func (*CurrencyServiceServer) CreateExchangeRate

func (*CurrencyServiceServer) DeleteExchangeRate

func (*CurrencyServiceServer) GetCurrencies

func (*CurrencyServiceServer) GetExchangeRate

func (*CurrencyServiceServer) GetExchangeRates added in v0.0.18

func (*CurrencyServiceServer) UpdateExchangeRate

type RecordsServiceServer

type RecordsServiceServer struct {
	pb.UnimplementedRecordsServiceServer

	ConsumerStatus *healthpb.RoutineStatus
	// contains filtered or unexported fields
}

func NewRecordsServiceServer

func NewRecordsServiceServer(logger *zap.Logger, db driver.Database) *RecordsServiceServer

func (*RecordsServiceServer) Consume

func (s *RecordsServiceServer) Consume(ctx context.Context)

type RoundingConf added in v0.0.18

type RoundingConf struct {
	Rounding string `json:"rounding"` // Rounding used in payments
}

func MakeRoundingConf added in v0.0.18

func MakeRoundingConf(ctx context.Context, log *zap.Logger) (conf RoundingConf)

type Routine

type Routine struct {
	Name     string
	LastExec string
	Running  bool
}

type RoutineConf

type RoutineConf struct {
	Frequency int `json:"freq"` // Frequency in Seconds
}

func MakeRoutineConf

func MakeRoutineConf(ctx context.Context, log *zap.Logger) (conf RoutineConf)

type SuspendConf

type SuspendConf struct {
	AutoResume     bool              `json:"auto_resume"`
	IsEnabled      bool              `json:"is_enabled"`
	Limit          float64           `json:"limit"`
	Schedule       []SuspendSchedule `json:"schedule"`
	IsExtraEnabled bool              `json:"is_extra_enabled"`
	ExtraLimit     float64           `json:"extra_limit"`
}

func MakeSuspendConf

func MakeSuspendConf(ctx context.Context, log *zap.Logger) (conf SuspendConf)

type SuspendSchedule

type SuspendSchedule struct {
	Day  int  `json:"day"`
	Off  bool `json:"off"`
	From int  `json:"from"`
	To   int  `json:"to"`
}

Jump to

Keyboard shortcuts

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