VbzCart/docs/tables/event vc ord hold: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | tables
Jump to navigation Jump to search
imported>Woozle
(extracted from VbzCart/tables)
 
imported>Woozle
(lotsa doc and some new fields; renaming to singular)
Line 1: Line 1:
==About==
==About==
''to be documented''
* '''Purpose''': for tracking all order-related events, especially those affecting the order's status
* '''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_event_type}}, didn't belong there)
*** Added '''VbzUser''' and '''Machine''' fields
*** Renamed to singular form
* '''Fields''':
** '''isActive''' represents the state of the order after this event, as determined by taking the order's previous flags and applying the event type's flags -- if no hold flags are active, then the order is active.
** '''VbzUser''' will probably just be the username from the wiki, if we will be using the wiki to manage user log-ins and provide access to the ordering system. Not sure how to let wiki authentication work for vbzcart code, unless we move the wiki to the same domain instead of its own subdomain (...or actually have the wiki present vbzcart pages, eventually?).
** '''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===
I apparently designed this and its "types" table ({{vbzcart|table|ord_event_type}}) sometime in 2008, but didn't document them; a note on the {{vbzcart|table|ord_event_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 {{vbzcart|table|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.
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE TABLE `ord_events` (
<section begin=sql /><mysql>CREATE TABLE `ord_event` (
   `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",
   `ID_Type`  INT NOT NULL COMMENT "ord_event_types.ID",
   `ID_Type`  INT NOT NULL COMMENT "ord_event_type.ID",
   `WhenDone`  DATETIME COMMENT "when the event happened",
  `isActive`  BOOL COMMENT "state of order after this event",
   `WhenDone`  DATETIME     COMMENT "when the event happened",
  `VbzUser`  VARCHAR(127) COMMENT "username of whoever initiated the event",
  `Machine`  VARCHAR(63)  COMMENT "some way of identifying the user's machine -- network name or IP address",
   `Notes`    VARCHAR(255) COMMENT "human-entered notes, if needed",
   `Notes`    VARCHAR(255) COMMENT "human-entered notes, if needed",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)

Revision as of 13:27, 12 July 2009

About

  • Purpose: for tracking all order-related events, especially those affecting the order's status
  • History:
    • 2008-12-27 Extracted from main "tables" page, but no documentation yet
    • 2009-07-12
      • Preliminary documentation
      • Added isActive field (was in Template:Vbzcart, didn't belong there)
      • Added VbzUser and Machine fields
      • Renamed to singular form
  • Fields:
    • isActive represents the state of the order after this event, as determined by taking the order's previous flags and applying the event type's flags -- if no hold flags are active, then the order is active.
    • VbzUser will probably just be the username from the wiki, if we will be using the wiki to manage user log-ins and provide access to the ordering system. Not sure how to let wiki authentication work for vbzcart code, unless we move the wiki to the same domain instead of its own subdomain (...or actually have the wiki present vbzcart pages, eventually?).
    • 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

I apparently designed this and its "types" table (Template:Vbzcart) sometime in 2008, but didn't document them; a note on the Template:Vbzcart 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 Template:Vbzcart 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.

SQL

<section begin=sql /><mysql>CREATE TABLE `ord_event` (

 `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",
 `isActive`  BOOL COMMENT "state of order after this event",
 `WhenDone`  DATETIME     COMMENT "when the event happened",
 `VbzUser`   VARCHAR(127) COMMENT "username of whoever initiated the event",
 `Machine`   VARCHAR(63)  COMMENT "some way of identifying the user's machine -- network name or IP address",
 `Notes`     VARCHAR(255) COMMENT "human-entered notes, if needed",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql> <section end=sql />