Difference between revisions of "VbzCart/tables/event vc ord hold"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(clarification/update of VbzUser)
(tidying before rename/redesign/repurpose)
Line 1: Line 1:
 
==About==
 
==About==
* '''Purpose''': for tracking events which change the status of an order, usually (always?) invoked manually
+
'''Purpose''': for tracking events (usually or always manually-invoked) which change the status of an order
* '''History''':
 
** '''2008-12-27''' Extracted from main "tables" page, but no documentation yet
 
** '''2009-07-12'''
 
*** Preliminary documentation
 
*** Added '''isActive''' field (was in {{vbzcart|table|ord_change_type}}, didn't belong there)
 
*** Added '''VbzUser''' and '''Machine''' fields
 
*** Renamed to singular form
 
** '''2009-10-18'''
 
*** Replaced '''isActive''' field with '''do*''' fields
 
*** Added '''SysUser''', for consistency with other event log tables
 
*** Renamed from '''ord_event''' to '''ord_change'''; using '''{{vbzcart|table|ord_event}}''' for stateless/internal events
 
* '''Fields''':
 
** <s>'''isActive''' represents</s> The '''do*''' tristate-flag fields represent the state of the order after this event, as determined by taking the order's previous flags and applying the event type's flags. This provides a record of the order's actual state over time, negating the need to follow the event history from the beginning in order to find the order's state at any given time.
 
** '''VbzUser''' is the user's wiki username, and only applies to events initiated through the wiki user interface
 
** '''Machine''' hasn't been rigorously defined yet; it just needs to be some way we can tell what computer was being used (and it does not need to be authenticated; authentication records should be kept elsewhere). Ideally, it should be netname@[ip address], but various coding environments may not support both of those.
 
 
===backstory===
 
===backstory===
 
I apparently designed this and its "types" table ({{vbzcart|table|ord_change_type}}) sometime in 2008, but didn't document them; a note on the {{vbzcart|table|ord_change_type}} page dated 2008-12-27 says "Are we actually using this, or is it part of the future online ordering system redesign?"
 
I apparently designed this and its "types" table ({{vbzcart|table|ord_change_type}}) sometime in 2008, but didn't document them; a note on the {{vbzcart|table|ord_change_type}} page dated 2008-12-27 says "Are we actually using this, or is it part of the future online ordering system redesign?"
Line 25: Line 10:
  
 
The system implemented here of defining event types which may or may not block certain things seems compatible with this goal, and we mainly just needed to add fields for user-tracking.
 
The system implemented here of defining event types which may or may not block certain things seems compatible with this goal, and we mainly just needed to add fields for user-tracking.
 +
==History==
 +
* '''2008-12-27''' Extracted from main "tables" page, but no documentation yet
 +
* '''2009-07-12'''
 +
** Preliminary documentation
 +
** Added '''isActive''' field (was in {{vbzcart|table|ord_change_type}}, didn't belong there)
 +
** Added '''VbzUser''' and '''Machine''' fields
 +
** Renamed to singular form
 +
* '''2009-10-18'''
 +
** Replaced '''isActive''' field with '''do*''' fields
 +
** Added '''SysUser''', for consistency with other event log tables
 +
** Renamed from '''ord_event''' to '''ord_change'''; using '''{{vbzcart|table|ord_event}}''' for stateless/internal events
 +
==Fields==
 +
* <s>'''isActive''' represents</s> The '''do*''' tristate-flag fields represent the state of the order after this event, as determined by taking the order's previous flags and applying the event type's flags. This provides a record of the order's actual state over time, negating the need to follow the event history from the beginning in order to find the order's state at any given time.
 +
* '''VbzUser''' is the user's wiki username, and only applies to events initiated through the wiki user interface
 +
* '''Machine''' hasn't been rigorously defined yet; it just needs to be some way we can tell what computer was being used (and it does not need to be authenticated; authentication records should be kept elsewhere). Ideally, it should be netname@[ip address], but various coding environments may not support both of those.
 
==SQL==
 
==SQL==
<section begin=sql /><mysql>CREATE TABLE `ord_change` (
+
<mysql>CREATE TABLE `ord_change` (
 
   `ID`            INT        NOT NULL AUTO_INCREMENT,
 
   `ID`            INT        NOT NULL AUTO_INCREMENT,
 
   `ID_Ord`        INT        NOT NULL COMMENT "core_orders.ID",
 
   `ID_Ord`        INT        NOT NULL COMMENT "core_orders.ID",
Line 42: Line 42:
 
)
 
)
 
ENGINE = MYISAM;</mysql>
 
ENGINE = MYISAM;</mysql>
<section end=sql />
 

Revision as of 10:10, 1 June 2017

About

Purpose: for tracking events (usually or always manually-invoked) which change the status of an order

backstory

I apparently designed this and its "types" table (ord_change_type) sometime in 2008, but didn't document them; a note on the ord_change_type page dated 2008-12-27 says "Are we actually using this, or is it part of the future online ordering system redesign?"

As of 2009-07, though, it has become clear that a general order log seems necessary for the following reasons:

  • To replace the ord_pull table
  • To make it unnecessary to track user details inside other order-related records
  • To keep an automatic record of all changes made to an order and any significant processing events

The system implemented here of defining event types which may or may not block certain things seems compatible with this goal, and we mainly just needed to add fields for user-tracking.

History

  • 2008-12-27 Extracted from main "tables" page, but no documentation yet
  • 2009-07-12
    • Preliminary documentation
    • Added isActive field (was in ord_change_type, didn't belong there)
    • Added VbzUser and Machine fields
    • Renamed to singular form
  • 2009-10-18
    • Replaced isActive field with do* fields
    • Added SysUser, for consistency with other event log tables
    • Renamed from ord_event to ord_change; using ord_event for stateless/internal events

Fields

  • isActive represents The do* tristate-flag fields represent the state of the order after this event, as determined by taking the order's previous flags and applying the event type's flags. This provides a record of the order's actual state over time, negating the need to follow the event history from the beginning in order to find the order's state at any given time.
  • VbzUser is the user's wiki username, and only applies to events initiated through the wiki user interface
  • Machine hasn't been rigorously defined yet; it just needs to be some way we can tell what computer was being used (and it does not need to be authenticated; authentication records should be kept elsewhere). Ideally, it should be netname@[ip address], but various coding environments may not support both of those.

SQL

<mysql>CREATE TABLE `ord_change` (

 `ID`             INT        NOT NULL AUTO_INCREMENT,
 `ID_Ord`         INT        NOT NULL COMMENT "core_orders.ID",
 `ID_Type`        INT        NOT NULL COMMENT "ord_event_type.ID",
 `doHoldRstk` TINYINT(1) DEFAULT NULL COMMENT "TRUE = do not base restock request items on this order",
 `doHoldChrg` TINYINT(1) DEFAULT NULL COMMENT "TRUE = do not charge bank card for this order",
 `doContact`  TINYINT(1) DEFAULT NULL COMMENT "TRUE = customer needs to be contacted about this order",
 `doExamine`  TINYINT(1) DEFAULT NULL COMMENT "TRUE = this order needs further examination",
 `WhenDone`  DATETIME                 COMMENT "when the event happened",
 `VbzUser`   VARCHAR(127)             COMMENT "VbzCart username of whoever initiated the event, if available",
 `SysUser`   VARCHAR(127)             COMMENT "who logged into the operating system, if available",
 `Machine`   VARCHAR(63)              COMMENT "network name or IP address of client",
 `Notes`     VARCHAR(255)             COMMENT "human-entered notes, if needed",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>