Merge pull request 'Создание контрактов для роли "Поручитель" и также небольшая правка в слое моделей' (#5) from Создание_контрактов_роль_поручитель into main
Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class GuarantorBindingModel : IGuarantorModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string GuarantorFIO { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string GuarantorEmail { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string GuarantorPassword { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string GuarantorNumber { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using ServiceStationDataModels.Enums;
|
||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class RepairBindingModel : IRepairModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string RepairName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public RepairStatus Status { get; set; } = RepairStatus.Неизвестен;
|
||||||
|
|
||||||
|
public double RepairPrice { get; set; }
|
||||||
|
|
||||||
|
public int GuarantorId { get; set; }
|
||||||
|
|
||||||
|
public int DefectId { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<int, ISparePartModel> RepairSpareParts { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class SparePartBindingModel : ISparePartModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string SparePartName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double SparePartPrice { get; set; }
|
||||||
|
|
||||||
|
public int GuarantorId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using ServiceStationDataModels.Enums;
|
||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BindingModels
|
||||||
|
{
|
||||||
|
public class WorkBindingModel : IWorkModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public string WorkName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public WorkStatus Status { get; set; } = WorkStatus.Неизвестен;
|
||||||
|
|
||||||
|
public double WorkPrice { get; set; }
|
||||||
|
|
||||||
|
public int GuarantorId { get; set; }
|
||||||
|
|
||||||
|
public int TechnicalWorkId { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<int, ISparePartModel> WorkSpareParts { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IGuarantorLogic
|
||||||
|
{
|
||||||
|
List<GuarantorViewModel>? ReadList(GuarantorSearchModel? model);
|
||||||
|
GuarantorViewModel? ReadElement(GuarantorSearchModel? model);
|
||||||
|
|
||||||
|
bool Create(GuarantorBindingModel model);
|
||||||
|
bool Update(GuarantorBindingModel model);
|
||||||
|
bool Delete(GuarantorBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IRepairLogic
|
||||||
|
{
|
||||||
|
List<RepairViewModel>? ReadList(RepairSearchModel? model);
|
||||||
|
RepairViewModel? ReadElement(RepairSearchModel? model);
|
||||||
|
|
||||||
|
bool Create(RepairBindingModel model);
|
||||||
|
bool Update(RepairBindingModel model);
|
||||||
|
bool Delete(RepairBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface ISparePartLogic
|
||||||
|
{
|
||||||
|
List<SparePartViewModel>? ReadList(SparePartSearchModel? model);
|
||||||
|
SparePartViewModel? ReadElement(SparePartSearchModel? model);
|
||||||
|
|
||||||
|
bool Create(SparePartBindingModel model);
|
||||||
|
bool Update(SparePartBindingModel model);
|
||||||
|
bool Delete(SparePartBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.BusinessLogicsContracts
|
||||||
|
{
|
||||||
|
public interface IWorkLogic
|
||||||
|
{
|
||||||
|
List<WorkViewModel>? ReadList(WorkSearchModel? model);
|
||||||
|
WorkViewModel? ReadElement(WorkSearchModel? model);
|
||||||
|
|
||||||
|
bool Create(WorkBindingModel model);
|
||||||
|
bool Update(WorkBindingModel model);
|
||||||
|
bool Delete(WorkBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class GuarantorSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? GuarantorFIO { get; set; }
|
||||||
|
public string? GuarantorEmail { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class RepairSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? RepairName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class SparePartSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? SparePartName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class WorkSearchModel
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
public string? WorkName { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface IGuarantorStorage
|
||||||
|
{
|
||||||
|
List<GuarantorViewModel> GetFullList();
|
||||||
|
List<GuarantorViewModel> GetFilteredList(GuarantorSearchModel model);
|
||||||
|
|
||||||
|
GuarantorViewModel? GetElement(GuarantorSearchModel model);
|
||||||
|
GuarantorViewModel? Insert(GuarantorBindingModel model);
|
||||||
|
GuarantorViewModel? Update(GuarantorBindingModel model);
|
||||||
|
GuarantorViewModel? Delete(GuarantorBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface IRepairStorage
|
||||||
|
{
|
||||||
|
List<RepairViewModel> GetFullList();
|
||||||
|
List<RepairViewModel> GetFilteredList(RepairSearchModel model);
|
||||||
|
|
||||||
|
RepairViewModel? GetElement(RepairSearchModel model);
|
||||||
|
RepairViewModel? Insert(RepairBindingModel model);
|
||||||
|
RepairViewModel? Update(RepairBindingModel model);
|
||||||
|
RepairViewModel? Delete(RepairBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface ISparePartStorage
|
||||||
|
{
|
||||||
|
List<SparePartViewModel> GetFullList();
|
||||||
|
List<SparePartViewModel> GetFilteredList(SparePartSearchModel model);
|
||||||
|
|
||||||
|
SparePartViewModel? GetElement(SparePartSearchModel model);
|
||||||
|
SparePartViewModel? Insert(SparePartBindingModel model);
|
||||||
|
SparePartViewModel? Update(SparePartBindingModel model);
|
||||||
|
SparePartViewModel? Delete(SparePartBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
using ServiceStationContracts.BindingModels;
|
||||||
|
using ServiceStationContracts.SearchModels;
|
||||||
|
using ServiceStationContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.StoragesContracts
|
||||||
|
{
|
||||||
|
public interface IWorkStorage
|
||||||
|
{
|
||||||
|
List<WorkViewModel> GetFullList();
|
||||||
|
List<WorkViewModel> GetFilteredList(WorkSearchModel model);
|
||||||
|
|
||||||
|
WorkViewModel? GetElement(WorkSearchModel model);
|
||||||
|
WorkViewModel? Insert(WorkBindingModel model);
|
||||||
|
WorkViewModel? Update(WorkBindingModel model);
|
||||||
|
WorkViewModel? Delete(WorkBindingModel model);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class GuarantorViewModel : IGuarantorModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("ФИО поручителя")]
|
||||||
|
public string GuarantorFIO { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Почта поручителя(логин)")]
|
||||||
|
public string GuarantorEmail { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Пароль поручителя")]
|
||||||
|
public string GuarantorPassword { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Номер телефона поручителя")]
|
||||||
|
public string GuarantorNumber { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using ServiceStationDataModels.Enums;
|
||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class RepairViewModel : IRepairModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Наименование ремонта")]
|
||||||
|
public string RepairName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Статус ремонта")]
|
||||||
|
public RepairStatus Status { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Стоимость ремонта")]
|
||||||
|
public double RepairPrice { get; set; }
|
||||||
|
|
||||||
|
public int GuarantorId { get; }
|
||||||
|
|
||||||
|
public int DefectId { get; }
|
||||||
|
|
||||||
|
public Dictionary<int, ISparePartModel> RepairSpareParts { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class SparePartViewModel : ISparePartModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Наименование запчасти")]
|
||||||
|
public string SparePartName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Стоимость запчасти")]
|
||||||
|
public double SparePartPrice { get; set; }
|
||||||
|
|
||||||
|
public int GuarantorId { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
using ServiceStationDataModels.Enums;
|
||||||
|
using ServiceStationDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ServiceStationContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class WorkViewModel : IWorkModel
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("наименование работы")]
|
||||||
|
public string WorkName { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Статус работы")]
|
||||||
|
public WorkStatus Status { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("Стоимость работы")]
|
||||||
|
public double WorkPrice { get; set; }
|
||||||
|
|
||||||
|
public int GuarantorId { get; }
|
||||||
|
|
||||||
|
public int TechnicalWorkId { get; }
|
||||||
|
|
||||||
|
public Dictionary<int, ISparePartModel> WorkSpareParts { get; } = new();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ namespace ServiceStationDataModels.Models
|
|||||||
|
|
||||||
Enums.RepairStatus Status { get; }
|
Enums.RepairStatus Status { get; }
|
||||||
|
|
||||||
double RepairCost { get; }
|
double RepairPrice { get; }
|
||||||
|
|
||||||
int GuarantorId { get; }
|
int GuarantorId { get; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user