diff --git a/packages/shorebird_code_push_protocol/lib/src/models/plan.dart b/packages/shorebird_code_push_protocol/lib/src/models/plan.dart index 4382b8e3..7e8b051d 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/plan.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/plan.dart @@ -51,12 +51,13 @@ class Plan { final Decimal? pricePerOverageInstall; /// The start of the current billing period. - /// This will be null for accounts without a subscription. - final DateTime? currentPeriodStart; + /// If the user is on a free plan, this will be the start of the current + /// month. + final DateTime currentPeriodStart; /// The end of the current billing period. - /// This will be null for accounts without a subscription. - final DateTime? currentPeriodEnd; + /// If the user is on a free plan, this will be the start of the next month. + final DateTime currentPeriodEnd; /// Whether the subscription will be canceled at the end of the current /// billing period. diff --git a/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart b/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart index 65821887..2dca3a7d 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/plan.g.dart @@ -18,10 +18,10 @@ Plan _$PlanFromJson(Map json) => $checkedCreate( basePrice: $checkedConvert('base_price', (v) => (v as num).toInt()), baseInstallCount: $checkedConvert('base_install_count', (v) => (v as num).toInt()), - currentPeriodStart: $checkedConvert('current_period_start', - (v) => v == null ? null : DateTime.parse(v as String)), - currentPeriodEnd: $checkedConvert('current_period_end', - (v) => v == null ? null : DateTime.parse(v as String)), + currentPeriodStart: $checkedConvert( + 'current_period_start', (v) => DateTime.parse(v as String)), + currentPeriodEnd: $checkedConvert( + 'current_period_end', (v) => DateTime.parse(v as String)), cancelAtPeriodEnd: $checkedConvert('cancel_at_period_end', (v) => v as bool), isTiered: $checkedConvert('is_tiered', (v) => v as bool), @@ -50,8 +50,8 @@ Map _$PlanToJson(Plan instance) => { 'base_price': instance.basePrice, 'base_install_count': instance.baseInstallCount, 'price_per_overage_install': instance.pricePerOverageInstall?.toJson(), - 'current_period_start': instance.currentPeriodStart?.toIso8601String(), - 'current_period_end': instance.currentPeriodEnd?.toIso8601String(), + 'current_period_start': instance.currentPeriodStart.toIso8601String(), + 'current_period_end': instance.currentPeriodEnd.toIso8601String(), 'cancel_at_period_end': instance.cancelAtPeriodEnd, 'is_tiered': instance.isTiered, 'max_team_size': instance.maxTeamSize,