-
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.
Tidy up question types and remove warnings
- Loading branch information
1 parent
c7b8093
commit c17f04d
Showing
10 changed files
with
62 additions
and
70 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
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
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,14 @@ | ||
namespace Simple.Domain.Surveys.Questions; | ||
|
||
public class ListQuestionType(string title, bool mandatory, IEnumerable<string> options, bool single) | ||
: QuestionType(QuestionTypeNames.List, title, mandatory) | ||
{ | ||
public IEnumerable<string> Options { get; init; } = options; | ||
public bool Single { get; init; } = single; | ||
} | ||
|
||
public static class QuestionTypeNames | ||
{ | ||
public const string List = "list"; | ||
public const string Text = "text"; | ||
} |
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,8 @@ | ||
namespace Simple.Domain.Surveys.Questions; | ||
|
||
public abstract class QuestionType(string type, string title, bool mandatory) | ||
{ | ||
public string Type { get; private init; } = type; | ||
public string Title { get; private init; } = title; | ||
public bool Mandatory { get; private init; } = mandatory; | ||
} |
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,7 @@ | ||
namespace Simple.Domain.Surveys.Questions; | ||
|
||
public class TextQuestionType(string title, bool mandatory, int maxLength) | ||
: QuestionType(QuestionTypeNames.Text, title, mandatory) | ||
{ | ||
public int MaxLength { get; init; } = maxLength; | ||
} |
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
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
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
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
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