Frontend first draft
This commit is contained in:
25
frontend/pshared/lib/data/mapper/permissions/data/role.dart
Normal file
25
frontend/pshared/lib/data/mapper/permissions/data/role.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user