RICADO Gen 4 API JS Client

RICADO Gen 4 API JS Client

source

Controllers/Packhouse/Site/CompacSizerBinWeightController.js

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

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

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

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

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

    /**
     * Retrieve Comments [GET /packhouse/sites/{siteId}/compac-sizer-bin-weights/{id}/comments]
     * 
     * Retrieves Comments for a Compac Sizer Bin Weight
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Bin Weight ID
     * @return {Promise<Array<CompacSizerBinWeightController.CommentItem>>}
     */
    static getComments(siteId, id)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.getRequest(`/packhouse/sites/${siteId}/compac-sizer-bin-weights/${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-bin-weights/{id}/comments]
     * 
     * Create a Comment for a Compac Sizer Bin Weight
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Bin Weight ID
     * @param {string} content The Content of the New Comment
     * @return {Promise<CompacSizerBinWeightController.CommentItem>}
     */
    static createComment(siteId, id, content)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.postRequest(`/packhouse/sites/${siteId}/compac-sizer-bin-weights/${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-bin-weights/{id}/comments/{commentId}]
     * 
     * Retrieves Comments for a Compac Sizer Bin Weight
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Bin Weight ID
     * @param {string} commentId The Comment ID
     * @return {Promise<CompacSizerBinWeightController.CommentItem>}
     */
    static getOneComment(siteId, id, commentId)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.getRequest(`/packhouse/sites/${siteId}/compac-sizer-bin-weights/${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-bin-weights/{id}/comments/{commentId}]
     * 
     * Update a Comment for a Compac Sizer Bin Weight
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Bin Weight ID
     * @param {string} commentId The Comment ID
     * @param {string} content The Updated Content for the Comment
     * @return {Promise<CompacSizerBinWeightController.CommentItem>}
     */
    static updateOneComment(siteId, id, commentId, content)
    {
        return new Promise((resolve, reject) => {
            RequestHelper.patchRequest(`/packhouse/sites/${siteId}/compac-sizer-bin-weights/${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-bin-weights/{id}/comments/{commentId}]
     * 
     * Delete a Comment for a Compac Sizer Bin Weight
     * 
     * @static
     * @public
     * @param {number} siteId The Site ID
     * @param {string} id The Compac Sizer Bin Weight 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-bin-weights/${id}/comments/${commentId}`)
            .then((result) => {
                resolve(result ?? true);
            })
            .catch(error => reject(error));
        });
    }

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

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

export default CompacSizerBinWeightController;

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

/**
 * The Create Data for a Compac Sizer Bin Weight
 * 
 * @typedef {Object} CompacSizerBinWeightController.CreateData
 * @property {string} compacSizerId The Compac Sizer ID this Bin Weight is associated with
 * @property {string} [packrunId] The Packrun ID associated with this Bin Weight
 * @property {Date} [createdTimestamp] When this Bin Weight was Created
 * @property {?string} [timeBatchId] The Time Batch ID associated with this Bin Weight
 * @property {Array<CompacSizerBinWeightController.OutletSource|CompacSizerBinWeightController.SizerBulkSource>} [sources] The Sources and Weights that make up this Bin Weight
 * @property {Array<CompacSizerBinWeightController.FreshPackMultiGrowerBinWeight>} freshPackMultiGrowerBinWeights The Multi-Grower Bin Weights that will be submitted to FreshPack
 * @property {Array<CompacSizerBinWeightController.FreshPackMultiGrowerBin>} [freshPackMultiGrowerBins] The Multi-Grower Bins that will be submitted to FreshPack
 * @memberof Controllers.Packhouse.Site
 */

/**
 * The Update Data for a Compac Sizer Bin Weight
 * 
 * @typedef {Object} CompacSizerBinWeightController.UpdateData
 * @property {string} [compacSizerId] The Compac Sizer ID this Bin Weight is associated with
 * @property {Date} [createdTimestamp] When this Bin Weight was Created
 * @property {?string} [timeBatchId] The Time Batch ID associated with this Bin Weight
 * @property {Array<CompacSizerBinWeightController.OutletSource|CompacSizerBinWeightController.SizerBulkSource>} [sources] The Sources and Weights that make up this Bin Weight
 * @property {Array<CompacSizerBinWeightController.FreshPackMultiGrowerBinWeight>} [freshPackMultiGrowerBinWeights] The Multi-Grower Bin Weights that will be submitted to FreshPack
 * @property {Array<CompacSizerBinWeightController.FreshPackMultiGrowerBin>} [freshPackMultiGrowerBins] The Multi-Grower Bins that will be submitted to FreshPack
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **UserAccount** Type
 * 
 * @typedef {Object} CompacSizerBinWeightController.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} CompacSizerBinWeightController.CommentItem
 * @property {string} id The Comment ID
 * @property {CompacSizerBinWeightController.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 **OutletSource** Type
 * 
 * @typedef {Object} CompacSizerBinWeightController.OutletSource
 * @property {string} type Type of this Bin Weight Source
 * @property {number} outletNumber Outlet Number of the Sizer Outlet
 * @property {?string} outletName Name of the Sizer Outlet
 * @property {Array<{classType: string, weight: number, fruitCount: ?number}>} weights An Array of Weights by Class Type for this Bin Weight Source
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **SizerBulkSource** Type
 * 
 * @typedef {Object} CompacSizerBinWeightController.SizerBulkSource
 * @property {string} type Type of this Bin Weight Source
 * @property {Array<{classType: string, weight: number, fruitCount: ?number}>} weights An Array of Weights by Class Type for this Bin Weight Source
 * @memberof Controllers.Packhouse.Site
 */

/**
 * Results from Interacting with the FreshPack API to Send Multi-Grower Bin Weights
 * 
 * @typedef {Object} CompacSizerBinWeightController.BinWeightApiStatus
 * @property {number} requestCount Number of Requests made to the FreshPack API
 * @property {?Date} requestTimestamp Timestamp of the last Request made to the FreshPack API
 * @property {?number} responseCode Response Code from the last FreshPack API Request
 * @property {?string} responseMessage Response Message from the last FreshPack API Request
 * @property {boolean} completed Whether Interaction with the FreshPack API has been Completed
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **FreshPackMultiGrowerBinWeight** Type
 * 
 * @typedef {Object} CompacSizerBinWeightController.FreshPackMultiGrowerBinWeight
 * @property {string} classType The Class Type of this Multi-Grower Bin Weight
 * @property {number} weight The Net Weight in Kilograms of this Multi-Grower Bin Weight
 * @property {?CompacSizerBinWeightController.BinWeightApiStatus} weightApi Results from Interacting with the FreshPack API to Send Multi-Grower Bin Weights
 * @memberof Controllers.Packhouse.Site
 */

/**
 * Results from Interacting with the FreshPack API to Create a Multi-Grower Bin
 * 
 * @typedef {Object} CompacSizerBinWeightController.BinNumberApiStatus
 * @property {number} requestCount Number of Requests made to the FreshPack API
 * @property {?Date} requestTimestamp Timestamp of the last Request made to the FreshPack API
 * @property {?number} responseCode Response Code from the last FreshPack API Request
 * @property {?string} responseMessage Response Message from the last FreshPack API Request
 * @property {boolean} completed Whether Interaction with the FreshPack API has been Completed
 * @memberof Controllers.Packhouse.Site
 */

/**
 * Results from Interacting with the FreshPack API to Print a Multi-Grower Bin Card
 * 
 * @typedef {Object} CompacSizerBinWeightController.BinCardApiStatus
 * @property {number} requestCount Number of Requests made to the FreshPack API
 * @property {?Date} requestTimestamp Timestamp of the last Request made to the FreshPack API
 * @property {?number} responseCode Response Code from the last FreshPack API Request
 * @property {?string} responseMessage Response Message from the last FreshPack API Request
 * @property {boolean} completed Whether Interaction with the FreshPack API has been Completed
 * @memberof Controllers.Packhouse.Site
 */

/**
 * A **FreshPackMultiGrowerBin** Type
 * 
 * @typedef {Object} CompacSizerBinWeightController.FreshPackMultiGrowerBin
 * @property {string} classType The Class Type of this Multi-Grower Bin
 * @property {?string} binNumber The FreshPack Assigned Number of this Multi-Grower Bin
 * @property {boolean} printBinCard Whether a Bin Card should be Printed when the Bin Weight is Finalized
 * @property {?CompacSizerBinWeightController.BinNumberApiStatus} binNumberApi Results from Interacting with the FreshPack API to Create a Multi-Grower Bin
 * @property {?CompacSizerBinWeightController.BinCardApiStatus} binCardApi Results from Interacting with the FreshPack API to Print a Multi-Grower Bin Card
 * @memberof Controllers.Packhouse.Site
 */