-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gestione Filtri. Related work items: #547
- Loading branch information
Showing
45 changed files
with
929 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...Infrastructure/Common/SEND/DatiRel/Queries/Persistence/RelAnniQueryByIdEntePersistence.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Data; | ||
using System.Dynamic; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence.Builder; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
public class RelAnniQueryByIdEntePersistence(RelAnniByIdEnteQuery command) : DapperBase, IQuery<IEnumerable<string>?> | ||
{ | ||
private readonly RelAnniByIdEnteQuery _command = command; | ||
private static readonly string _sql = RelTestataSQLBuilder.SelectAnni(); | ||
private static readonly string _orderBy = RelTestataSQLBuilder.GroupByOrderByYear; | ||
public async Task<IEnumerable<string>?> Execute(IDbConnection? connection, string schema, IDbTransaction? transaction, CancellationToken cancellationToken = default) | ||
{ | ||
var authInfo = _command.AuthenticationInfo; | ||
dynamic parameters = new ExpandoObject(); | ||
|
||
var where = " WHERE internal_organization_id=@IdEnte "; | ||
parameters.IdEnte = authInfo.IdEnte; | ||
|
||
return await ((IDatabase)this).SelectAsync<string>( | ||
connection!, _sql + where + _orderBy, parameters, transaction); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ture.BE.Infrastructure/Common/SEND/DatiRel/Queries/Persistence/RelAnniQueryPersistence.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Data; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence.Builder; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
public class RelAnniQueryPersistence(RelAnniQuery command) : DapperBase, IQuery<IEnumerable<string>?> | ||
{ | ||
private readonly RelAnniQuery _command = command; | ||
private static readonly string _sql = RelTestataSQLBuilder.SelectAnni(); | ||
private static readonly string _orderBy = RelTestataSQLBuilder.OrderByYear; | ||
public async Task<IEnumerable<string>?> Execute(IDbConnection? connection, string schema, IDbTransaction? transaction, CancellationToken cancellationToken = default) | ||
{ | ||
|
||
return await ((IDatabase)this).SelectAsync<string>( | ||
connection!, _sql + _orderBy, _command, transaction); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...Infrastructure/Common/SEND/DatiRel/Queries/Persistence/RelMesiByIdEnteQueryPersistence.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Data; | ||
using System.Dynamic; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence.Builder; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
public class RelMesiByIdEnteQueryPersistence(RelMesiByIdEnteQuery command) : DapperBase, IQuery<IEnumerable<string>?> | ||
{ | ||
private readonly RelMesiByIdEnteQuery _command = command; | ||
private static readonly string _sql = RelTestataSQLBuilder.SelectMesi(); | ||
private static readonly string _orderBy = RelTestataSQLBuilder.GroupByMonthByYear; | ||
public async Task<IEnumerable<string>?> Execute(IDbConnection? connection, string schema, IDbTransaction? transaction, CancellationToken cancellationToken = default) | ||
{ | ||
var authInfo = _command.AuthenticationInfo; | ||
dynamic parameters = new ExpandoObject(); | ||
var where = " WHERE year=@anno "; | ||
parameters.Anno = _command.Anno; | ||
where += " AND internal_organization_id=@IdEnte "; | ||
parameters.IdEnte = authInfo.IdEnte; | ||
return await ((IDatabase)this).SelectAsync<string>( | ||
connection!, _sql + where + _orderBy, parameters, transaction); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ture.BE.Infrastructure/Common/SEND/DatiRel/Queries/Persistence/RelMesiQueryPersistence.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Data; | ||
using System.Dynamic; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence.Builder; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
public class RelMesiQueryPersistence(RelMesiQuery command) : DapperBase, IQuery<IEnumerable<string>?> | ||
{ | ||
private readonly RelMesiQuery _command = command; | ||
private static readonly string _sql = RelTestataSQLBuilder.SelectMesi(); | ||
private static readonly string _orderBy = RelTestataSQLBuilder.OrderByMonth; | ||
public async Task<IEnumerable<string>?> Execute(IDbConnection? connection, string schema, IDbTransaction? transaction, CancellationToken cancellationToken = default) | ||
{ | ||
dynamic parameters = new ExpandoObject(); | ||
var where = string.Empty; | ||
if (!string.IsNullOrEmpty(_command.Anno)) | ||
{ | ||
where += " WHERE year=@anno "; | ||
parameters.Anno = _command.Anno; | ||
} | ||
|
||
return await ((IDatabase)this).SelectAsync<string>( | ||
connection!, _sql + where + _orderBy, parameters, transaction); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...ture/PortaleFatture.BE.Infrastructure/Common/SEND/DatiRel/Queries/RelAnniByIdEnteQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
public class RelAnniByIdEnteQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
public string? IdContratto { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
...frastructure/PortaleFatture.BE.Infrastructure/Common/SEND/DatiRel/Queries/RelAnniQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
public class RelAnniQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
} |
13 changes: 13 additions & 0 deletions
13
...ture/PortaleFatture.BE.Infrastructure/Common/SEND/DatiRel/Queries/RelMesiByIdEnteQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
|
||
public class RelMesiByIdEnteQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
|
||
public string? Anno { get; set; } | ||
|
||
public string? IdContratto { get; set; } | ||
} |
11 changes: 11 additions & 0 deletions
11
...frastructure/PortaleFatture.BE.Infrastructure/Common/SEND/DatiRel/Queries/RelMesiQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
|
||
public class RelMesiQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
|
||
public string? Anno { get; set; } | ||
} |
24 changes: 24 additions & 0 deletions
24
...taleFatture.BE.Infrastructure/Common/SEND/DatiRel/QueryHandlers/RelAnniByIdEnteHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using MediatR; | ||
using Microsoft.Extensions.Localization; | ||
using Microsoft.Extensions.Logging; | ||
using PortaleFatture.BE.Core.Resources; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence.Schemas; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.QueryHandlers; | ||
|
||
public class RelAnniByIdEnteHandler( | ||
IFattureDbContextFactory factory, | ||
IStringLocalizer<Localization> localizer, | ||
ILogger<RelAnniByIdEnteHandler> logger) : IRequestHandler<RelAnniByIdEnteQuery, IEnumerable<string>?> | ||
{ | ||
private readonly IFattureDbContextFactory _factory = factory; | ||
private readonly ILogger<RelAnniByIdEnteHandler> _logger = logger; | ||
private readonly IStringLocalizer<Localization> _localizer = localizer; | ||
public async Task<IEnumerable<string>?> Handle(RelAnniByIdEnteQuery request, CancellationToken ct) | ||
{ | ||
using var rs = await _factory.Create(cancellationToken: ct); | ||
return await rs.Query(new RelAnniQueryByIdEntePersistence(request), ct); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ture/PortaleFatture.BE.Infrastructure/Common/SEND/DatiRel/QueryHandlers/RelAnniHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using MediatR; | ||
using Microsoft.Extensions.Localization; | ||
using Microsoft.Extensions.Logging; | ||
using PortaleFatture.BE.Core.Resources; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence.Schemas; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.QueryHandlers; | ||
|
||
public class RelAnniHandler( | ||
IFattureDbContextFactory factory, | ||
IStringLocalizer<Localization> localizer, | ||
ILogger<RelAnniHandler> logger) : IRequestHandler<RelAnniQuery, IEnumerable<string>?> | ||
{ | ||
private readonly IFattureDbContextFactory _factory = factory; | ||
private readonly ILogger<RelAnniHandler> _logger = logger; | ||
private readonly IStringLocalizer<Localization> _localizer = localizer; | ||
public async Task<IEnumerable<string>?> Handle(RelAnniQuery request, CancellationToken ct) | ||
{ | ||
using var rs = await _factory.Create(cancellationToken: ct); | ||
return await rs.Query(new RelAnniQueryPersistence(request), ct); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...taleFatture.BE.Infrastructure/Common/SEND/DatiRel/QueryHandlers/RelMesiByIdEnteHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using MediatR; | ||
using Microsoft.Extensions.Localization; | ||
using Microsoft.Extensions.Logging; | ||
using PortaleFatture.BE.Core.Resources; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence.Schemas; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.QueryHandlers; | ||
|
||
public class RelMesiByIdEnteHandler( | ||
IFattureDbContextFactory factory, | ||
IStringLocalizer<Localization> localizer, | ||
ILogger<RelMesiByIdEnteHandler> logger) : IRequestHandler<RelMesiByIdEnteQuery, IEnumerable<string>?> | ||
{ | ||
private readonly IFattureDbContextFactory _factory = factory; | ||
private readonly ILogger<RelMesiByIdEnteHandler> _logger = logger; | ||
private readonly IStringLocalizer<Localization> _localizer = localizer; | ||
public async Task<IEnumerable<string>?> Handle(RelMesiByIdEnteQuery request, CancellationToken ct) | ||
{ | ||
using var rs = await _factory.Create(cancellationToken: ct); | ||
return await rs.Query(new RelMesiByIdEnteQueryPersistence(request), ct); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ture/PortaleFatture.BE.Infrastructure/Common/SEND/DatiRel/QueryHandlers/RelMesiHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using MediatR; | ||
using Microsoft.Extensions.Localization; | ||
using Microsoft.Extensions.Logging; | ||
using PortaleFatture.BE.Core.Resources; | ||
using PortaleFatture.BE.Infrastructure.Common.Persistence.Schemas; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries; | ||
using PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.Queries.Persistence; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.DatiRel.QueryHandlers; | ||
|
||
public class RelMesiHandler( | ||
IFattureDbContextFactory factory, | ||
IStringLocalizer<Localization> localizer, | ||
ILogger<RelMesiHandler> logger) : IRequestHandler<RelMesiQuery, IEnumerable<string>?> | ||
{ | ||
private readonly IFattureDbContextFactory _factory = factory; | ||
private readonly ILogger<RelMesiHandler> _logger = logger; | ||
private readonly IStringLocalizer<Localization> _localizer = localizer; | ||
public async Task<IEnumerable<string>?> Handle(RelMesiQuery request, CancellationToken ct) | ||
{ | ||
using var rs = await _factory.Create(cancellationToken: ct); | ||
return await rs.Query(new RelMesiQueryPersistence(request), ct); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...tructure/PortaleFatture.BE.Infrastructure/Common/SEND/Fatture/Queries/FattureAnniQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.Fatture.Queries; | ||
|
||
|
||
public class FattureAnniQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
} |
11 changes: 11 additions & 0 deletions
11
...tructure/PortaleFatture.BE.Infrastructure/Common/SEND/Fatture/Queries/FattureMesiQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.Fatture.Queries; | ||
|
||
public class FattureMesiQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
|
||
public string? Anno { get; set; } | ||
} |
12 changes: 12 additions & 0 deletions
12
...aleFatture.BE.Infrastructure/Common/SEND/Fatture/Queries/FattureTipologiaAnniMeseQuery.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using MediatR; | ||
using PortaleFatture.BE.Core.Auth; | ||
|
||
namespace PortaleFatture.BE.Infrastructure.Common.SEND.Fatture.Queries; | ||
|
||
public class FattureTipologiaAnniMeseQuery(IAuthenticationInfo authenticationInfo) : IRequest<IEnumerable<string>?> | ||
{ | ||
public IAuthenticationInfo AuthenticationInfo { get; internal set; } = authenticationInfo; | ||
|
||
public int? Anno { get; set; } | ||
public int? Mese { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.