Skip to content

Commit 5b59eee

Browse files
authored
Merge pull request #697 from OpenRailAssociation/mcy/fix-pass-dto-in-operations
fix: use getDto() in NGE events instead of models
2 parents 710723e + c256a8c commit 5b59eee

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/app/models/operation.model.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import {Node} from "./node.model";
22
import {Trainrun} from "./trainrun.model";
33
import {Label} from "./label.model";
44
import {Note} from "./note.model";
5+
import {
6+
FreeFloatingTextDto,
7+
LabelDto,
8+
NodeDto,
9+
TrainrunDto,
10+
} from "../data-structures/business.data.structures";
511

612
enum OperationType {
713
create = "create",
@@ -27,38 +33,38 @@ abstract class Operation {
2733
}
2834

2935
class TrainrunOperation extends Operation {
30-
readonly trainrun: Trainrun;
36+
readonly trainrun: TrainrunDto;
3137

3238
constructor(operationType: OperationType, trainrun: Trainrun) {
3339
super(operationType, OperationObjectType.trainrun);
34-
this.trainrun = trainrun;
40+
this.trainrun = trainrun.getDto();
3541
}
3642
}
3743

3844
class NodeOperation extends Operation {
39-
readonly node: Node;
45+
readonly node: NodeDto;
4046

4147
constructor(operationType: OperationType, node: Node) {
4248
super(operationType, OperationObjectType.node);
43-
this.node = node;
49+
this.node = node.getDto();
4450
}
4551
}
4652

4753
class LabelOperation extends Operation {
48-
readonly label: Label;
54+
readonly label: LabelDto;
4955

5056
constructor(operationType: OperationType, label: Label) {
5157
super(operationType, OperationObjectType.label);
52-
this.label = label;
58+
this.label = label.getDto();
5359
}
5460
}
5561

5662
class NoteOperation extends Operation {
57-
readonly note: Note;
63+
readonly note: FreeFloatingTextDto;
5864

5965
constructor(operationType: OperationType, note: Note) {
6066
super(operationType, OperationObjectType.note);
61-
this.note = note;
67+
this.note = note.getDto();
6268
}
6369
}
6470

0 commit comments

Comments
 (0)