-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from scogliera/feature/add_models
Přidané modely objektů
- Loading branch information
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace TeacherDigitalAgency.Models; | ||
|
||
public class ContactInfo | ||
{ | ||
[JsonPropertyName("telephone_numbers")] public required HashSet<string> TelephoneNumbers { get; set; } | ||
[JsonPropertyName("emails")] public required HashSet<string> Emails { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace TeacherDigitalAgency.Models; | ||
|
||
public class Error | ||
{ | ||
[JsonPropertyName("code")] public required int Code { get; set; } | ||
[JsonPropertyName("message")] public required string Message { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace TeacherDigitalAgency.Models; | ||
|
||
public class Lecturer | ||
{ | ||
public Lecturer(string firstName, string lastName) | ||
{ | ||
FirstName = firstName; | ||
LastName = lastName; | ||
} | ||
|
||
[JsonPropertyName("uuid")] public Guid Uuid { get; init; } = Guid.NewGuid(); | ||
[JsonPropertyName("title_before")] public string? TitleBefore { get; set; } | ||
[JsonPropertyName("first_name")] public required string FirstName { get; set; } | ||
[JsonPropertyName("middle_name")] public string? MiddleName { get; set; } | ||
[JsonPropertyName("last_name")] public required string LastName { get; set; } | ||
[JsonPropertyName("title_after")] public string? TitleAfter { get; set; } | ||
[JsonPropertyName("picture_url")] public string? PictureUrl { get; set; } | ||
[JsonPropertyName("location")] public string? Location { get; set; } | ||
[JsonPropertyName("claim")] public string? Claim { get; set; } | ||
[JsonPropertyName("bio")] public string? Bio { get; set; } | ||
[JsonPropertyName("tags")] public IEnumerable<Tag> Tags { get; set; } = new List<Tag>(); | ||
[JsonPropertyName("price_per_hour")] public int? PricePerHour { get; set; } | ||
// TODO: Not known if contact can be nullable - most likely yes | ||
[JsonPropertyName("contact")] public ContactInfo? ContactInfo { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace TeacherDigitalAgency.Models; | ||
|
||
public class Tag | ||
{ | ||
[JsonPropertyName("uuid")] public Guid Uuid { get; init; } = Guid.NewGuid(); | ||
[JsonPropertyName("name")] public required string Name { get; set; } | ||
} |