@ricado/api-client 2.5.12 → 2.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/ShiftController.js +1784 -190
- package/lib/Models/Packhouse/Site/ShiftModel.js +99 -1
- package/lib/PackageVersion.js +1 -1
- package/lib/WebSocketHelper.js +2 -3
- package/lib/index.d.ts +2072 -1607
- package/package.json +2 -2
- package/src/Controllers/Packhouse/Site/ShiftController.js +2027 -0
- package/src/Models/Packhouse/Site/ShiftModel.js +124 -0
- package/src/PackageVersion.js +1 -1
- package/src/WebSocketHelper.js +0 -2
- package/types/tslint.json +3 -1
|
@@ -179,6 +179,14 @@ class ShiftModel extends BaseModel
|
|
|
179
179
|
return scheduleDefaultValue;
|
|
180
180
|
}());
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* The Score Weightings used for this Shift. Represented as a Number between 0.0 and 1.0
|
|
184
|
+
*
|
|
185
|
+
* @type {?{class1TraysPerHour: number, costPerTray: number, qualityR600Ideal: number, customQualities: Array<{id: string, weighting: number}>}}
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
this.scoreWeightings = null;
|
|
189
|
+
|
|
182
190
|
/**
|
|
183
191
|
* The Status of this Shift
|
|
184
192
|
*
|
|
@@ -687,6 +695,122 @@ class ShiftModel extends BaseModel
|
|
|
687
695
|
}());
|
|
688
696
|
}
|
|
689
697
|
|
|
698
|
+
if('scoreWeightings' in jsonObject)
|
|
699
|
+
{
|
|
700
|
+
model.scoreWeightings = (function(){
|
|
701
|
+
if(jsonObject['scoreWeightings'] === null)
|
|
702
|
+
{
|
|
703
|
+
return null;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
let scoreWeightingsObject = {};
|
|
707
|
+
|
|
708
|
+
if(typeof jsonObject['scoreWeightings'] === 'object' && 'class1TraysPerHour' in jsonObject['scoreWeightings'])
|
|
709
|
+
{
|
|
710
|
+
scoreWeightingsObject.class1TraysPerHour = (function(){
|
|
711
|
+
if(typeof jsonObject['scoreWeightings'].class1TraysPerHour !== 'number')
|
|
712
|
+
{
|
|
713
|
+
return Number(jsonObject['scoreWeightings'].class1TraysPerHour);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
return jsonObject['scoreWeightings'].class1TraysPerHour;
|
|
717
|
+
}());
|
|
718
|
+
}
|
|
719
|
+
else
|
|
720
|
+
{
|
|
721
|
+
scoreWeightingsObject.class1TraysPerHour = 0;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
if(typeof jsonObject['scoreWeightings'] === 'object' && 'costPerTray' in jsonObject['scoreWeightings'])
|
|
725
|
+
{
|
|
726
|
+
scoreWeightingsObject.costPerTray = (function(){
|
|
727
|
+
if(typeof jsonObject['scoreWeightings'].costPerTray !== 'number')
|
|
728
|
+
{
|
|
729
|
+
return Number(jsonObject['scoreWeightings'].costPerTray);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return jsonObject['scoreWeightings'].costPerTray;
|
|
733
|
+
}());
|
|
734
|
+
}
|
|
735
|
+
else
|
|
736
|
+
{
|
|
737
|
+
scoreWeightingsObject.costPerTray = 0;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
if(typeof jsonObject['scoreWeightings'] === 'object' && 'qualityR600Ideal' in jsonObject['scoreWeightings'])
|
|
741
|
+
{
|
|
742
|
+
scoreWeightingsObject.qualityR600Ideal = (function(){
|
|
743
|
+
if(typeof jsonObject['scoreWeightings'].qualityR600Ideal !== 'number')
|
|
744
|
+
{
|
|
745
|
+
return Number(jsonObject['scoreWeightings'].qualityR600Ideal);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return jsonObject['scoreWeightings'].qualityR600Ideal;
|
|
749
|
+
}());
|
|
750
|
+
}
|
|
751
|
+
else
|
|
752
|
+
{
|
|
753
|
+
scoreWeightingsObject.qualityR600Ideal = 0;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
if(typeof jsonObject['scoreWeightings'] === 'object' && 'customQualities' in jsonObject['scoreWeightings'])
|
|
757
|
+
{
|
|
758
|
+
scoreWeightingsObject.customQualities = (function(){
|
|
759
|
+
if(Array.isArray(jsonObject['scoreWeightings'].customQualities) !== true)
|
|
760
|
+
{
|
|
761
|
+
return [];
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
return jsonObject['scoreWeightings'].customQualities.map((customQualitiesItem) => {
|
|
765
|
+
return (function(){
|
|
766
|
+
let customQualitiesItemObject = {};
|
|
767
|
+
|
|
768
|
+
if(typeof customQualitiesItem === 'object' && 'id' in customQualitiesItem)
|
|
769
|
+
{
|
|
770
|
+
customQualitiesItemObject.id = (function(){
|
|
771
|
+
if(typeof customQualitiesItem.id !== 'string')
|
|
772
|
+
{
|
|
773
|
+
return String(customQualitiesItem.id);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return customQualitiesItem.id;
|
|
777
|
+
}());
|
|
778
|
+
}
|
|
779
|
+
else
|
|
780
|
+
{
|
|
781
|
+
customQualitiesItemObject.id = "";
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
if(typeof customQualitiesItem === 'object' && 'weighting' in customQualitiesItem)
|
|
785
|
+
{
|
|
786
|
+
customQualitiesItemObject.weighting = (function(){
|
|
787
|
+
if(typeof customQualitiesItem.weighting !== 'number')
|
|
788
|
+
{
|
|
789
|
+
return Number(customQualitiesItem.weighting);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return customQualitiesItem.weighting;
|
|
793
|
+
}());
|
|
794
|
+
}
|
|
795
|
+
else
|
|
796
|
+
{
|
|
797
|
+
customQualitiesItemObject.weighting = 0;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
return customQualitiesItemObject;
|
|
801
|
+
}());
|
|
802
|
+
});
|
|
803
|
+
}());
|
|
804
|
+
}
|
|
805
|
+
else
|
|
806
|
+
{
|
|
807
|
+
scoreWeightingsObject.customQualities = [];
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
return scoreWeightingsObject;
|
|
811
|
+
}());
|
|
812
|
+
}
|
|
813
|
+
|
|
690
814
|
if('status' in jsonObject)
|
|
691
815
|
{
|
|
692
816
|
model.status = (function(){
|
package/src/PackageVersion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '2.5.
|
|
2
|
+
export const version = '2.5.14';
|
package/src/WebSocketHelper.js
CHANGED
|
@@ -59,10 +59,8 @@ class WebSocketHelper
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
// @ts-expect-error
|
|
63
62
|
var onEvent = WebSocketHelper._socket.onevent;
|
|
64
63
|
|
|
65
|
-
// @ts-expect-error
|
|
66
64
|
WebSocketHelper._socket.onevent = function (packet) {
|
|
67
65
|
var args = packet.data || [];
|
|
68
66
|
onEvent.call (this, packet); // original call
|
package/types/tslint.json
CHANGED