import {Mongo} from "meteor/mongo";

export const AssetAssignmentHistory = new Mongo.Collection('assetAssignmentHistory');

/*
Maintains a historical record of asset assignments.
assetKey: The MongoID of the asset.  AssetID's could be reused, so this prevents that eventuality from messing up historical records.
assetId: The asset's assigned ID (not a MongoID).
serial: The asset's serial number (part of the device, or defined by the manufacturer).  In some cases this may be a partial serial.  It is not a unique identifier, but should be mostly unique.  This might be undefined if a serial was never provided for the original asset.
assetTypeName: The name of the asset type, or "UNK" if one could not be found (shouldn't happen).  This is stored because these records could be kept longer than the assets in the system.
assigneeType: One of 'Student' or 'Staff'.
assigneeId: The MongoID of the student or staff the asset was assigned to.
startDate: The date/time of the assignment.
endDate: The date/time of the unassignment.
comment: A text block detailing the reason for the unassignment of the device.  Eg: 'Broke Screen' or 'End of year' or 'Not charging' or 'Needs replacement'.
startCondition: One of the condition options: [New, Like New, Good, Okay, Damaged] (see assets.unassign for details).
endCondition: One of the condition options: [New, Like New, Good, Okay, Damaged] (see assets.unassign for details).
startConditionDetails: An optional text block for details on the condition.
endConditionDetails: An optional text block for details on the condition.
 */