+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:
@@ -1,6 +1,7 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/account/base.dart';
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
|
||||
part 'account.g.dart';
|
||||
|
||||
@@ -8,14 +9,17 @@ part 'account.g.dart';
|
||||
@JsonSerializable()
|
||||
class AccountDTO extends AccountBaseDTO {
|
||||
final String login;
|
||||
final String locale;
|
||||
|
||||
const AccountDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required super.name,
|
||||
required super.lastName,
|
||||
required super.description,
|
||||
required super.avatarUrl,
|
||||
required super.locale,
|
||||
required this.locale,
|
||||
required this.login,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
|
||||
part 'base.g.dart';
|
||||
|
||||
@@ -8,7 +9,8 @@ part 'base.g.dart';
|
||||
@JsonSerializable()
|
||||
class AccountBaseDTO extends StorableDTO {
|
||||
final String name;
|
||||
final String locale;
|
||||
final String lastName;
|
||||
final String? description;
|
||||
final String? avatarUrl;
|
||||
|
||||
const AccountBaseDTO({
|
||||
@@ -16,8 +18,9 @@ class AccountBaseDTO extends StorableDTO {
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required this.name,
|
||||
required this.description,
|
||||
required this.avatarUrl,
|
||||
required this.locale,
|
||||
required this.lastName,
|
||||
});
|
||||
|
||||
factory AccountBaseDTO.fromJson(Map<String, dynamic> json) => _$AccountBaseDTOFromJson(json);
|
||||
|
||||
12
frontend/pshared/lib/data/dto/date_time.dart
Normal file
12
frontend/pshared/lib/data/dto/date_time.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
|
||||
class UtcIso8601Converter implements JsonConverter<DateTime, String> {
|
||||
const UtcIso8601Converter();
|
||||
|
||||
@override
|
||||
DateTime fromJson(String json) => DateTime.parse(json).toUtc();
|
||||
|
||||
@override
|
||||
String toJson(DateTime value) => value.toUtc().toIso8601String();
|
||||
}
|
||||
18
frontend/pshared/lib/data/dto/describable.dart
Normal file
18
frontend/pshared/lib/data/dto/describable.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'describable.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class DescribableDTO {
|
||||
final String name;
|
||||
final String? description;
|
||||
|
||||
const DescribableDTO({
|
||||
required this.name,
|
||||
this.description,
|
||||
});
|
||||
|
||||
factory DescribableDTO.fromJson(Map<String, dynamic> json) => _$DescribableDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DescribableDTOToJson(this);
|
||||
}
|
||||
@@ -1,18 +1,28 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
import 'package:pshared/data/dto/permissions/bound.dart';
|
||||
|
||||
part 'organization.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class OrganizationDTO extends StorableDTO {
|
||||
class OrganizationDTO extends PermissionBoundDTO {
|
||||
final String name;
|
||||
final String? description;
|
||||
final String timeZone;
|
||||
final String? logoUrl;
|
||||
final String tenantRef;
|
||||
|
||||
const OrganizationDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required super.permissionRef,
|
||||
required super.organizationRef,
|
||||
required this.name,
|
||||
required this.tenantRef,
|
||||
this.description,
|
||||
required this.timeZone,
|
||||
this.logoUrl,
|
||||
});
|
||||
|
||||
23
frontend/pshared/lib/data/dto/organization/bound.dart
Normal file
23
frontend/pshared/lib/data/dto/organization/bound.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
|
||||
part 'bound.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class OrganizationBoundDTO extends StorableDTO {
|
||||
final String organizationRef;
|
||||
|
||||
const OrganizationBoundDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required this.organizationRef,
|
||||
});
|
||||
|
||||
factory OrganizationBoundDTO.fromJson(Map<String, dynamic> json) => _$OrganizationBoundDTOFromJson(json);
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$OrganizationBoundDTOToJson(this);
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/describable.dart';
|
||||
|
||||
part 'description.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class OrganizationDescriptionDTO {
|
||||
final DescribableDTO description;
|
||||
final String? logoUrl;
|
||||
|
||||
const OrganizationDescriptionDTO({
|
||||
required this.description,
|
||||
this.logoUrl,
|
||||
});
|
||||
|
||||
|
||||
26
frontend/pshared/lib/data/dto/permissions/bound.dart
Normal file
26
frontend/pshared/lib/data/dto/permissions/bound.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
|
||||
part 'bound.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PermissionBoundDTO extends StorableDTO {
|
||||
final String permissionRef;
|
||||
final String organizationRef;
|
||||
|
||||
const PermissionBoundDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required this.permissionRef,
|
||||
required this.organizationRef,
|
||||
});
|
||||
|
||||
factory PermissionBoundDTO.fromJson(Map<String, dynamic> json) => _$PermissionBoundDTOFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$PermissionBoundDTOToJson(this);
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
|
||||
import 'package:pshared/data/dto/storable/describable.dart';
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
import 'package:pshared/models/resources.dart';
|
||||
|
||||
part 'policy.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class PolicyDescriptionDTO extends StorableDTO {
|
||||
class PolicyDescriptionDTO extends StorableDescribabaleDTO {
|
||||
final List<ResourceType>? resourceTypes;
|
||||
final String? organizationRef;
|
||||
|
||||
@@ -14,6 +16,8 @@ class PolicyDescriptionDTO extends StorableDTO {
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required super.name,
|
||||
required super.description,
|
||||
required this.resourceTypes,
|
||||
required this.organizationRef,
|
||||
});
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
import 'package:pshared/data/dto/storable/describable.dart';
|
||||
|
||||
part 'role.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class RoleDescriptionDTO extends StorableDTO {
|
||||
class RoleDescriptionDTO extends StorableDescribabaleDTO {
|
||||
final String organizationRef;
|
||||
|
||||
const RoleDescriptionDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required super.name,
|
||||
required super.description,
|
||||
required this.organizationRef,
|
||||
});
|
||||
|
||||
|
||||
16
frontend/pshared/lib/data/dto/reference.dart
Normal file
16
frontend/pshared/lib/data/dto/reference.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'reference.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class ReferenceDTO {
|
||||
final String ref;
|
||||
|
||||
const ReferenceDTO({
|
||||
required this.ref,
|
||||
});
|
||||
|
||||
factory ReferenceDTO.fromJson(Map<String, dynamic> json) => _$ReferenceDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$ReferenceDTOToJson(this);
|
||||
}
|
||||
@@ -1,12 +1,18 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
|
||||
part 'storable.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class StorableDTO {
|
||||
final String id;
|
||||
|
||||
@UtcIso8601Converter()
|
||||
final DateTime createdAt;
|
||||
|
||||
@UtcIso8601Converter()
|
||||
final DateTime updatedAt;
|
||||
|
||||
const StorableDTO({
|
||||
|
||||
26
frontend/pshared/lib/data/dto/storable/describable.dart
Normal file
26
frontend/pshared/lib/data/dto/storable/describable.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:pshared/data/dto/date_time.dart';
|
||||
import 'package:pshared/data/dto/storable.dart';
|
||||
|
||||
part 'describable.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class StorableDescribabaleDTO extends StorableDTO {
|
||||
final String name;
|
||||
final String? description;
|
||||
|
||||
const StorableDescribabaleDTO({
|
||||
required super.id,
|
||||
required super.createdAt,
|
||||
required super.updatedAt,
|
||||
required this.name,
|
||||
this.description,
|
||||
});
|
||||
|
||||
factory StorableDescribabaleDTO.fromJson(Map<String, dynamic> json) => _$StorableDescribabaleDTOFromJson(json);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() => _$StorableDescribabaleDTOToJson(this);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:pshared/data/dto/account/account.dart';
|
||||
import 'package:pshared/models/account/account.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
|
||||
@@ -9,6 +10,8 @@ extension AccountMapper on Account {
|
||||
createdAt: createdAt,
|
||||
updatedAt: updatedAt,
|
||||
name: name,
|
||||
lastName: lastName,
|
||||
description: description,
|
||||
avatarUrl: avatarUrl,
|
||||
locale: locale,
|
||||
login: login,
|
||||
@@ -19,8 +22,9 @@ extension AccountDTOMapper on AccountDTO {
|
||||
Account toDomain() => Account(
|
||||
storable: newStorable(id: id, createdAt: createdAt, updatedAt: updatedAt),
|
||||
avatarUrl: avatarUrl,
|
||||
describable: newDescribable(name: name, description: description),
|
||||
lastName: lastName,
|
||||
locale: locale,
|
||||
login: login,
|
||||
name: name,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:pshared/data/dto/account/base.dart';
|
||||
import 'package:pshared/models/account/base.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
|
||||
@@ -8,17 +9,18 @@ extension AccountBaseMapper on AccountBase {
|
||||
id: storable.id,
|
||||
createdAt: storable.createdAt,
|
||||
updatedAt: storable.updatedAt,
|
||||
name: describable.name,
|
||||
description: describable.description,
|
||||
lastName: lastName,
|
||||
avatarUrl: avatarUrl,
|
||||
name: name,
|
||||
locale: locale,
|
||||
);
|
||||
}
|
||||
|
||||
extension AccountDTOMapper on AccountBaseDTO {
|
||||
AccountBase toDomain() => AccountBase(
|
||||
storable: newStorable(id: id, createdAt: createdAt, updatedAt: updatedAt),
|
||||
describable: newDescribable(name: name, description: description),
|
||||
lastName: lastName,
|
||||
avatarUrl: avatarUrl,
|
||||
name: name,
|
||||
locale: locale,
|
||||
);
|
||||
}
|
||||
|
||||
17
frontend/pshared/lib/data/mapper/describable.dart
Normal file
17
frontend/pshared/lib/data/mapper/describable.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:pshared/data/dto/describable.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
|
||||
|
||||
extension DescribableMapper on Describable {
|
||||
DescribableDTO toDTO() => DescribableDTO(
|
||||
name: name,
|
||||
description: description,
|
||||
);
|
||||
}
|
||||
|
||||
extension DescribableDTOMapper on DescribableDTO {
|
||||
Describable toDomain() => newDescribable(
|
||||
name: name,
|
||||
description: description,
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'package:pshared/data/dto/organization.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/organization/bound.dart';
|
||||
import 'package:pshared/models/organization/organization.dart';
|
||||
import 'package:pshared/models/permissions/bound.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
|
||||
@@ -8,15 +11,26 @@ extension OrganizationMapper on Organization {
|
||||
id: storable.id,
|
||||
createdAt: storable.createdAt,
|
||||
updatedAt: storable.updatedAt,
|
||||
name: describable.name,
|
||||
description: describable.description,
|
||||
timeZone: timeZone,
|
||||
logoUrl: logoUrl,
|
||||
organizationRef: permissionBound.organizationRef,
|
||||
permissionRef: permissionBound.permissionRef,
|
||||
tenantRef: tenantRef,
|
||||
);
|
||||
}
|
||||
|
||||
extension OrganizationDTOMapper on OrganizationDTO {
|
||||
Organization toDomain() => Organization(
|
||||
storable: newStorable(id: id, createdAt: createdAt, updatedAt: updatedAt),
|
||||
describable: newDescribable(name: name, description: description),
|
||||
timeZone: timeZone,
|
||||
logoUrl: logoUrl,
|
||||
permissionBound: newPermissionBound(
|
||||
organizationBound: newOrganizationBound(organizationRef: organizationRef),
|
||||
permissionRef: permissionRef,
|
||||
),
|
||||
tenantRef: tenantRef,
|
||||
);
|
||||
}
|
||||
|
||||
18
frontend/pshared/lib/data/mapper/organization/bound.dart
Normal file
18
frontend/pshared/lib/data/mapper/organization/bound.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:pshared/data/dto/organization/bound.dart';
|
||||
import 'package:pshared/models/organization/bound.dart';
|
||||
|
||||
|
||||
extension OrganizationBoundMapper on OrganizationBound {
|
||||
OrganizationBoundDTO toDTO() => OrganizationBoundDTO(
|
||||
id: '', // OrganizationBound doesn't have storable fields, so we need to provide defaults
|
||||
createdAt: DateTime.now(),
|
||||
updatedAt: DateTime.now(),
|
||||
organizationRef: organizationRef,
|
||||
);
|
||||
}
|
||||
|
||||
extension OrganizationBoundDTOMapper on OrganizationBoundDTO {
|
||||
OrganizationBound toDomain() => newOrganizationBound(
|
||||
organizationRef: organizationRef,
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
import 'package:pshared/data/dto/organization/description.dart';
|
||||
import 'package:pshared/data/mapper/describable.dart';
|
||||
import 'package:pshared/models/organization/description.dart';
|
||||
|
||||
|
||||
extension OrganizationDescriptionMapper on OrganizationDescription {
|
||||
OrganizationDescriptionDTO toDTO() => OrganizationDescriptionDTO(
|
||||
description: description.toDTO(),
|
||||
logoUrl: logoUrl,
|
||||
);
|
||||
}
|
||||
@@ -11,5 +13,6 @@ extension OrganizationDescriptionMapper on OrganizationDescription {
|
||||
extension AccountDescriptionDTOMapper on OrganizationDescriptionDTO {
|
||||
OrganizationDescription toDomain() => OrganizationDescription(
|
||||
logoUrl: logoUrl,
|
||||
description: description.toDomain(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:pshared/data/dto/permissions/description/policy.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/permissions/descriptions/policy.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
@@ -8,6 +9,8 @@ extension PolicyDescriptionMapper on PolicyDescription {
|
||||
id: storable.id,
|
||||
createdAt: storable.createdAt,
|
||||
updatedAt: storable.updatedAt,
|
||||
name: describable.name,
|
||||
description: describable.description,
|
||||
resourceTypes: resourceTypes,
|
||||
organizationRef: organizationRef,
|
||||
);
|
||||
@@ -16,6 +19,7 @@ extension PolicyDescriptionMapper on PolicyDescription {
|
||||
extension PolicyDescriptionDTOMapper on PolicyDescriptionDTO {
|
||||
PolicyDescription toDomain() => PolicyDescription(
|
||||
storable: newStorable(id: id, createdAt: createdAt, updatedAt: createdAt),
|
||||
describable: newDescribable(name: name, description: description),
|
||||
resourceTypes: resourceTypes,
|
||||
organizationRef: organizationRef,
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:pshared/data/dto/permissions/description/role.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/permissions/descriptions/role.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
@@ -8,6 +9,8 @@ extension RoleDescriptionMapper on RoleDescription {
|
||||
id: storable.id,
|
||||
createdAt: storable.createdAt,
|
||||
updatedAt: storable.updatedAt,
|
||||
name: describable.name,
|
||||
description: describable.description,
|
||||
organizationRef: organizationRef,
|
||||
);
|
||||
}
|
||||
@@ -15,6 +18,7 @@ extension RoleDescriptionMapper on RoleDescription {
|
||||
extension RoleDescriptionDTOMapper on RoleDescriptionDTO {
|
||||
RoleDescription toDomain() => RoleDescription(
|
||||
storable: newStorable(id: id, createdAt: createdAt, updatedAt: updatedAt),
|
||||
describable: newDescribable(name: name, description: description),
|
||||
organizationRef: organizationRef,
|
||||
);
|
||||
}
|
||||
|
||||
11
frontend/pshared/lib/data/mapper/reference.dart
Normal file
11
frontend/pshared/lib/data/mapper/reference.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
import 'package:pshared/data/dto/reference.dart';
|
||||
import 'package:pshared/models/reference.dart';
|
||||
|
||||
|
||||
extension ReferenceMapper on Reference {
|
||||
ReferenceDTO toDTO() => ReferenceDTO(ref: ref);
|
||||
}
|
||||
|
||||
extension ReferenceDTOMapper on ReferenceDTO {
|
||||
Reference toDomain() => newReference(ref: ref);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import 'package:pshared/models/storable.dart';
|
||||
|
||||
|
||||
extension StorableMapper on Storable {
|
||||
StorableDTO toDTO() => StorableDTO(id: id, createdAt: createdAt, updatedAt: updatedAt);
|
||||
StorableDTO toDTO() => StorableDTO(id: id, createdAt: createdAt.toUtc(), updatedAt: updatedAt.toUtc());
|
||||
}
|
||||
|
||||
extension StorableDTOMapper on StorableDTO {
|
||||
|
||||
Reference in New Issue
Block a user