﻿function Reporting() {

    this.report = report;
    this.bellman = new BellMan();

    this.reportedMessages = new Array();

    function report(sessionId, pageId, assetId, actionId, detail, vehicle, paCode, callback) {

        // sent to local reporting server
        sendReportingEventToServer(sessionId, pageId, assetId, actionId, detail, vehicle, paCode, callback);


        // build message for 3rd party reporting partners
        var message = 
        {
            assetId : assetId,
            actionId : actionId,
            detail : detail,
            vehicle : vehicle,
            paCode: paCode,
            callback : callback
        };

        //
        // TODO : add reporting partners
        //


        this.reportedMessages.push(message);
        this.bellman.broadcast("reporting", message);
    }
}
