예제 #1
0
        public SyncVatCodesCommand(IVatCodeService vatCodeService, IInOutService utilities, ILogger <SyncVatCodesCommand> logger) : base("sync",
                                                                                                                                         Descriptions.SyncVatCodeDescription)
        {
            _vatCodeService = vatCodeService;
            _utilities      = utilities;
            _logger         = logger;

            Add(new Option <FileInfo?>(new[] { "-i", "--input" }, () => null, Descriptions.InputVatCodeDescription)
            {
                IsRequired = true
            });
            Add(new Option <EFormatType>(new[] { "--input-format" }, () => EFormatType.JSON, Descriptions.InputFormatDescription)
            {
                IsRequired = true
            });
            Add(new Option <FileInfo?>(new[] { "-o", "--output" }, () => null, Descriptions.OutputDescription));
            Add(new Option <EFormatType>(new[] { "-f", "--format", "--output-format" }, () => EFormatType.JSON, Descriptions.FormatDescription));

            Handler = CommandHandler.Create <FileInfo, EFormatType, FileInfo?, EFormatType>(ImportVatCodesHandler);
        }
예제 #2
0
        public ListVatCodesCommand(
            IVatCodeService vatCodeService,
            IInOutService utilities,
            ILogger <ListVatCodesCommand> logger) :
            base("list", "Lists all known VatCodes in a company")
        {
            _vatCodeService = vatCodeService;
            _utilities      = utilities;
            _logger         = logger;

            Add(new Option <string?>(new[] { "-c", "--company-id" }, () => null, "The company identifier under which the VatCodes exists")
            {
                IsRequired = true
            });
            Add(new Option <string?>(new[] { "-q", "--query" }, () => null, Descriptions.QueryDescription));
            Add(new Option <EFormatType>(new[] { "-f", "--format" }, () => EFormatType.JSON, Descriptions.FormatDescription));
            Add(new Option <FileInfo?>(new[] { "-o", "--output" }, () => null, Descriptions.OutputDescription));

            Handler = CommandHandler.Create <string, string, EFormatType, FileInfo?>(ListVatCodesHandler);
        }