• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

b1f6c1c4 / ProfessionalAccounting / 320

16 Oct 2024 05:07PM UTC coverage: 55.799% (-1.1%) from 56.944%
320

push

appveyor

b1f6c1c4
final taobao

6264 of 11226 relevant lines covered (55.8%)

126.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/AccountingServer.BLL/Util/QueryHelper.cs
1
/* Copyright (C) 2020-2024 b1f6c1c4
2
 *
3
 * This file is part of ProfessionalAccounting.
4
 *
5
 * ProfessionalAccounting is free software: you can redistribute it and/or
6
 * modify it under the terms of the GNU Affero General Public License as
7
 * published by the Free Software Foundation, version 3.
8
 *
9
 * ProfessionalAccounting is distributed in the hope that it will be useful, but
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License
12
 * for more details.
13
 *
14
 * You should have received a copy of the GNU Affero General Public License
15
 * along with ProfessionalAccounting.  If not, see
16
 * <https://www.gnu.org/licenses/>.
17
 */
18

19
using AccountingServer.Entities;
20

21
namespace AccountingServer.BLL.Util;
22

23
public abstract class BinaryQueries<TAtom> : IQueryAry<TAtom> where TAtom : class
24
{
25
    protected BinaryQueries(IQueryCompounded<TAtom> filter1,
×
26
        IQueryCompounded<TAtom> filter2)
27
    {
×
28
        Filter1 = filter1;
×
29
        Filter2 = filter2;
×
30
    }
×
31

32
    public abstract OperatorType Operator { get; }
33

34
    public IQueryCompounded<TAtom> Filter1 { get; }
35

36
    public IQueryCompounded<TAtom> Filter2 { get; }
37

38
    public T Accept<T>(IQueryVisitor<TAtom, T> visitor) => visitor.Visit(this);
×
39
}
40

41
public sealed class IntersectQueries<TAtom> : BinaryQueries<TAtom> where TAtom : class
42
{
43
    public IntersectQueries(IQueryCompounded<TAtom> filter1,
44
        IQueryCompounded<TAtom> filter2) : base(filter1, filter2) { }
×
45

46
    public override OperatorType Operator => OperatorType.Intersect;
×
47
}
48

49
public sealed class UnionQueries<TAtom> : BinaryQueries<TAtom> where TAtom : class
50
{
51
    public UnionQueries(IQueryCompounded<TAtom> filter1,
52
        IQueryCompounded<TAtom> filter2) : base(filter1, filter2) { }
×
53

54
    public override OperatorType Operator => OperatorType.Union;
×
55
}
56

57
public sealed class SimpleDetailQuery : IDetailQueryAtom
58
{
59
    public TitleKind? Kind { get; init; }
60
    public VoucherDetail Filter { get; init; }
61
    public bool? IsPseudoCurrency { get; init; }
62
    public bool IsFundBidirectional { get; init; }
63
    public int Dir { get; init; }
64
    public string ContentPrefix { get; init; }
65
    public string RemarkPrefix { get; init; }
66
    public T Accept<T>(IQueryVisitor<IDetailQueryAtom, T> visitor) => visitor.Visit(this);
×
67
}
68

69
public sealed class SimpleVoucherQuery : IVoucherQueryAtom
70
{
71
    public bool ForAll { get; init; } = false;
×
72
    public Voucher VoucherFilter { get; init; } = null;
×
73
    public DateFilter Range { get; init; } = DateFilter.Unconstrained;
×
74
    public string RemarkPrefix { get; init; } = null;
×
75
    public IQueryCompounded<IDetailQueryAtom> DetailFilter { get; init; } = null;
×
76
    public T Accept<T>(IQueryVisitor<IVoucherQueryAtom, T> visitor) => visitor.Visit(this);
×
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc