+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

This commit is contained in:
Stephan D
2025-11-17 20:16:45 +01:00
parent 1ab7f2e7d3
commit c6a56071b5
89 changed files with 1308 additions and 3497 deletions

View File

@@ -1,36 +1,35 @@
import 'package:flutter/foundation.dart';
import 'package:pshared/models/account/base.dart';
import 'package:pshared/models/describable.dart';
@immutable
class Account extends AccountBase {
final String login;
final String locale;
const Account({
required super.storable,
required super.describable,
required super.avatarUrl,
required super.lastName,
required this.login,
required super.locale,
required super.name,
required this.locale,
});
factory Account.fromBase(AccountBase accountBase, String login) => Account(
storable: accountBase.storable,
avatarUrl: accountBase.avatarUrl,
locale: accountBase.locale,
name: accountBase.name,
login: login,
);
@override
Account copyWith({
Describable? describable,
String? lastName,
String? Function()? avatarUrl,
String? name,
String? locale,
}) {
final updatedBase = super.copyWith(
avatarUrl: avatarUrl,
name: name,
locale: locale,
);
return Account.fromBase(updatedBase, login);
}
}) => Account(
storable: storable,
describable: describableCopyWithOther(this.describable, describable),
lastName: lastName ?? this.lastName,
avatarUrl: avatarUrl != null ? avatarUrl() : this.avatarUrl,
login: login,
locale: locale ?? this.locale,
);
}

View File

@@ -1,8 +1,16 @@
import 'package:flutter/foundation.dart';
import 'package:pshared/models/describable.dart';
import 'package:pshared/models/storable.dart';
import 'package:pshared/models/storable/describable.dart';
import 'package:pshared/utils/name_initials.dart';
class AccountBase implements Storable {
@immutable
class AccountBase implements StorableDescribable {
final Storable storable;
final Describable describable;
final String lastName;
@override
String get id => storable.id;
@@ -10,26 +18,30 @@ class AccountBase implements Storable {
DateTime get createdAt => storable.createdAt;
@override
DateTime get updatedAt => storable.updatedAt;
@override
String get name => describable.name;
@override
String? get description => describable.description;
final String? avatarUrl;
final String name;
final String locale;
const AccountBase({
required this.storable,
required this.name,
required this.locale,
required this.describable,
required this.avatarUrl,
required this.lastName,
});
String get nameInitials => getNameInitials(describable.name);
AccountBase copyWith({
Describable? describable,
String? lastName,
String? Function()? avatarUrl,
String? name,
String? locale,
}) => AccountBase(
storable: storable,
avatarUrl: avatarUrl != null ? avatarUrl() : this.avatarUrl,
locale: locale ?? this.locale,
name: name ?? this.name,
describable: describable ?? this.describable,
lastName: lastName ?? this.lastName,
);
}