Frontend first draft
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class OrganizationDescription {
|
||||
final String? logoUrl;
|
||||
|
||||
const OrganizationDescription({
|
||||
this.logoUrl,
|
||||
});
|
||||
}
|
||||
4
frontend/pshared/lib/models/organization/employee.dart
Normal file
4
frontend/pshared/lib/models/organization/employee.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'package:pshared/models/account/account.dart';
|
||||
|
||||
|
||||
typedef Employee = Account;
|
||||
34
frontend/pshared/lib/models/organization/organization.dart
Normal file
34
frontend/pshared/lib/models/organization/organization.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user