Skip to content
Snippets Groups Projects
Commit 4ae9d194 authored by Gomez Goiri, Aitor's avatar Gomez Goiri, Aitor
Browse files

Creating several individual assets in the simulation

parent 9ca47c44
Branches
Tags
No related merge requests found
......@@ -42,26 +42,34 @@ const simulateCycle = async (arg1, cmd) => {
await signInAs(apiClient, otherArgs.sidenorUser, password)
let batchId = await createAssetAndSendToCone(apiClient, "simulated asset 1")
//batchId = await createAssetAndSendToCone(apiClient, "simulated asset 2")
//batchId = await createAssetAndSendToCone(apiClient, "simulated asset 3")
const mergedStock = await sendToStock(apiClient, { assetId: batchId })
const selectedStockId = await discardStock(apiClient, {
assetId: mergedStock.id
let stockId
for (let simId of [1, 2, 3]) {
const batchId = await createAssetAndSendToCone(
apiClient,
`simulated asset ${simId}`
)
let mergedStock = await sendToStock(apiClient, {
assetId: batchId,
// The first time the user should select the stock as it is not provided
stockId
})
stockId = mergedStock.id
}
const selectedStockId = await discardStock(apiClient, { assetId: stockId })
const selectedStock = await apiClient.getAsset(selectedStockId)
await signInAs(apiClient, otherArgs.cement1User, password)
await bidAsset(apiClient, {
assetId: selectedStockId,
quantity: faker.datatype.number({ min: 200, max: selectedStock.quantity }),
price: faker.datatype.number({ min: 50, max: 150 })
})
await signInAs(apiClient, otherArgs.cement2User, password)
await bidAsset(apiClient, {
assetId: selectedStockId,
quantity: selectedStock.quantity - 500,
quantity: faker.datatype.number({ min: 100, max: selectedStock.quantity }),
price: faker.datatype.number({ min: 25, max: 200 })
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment