feat: send personal player notifications
This commit is contained in:
@@ -77,9 +77,16 @@
|
||||
<label class="gm-form-label">Общая ссылка</label>
|
||||
<InputText @bind-Value="batch.JoinLink" class="gm-form-control" />
|
||||
</div>
|
||||
<div class="gm-form-group">
|
||||
<label class="gm-form-label">Уведомления игрокам</label>
|
||||
<select @bind="batch.NotificationMode" class="gm-form-control">
|
||||
<option value="@SessionNotificationModeExtensions.GroupAndDirectValue">В группе и в личку</option>
|
||||
<option value="@SessionNotificationModeExtensions.GroupOnlyValue">Только в группе</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn-gm btn-gm-primary" disabled="@IsBatchBusy(batch)">
|
||||
@(IsBatchBusy(batch) ? "⏳ Обновляем..." : "💾 Обновить title/link")
|
||||
@(IsBatchBusy(batch) ? "⏳ Обновляем..." : "💾 Обновить batch")
|
||||
</button>
|
||||
</EditForm>
|
||||
|
||||
@@ -277,7 +284,11 @@
|
||||
try
|
||||
{
|
||||
await SessionService.UpdateBatchDetailsForGmAsync(batch.BatchId, telegramId, batch.Title, batch.JoinLink);
|
||||
successMessage = "Общие title/link обновлены для всей пачки.";
|
||||
await SessionService.UpdateBatchNotificationModeForGmAsync(
|
||||
batch.BatchId,
|
||||
telegramId,
|
||||
SessionNotificationModeExtensions.FromDatabaseValue(batch.NotificationMode));
|
||||
successMessage = "Настройки batch обновлены.";
|
||||
await LoadSessions();
|
||||
}
|
||||
catch (SessionAccessDeniedException)
|
||||
@@ -373,6 +384,7 @@
|
||||
BatchId = group.Key,
|
||||
Title = firstSession.Title,
|
||||
JoinLink = firstSession.JoinLink,
|
||||
NotificationMode = firstSession.NotificationMode,
|
||||
FirstScheduledAtLocal = firstSession.ScheduledAt.ToMoscow(),
|
||||
LastScheduledAtLocal = lastSession.ScheduledAt.ToMoscow(),
|
||||
IntervalDays = InferIntervalDays(orderedSessions),
|
||||
@@ -447,6 +459,7 @@
|
||||
public Guid BatchId { get; init; }
|
||||
public string Title { get; set; } = "";
|
||||
public string JoinLink { get; set; } = "";
|
||||
public string NotificationMode { get; set; } = SessionNotificationModeExtensions.GroupAndDirectValue;
|
||||
public DateTime FirstScheduledAtLocal { get; set; } = DateTime.Now;
|
||||
public DateTime LastScheduledAtLocal { get; init; } = DateTime.Now;
|
||||
public int IntervalDays { get; set; } = 7;
|
||||
|
||||
Reference in New Issue
Block a user