Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Update infrastructure, add new controller #33

Merged
merged 19 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,7 @@ _Pvt_Extensions
/.mfractor
src/WebUI/ClientApp/package-lock.json
/src/WebUI/appsettings.json

/src/SWD-Laundry-Backend/appsettings.Development.json
/src/SWD-Laundry-Backend/appsettings.Production.json

Binary file modified Script.sql
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ public class Building : BaseEntity
public string Name { get; set; }
public string Address { get; set; }
public string Description { get; set; }

#region Relationship
public List<Customer> Customers { get; set; }
public List<Staff_Trip> Staff_Trips { get; set; }
#endregion
}
17 changes: 2 additions & 15 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/Customer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Entity.IdentityModels;

namespace SWD_Laundry_Backend.Contract.Repository.Entity;
Expand All @@ -8,27 +7,15 @@ namespace SWD_Laundry_Backend.Contract.Repository.Entity;

public class Customer : BaseEntity
{
//public string Name { get; set; }
//public string Address { get; set; }

#region Relationship

[ForeignKey("Building")]
public string BuildingID { get; set; }

[ForeignKey("ApplicationUser")]
public string ApplicationUserID { get; set; }

////===========================
public Building Building { get; set; }

public ApplicationUser ApplicationUser { get; set; }
public virtual List<Order> Order { get; set; }

#endregion Relationship

#region Special Attribute



#endregion Special Attribute
//public virtual List<Order> Order { get; set; }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations.Schema;
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Entity.IdentityModels;

namespace SWD_Laundry_Backend.Contract.Repository.Entity;
Expand All @@ -14,14 +13,11 @@ public class LaundryStore : BaseEntity
public DateTime EndTime { get; set; }
public bool Status { get; set; }

#region Relationship

////===========================
[ForeignKey("ApplicationUser")]
public string ApplicationUserID { get; set; }

public ApplicationUser ApplicationUser { get; set; }

public List<Order> Orders{ get; set; }

#endregion Relationship
//public List<Order> Orders { get; set; }
}
22 changes: 8 additions & 14 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ public class Order : BaseEntity
public DateTime OrderDate { get; set; }
public TimeFrame DeliveryTimeFrame { get; set; }
public DateTime ExpectedFinishDate { get; set; }

public OrderType OrderType { get; set; }
public PaymentType PaymentType { get; set; }

public string Address { get; set; } // Address = Customer's building location
public short Amount { get; set; }

public double TotalPrice { get; set; }

#region Relationship

[ForeignKey("Customer")]
////===========================
[ForeignKey(nameof(Customer))]
public string CustomerID { get; set; }

[ForeignKey(nameof(LaundryStore))]
Expand All @@ -31,15 +34,6 @@ public class Order : BaseEntity
public Staff Staff { get; set; }
public LaundryStore LaundryStore { get; set; }

public List<Payment> Payments { get; set; }
public List<OrderHistory> OrderHistories { get; set; }

#endregion Relationship

#region Special Attribute

public OrderType OrderType { get; set; }
public PaymentType PaymentType { get; set; }

#endregion Special Attribute
//public List<Payment> Payments { get; set; }
//public List<OrderHistory> OrderHistories { get; set; }
}
15 changes: 4 additions & 11 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/OrderHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ public class OrderHistory : BaseEntity
public string Title { get; set; }
public string Message { get; set; }

#region Relationship
public OrderStatus OrderStatus { get; set; }
public DeliveryStatus DeliveryStatus { get; set; }
public LaundryStatus LaundryStatus { get; set; }

////===========================
[ForeignKey("Order")]
public string OrderID { get; set; }

public Order Order { get; set; }

#endregion Relationship

#region Special attributes

public OrderStatus OrderStatus { get; set; }
public DeliveryStatus DeliveryStatus { get; set; }
public LaundryStatus LaundryStatus { get; set; }

#endregion Special attributes
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ public class Payment : BaseEntity
{
public double Price { get; set; }

#region Relationship

////===========================
[ForeignKey(nameof(Order))]
public string OrderId { get; set; }

public Transaction Transaction { get; set; }
public Order Orders { get; set; }

#endregion Relationship
}
12 changes: 1 addition & 11 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/Staff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,14 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Entity.IdentityModels;



#nullable disable

public class Staff : BaseEntity
{
//public DateTime Dob { get; set; }
//public string Address { get; set; }
//public double Salary { get; set; }

#region Relationship

[ForeignKey("ApplicationUser")]
public string ApplicationUserID { get; set; }

public ApplicationUser ApplicationUser { get; set; }

public List<Staff_Trip> Staff_Trips { get; set; }

#endregion Relationship
//public List<Staff_Trip> Staff_Trips { get; set; }
}
13 changes: 4 additions & 9 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/Staff_Trip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ public class Staff_Trip : BaseEntity
{
public int TripCollect { get; set; } = 0;

#region Relationship
public TripType TripType { get; set; }

////===========================
[ForeignKey("Staff")]
public string StaffID { get; set; }

Expand All @@ -20,15 +21,9 @@ public class Staff_Trip : BaseEntity
[ForeignKey("Building")]
public string BuildingID { get; set; }

////===========================

public Building Building { get; set; }
public Staff Staff { get; set; }
public TimeSchedule TimeSchedule { get; set; }

#endregion Relationship

#region Special Attribute

public TripType TripType { get; set; }

#endregion Special Attribute
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Core.Enum;
using SWD_Laundry_Backend.Core.Enum;

namespace SWD_Laundry_Backend.Contract.Repository.Entity;
#nullable disable

public class TimeSchedule : BaseEntity
{
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }

#region Special Attribute

public DayOfWeek DayOfWeek { get; set; }
public TimeFrame TimeFrame { get; set; }
public List<Staff_Trip> Staff_Trip { get; set; }

#endregion Special Attribute
//public virtual List<Staff_Trip> Staff_Trip { get; set; }
}
16 changes: 6 additions & 10 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@ public class Transaction : BaseEntity
public string PaymentMethod { get; set; }
public int Amount { get; set; }
public string Description { get; set; }
public AllowedTransactionType TransactionType { get; set; }

#region Relationship

////===========================
[ForeignKey(nameof(Wallet))]
public string WalletID { get; set; }

public Wallet Wallet { get; set; }
public List<Payment> Payments { get; set; }

#endregion Relationship

#region Special Attribute

public AllowedTransactionType TransactionType { get; set; }

#endregion Special Attribute
[ForeignKey(nameof(Payment))]
public string PaymentID { get; set; }
public Payment Payment { get; set; }
//public List<Payment> Payments { get; set; }
}
10 changes: 2 additions & 8 deletions src/SWD-Laundry-Backend.Contract.Repository/Entity/Wallet.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Entity.IdentityModels;
using SWD_Laundry_Backend.Contract.Repository.Entity.IdentityModels;

namespace SWD_Laundry_Backend.Contract.Repository.Entity;
#nullable disable
Expand All @@ -8,11 +7,6 @@ public class Wallet : BaseEntity
{
public double Balance { get; set; }

#region Relationship

public List<Transaction> Transactions { get; set; }

public ApplicationUser ApplicationUser { get; set; }

#endregion Relationship
//public List<Transaction> Transactions { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Infrastructure;

namespace SWD_Laundry_Backend.Contract.Repository.Interface;

public interface ILaundryStoreRepository : IRepository<LaundryStore>
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Infrastructure;

namespace SWD_Laundry_Backend.Contract.Repository.Interface;
public interface IStaffTripRepository : IRepository<Staff_Trip>
{
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SWD_Laundry_Backend.Contract.Repository.Infrastructure;
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Infrastructure;

namespace SWD_Laundry_Backend.Contract.Repository.Interface;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Infrastructure;

namespace SWD_Laundry_Backend.Contract.Repository.Interface;

public interface ITransactionRepository : IRepository<Transaction>
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Repository.Infrastructure;

namespace SWD_Laundry_Backend.Contract.Repository.Interface;

public interface IWalletRepository : IRepository<Wallet>
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Service.Base_Service_Interface;
using SWD_Laundry_Backend.Core.Models;

namespace SWD_Laundry_Backend.Contract.Service.Interface;

public interface ILaundryStoreService : ICreateAble<LaundryStoreModel, string>, IGetAble<LaundryStore, string>, IUpdateAble<LaundryStoreModel, string>, IDeleteAble<string>
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Service.Base_Service_Interface;
using SWD_Laundry_Backend.Core.Models;

namespace SWD_Laundry_Backend.Contract.Service.Interface;

public interface IStaffTripService :
ICreateAble<StaffTripModel, string>,
IGetAble<Staff_Trip, string>,
IUpdateAble<StaffTripModel, string>,
IDeleteAble<string>
{
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
using SWD_Laundry_Backend.Contract.Service.Base_Service_Interface;
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Service.Base_Service_Interface;
using SWD_Laundry_Backend.Core.Models;

namespace SWD_Laundry_Backend.Contract.Service.Interface;

public interface ITimeScheduleService : ICreateAble<TimeScheduleModel, string>, IGetAble<TimeSchedule, string>, IUpdateAble<TimeScheduleModel, string>, IDeleteAble<string>
public interface ITimeScheduleService :
ICreateAble<TimeScheduleModel, string>,
IGetAble<TimeSchedule, string>,
IUpdateAble<TimeScheduleModel, string>,
IDeleteAble<string>
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using SWD_Laundry_Backend.Contract.Repository.Entity;
using SWD_Laundry_Backend.Contract.Service.Base_Service_Interface;
using SWD_Laundry_Backend.Core.Models;

namespace SWD_Laundry_Backend.Contract.Service.Interface;

public interface ITransactionService :
ICreateAble<TransactionModel, string>,
IGetAble<Transaction, string>,
IUpdateAble<TransactionModel, string>
{
}
Loading
Loading