35 lines
752 B
Dart
35 lines
752 B
Dart
import 'package:pshared/models/storable.dart';
|
|
|
|
|
|
class Organization implements Storable {
|
|
final Storable storable;
|
|
|
|
@override
|
|
String get id => storable.id;
|
|
@override
|
|
DateTime get createdAt => storable.createdAt;
|
|
@override
|
|
DateTime get updatedAt => storable.updatedAt;
|
|
|
|
final String timeZone;
|
|
final String? logoUrl;
|
|
|
|
const Organization({
|
|
required this.storable,
|
|
required this.timeZone,
|
|
this.logoUrl,
|
|
});
|
|
|
|
|
|
Organization copyWith({
|
|
String? name,
|
|
String? Function()? description,
|
|
String? timeZone,
|
|
String? Function()? logoUrl,
|
|
}) => Organization(
|
|
storable: storable, // Same Storable, same id
|
|
timeZone: timeZone ?? this.timeZone,
|
|
logoUrl: logoUrl != null ? logoUrl() : this.logoUrl,
|
|
);
|
|
}
|