+signup +login
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
This commit is contained in:
18
frontend/pshared/lib/models/organization/bound.dart
Normal file
18
frontend/pshared/lib/models/organization/bound.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
|
||||
abstract class OrganizationBound {
|
||||
String get organizationRef;
|
||||
}
|
||||
|
||||
@immutable
|
||||
class _OrganizationBoundImp implements OrganizationBound {
|
||||
@override
|
||||
final String organizationRef;
|
||||
|
||||
const _OrganizationBoundImp({
|
||||
required this.organizationRef,
|
||||
});
|
||||
}
|
||||
|
||||
OrganizationBound newOrganizationBound({ required String organizationRef }) => _OrganizationBoundImp(organizationRef: organizationRef);
|
||||
@@ -1,7 +1,12 @@
|
||||
import 'package:pshared/models/describable.dart';
|
||||
|
||||
|
||||
class OrganizationDescription {
|
||||
final Describable description;
|
||||
final String? logoUrl;
|
||||
|
||||
const OrganizationDescription({
|
||||
required this.description,
|
||||
this.logoUrl,
|
||||
});
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/permissions/bound.dart';
|
||||
import 'package:pshared/models/permissions/bound/describable.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
|
||||
class Organization implements Storable {
|
||||
class Organization implements PermissionBoundStorableDescribable {
|
||||
final Storable storable;
|
||||
final PermissionBound permissionBound;
|
||||
final Describable describable;
|
||||
|
||||
@override
|
||||
String get id => storable.id;
|
||||
@@ -10,25 +15,39 @@ class Organization implements Storable {
|
||||
DateTime get createdAt => storable.createdAt;
|
||||
@override
|
||||
DateTime get updatedAt => storable.updatedAt;
|
||||
@override
|
||||
String get organizationRef => permissionBound.organizationRef;
|
||||
@override
|
||||
String get permissionRef => permissionBound.permissionRef;
|
||||
@override
|
||||
String get name => describable.name;
|
||||
@override
|
||||
String? get description => describable.description;
|
||||
|
||||
final String timeZone;
|
||||
final String? logoUrl;
|
||||
final String tenantRef;
|
||||
|
||||
const Organization({
|
||||
required this.storable,
|
||||
required this.describable,
|
||||
required this.timeZone,
|
||||
required this.permissionBound,
|
||||
required this.tenantRef,
|
||||
this.logoUrl,
|
||||
});
|
||||
|
||||
|
||||
Organization copyWith({
|
||||
String? name,
|
||||
String? Function()? description,
|
||||
Describable? describable,
|
||||
String? timeZone,
|
||||
String? Function()? logoUrl,
|
||||
}) => Organization(
|
||||
storable: storable, // Same Storable, same id
|
||||
describable: describableCopyWithOther(this.describable, describable),
|
||||
timeZone: timeZone ?? this.timeZone,
|
||||
logoUrl: logoUrl != null ? logoUrl() : this.logoUrl,
|
||||
permissionBound: permissionBound,
|
||||
tenantRef: tenantRef,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user