Skip to content

Commit

Permalink
feat(application): add transport table concrete and base class for it
Browse files Browse the repository at this point in the history
  • Loading branch information
JeferssonCL committed Sep 12, 2024
1 parent 9391584 commit 908ab93
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace DistributionCenter.Application.Tables.Core.Bases;

using Components.Information.Interfaces;
using Components.QueryCommands.Concretes.File.Concretes;
using Components.QueryCommands.Interfaces;
using Connections.Interfaces;
using Domain.Entities.Interfaces;
using Interfaces;

public abstract class BaseJsonTable<T>(IFileConnectionFactory<T> fileConnectionFactory) : ITable<T>
where T : IEntity
{
protected IFileConnectionFactory<T> FileConnectionFactory { get; } = fileConnectionFactory;

public IQuery<T> GetById(Guid id)
{
throw new NotImplementedException();
}

public ICommand Create(T entity)
{
return new CreateJsonCommand<T>(
FileConnectionFactory,
entity);
}

public ICommand Update(T entity)
{
throw new NotImplementedException();
}

public abstract ITableInformation GetInformation();
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace DistributionCenter.Application.Tables.Core.Concretes;

using Components.Information.Concretes;
using Components.Information.Interfaces;
using Connections.Interfaces;
using Bases;
using DistributionCenter.Domain.Entities.Concretes;

public class TransportTable(IFileConnectionFactory<Transport> fileConnectionFactory) :
BaseJsonTable<Transport>(fileConnectionFactory)
{
public override ITableInformation GetInformation()
{
return new TransportTableInformation();
}
}

0 comments on commit 908ab93

Please sign in to comment.