@firela/api-types 0.0.0-canary.32edff08 → 0.0.0-canary.3ed455fd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -316,6 +316,53 @@ export type RegionsMetadataResponseDto = {
316
316
  regions: Array<RegionInfoDto>;
317
317
  };
318
318
 
319
+ export type CostSpecDto = {
320
+ /**
321
+ * Cost specification mode (mirrors engine CostSpec)
322
+ */
323
+ mode: 'per-unit' | 'total' | 'date' | 'label' | 'auto';
324
+ /**
325
+ * Per-unit cost (required when mode is "per-unit")
326
+ */
327
+ numberPerUnit?: string;
328
+ /**
329
+ * Total cost for all units (required when mode is "total")
330
+ */
331
+ totalNumber?: string;
332
+ /**
333
+ * Cost currency (required in all modes)
334
+ */
335
+ currency: string;
336
+ /**
337
+ * Lot acquisition date, ISO 8601 (required when mode is "date")
338
+ */
339
+ date?: string;
340
+ /**
341
+ * Lot label (required when mode is "label"; optional tag in buy modes)
342
+ */
343
+ label?: string;
344
+ /**
345
+ * Merge lots for AVERAGE booking (mode: auto)
346
+ */
347
+ merge?: boolean;
348
+ };
349
+
350
+ /**
351
+ * Cost specification mode (mirrors engine CostSpec)
352
+ */
353
+ export type mode = 'per-unit' | 'total' | 'date' | 'label' | 'auto';
354
+
355
+ export type AmountDto = {
356
+ /**
357
+ * Amount as decimal string (max 15 integer + 15 decimal digits)
358
+ */
359
+ number: string;
360
+ /**
361
+ * Currency/commodity code
362
+ */
363
+ currency: string;
364
+ };
365
+
319
366
  export type CreatePostingDto = {
320
367
  /**
321
368
  * Account name in Beancount format (must start with uppercase, colon-separated)
@@ -335,6 +382,14 @@ export type CreatePostingDto = {
335
382
  meta?: {
336
383
  [key: string]: unknown;
337
384
  };
385
+ /**
386
+ * Cost basis (Beancount `{...}`). Maps to engine costSpec. Required for commodity holdings so they carry a monetary weight that can balance.
387
+ */
388
+ cost?: CostSpecDto;
389
+ /**
390
+ * Price annotation (Beancount `@...`). Maps to engine price. Used for valuation; cost takes priority for balance weight.
391
+ */
392
+ price?: AmountDto;
338
393
  };
339
394
 
340
395
  export type CreateTransactionDto = {
@@ -387,6 +442,25 @@ export type CreateTransactionDto = {
387
442
  */
388
443
  export type flag = '*' | '!';
389
444
 
445
+ export type CostDetailDto = {
446
+ /**
447
+ * Per-unit cost basis (mirrors engine Cost.number)
448
+ */
449
+ number?: string;
450
+ /**
451
+ * Cost currency
452
+ */
453
+ currency?: string;
454
+ /**
455
+ * Lot acquisition date (ISO yyyy-mm-dd)
456
+ */
457
+ date?: string;
458
+ /**
459
+ * Lot label
460
+ */
461
+ label?: string;
462
+ };
463
+
390
464
  export type PostingResponseDto = {
391
465
  /**
392
466
  * Account name
@@ -400,6 +474,10 @@ export type PostingResponseDto = {
400
474
  * Currency
401
475
  */
402
476
  currency?: string;
477
+ /**
478
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
479
+ */
480
+ cost?: CostDetailDto;
403
481
  };
404
482
 
405
483
  export type RecurringSuggestionDto = {
@@ -561,6 +639,55 @@ export type BatchTransactionResponseDto = {
561
639
  failed: Array<BatchTransactionErrorDto>;
562
640
  };
563
641
 
642
+ export type CorrectTransactionDto = {
643
+ /**
644
+ * Transaction date (ISO 8601 format)
645
+ */
646
+ date: string;
647
+ /**
648
+ * Transaction flag: * (cleared), ! (pending)
649
+ */
650
+ flag?: '*' | '!';
651
+ /**
652
+ * Payee name
653
+ */
654
+ payee?: string;
655
+ /**
656
+ * Transaction narration/description
657
+ */
658
+ narration: string;
659
+ /**
660
+ * Transaction tags (without # prefix)
661
+ */
662
+ tags?: Array<string>;
663
+ /**
664
+ * Transaction links (without ^ prefix)
665
+ */
666
+ links?: Array<string>;
667
+ /**
668
+ * Transaction postings (minimum 1, typically 2 for double-entry)
669
+ */
670
+ postings: Array<CreatePostingDto>;
671
+ /**
672
+ * Transaction-level metadata
673
+ */
674
+ meta?: {
675
+ [key: string]: unknown;
676
+ };
677
+ /**
678
+ * Unique key for idempotent transaction creation. If provided, duplicate requests with the same key will return the existing transaction.
679
+ */
680
+ idempotencyKey?: string;
681
+ /**
682
+ * Auto-create accounts if not found. When true, missing accounts will be automatically created. When false (default for API), missing accounts will cause a validation error. Set to true for quick entry scenarios where you want to create accounts on-the-fly.
683
+ */
684
+ autoCreateAccounts?: boolean;
685
+ /**
686
+ * Reason for correcting/superseding the original transaction
687
+ */
688
+ correctionReason?: string;
689
+ };
690
+
564
691
  export type PostingDetailDto = {
565
692
  /**
566
693
  * Posting ID
@@ -571,9 +698,9 @@ export type PostingDetailDto = {
571
698
  */
572
699
  accountId: string;
573
700
  /**
574
- * Account name
701
+ * Fully-qualified Beancount account path
575
702
  */
576
- accountName: string;
703
+ account: string;
577
704
  /**
578
705
  * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.
579
706
  */
@@ -594,6 +721,10 @@ export type PostingDetailDto = {
594
721
  * Cost date
595
722
  */
596
723
  costDate?: string;
724
+ /**
725
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
726
+ */
727
+ cost?: CostDetailDto;
597
728
  /**
598
729
  * Price amount
599
730
  */
@@ -691,6 +822,14 @@ export type TransactionDetailDto = {
691
822
  * Correction reason (if voided or superseded)
692
823
  */
693
824
  correctionReason?: string;
825
+ /**
826
+ * ID of the transaction that supersedes this one (set when status=SUPERSEDED)
827
+ */
828
+ supersededBy?: string;
829
+ /**
830
+ * ID of the transaction this one corrected/replaced (back-link on the replacement)
831
+ */
832
+ originalTxn?: string;
694
833
  };
695
834
 
696
835
  /**
@@ -3354,6 +3493,8 @@ export type SupportedProvidersResponseDto = {
3354
3493
 
3355
3494
  export type ParserTelemetryReportDto = unknown;
3356
3495
 
3496
+ export type UncoveredFormatMissDto = unknown;
3497
+
3357
3498
  export type ProcessNlpDto = {
3358
3499
  /**
3359
3500
  * Natural language text describing a transaction (Chinese)
@@ -4139,8 +4280,21 @@ export type AccountItemWithAssetClassDto = {
4139
4280
  * Risk level
4140
4281
  */
4141
4282
  riskLevel?: string;
4283
+ /**
4284
+ * ADR-0105 classification provenance (holding level always; account level only on FALLBACK)
4285
+ */
4286
+ source?: 'USER_META' | 'FIAT_CURRENCY' | 'OPENBB_MAPPING' | 'FALLBACK';
4142
4287
  };
4143
4288
 
4289
+ /**
4290
+ * ADR-0105 classification provenance (holding level always; account level only on FALLBACK)
4291
+ */
4292
+ export type source2 =
4293
+ | 'USER_META'
4294
+ | 'FIAT_CURRENCY'
4295
+ | 'OPENBB_MAPPING'
4296
+ | 'FALLBACK';
4297
+
4144
4298
  export type AssetClassGroupDto = {
4145
4299
  /**
4146
4300
  * Asset class name
@@ -4227,6 +4381,12 @@ export type AssetClassSummaryDto = {
4227
4381
  * Exchange rate warnings
4228
4382
  */
4229
4383
  warnings?: Array<AccountExchangeRateWarningDto>;
4384
+ /**
4385
+ * ADR-0105 §4 fallback provenance stats (holding level only). valueRatio is the grey-area share of total converted value; count is the number of source=FALLBACK holdings.
4386
+ */
4387
+ fallback?: {
4388
+ [key: string]: unknown;
4389
+ };
4230
4390
  };
4231
4391
 
4232
4392
  export type AssetClassAccountsResponseDto = {
@@ -4238,6 +4398,56 @@ export type AssetClassAccountsResponseDto = {
4238
4398
  * Summary statistics
4239
4399
  */
4240
4400
  summary: AssetClassSummaryDto;
4401
+ /**
4402
+ * ADR-0105 §6 holding-level grey-area bucket (source=FALLBACK holdings peeled out of groups). Present only for groupBy=holdingAssetClass when FALLBACK holdings exist.
4403
+ */
4404
+ uncategorized?: AssetClassGroupDto;
4405
+ };
4406
+
4407
+ export type HoldingAssetClassAccountSliceDto = {
4408
+ /**
4409
+ * Account ID
4410
+ */
4411
+ accountId: string;
4412
+ /**
4413
+ * Full account path
4414
+ */
4415
+ accountPath: string;
4416
+ /**
4417
+ * Currency of the holding with the largest converted base value; undefined when no holding is convertible
4418
+ */
4419
+ accountCurrency?: string;
4420
+ /**
4421
+ * Account's market value in base currency (Σ converted holdings; grey bucket included)
4422
+ */
4423
+ marketValueBase: string;
4424
+ /**
4425
+ * Share of the global total (0-100). 0 when globalTotal is zero (no NaN/Infinity).
4426
+ */
4427
+ shareOfTotalPct: number;
4428
+ /**
4429
+ * Per-account asset-class breakdown
4430
+ */
4431
+ groups: Array<AssetClassGroupDto>;
4432
+ /**
4433
+ * Per-account grey bucket (source=FALLBACK holdings, incl. broker cash)
4434
+ */
4435
+ uncategorized?: AssetClassGroupDto;
4436
+ /**
4437
+ * Every holding row for this account (account ID in each row’s `id` field)
4438
+ */
4439
+ holdings: Array<AccountItemWithAssetClassDto>;
4440
+ };
4441
+
4442
+ export type HoldingAssetClassCrossAccountResponseDto = {
4443
+ /**
4444
+ * Merged cross-account holding aggregation
4445
+ */
4446
+ global: AssetClassAccountsResponseDto;
4447
+ /**
4448
+ * Per-account slices
4449
+ */
4450
+ byAccount: Array<HoldingAssetClassAccountSliceDto>;
4241
4451
  };
4242
4452
 
4243
4453
  export type CashFlowByCurrencyDto = {
@@ -4319,133 +4529,430 @@ export type CashFlowResponseDto = {
4319
4529
  warnings?: Array<ExchangeRateWarningDto>;
4320
4530
  };
4321
4531
 
4322
- export type CurrencyBalanceDto = {
4532
+ export type MonetaryDto = {
4323
4533
  /**
4324
- * ISO 4217 currency code
4534
+ * Amount (Decimal string)
4535
+ */
4536
+ amount: string;
4537
+ /**
4538
+ * ISO 4217 currency
4325
4539
  */
4326
4540
  currency: string;
4327
4541
  /**
4328
- * Balance amount
4542
+ * Converted to user base currency (Decimal string)
4329
4543
  */
4330
- balance: string;
4544
+ baseCcyEquivalent?: {
4545
+ [key: string]: unknown;
4546
+ } | null;
4331
4547
  };
4332
4548
 
4333
- export type TimeSeriesPointDto = {
4549
+ export type CurrentPriceDto = {
4334
4550
  /**
4335
- * Date in YYYY-MM-DD format
4551
+ * Price amount (Decimal string)
4552
+ */
4553
+ amount: string;
4554
+ /**
4555
+ * Price currency (ISO 4217)
4556
+ */
4557
+ currency: string;
4558
+ /**
4559
+ * Price date (ISO 8601)
4336
4560
  */
4337
4561
  date: string;
4338
4562
  /**
4339
- * Value at this date (in base currency)
4563
+ * Price source
4340
4564
  */
4341
- value: string;
4565
+ source: 'USER_OVERRIDE' | 'OPENBB_EQUITY' | 'OPENBB_CURRENCY';
4566
+ };
4567
+
4568
+ /**
4569
+ * Price source
4570
+ */
4571
+ export type source3 = 'USER_OVERRIDE' | 'OPENBB_EQUITY' | 'OPENBB_CURRENCY';
4572
+
4573
+ export type FxRateDto = {
4574
+ from: string;
4575
+ to: string;
4342
4576
  /**
4343
- * Change from previous point
4577
+ * FX rate (Decimal string)
4344
4578
  */
4345
- change?: {
4346
- [key: string]: unknown;
4347
- };
4579
+ rate: string;
4348
4580
  /**
4349
- * Multi-currency breakdown for this point
4581
+ * Rate date (ISO 8601)
4350
4582
  */
4351
- byCurrency?: Array<CurrencyBalanceDto>;
4583
+ date: string;
4352
4584
  };
4353
4585
 
4354
- export type TrendSummaryDto = {
4586
+ export type HoldingPnlRowDto = {
4355
4587
  /**
4356
- * Value at start of period
4588
+ * Account UUID
4357
4589
  */
4358
- startValue: string;
4590
+ accountId: string;
4359
4591
  /**
4360
- * Value at end of period
4592
+ * Full account path
4361
4593
  */
4362
- endValue: string;
4594
+ accountPath: string;
4363
4595
  /**
4364
- * Total change over period
4596
+ * Account settlement currency (ISO 4217), from cost currency
4365
4597
  */
4366
- totalChange: string;
4598
+ accountCcy?: {
4599
+ [key: string]: unknown;
4600
+ } | null;
4367
4601
  /**
4368
- * Total change percentage
4602
+ * Broker type derived from Platform.type
4369
4603
  */
4370
- totalChangePercentage: string;
4371
- };
4372
-
4373
- export type MultiCurrencyPointDto = {
4604
+ brokerType?: {
4605
+ [key: string]: unknown;
4606
+ } | null;
4374
4607
  /**
4375
- * Date in YYYY-MM-DD format
4608
+ * Commodity symbol
4376
4609
  */
4377
- date: string;
4610
+ symbol: string;
4378
4611
  /**
4379
- * Balances by currency
4612
+ * Chart segment token (libs/common resolver)
4380
4613
  */
4381
- byCurrency: Array<CurrencyBalanceDto>;
4382
- };
4383
-
4384
- export type PortfolioTrendsResponseDto = {
4614
+ chartToken: 'equity' | 'fund' | 'bond' | 'cash' | 'other';
4615
+ assetClass: string;
4616
+ assetSubClass?: {
4617
+ [key: string]: unknown;
4618
+ } | null;
4385
4619
  /**
4386
- * Time series data points
4620
+ * Net held units (Decimal string)
4387
4621
  */
4388
- series: Array<TimeSeriesPointDto>;
4622
+ units: string;
4389
4623
  /**
4390
- * Period summary
4624
+ * Average cost per unit; null when cost currency conflicts or no cost
4391
4625
  */
4392
- summary: TrendSummaryDto;
4626
+ averageCostPerUnit?: MonetaryDto | null;
4393
4627
  /**
4394
- * Period requested
4628
+ * Cost basis of held units
4395
4629
  */
4396
- period: string;
4630
+ costBasis?: MonetaryDto | null;
4397
4631
  /**
4398
- * Data granularity
4632
+ * Market value at asOf price
4399
4633
  */
4400
- granularity: string;
4634
+ marketValue?: MonetaryDto | null;
4401
4635
  /**
4402
- * Base currency for converted values
4636
+ * Price used for market value
4403
4637
  */
4404
- currency: string;
4638
+ currentPrice?: CurrentPriceDto | null;
4405
4639
  /**
4406
- * Multi-currency time series (each point has currency breakdown)
4640
+ * Unrealized P&L in base currency (Decimal string); null when any FX/price missing
4407
4641
  */
4408
- byCurrency?: Array<MultiCurrencyPointDto>;
4642
+ unrealizedPnlBase?: {
4643
+ [key: string]: unknown;
4644
+ } | null;
4409
4645
  /**
4410
- * Exchange rate warnings
4646
+ * Unrealized P&L % (Decimal string)
4411
4647
  */
4412
- warnings?: Array<ExchangeRateWarningDto>;
4648
+ unrealizedPnlPct?: {
4649
+ [key: string]: unknown;
4650
+ } | null;
4651
+ /**
4652
+ * Historical FX rate applied to cost basis
4653
+ */
4654
+ costFxRate?: FxRateDto | null;
4655
+ /**
4656
+ * FX rate applied to market value
4657
+ */
4658
+ marketFxRate?: FxRateDto | null;
4659
+ /**
4660
+ * Share of invested assets % (Decimal string); only for invested chartTokens
4661
+ */
4662
+ pctOfInvestedAssets?: {
4663
+ [key: string]: unknown;
4664
+ } | null;
4665
+ /**
4666
+ * Cumulative realized P&L on sold lots (asOf-date cutoff); null when the method has no applicable sells, a sell lacks a price, or any required FX rate is missing (never-mix). When a sell spans multiple currencies (cross-currency sale), amount and currency reflect the base currency; baseCcyEquivalent is always the authoritative dual-FX figure
4667
+ */
4668
+ realizedPnl?: MonetaryDto | null;
4413
4669
  };
4414
4670
 
4415
- export type GenerateSnapshotBody = unknown;
4416
-
4417
- export type GenerateSnapshotResponse = unknown;
4418
-
4419
- export type BackfillSnapshotsBody = unknown;
4420
-
4421
- export type BackfillSnapshotsResponse = unknown;
4671
+ /**
4672
+ * Chart segment token (libs/common resolver)
4673
+ */
4674
+ export type chartToken = 'equity' | 'fund' | 'bond' | 'cash' | 'other';
4422
4675
 
4423
- export type AnonymousLoginDto = {
4676
+ export type HoldingPnlWarningDto = {
4424
4677
  /**
4425
- * Access token for anonymous login
4678
+ * Warning type
4426
4679
  */
4427
- accessToken: string;
4680
+ type:
4681
+ | 'MISSING_COST_FX_RATE'
4682
+ | 'MISSING_MARKET_FX_RATE'
4683
+ | 'MISSING_SALE_PRICE'
4684
+ | 'MISSING_REALIZED_FX_RATE'
4685
+ | 'OVERSOLD_LOTS'
4686
+ | 'NO_PRICE'
4687
+ | 'MIXED_COST_CURRENCY';
4688
+ symbol?: {
4689
+ [key: string]: unknown;
4690
+ } | null;
4691
+ accountId?: {
4692
+ [key: string]: unknown;
4693
+ } | null;
4694
+ currency?: {
4695
+ [key: string]: unknown;
4696
+ } | null;
4428
4697
  };
4429
4698
 
4430
- export type AccountControllerCreateData = {
4699
+ /**
4700
+ * Warning type
4701
+ */
4702
+ export type type4 =
4703
+ | 'MISSING_COST_FX_RATE'
4704
+ | 'MISSING_MARKET_FX_RATE'
4705
+ | 'MISSING_SALE_PRICE'
4706
+ | 'MISSING_REALIZED_FX_RATE'
4707
+ | 'OVERSOLD_LOTS'
4708
+ | 'NO_PRICE'
4709
+ | 'MIXED_COST_CURRENCY';
4710
+
4711
+ export type HoldingPnlResponseDto = {
4712
+ asOfDate: string;
4713
+ baseCurrency: string;
4431
4714
  /**
4432
- * Region code for tenant context
4715
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
4433
4716
  */
4434
- region: 'cn' | 'us' | 'de' | 'gb';
4435
- requestBody: CreateAccountDto;
4717
+ method: 'average' | 'FIFO';
4718
+ rows: Array<HoldingPnlRowDto>;
4719
+ warnings: Array<HoldingPnlWarningDto>;
4436
4720
  };
4437
4721
 
4438
- export type AccountControllerCreateResponse = AccountResponseDto;
4722
+ /**
4723
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
4724
+ */
4725
+ export type method = 'average' | 'FIFO';
4439
4726
 
4440
- export type AccountControllerFindAllData = {
4727
+ export type CreateBeanPriceDto = {
4441
4728
  /**
4442
- * Filter by custom (user-created) accounts only
4729
+ * Currency being priced (e.g., USD, AAPL, BTC)
4443
4730
  */
4444
- isCustom?: boolean;
4731
+ currency: string;
4445
4732
  /**
4446
- * Maximum number of results
4733
+ * Quote currency (pricing currency, e.g., CNY, EUR)
4447
4734
  */
4448
- limit?: number;
4735
+ quoteCurrency: string;
4736
+ /**
4737
+ * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
4738
+ */
4739
+ amount: number;
4740
+ /**
4741
+ * Price date (ISO 8601 format)
4742
+ */
4743
+ date: string;
4744
+ /**
4745
+ * Metadata (validated by Zod schema, max field lengths enforced)
4746
+ */
4747
+ metadata?: {
4748
+ [key: string]: unknown;
4749
+ };
4750
+ };
4751
+
4752
+ export type PriceResponseDto = {
4753
+ /**
4754
+ * Unique identifier
4755
+ */
4756
+ id: string;
4757
+ /**
4758
+ * User ID (owner of the price)
4759
+ */
4760
+ userId: string;
4761
+ /**
4762
+ * Currency being priced (e.g., USD, AAPL, BTC)
4763
+ */
4764
+ currency: string;
4765
+ /**
4766
+ * Quote currency (pricing currency, e.g., USD, CNY)
4767
+ */
4768
+ quoteCurrency: string;
4769
+ /**
4770
+ * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
4771
+ */
4772
+ amount: number;
4773
+ /**
4774
+ * Price date (ISO 8601 format). Represents the date this price was valid.
4775
+ */
4776
+ date: string;
4777
+ /**
4778
+ * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
4779
+ */
4780
+ meta: {
4781
+ [key: string]: unknown;
4782
+ };
4783
+ /**
4784
+ * Creation timestamp
4785
+ */
4786
+ createdAt: string;
4787
+ /**
4788
+ * Last update timestamp
4789
+ */
4790
+ updatedAt: string;
4791
+ };
4792
+
4793
+ export type PriceListResponseDto = {
4794
+ /**
4795
+ * List of prices
4796
+ */
4797
+ items: Array<PriceResponseDto>;
4798
+ /**
4799
+ * Total number of prices
4800
+ */
4801
+ total: number;
4802
+ };
4803
+
4804
+ export type UpdateBeanPriceDto = {
4805
+ /**
4806
+ * Currency being priced
4807
+ */
4808
+ currency?: string;
4809
+ /**
4810
+ * Quote currency (pricing currency)
4811
+ */
4812
+ quoteCurrency?: string;
4813
+ /**
4814
+ * Price amount (MUST be >= 0 per Beancount spec)
4815
+ */
4816
+ amount?: number;
4817
+ /**
4818
+ * Price date (ISO 8601 format)
4819
+ */
4820
+ date?: string;
4821
+ /**
4822
+ * Metadata
4823
+ */
4824
+ metadata?: {
4825
+ [key: string]: unknown;
4826
+ };
4827
+ };
4828
+
4829
+ export type CurrencyBalanceDto = {
4830
+ /**
4831
+ * ISO 4217 currency code
4832
+ */
4833
+ currency: string;
4834
+ /**
4835
+ * Balance amount
4836
+ */
4837
+ balance: string;
4838
+ };
4839
+
4840
+ export type TimeSeriesPointDto = {
4841
+ /**
4842
+ * Date in YYYY-MM-DD format
4843
+ */
4844
+ date: string;
4845
+ /**
4846
+ * Value at this date (in base currency)
4847
+ */
4848
+ value: string;
4849
+ /**
4850
+ * Change from previous point
4851
+ */
4852
+ change?: {
4853
+ [key: string]: unknown;
4854
+ };
4855
+ /**
4856
+ * Multi-currency breakdown for this point
4857
+ */
4858
+ byCurrency?: Array<CurrencyBalanceDto>;
4859
+ };
4860
+
4861
+ export type TrendSummaryDto = {
4862
+ /**
4863
+ * Value at start of period
4864
+ */
4865
+ startValue: string;
4866
+ /**
4867
+ * Value at end of period
4868
+ */
4869
+ endValue: string;
4870
+ /**
4871
+ * Total change over period
4872
+ */
4873
+ totalChange: string;
4874
+ /**
4875
+ * Total change percentage
4876
+ */
4877
+ totalChangePercentage: string;
4878
+ };
4879
+
4880
+ export type MultiCurrencyPointDto = {
4881
+ /**
4882
+ * Date in YYYY-MM-DD format
4883
+ */
4884
+ date: string;
4885
+ /**
4886
+ * Balances by currency
4887
+ */
4888
+ byCurrency: Array<CurrencyBalanceDto>;
4889
+ };
4890
+
4891
+ export type PortfolioTrendsResponseDto = {
4892
+ /**
4893
+ * Time series data points
4894
+ */
4895
+ series: Array<TimeSeriesPointDto>;
4896
+ /**
4897
+ * Period summary
4898
+ */
4899
+ summary: TrendSummaryDto;
4900
+ /**
4901
+ * Period requested
4902
+ */
4903
+ period: string;
4904
+ /**
4905
+ * Data granularity
4906
+ */
4907
+ granularity: string;
4908
+ /**
4909
+ * Base currency for converted values
4910
+ */
4911
+ currency: string;
4912
+ /**
4913
+ * Multi-currency time series (each point has currency breakdown)
4914
+ */
4915
+ byCurrency?: Array<MultiCurrencyPointDto>;
4916
+ /**
4917
+ * Exchange rate warnings
4918
+ */
4919
+ warnings?: Array<ExchangeRateWarningDto>;
4920
+ };
4921
+
4922
+ export type GenerateSnapshotBody = unknown;
4923
+
4924
+ export type GenerateSnapshotResponse = unknown;
4925
+
4926
+ export type BackfillSnapshotsBody = unknown;
4927
+
4928
+ export type BackfillSnapshotsResponse = unknown;
4929
+
4930
+ export type AnonymousLoginDto = {
4931
+ /**
4932
+ * Access token for anonymous login
4933
+ */
4934
+ accessToken: string;
4935
+ };
4936
+
4937
+ export type AccountControllerCreateData = {
4938
+ /**
4939
+ * Region code for tenant context
4940
+ */
4941
+ region: 'cn' | 'us' | 'de' | 'gb';
4942
+ requestBody: CreateAccountDto;
4943
+ };
4944
+
4945
+ export type AccountControllerCreateResponse = AccountResponseDto;
4946
+
4947
+ export type AccountControllerFindAllData = {
4948
+ /**
4949
+ * Filter by custom (user-created) accounts only
4950
+ */
4951
+ isCustom?: boolean;
4952
+ /**
4953
+ * Maximum number of results
4954
+ */
4955
+ limit?: number;
4449
4956
  /**
4450
4957
  * Number of results to skip
4451
4958
  */
@@ -4641,6 +5148,20 @@ export type TransactionControllerCreateBatchData = {
4641
5148
  export type TransactionControllerCreateBatchResponse =
4642
5149
  BatchTransactionResponseDto;
4643
5150
 
5151
+ export type TransactionControllerCorrectData = {
5152
+ /**
5153
+ * Original transaction ID to correct
5154
+ */
5155
+ id: string;
5156
+ /**
5157
+ * Region code for tenant context
5158
+ */
5159
+ region: 'cn' | 'us' | 'de' | 'gb';
5160
+ requestBody: CorrectTransactionDto;
5161
+ };
5162
+
5163
+ export type TransactionControllerCorrectResponse = TransactionDetailDto;
5164
+
4644
5165
  export type TransactionControllerSuggestTagsData = {
4645
5166
  /**
4646
5167
  * Max suggestions (1-100, default 10)
@@ -5723,9 +6244,9 @@ export type ProviderSyncControllerSyncData = {
5723
6244
  | 'beancount-direct'
5724
6245
  | 'parsed-bill';
5725
6246
  /**
5726
- * Region code
6247
+ * Region code for tenant context
5727
6248
  */
5728
- region: unknown;
6249
+ region: 'cn' | 'us' | 'de' | 'gb';
5729
6250
  requestBody: ProviderSyncDto;
5730
6251
  };
5731
6252
 
@@ -5764,6 +6285,29 @@ export type TelemetryControllerReportTelemetryData = {
5764
6285
 
5765
6286
  export type TelemetryControllerReportTelemetryResponse = unknown;
5766
6287
 
6288
+ export type TelemetryControllerReportCoverageMissData = {
6289
+ /**
6290
+ * Region code for tenant context
6291
+ */
6292
+ region: 'cn' | 'us' | 'de' | 'gb';
6293
+ requestBody: UncoveredFormatMissDto;
6294
+ };
6295
+
6296
+ export type TelemetryControllerReportCoverageMissResponse = unknown;
6297
+
6298
+ export type TelemetryControllerGetCoverageMetricsData = {
6299
+ /**
6300
+ * Region code for tenant context
6301
+ */
6302
+ region: 'cn' | 'us' | 'de' | 'gb';
6303
+ /**
6304
+ * Top-N uncovered formats (default 10)
6305
+ */
6306
+ topN?: unknown;
6307
+ };
6308
+
6309
+ export type TelemetryControllerGetCoverageMetricsResponse = unknown;
6310
+
5767
6311
  export type NlpControllerProcessNaturalLanguageData = {
5768
6312
  /**
5769
6313
  * Region code for tenant context
@@ -5817,6 +6361,10 @@ export type DashboardControllerGetNetWorthData = {
5817
6361
  export type DashboardControllerGetNetWorthResponse = NetWorthResponseDto;
5818
6362
 
5819
6363
  export type DashboardControllerGetAccountsData = {
6364
+ /**
6365
+ * Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
6366
+ */
6367
+ accountId?: string;
5820
6368
  /**
5821
6369
  * Date for balance calculation (ISO 8601 format)
5822
6370
  */
@@ -5824,7 +6372,11 @@ export type DashboardControllerGetAccountsData = {
5824
6372
  /**
5825
6373
  * Grouping strategy
5826
6374
  */
5827
- groupBy?: 'platform' | 'assetClass';
6375
+ groupBy?:
6376
+ | 'platform'
6377
+ | 'assetClass'
6378
+ | 'holdingAssetClass'
6379
+ | 'holdingAssetClassByAccount';
5828
6380
  /**
5829
6381
  * Region code for tenant context
5830
6382
  */
@@ -5833,7 +6385,8 @@ export type DashboardControllerGetAccountsData = {
5833
6385
 
5834
6386
  export type DashboardControllerGetAccountsResponse =
5835
6387
  | AccountsResponseDto
5836
- | AssetClassAccountsResponseDto;
6388
+ | AssetClassAccountsResponseDto
6389
+ | HoldingAssetClassCrossAccountResponseDto;
5837
6390
 
5838
6391
  export type DashboardControllerGetCashFlowData = {
5839
6392
  /**
@@ -5848,6 +6401,124 @@ export type DashboardControllerGetCashFlowData = {
5848
6401
 
5849
6402
  export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
5850
6403
 
6404
+ export type HoldingPnlControllerGetHoldingPnlData = {
6405
+ /**
6406
+ * Scope to a single account
6407
+ */
6408
+ accountId?: string;
6409
+ /**
6410
+ * As-of date (ISO 8601), defaults to today
6411
+ */
6412
+ asOf?: string;
6413
+ /**
6414
+ * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
6415
+ */
6416
+ method?: 'FIFO' | 'average';
6417
+ /**
6418
+ * Region code for tenant context
6419
+ */
6420
+ region: 'cn' | 'us' | 'de' | 'gb';
6421
+ };
6422
+
6423
+ export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6424
+
6425
+ export type PriceControllerCreateData = {
6426
+ /**
6427
+ * Region code for tenant context
6428
+ */
6429
+ region: 'cn' | 'us' | 'de' | 'gb';
6430
+ requestBody: CreateBeanPriceDto;
6431
+ };
6432
+
6433
+ export type PriceControllerCreateResponse = PriceResponseDto;
6434
+
6435
+ export type PriceControllerFindAllData = {
6436
+ /**
6437
+ * Filter by currency (e.g., BTC, AAPL, USD)
6438
+ */
6439
+ currency?: string;
6440
+ /**
6441
+ * Filter prices from this date (ISO 8601 format)
6442
+ */
6443
+ dateFrom?: string;
6444
+ /**
6445
+ * Filter prices to this date (ISO 8601 format)
6446
+ */
6447
+ dateTo?: string;
6448
+ /**
6449
+ * Number of items per page (default: 20, max: 100)
6450
+ */
6451
+ limit?: number;
6452
+ /**
6453
+ * Page number for pagination (default: 1)
6454
+ */
6455
+ page?: number;
6456
+ /**
6457
+ * Filter by quote currency (pricing currency, e.g., USD, CNY)
6458
+ */
6459
+ quoteCurrency?: string;
6460
+ /**
6461
+ * Region code for tenant context
6462
+ */
6463
+ region: 'cn' | 'us' | 'de' | 'gb';
6464
+ /**
6465
+ * Search term for currency or quoteCurrency (case-insensitive partial match)
6466
+ */
6467
+ search?: string;
6468
+ };
6469
+
6470
+ export type PriceControllerFindAllResponse = PriceListResponseDto;
6471
+
6472
+ export type PriceControllerFindOneData = {
6473
+ /**
6474
+ * Price ID
6475
+ */
6476
+ id: string;
6477
+ /**
6478
+ * Region code for tenant context
6479
+ */
6480
+ region: 'cn' | 'us' | 'de' | 'gb';
6481
+ };
6482
+
6483
+ export type PriceControllerFindOneResponse = PriceResponseDto;
6484
+
6485
+ export type PriceControllerUpdateData = {
6486
+ /**
6487
+ * Price ID
6488
+ */
6489
+ id: string;
6490
+ /**
6491
+ * Region code for tenant context
6492
+ */
6493
+ region: 'cn' | 'us' | 'de' | 'gb';
6494
+ requestBody: UpdateBeanPriceDto;
6495
+ };
6496
+
6497
+ export type PriceControllerUpdateResponse = PriceResponseDto;
6498
+
6499
+ export type PriceControllerDeleteData = {
6500
+ /**
6501
+ * Price ID
6502
+ */
6503
+ id: string;
6504
+ /**
6505
+ * Region code for tenant context
6506
+ */
6507
+ region: 'cn' | 'us' | 'de' | 'gb';
6508
+ };
6509
+
6510
+ export type PriceControllerDeleteResponse = void;
6511
+
6512
+ export type PriceControllerBulkCreateData = {
6513
+ /**
6514
+ * Region code for tenant context
6515
+ */
6516
+ region: 'cn' | 'us' | 'de' | 'gb';
6517
+ requestBody: Array<string>;
6518
+ };
6519
+
6520
+ export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
6521
+
5851
6522
  export type ReportingControllerGetPortfolioTrendsData = {
5852
6523
  /**
5853
6524
  * Data granularity
@@ -6141,6 +6812,29 @@ export type $OpenApiTs = {
6141
6812
  };
6142
6813
  };
6143
6814
  };
6815
+ '/api/v1/{region}/bean/transactions/{id}/correct': {
6816
+ post: {
6817
+ req: TransactionControllerCorrectData;
6818
+ res: {
6819
+ /**
6820
+ * Corrected transaction created
6821
+ */
6822
+ 201: TransactionDetailDto;
6823
+ /**
6824
+ * Original transaction not found
6825
+ */
6826
+ 404: ApiProblemResponseDto;
6827
+ /**
6828
+ * Original no longer ACTIVE (concurrent modification)
6829
+ */
6830
+ 409: ApiProblemResponseDto;
6831
+ /**
6832
+ * Pipeline validation failed (does not balance, invalid accounts)
6833
+ */
6834
+ 422: ApiProblemResponseDto;
6835
+ };
6836
+ };
6837
+ };
6144
6838
  '/api/v1/{region}/bean/transactions/tags': {
6145
6839
  get: {
6146
6840
  req: TransactionControllerSuggestTagsData;
@@ -7564,6 +8258,32 @@ export type $OpenApiTs = {
7564
8258
  };
7565
8259
  };
7566
8260
  };
8261
+ '/api/v1/{region}/bean/import/parser-coverage-miss': {
8262
+ post: {
8263
+ req: TelemetryControllerReportCoverageMissData;
8264
+ res: {
8265
+ /**
8266
+ * Coverage miss report received
8267
+ */
8268
+ 200: unknown;
8269
+ /**
8270
+ * Unauthorized
8271
+ */
8272
+ 401: unknown;
8273
+ };
8274
+ };
8275
+ };
8276
+ '/api/v1/{region}/bean/import/parser-coverage-metrics': {
8277
+ get: {
8278
+ req: TelemetryControllerGetCoverageMetricsData;
8279
+ res: {
8280
+ /**
8281
+ * Coverage metrics
8282
+ */
8283
+ 200: unknown;
8284
+ };
8285
+ };
8286
+ };
7567
8287
  '/api/v1/{region}/bean/nlp/process': {
7568
8288
  post: {
7569
8289
  req: NlpControllerProcessNaturalLanguageData;
@@ -7633,7 +8353,10 @@ export type $OpenApiTs = {
7633
8353
  /**
7634
8354
  * Accounts retrieved successfully. Response type depends on groupBy parameter.
7635
8355
  */
7636
- 200: AccountsResponseDto | AssetClassAccountsResponseDto;
8356
+ 200:
8357
+ | AccountsResponseDto
8358
+ | AssetClassAccountsResponseDto
8359
+ | HoldingAssetClassCrossAccountResponseDto;
7637
8360
  /**
7638
8361
  * User not authenticated
7639
8362
  */
@@ -7660,6 +8383,109 @@ export type $OpenApiTs = {
7660
8383
  };
7661
8384
  };
7662
8385
  };
8386
+ '/api/v1/{region}/investment/holdings/pnl': {
8387
+ get: {
8388
+ req: HoldingPnlControllerGetHoldingPnlData;
8389
+ res: {
8390
+ /**
8391
+ * Holding P&L retrieved successfully
8392
+ */
8393
+ 200: HoldingPnlResponseDto;
8394
+ /**
8395
+ * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
8396
+ */
8397
+ 400: unknown;
8398
+ /**
8399
+ * User not authenticated
8400
+ */
8401
+ 401: unknown;
8402
+ };
8403
+ };
8404
+ };
8405
+ '/api/v1/{region}/bean/prices': {
8406
+ post: {
8407
+ req: PriceControllerCreateData;
8408
+ res: {
8409
+ /**
8410
+ * Price created successfully
8411
+ */
8412
+ 201: PriceResponseDto;
8413
+ /**
8414
+ * Currency or quoteCurrency commodity not found
8415
+ */
8416
+ 404: unknown;
8417
+ /**
8418
+ * Price already exists for this currency pair and date
8419
+ */
8420
+ 409: unknown;
8421
+ };
8422
+ };
8423
+ get: {
8424
+ req: PriceControllerFindAllData;
8425
+ res: {
8426
+ /**
8427
+ * Prices retrieved successfully
8428
+ */
8429
+ 200: PriceListResponseDto;
8430
+ };
8431
+ };
8432
+ };
8433
+ '/api/v1/{region}/bean/prices/{id}': {
8434
+ get: {
8435
+ req: PriceControllerFindOneData;
8436
+ res: {
8437
+ /**
8438
+ * Price retrieved successfully
8439
+ */
8440
+ 200: PriceResponseDto;
8441
+ /**
8442
+ * Price not found
8443
+ */
8444
+ 404: unknown;
8445
+ };
8446
+ };
8447
+ put: {
8448
+ req: PriceControllerUpdateData;
8449
+ res: {
8450
+ /**
8451
+ * Price updated successfully
8452
+ */
8453
+ 200: PriceResponseDto;
8454
+ /**
8455
+ * Price not found
8456
+ */
8457
+ 404: unknown;
8458
+ /**
8459
+ * Updated price conflicts with existing price
8460
+ */
8461
+ 409: unknown;
8462
+ };
8463
+ };
8464
+ delete: {
8465
+ req: PriceControllerDeleteData;
8466
+ res: {
8467
+ /**
8468
+ * Price deleted successfully
8469
+ */
8470
+ 204: void;
8471
+ /**
8472
+ * Price not found
8473
+ */
8474
+ 404: unknown;
8475
+ };
8476
+ };
8477
+ };
8478
+ '/api/v1/{region}/bean/prices/bulk': {
8479
+ post: {
8480
+ req: PriceControllerBulkCreateData;
8481
+ res: {
8482
+ /**
8483
+ * Prices created successfully
8484
+ */
8485
+ 201: Array<PriceResponseDto>;
8486
+ };
8487
+ };
8488
+ };
7663
8489
  '/api/v1/{region}/reporting/portfolio/trends': {
7664
8490
  get: {
7665
8491
  req: ReportingControllerGetPortfolioTrendsData;