Add checks for the Indicator request endpoint

This commit is contained in:
2025-10-28 18:04:10 +07:00
parent 1181a0920a
commit 5560c6942e
3 changed files with 16 additions and 10 deletions

View File

@@ -13,27 +13,33 @@ public class IndicatorRequestDto
/// Name of the indicator (e.g., "MACD", "RSI", "Bollinger Bands")
/// </summary>
[Required]
public string IndicatorName { get; set; }
[StringLength(200, MinimumLength = 4, ErrorMessage = "Indicator name must be between 4 and 200 characters.")]
public string IndicatorName { get; set; } = string.Empty;
/// <summary>
/// Strategy or description of how the indicator is used (e.g., "MACD Cross", "RSI Divergence")
/// </summary>
[Required]
[StringLength(1000, MinimumLength = 10, ErrorMessage = "Strategy description must be between 10 and 1000 characters.")]
public string StrategyDescription { get; set; } = string.Empty;
/// <summary>
/// Primary documentation URL for the indicator
/// </summary>
[Url(ErrorMessage = "Documentation URL must be a valid URL.")]
public string? DocumentationUrl { get; set; }
/// <summary>
/// Image URL for the indicator (optional) - can be a chart, diagram, or visual representation
/// </summary>
[Url(ErrorMessage = "Image URL must be a valid URL.")]
public string? ImageUrl { get; set; }
/// <summary>
/// Name of the person requesting the indicator
/// Telegram account handle of the person requesting the indicator (e.g., "cryptooda")
/// </summary>
[Required]
[RegularExpression(@"^(?=(?:[0-9_]*[a-z]){3})[a-z0-9_]{5,}$",
ErrorMessage = "Requester name must be a valid Telegram handle (lowercase letters, numbers, underscores only, minimum 5 characters with at least 3 letters).")]
public string RequesterName { get; set; } = string.Empty;
}

View File

@@ -5103,11 +5103,11 @@ export interface PrivyInitAddressResponse {
}
export interface IndicatorRequestDto {
indicatorName?: string;
strategyDescription?: string;
documentationUrl?: string;
indicatorName: string;
strategyDescription: string;
documentationUrl?: string | null;
imageUrl?: string | null;
requesterName?: string;
requesterName: string;
}
export interface LoginRequest {

View File

@@ -1234,11 +1234,11 @@ export interface PrivyInitAddressResponse {
}
export interface IndicatorRequestDto {
indicatorName?: string;
strategyDescription?: string;
documentationUrl?: string;
indicatorName: string;
strategyDescription: string;
documentationUrl?: string | null;
imageUrl?: string | null;
requesterName?: string;
requesterName: string;
}
export interface LoginRequest {