Some checks failed
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
ci/woodpecker/push/fx_ingestor 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
83 lines
2.3 KiB
Dart
83 lines
2.3 KiB
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'signup.g.dart';
|
|
|
|
|
|
@JsonSerializable(explicitToJson: true)
|
|
class SignupRequest {
|
|
final SignupAccount account;
|
|
final DescribableRequest organization;
|
|
final String organizationTimeZone;
|
|
final DescribableRequest anonymousUser;
|
|
final DescribableRequest ownerRole;
|
|
final DescribableRequest anonymousRole;
|
|
|
|
const SignupRequest({
|
|
required this.account,
|
|
required this.organization,
|
|
required this.organizationTimeZone,
|
|
required this.anonymousUser,
|
|
required this.ownerRole,
|
|
required this.anonymousRole,
|
|
});
|
|
|
|
factory SignupRequest.build({
|
|
required String name,
|
|
required String login,
|
|
required String password,
|
|
required String locale,
|
|
required String organizationName,
|
|
required String organizationTimeZone,
|
|
}) =>
|
|
SignupRequest(
|
|
account: SignupAccount(
|
|
name: name,
|
|
login: login,
|
|
password: password,
|
|
locale: locale,
|
|
),
|
|
organization: DescribableRequest(name: organizationName),
|
|
organizationTimeZone: organizationTimeZone,
|
|
anonymousUser: const DescribableRequest(name: 'Anonymous'),
|
|
ownerRole: const DescribableRequest(name: 'Owner'),
|
|
anonymousRole: const DescribableRequest(name: 'Anonymous'),
|
|
);
|
|
|
|
factory SignupRequest.fromJson(Map<String, dynamic> json) =>
|
|
_$SignupRequestFromJson(json);
|
|
Map<String, dynamic> toJson() => _$SignupRequestToJson(this);
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class SignupAccount {
|
|
final String name;
|
|
final String login;
|
|
final String password;
|
|
final String locale;
|
|
final String? description;
|
|
|
|
const SignupAccount({
|
|
required this.name,
|
|
required this.login,
|
|
required this.password,
|
|
required this.locale,
|
|
this.description,
|
|
});
|
|
|
|
factory SignupAccount.fromJson(Map<String, dynamic> json) =>
|
|
_$SignupAccountFromJson(json);
|
|
Map<String, dynamic> toJson() => _$SignupAccountToJson(this);
|
|
}
|
|
|
|
@JsonSerializable()
|
|
class DescribableRequest {
|
|
final String name;
|
|
final String? description;
|
|
|
|
const DescribableRequest({required this.name, this.description});
|
|
|
|
factory DescribableRequest.fromJson(Map<String, dynamic> json) =>
|
|
_$DescribableRequestFromJson(json);
|
|
Map<String, dynamic> toJson() => _$DescribableRequestToJson(this);
|
|
}
|