Frontend first draft
This commit is contained in:
22
frontend/pshared/lib/data/mapper/organization.dart
Normal file
22
frontend/pshared/lib/data/mapper/organization.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:pshared/data/dto/organization.dart';
|
||||
import 'package:pshared/models/organization/organization.dart';
|
||||
import 'package:pshared/models/storable.dart';
|
||||
|
||||
|
||||
extension OrganizationMapper on Organization {
|
||||
OrganizationDTO toDTO() => OrganizationDTO(
|
||||
id: storable.id,
|
||||
createdAt: storable.createdAt,
|
||||
updatedAt: storable.updatedAt,
|
||||
timeZone: timeZone,
|
||||
logoUrl: logoUrl,
|
||||
);
|
||||
}
|
||||
|
||||
extension OrganizationDTOMapper on OrganizationDTO {
|
||||
Organization toDomain() => Organization(
|
||||
storable: newStorable(id: id, createdAt: createdAt, updatedAt: updatedAt),
|
||||
timeZone: timeZone,
|
||||
logoUrl: logoUrl,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user