- Ersetzung von ITranslateService durch IStringLocalizer<X> für verbesserte Lokalisierung. - Aktualisierung der DTO-Klassen entsprechend der neuesten Core.DTO-Struktur. - Integration der neuen Klassen Result und DataResult aus Core.DTO für standardisierte Serviceantworten.
24 lines
1.2 KiB
C#
24 lines
1.2 KiB
C#
using AutoMapper;
|
|
using DigitalData.Core.Application;
|
|
using Microsoft.Extensions.Localization;
|
|
using EnvelopeGenerator.Application.Contracts;
|
|
using EnvelopeGenerator.Application.DTOs;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
using EnvelopeGenerator.Infrastructure.Contracts;
|
|
using static EnvelopeGenerator.Common.Constants;
|
|
using EnvelopeGenerator.Application.Resources;
|
|
|
|
namespace EnvelopeGenerator.Application.Services
|
|
{
|
|
public class EnvelopeHistoryService : BasicCRUDService<IEnvelopeHistoryRepository, EnvelopeHistoryDto, EnvelopeHistory, long>, IEnvelopeHistoryService
|
|
{
|
|
public EnvelopeHistoryService(IEnvelopeHistoryRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper)
|
|
: base(repository, localizer, mapper)
|
|
{
|
|
}
|
|
|
|
public async Task<int> CountAsync(int? envelopeId = null, string? userReference = null, int? status = null) => await _repository.CountAsync(envelopeId: envelopeId, userReference: userReference, status: status);
|
|
|
|
public async Task<bool> AccessCodeAlreadyRequested(int envelopeId, string userReference) => await _repository.CountAsync(envelopeId: envelopeId, userReference:userReference, status: (int) EnvelopeStatus.AccessCodeRequested) > 0;
|
|
}
|
|
} |