69 lines
2.9 KiB
C#
69 lines
2.9 KiB
C#
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using FinlyticAssets.Models;
|
|
using FinlyticCore.Models.Assets;
|
|
|
|
namespace FinlyticAssets.Entities;
|
|
|
|
/// <summary>
|
|
/// Represents the global synchronization and timing configurations for the Trade Republic asset scanner.
|
|
/// </summary>
|
|
public class Settings
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the unique identifier for the settings record.
|
|
/// </summary>
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether the very first full scan of all assets has been completed.
|
|
/// Used to switch from fast initial discovery delays to stealthy incremental update delays.
|
|
/// </summary>
|
|
public bool FinishedInitialScan { get; set; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// Gets or sets the maximum number of assets requested per single API pagination call.
|
|
/// Values around 100 look like standard dynamic-scrolling payloads from a real client device.
|
|
/// </summary>
|
|
public int TradeRepublicMaxRequestPageSize { get; set; } = 100;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the idle delay in seconds between switching from one full asset category to another (e.g., from Stocks to Crypto)
|
|
/// during standard maintenance mode. (Default 12000s = ~3.3 hours).
|
|
/// </summary>
|
|
public int AssetUpdateTypeDelay { get; set; } = 12000;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the idle delay in seconds between switching asset categories during the initial setup scan.
|
|
/// Set to 0 to move immediately to the next type after finishing the current one. (Default 0s).
|
|
/// </summary>
|
|
public int InitAssetUpdateTypeDelay { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the baseline delay in seconds between sequential page requests of the same asset type during the initial setup scan.
|
|
/// (Default 120s = 2 minutes).
|
|
/// </summary>
|
|
public int InitBatchAssetUpdateDelay { get; set; } = 120;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the standard baseline delay in seconds between sequential page requests of the same asset type during recurring incremental updates.
|
|
/// Spreads pagination widely over time to blend into regular human traffic profiles. (Default 600s = 10 minutes).
|
|
/// </summary>
|
|
public int BatchAssetUpdateDelay { get; set; } = 600;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the asset type that is currently being processed by the full scan.
|
|
/// Acts as a live pointer for recovery after a service interruption.
|
|
/// </summary>
|
|
public AssetType CurrentScanningType { get; set; } = AssetType.Stock;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the page number of the <see cref="CurrentScanningType"/> that is currently being fetched or was just processed.
|
|
/// Trade Republic uses 1-based pagination. A value of 0 means the scan is currently idle or between types.
|
|
/// </summary>
|
|
public int CurrentScanningPage { get; set; } = 0;
|
|
}
|