2024-05-05 22:08:27 +02:00
|
|
|
|
using FluentNHibernate.Mapping;
|
|
|
|
|
|
|
|
|
|
namespace FirmTracker_Server.nHibernate.Transactions
|
|
|
|
|
{
|
2024-05-06 21:25:10 +02:00
|
|
|
|
public class TransactionMapping : ClassMap<Transaction>
|
2024-05-05 22:08:27 +02:00
|
|
|
|
{
|
|
|
|
|
public TransactionMapping()
|
|
|
|
|
{
|
|
|
|
|
Table("Transactions");
|
2024-05-06 21:25:10 +02:00
|
|
|
|
Id(x => x.Id).GeneratedBy.Identity();
|
2024-05-05 22:08:27 +02:00
|
|
|
|
Map(x => x.Date);
|
|
|
|
|
Map(x => x.EmployeeId);
|
|
|
|
|
Map(x => x.PaymentType);
|
|
|
|
|
Map(x => x.Discount);
|
|
|
|
|
Map(x => x.Description);
|
2024-06-12 14:03:49 +02:00
|
|
|
|
Map(x => x.TotalPrice).Precision(18).Scale(2);
|
2024-05-05 22:08:27 +02:00
|
|
|
|
|
2024-05-06 21:25:10 +02:00
|
|
|
|
HasMany(x => x.TransactionProducts)
|
|
|
|
|
.KeyColumn("TransactionId")
|
|
|
|
|
.Cascade.AllDeleteOrphan()
|
2024-06-16 23:02:04 +02:00
|
|
|
|
.Inverse();
|
2024-06-08 00:24:12 +02:00
|
|
|
|
|
2024-05-05 22:08:27 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|