func (P *Portfolio) Refresh(date time.Time) []Investment {
	idxsOutdatedInvs := searchOutdatedInvestments(P.Investments, date)
	outdatedInvs := make([]Investment, 0)
	for _, idx := range idxsOutdatedInvs {
		P.PastInvestments = append(P.PastInvestments, P.Investments[idx])
		outdatedInvs = append(outdatedInvs, P.Investments[idx])
	}
	P.Investments = removeSeveralU(P.Investments, idxsOutdatedInvs)
	return outdatedInvs
}
// Refresh refreshes Portfolio based on the date,
// Moves Investments with EndDate > date to PastInvestments
// returns moved Investments to PastInvestments
Refresh refreshes Portfolio based on the date,
Moves Investments with EndDate > date to PastInvestments
returns moved Investments to PastInvestments
// Refresh refreshes Portfolio based on the date // Moves Investments with EndDate > date to PastInvestments // returns moved Investments to PastInvestments
func (P *Portfolio) Refresh(date time.Time) []Investment {
	idxsOutdatedInvs := searchOutdatedInvestments(P.Investments, date)
	outdatedInvs := make([]Investment, 0)
	for _, idx := range idxsOutdatedInvs {
		P.PastInvestments = append(P.PastInvestments, P.Investments[idx])
		outdatedInvs = append(outdatedInvs, P.Investments[idx])
	}
	P.Investments = removeSeveralU(P.Investments, idxsOutdatedInvs)
	return outdatedInvs
}
func ( P * Portfolio ) Refresh ( date time . Time ) [ ] Investment { idxsOutdatedInvs := searchOutdatedInvestments ( P . Investments , date ) outdatedInvs := make ( [ ] Investment , 0 ) for _ , idx := range idxsOutdatedInvs { P . PastInvestments = append ( P . PastInvestments , P . Investments [ idx ] ) outdatedInvs = append ( outdatedInvs , P . Investments [ idx ] ) } P . Investments = removeSeveralU ( P . Investments , idxsOutdatedInvs ) return outdatedInvs }
Refresh refreshes Portfolio based on the date,
Moves Investments with EndDate > date to PastInvestments
returns moved Investments to PastInvestments
Refresh refreshes Portfolio based on the date Moves Investments with EndDate > date to PastInvestments returns moved Investments to PastInvestments