556
edits
Line 32: | Line 32: | ||
* Boxes shouldn't be deleted from the database, nor should the owner_id column be set to NULL, as this could result in the loss of useful information such as who owned the box last. Instead, boxes can be marked as inactive or unowned. | * Boxes shouldn't be deleted from the database, nor should the owner_id column be set to NULL, as this could result in the loss of useful information such as who owned the box last. Instead, boxes can be marked as inactive or unowned. | ||
=== Database === | === Database Design === | ||
* Box | * Box | ||
** creator_id (Reference ID) - As anyone will be able to create a new box record this would be handy for identifying one people aren't being excellent i.e. someone spams the create button. | |||
** owner_id (Reference ID) - Who owns the box/contents. The idea is that this will only get updated on claiming the box so it will be possible to identify old owners if they left something in the box after disowning it. | |||
** owned (BOOLEAN) - If the assign owner still wishes to own the box. | |||
** active (BOOLEAN) - Overengineering at its finest, this serves no real purpose but is intended to take a particular box out of service. (Admin use only) | |||
** location (Reference ID) - Where the box is located. Could be NULL, as in there's no valid place for it on the shelves. | |||
* Storage Locations - A representation of all valid storage locations. shelf and bay combine to create a UNIQUE key. | * Storage Locations - A representation of all valid storage locations. shelf and bay combine to create a UNIQUE key. | ||
** shelf (Reference ID) - refers to a shelf unit | |||
** bay (Reference ID) - refers to a shelf bay | |||
* Storage Unit | * Storage Unit | ||
** key (CHAR(2)) - Unique string representing unit | |||
** x (INTEGER) - x-coord in pixels for positioning shelf unit marker on box location image. | |||
** y (INTEGER) - y-coord in pixels for positioning shelf unit marker on box location image. | |||
orientation (INTEGER) - Orientation of the shelf unit for box location image. (N = 0, E = 1, S = 2, W = 3) | orientation (INTEGER) - Orientation of the shelf unit for box location image. (N = 0, E = 1, S = 2, W = 3) | ||
* Storage Bay | * Storage Bay | ||
** key (CHAR(2)) - Unique string representing bay | |||
** x (INTEGER) - x-coord in pixels for positioning shelf bay marker on box location image. | |||
** y (INTEGER) - y-coord in pixels for positioning shelf bay marker on box location image. | |||
=== Image Generation === | === Image Generation === |