import TransactionFill from "../transaction/TransactionFill.js";
import TransactionStatus from "../transaction/TransactionStatus.js";
import APIEvent from "./APIEvent.js"
import APIEventType from "./APIEventType.js"

export default class TransactionUpdateEvent extends APIEvent{
    /**
     * @type {string}
     */
    apiId = null;

    /**
     * @type {string}
     */
    transactionId = 0;

    /**
     * @type {string}
     */
    status = TransactionStatus.NEW;

    /**
     * @type {number}
     */
    timestamp = 0;

    /**
     * @type {TransactionFill[]}
     */
    fills = [];

    /**
     * @param {string} transactionId 
     * @param {string} apiId 
     * @param {string} status 
     * @param {number} timestamp
     */
    constructor(transactionId, apiId, status, timestamp = Date.now()){
        super(APIEventType.TRANSACTION_UPDATE);
        this.apiId = apiId;
        this.transactionId = transactionId;
        this.statis = status;
        this.timestamp = timestamp;
    }
}