Ejemplo n.º 1
0
        public void Should_apply_inn_filter()
        {
            var docflowFilter = new DocflowFilterBuilder()
                                .WithInnKppOfALegalEntity(InnKpp.Parse("1234567890-123456789"))
                                .WithIndividualEntrepreneurInn(Inn.Parse("123456789012"))
                                .CreateFilter();

            ShouldHaveExpectedQueryParameters(docflowFilter, ("innKpp", "123456789012"));
        }
Ejemplo n.º 2
0
        public void Should_build_filter_with_non_dependent_fields()
        {
            var createdFrom = new DateTime(2021, 07, 08, 01, 01, 01);
            var createdTo   = new DateTime(2021, 07, 18, 01, 01, 01);
            var orgId       = Guid.Parse("047AE3BA-6F78-48BB-8460-A59A11C65C2E");
            var periodFrom  = new DateOnly(2021, 07, 08);
            var periodTo    = new DateOnly(2021, 07, 18);

            var docflowFilter = new DocflowFilterBuilder()
                                .WithFinishedDocflows()
                                .WithIncomingDocflows(false)
                                .WithCu(AuthorityCode.Pfr.Parse("123-456"))
                                .WithKnd(Knd.Parse("1234567"))
                                .WithOkpo(Okpo.LegalEntity.Parse("12345678"))
                                .WithInnKppOfALegalEntity(InnKpp.Parse("1234567890-123456789"))
                                .WithOkud(Okud.Parse("1234567"))
                                .WithRegNumberOfPfrDocflow(PfrRegNumber.Parse("123-456-789012"))
                                .WithTypes(DocflowType.Fns534Report, DocflowType.Fns534Letter)
                                .WithFormName("the form")
                                .WithCreatedFrom(createdFrom)
                                .WithCreatedTo(createdTo)
                                .WithDemandsOnReports()
                                .ForAllUsers(false)
                                .WithOrganizationId(orgId)
                                .WithReportingPeriod(periodFrom, periodTo)
                                .CreateFilter();

            ShouldHaveExpectedQueryParameters(
                docflowFilter,
                ("cu", "123-456"),
                ("finished", "true"),
                ("incoming", "false"),
                ("knd", "1234567"),
                ("okpo", "12345678"),
                ("okud", "1234567"),
                ("innKpp", "1234567890-123456789"),
                ("regNumber", "123-456-789012"),
                ("formName", "the form"),
                ("createdFrom", "2021-07-08T01:01:01.0000000"),
                ("createdTo", "2021-07-18T01:01:01.0000000"),
                ("demandsOnReports", "true"),
                ("forAllUsers", "false"),
                ("orgId", orgId.ToString()),
                ("periodFrom", "2021-07-08T00:00:00.0000000"),
                ("periodTo", "2021-07-18T00:00:00.0000000"),
                ("type", "fns534-report"),
                ("type", "fns534-letter")
                );
        }
 /// <summary>
 /// ИНН-КПП, для которых нужно получить документообороты для юрлиц. Формат данных для юрлиц: 1234567890-123456789, для ИП: 123456789012
 /// </summary>
 public DocflowFilterBuilder WithInnKppOfALegalEntity(string inn, string kpp)
 {
     filter.SetInnKpp(InnKpp.Parse($"{inn}-{kpp}").Value);
     return(this);
 }