Exemple #1
0
 public static bool IsValid(this EarnTask task)
 {
     if (task.Id.IsNullOrBlank() || task.Title.IsNullOrBlank() ||
         task.Description.IsNullOrBlank() || task.Type.IsNullOrBlank() ||
         task.Memo.IsNullOrBlank() ||
         !task.KinReward.HasValue || !task.MinToComplete.HasValue ||
         !task.Provider.HasValue || task.Questions == null ||
         !task.StartDateInSeconds.HasValue || !task.LastUpdatedAt.HasValue)
     {
         return(false);
     }
     return(task.Questions.TrueForAll(question => question.IsValid()) &&
            task.Provider.Value.IsValid());
 }
Exemple #2
0
 public static long?StartDateInMillis(this EarnTask task) => task.StartDateInSeconds * 1000;
Exemple #3
0
 public static bool IsTaskWebView(this EarnTask task) =>
 task.Type == EarnTask.TASK_TYPE_TRUEX;
Exemple #4
0
 public static string Tags(this EarnTask task) =>
 string.Join(",", task.Tags);
Exemple #5
0
 public static bool IsQuestionnaire(this EarnTask task) =>
 task.Type == EarnTask.TASK_TYPE_QUESTIONNAIRE;