func CancelBalanceDelta(tr Training, cancelingUserType UserType) int {
	if tr.CanBeCanceledForFree() {
		return 1
	}
	switch cancelingUserType {
	case Trainer:
		return 2
	case Attendee:
		return 0
	default:
		panic(fmt.Sprintf("not supported user type %s", cancelingUserType))
	}
}
CancelBalanceDelta return trainings balance delta that should be adjusted after training cancellation.
package training
import "fmt"