Add managed databases and services with billing-aligned upgrades.
Introduce product types for managed PostgreSQL, Redis, and RabbitMQ with a dedicated dashboard, Helm-only deploy pipeline, external access, snapshots with progress, and prorated resource or storage upgrades matching application billing rules. PVCs use an expandable StorageClass with automatic migration when legacy disks cannot resize in place. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { IsString, IsEnum, IsOptional, IsBoolean, IsNumber, IsArray, ValidateNested, Min } from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { BillingCycle, PricingResourceType, AppRuntime, InvoiceStatus } from '../../common/enums';
|
||||
import { BillingCycle, PricingResourceType, AppRuntime, InvoiceStatus, ProductType } from '../../common/enums';
|
||||
import { OptionalServiceResourcesDto } from './optional-service-resources.dto';
|
||||
|
||||
export class CreatePricingRuleDto {
|
||||
@@ -92,6 +92,11 @@ export class ChargeWalletDto {
|
||||
}
|
||||
|
||||
export class CalculateCostDto {
|
||||
@ApiPropertyOptional({ enum: ProductType, default: ProductType.APPLICATION })
|
||||
@IsOptional()
|
||||
@IsEnum(ProductType)
|
||||
productType?: ProductType;
|
||||
|
||||
@ApiProperty({ example: 'nodejs' })
|
||||
@IsString()
|
||||
runtime: string;
|
||||
@@ -108,10 +113,11 @@ export class CalculateCostDto {
|
||||
@IsString()
|
||||
memoryLimit: string;
|
||||
|
||||
@ApiProperty({ example: 1, description: 'Number of replicas' })
|
||||
@ApiPropertyOptional({ example: 1, description: 'Number of replicas (0 for managed services)' })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@Min(1)
|
||||
replicas: number;
|
||||
@Min(0)
|
||||
replicas?: number;
|
||||
|
||||
@ApiProperty({ example: '1Gi', description: 'Database storage size' })
|
||||
@IsOptional()
|
||||
@@ -206,6 +212,18 @@ export class UpgradeResourcesDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
appStorageSize?: string;
|
||||
|
||||
@ApiPropertyOptional({ type: OptionalServiceResourcesDto, description: 'Managed Redis resource limits' })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => OptionalServiceResourcesDto)
|
||||
redisResources?: OptionalServiceResourcesDto;
|
||||
|
||||
@ApiPropertyOptional({ type: OptionalServiceResourcesDto, description: 'Managed RabbitMQ resource limits' })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => OptionalServiceResourcesDto)
|
||||
rabbitmqResources?: OptionalServiceResourcesDto;
|
||||
}
|
||||
|
||||
export class CalculateUpgradeCostDto extends UpgradeResourcesDto {}
|
||||
|
||||
Reference in New Issue
Block a user