feat: Implementazione completa sistema schedulazione con intervalli personalizzati

- Aggiunto supporto schedulazione con intervalli flessibili (secondi/minuti/ore/giorni/settimane/mesi)
- Esteso modello ProfileSchedule con campi IntervalValue e IntervalUnit
- Ottimizzato ScheduledJobService per controlli ogni 30s con esecuzione parallela
- Implementata interfaccia UI completa con anteprima real-time in italiano
- Aggiunta migrazione database AddIntervalSchedulingFields
- Implementati metodi calcolo NextExecutionTime per intervalli
- Aggiunta gestione tracking anti-duplicati e cleanup automatico
- Creata documentazione completa (6 file, 2500+ righe)

Modifiche tecniche:
- ProfileSchedule.cs: Nuovi campi e metodi CalculateNextInterval/GetScheduleDescription
- ScheduledJobService.cs: Ridotto check interval a 30s, aggiunto parallel processing
- ProfileScheduleService.cs: Supporto calcolo intervalli in UpdateNextExecutionTimeAsync
- Scheduling.razor: Aggiunta sezione UI per configurazione intervalli
- Scheduling.razor.cs: Implementato GetIntervalPreview() e gestione stato campi
This commit is contained in:
2025-10-02 01:12:39 +02:00
parent b76a6760fb
commit d042863a56
71 changed files with 17860 additions and 144 deletions
@@ -0,0 +1,225 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CredentialManager.Migrations
{
/// <inheritdoc />
public partial class AddProfileSchedule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_ProfileSchedules_IsActive",
table: "ProfileSchedules");
migrationBuilder.DropIndex(
name: "IX_ProfileSchedules_Name",
table: "ProfileSchedules");
migrationBuilder.DropIndex(
name: "IX_ProfileSchedules_NextExecution",
table: "ProfileSchedules");
migrationBuilder.DropIndex(
name: "IX_ProfileSchedules_ScheduleType",
table: "ProfileSchedules");
migrationBuilder.DropColumn(
name: "LastExecutionResult",
table: "ProfileSchedules");
migrationBuilder.DropColumn(
name: "WeeklyDays",
table: "ProfileSchedules");
migrationBuilder.RenameColumn(
name: "NextExecution",
table: "ProfileSchedules",
newName: "ScheduledDateTime");
migrationBuilder.RenameColumn(
name: "MonthlyDay",
table: "ProfileSchedules",
newName: "LastExecutionRecordCount");
migrationBuilder.RenameColumn(
name: "LastExecutionSuccess",
table: "ProfileSchedules",
newName: "IsEnabled");
migrationBuilder.RenameColumn(
name: "LastExecution",
table: "ProfileSchedules",
newName: "NextExecutionTime");
migrationBuilder.RenameColumn(
name: "ExecuteOnce",
table: "ProfileSchedules",
newName: "LastExecutionTime");
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "ProfileSchedules",
type: "INTEGER",
nullable: false,
oldClrType: typeof(bool),
oldType: "INTEGER",
oldDefaultValue: true);
migrationBuilder.AlterColumn<int>(
name: "ExecutionCount",
table: "ProfileSchedules",
type: "INTEGER",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER",
oldDefaultValue: 0);
migrationBuilder.AlterColumn<DateTime>(
name: "CreatedAt",
table: "ProfileSchedules",
type: "TEXT",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TEXT",
oldDefaultValueSql: "CURRENT_TIMESTAMP");
migrationBuilder.AddColumn<int>(
name: "DayOfMonth",
table: "ProfileSchedules",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "DayOfWeek",
table: "ProfileSchedules",
type: "INTEGER",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LastExecutionMessage",
table: "ProfileSchedules",
type: "TEXT",
maxLength: 1000,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LastExecutionStatus",
table: "ProfileSchedules",
type: "TEXT",
maxLength: 20,
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DayOfMonth",
table: "ProfileSchedules");
migrationBuilder.DropColumn(
name: "DayOfWeek",
table: "ProfileSchedules");
migrationBuilder.DropColumn(
name: "LastExecutionMessage",
table: "ProfileSchedules");
migrationBuilder.DropColumn(
name: "LastExecutionStatus",
table: "ProfileSchedules");
migrationBuilder.RenameColumn(
name: "ScheduledDateTime",
table: "ProfileSchedules",
newName: "NextExecution");
migrationBuilder.RenameColumn(
name: "NextExecutionTime",
table: "ProfileSchedules",
newName: "LastExecution");
migrationBuilder.RenameColumn(
name: "LastExecutionTime",
table: "ProfileSchedules",
newName: "ExecuteOnce");
migrationBuilder.RenameColumn(
name: "LastExecutionRecordCount",
table: "ProfileSchedules",
newName: "MonthlyDay");
migrationBuilder.RenameColumn(
name: "IsEnabled",
table: "ProfileSchedules",
newName: "LastExecutionSuccess");
migrationBuilder.AlterColumn<bool>(
name: "IsActive",
table: "ProfileSchedules",
type: "INTEGER",
nullable: false,
defaultValue: true,
oldClrType: typeof(bool),
oldType: "INTEGER");
migrationBuilder.AlterColumn<int>(
name: "ExecutionCount",
table: "ProfileSchedules",
type: "INTEGER",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "INTEGER");
migrationBuilder.AlterColumn<DateTime>(
name: "CreatedAt",
table: "ProfileSchedules",
type: "TEXT",
nullable: false,
defaultValueSql: "CURRENT_TIMESTAMP",
oldClrType: typeof(DateTime),
oldType: "TEXT");
migrationBuilder.AddColumn<string>(
name: "LastExecutionResult",
table: "ProfileSchedules",
type: "TEXT",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "WeeklyDays",
table: "ProfileSchedules",
type: "TEXT",
maxLength: 50,
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_ProfileSchedules_IsActive",
table: "ProfileSchedules",
column: "IsActive");
migrationBuilder.CreateIndex(
name: "IX_ProfileSchedules_Name",
table: "ProfileSchedules",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ProfileSchedules_NextExecution",
table: "ProfileSchedules",
column: "NextExecution");
migrationBuilder.CreateIndex(
name: "IX_ProfileSchedules_ScheduleType",
table: "ProfileSchedules",
column: "ScheduleType");
}
}
}