Files
sendico/frontend/pshared/lib/data/mapper/organization.dart
Stephan D c6a56071b5
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
+signup +login
2025-11-17 20:16:45 +01:00

37 lines
1.2 KiB
Dart

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';
extension OrganizationMapper on Organization {
OrganizationDTO toDTO() => OrganizationDTO(
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,
);
}