Exemplo n.º 1
0
 private Report(ReportTitle title, string description, ReportShortcut shortcut, Color color)
 {
     Title       = title;
     Description = description;
     Shortcut    = shortcut;
     Color       = color;
     CreateTime  = DateTime.Now;
     Id          = Guid.NewGuid();
 }
Exemplo n.º 2
0
 public static Report Make(
     Guid id,
     ReportTitle title,
     string description,
     ReportShortcut shortcut,
     Color color,
     TimeSpan averageDuration,
     DateTime createTime,
     int downloads)
 => new Report(
     id,
     title,
     description,
     shortcut,
     color,
     averageDuration,
     createTime,
     downloads,
     new UserId[0],
     new CompanyId[0]);
Exemplo n.º 3
0
 private Report(
     Guid id,
     ReportTitle title,
     string description,
     ReportShortcut shortcut,
     Color color,
     TimeSpan averageDuration,
     DateTime createTime,
     int downloads,
     UserId[] allowedUsers,
     CompanyId[] allowedCompanies
     )
 {
     Id                    = id;
     Title                 = title;
     Description           = description;
     Shortcut              = shortcut;
     Color                 = color;
     AverageGenerationTime = averageDuration;
     CreateTime            = createTime;
     DownloadTimes         = downloads;
     _allowedUsers         = new List <UserId>(allowedUsers);
     _allowedCompanies     = new List <CompanyId>(allowedCompanies);
 }
Exemplo n.º 4
0
 public static Report CreateNew(ReportTitle title, string description, ReportShortcut shortcut, Color color, IReportUniqueTitleChecker checker)
 {
     CheckRule(new ReportTitleMustBeUniqueRule(checker, title));
     return(new Report(title, description, shortcut, color));
 }