Skip to content

Commit

Permalink
Added support for FreshPack Bin Lots and Fruit Temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ashneilson committed Mar 7, 2023
1 parent 3060593 commit eb69d49
Show file tree
Hide file tree
Showing 8 changed files with 2,637 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ricado/api-client",
"version": "2.3.21",
"version": "2.3.22",
"description": "RICADO Gen 4 API Client Library for NodeJS and Browsers",
"author": {
"name": "Ash Neilson"
Expand Down
1,008 changes: 1,008 additions & 0 deletions src/Controllers/Packhouse/Site/FreshPackBinLotController.js

Large diffs are not rendered by default.

1,023 changes: 1,023 additions & 0 deletions src/Controllers/Packhouse/Site/FreshPackFruitTemperatureController.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/Controllers/Packhouse/Site/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import CompacSizerOutletTypeChangeController from './CompacSizerOutletTypeChange
import CompacSizerOutletTypeController from './CompacSizerOutletTypeController';
import CompacSizerPackrunSummaryController from './CompacSizerPackrunSummaryController';
import DowntimeEventController from './DowntimeEventController';
import FreshPackBinLotController from './FreshPackBinLotController';
import FreshPackFruitTemperatureController from './FreshPackFruitTemperatureController';
import FreshPackPackrunSummaryController from './FreshPackPackrunSummaryController';
import FreshQualityPackrunSummaryController from './FreshQualityPackrunSummaryController';
import GrowingMethodController from './GrowingMethodController';
Expand Down Expand Up @@ -57,6 +59,8 @@ const Site = {
CompacSizerOutletTypeController,
CompacSizerPackrunSummaryController,
DowntimeEventController,
FreshPackBinLotController,
FreshPackFruitTemperatureController,
FreshPackPackrunSummaryController,
FreshQualityPackrunSummaryController,
GrowingMethodController,
Expand Down
248 changes: 248 additions & 0 deletions src/Models/Packhouse/Site/FreshPackBinLotModel.js
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;
Loading

0 comments on commit eb69d49

Please sign in to comment.