@temboplus/afloat 0.3.0 → 0.4.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.
@@ -1,7 +1,7 @@
1
1
  import type { ISO2CountryCode, MobileMoneyProviderId } from "@temboplus/frontend-core";
2
- import { type Amount, ChannelType, PhoneNumber } from "@temboplus/frontend-core";
2
+ import { type Amount, ChannelType } from "@temboplus/frontend-core";
3
3
  import type { Wallet } from "@/modules/wallet/wallet.model.js";
4
- import { BankBeneficiaryInfo, type BeneficiaryInfo } from "../beneficiary/beneficiary-info.model.js";
4
+ import { BankBeneficiaryInfo, type BeneficiaryInfo, MobileBeneficiaryInfo } from "../beneficiary/beneficiary-info.model.js";
5
5
  import { PayoutChannel, type PayoutInputDTO } from "./payout.dtos.js";
6
6
  export type PayoutChannelCode = PayoutChannel;
7
7
  /**
@@ -40,16 +40,19 @@ export declare class PayoutChannelResolver {
40
40
  *
41
41
  * Routing rules:
42
42
  * - All Kenya mobile money payouts route through `KE-SAFARICOM-B2C`.
43
- * - Tanzania Vodacom mobile numbers route through `TZ-TIGO-B2C`.
44
- * - Tanzania Tigo, Airtel, and Halotel route through their matching upstream channels.
43
+ * - Tanzania Vodacom, Tigo, Airtel, and Halotel route through their matching
44
+ * upstream channels.
45
45
  *
46
- * @param phoneNumber - Parsed mobile beneficiary phone number.
47
- * @param mnoId - Beneficiary mobile money provider id.
46
+ * The provider is taken from the beneficiary's `mnoId` — the validated,
47
+ * possibly user-supplied choice (e.g. TZ "66" numbers) — never re-derived
48
+ * from the phone prefix here.
49
+ *
50
+ * @param receiver - Valid mobile beneficiary details containing phone number and provider.
48
51
  * @param wallet - Wallet paying out; its country must match the phone number country.
49
52
  * @returns The concrete upstream mobile money payout channel.
50
- * @throws Error when the phone, provider, country, or wallet corridor is invalid or unsupported.
53
+ * @throws Error when the beneficiary, provider, country, or wallet corridor is invalid or unsupported.
51
54
  */
52
- static forMobile(phoneNumber: PhoneNumber, mnoId: MobileMoneyProviderId, wallet: Wallet): PayoutChannel;
55
+ static forMobile(receiver: MobileBeneficiaryInfo, wallet: Wallet): PayoutChannel;
53
56
  /**
54
57
  * Converts a concrete payout channel into the generic coverage channel type.
55
58
  *
@@ -141,7 +144,9 @@ export declare class PayoutInputFactory {
141
144
  private createBankInput;
142
145
  }
143
146
  /**
144
- * @deprecated Use PayoutChannelResolver instead.
147
+ * @deprecated Use PayoutChannelResolver instead. Note: `mobile` now takes
148
+ * `(receiver: MobileBeneficiaryInfo, wallet: Wallet)` like `bank`, instead of
149
+ * the old `(phoneNumber, mnoId, wallet)` triple.
145
150
  */
146
151
  export declare const createPayoutChannelCode: {
147
152
  bank: typeof PayoutChannelResolver.forBank;
@@ -1 +1 @@
1
- {"version":3,"file":"payout-channel-handler.d.ts","sourceRoot":"","sources":["../../../src/modules/payout/payout-channel-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EACL,KAAK,MAAM,EACX,WAAW,EAGX,WAAW,EAIZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EAErB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AA0D9C;;;;;GAKG;AACH,qBAAa,qBAAqB;IAChC;;;;;;;;;OASG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,eAAe,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,aAAa;IAUlG;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa;IAgB5E;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa;IAkCvG;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,WAAW;IAI1D;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe;IAI9D;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,qBAAqB,GAAG,SAAS;IAK/E;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAIrD;;;;;OAKG;IACH,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO;IAI5D;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,uCAAuC;CAkBvD;AAED;;;;;GAKG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;;;;;OAUG;IACH,cAAc,CACZ,IAAI,EAAE;QACJ,QAAQ,EAAE,eAAe,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EACD,MAAM,EAAE,MAAM,GACb,cAAc;IAcjB;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;CAiBxB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;CAGnC,CAAC"}
1
+ {"version":3,"file":"payout-channel-handler.d.ts","sourceRoot":"","sources":["../../../src/modules/payout/payout-channel-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EACL,KAAK,MAAM,EACX,WAAW,EAOZ,MA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;;;OAUG;IACH,cAAc,CACZ,IAAI,EAAE;QACJ,QAAQ,EAAE,eAAe,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EACD,MAAM,EAAE,MAAM,GACb,cAAc;IAcjB;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;CAiBxB;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;CAGnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/afloat",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A foundational library for Temboplus-Afloat projects.",
5
5
  "author": "Okello Gerald",
6
6
  "license": "MIT",