| | 1 | | namespace Syki.Shared; |
| | 2 | |
|
| | 3 | | public class CreateUserIn |
| | 4 | | { |
| 1441 | 5 | | public Guid InstitutionId { get; set; } |
| 950 | 6 | | public string Name { get; set; } |
| 1900 | 7 | | public string Email { get; set; } |
| 950 | 8 | | public string Password { get; set; } |
| 942 | 9 | | public UserRole Role { get; set; } |
| 551 | 10 | | public string? PhoneNumber { get; set; } |
| | 11 | |
|
| | 12 | | public static CreateUserIn NewAcademic(Guid institutionId, string email, string password) |
| | 13 | | { |
| 279 | 14 | | return new() |
| 279 | 15 | | { |
| 279 | 16 | | Name = email, |
| 279 | 17 | | Email = email, |
| 279 | 18 | | Password = password, |
| 279 | 19 | | Role = UserRole.Academic, |
| 279 | 20 | | InstitutionId = institutionId, |
| 279 | 21 | | }; |
| | 22 | | } |
| | 23 | |
|
| | 24 | | public static CreateUserIn NewTeacher(Guid institutionId, string name, string email) |
| | 25 | | { |
| 118 | 26 | | return new() |
| 118 | 27 | | { |
| 118 | 28 | | Name = name, |
| 118 | 29 | | Email = email, |
| 118 | 30 | | Role = UserRole.Teacher, |
| 118 | 31 | | InstitutionId = institutionId, |
| 118 | 32 | | Password = $"Teacher@{Guid.NewGuid().ToString().OnlyNumbers()}", |
| 118 | 33 | | }; |
| | 34 | | } |
| | 35 | |
|
| | 36 | | public static CreateUserIn NewStudent(Guid institutionId, string name, string email, string? phoneNumber) |
| | 37 | | { |
| 95 | 38 | | return new() |
| 95 | 39 | | { |
| 95 | 40 | | Name = name, |
| 95 | 41 | | Email = email, |
| 95 | 42 | | Role = UserRole.Student, |
| 95 | 43 | | PhoneNumber = phoneNumber, |
| 95 | 44 | | InstitutionId = institutionId, |
| 95 | 45 | | Password = $"Student@{Guid.NewGuid().ToString().OnlyNumbers()}", |
| 95 | 46 | | }; |
| | 47 | | } |
| | 48 | | } |