Design Document For BID18xx

From BOARD18 Project WIKI
Revision as of 07:57, 29 October 2020 by Rich (talk | contribs) (→‎Introduction: re organize)
Jump to navigation Jump to search

Introduction

BID18xx is a utility which can be used to moderate the hidden bids that are used to determine player order in games such as 18FL and 18West.

BID18xx is a multi page utility which makes use of emails to request input from and report results to the players.

BID18xx 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 BID18xx.

These sections are:

BID18xx Logic Flow

Most of the work of BID18xx is done in two pages, BID18xxStart and BID18xxSubmit.
This section contains links to WIKI pages describing in detail all 4 of the BID18xx pages.
Each such WIKI page list all of the functions contained in that BID18xx page.
The last link below points to a WIKI page describing a repository of common functions used by these pages.

BID18xx Server Side

The server side processing for BID18xx is done in stand alone PHP programs that are executed from these web pages via AJAX calls.
Below is a link to a WIKI page containing descriptions of all of these PHP programs.

BID18xx Server Side Programs

Database Structure

The BID18xx database is structured as follows:

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

The bid field is a text string containing a stringified JSON data object as shown below.

JSON Data Object

This object contains all of the information about a given bid except for the bid_id.
It is stored in the table as a stringified JSON object called bid and appears to JavaScript as a JSON data object.

This JSON data object adheres to the following JSON structure:

 
BID18.bid = array (
  'gameName' => 'nnnnn'
  'status' => 'Active',
  'updtCount' => 1,
  'numbPlayers' => 4,
  'players' => 
  array (
    0 => 
    array (
      'order' => 1,
      'name' => 'player1',
      'email' => 'player1@example.com',
      'status' => 'Pending'
      'bid' => 0,
      'urlKey' => '??????????',
    ),
    .
    more players
    .
  ),
)