Difference between revisions of "Design Document For DRAFT1846"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(→‎Some Fields of Note: added more fields)
(→‎Some Fields of Note: completed 3 new fields)
Line 87: Line 87:


== Some Fields of Note ==
== Some Fields of Note ==
The stringified JSON database table item contains some fields that could use some explanation.
The "draft" database table field is a stringified JSON structure.<br>
A number of these fields are mentioned and explained here.
This structure contains some key/value pairs that could use some explanation as to their use.<br>
A number of these key/value pairs are mentioned here.


=== The status field ===
=== The status key/value pair ===
The D1846.draft.status field is used to track the progress of the draft.<br>It can have one of these vallues:
The status value is a text string used to track the progress of the draft.<br>
*Pending: Still waiting for at least one player to confirm.
It can have any one of these 5 values:
*Confirmed: All players have confirmed their emai addresses.
#Pending: Still waiting for at least one player to confirm.
*Active: The draft is active and more than one card is left.
#Confirmed: All players have confirmed their email addresses.
*Last: The last remaining private is being processed.
#Active: The draft is active and more than one card is left.
*Done: The draft is completed.
#Last: The last remaining private is being processed.
#Done: The draft is completed.


=== The updtCount field ===
=== The updtCount key/value pair ===
The updtCount value is an integer used to support a week version of optimistic database locking.<br>
=== The cpd key/value pair ===
The cpd value is an integer used to keep track of the discount being applied to a private.<br>
It is only used by the draft1846Last page.


=== The cpd field ===
=== The return key/value pair ===
 
The return value is a text string used to return the success or failure status of a call to a php module.<br>
=== The return field ===
The actual value of the string is dependent on the php module in question and is documented there.


== Database Structure ==
== Database Structure ==

Revision as of 05:35, 16 May 2020

DraftFlow.png

Introduction

DRAFT1846 has been designed to look and feel as much like BOARD18 as possible.

This means that a couple of the sections of the BOARD18 design document can be applied, for the most part, directly to DRAFT1846.

These sections are:

The diagram to the right shows the general control flow between the DRAFT1846 components.
Note that many details have been omitted from this diagram.

JASON Data Object

This Object contains all of the information about a given draft except for the Draft ID.

 
array (
  'status' => 'Active',
  'updtCount' => 0,
  'numbPlayers' => 4,
  'curPlayer' => 1,
  'deck' => 
  array (
    0 => 'Ohio and Indiana',
    1 => 'Michigan Central',
    2 => 'Meat Packing Co.',
    3 => 'Blank Card',
    4 => 'Mail Contract',
    5 => 'Big 4',
    6 => 'Tunnel Blasting Co.',
    7 => 'Blank Card',
    8 => 'Michigan Southern',
    9 => 'Blank Card',
    10 => 'Blank Card',
    11 => 'Chicago and W. Indiana',
  ),
  'hand' => 
  array (
  ),
  'players' => 
  array (
    0 => 
    array (
      'name' => 'Paul',
      'email' => 'paul.zieske@gmail.com',
      'confirmed' => 'Yes',
      'cash' => 400,
      'privates' => 
      array (
      ),
    ),
    1 => 
    array (
      'name' => 'Chris',
      'email' => 'garden.nomad@gmail.com',
      'confirmed' => 'Yes',
      'cash' => 400,
      'privates' => 
      array (
      ),
    ),
    2 => 
    array (
      'name' => 'Rich',
      'email' => 'rich02@board18.org',
      'confirmed' => 'Yes',
      'cash' => 400,
      'privates' => 
      array (
      ),
    ),
    3 => 
    array (
      'name' => 'Frank',
      'email' => 'franktaw@netscape.net',
      'confirmed' => 'Yes',
      'cash' => 400,
      'privates' => 
      array (
      ),
    ),
  ),
  'return' => 'success',
)

Some Fields of Note

The "draft" database table field is a stringified JSON structure.
This structure contains some key/value pairs that could use some explanation as to their use.
A number of these key/value pairs are mentioned here.

The status key/value pair

The status value is a text string used to track the progress of the draft.
It can have any one of these 5 values:

  1. Pending: Still waiting for at least one player to confirm.
  2. Confirmed: All players have confirmed their email addresses.
  3. Active: The draft is active and more than one card is left.
  4. Last: The last remaining private is being processed.
  5. Done: The draft is completed.

The updtCount key/value pair

The updtCount value is an integer used to support a week version of optimistic database locking.

The cpd key/value pair

The cpd value is an integer used to keep track of the discount being applied to a private.
It is only used by the draft1846Last page.

The return key/value pair

The return value is a text string used to return the success or failure status of a call to a php module.
The actual value of the string is dependent on the php module in question and is documented there.

Database Structure

The DRAFT1846 database is structured as follows:

 
mysql> show columns from draft_table;
+---------------+------------------+------+-----+-------------------+-----------------------------+
| Field         | Type             | Null | Key | Default           | Extra                       |
+---------------+------------------+------+-----+-------------------+-----------------------------+
| draft_id      | int(11) unsigned | NO   | PRI | NULL              | auto_increment              |
| draft         | text             | YES  |     | NULL              |                             |
| activity_date | timestamp        | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+---------------+------------------+------+-----+-------------------+-----------------------------+
3 rows in set (0.00 sec)

The draft field is a text string containing the stringafied JSON data object as shown above.


This page is a stub.
The BOARD18 Project will soon be expanding it.