@vasrefil/api-toolkit 1.0.14 → 1.0.15

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.
@@ -3,3 +3,5 @@ export * from './status.interface';
3
3
  export * from './root-controller.interface';
4
4
  export * from './interface';
5
5
  export * from './env.interface';
6
+ export * from './transaction.interface';
7
+ export * from './voucher.interface';
@@ -19,3 +19,5 @@ __exportStar(require("./status.interface"), exports);
19
19
  __exportStar(require("./root-controller.interface"), exports);
20
20
  __exportStar(require("./interface"), exports);
21
21
  __exportStar(require("./env.interface"), exports);
22
+ __exportStar(require("./transaction.interface"), exports);
23
+ __exportStar(require("./voucher.interface"), exports);
@@ -0,0 +1,90 @@
1
+ import { VoucherTypeI } from "./voucher.interface";
2
+ export declare enum TransactionStatusI {
3
+ SUCCESS = "SUCCESS",
4
+ FAILED = "FAILED",
5
+ PROCESSING = "PROCESSING",
6
+ PENDING = "PENDING",
7
+ CANCELLED = "CANCELLED"
8
+ }
9
+ export declare enum TransactionTypeI {
10
+ VAS = "VAS",
11
+ EDUCATION = "EDUCATION",
12
+ PAYMENT = "PAYMENT",
13
+ FUNDS_TRANSFER = "FUNDS_TRANSFER",
14
+ WITHDRAW = "WITHDRAW",
15
+ EDUCATION_PAYMENT_WITHDRAW = "EDUCATION_PAYMENT_WITHDRAW",
16
+ VASPOINT_WITHDRAW = "VASPOINT_WITHDRAW",
17
+ ADMIN_CREDIT = "ADMIN_CREDIT",
18
+ ADMIN_DEBIT = "ADMIN_DEBIT",
19
+ PROMOTION = "PROMOTION"
20
+ }
21
+ export declare enum TransactionActionTypeI {
22
+ CREDIT = "CREDIT",
23
+ DEBIT = "DEBIT"
24
+ }
25
+ export declare enum TransactionServieTypeI {
26
+ AIRTIME = "AIRTIME",
27
+ DATA_BUNDLE = "DATA_BUNDLE",
28
+ CABLE_TV = "CABLE_TV",
29
+ ELECTRICITY = "ELECTRICITY",
30
+ DEPARTMENTAL_DUES = "DEPARTMENTAL_DUES",
31
+ HANDOUT = "HANDOUT",
32
+ FACULTY_DUES = "FACULTY_DUES",
33
+ CREDIT_WALLET = "CREDIT_WALLET",
34
+ CASHBACK_CREDIT = "CASHBACK_CREDIT",
35
+ DEBIT_WALLET = "DEBIT_WALLET"
36
+ }
37
+ export interface TransactionI {
38
+ _id?: string;
39
+ user_id: string;
40
+ reference_id: string;
41
+ service_type: TransactionServieTypeI;
42
+ service_provider: string | any;
43
+ amount: number;
44
+ recipient: string;
45
+ status: TransactionStatusI;
46
+ type: TransactionTypeI;
47
+ title: string;
48
+ action_type: TransactionActionTypeI;
49
+ total_amount: number;
50
+ platform_provider?: string;
51
+ plan_name?: string;
52
+ plan_id?: string;
53
+ meter_type?: string;
54
+ electricity_token?: string;
55
+ customer_name?: string;
56
+ customer_address?: string;
57
+ trans_id?: string;
58
+ service_fees?: number;
59
+ createdAt?: string;
60
+ debited_amount?: number;
61
+ beneficiary_name?: string;
62
+ transferred_fund_recipients?: any[];
63
+ description?: string;
64
+ reciever_amount?: number;
65
+ customer?: {
66
+ phone: string;
67
+ };
68
+ cabletv?: {
69
+ subscription_type: 'renew' | 'change';
70
+ };
71
+ metadata?: {
72
+ phone_is_ported: boolean;
73
+ };
74
+ voucher?: {
75
+ code: string;
76
+ amount: number;
77
+ redeem_id: string;
78
+ type: VoucherTypeI;
79
+ };
80
+ user_balance?: {
81
+ initial_balance: number;
82
+ final_balance: number;
83
+ };
84
+ profit?: number;
85
+ payment_sender_id?: string;
86
+ formatted_amount?: string;
87
+ formatted_total_amount?: string;
88
+ formatted_service_fees?: string;
89
+ formatted_debited_amount?: string;
90
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TransactionServieTypeI = exports.TransactionActionTypeI = exports.TransactionTypeI = exports.TransactionStatusI = void 0;
4
+ var TransactionStatusI;
5
+ (function (TransactionStatusI) {
6
+ TransactionStatusI["SUCCESS"] = "SUCCESS";
7
+ TransactionStatusI["FAILED"] = "FAILED";
8
+ TransactionStatusI["PROCESSING"] = "PROCESSING";
9
+ TransactionStatusI["PENDING"] = "PENDING";
10
+ TransactionStatusI["CANCELLED"] = "CANCELLED";
11
+ })(TransactionStatusI || (exports.TransactionStatusI = TransactionStatusI = {}));
12
+ var TransactionTypeI;
13
+ (function (TransactionTypeI) {
14
+ TransactionTypeI["VAS"] = "VAS";
15
+ TransactionTypeI["EDUCATION"] = "EDUCATION";
16
+ TransactionTypeI["PAYMENT"] = "PAYMENT";
17
+ TransactionTypeI["FUNDS_TRANSFER"] = "FUNDS_TRANSFER";
18
+ TransactionTypeI["WITHDRAW"] = "WITHDRAW";
19
+ TransactionTypeI["EDUCATION_PAYMENT_WITHDRAW"] = "EDUCATION_PAYMENT_WITHDRAW";
20
+ TransactionTypeI["VASPOINT_WITHDRAW"] = "VASPOINT_WITHDRAW";
21
+ TransactionTypeI["ADMIN_CREDIT"] = "ADMIN_CREDIT";
22
+ TransactionTypeI["ADMIN_DEBIT"] = "ADMIN_DEBIT";
23
+ TransactionTypeI["PROMOTION"] = "PROMOTION";
24
+ })(TransactionTypeI || (exports.TransactionTypeI = TransactionTypeI = {}));
25
+ var TransactionActionTypeI;
26
+ (function (TransactionActionTypeI) {
27
+ TransactionActionTypeI["CREDIT"] = "CREDIT";
28
+ TransactionActionTypeI["DEBIT"] = "DEBIT";
29
+ })(TransactionActionTypeI || (exports.TransactionActionTypeI = TransactionActionTypeI = {}));
30
+ var TransactionServieTypeI;
31
+ (function (TransactionServieTypeI) {
32
+ TransactionServieTypeI["AIRTIME"] = "AIRTIME";
33
+ TransactionServieTypeI["DATA_BUNDLE"] = "DATA_BUNDLE";
34
+ TransactionServieTypeI["CABLE_TV"] = "CABLE_TV";
35
+ TransactionServieTypeI["ELECTRICITY"] = "ELECTRICITY";
36
+ TransactionServieTypeI["DEPARTMENTAL_DUES"] = "DEPARTMENTAL_DUES";
37
+ TransactionServieTypeI["HANDOUT"] = "HANDOUT";
38
+ TransactionServieTypeI["FACULTY_DUES"] = "FACULTY_DUES";
39
+ TransactionServieTypeI["CREDIT_WALLET"] = "CREDIT_WALLET";
40
+ TransactionServieTypeI["CASHBACK_CREDIT"] = "CASHBACK_CREDIT";
41
+ TransactionServieTypeI["DEBIT_WALLET"] = "DEBIT_WALLET";
42
+ })(TransactionServieTypeI || (exports.TransactionServieTypeI = TransactionServieTypeI = {}));
@@ -0,0 +1,69 @@
1
+ import { TransactionServieTypeI } from "./transaction.interface";
2
+ import { UserI } from "./user.interface";
3
+ export interface VoucherPayloadI {
4
+ transaction: VoucherTransactionI;
5
+ }
6
+ export interface VoucherTransactionI {
7
+ service_type: TransactionServieTypeI;
8
+ amount: number;
9
+ service_provider: string;
10
+ plan: string;
11
+ recipient: string;
12
+ customer?: {
13
+ email: string;
14
+ name: string;
15
+ };
16
+ }
17
+ export interface VoucherTransI {
18
+ code: string;
19
+ transaction: VoucherTransactionI;
20
+ }
21
+ export interface ValidateRedeemRespI {
22
+ message: string;
23
+ deductible_amount: number;
24
+ redeem_details?: {
25
+ _id: string;
26
+ };
27
+ validation_details?: ValidationDetailsI;
28
+ }
29
+ export interface ValidationDetailsI {
30
+ deductible_amount: number;
31
+ type: VoucherTypeI;
32
+ message: string;
33
+ discount: {
34
+ percentage: number;
35
+ is_capped: boolean;
36
+ capped_amount: number;
37
+ };
38
+ }
39
+ export interface ValidateDataPlanVoucherRespI {
40
+ status: boolean;
41
+ data?: ValidateRedeemRespI;
42
+ error?: any;
43
+ }
44
+ export interface ValidityChecksPayloadI {
45
+ user: UserI;
46
+ voucher: VoucherTransI;
47
+ options?: {
48
+ validate_user_payment?: boolean;
49
+ };
50
+ }
51
+ export declare enum VoucherTypeI {
52
+ DISCOUNT = "DISCOUNT",
53
+ CASHBACK = "CASHBACK",
54
+ VAS_GIFT = "VAS_GIFT"
55
+ }
56
+ export declare enum VoucherAmountTypeI {
57
+ FIXED = "FIXED",
58
+ PERCENTAGE = "PERCENTAGE"
59
+ }
60
+ export interface VoucherConfigI {
61
+ _id?: string;
62
+ amount: number;
63
+ amount_type: VoucherAmountTypeI;
64
+ is_capped?: boolean;
65
+ capped_amount?: number;
66
+ }
67
+ export interface ReferralConfigI extends VoucherConfigI {
68
+ id: string;
69
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VoucherAmountTypeI = exports.VoucherTypeI = void 0;
4
+ var VoucherTypeI;
5
+ (function (VoucherTypeI) {
6
+ VoucherTypeI["DISCOUNT"] = "DISCOUNT";
7
+ VoucherTypeI["CASHBACK"] = "CASHBACK";
8
+ VoucherTypeI["VAS_GIFT"] = "VAS_GIFT";
9
+ })(VoucherTypeI || (exports.VoucherTypeI = VoucherTypeI = {}));
10
+ var VoucherAmountTypeI;
11
+ (function (VoucherAmountTypeI) {
12
+ VoucherAmountTypeI["FIXED"] = "FIXED";
13
+ VoucherAmountTypeI["PERCENTAGE"] = "PERCENTAGE";
14
+ })(VoucherAmountTypeI || (exports.VoucherAmountTypeI = VoucherAmountTypeI = {}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vasrefil/api-toolkit",
3
3
  "description": "This is Vasrefil API toolkit",
4
- "version": "1.0.14",
4
+ "version": "1.0.15",
5
5
  "author": "Sodiq Alabi",
6
6
  "main": "dist/public-api.js",
7
7
  "types": "dist/public-api.d.ts",