BillingPlanAddCommand.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using BO.AppServer.Metadata.Dto;
  2. using BO.Console.Commands.Base;
  3. using Quadarax.Foundation.Core.QConsole;
  4. using Quadarax.Foundation.Core.QConsole.Attributes;
  5. namespace BO.Console.Commands.Catalogues
  6. {
  7. [CommandDefinition]
  8. internal class BillingPlanAddCommand : AbstractPostCommand<BillingPlanCDto, BillingPlanRDto>
  9. {
  10. #region *** Constants ***
  11. private const string CS_CMD_BPLANADD_NAME = "bplan_add";
  12. private const string CS_CMD_BPLANADD_DESCR = "Add new billing plan/s by import file.";
  13. #endregion
  14. #region *** Properties ***
  15. public override string Name => CS_CMD_BPLANADD_NAME;
  16. public override string Description => CS_CMD_BPLANADD_DESCR;
  17. #endregion
  18. #region *** Constructor ***
  19. public BillingPlanAddCommand(Engine engine) : base(engine)
  20. {
  21. }
  22. #endregion
  23. #region *** EXECUTE ***
  24. protected override BillingPlanRDto IterationExecute(BillingPlanCDto data)
  25. {
  26. WriteDebugInfo($"MimeType '{data.Code}' starts creating...");
  27. var result = Client.CreateBillingPlanAsync(data).Result;
  28. WriteCaption($"BillingPlan '{data.Code}' created.");
  29. return result;
  30. }
  31. #endregion
  32. #region *** Private operations ***
  33. #endregion
  34. }
  35. }