@sixtyninecommerce/admin 0.11.0 → 0.13.0

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.
Files changed (153) hide show
  1. package/README.md +1509 -28
  2. package/dist/auth/index.d.ts +7 -1
  3. package/dist/auth/index.js +8 -1
  4. package/dist/catalog/documents.d.ts +142 -0
  5. package/dist/catalog/documents.js +114 -0
  6. package/dist/catalog/index.d.ts +48 -7
  7. package/dist/catalog/index.js +6 -1
  8. package/dist/catalog/metadata.d.ts +244 -0
  9. package/dist/catalog/metadata.js +220 -0
  10. package/dist/catalog/properties.d.ts +38 -0
  11. package/dist/catalog/properties.js +52 -1
  12. package/dist/catalog/recommendations.d.ts +33 -6
  13. package/dist/catalog/recommendations.js +94 -2
  14. package/dist/catalog/reviews.d.ts +17 -4
  15. package/dist/catalog/reviews.js +7 -0
  16. package/dist/catalog/variants.d.ts +60 -0
  17. package/dist/catalog/variants.js +39 -0
  18. package/dist/catalog/visibility.d.ts +18 -2
  19. package/dist/client.d.ts +29 -3
  20. package/dist/client.js +19 -8
  21. package/dist/content/assets.d.ts +3 -4
  22. package/dist/content/forms.d.ts +332 -1
  23. package/dist/content/forms.js +140 -4
  24. package/dist/content/items.d.ts +31 -8
  25. package/dist/content/items.js +1 -1
  26. package/dist/content/menus.d.ts +254 -0
  27. package/dist/content/menus.js +70 -0
  28. package/dist/content/strings.d.ts +137 -0
  29. package/dist/content/strings.js +82 -0
  30. package/dist/customers/delivery-terms.d.ts +44 -0
  31. package/dist/customers/delivery-terms.js +32 -0
  32. package/dist/customers/groups.d.ts +16 -5
  33. package/dist/customers/groups.js +6 -2
  34. package/dist/customers/index.d.ts +15 -0
  35. package/dist/customers/index.js +4 -0
  36. package/dist/documents/emails.d.ts +154 -0
  37. package/dist/documents/emails.js +220 -0
  38. package/dist/documents/index.d.ts +13 -0
  39. package/dist/documents/index.js +2 -0
  40. package/dist/fulfillments/create.d.ts +1 -1
  41. package/dist/fulfillments/create.js +5 -2
  42. package/dist/fulfillments/index.d.ts +119 -1
  43. package/dist/fulfillments/index.js +124 -4
  44. package/dist/fulfillments/warehouse.d.ts +29 -17
  45. package/dist/fulfillments/warehouse.js +32 -1
  46. package/dist/index.d.ts +43 -23
  47. package/dist/index.js +11 -5
  48. package/dist/integrations/exact-online-types.d.ts +542 -0
  49. package/dist/integrations/exact-online.d.ts +541 -5
  50. package/dist/integrations/exact-online.js +714 -1
  51. package/dist/integrations/index.d.ts +23 -8
  52. package/dist/integrations/index.js +9 -4
  53. package/dist/integrations/pipeline-discoveries.d.ts +65 -0
  54. package/dist/integrations/pipeline-discoveries.js +65 -0
  55. package/dist/integrations/pipeline-runs.d.ts +119 -0
  56. package/dist/integrations/pipeline-runs.js +87 -0
  57. package/dist/integrations/pipelines.d.ts +73 -2
  58. package/dist/integrations/pipelines.js +36 -1
  59. package/dist/integrations/price-import.d.ts +223 -0
  60. package/dist/integrations/price-import.js +124 -0
  61. package/dist/integrations/types.d.ts +221 -3
  62. package/dist/integrations/types.js +4 -3
  63. package/dist/meta/index.d.ts +10 -0
  64. package/dist/metafields/index.d.ts +8 -1
  65. package/dist/metafields/index.js +10 -0
  66. package/dist/orders/cancel-with-money.d.ts +10 -0
  67. package/dist/orders/cancel-with-money.js +2 -0
  68. package/dist/orders/commit-edit.d.ts +16 -0
  69. package/dist/orders/commit-edit.js +14 -1
  70. package/dist/orders/deposit-policy.d.ts +3 -1
  71. package/dist/orders/index.d.ts +22 -11
  72. package/dist/orders/index.js +5 -2
  73. package/dist/orders/list.d.ts +26 -5
  74. package/dist/orders/list.js +123 -13
  75. package/dist/orders/manual-discounts.d.ts +13 -5
  76. package/dist/orders/money-view.d.ts +149 -0
  77. package/dist/orders/money-view.js +99 -0
  78. package/dist/orders/plan-edit.d.ts +34 -2
  79. package/dist/orders/plan-edit.js +110 -12
  80. package/dist/orders/surcharges.d.ts +12 -0
  81. package/dist/orders/surcharges.js +34 -9
  82. package/dist/payments/account-credit.d.ts +17 -1
  83. package/dist/payments/account-credit.js +25 -2
  84. package/dist/payments/credit-noted-fields.d.ts +8 -1
  85. package/dist/payments/credit-noted-fields.js +34 -2
  86. package/dist/payments/customer-consent.d.ts +30 -0
  87. package/dist/payments/customer-consent.js +49 -0
  88. package/dist/payments/index.d.ts +89 -14
  89. package/dist/payments/index.js +22 -2
  90. package/dist/payments/requests.d.ts +6 -3
  91. package/dist/payments/requests.js +1 -0
  92. package/dist/pickups/index.d.ts +5 -3
  93. package/dist/pickups/index.js +5 -2
  94. package/dist/platform/email-gateways.d.ts +165 -0
  95. package/dist/platform/email-gateways.js +78 -0
  96. package/dist/platform/tax.d.ts +11 -3
  97. package/dist/platform/tax.js +30 -0
  98. package/dist/pos/exchanges.d.ts +6 -1
  99. package/dist/pos/index.d.ts +229 -10
  100. package/dist/pos/index.js +113 -4
  101. package/dist/pos/offline-sales.d.ts +44 -3
  102. package/dist/pos/offline-sales.js +57 -3
  103. package/dist/pos/returns.d.ts +28 -1
  104. package/dist/pos/returns.js +36 -6
  105. package/dist/pricing/price-lists.d.ts +3 -1
  106. package/dist/purchasing/alerts.d.ts +19 -4
  107. package/dist/purchasing/alerts.js +29 -3
  108. package/dist/purchasing/backorders.d.ts +61 -0
  109. package/dist/purchasing/backorders.js +92 -0
  110. package/dist/purchasing/index.d.ts +21 -3
  111. package/dist/purchasing/index.js +8 -0
  112. package/dist/purchasing/links.d.ts +263 -0
  113. package/dist/purchasing/links.js +192 -0
  114. package/dist/purchasing/purchase-orders.d.ts +4 -1
  115. package/dist/purchasing/receipts.d.ts +396 -0
  116. package/dist/purchasing/receipts.js +287 -0
  117. package/dist/purchasing/returns.d.ts +273 -0
  118. package/dist/purchasing/returns.js +229 -0
  119. package/dist/quotes/index.d.ts +20 -3
  120. package/dist/returns/index.d.ts +62 -1
  121. package/dist/returns/index.js +61 -0
  122. package/dist/seo/config.d.ts +128 -0
  123. package/dist/seo/config.js +95 -0
  124. package/dist/seo/redirects.d.ts +125 -0
  125. package/dist/seo/redirects.js +60 -1
  126. package/dist/seo/settings.d.ts +147 -0
  127. package/dist/seo/settings.js +209 -0
  128. package/dist/shipping/index.d.ts +6 -0
  129. package/dist/shipping/index.js +2 -0
  130. package/dist/shipping/methods.d.ts +8 -1
  131. package/dist/shipping/myparcel.d.ts +415 -1
  132. package/dist/shipping/myparcel.js +291 -3
  133. package/dist/shipping/rate-tables.d.ts +149 -4
  134. package/dist/shipping/rate-tables.js +229 -23
  135. package/dist/shipping/ship-to-countries.d.ts +75 -0
  136. package/dist/shipping/ship-to-countries.js +47 -0
  137. package/dist/stock/by-location.d.ts +86 -0
  138. package/dist/stock/by-location.js +94 -0
  139. package/dist/stock/index.d.ts +8 -1
  140. package/dist/stock/index.js +4 -0
  141. package/dist/stock/settings.d.ts +106 -0
  142. package/dist/stock/settings.js +103 -0
  143. package/dist/stock/transfers.d.ts +171 -10
  144. package/dist/stock/transfers.js +82 -4
  145. package/dist/stored-value/index.d.ts +98 -7
  146. package/dist/stored-value/index.js +71 -4
  147. package/dist/tax/display-policy.d.ts +105 -0
  148. package/dist/tax/display-policy.js +84 -0
  149. package/dist/tax/index.d.ts +3 -0
  150. package/dist/tax/index.js +2 -0
  151. package/dist/tenant/email-templates.d.ts +222 -1
  152. package/dist/tenant/email-templates.js +227 -10
  153. package/package.json +2 -2
@@ -421,3 +421,545 @@ export interface ExactSyncEstimate {
421
421
  /** A budget is set (above 0) and `total` exceeds it. */
422
422
  overBudget: boolean;
423
423
  }
424
+ /** Per-reason count of the items one catalogue run kept out of the storefront. */
425
+ export interface ExactCatalogueExclusionCounts {
426
+ /**
427
+ * Items outside their Exact active window (end date passed, or start date still ahead). Always
428
+ * applied, not a policy control; null on rows recorded before the rule existed.
429
+ */
430
+ inactive: number | null;
431
+ /** Items whose Exact webshop flag is off (counted only while `requireWebshopFlag` is on). */
432
+ notWebshop: number;
433
+ /** Non-stock items the `nonStockItems` policy kept out. */
434
+ nonStock: number;
435
+ /** Items with no usable default-currency sales price the `unpricedItems` policy kept out. */
436
+ unpriced: number;
437
+ /** Every excluded item: the reasons above are exclusive and sum to it. `absent` is not in it. */
438
+ total: number;
439
+ /**
440
+ * Items the store holds that the run's Exact read did not return at all (deleted in Exact, or
441
+ * no longer a sales item), which the run disabled. Null when the reverse pass did not run (the
442
+ * read could not be proven complete, or the row predates the pass): NOT the same as 0.
443
+ */
444
+ absent: number | null;
445
+ }
446
+ /** One run of an inbound (Exact → platform) sync, as the sync log recorded it. */
447
+ export interface ExactOnlineSyncLogEntry {
448
+ id: string;
449
+ /** What the run read or wrote: `items`, `prices`, `stock`, `pictures`, `customers`, `orders`, … */
450
+ entity: string;
451
+ /** How it started: `seed`, `delta`, `manual`, `scheduled` or `webhook`. */
452
+ mode: string;
453
+ /** `success`, `partial` or `failed`; any other value is a warning. */
454
+ status: string;
455
+ createdCount: number;
456
+ updatedCount: number;
457
+ skippedCount: number;
458
+ failedCount: number;
459
+ /** Pictures withdrawn from products by this run; only ever above 0 on `pictures` rows. */
460
+ detachedCount: number;
461
+ /** The run's failure in the engine's words (secrets scrubbed); null for a clean run. */
462
+ error: string | null;
463
+ durationMs: number | null;
464
+ /** ISO-8601 UTC. */
465
+ createdAt: string;
466
+ /** The catalogue import policy's exclusions; only ever set on `items` rows. */
467
+ catalogueExclusions: ExactCatalogueExclusionCounts | null;
468
+ }
469
+ /** How the newest real run of one inbound area ended. */
470
+ export interface ExactOnlineSyncRunSummary {
471
+ /** When that run was logged; for the catalogue, when its sweep started. ISO-8601 UTC. */
472
+ lastRunAt: string;
473
+ /** `success`, `partial`, `failed` or `warning`. */
474
+ status: string;
475
+ error: string | null;
476
+ /** When the area last ran clean; null when no clean run is known. */
477
+ lastSuccessAt: string | null;
478
+ }
479
+ /**
480
+ * How the newest real run of each inbound area ended, read from the sync log. The schedule's
481
+ * `*LastEnqueuedAt` times say only that a run was QUEUED, whether or not it then failed. An area
482
+ * that never ran (or a store that is not connected) is null.
483
+ */
484
+ export interface ExactOnlineSyncHealth {
485
+ /** The newest customer synchronization that was not a webhook read of one Account. */
486
+ customers: ExactOnlineSyncRunSummary | null;
487
+ /** The newest catalogue sweep (warehouses, items, stock): the worst of its steps. */
488
+ catalogue: ExactOnlineSyncRunSummary | null;
489
+ /** The newest inbound order synchronization. */
490
+ orders: ExactOnlineSyncRunSummary | null;
491
+ }
492
+ /** What {@link ExactOnlineSyncModule.logs} reads. */
493
+ export interface ExactOnlineSyncLogOptions {
494
+ /** One entity's runs only (`items`, `pictures`, `price-lists`, …); every entity's otherwise. */
495
+ entity?: string;
496
+ /** How many of the newest runs: a whole number from 1 to 100; 20 when left out. */
497
+ limit?: number;
498
+ }
499
+ /** One Exact Sync API cursor (watermark) of the store, by entity stream. */
500
+ export interface ExactSyncCursor {
501
+ /** The entity stream: `items`, `stock`, `salesOrders`, `accounts`, … */
502
+ entity: string;
503
+ /** Opaque; null when the stream never advanced. */
504
+ cursor: string | null;
505
+ }
506
+ /** A stock location of the store and the Exact warehouse it mirrors (read-only). */
507
+ export interface ExactWarehouseLink {
508
+ stockLocationId: string;
509
+ stockLocationName: string;
510
+ /** The Exact warehouse GUID; null while the location is not linked. */
511
+ exactWarehouseId: string | null;
512
+ }
513
+ /** A platform shipping method's Exact mapping, live against the store's Exact catalogue. */
514
+ export type ExactShippingMethodStatus = 'mapped' | 'unmapped' | 'exact-missing';
515
+ /** One platform shipping method of the store, joined to its Exact mapping. */
516
+ export interface ExactShippingMethodMapping {
517
+ vendureShippingMethodId: string;
518
+ vendureCode: string;
519
+ vendureName: string;
520
+ /** The Exact shipping method (GUID) it maps to; null when unmapped. */
521
+ exactShippingMethodId: string | null;
522
+ /** Exact created it (Activated) and owns its name and rate; only these convert or retire. */
523
+ exactManaged: boolean;
524
+ /** `exact-missing`: the mapped Exact method is no longer active or current in Exact. */
525
+ status: ExactShippingMethodStatus;
526
+ }
527
+ /** One shipping method of the store's synchronized Exact catalogue. */
528
+ export interface ExactShippingMethodPreview {
529
+ /** The Exact GUID. */
530
+ id: string;
531
+ code: string | null;
532
+ description: string | null;
533
+ /** Active in Exact and current in the synchronized catalogue: only these can be activated. */
534
+ active: boolean;
535
+ /** Exact's flat rate in major units; null when Exact defines none (never free shipping). */
536
+ amount: number | null;
537
+ /** A platform method of the store already maps to it. */
538
+ linked: boolean;
539
+ }
540
+ /** The store's shipping methods joined to Exact, and its synchronized Exact catalogue. */
541
+ export interface ExactShippingMethodsView {
542
+ mappings: ExactShippingMethodMapping[];
543
+ exact: ExactShippingMethodPreview[];
544
+ }
545
+ export interface SetExactShippingMethodMappingInput {
546
+ /** A shipping method of the store. */
547
+ vendureShippingMethodId: string;
548
+ /** The Exact method to map it to; null clears the mapping. */
549
+ exactShippingMethodId: string | null;
550
+ }
551
+ export interface ConvertExactShippingMethodInput {
552
+ /** The Activated Exact method whose imported platform method is retired. */
553
+ exactShippingMethodId: string;
554
+ /** The store's own platform method (not Exact-managed) the mapping moves to. */
555
+ vendureShippingMethodId: string;
556
+ }
557
+ /** Which Exact connection log: the API calls, or the sync and lifecycle events. */
558
+ export type ExactOnlineConnectionLogKind = 'calls' | 'events';
559
+ /**
560
+ * The dates of an Exact connection-log filter: inclusive ISO-8601. Pass an explicit offset
561
+ * (`2026-10-14T00:00:00+02:00`): the service pins only a bare `dateTo` (`2026-10-14` reads as
562
+ * the end of that UTC day); any other value without an offset, a bare `dateFrom` included, is
563
+ * read in the audit database's session time zone.
564
+ */
565
+ export interface ExactOnlineConnectionLogDates {
566
+ dateFrom?: string;
567
+ dateTo?: string;
568
+ }
569
+ /** Filters for {@link ExactOnlineConnectionLogsModule.calls}. */
570
+ export interface ExactOnlineConnectionLogCallFilter extends ExactOnlineConnectionLogDates {
571
+ /** `succeeded`, `failed` or `timeout`. */
572
+ outcome?: string;
573
+ /** The real HTTP status Exact answered. */
574
+ statusCode?: number;
575
+ /** Free text over the operation, the error and the remote reference. */
576
+ q?: string;
577
+ }
578
+ /** Filters for {@link ExactOnlineConnectionLogsModule.events}. */
579
+ export interface ExactOnlineConnectionLogEventFilter extends ExactOnlineConnectionLogDates {
580
+ /** `admin_action`, `integration`, `job`, `webhook`, `system`, … */
581
+ category?: string;
582
+ /** `succeeded`, `failed`, `partial`, `skipped` or `rejected`. */
583
+ outcome?: string;
584
+ /** Free text over the action, the target label, the error detail and the actor label. */
585
+ q?: string;
586
+ }
587
+ /** An export's filter: one log's filters, over a bounded range of at most 366 days. */
588
+ export type ExactOnlineConnectionLogExportFilter = (ExactOnlineConnectionLogCallFilter | ExactOnlineConnectionLogEventFilter) & {
589
+ dateFrom: string;
590
+ dateTo: string;
591
+ };
592
+ /** How a mirrored payment condition is due. */
593
+ export type ExactPaymentConditionClassification = 'single_due_date' | 'complex' | 'unresolved' | 'unassigned';
594
+ /** A payment condition mirrored from the connected Exact division. */
595
+ export interface ExactPaymentCondition {
596
+ exactId: string;
597
+ code: string;
598
+ description: string | null;
599
+ /** The condition in a sentence. */
600
+ summary: string;
601
+ classification: ExactPaymentConditionClassification;
602
+ paymentDays: number | null;
603
+ paymentEndOfMonths: number | null;
604
+ paymentMethod: string | null;
605
+ percentage: number | null;
606
+ discountPaymentDays: number | null;
607
+ discountPercentage: number | null;
608
+ paymentDiscountType: string | null;
609
+ active: boolean;
610
+ /** ISO-8601, UTC. */
611
+ syncedAt: string;
612
+ }
613
+ /** How many customers hold one payment condition. */
614
+ export interface ExactPaymentConditionDistribution {
615
+ code: string;
616
+ description: string | null;
617
+ customerCount: number;
618
+ }
619
+ /** A condition code customers hold that the mirrored catalog does not know. */
620
+ export interface ExactUnresolvedPaymentCondition {
621
+ code: string;
622
+ customerCount: number;
623
+ }
624
+ /** How the newest payment-terms reconcile went. */
625
+ export interface ExactPaymentTermsSyncSummary {
626
+ mode: string;
627
+ status: string;
628
+ createdCount: number;
629
+ updatedCount: number;
630
+ deactivatedCount: number;
631
+ failedCount: number;
632
+ /** ISO-8601, UTC. */
633
+ at: string;
634
+ error: string | null;
635
+ }
636
+ /** Coverage and freshness of the Exact Account → payment-condition mirror. */
637
+ export interface ExactPaymentTermsDiagnostics {
638
+ totalCustomers: number;
639
+ assignedCount: number;
640
+ unassignedCount: number;
641
+ unresolvedCount: number;
642
+ staleCount: number;
643
+ lastSyncedAt: string | null;
644
+ error: string | null;
645
+ permissionWarning: boolean;
646
+ distribution: ExactPaymentConditionDistribution[];
647
+ unresolvedCodes: ExactUnresolvedPaymentCondition[];
648
+ lastReconciliation: ExactPaymentTermsSyncSummary | null;
649
+ }
650
+ /** One Exact read a dry run made, and whether it worked. */
651
+ export interface ExactTermsDryRunResource {
652
+ resource: string;
653
+ ok: boolean;
654
+ permissionWarning: boolean;
655
+ error: string | null;
656
+ }
657
+ /** A condition code the dry run found duplicated, or not representable as one due date. */
658
+ export interface ExactPaymentTermsDryRunCondition {
659
+ code: string;
660
+ description: string | null;
661
+ summary: string;
662
+ classification: 'single_due_date' | 'complex';
663
+ scheduleCount: number;
664
+ }
665
+ /** An Exact Account whose payment condition the platform could not take over. */
666
+ export interface ExactPaymentTermsDryRunAssignmentIssue {
667
+ accountId: string;
668
+ accountCode: string | null;
669
+ conditionCode: string | null;
670
+ conditionDescription: string | null;
671
+ status: 'unassigned' | 'unresolved' | 'unchecked';
672
+ }
673
+ /** A live, read-only reconciliation of the division's payment conditions. */
674
+ export interface ExactPaymentTermsDryRun {
675
+ division: string;
676
+ /** ISO-8601, UTC. */
677
+ generatedAt: string;
678
+ /** False when a read stopped early: the counts are then a lower bound. */
679
+ complete: boolean;
680
+ permissionWarning: boolean;
681
+ catalogRowCount: number;
682
+ catalogCodeCount: number;
683
+ accountCount: number;
684
+ assignedCount: number;
685
+ unassignedCount: number;
686
+ unresolvedCount: number;
687
+ uncheckedCount: number;
688
+ distribution: ExactPaymentConditionDistribution[];
689
+ duplicateConditions: ExactPaymentTermsDryRunCondition[];
690
+ complexConditions: ExactPaymentTermsDryRunCondition[];
691
+ unresolvedCodes: ExactUnresolvedPaymentCondition[];
692
+ assignmentIssues: ExactPaymentTermsDryRunAssignmentIssue[];
693
+ resources: ExactTermsDryRunResource[];
694
+ }
695
+ /** An Incoterm of the division's mirrored catalog. */
696
+ export interface ExactIncoterm {
697
+ exactId: number;
698
+ code: string;
699
+ version: number;
700
+ description: string | null;
701
+ catalogAvailable: boolean;
702
+ stale: boolean;
703
+ lastSyncedAt: string | null;
704
+ error: string | null;
705
+ }
706
+ /**
707
+ * Whether a customer synchronization has ever mirrored Account delivery assignments on this
708
+ * division. `never`: the operational switch cannot be saved yet (readiness needs one success).
709
+ */
710
+ export type ExactDeliveryTermsAccountSyncStatus = 'never' | 'succeeded' | 'failed';
711
+ /** How many customers hold one Exact shipping method. */
712
+ export interface ExactDeliveryTermsShippingDistribution {
713
+ exactId: string;
714
+ code: string | null;
715
+ description: string | null;
716
+ customerCount: number;
717
+ }
718
+ /** How many customers hold one Incoterm. */
719
+ export interface ExactDeliveryTermsIncotermDistribution {
720
+ code: string;
721
+ version: number | null;
722
+ description: string | null;
723
+ customerCount: number;
724
+ }
725
+ /** Coverage and freshness of the Exact Account delivery assignments, and the method mapping. */
726
+ export interface ExactDeliveryTermsDiagnostics {
727
+ reconciliationRequired: boolean;
728
+ accountSyncStatus: ExactDeliveryTermsAccountSyncStatus;
729
+ totalCustomers: number;
730
+ assignedCount: number;
731
+ unassignedCount: number;
732
+ unresolvedCount: number;
733
+ staleCount: number;
734
+ mappedMethodCount: number;
735
+ /** Mappings that also pass the operational readiness check (it rejects stale definitions). */
736
+ usableShippingMappingCount: number;
737
+ unmappedMethodCount: number;
738
+ inactiveMethodCount: number;
739
+ unavailableMethodCount: number;
740
+ nullAmountCount: number;
741
+ invalidIncotermCount: number;
742
+ lastSyncedAt: string | null;
743
+ error: string | null;
744
+ permissionWarning: boolean;
745
+ shippingMethodDistribution: ExactDeliveryTermsShippingDistribution[];
746
+ incotermDistribution: ExactDeliveryTermsIncotermDistribution[];
747
+ warnings: string[];
748
+ }
749
+ /** An Exact Account whose delivery assignment the platform could not take over. */
750
+ export interface ExactDeliveryTermsDryRunIssue {
751
+ accountId: string;
752
+ accountCode: string | null;
753
+ shippingMethodId: string | null;
754
+ incotermCode: string | null;
755
+ incotermVersion: number | null;
756
+ status: 'unassigned_shipping' | 'unresolved_shipping' | 'unmapped_shipping' | 'unresolved_incoterm' | 'invalid_policy' | 'unchecked';
757
+ message: string;
758
+ }
759
+ /** A live, read-only reconciliation of the division's delivery assignments. */
760
+ export interface ExactDeliveryTermsDryRun {
761
+ division: string;
762
+ /** ISO-8601, UTC. */
763
+ generatedAt: string;
764
+ /** False when a read stopped early: the counts are then a lower bound. */
765
+ complete: boolean;
766
+ permissionWarning: boolean;
767
+ shippingMethodCount: number;
768
+ activeShippingMethodCount: number;
769
+ mappingCount: number;
770
+ unmappedCatalogMethodCount: number;
771
+ nullAmountCount: number;
772
+ zeroAmountCount: number;
773
+ incotermCount: number;
774
+ accountCount: number;
775
+ assignedShippingMethodCount: number;
776
+ mappedAssignedShippingMethodCount: number;
777
+ unmappedAssignedShippingMethodCount: number;
778
+ unassignedShippingMethodCount: number;
779
+ unresolvedShippingMethodCount: number;
780
+ assignedIncotermCount: number;
781
+ unassignedIncotermCount: number;
782
+ unresolvedIncotermCount: number;
783
+ invalidPolicyCount: number;
784
+ shippingMethodDistribution: Array<{
785
+ exactId: string;
786
+ customerCount: number;
787
+ }>;
788
+ incotermDistribution: Array<{
789
+ code: string;
790
+ version: number | null;
791
+ customerCount: number;
792
+ }>;
793
+ assignmentIssues: ExactDeliveryTermsDryRunIssue[];
794
+ resources: ExactTermsDryRunResource[];
795
+ }
796
+ /**
797
+ * One customer's Exact payment terms as the engine answers them. `status` and `classification`
798
+ * are the engine's own spelling (lowercase: `assigned`, `single_due_date`, …), not the
799
+ * uppercase enums of the provider-neutral `customers.credit.paymentTerms`.
800
+ */
801
+ export interface ExactCustomerPaymentTerms {
802
+ customerId: string;
803
+ /** `exact-online`. */
804
+ source: string;
805
+ /** Exact governs the customer's terms; false while the mirror is only staged. */
806
+ managedExternally: boolean;
807
+ /** The customer is linked to an Exact Account. */
808
+ linkedExternally: boolean;
809
+ status: string;
810
+ stale: boolean;
811
+ exactAccountId: string | null;
812
+ exactAccountCode: string | null;
813
+ conditionCode: string | null;
814
+ conditionDescription: string | null;
815
+ /** The terms in a sentence. */
816
+ summary: string;
817
+ classification: string;
818
+ paymentDays: number | null;
819
+ paymentEndOfMonths: number | null;
820
+ paymentMethod: string | null;
821
+ percentage: number | null;
822
+ discountPaymentDays: number | null;
823
+ discountPercentage: number | null;
824
+ paymentDiscountType: string | null;
825
+ /** When Exact last changed the Account's condition. */
826
+ syncedAt: string | null;
827
+ /**
828
+ * When a sync last confirmed these terms against Exact. `syncedAt` only moves when the Account
829
+ * changes there, so it ages on a healthy customer.
830
+ */
831
+ lastCheckedAt: string | null;
832
+ error: string | null;
833
+ }
834
+ /**
835
+ * One customer's Exact delivery assignment as the engine answers it, staged ones included. The
836
+ * statuses and `deliveryAdvice` are the engine's own spelling (lowercase: `assigned`,
837
+ * `partial_allowed`, …).
838
+ */
839
+ export interface ExactCustomerDeliveryTerms {
840
+ customerId: string;
841
+ source: string;
842
+ managedExternally: boolean;
843
+ linkedExternally: boolean;
844
+ status: string;
845
+ shippingMethodStatus: string;
846
+ policyStatus: string;
847
+ summary: string;
848
+ exactAccountId: string | null;
849
+ exactAccountCode: string | null;
850
+ preferredShippingMethodId: string | null;
851
+ preferredShippingMethodCode: string | null;
852
+ preferredShippingMethodName: string | null;
853
+ preferredShippingMethodAvailable: boolean;
854
+ eligibleShippingMethodIds: string[];
855
+ incotermStatus: string;
856
+ incotermCode: string | null;
857
+ incotermVersion: number | null;
858
+ incotermAddress: string | null;
859
+ incotermDescription: string | null;
860
+ shippingLeadDays: number | null;
861
+ deliveryAdvice: string;
862
+ stale: boolean;
863
+ syncedAt: string | null;
864
+ /** As {@link ExactCustomerPaymentTerms.lastCheckedAt}. */
865
+ lastCheckedAt: string | null;
866
+ error: string | null;
867
+ }
868
+ /**
869
+ * Where one customer stands in the Exact → platform price-list reconcile:
870
+ * - `assigned`: in the Exact price-list group, and that group has a price list;
871
+ * - `pending`: Exact says the Account has a price list, not reconciled yet;
872
+ * - `none`: linked to Exact, and the Account has no price list;
873
+ * - `unlinked`: the customer has no Exact Account link.
874
+ */
875
+ export type ExactCustomerPriceListStatus = 'assigned' | 'pending' | 'none' | 'unlinked';
876
+ /** One customer's Exact price-list link: what Exact says against what the store has. */
877
+ export interface ExactCustomerPriceList {
878
+ customerId: string;
879
+ exactAccountId: string | null;
880
+ exactAccountCode: string | null;
881
+ exactPriceListId: string | null;
882
+ /** The customer group mirroring the Exact price list, once reconciled. */
883
+ groupId: string | null;
884
+ groupName: string | null;
885
+ /** The price list attached to that group, once reconciled. */
886
+ priceListId: string | null;
887
+ priceListName: string | null;
888
+ status: ExactCustomerPriceListStatus;
889
+ /** The newest price-list reconcile of the store, whatever it touched. */
890
+ lastReconciledAt: string | null;
891
+ /** That run's error; null when it succeeded or none ran. */
892
+ lastError: string | null;
893
+ }
894
+ /** An order's place in Exact, and what blocks a push. */
895
+ export interface ExactOrderState {
896
+ /** Pushed from this store into the connected division. */
897
+ pushed: boolean;
898
+ /** `pushed` (sent from here), `imported` (came from Exact), or null (not in Exact). */
899
+ origin: 'pushed' | 'imported' | null;
900
+ salesOrderId: string | null;
901
+ salesOrderNumber: string | null;
902
+ pushedAt: string | null;
903
+ /** False for a guest order, which cannot be pushed. */
904
+ hasCustomer: boolean;
905
+ /** The customer is linked to an Exact Account of the connected division. */
906
+ customerLinked: boolean;
907
+ /** Lines whose variant is not linked to an Exact item; a push refuses them. */
908
+ unmappedSkus: string[];
909
+ /** How Exact's sales order differs from this order, in plain words; empty when it matches. */
910
+ warnings: string[];
911
+ }
912
+ /** An imported order's inbound (Exact → platform) sync state. */
913
+ export interface ExactOrderSyncState {
914
+ exactSalesOrderId: string;
915
+ exactOrderNumber: string | null;
916
+ /** How many times the import wrote the order. */
917
+ revision: number;
918
+ lastSyncedAt: string | null;
919
+ /** Exact's order changed in a way the import could not apply. */
920
+ driftDetected: boolean;
921
+ /** When Exact deleted the sales order; null while it exists. */
922
+ exactDeletedAt: string | null;
923
+ unmappedSkus: string[];
924
+ }
925
+ /** What a push answered. A refusal is `success: false` with the reason, not a throw. */
926
+ export interface ExactOrderPushResult {
927
+ success: boolean;
928
+ /** The order was already in Exact: nothing was written. */
929
+ alreadyPushed: boolean;
930
+ salesOrderId: string | null;
931
+ salesOrderNumber: string | null;
932
+ error: string | null;
933
+ errorCode: string | null;
934
+ /** How the sales order the push created differs from the order; null or empty when it matches. */
935
+ warnings: string[] | null;
936
+ }
937
+ /** What repricing one imported order answered. A refusal is `success: false`, not a throw. */
938
+ export interface ExactOrderRepriceResult {
939
+ success: boolean;
940
+ /** Any line's tax split changed. */
941
+ changed: boolean;
942
+ linesRepriced: number;
943
+ error: string | null;
944
+ }
945
+ /** What repricing every imported order of the store answered. */
946
+ export interface ExactOrderRepriceAllResult {
947
+ /** The imported orders of the connected division. */
948
+ total: number;
949
+ repriced: number;
950
+ /** Already right, or no longer linked to an order. */
951
+ skipped: number;
952
+ failed: number;
953
+ }
954
+ /** A product's Exact ownership (what the product editor's "Managed by Exact" banner reads). */
955
+ export interface ExactProductStatus {
956
+ /** Exact owns the product's catalogue data; null on a product the sync never touched. */
957
+ exactManaged: boolean | null;
958
+ exactItemId: string | null;
959
+ exactItemGroupId: string | null;
960
+ /**
961
+ * The catalogue sync's signature on a disable: set, the sync switched the product off and
962
+ * owns switching it back on; null, a human did (or it is enabled). Never write it back.
963
+ */
964
+ exactDisabledReason: string | null;
965
+ }