You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: estimatedpayouts.go
    path of file: ./repos/storj/storagenode/payouts/estimatedpayouts
    
    the code of the file until where you have to start completion: // Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.

package estimatedpayouts

import (
	"math"
	"time"

	"storj.io/storj/private/date"
)

// EstimatedPayout contains usage and estimated payouts data for current and previous months.
type EstimatedPayout struct {
	CurrentMonth             PayoutMonthly `json:"currentMonth"`
	PreviousMonth            PayoutMonthly `json:"previousMonth"`
	CurrentMonthExpectations int64         `json:"currentMonthExpectations"`
}

// PayoutMonthly contains usage and estimated payouts dat
    
func (estimatedPayout *EstimatedPayout) Set(current, previous PayoutMonthly, now, joinedAt time.Time) {
	estimatedPayout.CurrentMonth = current
	estimatedPayout.PreviousMonth = previous

	beginOfMonth := date.UTCBeginOfMonth(now)
	endOfMonth := date.UTCEndOfMonth(now)

	// Joined before the first day of this month
	if joinedAt.Before(beginOfMonth) {
		minutesPast := now.Sub(beginOfMonth).Minutes()
		estimatedMinutesJoinedCurrentMonth := endOfMonth.Sub(beginOfMonth).Minutes()

		payoutPerMin := estimatedPayout.CurrentMonth.Payout / minutesPast
		estimatedPayout.CurrentMonthExpectations += int64(payoutPerMin * estimatedMinutesJoinedCurrentMonth)
		return
	}
	// Joined this month
	minutesSinceJoined := now.Sub(joinedAt).Minutes()
	estimatedMinutesJoinedCurrentMonth := endOfMonth.Sub(joinedAt).Minutes()
	estimatedPayout.CurrentMonthExpectations += int64(estimatedPayout.CurrentMonth.Payout / minutesSinceJoined * estimatedMinutesJoinedCurrentMonth)
}