feat(#14): Wire manual buy/sell to the mammon acquire/consume endpoints

This commit is contained in:
Sirttas
2026-07-06 22:02:27 +02:00
parent 2a145bbbe7
commit d2a3a22ddf
11 changed files with 442 additions and 54 deletions
+1 -5
View File
@@ -1,13 +1,10 @@
<script setup lang="ts">
import {getMarketTypes, TaxInput, useMarketTaxStore} from "@/market";
import {BuyModal} from '@/market/acquisition';
import {ScanResult, ScanResultTable, toScanResult} from '@/market/scan';
import {marketApi} from "@/mammon";
import {useStorage} from "@vueuse/core";
import {ref, watch} from 'vue';
const buyModal = ref<typeof BuyModal>();
const marketTaxStore = useMarketTaxStore();
const days = useStorage('market-scan-days', 365);
const items = ref<ScanResult[]>([]);
@@ -51,8 +48,7 @@ watch([days, () => marketTaxStore.brokerFee, () => marketTaxStore.scc], scan, {
<span>Scanning market</span>
</div>
<template v-else>
<ScanResultTable :items="items" @buy="(type, buy, sell) => buyModal?.open(type, { 'Buy': buy, 'Sell': sell })" />
<BuyModal ref="buyModal" />
<ScanResultTable :items="items" />
</template>
</template>
+1 -1
View File
@@ -39,7 +39,7 @@ const result = computedAsync(async () => {
const acquisitions = computedAsync(async () => {
const p = price.value;
return !p ? [] : (await acquisitionApi.findAllAcquisitions(undefined, item.value?.id, true)).data
.map(a => ({
id: a.acquisitionId,