File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
app/bounded_contexts/tracking/infrastructure/mappers Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ module Tracking
2
+ module Infrastructure
3
+ module Mappers
4
+ module TrackingEventMapper
5
+ module_function
6
+
7
+ def to_entity ( tracking_event_dao )
8
+ Domain ::ValueObjects ::TrackingEvent . new (
9
+ tracking_voyage_number : Domain ::ValueObjects ::TrackingVoyageNumber . new (
10
+ value : tracking_event_dao . voyage_number
11
+ ) ,
12
+ tracking_location : Domain ::ValueObjects ::TrackingLocation . new (
13
+ un_loc_code : tracking_event_dao . location_id
14
+ ) ,
15
+ event_type : tracking_event_dao . event_type ,
16
+ event_time : tracking_event_dao . event_time . to_datetime ,
17
+ )
18
+ end
19
+
20
+ def to_dao ( tracking_event )
21
+ {
22
+ event_type : tracking_event . event_type ,
23
+ event_time : tracking_event . event_time ,
24
+ location_id : tracking_event . tracking_location . un_loc_code ,
25
+ voyage_number : tracking_event . tracking_voyage_number . value
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
You can’t perform that action at this time.
0 commit comments