forked from Yara724/api
added offline inquiry in system setting also fix some bugs
This commit is contained in:
@@ -13,12 +13,38 @@ export class ExternalApisSettingsDto {
|
||||
sandHubUseLiveApi?: boolean;
|
||||
}
|
||||
|
||||
export class OfflineInquirySettingsDto {
|
||||
@ApiPropertyOptional({
|
||||
description:
|
||||
"Master switch for seeded offline plate inquiries. When false, `offlineInquiries` hits are skipped.",
|
||||
example: true,
|
||||
})
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export class UpdateSystemSettingsDto {
|
||||
@ApiPropertyOptional({ type: ExternalApisSettingsDto })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => ExternalApisSettingsDto)
|
||||
externalApis?: ExternalApisSettingsDto;
|
||||
|
||||
@ApiPropertyOptional({ type: OfflineInquirySettingsDto })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => OfflineInquirySettingsDto)
|
||||
offlineInquiry?: OfflineInquirySettingsDto;
|
||||
}
|
||||
|
||||
export class UpdateOfflineInquirySettingsDto {
|
||||
@ApiProperty({
|
||||
description: "Enable or disable offline seeded plate inquiries globally",
|
||||
example: true,
|
||||
})
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export class ExternalApisSettingsViewDto {
|
||||
@@ -30,6 +56,15 @@ export class ExternalApisSettingsViewDto {
|
||||
sandHubUseLiveApi: boolean;
|
||||
}
|
||||
|
||||
export class OfflineInquirySettingsViewDto {
|
||||
@ApiProperty({
|
||||
description:
|
||||
"Stored in `system_settings.offlineInquiry.enabled` — when false, offline seeds are ignored",
|
||||
example: true,
|
||||
})
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export class SystemSettingsResponseDto {
|
||||
@ApiProperty({ example: "global" })
|
||||
key: string;
|
||||
@@ -37,6 +72,9 @@ export class SystemSettingsResponseDto {
|
||||
@ApiProperty({ type: ExternalApisSettingsViewDto })
|
||||
externalApis: ExternalApisSettingsViewDto;
|
||||
|
||||
@ApiProperty({ type: OfflineInquirySettingsViewDto })
|
||||
offlineInquiry: OfflineInquirySettingsViewDto;
|
||||
|
||||
@ApiProperty({
|
||||
description: "Human-readable mode for operators",
|
||||
example: "mock",
|
||||
|
||||
Reference in New Issue
Block a user