@optizio/merchant-identity 0.7.1 → 0.9.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 (2) hide show
  1. package/dist/index.d.ts +96 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -702,12 +702,37 @@ export interface AffiliateImportBatchInput {
702
702
  idempotencyKey: string;
703
703
  actorId: string;
704
704
  }
705
+ /** Validate a staged import without resolving or activating it. */
706
+ export interface AffiliateImportValidationInput {
707
+ batchId: string;
708
+ idempotencyKey: string;
709
+ actorId: string;
710
+ }
705
711
  /** Activate a validated import; partial data must not leak into balances. */
706
712
  export interface AffiliateImportActivateInput {
707
713
  batchId: string;
708
714
  idempotencyKey: string;
709
715
  actorId: string;
710
716
  }
717
+ /** Activate the one reviewed Shoffi production opening-balance batch. */
718
+ export interface AffiliateOpeningBalanceActivationInput {
719
+ batchId: string;
720
+ idempotencyKey: string;
721
+ actorId: string;
722
+ }
723
+ export interface AffiliateOpeningBalanceActivationResult {
724
+ records: number;
725
+ amountMinor: number;
726
+ }
727
+ /** Move only active referrals to the approved post-revocation accrual boundary. */
728
+ export interface AffiliateAccrualBoundaryMoveInput {
729
+ idempotencyKey: string;
730
+ actorId: string;
731
+ }
732
+ export interface AffiliateAccrualBoundaryMoveResult {
733
+ moved: number;
734
+ accrualFrom: string;
735
+ }
711
736
  /** Explicitly map one source record to a canonical entity. */
712
737
  export interface AffiliateImportResolveInput {
713
738
  sourceRecordId: string;
@@ -916,6 +941,7 @@ export interface AffiliateAdminClient {
916
941
  seedRelationship(input: AffiliateRelationshipSeedInput): Promise<AffiliateRelationshipSeedResult>;
917
942
  stageImportBatch(input: AffiliateImportBatchInput): Promise<{
918
943
  batchId: string;
944
+ sourceRecords: number;
919
945
  }>;
920
946
  validateImport(id: string): Promise<{
921
947
  valid: boolean;
@@ -940,8 +966,26 @@ export interface AffiliateAdminClient {
940
966
  export interface AffiliateImportStagingClient {
941
967
  stageImportBatch(input: AffiliateImportBatchInput): Promise<{
942
968
  batchId: string;
969
+ sourceRecords: number;
970
+ }>;
971
+ }
972
+ /**
973
+ * Deliberately narrow import-validation surface. It can validate one staged
974
+ * batch, but cannot resolve source records or activate any import.
975
+ */
976
+ export interface AffiliateImportValidationClient {
977
+ validateImport(input: AffiliateImportValidationInput): Promise<{
978
+ valid: boolean;
979
+ errorCount: number;
943
980
  }>;
944
981
  }
982
+ /**
983
+ * Deliberately narrow import-activation surface. It can activate one
984
+ * validated, non-financial batch, but cannot stage, validate, or resolve one.
985
+ */
986
+ export interface AffiliateImportActivationClient {
987
+ activateImport(input: AffiliateImportActivateInput): Promise<void>;
988
+ }
945
989
  /**
946
990
  * Deliberately narrow relationship-seed surface for a separately protected
947
991
  * operator Worker. It cannot stage imports, activate them, or touch payouts.
@@ -949,6 +993,58 @@ export interface AffiliateImportStagingClient {
949
993
  export interface AffiliateRelationshipSeedClient {
950
994
  seedRelationship(input: AffiliateRelationshipSeedInput): Promise<AffiliateRelationshipSeedResult>;
951
995
  }
996
+ /**
997
+ * A single reviewed pass over commissions earned from the approved
998
+ * relationship cutover. This cannot create payouts or modify payout policy.
999
+ */
1000
+ export interface AffiliatePostCutoverBackfillInput {
1001
+ idempotencyKey: string;
1002
+ actorId: string;
1003
+ }
1004
+ export interface AffiliatePostCutoverBackfillResult {
1005
+ processed: number;
1006
+ created: number;
1007
+ completed: boolean;
1008
+ errorCount: number;
1009
+ }
1010
+ /** Narrow Access-operator surface for the one-time post-cutover backfill. */
1011
+ export interface AffiliatePostCutoverBackfillClient {
1012
+ runPostCutoverCommissionBackfill(input: AffiliatePostCutoverBackfillInput): Promise<AffiliatePostCutoverBackfillResult>;
1013
+ }
1014
+ /** Separate explicit rescan of late arrivals inside the original backfill cutoff. */
1015
+ export interface AffiliatePostCutoverCatchupClient {
1016
+ runPostCutoverCommissionCatchup(input: AffiliatePostCutoverBackfillInput): Promise<AffiliatePostCutoverBackfillResult>;
1017
+ }
1018
+ /** A reviewed accounting decision, not an automatic clawback or ledger write. */
1019
+ export interface AffiliatePartnerAdjustmentReviewInput {
1020
+ transactionGid: string;
1021
+ disposition: 'prior_period_no_local_reversal' | 'manual_adjustment_recorded';
1022
+ /** Reference to privately retained evidence supporting this exact decision. */
1023
+ evidenceReference: string;
1024
+ reason: string;
1025
+ /** Existing negative USD manual adjustment for the affected affiliate, or null. */
1026
+ ledgerEntryId: string | null;
1027
+ /** Explicit reviewed amount of that existing ledger entry, or null. */
1028
+ ledgerAmountMinor: number | null;
1029
+ idempotencyKey: string;
1030
+ actorId: string;
1031
+ }
1032
+ export interface AffiliatePartnerAdjustmentReviewResult {
1033
+ transactionGid: string;
1034
+ disposition: AffiliatePartnerAdjustmentReviewInput['disposition'];
1035
+ }
1036
+ /** Narrow, audit-only Access operator capability. It never writes ledger money. */
1037
+ export interface AffiliatePartnerAdjustmentReviewClient {
1038
+ reviewShoffiPartnerAdjustment(input: AffiliatePartnerAdjustmentReviewInput): Promise<AffiliatePartnerAdjustmentReviewResult>;
1039
+ }
1040
+ /** Narrow operator surface for opening liabilities only. */
1041
+ export interface AffiliateOpeningBalanceActivationClient {
1042
+ activateShoffiOpeningBalanceImport(input: AffiliateOpeningBalanceActivationInput): Promise<AffiliateOpeningBalanceActivationResult>;
1043
+ }
1044
+ /** Narrow operator surface for the one reviewed referral-boundary move. */
1045
+ export interface AffiliateAccrualBoundaryMoveClient {
1046
+ moveShoffiAccrualBoundary(input: AffiliateAccrualBoundaryMoveInput): Promise<AffiliateAccrualBoundaryMoveResult>;
1047
+ }
952
1048
  /**
953
1049
  * The one rejection every `UNAVAILABLE_AFFILIATE_ADMIN` method throws: an
954
1050
  * unavailable affiliate write client must fail, never pretend an import,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optizio/merchant-identity",
3
- "version": "0.7.1",
3
+ "version": "0.9.0",
4
4
  "description": "Shared merchant/user identity + revenue types and RPC client contracts for the merchant-hub portfolio.",
5
5
  "repository": {
6
6
  "type": "git",