Skip to content
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
5 changes: 4 additions & 1 deletion src/MergeDay.Api/Domain/Entities/Bill.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MergeDay.Api.Domain.Entities;

Expand All @@ -9,11 +10,13 @@ public class Bill
public Guid ApplicationUserId { get; set; }
public ApplicationUser ApplicationUser { get; set; } = null!;

[Required]
public required string Name { get; set; } = string.Empty;

[Column(TypeName = "decimal(18,2)")]
public required decimal Total { get; set; }

[Required]
public required string IBAN { get; set; } = string.Empty;

public string? Note { get; set; }
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions src/MergeDay.Api/Infrastructure/Persistence/MergeDayDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)

modelBuilder.Entity<Bill>(e =>
{
e.HasKey(x => x.Id);
e.Property(x => x.Id).HasDefaultValueSql("NEWSEQUENTIALID()");

e.Property(x => x.Name).IsRequired();
e.Property(x => x.IBAN).IsRequired();
e.Property(x => x.Total).HasColumnType("decimal(18,2)");

e.HasOne(x => x.ApplicationUser)
.WithMany()
.HasForeignKey(x => x.ApplicationUserId)
Expand All @@ -44,10 +37,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)

modelBuilder.Entity<BillItem>(e =>
{
e.HasKey(x => x.Id);
e.Property(x => x.Id).HasDefaultValueSql("NEWSEQUENTIALID()");
e.Property(x => x.Price).HasColumnType("decimal(18,2)");

e.HasOne(x => x.ApplicationUser)
.WithMany()
.HasForeignKey(x => x.ApplicationUserId)
Expand All @@ -59,11 +48,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)

modelBuilder.Entity<RefreshToken>(e =>
{
e.HasKey(x => x.Id);
e.Property(x => x.Id).HasDefaultValueSql("NEWSEQUENTIALID()");
e.Property(x => x.TokenHash).IsRequired().HasMaxLength(256);
e.Property(x => x.ReplacedByTokenHash).HasMaxLength(256);

e.HasIndex(x => x.TokenHash).IsUnique();
e.HasIndex(x => x.ApplicationUserId);

Expand Down
Loading