public Widget CreateNewFixedBudgetMonitorWidget(string bucketCode, string description, decimal fixedBudgetAmount)
{
if (string.IsNullOrWhiteSpace(bucketCode))
{
throw new ArgumentNullException(nameof(bucketCode));
}
if (string.IsNullOrWhiteSpace(description))
{
throw new ArgumentNullException(nameof(description));
}
if (fixedBudgetAmount <= 0)
{
throw new ArgumentException("Fixed Budget amount must be greater than zero.", nameof(fixedBudgetAmount));
}
var bucket = this.bucketRepository.CreateNewFixedBudgetProject(bucketCode, description, fixedBudgetAmount);
this.budgetRepository.SaveAsync();
var widget = this.widgetService.Create(typeof(FixedBudgetMonitorWidget).FullName, bucket.Code);
return UpdateWidgetCollectionWithNewAddition((Widget) widget);
}