Fecha a orquestracao de Billing (agente.md secao 120-139) sobre o schema/ RatingEngine puro ja existentes: escritores do ledger UsageEvent (CALL_SECONDS no CDR, ACTIVE_DAY via sweep diario), closeBillingPeriod/ reopenBillingPeriod (fechamento imutavel com audit trail), e os controllers de price books/rate decks/plan versions/subscriptions/ periods/statements. Corrige 2 bugs reais de RLS achados no teste ponta a ponta (reopen sem tenant context, subscriptions sem withTenantContext) e adiciona teste unitario do RatingEngine (17 casos). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EWHKmcVJtstQFErbZ1AanY
24 lines
407 B
TypeScript
24 lines
407 B
TypeScript
import { IsDateString, IsInt, IsOptional, IsString, IsUUID, Max, MaxLength, Min } from "class-validator";
|
|
|
|
export class CreateSubscriptionDto {
|
|
@IsUUID()
|
|
tenantId!: string;
|
|
|
|
@IsUUID()
|
|
planVersionId!: string;
|
|
|
|
@IsOptional()
|
|
@IsDateString()
|
|
startedAt?: string;
|
|
|
|
@IsInt()
|
|
@Min(1)
|
|
@Max(28)
|
|
billingCycleAnchor!: number;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(3)
|
|
currency?: string;
|
|
}
|