26 lines
618 B
Dart
26 lines
618 B
Dart
import 'package:pshared/data/dto/permissions/data/role.dart';
|
|
import 'package:pshared/models/permissions/data/role.dart';
|
|
|
|
|
|
extension RoleMapper on Role {
|
|
/// Converts a `Role` domain model to a `RoleDTO`.
|
|
RoleDTO toDTO() {
|
|
return RoleDTO(
|
|
accountRef: accountRef,
|
|
descriptionRef: descriptionRef,
|
|
organizationRef: organizationRef,
|
|
);
|
|
}
|
|
}
|
|
|
|
extension RoleDTOMapper on RoleDTO {
|
|
/// Converts a `RoleDTO` to a `Role` domain model.
|
|
Role toDomain() {
|
|
return Role(
|
|
accountRef: accountRef,
|
|
descriptionRef: descriptionRef,
|
|
organizationRef: organizationRef,
|
|
);
|
|
}
|
|
}
|