Ejemplo n.º 1
0
 public WaybillContent(
     WaybillHeader header,
     IReadOnlyCollection <WaybillItem> items,
     WaybillTotals totals)
 {
     Header = header ?? throw new ArgumentNullException(nameof(header));
     Items  = items ?? throw new ArgumentNullException(nameof(items));
     Totals = totals ?? throw new ArgumentNullException(nameof(totals));
 }
Ejemplo n.º 2
0
        private static WaybillContent MapToModel(this WaybillContentDto dto)
        {
            var documentHeader = new WaybillHeader(
                documentNumber: dto.DocumentNumber,
                documentDate: dto.DocumentDate,
                consignee: dto.Consignee);

            var documentItems = dto.Items
                                .Select(WaybillItemMapper.MapToModel)
                                .ToArray();

            var documentTotals = new WaybillTotals(
                totalSumWithoutVat: dto.TotalSumWithVat,
                totalVatSum: dto.TotalVat,
                totalSumWithVat: dto.TotalSumWithoutVat);

            return(new WaybillContent(
                       header: documentHeader,
                       items: documentItems,
                       totals: documentTotals));
        }
Ejemplo n.º 3
0
        public Task <WaybillContent> Parse(Stream waybillFileStream)
        {
            var header = new WaybillHeader(
                documentDate: new DateTime(2019, 06, 28),
                documentNumber: "1",
                consignee: "ООО ВЕКТОР"
                );

            var totals = new WaybillTotals(
                totalSumWithoutVat: 80508.47m,
                totalVatSum: 14491.53m,
                totalSumWithVat: 95000m
                );

            var content = new WaybillContent(
                header,
                new[] { CreateItem() },
                totals
                );

            return(Task.FromResult(content));
        }