utils

package
v0.5.67 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEnvVarEmpty = errors.New("getenv: environment variable empty")

Functions

func CheckIfIsCancelledBeforeThreshold added in v0.5.61

func CheckIfIsCancelledBeforeThreshold(cancelledAt time.Time, appointmentScheduledStartDateTime time.Time, threshold float64) bool

func CommaSeparatedValuesTo

func CommaSeparatedValuesTo()

func GetPercentageToReimburse added in v0.5.67

func GetPercentageToReimburse(cancelledAt time.Time, appointmentScheduledStartDateTime time.Time, threshold float64) float64

func JsonToStruct

func JsonToStruct(jsonStr string, obj interface{}) error

func StructToJson

func StructToJson(obj interface{}) string

Types

type AmountsBreakdown added in v0.5.31

type AmountsBreakdown struct {
	PractitionerPaymentAmount float64 `json:"practitioner_payment_amount"`
	ReimbursementAmount       float64 `json:"reimbursement_amount"`
	PlatformFeeAmount         float64 `json:"platform_fee_amount"`
}

func GetAmountsBreakdownForAppointmentCancellation added in v0.5.31

func GetAmountsBreakdownForAppointmentCancellation(payload GetAmountsBreakdownForAppointmentCancellationPayload) (AmountsBreakdown, error)

type GetAmountsBreakdownForAppointmentCancellationPayload added in v0.5.31

type GetAmountsBreakdownForAppointmentCancellationPayload struct {
	AmountPayed            float64   `json:"amount_payed" validate:"required gte=0"`
	ScheduledStartDateTime time.Time `json:"scheduled_start_date_time" validate:"required"`
	HoursThreshold         float64   `json:"hours_threshold" validate:"required gte=0"`
	PlatformFee            float64   `json:"platform_fee" validate:"required gte=0 lte=1"`
	CancellationAt         time.Time `json:"cancellation_at" validate:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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