VbzCart/docs/tables/ord hold type: Difference between revisions
Jump to navigation
Jump to search
imported>Woozle (rename references in text and SQL) |
imported>Woozle (tidying, some minor changes) |
||
Line 3: | Line 3: | ||
* '''Relates to''': {{vbzcart|table|ord_change}} | * '''Relates to''': {{vbzcart|table|ord_change}} | ||
* '''Background''': See {{vbzcart|table|ord_change}} | * '''Background''': See {{vbzcart|table|ord_change}} | ||
==History== | |||
* '''2008-12-27''' Extracted from main "tables" listing, no design changes; no documentation yet, either | |||
* '''2009-07-12''' Removed isActive field; added "Hold" to field names for directional consistency (+1 always turns on an alert); preliminary documentation | |||
* '''2009-10-18''' | |||
** changing type for alert flags from TINYINT to TINYINT(1); the default seems to be TINYINT(4) | |||
*** BIT(2) would work, but there doesn't seem to be any clean way to represent -1 | |||
** renaming from '''ord_event_type''' to '''ord_change_type'''; will eventually replace '''ord_pull_type''' | |||
* ''' | * '''2017-06-01''' Renamed '''Descr''' to '''About'''; changed ENGINE from MYISAM to InnoDB. | ||
==Fields== | |||
* '''alert flags''': | |||
** '''doHoldRstk''' - if TRUE, do not base restock requests on this order's items | |||
** '''doHoldChrg''' - if TRUE, do not make any debits from the customer for this order (wait for confirmation) | |||
** '''doContact''' - if TRUE, contact the customer before proceeding (do we need a separate "no payment" flag?) | |||
** '''doExamine''' - if TRUE, something about this order needs further examination (explanation in event notes) | |||
** It may be that we need a "'''doImport'''" flag, to indicate orders which need importing; '''doExamine''' is probably for more complicated issues which may take time/expertise to resolve. On the other hand, it may make more sense to detect un-imported orders in other ways, e.g. the fact that some fields will be NULL -- but it may be useful to have an explicit flag for this, e.g. to be able to signal that an order needs to be ''re''-imported. | |||
** We may also want a "'''doHoldShip'''" flag, to indicate that shipping should be delayed | |||
** Eventually, maybe we need an ord_action table, listing all the possible actions which might be flagged | |||
===alert flags=== | ===alert flags=== | ||
The alert flag fields each have 3 possible values: | The alert flag fields each have 3 possible values: | ||
Line 29: | Line 30: | ||
If the order has any one of these flags set, then the order is "on hold". | If the order has any one of these flags set, then the order is "on hold". | ||
==SQL== | ==SQL== | ||
<mysql>CREATE TABLE `ord_change_type` ( | |||
`ID` INT NOT NULL AUTO_INCREMENT, | `ID` INT NOT NULL AUTO_INCREMENT, | ||
`Display` VARCHAR(63) COMMENT "brief name for this event type", | `Display` VARCHAR(63) COMMENT "brief name for this event type", | ||
` | `About` VARCHAR(127) COMMENT "longer description of usage", | ||
`doHoldRstk` TINYINT(1) COMMENT "forbid(+1)/allow(-1) restocking this order's items", | `doHoldRstk` TINYINT(1) COMMENT "forbid(+1)/allow(-1) restocking this order's items", | ||
`doHoldChrg` TINYINT(1) COMMENT "forbid(+1)/allow(-1) charging bank card for this order", | `doHoldChrg` TINYINT(1) COMMENT "forbid(+1)/allow(-1) charging bank card for this order", | ||
Line 39: | Line 40: | ||
PRIMARY KEY(`ID`) | PRIMARY KEY(`ID`) | ||
) | ) | ||
ENGINE = | ENGINE = InnoDB;</mysql> | ||
Revision as of 12:17, 1 June 2017
About
- Purpose: Admin-maintained table for different types of order changes and how the order itself is affected by each event of that type
- Relates to: Template:Vbzcart
- Background: See Template:Vbzcart
History
- 2008-12-27 Extracted from main "tables" listing, no design changes; no documentation yet, either
- 2009-07-12 Removed isActive field; added "Hold" to field names for directional consistency (+1 always turns on an alert); preliminary documentation
- 2009-10-18
- changing type for alert flags from TINYINT to TINYINT(1); the default seems to be TINYINT(4)
- BIT(2) would work, but there doesn't seem to be any clean way to represent -1
- renaming from ord_event_type to ord_change_type; will eventually replace ord_pull_type
- changing type for alert flags from TINYINT to TINYINT(1); the default seems to be TINYINT(4)
- 2017-06-01 Renamed Descr to About; changed ENGINE from MYISAM to InnoDB.
Fields
- alert flags:
- doHoldRstk - if TRUE, do not base restock requests on this order's items
- doHoldChrg - if TRUE, do not make any debits from the customer for this order (wait for confirmation)
- doContact - if TRUE, contact the customer before proceeding (do we need a separate "no payment" flag?)
- doExamine - if TRUE, something about this order needs further examination (explanation in event notes)
- It may be that we need a "doImport" flag, to indicate orders which need importing; doExamine is probably for more complicated issues which may take time/expertise to resolve. On the other hand, it may make more sense to detect un-imported orders in other ways, e.g. the fact that some fields will be NULL -- but it may be useful to have an explicit flag for this, e.g. to be able to signal that an order needs to be re-imported.
- We may also want a "doHoldShip" flag, to indicate that shipping should be delayed
- Eventually, maybe we need an ord_action table, listing all the possible actions which might be flagged
alert flags
The alert flag fields each have 3 possible values:
- 0 = no change
- +1 = FORBID / TURN ON ALERT
- -1 = ALLOW / TURN OFF ALERT
Each one affects the corresponding field in the order (not yet implemented as of 2009-07-12) as described above when an event of the type defined in this record occurs
If the order has any one of these flags set, then the order is "on hold".
SQL
<mysql>CREATE TABLE `ord_change_type` (
`ID` INT NOT NULL AUTO_INCREMENT, `Display` VARCHAR(63) COMMENT "brief name for this event type", `About` VARCHAR(127) COMMENT "longer description of usage", `doHoldRstk` TINYINT(1) COMMENT "forbid(+1)/allow(-1) restocking this order's items", `doHoldChrg` TINYINT(1) COMMENT "forbid(+1)/allow(-1) charging bank card for this order", `doContact` TINYINT(1) COMMENT "turn on(+1)/off(-1) need-to-contact flag for this order", `doExamine` TINYINT(1) COMMENT "turn on(+1)/off(-1) need-to-examine flag for this order", PRIMARY KEY(`ID`)
) ENGINE = InnoDB;</mysql>