"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Require the LUSID SDK and libraries
var api_1 = require("../../api");
var clientBuilder_1 = require("./clientBuilder");
var uuid4 = require('uuid/v4');
var scope = uuid4();
var createRequest = new api_1.CreateTransactionPortfolioRequest();
createRequest.displayName = "UK Equities";
createRequest.code = "UKEQTY";
createRequest.baseCurrency = "GBP";
createRequest.created = new Date(2020, 1, 1, 12, 0, 0);
var transactionRequest = new api_1.TransactionRequest();
transactionRequest.instrumentIdentifiers = { "Instrument/default/Currency": "GBP" };
transactionRequest.type = "FundsIn";
transactionRequest.transactionDate = "2020-12-15T13:00:00Z";
transactionRequest.settlementDate = "2020-12-17T13:00:00Z";
transactionRequest.totalConsideration = new api_1.CurrencyAndAmount();
transactionRequest.totalConsideration.amount = 100;
transactionRequest.totalConsideration.currency = "GBP";
transactionRequest.units = 100;
transactionRequest.transactionCurrency = "GBP";
transactionRequest.transactionId = "1_-5207";
describe('Create portfolios', function () {
    it('Should create a portfolio', function (done) {
        clientBuilder_1.client.api.transactionPortfolios.createPortfolio(scope, createRequest)
            .then(function () { return done(); })
            .catch(function (err) { return done("Failed to create portfolio. Error: " + err.toString()); });
    });
    it('Should upsert a transaction', function (done) {
        clientBuilder_1.client.api.transactionPortfolios.upsertTransactions(scope, createRequest.code, [transactionRequest])
            .then(function () { return done(); })
            .catch(function (err) { return done("Failed to upsert transaction. Error: " + err.toString()); });
    });
    it('Should cancel a transaction', function (done) {
        clientBuilder_1.client.api.transactionPortfolios.cancelTransactions(scope, createRequest.code, [transactionRequest.transactionId])
            .then(function () { return done(); })
            .catch(function (err) { return done("Failed to cancel transaction. Error: " + err.toString()); });
    });
});
//# sourceMappingURL=createPortfolio.test.js.map