From 908ab933d5d29a8293abd226948206201e6ad323 Mon Sep 17 00:00:00 2001 From: JeferssonCL Date: Wed, 11 Sep 2024 21:32:46 -0400 Subject: [PATCH] feat(application): add transport table concrete and base class for it --- .../Tables/Core/Bases/BaseJsonTable.cs | 34 +++++++++++++++++++ .../Tables/Core/Concretes/TransportTable.cs | 16 +++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/DistributionCenter.Application/Tables/Core/Bases/BaseJsonTable.cs create mode 100644 src/DistributionCenter.Application/Tables/Core/Concretes/TransportTable.cs diff --git a/src/DistributionCenter.Application/Tables/Core/Bases/BaseJsonTable.cs b/src/DistributionCenter.Application/Tables/Core/Bases/BaseJsonTable.cs new file mode 100644 index 0000000..6f33d6d --- /dev/null +++ b/src/DistributionCenter.Application/Tables/Core/Bases/BaseJsonTable.cs @@ -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(IFileConnectionFactory fileConnectionFactory) : ITable + where T : IEntity +{ + protected IFileConnectionFactory FileConnectionFactory { get; } = fileConnectionFactory; + + public IQuery GetById(Guid id) + { + throw new NotImplementedException(); + } + + public ICommand Create(T entity) + { + return new CreateJsonCommand( + FileConnectionFactory, + entity); + } + + public ICommand Update(T entity) + { + throw new NotImplementedException(); + } + + public abstract ITableInformation GetInformation(); +} + diff --git a/src/DistributionCenter.Application/Tables/Core/Concretes/TransportTable.cs b/src/DistributionCenter.Application/Tables/Core/Concretes/TransportTable.cs new file mode 100644 index 0000000..ffc1874 --- /dev/null +++ b/src/DistributionCenter.Application/Tables/Core/Concretes/TransportTable.cs @@ -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 fileConnectionFactory) : + BaseJsonTable(fileConnectionFactory) +{ + public override ITableInformation GetInformation() + { + return new TransportTableInformation(); + } +}