Skip to content

Commit

Permalink
chore: remove stripeCustomerId from Organization (#2520)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman authored Oct 9, 2024
1 parent 6a8c12d commit 6577946
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ enum OrganizationType {

/// {@template organization}
/// An Organization groups users and apps together. Organizations can be
/// personal (single-user) or team (multi-user). An Organization with a
/// [stripeCustomerId] may have a subscription.
/// personal (single-user) or team (multi-user). Organizations have exactly one
/// owner, but can have multiple admins and members.
/// {@endtemplate}
@JsonSerializable()
class Organization extends Equatable {
Expand All @@ -46,7 +46,6 @@ class Organization extends Equatable {
required this.id,
required this.name,
required this.organizationType,
required this.stripeCustomerId,
required this.createdAt,
required this.updatedAt,
});
Expand All @@ -62,15 +61,13 @@ class Organization extends Equatable {
int id = 42,
String name = 'Test Organization',
OrganizationType organizationType = OrganizationType.personal,
String? stripeCustomerId,
DateTime? createdAt,
DateTime? updatedAt,
}) =>
Organization(
id: id,
name: name,
organizationType: organizationType,
stripeCustomerId: stripeCustomerId,
createdAt: createdAt ?? DateTime.now(),
updatedAt: updatedAt ?? DateTime.now(),
);
Expand All @@ -88,9 +85,6 @@ class Organization extends Equatable {
/// The type of organization.
final OrganizationType organizationType;

/// The Stripe customer ID for the organization, if one exists.
final String? stripeCustomerId;

/// When this organization was created.
final DateTime createdAt;

Expand All @@ -102,7 +96,6 @@ class Organization extends Equatable {
id,
name,
organizationType,
stripeCustomerId,
createdAt,
updatedAt,
];
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ void main() {
createdAt: DateTime.now(),
updatedAt: DateTime.now(),
organizationType: OrganizationType.team,
stripeCustomerId: 'cus_123',
);
expect(
Organization.fromJson(organization.toJson()).toJson(),
Expand All @@ -29,15 +28,13 @@ void main() {
createdAt: date,
updatedAt: date,
organizationType: OrganizationType.team,
stripeCustomerId: 'cus_123',
);
final otherOrganization = Organization(
id: 1,
name: 'name',
createdAt: date,
updatedAt: date,
organizationType: OrganizationType.team,
stripeCustomerId: 'cus_123',
);
expect(organization, equals(otherOrganization));
});
Expand All @@ -51,15 +48,13 @@ void main() {
createdAt: date,
updatedAt: date,
organizationType: OrganizationType.team,
stripeCustomerId: 'cus_123',
);
final otherOrganization = Organization(
id: 1,
name: 'name',
name: 'name 2',
createdAt: date,
updatedAt: date,
organizationType: OrganizationType.team,
stripeCustomerId: 'cus_456',
);
expect(organization, isNot(equals(otherOrganization)));
});
Expand Down

0 comments on commit 6577946

Please sign in to comment.