Skip to content

Commit

Permalink
fix(dealers): exclude unwanted fields from API (#194)
Browse files Browse the repository at this point in the history
* fix(dealers): exclude unnecessary fields from API

* chore(todo): mark planned changes for EF29

* fix(dealers): set defaults for deprecated required fields
  • Loading branch information
Fenrikur authored Sep 1, 2024
1 parent 4d0a193 commit c1d8232
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Eurofurence.App.Domain.Model/Dealers/DealerRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ public class DealerRecord : EntityBase
/// <summary>
/// Registration number (as on badge) of the attendee that acts on behalf/represents this dealer.
/// </summary>
// TODO: Remove entirely for EF29
[Required]
[DataMember]
public int RegistrationNumber { get; set; }
[JsonIgnore]
public int RegistrationNumber { get; set; } = -1;

/// <summary>
/// Nickname number (as on badge) of the attendee that acts on behalf/represents this dealer.
/// </summary>
// TODO: Remove entirely for EF29
[Required]
[DataMember]
public string AttendeeNickname { get; set; }
[JsonIgnore]
public string AttendeeNickname { get; set; } = "";

/// <summary>
/// **(pba)** Name under which this dealer is acting, e.G. name of the company or brand.
Expand Down Expand Up @@ -172,6 +176,7 @@ public class DealerRecord : EntityBase
[DataMember]
public Dictionary<string, string[]> Keywords { get; set; }

// TODO: Remove entirely for EF29 (superseded by making DisplayName Required and using it exclusively)
public string DisplayNameOrAttendeeNickname =>
!string.IsNullOrWhiteSpace(DisplayName) ? DisplayName : AttendeeNickname;
}
Expand Down

0 comments on commit c1d8232

Please sign in to comment.