File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ class ReturnSubmissionModel extends BaseModel {
42
42
}
43
43
}
44
44
45
+ /**
46
+ * Applies meter readings to return submission lines
47
+ */
45
48
$applyReadings ( ) {
46
49
const meter = this . $meter ( )
47
50
@@ -59,6 +62,11 @@ class ReturnSubmissionModel extends BaseModel {
59
62
}
60
63
}
61
64
65
+ /**
66
+ * Returns the first meter from the return submission's metadata, or null if no meters exist.
67
+ *
68
+ * @returns {?object } The first meter, or null.
69
+ */
62
70
$meter ( ) {
63
71
if ( ! this . metadata ?. meters ) {
64
72
return null
@@ -67,6 +75,12 @@ class ReturnSubmissionModel extends BaseModel {
67
75
return this . metadata . meters [ 0 ]
68
76
}
69
77
78
+ /**
79
+ * Returns the method of measurement from the return submission's metadata, defaulting to 'abstractionVolumes' if none
80
+ * is specified.
81
+ *
82
+ * @returns {string } The method of measurement.
83
+ */
70
84
$method ( ) {
71
85
if ( ! this . metadata ?. method ) {
72
86
return 'abstractionVolumes'
@@ -75,6 +89,11 @@ class ReturnSubmissionModel extends BaseModel {
75
89
return this . metadata . method
76
90
}
77
91
92
+ /**
93
+ * Returns the unit of measurement from the return submission's metadata, defaulting to cubic metres if not specified.
94
+ *
95
+ * @returns {string } The unit of measurement.
96
+ */
78
97
$units ( ) {
79
98
if ( ! this . metadata ?. units ) {
80
99
return unitNames . CUBIC_METRES
You can’t perform that action at this time.
0 commit comments