scroogie models update

This commit is contained in:
devil_1nc 2024-06-11 12:18:10 +04:00
parent 3ac33fa276
commit c7e0c3823a
29 changed files with 491 additions and 0 deletions

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BindingModels
{
public class MediaFileBindingModel
{
public Guid Id { get; set; }
public Guid ProductId { get; set; }
public string Location { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BindingModels
{
public class ProductBindingModel
{
public Guid Id { get; set; }
public string Name { get; set; } = string.Empty;
public double Price { get; set; }
public int Amount { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BindingModels
{
public class PurchaseBindingModel
{
public Guid Id { get; set; }
public DateTime DatePurchase { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BindingModels
{
public class SellBindingModel
{
public DateTime DateSell { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BusinessLogicContracts
{
public interface IEmployeeProductLogic
{
EmployeeProductViewModel Create(ProductBindingModel model);
EmployeeProductViewModel Update(ProductBindingModel model);
EmployeeProductViewModel ReadElement(ProductSearchModel model);
IEnumerable<EmployeeProductViewModel> ReadElements(ProductSearchModel? model);
EmployeeProductViewModel Delete(ProductSearchModel model);
}
}

View File

@ -0,0 +1,24 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BusinessLogicContracts
{
public interface IPurchaseLogic
{
PurchaseViewModel Create(PurchaseBindingModel model);
PurchaseViewModel Update(PurchaseBindingModel model);
PurchaseViewModel ReadElement(PurchaseSearchModel model);
IEnumerable<PurchaseViewModel> ReadElements(PurchaseSearchModel? model);
PurchaseViewModel Delete(PurchaseSearchModel model);
}
}

View File

@ -0,0 +1,24 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BusinessLogicContracts
{
public interface ISellLogic
{
SellViewModel Create(SellBindingModel model);
SellViewModel Update(SellBindingModel model);
SellViewModel ReadElement(SellSearchModel model);
IEnumerable<SellViewModel> ReadElements(SellSearchModel? model);
SellViewModel Delete(SellSearchModel model);
}
}

View File

@ -0,0 +1,21 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BusinessLogicContracts
{
public interface IUserProductLogic
{
UserProductViewModel ReadElement(ProductSearchModel model);
IEnumerable<UserProductViewModel> ReadElements(ProductSearchModel? model);
UserProductViewModel Delete(ProductSearchModel model);
}
}

View File

@ -6,4 +6,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DataModels\DataModels.csproj" />
</ItemGroup>
</Project> </Project>

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.SearchModels
{
public class ProductSearchModel
{
public Guid? Id { get; set; }
public string? Name { get; set; }
public double? Price { get; set; }
public double? Rate { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using DataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.SearchModels
{
public class PurchaseSearchModel
{
public Guid? Id { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public double? PriceFrom { get; set; }
public double? PriceTo { get; set; }
public PurchaseStatus? Status { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.SearchModels
{
public class SellSearchModel
{
public Guid? Id { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public Guid? SupplyDocId { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.StorageContracts
{
public interface IProductStorage
{
ProductBindingModel? Insert(ProductBindingModel model);
IEnumerable<ProductBindingModel> GetList(ProductSearchModel? model);
ProductBindingModel? GetElement(ProductSearchModel model);
ProductBindingModel? Update(ProductBindingModel model);
ProductBindingModel? Delete(ProductSearchModel model);
}
}

View File

@ -0,0 +1,23 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.StorageContracts
{
public interface IPurchaseStorage
{
PurchaseBindingModel? Insert(PurchaseBindingModel model);
IEnumerable<PurchaseBindingModel> GetList(PurchaseSearchModel? model);
PurchaseBindingModel? GetElement(PurchaseSearchModel model);
PurchaseBindingModel? Update(PurchaseBindingModel model);
PurchaseBindingModel? Delete(PurchaseSearchModel model);
}
}

View File

@ -0,0 +1,23 @@
using Contracts.BindingModels;
using Contracts.SearchModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.StorageContracts
{
public interface ISellStorage
{
SellBindingModel? Insert(SellBindingModel model);
IEnumerable<SellBindingModel> GetList(SellSearchModel? model);
SellBindingModel? GetElement(SellSearchModel model);
SellBindingModel? Update(SellBindingModel model);
SellBindingModel? Delete(SellSearchModel model);
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.ViewModels
{
public class EmployeeProductViewModel
{
public Guid Guid { get; set; }
public string Name { get; set; } = string.Empty;
public double Price { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using DataModels.Enums;
using DataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.ViewModels
{
public class PurchaseViewModel
{
public Guid Id { get; set; }
public DateTime PurchaseDate { get; set; }
public required IUser User { get; set; }
public required List<IProduct> Products { get; set; }
public PurchaseStatus Status { get; set; }
}
}

View File

@ -0,0 +1,16 @@
using DataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.ViewModels
{
public class SellViewModel
{
public Guid Id { get; set; }
public DateTime SellDate { get; set; }
public ISupplyDoc? SupplyDoc { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.ViewModels
{
public class UserProductViewModel
{
public string Name { get; set; } = string.Empty;
public double Price { get; set; }
public double Rate { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataModels.Enums
{
public enum PurchaseStatus
{
Unknown = -1,
Processing = 0,
Complited = 1
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataModels.Models
{
public interface IMediaFile
{
string Name { get; }
string Location { get; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataModels.Models
{
public interface IProduct : IId
{
string Name { get; }
double Price { get; }
bool IBeingSold { get; }
public double Rate { get; }
int Amount { get; }
}
}

View File

@ -0,0 +1,15 @@
using DataModels.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataModels.Models
{
public interface IPurchase : IId
{
DateTime DatePurchase { get; }
PurchaseStatus Status { get; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataModels.Models
{
public interface ISell : IId
{
DateTime DateSell { get; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataModels.Models
{
public interface ISupplyDoc : IId
{
string Name { get; }
}
}

View File

@ -0,0 +1,18 @@
using DataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Models
{
public class MediaFile : IMediaFile
{
[Required]
public string Name { get; set; }
[Required]
public string Location { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Models
{
public class Product
{
}
}

View File

@ -0,0 +1,21 @@
using DataModels.Enums;
using DataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Models
{
public class Purchase : IPurchase
{
public Guid Id { get; set; }
[Required]
public DateTime DatePurchase { get; set; }
[Required]
public PurchaseStatus Status { get; private set; } = PurchaseStatus.Unknown;
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Models
{
internal class Sell
{
}
}