package gw.api.history uses gw.api.util.LocaleUtil uses java.util.Date uses java.util.concurrent.Callable class PolicyTermCustomHistoryImpl extends AbstractCustomHistoryImpl { var policyTerm : PolicyTerm construct(owner : PolicyTerm) { super() policyTerm = owner } override function createCustomHistoryEvent(type : CustomHistoryType, description : Callable) : History { var history = new History(policyTerm) history.PolicyTerm = policyTerm history.Policy = policyTerm.Policy history.Account = policyTerm.Policy.Account history.User = User.util.CurrentUser history.EventTimestamp = Date.CurrentDate history.Type = HistoryType.TC_CUSTOM history.CustomType = type if (description != null) { LocaleUtil.runAsCurrentLanguage(LocaleUtil.toLanguage(policyTerm.Policy.PrimaryLanguage), \ -> { history.Description = description.call() }) } return history } }