RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

source

Controllers/Packhouse/Site/CompacSizerBatchController.js

/**
 * File Auto-Generated by the RICADO Gen 4 PHP API Project
 * 
 * Do Not Edit this File Manually!
 */

import RequestHelper from '../../../RequestHelper';
import CompacSizerBatchModel from '../../../Models/Packhouse/Site/CompacSizerBatchModel';

/**
 * Controller Class for Compac Sizer Batches
 * 
 * @class
 */
class CompacSizerBatchController
{
    /**
     * Retrieve a Compac Sizer Batch [GET /packhouse/sites/{siteId}/compac-sizer-batches/{id}]
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @return {Promise<CompacSizerBatchModel>}
     */
    static getOne(siteId, id)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.getRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}`)
            .then((result) => {
                let resolveValue = (function(){
                    return CompacSizerBatchModel.fromJSON(result, siteId);
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Update a Compac Sizer Batch [PATCH /packhouse/sites/{siteId}/compac-sizer-batches/{id}]
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @param {CompacSizerBatchController.UpdateData} updateData The Compac Sizer Batch Update Data
     * @return {Promise<CompacSizerBatchModel>}
     */
    static update(siteId, id, updateData)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.patchRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}`, updateData)
            .then((result) => {
                let resolveValue = (function(){
                    return CompacSizerBatchModel.fromJSON(result, siteId);
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Delete a Compac Sizer Batch [DELETE /packhouse/sites/{siteId}/compac-sizer-batches/{id}]
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @return {Promise<boolean>}
     */
    static delete(siteId, id)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.deleteRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}`)
            .then((result) => {
                resolve(result ?? true);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Retrieve Comments [GET /packhouse/sites/{siteId}/compac-sizer-batches/{id}/comments]
     * 
     * Retrieves Comments for a Compac Sizer Batch
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @return {Promise<Array<CompacSizerBatchController.CommentItem>>}
     */
    static getComments(siteId, id)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.getRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}/comments`)
            .then((result) => {
                let resolveValue = (function(){
                    if(Array.isArray(result) !== true)
                    {
                        return [];
                    }
                
                    return result.map((resultItem) => {
                        return (function(){
                            let resultItemObject = {};
                            
                            if(typeof resultItem === 'object' && 'id' in resultItem)
                            {
                                resultItemObject.id = (function(){
                                    if(typeof resultItem.id !== 'string')
                                    {
                                        return String(resultItem.id);
                                    }
                
                                    return resultItem.id;
                                }());
                            }
                            else
                            {
                                resultItemObject.id = "";
                            }
                            
                            if(typeof resultItem === 'object' && 'userAccount' in resultItem)
                            {
                                resultItemObject.userAccount = (function(){
                                    let userAccountObject = {};
                                    
                                    if(typeof resultItem.userAccount === 'object' && 'id' in resultItem.userAccount)
                                    {
                                        userAccountObject.id = (function(){
                                            if(resultItem.userAccount.id === null)
                                            {
                                                return null;
                                            }
                
                                            if(typeof resultItem.userAccount.id !== 'string')
                                            {
                                                return String(resultItem.userAccount.id);
                                            }
                
                                            return resultItem.userAccount.id;
                                        }());
                                    }
                                    else
                                    {
                                        userAccountObject.id = null;
                                    }
                                    
                                    if(typeof resultItem.userAccount === 'object' && 'firstName' in resultItem.userAccount)
                                    {
                                        userAccountObject.firstName = (function(){
                                            if(resultItem.userAccount.firstName === null)
                                            {
                                                return null;
                                            }
                
                                            if(typeof resultItem.userAccount.firstName !== 'string')
                                            {
                                                return String(resultItem.userAccount.firstName);
                                            }
                
                                            return resultItem.userAccount.firstName;
                                        }());
                                    }
                                    else
                                    {
                                        userAccountObject.firstName = null;
                                    }
                                    
                                    if(typeof resultItem.userAccount === 'object' && 'lastName' in resultItem.userAccount)
                                    {
                                        userAccountObject.lastName = (function(){
                                            if(resultItem.userAccount.lastName === null)
                                            {
                                                return null;
                                            }
                
                                            if(typeof resultItem.userAccount.lastName !== 'string')
                                            {
                                                return String(resultItem.userAccount.lastName);
                                            }
                
                                            return resultItem.userAccount.lastName;
                                        }());
                                    }
                                    else
                                    {
                                        userAccountObject.lastName = null;
                                    }
                
                                    return userAccountObject;
                                }());
                            }
                            else
                            {
                                resultItemObject.userAccount = (function(){
                                    let userAccountDefaultValue = {};
                                    
                                    userAccountDefaultValue.id = null;
                                    
                                    userAccountDefaultValue.firstName = null;
                                    
                                    userAccountDefaultValue.lastName = null;
                                    
                                    return userAccountDefaultValue;
                                }());
                            }
                            
                            if(typeof resultItem === 'object' && 'content' in resultItem)
                            {
                                resultItemObject.content = (function(){
                                    if(resultItem.content === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof resultItem.content !== 'string')
                                    {
                                        return String(resultItem.content);
                                    }
                
                                    return resultItem.content;
                                }());
                            }
                            else
                            {
                                resultItemObject.content = null;
                            }
                            
                            if(typeof resultItem === 'object' && 'createdTimestamp' in resultItem)
                            {
                                resultItemObject.createdTimestamp = (function(){
                                    if(resultItem.createdTimestamp === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof resultItem.createdTimestamp !== 'string')
                                    {
                                        return new Date(String(resultItem.createdTimestamp));
                                    }
                
                                    return new Date(resultItem.createdTimestamp);
                                }());
                            }
                            else
                            {
                                resultItemObject.createdTimestamp = null;
                            }
                            
                            if(typeof resultItem === 'object' && 'updatedTimestamp' in resultItem)
                            {
                                resultItemObject.updatedTimestamp = (function(){
                                    if(resultItem.updatedTimestamp === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof resultItem.updatedTimestamp !== 'string')
                                    {
                                        return new Date(String(resultItem.updatedTimestamp));
                                    }
                
                                    return new Date(resultItem.updatedTimestamp);
                                }());
                            }
                            else
                            {
                                resultItemObject.updatedTimestamp = null;
                            }
                
                            return resultItemObject;
                        }());
                    });
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Create a Comment [POST /packhouse/sites/{siteId}/compac-sizer-batches/{id}/comments]
     * 
     * Create a Comment for a Compac Sizer Batch
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @param {string} content The Content of the New Comment
     * @return {Promise<CompacSizerBatchController.CommentItem>}
     */
    static createComment(siteId, id, content)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.postRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}/comments`, {content})
            .then((result) => {
                let resolveValue = (function(){
                    let resultObject = {};
                    
                    if(typeof result === 'object' && 'id' in result)
                    {
                        resultObject.id = (function(){
                            if(typeof result.id !== 'string')
                            {
                                return String(result.id);
                            }
                
                            return result.id;
                        }());
                    }
                    else
                    {
                        resultObject.id = "";
                    }
                    
                    if(typeof result === 'object' && 'userAccount' in result)
                    {
                        resultObject.userAccount = (function(){
                            let userAccountObject = {};
                            
                            if(typeof result.userAccount === 'object' && 'id' in result.userAccount)
                            {
                                userAccountObject.id = (function(){
                                    if(result.userAccount.id === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.id !== 'string')
                                    {
                                        return String(result.userAccount.id);
                                    }
                
                                    return result.userAccount.id;
                                }());
                            }
                            else
                            {
                                userAccountObject.id = null;
                            }
                            
                            if(typeof result.userAccount === 'object' && 'firstName' in result.userAccount)
                            {
                                userAccountObject.firstName = (function(){
                                    if(result.userAccount.firstName === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.firstName !== 'string')
                                    {
                                        return String(result.userAccount.firstName);
                                    }
                
                                    return result.userAccount.firstName;
                                }());
                            }
                            else
                            {
                                userAccountObject.firstName = null;
                            }
                            
                            if(typeof result.userAccount === 'object' && 'lastName' in result.userAccount)
                            {
                                userAccountObject.lastName = (function(){
                                    if(result.userAccount.lastName === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.lastName !== 'string')
                                    {
                                        return String(result.userAccount.lastName);
                                    }
                
                                    return result.userAccount.lastName;
                                }());
                            }
                            else
                            {
                                userAccountObject.lastName = null;
                            }
                
                            return userAccountObject;
                        }());
                    }
                    else
                    {
                        resultObject.userAccount = (function(){
                            let userAccountDefaultValue = {};
                            
                            userAccountDefaultValue.id = null;
                            
                            userAccountDefaultValue.firstName = null;
                            
                            userAccountDefaultValue.lastName = null;
                            
                            return userAccountDefaultValue;
                        }());
                    }
                    
                    if(typeof result === 'object' && 'content' in result)
                    {
                        resultObject.content = (function(){
                            if(result.content === null)
                            {
                                return null;
                            }
                
                            if(typeof result.content !== 'string')
                            {
                                return String(result.content);
                            }
                
                            return result.content;
                        }());
                    }
                    else
                    {
                        resultObject.content = null;
                    }
                    
                    if(typeof result === 'object' && 'createdTimestamp' in result)
                    {
                        resultObject.createdTimestamp = (function(){
                            if(result.createdTimestamp === null)
                            {
                                return null;
                            }
                
                            if(typeof result.createdTimestamp !== 'string')
                            {
                                return new Date(String(result.createdTimestamp));
                            }
                
                            return new Date(result.createdTimestamp);
                        }());
                    }
                    else
                    {
                        resultObject.createdTimestamp = null;
                    }
                    
                    if(typeof result === 'object' && 'updatedTimestamp' in result)
                    {
                        resultObject.updatedTimestamp = (function(){
                            if(result.updatedTimestamp === null)
                            {
                                return null;
                            }
                
                            if(typeof result.updatedTimestamp !== 'string')
                            {
                                return new Date(String(result.updatedTimestamp));
                            }
                
                            return new Date(result.updatedTimestamp);
                        }());
                    }
                    else
                    {
                        resultObject.updatedTimestamp = null;
                    }
                
                    return resultObject;
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Retrieve a Comment [GET /packhouse/sites/{siteId}/compac-sizer-batches/{id}/comments/{commentId}]
     * 
     * Retrieves Comments for a Compac Sizer Batch
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @param {string} commentId The Comment ID
     * @return {Promise<CompacSizerBatchController.CommentItem>}
     */
    static getOneComment(siteId, id, commentId)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.getRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}/comments/${commentId}`)
            .then((result) => {
                let resolveValue = (function(){
                    let resultObject = {};
                    
                    if(typeof result === 'object' && 'id' in result)
                    {
                        resultObject.id = (function(){
                            if(typeof result.id !== 'string')
                            {
                                return String(result.id);
                            }
                
                            return result.id;
                        }());
                    }
                    else
                    {
                        resultObject.id = "";
                    }
                    
                    if(typeof result === 'object' && 'userAccount' in result)
                    {
                        resultObject.userAccount = (function(){
                            let userAccountObject = {};
                            
                            if(typeof result.userAccount === 'object' && 'id' in result.userAccount)
                            {
                                userAccountObject.id = (function(){
                                    if(result.userAccount.id === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.id !== 'string')
                                    {
                                        return String(result.userAccount.id);
                                    }
                
                                    return result.userAccount.id;
                                }());
                            }
                            else
                            {
                                userAccountObject.id = null;
                            }
                            
                            if(typeof result.userAccount === 'object' && 'firstName' in result.userAccount)
                            {
                                userAccountObject.firstName = (function(){
                                    if(result.userAccount.firstName === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.firstName !== 'string')
                                    {
                                        return String(result.userAccount.firstName);
                                    }
                
                                    return result.userAccount.firstName;
                                }());
                            }
                            else
                            {
                                userAccountObject.firstName = null;
                            }
                            
                            if(typeof result.userAccount === 'object' && 'lastName' in result.userAccount)
                            {
                                userAccountObject.lastName = (function(){
                                    if(result.userAccount.lastName === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.lastName !== 'string')
                                    {
                                        return String(result.userAccount.lastName);
                                    }
                
                                    return result.userAccount.lastName;
                                }());
                            }
                            else
                            {
                                userAccountObject.lastName = null;
                            }
                
                            return userAccountObject;
                        }());
                    }
                    else
                    {
                        resultObject.userAccount = (function(){
                            let userAccountDefaultValue = {};
                            
                            userAccountDefaultValue.id = null;
                            
                            userAccountDefaultValue.firstName = null;
                            
                            userAccountDefaultValue.lastName = null;
                            
                            return userAccountDefaultValue;
                        }());
                    }
                    
                    if(typeof result === 'object' && 'content' in result)
                    {
                        resultObject.content = (function(){
                            if(result.content === null)
                            {
                                return null;
                            }
                
                            if(typeof result.content !== 'string')
                            {
                                return String(result.content);
                            }
                
                            return result.content;
                        }());
                    }
                    else
                    {
                        resultObject.content = null;
                    }
                    
                    if(typeof result === 'object' && 'createdTimestamp' in result)
                    {
                        resultObject.createdTimestamp = (function(){
                            if(result.createdTimestamp === null)
                            {
                                return null;
                            }
                
                            if(typeof result.createdTimestamp !== 'string')
                            {
                                return new Date(String(result.createdTimestamp));
                            }
                
                            return new Date(result.createdTimestamp);
                        }());
                    }
                    else
                    {
                        resultObject.createdTimestamp = null;
                    }
                    
                    if(typeof result === 'object' && 'updatedTimestamp' in result)
                    {
                        resultObject.updatedTimestamp = (function(){
                            if(result.updatedTimestamp === null)
                            {
                                return null;
                            }
                
                            if(typeof result.updatedTimestamp !== 'string')
                            {
                                return new Date(String(result.updatedTimestamp));
                            }
                
                            return new Date(result.updatedTimestamp);
                        }());
                    }
                    else
                    {
                        resultObject.updatedTimestamp = null;
                    }
                
                    return resultObject;
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Update a Comment [PATCH /packhouse/sites/{siteId}/compac-sizer-batches/{id}/comments/{commentId}]
     * 
     * Update a Comment for a Compac Sizer Batch
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @param {string} commentId The Comment ID
     * @param {string} content The Updated Content for the Comment
     * @return {Promise<CompacSizerBatchController.CommentItem>}
     */
    static updateOneComment(siteId, id, commentId, content)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.patchRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}/comments/${commentId}`, {content})
            .then((result) => {
                let resolveValue = (function(){
                    let resultObject = {};
                    
                    if(typeof result === 'object' && 'id' in result)
                    {
                        resultObject.id = (function(){
                            if(typeof result.id !== 'string')
                            {
                                return String(result.id);
                            }
                
                            return result.id;
                        }());
                    }
                    else
                    {
                        resultObject.id = "";
                    }
                    
                    if(typeof result === 'object' && 'userAccount' in result)
                    {
                        resultObject.userAccount = (function(){
                            let userAccountObject = {};
                            
                            if(typeof result.userAccount === 'object' && 'id' in result.userAccount)
                            {
                                userAccountObject.id = (function(){
                                    if(result.userAccount.id === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.id !== 'string')
                                    {
                                        return String(result.userAccount.id);
                                    }
                
                                    return result.userAccount.id;
                                }());
                            }
                            else
                            {
                                userAccountObject.id = null;
                            }
                            
                            if(typeof result.userAccount === 'object' && 'firstName' in result.userAccount)
                            {
                                userAccountObject.firstName = (function(){
                                    if(result.userAccount.firstName === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.firstName !== 'string')
                                    {
                                        return String(result.userAccount.firstName);
                                    }
                
                                    return result.userAccount.firstName;
                                }());
                            }
                            else
                            {
                                userAccountObject.firstName = null;
                            }
                            
                            if(typeof result.userAccount === 'object' && 'lastName' in result.userAccount)
                            {
                                userAccountObject.lastName = (function(){
                                    if(result.userAccount.lastName === null)
                                    {
                                        return null;
                                    }
                
                                    if(typeof result.userAccount.lastName !== 'string')
                                    {
                                        return String(result.userAccount.lastName);
                                    }
                
                                    return result.userAccount.lastName;
                                }());
                            }
                            else
                            {
                                userAccountObject.lastName = null;
                            }
                
                            return userAccountObject;
                        }());
                    }
                    else
                    {
                        resultObject.userAccount = (function(){
                            let userAccountDefaultValue = {};
                            
                            userAccountDefaultValue.id = null;
                            
                            userAccountDefaultValue.firstName = null;
                            
                            userAccountDefaultValue.lastName = null;
                            
                            return userAccountDefaultValue;
                        }());
                    }
                    
                    if(typeof result === 'object' && 'content' in result)
                    {
                        resultObject.content = (function(){
                            if(result.content === null)
                            {
                                return null;
                            }
                
                            if(typeof result.content !== 'string')
                            {
                                return String(result.content);
                            }
                
                            return result.content;
                        }());
                    }
                    else
                    {
                        resultObject.content = null;
                    }
                    
                    if(typeof result === 'object' && 'createdTimestamp' in result)
                    {
                        resultObject.createdTimestamp = (function(){
                            if(result.createdTimestamp === null)
                            {
                                return null;
                            }
                
                            if(typeof result.createdTimestamp !== 'string')
                            {
                                return new Date(String(result.createdTimestamp));
                            }
                
                            return new Date(result.createdTimestamp);
                        }());
                    }
                    else
                    {
                        resultObject.createdTimestamp = null;
                    }
                    
                    if(typeof result === 'object' && 'updatedTimestamp' in result)
                    {
                        resultObject.updatedTimestamp = (function(){
                            if(result.updatedTimestamp === null)
                            {
                                return null;
                            }
                
                            if(typeof result.updatedTimestamp !== 'string')
                            {
                                return new Date(String(result.updatedTimestamp));
                            }
                
                            return new Date(result.updatedTimestamp);
                        }());
                    }
                    else
                    {
                        resultObject.updatedTimestamp = null;
                    }
                
                    return resultObject;
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Delete a Comment [DELETE /packhouse/sites/{siteId}/compac-sizer-batches/{id}/comments/{commentId}]
     * 
     * Delete a Comment for a Compac Sizer Batch
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Batch ID
     * @param {string} commentId The Comment ID
     * @return {Promise<boolean>}
     */
    static deleteOneComment(siteId, id, commentId)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.deleteRequest(`/packhouse/sites/${siteId}/compac-sizer-batches/${id}/comments/${commentId}`)
            .then((result) => {
                resolve(result ?? true);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * List all Compac Sizer Batches [GET /packhouse/sites/{siteId}/compac-sizer-batches]
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {CompacSizerBatchController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
     * @return {Promise<CompacSizerBatchModel[]>}
     */
    static getAll(siteId, queryParameters = {})
    {
        return new Promise((resolve, reject) => {
            RequestHelper.getRequest(`/packhouse/sites/${siteId}/compac-sizer-batches`, queryParameters)
            .then((result) => {
                let resolveValue = (function(){
                    if(Array.isArray(result) !== true)
                    {
                        return [];
                    }
                
                    return result.map((resultItem) => {
                        return (function(){
                            return CompacSizerBatchModel.fromJSON(resultItem, siteId);
                        }());
                    });
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }

    /**
     * Create a Compac Sizer Batch [POST /packhouse/sites/{siteId}/compac-sizer-batches]
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {CompacSizerBatchController.CreateData} createData The Compac Sizer Batch Create Data
     * @return {Promise<CompacSizerBatchModel>}
     */
    static create(siteId, createData)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.postRequest(`/packhouse/sites/${siteId}/compac-sizer-batches`, createData)
            .then((result) => {
                let resolveValue = (function(){
                    return CompacSizerBatchModel.fromJSON(result, siteId);
                }());
                
                resolve(resolveValue);
            })
            .catch(error => reject(error));
        });
    }
}

export default CompacSizerBatchController;

/**
 * The Optional Query Parameters for the getAll Function
 * 
 * @typedef {Object} CompacSizerBatchController.GetAllQueryParameters
 * @property {string} [compacSizerId] The Compac Sizer ID this Batch is associated with
 * @property {string} [batchId] The Numeric Compac Batch ID
 * @property {?string} [packrunId] The Packrun ID associated with this Batch
 * @property {Date} [createdTimestampBegin] Filter by the Timestamp when this Compac Sizer Batch was Created. Results Greater than or Equal to Timestamp
 * @property {Date} [createdTimestampEnd] Filter by the Timestamp when this Compac Sizer Batch was Created. Results Less than or Equal to Timestamp
 * @property {string} [batchName] Filter by the Compac Batch Name
 * @memberof Controllers.Packhouse.Site
 */

/**
 * The Create Data for a Compac Sizer Batch
 * 
 * @typedef {Object} CompacSizerBatchController.CreateData
 * @property {string} compacSizerId The Compac Sizer ID this Batch is associated with
 * @property {string} [batchId] The Numeric Compac Batch ID
 * @property {Date} [createdTimestamp] When this Batch was Created
 * @property {?string} [packrunId] The Packrun ID associated with this Batch
 * @property {CompacSizerBatchController.CompacSizerBatch} batch The Compac Sizer Batch Data
 * @memberof Controllers.Packhouse.Site
 */

/**
 * The Update Data for a Compac Sizer Batch
 * 
 * @typedef {Object} CompacSizerBatchController.UpdateData
 * @property {string} [compacSizerId] The Compac Sizer ID this Batch is associated with
 * @property {Date} [createdTimestamp] When this Batch was Created
 * @property {?string} [packrunId] The Packrun ID associated with this Batch
 * @property {CompacSizerBatchController.CompacSizerBatch} [batch] The Compac Sizer Batch Data
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **UserAccount** Type
 * 
 * @typedef {Object} CompacSizerBatchController.UserAccount
 * @property {?string} id The User Account ID
 * @property {?string} firstName The User's First Name
 * @property {?string} lastName The User's Last Name
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **CommentItem** Type
 * 
 * @typedef {Object} CompacSizerBatchController.CommentItem
 * @property {string} id The Comment ID
 * @property {CompacSizerBatchController.UserAccount} userAccount 
 * @property {?string} content The Content of the Comment
 * @property {?Date} createdTimestamp When the Comment was Created
 * @property {?Date} updatedTimestamp When the Comment was last Updated
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchEvent** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchEvent
 * @property {number} id ID of this Event
 * @property {number} batchId The Batch ID this Event is associated with
 * @property {string} type The Event Type
 * @property {string} details Details of this Event
 * @property {Date} timestamp When this Event Occurred
 * @property {number} runningSeconds Total Seconds the Sizer was Running during this Event
 * @property {number} fruitRunningSeconds Total Seconds the Sizer was Running with Fruit during this Event
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchSizingMapFruitSize** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchSizingMapFruitSize
 * @property {number} id ID of this Fruit Size
 * @property {number} eventId The Event ID this Fruit Size is associated with
 * @property {number} index Index of this Fruit Size
 * @property {?string} name Name of this Fruit Size
 * @property {number} minimumFruitWeight The Minimum Weight in Grams for this Fruit Size
 * @property {number} fruitCount The Fruit Count for this Fruit Size
 * @property {number} minimumTrayWeight The Minimum Tray Weight in Grams for this Fruit Size
 * @property {number} varietySizingMapId ID of the Variety Sizing Map
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchSizingMap** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchSizingMap
 * @property {number} id ID of this Sizing Map
 * @property {number} eventId The Event ID this Sizing Map is associated with
 * @property {number} varietySizingMapId ID of the Variety Sizing Map
 * @property {?string} name Name of this Sizing Map
 * @property {Array<CompacSizerBatchController.BatchSizingMapFruitSize>} fruitSizes An Array of Fruit Sizes defined in this Sizing Map
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchGrade** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchGrade
 * @property {number} id ID of this Grade
 * @property {number} eventId The Event ID this Grade is associated with
 * @property {number} index Index of this Grade
 * @property {?string} name Name of this Grade
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchQuality** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchQuality
 * @property {number} id ID of this Quality
 * @property {number} eventId The Event ID this Quality is associated with
 * @property {number} index Index of this Quality
 * @property {?string} name Name of this Quality
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchProduct** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchProduct
 * @property {number} id ID of this Product
 * @property {number} eventId The Event ID this Product is associated with
 * @property {string} guid UUID of this Product
 * @property {?string} name Name of this Product
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchPack** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchPack
 * @property {number} id ID of this Pack
 * @property {number} eventId The Event ID this Pack is associated with
 * @property {string} guid UUID of this Pack
 * @property {?string} name Name of this Pack
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchSummaryGroup** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchSummaryGroup
 * @property {number} id ID of this Summary Group
 * @property {?string} name Name of this Summary Group
 * @property {boolean} isReject Whether this Summary Group is classes as Reject
 * @property {number} orderIndex The Display Order Index for this Summary Group
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchDropSummary** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchDropSummary
 * @property {number} id ID of this Drop Summary
 * @property {number} eventId The Event ID this Drop Summary is associated with
 * @property {number} summaryGroupId ID of the Summary Group for this Drop Summary
 * @property {number} productId ID of the Product for this Drop Summary
 * @property {number} dropId ID of the Drop for this Drop Summary
 * @property {number} gradeIndex Index of the Grade for this Drop Summary
 * @property {number} sizeIndex Index of the Fruit Size for this Drop Summary
 * @property {number} qualityIndex Index of the Quality for this Drop Summary
 * @property {number} fruitWeight Fruit Weight in Grams for this Drop Summary
 * @property {number} fruitCount Fruit Count for this Drop Summary
 * @property {number} varietySizingMapId Variety Sizing Map ID for this Drop Summary
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchRecycleSummary** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchRecycleSummary
 * @property {number} id ID of this Recycle Summary
 * @property {number} eventId The Event ID this Recycle Summary is associated with
 * @property {number} productId ID of the Product for this Recycle Summary
 * @property {number} dropId ID of the Drop for this Recycle Summary
 * @property {number} gradeIndex Index of the Grade for this Recycle Summary
 * @property {number} sizeIndex Index of the Fruit Size for this Recycle Summary
 * @property {number} qualityIndex Index of the Quality for this Recycle Summary
 * @property {number} fruitWeight Fruit Weight in Grams for this Recycle Summary
 * @property {number} fruitCount Fruit Count for this Recycle Summary
 * @property {number} varietySizingMapId Variety Sizing Map ID for this Recycle Summary
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchPackSummary** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchPackSummary
 * @property {number} id ID of this Pack Summary
 * @property {number} eventId The Event ID this Pack Summary is associated with
 * @property {number} summaryGroupId ID of the Summary Group for this Pack Summary
 * @property {number} productId ID of the Product for this Pack Summary
 * @property {number} packId ID of the Pack for this Pack Summary
 * @property {number} packCount Pack Count for this Pack Summary
 * @property {number} fruitWeight Fruit Weight in Grams for this Drop Summary
 * @property {number} fruitCount Fruit Count for this Drop Summary
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **BatchDrop** Type
 * 
 * @typedef {Object} CompacSizerBatchController.BatchDrop
 * @property {number} id ID of this Drop (Outlet)
 * @property {?string} name Name of this Drop (Outlet)
 * @property {boolean} totallingEnabled Whether Fruit sent to this Drop (Outlet) should be recorded in the Drop Summary
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **CompacSizerBatch** Type
 * 
 * @typedef {Object} CompacSizerBatchController.CompacSizerBatch
 * @property {number} id ID of this Batch
 * @property {?string} name Name of this Batch
 * @property {?string} growerCode Code of the Grower for this Batch
 * @property {?string} growerName Name of the Grower for this Batch
 * @property {?Date} startTimestamp When this Batch was Started
 * @property {?Date} endTimestamp When this Batch was Finished
 * @property {string[]} comments An Array of Comments for this Batch
 * @property {string} varietyId ID of the Variety for this Batch
 * @property {string} varietyName Name of the Variety for this Batch
 * @property {boolean} finished Whether this Batch has been Finished
 * @property {Array<CompacSizerBatchController.BatchEvent>} events An Array of Events for this Batch
 * @property {Array<CompacSizerBatchController.BatchSizingMap>} sizingMaps An Array of Sizing Maps for this Batch
 * @property {Array<CompacSizerBatchController.BatchGrade>} grades An Array of Grades for this Batch
 * @property {Array<CompacSizerBatchController.BatchQuality>} qualities An Array of Qualities for this Batch
 * @property {Array<CompacSizerBatchController.BatchProduct>} products An Array of Products for this Batch
 * @property {Array<CompacSizerBatchController.BatchPack>} packs An Array of Packs for this Batch
 * @property {Array<CompacSizerBatchController.BatchSummaryGroup>} summaryGroups An Array of Summary Groups for this Batch
 * @property {Array<CompacSizerBatchController.BatchDropSummary>} dropSummaries An Array of Drop Summaries for this Batch
 * @property {Array<CompacSizerBatchController.BatchRecycleSummary>} recycleSummaries An Array of Recycle Summaries for this Batch
 * @property {Array<CompacSizerBatchController.BatchPackSummary>} packSummaries An Array of Pack Summaries for this Batch
 * @property {Array<CompacSizerBatchController.BatchDrop>} drops An Array of Drops (Outlets) for this Batch
 * @memberof Controllers.Packhouse.Site
 */