Skip to content

Commit

Permalink
Merge remote-tracking branch 'main/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
NickolausDS committed Oct 25, 2012
2 parents 84cbeaf + 42f2623 commit 4837a70
Show file tree
Hide file tree
Showing 270 changed files with 31,849 additions and 36 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ SOU Stock Market Simulator

Currently under development by the 2012 CS469 Systems Analysis class.

Please see the Github "Wiki" documentation for further information.
Please see the Github "Wiki" documentation for further information.

Server Link: http://140.211.89.15/
139 changes: 139 additions & 0 deletions doc/DB/DBUseCase/DBUseCase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
###ID
UC User Account Information
##Actors
Users, Users Accounts
##Description
User has access to account information
##Preconditions
User chooses Transactions Info
User chooses Financial Account Info
User chooses Personal information
##Postconditions User is redirected to Transactions info page
User is redirected to Financial info page
User is redirected to Personal info page
User makes an incorrect choice
##Dialog
1. Users transaction data is avalable
1.1 New Transaction
1.1.1 Start new transaction
1.1.2 Buy Stock
1.1.3 Sell Stock
1.2 Transaction History
1.2.1 See Transaction History
1.3 Error message
2. Users Financial data is avalable
2.1 See Account history and balance
2.2 Make a deposit
2.3 Make a withdraw
2.4 Error message
3. User personal data is avalable
3.1 View Personal data
3.2 Make changes to personal data
3.3 Error message
4. User is givin an Error message


#Trade Engine:

##ID
0UCUsrPurchase

##Actors
EndUser, System

##Description
EndUser purchasing share(s) of a stock

##Preconditions
EndUser is authenticated to use software

##Postconditions
Money is deducted from cash, share(s) added to portfolio (successful)
No changes to database (unsuccessful)

##Dialog
1. EndUser requests to purchase share(s) of a stock
2. System requests current price of said stock, calculates total cost of purchase
3. If EndUser does not have the funds to make the trade, unsuccessful postconditions established (returns to step 1), if user can afford the purchase, successful postconditions established.


##ID
UCUsrSell

##Actors
EndUser, System

##Description
EndUser selling share(s) of a particular company

##Preconditions
EndUser is authenticated
EndUser owns at least 1 share

##Postconditions
Money is added to cash, share(s) deducted from portfolio (successful)
No changes to database, error message displayed (unsuccessful)

##Dialog
1. EndUser requests to sell share(s)
2. System requests current price of stock, calculates total
3. If the data does not get tampered with along the way?, succesful postconditions established, otherwise, unsuccessful postconditions established (return to step 1).

### UCSubmitFeedData (Keith K)

### Actors
* DataFeed
* Database

### Description
* Data feed sends one tick of data for one symbol to database

### Preconditions
* Database is up and running

### Post Conditions
* Successful Data from sms feed was stored in database
* Un-successful Data from sms feed was not stored in database

### Dialog
* Feed supplies symbol
* Feed supplies all field values for one tick for supplied symbol
* System responds (database) stored data successfuly or not


### ID
* User Login
## Actors
* User, System
## Description
* Verify user access priviledges
## Preconditions
* User enters correct username and password
* User enters incorrect username and password
## Postconditions
* Successful login
* Unsuccssful login
## Dialog
1. System prompts user for username and password
2. User successfully enters information and allowed access
2.1 User is unsuccessfully enters information and access is denied
2.1.1 System logs unsuccesful attempt
2.1.2 System prompts user again for username and password
3. System locks user account after three failed attempts

##ID
ViewStockSnapshot
###Actors
User, SOUSMS
###Description
User can see a "snapshot" of selected stock info (on mobile device).
###Preconditions
User is logged in to SOUSMS.
###Postconditions
Successful: User views desired stock info.
Unsuccessful: Error message.
###Dialog
1. User requests to view stock snapshot by symbol
1.1 Requested symbol refers to valid stock. Display stock info: symbol, company name, current price, high/low.
1.2 Requtested symbold does not refer to valid stock. Display error message.
2. User can request additional symbol snapshots until done.
Binary file added doc/DB/DBUseCase/Use Case Log in.xlsx
Binary file not shown.
17 changes: 17 additions & 0 deletions doc/DB/DBUseCase/Use Case Login.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
##ID
UC Login
###Actors
User, Stock
###Desription
Varification of Users Username and Password
###Preconditions
The user inputs the correct username and password
The user inputs the incorrect username and password
###Postcondition Successful Login
Unsuccessfull Login
###Dialog
1. User logged in correctly and moves to trade engine
2.User logs in incorrectly and is givin an Error message
2.1 Incorect log in is logged
2.1.1 User returns to log in screen for another attempt
3. User is incorrect to many times and is locked out for a specific amount of time
Binary file added doc/DB/DBUseCase/Use Case User Accounts.xlsx
Binary file not shown.
Binary file added doc/DB/DBUseCase/Use case diagram.vsd
Binary file not shown.
33 changes: 33 additions & 0 deletions doc/DB/DBUseCase/Use case user accounts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
###ID
UC User Account Information
##Actors
Users, Users Accounts
##Description
User has access to account information
##Preconditions
User chooses Transactions Info
User chooses Financial Account Info
User chooses Personal information
##Postconditions User is redirected to Transactions info page
User is redirected to Financial info page
User is redirected to Personal info page
User makes an incorrect choice
##Dialog
1. Users transaction data is avalable
1.1 New Transaction
1.1.1 Start new transaction
1.1.2 Buy Stock
1.1.3 Sell Stock
1.2 Transaction History
1.2.1 See Transaction History
1.3 Error message
2. Users Financial data is avalable
2.1 See Account history and balance
2.2 Make a deposit
2.3 Make a withdraw
2.4 Error message
3. User personal data is avalable
3.1 View Personal data
3.2 Make changes to personal data
3.3 Error message
4. User is givin an Error message
Binary file added doc/DB/ERD/VisioERD.pdf
Binary file not shown.
82 changes: 82 additions & 0 deletions doc/DB/MySQLCreateTable.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*MySQL*/


/*Against my own wishes, I put bank information into the user table*/

CREATE TABLE User (
UserID int primary key auto_increment,
Password varchar not null,
FName char not null,
LName char not null,
Email varchar not null,
Balance float(10,2) null
) Engine=InnoDB

/*Stores user transaction data*/

CREATE TABLE Transaction(
TransID int primary key auto_increment,
UserID int not null,
Symbol char not null,
Date varchar not null,
SellBuy binary not null,
Shares int not null,
Foreign Key (UserID) References User(UserId)
on update no action
)Engine=InnoDB

/*Stores users current stock holdings */

CREATE TABLE Portfolio(
UserID int primary key,
Symbol char primary key,
DateModified timestamp not null,
Shares int not null,
Foreign Key (UserID, Symbol) References Transaction(UserID, Symbol)
on update cascade
)

/*
Hoping to find a more efficient way to do this... however...
We are thinking of perhaps having a "feed dumping" table called Feed (this is constantly being populated by the feed)
as well as a table for users to query (holds most current values of our 40 symbols.. perhaps updating every 40 seconds?) for price checking, purchasing, etc.
Lets see if we can find a more efficient way.....?
*/

CREATE TABLE Feed(
Symbol char primary key,
TS timestamp primary key,
BestAskPrice float(5,2) not null,
BestAskQty float(5,2) not null
BestBidPrice float (5,2) not null,
BestBidQty float(5,2) not null,
Close float (5,2) not null,
High float(5,2) not null,
Date timestamp not null,
LastSale float (5,2) not null,
Low float(5,2) not null,
NetChg float not null,
Open float not null,
Pcl float not null
)
CREATE TABLE UserQuery(
Symbol char primary key,
TS timestamp not null,
UserID int not null,
BestAskPrice float(5,2) not null,
BestAskQty float(5,2) not null
BestBidPrice float (5,2) not null,
BestBidQty float(5,2) not null,
Close float (5,2) not null,
High float(5,2) not null,
Date timestamp not null,
LastSale float (5,2) not null,
Low float(5,2) not null,
NetChg float not null,
Open float not null,
Pcl float not null,
Foreign Key (UserID) References Portfolio(UserID)
on update no action,
Foreign Key (Symbol, TS, UserID, BestAskPrice, BestAskQty, BestBidPrice, BestBidQty, Close, High, Date, LastSale, Low, NetChg, Open, Pcl) References Feed(Symbol, TS, UserID, BestAskPrice, BestAskQty, BestBidPrice, BestBidQty, Close, High, Date, LastSale, Low, NetChg, Open, Pcl)
on update no action, on delete no action
)
25 changes: 25 additions & 0 deletions doc/DataFeed/UCDataFeed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Data Feed Use Case

###ID
UCDataFeed

###Actors
Data Feed, Database

###Description
Data feed sends ticker data to be stored in the db

###Preconditions:
* Data feed ordered and functional.
* Database created.

###Postconditions:
* Symbol data stored in database. (successful)
* Data not retained. (unsuccessful)

###Dialog
1. Data feed provides ticker data via XML
2. SMS attempts to parse data and store in db
3. If parse unsuccessful display error and back to 1


48 changes: 48 additions & 0 deletions doc/DataFeed/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Notes


for item one - i guess ill take over the fork... whatever that means.
7:11 PM

im looking over the nasdaq pdf now
7:12 PM

looks like all we need to do is order the web service - lol
7:15 PM

i just sent an email to the web service people to see if the email address works and to see if they would be the appropriate people to ask questions to.



Brets terms that I don't understand from the NASDAQ doc:

1. UTP Level 1
2. CTA
3. FINRA
4. So this document explains that the input value would be the ticker name such as AAPL, MSFT, GOOG, and the possible outputs are such things as bestAskPrice, close, and high? Is the process that we are supposed to implement already created and we just put it in place, or do we need to add some code to the database java script, such as what we found at:

http://stackoverflow.com/questions/807418/simplest-way-to-query-xml-in-java?lq=1

or

http://stackoverflow.com/questions/428073/what-is-the-best-simplest-way-to-read-in-an-xml-file-in-java-application


?

<<<<<<< HEAD
test change
=======
Shaun's terms - 10/08/2012

1. XML (Not very familiar with it)
2. What information we get back from NASDAQ
3. Where this information is stored
4. Who we need to coordinate with most. (Database? Trade Engine?...)
5. Timeline for goals
>>>>>>> Added Shaun's terms for further explanation
The Data Feed team recommends Java as a language for parsing the XML feed.
Edit: Most likely PHP

Need to get SQL server info to start writing code
Loading

0 comments on commit 4837a70

Please sign in to comment.