doku
All checks were successful
Deploy / deploy-staging (push) Successful in 32s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-08-21 01:04:21 +02:00
parent 70c86bd8ce
commit 95100d3a78
9 changed files with 66 additions and 37 deletions

View File

@@ -2116,11 +2116,20 @@ final class Router
: $this->currentTimestamp();
$settledValueAmount = null;
$settledValueCurrency = null;
$settledFxFetchId = null;
if ($this->isCryptoCurrencyCode($purchaseCurrency)) {
$settledValueCurrency = $this->requiredCurrency($settings['report_currency'] ?? 'EUR', 'report_currency');
$settledFxFetchId = $this->resolveMeasurementFxFetchId($projectKey, ['measured_at' => $purchasedAt], true);
if ($settledFxFetchId === null) {
throw new ApiException(
'Es konnte kein FX-Snapshot fuer die Krypto-Zahlung gespeichert werden. Der Miner wird nicht ohne historische Kursreferenz angelegt.',
422,
['currency' => $purchaseCurrency, 'purchased_at' => $purchasedAt]
);
}
$settledValueAmount = $purchaseCurrency === $settledValueCurrency
? $purchaseCost
: $this->convertMiningAssetAmount((float) $purchaseCost, $purchaseCurrency, $settledValueCurrency, $purchasedAt);
: $this->convertMiningAssetAmount((float) $purchaseCost, $purchaseCurrency, $settledValueCurrency, $purchasedAt, $settledFxFetchId);
if ($settledValueAmount === null) {
throw new ApiException(
'Der aktuelle Kurs fuer die Krypto-Zahlung konnte nicht ermittelt werden. Der Miner wird nicht ohne feste Bewertung gespeichert.',
@@ -2145,6 +2154,7 @@ final class Router
'reference_price_currency' => $referencePriceCurrency,
'settled_value_amount' => $settledValueAmount,
'settled_value_currency' => $settledValueCurrency,
'settled_fx_fetch_id' => $settledFxFetchId,
'auto_renew' => $isAutoRenew ? 1 : 0,
'note' => $this->optionalString($input['note'] ?? ($offer['note'] ?? null), 1000),
'is_active' => 1,