@optizio/merchant-identity 0.6.0 → 0.7.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.
package/dist/index.d.ts CHANGED
@@ -716,6 +716,85 @@ export interface AffiliateImportResolveInput {
716
716
  reason: string;
717
717
  actorId: string;
718
718
  }
719
+ /**
720
+ * One approved program in the first canonical relationship seed. The app
721
+ * must already exist in Partner data; this operation does not create apps.
722
+ */
723
+ export interface AffiliateRelationshipSeedProgramInput {
724
+ id: string;
725
+ /** The app-local Shoffi identifier explicitly mapped to this Partner app. */
726
+ sourceAppId: string;
727
+ appGid: string;
728
+ name: string;
729
+ defaultRateBps: number;
730
+ status: 'active' | 'inactive';
731
+ /** Approved UTC commission cutover for this app's referrals. */
732
+ cutoverAt: string;
733
+ }
734
+ /**
735
+ * An approved canonical affiliate. Relationship migration keeps every
736
+ * affiliate on payout hold until payout policy and historical balances have
737
+ * separately been approved.
738
+ */
739
+ export interface AffiliateRelationshipSeedAffiliateInput {
740
+ id: string;
741
+ name: string;
742
+ email: string | null;
743
+ payoutHoldReason: string;
744
+ }
745
+ /**
746
+ * Maps one app-scoped Shoffi relation identity to an approved canonical
747
+ * affiliate/program membership. The source identity is retained in the seed
748
+ * audit record and must not be inferred from display names or emails.
749
+ */
750
+ export interface AffiliateRelationshipSeedMembershipInput {
751
+ id: string;
752
+ affiliateId: string;
753
+ programId: string;
754
+ sourceAppId: string;
755
+ sourceRelationId: string;
756
+ joinedAt: string | null;
757
+ status: 'active' | 'inactive';
758
+ legacyCodes: {
759
+ source: string;
760
+ code: string;
761
+ }[];
762
+ }
763
+ /** An approved continuing or ended Shoffi referral relationship. */
764
+ export interface AffiliateRelationshipSeedReferralInput {
765
+ id: string;
766
+ membershipId: string;
767
+ appGid: string;
768
+ shopDomain: string;
769
+ shopGid: string | null;
770
+ referredAt: string | null;
771
+ rateBps: number;
772
+ accrualFrom: string;
773
+ status: 'active' | 'ended';
774
+ endedAt: string | null;
775
+ endReason: string | null;
776
+ }
777
+ /**
778
+ * The complete operator-reviewed canonical relationship seed. It deliberately
779
+ * excludes historical commissions, payouts, and payout items.
780
+ */
781
+ export interface AffiliateRelationshipSeedInput {
782
+ /** The reviewed Shoffi account scope that supplied the relation IDs. */
783
+ sourceAccount: string;
784
+ programs: AffiliateRelationshipSeedProgramInput[];
785
+ affiliates: AffiliateRelationshipSeedAffiliateInput[];
786
+ memberships: AffiliateRelationshipSeedMembershipInput[];
787
+ referrals: AffiliateRelationshipSeedReferralInput[];
788
+ idempotencyKey: string;
789
+ reason: string;
790
+ actorId: string;
791
+ }
792
+ export interface AffiliateRelationshipSeedResult {
793
+ programIds: string[];
794
+ affiliateIds: string[];
795
+ membershipIds: string[];
796
+ referralIds: string[];
797
+ }
719
798
  /** Ask for a (catch-up) commission sweep pass; returns immediately. */
720
799
  export interface AffiliateSweepInput {
721
800
  /** Restrict the pass to one app, null = all. */
@@ -834,6 +913,7 @@ export interface AffiliateDomainStatus {
834
913
  export interface AffiliateAdminClient {
835
914
  updateAffiliate(input: AffiliateUpdateInput): Promise<Affiliate>;
836
915
  setPayoutPolicy(input: AffiliatePayoutPolicyInput): Promise<void>;
916
+ seedRelationship(input: AffiliateRelationshipSeedInput): Promise<AffiliateRelationshipSeedResult>;
837
917
  stageImportBatch(input: AffiliateImportBatchInput): Promise<{
838
918
  batchId: string;
839
919
  }>;
package/dist/index.js CHANGED
@@ -230,6 +230,9 @@ export const UNAVAILABLE_AFFILIATE_ADMIN = {
230
230
  async setPayoutPolicy() {
231
231
  unavailable();
232
232
  },
233
+ async seedRelationship() {
234
+ unavailable();
235
+ },
233
236
  async stageImportBatch() {
234
237
  unavailable();
235
238
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optizio/merchant-identity",
3
- "version": "0.6.0",
3
+ "version": "0.7.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",