-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for FreshPack Bin Lots and Fruit Temperatures
- Loading branch information
1 parent
3060593
commit eb69d49
Showing
8 changed files
with
2,637 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,008 changes: 1,008 additions & 0 deletions
1,008
src/Controllers/Packhouse/Site/FreshPackBinLotController.js
Large diffs are not rendered by default.
Oops, something went wrong.
1,023 changes: 1,023 additions & 0 deletions
1,023
src/Controllers/Packhouse/Site/FreshPackFruitTemperatureController.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,248 @@ | ||
/** | ||
* File Auto-Generated by the RICADO Gen 4 PHP API Project | ||
* | ||
* Do Not Edit this File Manually! | ||
*/ | ||
|
||
import BaseModel from '../../../Models/BaseModel'; | ||
|
||
/** | ||
* Model Class for a FreshPack Bin Lot | ||
* | ||
* @class | ||
* @hideconstructor | ||
* @extends BaseModel | ||
*/ | ||
class FreshPackBinLotModel extends BaseModel | ||
{ | ||
/** | ||
* FreshPackBinLotModel Constructor | ||
* | ||
* @protected | ||
* @param {number} siteId The Site ID associated with this FreshPack Bin Lot | ||
*/ | ||
constructor(siteId) | ||
{ | ||
super(); | ||
|
||
/** | ||
* The FreshPack Bin Lot ID | ||
* | ||
* @type {string} | ||
* @public | ||
*/ | ||
this.id = ""; | ||
|
||
/** | ||
* The Bin Tip ID this Bin Lot is associated with | ||
* | ||
* @type {string} | ||
* @public | ||
*/ | ||
this.binTipId = ""; | ||
|
||
/** | ||
* The Bin Lot Code | ||
* | ||
* @type {string} | ||
* @public | ||
*/ | ||
this.binLotCode = ""; | ||
|
||
/** | ||
* When this Bin Lot was Created | ||
* | ||
* @type {Date} | ||
* @public | ||
*/ | ||
this.createdTimestamp = new Date(); | ||
|
||
/** | ||
* An Array of Packrun IDs associated with this Bin Lot | ||
* | ||
* @type {string[]} | ||
* @public | ||
*/ | ||
this.packrunIds = []; | ||
|
||
/** | ||
* An Array of Bin Numbers for this Bin Lot | ||
* | ||
* @type {string[]} | ||
* @public | ||
*/ | ||
this.binNumbers = []; | ||
|
||
/** | ||
* Whether the FreshPack Bin Lot has been deleted | ||
* | ||
* @type {boolean} | ||
* @public | ||
*/ | ||
this.deleted = false; | ||
|
||
/** | ||
* When the FreshPack Bin Lot was last updated | ||
* | ||
* @type {Date} | ||
* @public | ||
*/ | ||
this.updateTimestamp = new Date(); | ||
|
||
/** | ||
* The Site ID associated with this FreshPack Bin Lot | ||
* | ||
* @type {number} | ||
* @public | ||
*/ | ||
this.siteId = siteId; | ||
} | ||
|
||
/** | ||
* Create a new **FreshPackBinLotModel** from a JSON Object or JSON String | ||
* | ||
* @static | ||
* @public | ||
* @param {Object<string, any>|string} json A JSON Object or JSON String | ||
* @param {number} siteId The Site ID associated with this FreshPack Bin Lot | ||
* @return {FreshPackBinLotModel} | ||
*/ | ||
static fromJSON(json, siteId) | ||
{ | ||
let model = new FreshPackBinLotModel(siteId); | ||
|
||
/** | ||
* The JSON Object | ||
* | ||
* @type {Object<string, any>} | ||
*/ | ||
let jsonObject = {}; | ||
|
||
if(typeof json === 'string') | ||
{ | ||
jsonObject = JSON.parse(json); | ||
} | ||
else if(typeof json === 'object') | ||
{ | ||
jsonObject = json; | ||
} | ||
|
||
if('id' in jsonObject) | ||
{ | ||
model.id = (function(){ | ||
if(typeof jsonObject['id'] !== 'string') | ||
{ | ||
return String(jsonObject['id']); | ||
} | ||
|
||
return jsonObject['id']; | ||
}()); | ||
} | ||
|
||
if('binTipId' in jsonObject) | ||
{ | ||
model.binTipId = (function(){ | ||
if(typeof jsonObject['binTipId'] !== 'string') | ||
{ | ||
return String(jsonObject['binTipId']); | ||
} | ||
|
||
return jsonObject['binTipId']; | ||
}()); | ||
} | ||
|
||
if('binLotCode' in jsonObject) | ||
{ | ||
model.binLotCode = (function(){ | ||
if(typeof jsonObject['binLotCode'] !== 'string') | ||
{ | ||
return String(jsonObject['binLotCode']); | ||
} | ||
|
||
return jsonObject['binLotCode']; | ||
}()); | ||
} | ||
|
||
if('createdTimestamp' in jsonObject) | ||
{ | ||
model.createdTimestamp = (function(){ | ||
if(typeof jsonObject['createdTimestamp'] !== 'string') | ||
{ | ||
return new Date(String(jsonObject['createdTimestamp'])); | ||
} | ||
|
||
return new Date(jsonObject['createdTimestamp']); | ||
}()); | ||
} | ||
|
||
if('packrunIds' in jsonObject) | ||
{ | ||
model.packrunIds = (function(){ | ||
if(Array.isArray(jsonObject['packrunIds']) !== true) | ||
{ | ||
return []; | ||
} | ||
|
||
return jsonObject['packrunIds'].map((packrunIdsItem) => { | ||
return (function(){ | ||
if(typeof packrunIdsItem !== 'string') | ||
{ | ||
return String(packrunIdsItem); | ||
} | ||
|
||
return packrunIdsItem; | ||
}()); | ||
}); | ||
}()); | ||
} | ||
|
||
if('binNumbers' in jsonObject) | ||
{ | ||
model.binNumbers = (function(){ | ||
if(Array.isArray(jsonObject['binNumbers']) !== true) | ||
{ | ||
return []; | ||
} | ||
|
||
return jsonObject['binNumbers'].map((binNumbersItem) => { | ||
return (function(){ | ||
if(typeof binNumbersItem !== 'string') | ||
{ | ||
return String(binNumbersItem); | ||
} | ||
|
||
return binNumbersItem; | ||
}()); | ||
}); | ||
}()); | ||
} | ||
|
||
if('deleted' in jsonObject) | ||
{ | ||
model.deleted = (function(){ | ||
if(typeof jsonObject['deleted'] !== 'boolean') | ||
{ | ||
return Boolean(jsonObject['deleted']); | ||
} | ||
|
||
return jsonObject['deleted']; | ||
}()); | ||
} | ||
|
||
if('updateTimestamp' in jsonObject) | ||
{ | ||
model.updateTimestamp = (function(){ | ||
if(typeof jsonObject['updateTimestamp'] !== 'string') | ||
{ | ||
return new Date(String(jsonObject['updateTimestamp'])); | ||
} | ||
|
||
return new Date(jsonObject['updateTimestamp']); | ||
}()); | ||
} | ||
|
||
return model; | ||
} | ||
} | ||
|
||
export default FreshPackBinLotModel; |
Oops, something went wrong.