/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends } from "tslib";
import { StockInfo } from "./StockInfo";
import { markType } from "./type";
/**
 * @hidden
 */
var StockPosition = /** @class */ (function (_super) {
    __extends(StockPosition, _super);
    function StockPosition() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._index = 0;
        _this._tradeDate = new Date();
        _this._shares = 0;
        _this._costPerShare = 0;
        _this._marketPrice = 0;
        _this._data = null;
        _this._action = null;
        return _this;
    }
    Object.defineProperty(StockPosition.prototype, "index", {
        get: function () {
            return this._index;
        },
        set: function (a) {
            this._index = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "tradeDate", {
        get: function () {
            return this._tradeDate;
        },
        set: function (a) {
            this._tradeDate = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "shares", {
        get: function () {
            return this._shares;
        },
        set: function (a) {
            this._shares = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "costPerShare", {
        get: function () {
            return this._costPerShare;
        },
        set: function (a) {
            this._costPerShare = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "costTotal", {
        get: function () {
            return Math.round(this.shares * this.costPerShare);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "marketValue", {
        get: function () {
            return Math.round(this.shares * this.marketPrice);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "marketPrice", {
        get: function () {
            return this._marketPrice;
        },
        set: function (a) {
            this._marketPrice = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "gainValue", {
        get: function () {
            return Math.round(this.marketValue - this.costTotal);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "gainPercentage", {
        get: function () {
            return this.gainValue / this.costTotal * 100;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "data", {
        get: function () {
            return this._data;
        },
        set: function (a) {
            this._data = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(StockPosition.prototype, "action", {
        get: function () {
            return this._action;
        },
        set: function (a) {
            this._action = a;
        },
        enumerable: true,
        configurable: true
    });
    StockPosition.$t = markType(StockPosition, 'StockPosition', StockInfo.$);
    return StockPosition;
}(StockInfo));
export { StockPosition };
