Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dealers): exclude unwanted fields from API #194

Merged
merged 3 commits into from
Sep 1, 2024
Merged
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
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