Skip to content

Commit 5a6c856

Browse files
author
serverpod_cloud
committed
fix(gc): 3e2172afb481ce1cf53f2518fb83fc36c2611180
1 parent f0d3439 commit 5a6c856

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

ground_control_client/lib/src/protocol/domains/billing/models/owner.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ abstract class Owner implements _i1.SerializableModel {
1919
Owner._({
2020
_i1.UuidValue? id,
2121
required this.externalBillingId,
22-
this.externalPaymentId,
22+
required this.externalPaymentId,
2323
required this.billingPortalUrl,
2424
required this.billingEmails,
2525
this.user,
@@ -30,7 +30,7 @@ abstract class Owner implements _i1.SerializableModel {
3030
factory Owner({
3131
_i1.UuidValue? id,
3232
required String externalBillingId,
33-
String? externalPaymentId,
33+
required String externalPaymentId,
3434
required Uri billingPortalUrl,
3535
required List<String> billingEmails,
3636
_i2.User? user,
@@ -42,7 +42,7 @@ abstract class Owner implements _i1.SerializableModel {
4242
return Owner(
4343
id: _i1.UuidValueJsonExtension.fromJson(jsonSerialization['id']),
4444
externalBillingId: jsonSerialization['externalBillingId'] as String,
45-
externalPaymentId: jsonSerialization['externalPaymentId'] as String?,
45+
externalPaymentId: jsonSerialization['externalPaymentId'] as String,
4646
billingPortalUrl:
4747
_i1.UriJsonExtension.fromJson(jsonSerialization['billingPortalUrl']),
4848
billingEmails: (jsonSerialization['billingEmails'] as List)
@@ -69,7 +69,7 @@ abstract class Owner implements _i1.SerializableModel {
6969

7070
String externalBillingId;
7171

72-
String? externalPaymentId;
72+
String externalPaymentId;
7373

7474
Uri billingPortalUrl;
7575

@@ -99,7 +99,7 @@ abstract class Owner implements _i1.SerializableModel {
9999
return {
100100
'id': id.toJson(),
101101
'externalBillingId': externalBillingId,
102-
if (externalPaymentId != null) 'externalPaymentId': externalPaymentId,
102+
'externalPaymentId': externalPaymentId,
103103
'billingPortalUrl': billingPortalUrl.toJson(),
104104
'billingEmails': billingEmails.toJson(),
105105
if (user != null) 'user': user?.toJson(),
@@ -121,7 +121,7 @@ class _OwnerImpl extends Owner {
121121
_OwnerImpl({
122122
_i1.UuidValue? id,
123123
required String externalBillingId,
124-
String? externalPaymentId,
124+
required String externalPaymentId,
125125
required Uri billingPortalUrl,
126126
required List<String> billingEmails,
127127
_i2.User? user,
@@ -145,7 +145,7 @@ class _OwnerImpl extends Owner {
145145
Owner copyWith({
146146
_i1.UuidValue? id,
147147
String? externalBillingId,
148-
Object? externalPaymentId = _Undefined,
148+
String? externalPaymentId,
149149
Uri? billingPortalUrl,
150150
List<String>? billingEmails,
151151
Object? user = _Undefined,
@@ -155,9 +155,7 @@ class _OwnerImpl extends Owner {
155155
return Owner(
156156
id: id ?? this.id,
157157
externalBillingId: externalBillingId ?? this.externalBillingId,
158-
externalPaymentId: externalPaymentId is String?
159-
? externalPaymentId
160-
: this.externalPaymentId,
158+
externalPaymentId: externalPaymentId ?? this.externalPaymentId,
161159
billingPortalUrl: billingPortalUrl ?? this.billingPortalUrl,
162160
billingEmails:
163161
billingEmails ?? this.billingEmails.map((e0) => e0).toList(),

ground_control_client/lib/src/test_tools/builders/billing/owner_builder.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class OwnerBuilder {
3131
return this;
3232
}
3333

34+
OwnerBuilder withExternalPaymentId(String externalPaymentId) {
35+
_externalPaymentId = externalPaymentId;
36+
return this;
37+
}
38+
3439
OwnerBuilder withBillingPortalUrl(Uri billingPortalUrl) {
3540
_billingPortalUrl = billingPortalUrl;
3641
return this;

0 commit comments

Comments
 (0)