Git Product home page Git Product logo

stock-trading-system-http-server's People

Contributors

kurtd5105 avatar qqqstuv avatar sterlinglaird avatar stvhwrd avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

stock-trading-system-http-server's Issues

Get DUMPLOGs from Logging Server to Client

Produce Log Files

In addition to the client activities, DayTrading requires full auditing capabilities; hence, complete transaction logs must be able to be produced on demand that detail of all client activities in the
system (including timestamps of all transactions), a record of each individual transaction, each transaction’s processing time information, and all account state changes within the system. This log must be dumped from the system as an ASCII text file when it receives the DUMPLOG command.

Constraints

(:point_up: Log files not of this exact schema will not be accepted)

Validation

Log files can be validated using xmllint against the provided XSD file

xmllint --schema logfile.xsd --noout OURLOGFILE.xml

Example

https://www.ece.uvic.ca/~seng468/ProjectWebSite/ExampleLog.html

Enable Logging

HTTP Server will contribute four logs:

DebugType

Debugging messages contain all the information of user commands, in
addition to an optional debug message

  • "timestamp": int // UNIX timestamp
  • "server": string // name of server eg. "Transaction Server"
  • "transactionNum": int // enumeration of transaction
  • "command": string // one of the known commands ("BUY", "SELL" etc)
  • "username": string // optional alphanumeric username
  • "stockSymbol": string // optional three-char alphanumeric stock symbol ("NWC", "BTK")
  • "filename": string // optional name of file to be written to
  • "funds": decimal // optional dollars and cents (eg 24.99)
  • "debugMessage": string // optional debug message or description

ErrorEventType

Error messages contain all the information of user commands, in
addition to an optional error message

  • "timestamp": int // UNIX timestamp
  • "server": string // name of server eg. "Transaction Server"
  • "transactionNum": int // enumeration of transaction
  • "command": string // one of the known commands ("BUY", "SELL" etc)
  • "username": string // optional alphanumeric username
  • "stockSymbol": string // optional three-char alphanumeric stock symbol ("NWC", "BTK")
  • "filename": string // optional name of file to be written to
  • "funds": decimal // optional dollars and cents (eg 24.99)
  • "errorMessage": string // optional error message or description

SystemEventType

System events can be current user commands, interserver communications,
or the execution of previously set triggers

  • "timestamp": int // UNIX timestamp
  • "server": string // name of server eg. "Transaction Server"
  • "transactionNum": int // enumeration of transaction
  • "command": string // one of the known commands ("BUY", "SELL" etc)
  • "username": string // optional alphanumeric username
  • "stockSymbol": string // optional three-char alphanumeric stock symbol ("NWC", "BTK")
  • "filename": string // optional name of file to be written to
  • "funds": decimal // optional dollars and cents (eg 24.99)

UserCommandType

User commands come from the user command files or from manual entries
in UI web forms

  • "timestamp": int // UNIX timestamp
  • "server": string // name of server eg. "Transaction Server"
  • "transactionNum": int // enumeration of transaction
  • "command": string // one of the known commands ("BUY", "SELL" etc)
  • "username": string // optional alphanumeric username
  • "stockSymbol": string // optional three-char alphanumeric stock symbol ("NWC", "BTK")
  • "filename": string // optional name of file to be written to
  • "funds": decimal // optional dollars and cents (eg 24.99)

Transaction numbering is not fault tolerant

Transaction number is set to 0 when server starts up. If it crashes and restarts, it would start at 0 again.
It should instead continue from most recent transaction number.

Display Summary via Web Client

Display Summary via Web Client

Purpose: A summary of the given user's transaction history and the current status of their accounts as well as any set buy or sell triggers and their parameters is displayed to the user.

Data Fields

Data will be transferred to Web Client as JSON and rendered by Web Client.

JSON Schema [WIP]

{
    "userSummary":
    {
        "account":
        {
            "userid": "",  // Globally-unique identifier
            "dollarsAvailable": "", // Current buying power
            "dollarsPending": "" // Amount on hold
        },
        "transactions": [
        {
            "timestamp": "", // Timestamp of execution
            "id": "",  // Globally-unique transaction identifier of
            "type": "", // Type of transaction eg. BUY, SELL
            "status": "", // Status of transaction eg. pending, complete, cancelled
            "dollarsAmount": "", // Dollar amount involved in transaction
            "sharePrice": "", // Price per share at time of purchase
        }],
        "holdings": [
        {
            "stockSymbol": "", // Unique identifier
            "shares": "",  // Number of shares purchased
            "sharePrice": "", // Price per share at time of purchase
            "purchaseDate": "" // Timestamp of execution
        }],
        "triggers": [
        {
            "type": "", // Type of trigger, eg. BUY, SELL
            "dollarAmount": "",  // Dollar amount involved in transaction if triggered
            "transactionId": "" // Globally-unique trigger identifier
        }]
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.