@temboplus/frontend-core 0.2.3 → 0.2.4
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/README.md +80 -90
- package/esm/src/models/phone_number/tz/network_operator.d.ts.map +1 -1
- package/esm/src/models/phone_number/tz/network_operator.js +5 -2
- package/esm/src/reports/report_manager.d.ts.map +1 -1
- package/esm/src/reports/report_manager.js +5 -2
- package/package.json +1 -1
- package/script/src/models/phone_number/tz/network_operator.d.ts.map +1 -1
- package/script/src/models/phone_number/tz/network_operator.js +5 -2
- package/script/src/reports/report_manager.d.ts.map +1 -1
- package/script/src/reports/report_manager.js +5 -2
package/README.md
CHANGED
|
@@ -1,142 +1,134 @@
|
|
|
1
|
+
```markdown
|
|
1
2
|
# @temboplus/frontend-core
|
|
2
3
|
|
|
3
|
-
A
|
|
4
|
+
A robust and versatile JavaScript/TypeScript library designed to streamline the development of TemboPlus front-end applications. This library provides a comprehensive suite of utilities, standardized data models, and services to ensure consistency, efficiency, and maintainability across all TemboPlus projects.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Core Features
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
* **Utility Functions:** A collection of pre-built helper functions to simplify common development tasks.
|
|
9
|
+
* **Standardized Data Models:** Consistent and reliable data structures for managing essential data types, including phone numbers, amounts, currencies, countries, and bank details.
|
|
10
|
+
* **Comprehensive Report Management:** A powerful `ReportManager` for generating and downloading reports in various formats across different TemboPlus projects.
|
|
11
|
+
* **Centralized Configuration Service:** A flexible `ConfigService` for managing application settings and environment configurations.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
* **Data Models**: Standardized structures for handling data like phone numbers, amounts, currencies, countries, and bank details
|
|
11
|
-
* **Report Management**: Tools for generating and downloading reports across different projects
|
|
12
|
-
* **Configuration Service**: Centralized configuration management for application settings
|
|
13
|
+
## Data Models
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
This library offers a set of meticulously crafted data models, each designed to handle specific data types with precision:
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
* **PhoneNumber:** Robust international phone number validation and formatting.
|
|
18
|
+
* **TZPhoneNumber:** Specialized phone number handling for Tanzania, including network operator identification.
|
|
19
|
+
* **Amount:** Precise currency value management, with support for formatting and conversion.
|
|
20
|
+
* **Currency:** Detailed currency information, including symbols, formatting rules, and validation.
|
|
21
|
+
* **Country:** Standardized country data with ISO codes and comprehensive validation.
|
|
22
|
+
* **Bank:** Consistent bank account information management.
|
|
22
23
|
|
|
23
|
-
## Report Management
|
|
24
|
+
## Report Management with `ReportManager`
|
|
24
25
|
|
|
25
|
-
The
|
|
26
|
+
The `ReportManager` simplifies the process of generating and downloading reports across various TemboPlus projects.
|
|
26
27
|
|
|
27
28
|
```typescript
|
|
28
|
-
import {
|
|
29
|
-
ReportManager,
|
|
30
|
-
FileFormat,
|
|
31
|
-
ReportType,
|
|
32
|
-
ProjectType
|
|
33
|
-
} from '@temboplus/frontend-core';
|
|
29
|
+
import { ReportManager, FileFormat, ReportType, ProjectType } from '@temboplus/frontend-core';
|
|
34
30
|
|
|
35
31
|
// Download a report
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
32
|
+
async function downloadMerchantDisbursementReport() {
|
|
33
|
+
await ReportManager.instance.downloadReport({
|
|
34
|
+
token: "your-auth-token",
|
|
35
|
+
projectType: ProjectType.DASHBOARD,
|
|
36
|
+
reportType: ReportType.MERCHANT_DISBURSEMENT_REPORT,
|
|
37
|
+
fileFormat: FileFormat.PDF,
|
|
38
|
+
query: {
|
|
39
|
+
startDate: "2023-01-01T00:00:00.000Z",
|
|
40
|
+
endDate: "2023-01-31T00:00:00.000Z"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
46
44
|
|
|
47
45
|
// Get all reports for a specific project
|
|
48
46
|
import { getReportsByProject } from '@temboplus/frontend-core';
|
|
49
|
-
|
|
47
|
+
function getAllDashboardReports(){
|
|
48
|
+
const dashboardReports = getReportsByProject(ProjectType.DASHBOARD);
|
|
49
|
+
return dashboardReports;
|
|
50
|
+
}
|
|
50
51
|
```
|
|
51
52
|
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
The library supports the following report types:
|
|
53
|
+
### Supported Report Types
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- **VertoX Reports**:
|
|
65
|
-
- `GATEWAY_TRANSACTION_LOG`: Log of all payment gateway API transactions
|
|
55
|
+
* **Dashboard Reports:**
|
|
56
|
+
* `MERCHANT_DISBURSEMENT_REPORT`: Detailed merchant disbursement reports.
|
|
57
|
+
* `TRANSACTION_REVENUE_SUMMARY`: Revenue transaction summaries.
|
|
58
|
+
* **Afloat Reports:**
|
|
59
|
+
* `CUSTOMER_WALLET_ACTIVITY`: Customer wallet activity logs.
|
|
60
|
+
* `CUSTOMER_PROFILE_SNAPSHOT`: Customer profile snapshots.
|
|
61
|
+
* **VertoX Reports:**
|
|
62
|
+
* `GATEWAY_TRANSACTION_LOG`: Payment gateway transaction logs.
|
|
66
63
|
|
|
67
|
-
## Configuration Service
|
|
64
|
+
## Configuration Service with `ConfigService`
|
|
68
65
|
|
|
69
|
-
The
|
|
66
|
+
The `ConfigService` provides a centralized mechanism for managing application configurations.
|
|
70
67
|
|
|
71
68
|
```typescript
|
|
72
69
|
import { ConfigService } from '@temboplus/frontend-core';
|
|
73
70
|
|
|
74
71
|
// Initialize configuration at application startup
|
|
75
72
|
ConfigService.instance.initialize({
|
|
76
|
-
|
|
73
|
+
pdfMakerBaseUrl: 'https://api.temboplus.com/pdf-maker' // Optional: Override default PDF maker base URL.
|
|
77
74
|
});
|
|
78
|
-
|
|
79
|
-
// Access configuration values throughout your application
|
|
80
|
-
const baseUrl = ConfigService.instance.pdfMakerBaseUrl;
|
|
81
75
|
```
|
|
82
76
|
|
|
83
|
-
##
|
|
77
|
+
## Data Model Validation
|
|
84
78
|
|
|
85
|
-
Each data model
|
|
79
|
+
Each data model includes validation methods to ensure data integrity:
|
|
86
80
|
|
|
87
|
-
|
|
81
|
+
* **`is(object)`:** Checks if an object is a valid instance of the data model.
|
|
82
|
+
* **`canConstruct(input)`:** Validates input data before constructing a new instance.
|
|
83
|
+
* **`validate()`:** Verifies the validity of an existing data model instance.
|
|
88
84
|
|
|
89
85
|
```typescript
|
|
86
|
+
import { PhoneNumber, Amount } from '@temboplus/frontend-core';
|
|
87
|
+
|
|
88
|
+
// Using is()
|
|
90
89
|
if (PhoneNumber.is(someObject)) {
|
|
91
|
-
|
|
92
|
-
console.log(phoneNumber.label);
|
|
90
|
+
console.log(someObject.label);
|
|
93
91
|
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### 2. Validating Input Data with `canConstruct`
|
|
97
92
|
|
|
98
|
-
|
|
93
|
+
// Using canConstruct()
|
|
99
94
|
if (Amount.canConstruct(userInput)) {
|
|
100
95
|
const amount = Amount.from(userInput);
|
|
101
96
|
}
|
|
102
|
-
```
|
|
103
97
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
98
|
+
// Using validate()
|
|
107
99
|
const phoneNumber = PhoneNumber.from("+1234567890");
|
|
108
100
|
if (phoneNumber.validate()) {
|
|
109
|
-
|
|
101
|
+
// Process the valid phone number.
|
|
110
102
|
}
|
|
111
103
|
```
|
|
112
104
|
|
|
113
|
-
## Static Access
|
|
105
|
+
## Static Data Access
|
|
114
106
|
|
|
115
|
-
|
|
107
|
+
Convenient static properties are available for accessing common data:
|
|
116
108
|
|
|
117
109
|
```typescript
|
|
118
|
-
|
|
110
|
+
import { Country, Currency, Bank } from '@temboplus/frontend-core';
|
|
111
|
+
|
|
112
|
+
// Country access
|
|
119
113
|
const tanzania = Country.TZ;
|
|
120
114
|
const usa = Country.UNITED_STATES;
|
|
121
115
|
|
|
122
|
-
//
|
|
116
|
+
// Currency access
|
|
123
117
|
const usd = Currency.USD;
|
|
124
118
|
const tzs = Currency.TANZANIAN_SHILLING;
|
|
125
119
|
|
|
126
|
-
//
|
|
120
|
+
// Bank access
|
|
127
121
|
const crdb = Bank.CRDB;
|
|
128
122
|
const nmb = Bank.NMB;
|
|
129
123
|
```
|
|
130
124
|
|
|
131
|
-
## Documentation
|
|
132
|
-
|
|
133
|
-
For detailed documentation on specific models:
|
|
125
|
+
## Detailed Model Documentation
|
|
134
126
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
127
|
+
* [PhoneNumber](./docs/phone_number.md)
|
|
128
|
+
* [Amount](./docs/amount.md)
|
|
129
|
+
* [Bank](./docs/bank.md)
|
|
130
|
+
* [Currency](./docs/currency.md)
|
|
131
|
+
* [Country](./docs/country.md)
|
|
140
132
|
|
|
141
133
|
## Installation
|
|
142
134
|
|
|
@@ -144,19 +136,17 @@ For detailed documentation on specific models:
|
|
|
144
136
|
npm install @temboplus/frontend-core
|
|
145
137
|
```
|
|
146
138
|
|
|
147
|
-
##
|
|
148
|
-
|
|
149
|
-
The library provides two phone number implementations:
|
|
139
|
+
## Phone Number Usage
|
|
150
140
|
|
|
151
141
|
```typescript
|
|
152
142
|
import { PhoneNumber, TZPhoneNumber, PhoneNumberFormat } from '@temboplus/frontend-core';
|
|
153
143
|
|
|
154
|
-
//
|
|
155
|
-
const
|
|
156
|
-
console.log(
|
|
144
|
+
// International phone numbers
|
|
145
|
+
const internationalPhone = PhoneNumber.from("+1 (202) 555-0123");
|
|
146
|
+
console.log(internationalPhone.getWithFormat(PhoneNumberFormat.INTERNATIONAL)); // +12025550123
|
|
157
147
|
|
|
158
|
-
//
|
|
159
|
-
const
|
|
160
|
-
console.log(
|
|
161
|
-
console.log(
|
|
162
|
-
```
|
|
148
|
+
// Tanzania phone numbers
|
|
149
|
+
const tanzaniaPhone = TZPhoneNumber.from("0712345678");
|
|
150
|
+
console.log(tanzaniaPhone.getWithFormat(PhoneNumberFormat.INTERNATIONAL)); // +255 712 345 678
|
|
151
|
+
console.log(tanzaniaPhone.networkOperator.name); // "Yas"
|
|
152
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network_operator.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/network_operator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"network_operator.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/network_operator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IAIjB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,EAAE,EAAE,eAAe,CAAC;IAEpB,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAE/B,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IAEpB,wDAAwD;IACxD,kBAAkB,EAAE,MAAM,CAAC;IAE3B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,eAAe,EACf,mBAAmB,CA8BpB,CAAC"}
|
|
@@ -6,6 +6,9 @@ export var NetworkOperator;
|
|
|
6
6
|
(function (NetworkOperator) {
|
|
7
7
|
NetworkOperator["VODACOM"] = "Vodacom";
|
|
8
8
|
NetworkOperator["AIRTEL"] = "Airtel";
|
|
9
|
+
// Preserve the value "Tigo" bse our backend still recognizes it for payout channel codes
|
|
10
|
+
// It should not be seen anywhere for we have NetworkOperatorInfo.displayName & NetworkOperatorInfo.mobileMoneyService
|
|
11
|
+
// as labels we can use on the frontend
|
|
9
12
|
NetworkOperator["TIGO"] = "Tigo";
|
|
10
13
|
NetworkOperator["HALOTEL"] = "Halotel";
|
|
11
14
|
})(NetworkOperator || (NetworkOperator = {}));
|
|
@@ -31,8 +34,8 @@ export const NETWORK_OPERATOR_CONFIG = {
|
|
|
31
34
|
id: NetworkOperator.TIGO,
|
|
32
35
|
mobileNumberPrefixes: ["71", "65", "67", "77"],
|
|
33
36
|
displayName: "Yas",
|
|
34
|
-
mobileMoneyService: "Mixx",
|
|
35
|
-
brandColor: "
|
|
37
|
+
mobileMoneyService: "Mixx by Yas",
|
|
38
|
+
brandColor: "yellow",
|
|
36
39
|
},
|
|
37
40
|
[NetworkOperator.HALOTEL]: {
|
|
38
41
|
id: NetworkOperator.HALOTEL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,CAOhB;IAEF;;;;OAIG;IACU,cAAc,CAAC,IAAI,EAAE;QAChC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,UAAU,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;QAEvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmFjB;;;;;OAKG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,mBAAmB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;;;OAIG;IACH,OAAO,CAAC,qCAAqC;IA6B7C;;;;OAIG;IACH,OAAO,CAAC,SAAS,CACyB;CAC3C"}
|
|
@@ -131,7 +131,10 @@ export class ReportManager {
|
|
|
131
131
|
configurable: true,
|
|
132
132
|
writable: true,
|
|
133
133
|
value: () => {
|
|
134
|
-
|
|
134
|
+
let url = ConfigService.instance.pdfMakerBaseUrl;
|
|
135
|
+
if (url.trim().length === 0) {
|
|
136
|
+
url = "https://api.afloat.money/pdf-maker";
|
|
137
|
+
}
|
|
135
138
|
if (url.endsWith("/"))
|
|
136
139
|
return url.slice(0, -1);
|
|
137
140
|
return url;
|
|
@@ -181,7 +184,7 @@ export class ReportManager {
|
|
|
181
184
|
// deno-lint-ignore no-explicit-any
|
|
182
185
|
const queryParams = {
|
|
183
186
|
...(args.query || {}),
|
|
184
|
-
|
|
187
|
+
fileFormat: args.fileFormat,
|
|
185
188
|
};
|
|
186
189
|
// Build the query string
|
|
187
190
|
const searchParams = new URLSearchParams();
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network_operator.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/network_operator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;
|
|
1
|
+
{"version":3,"file":"network_operator.d.ts","sourceRoot":"","sources":["../../../../../src/src/models/phone_number/tz/network_operator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IAIjB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,EAAE,EAAE,eAAe,CAAC;IAEpB,+DAA+D;IAC/D,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAE/B,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IAEpB,wDAAwD;IACxD,kBAAkB,EAAE,MAAM,CAAC;IAE3B,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,eAAe,EACf,mBAAmB,CA8BpB,CAAC"}
|
|
@@ -9,6 +9,9 @@ var NetworkOperator;
|
|
|
9
9
|
(function (NetworkOperator) {
|
|
10
10
|
NetworkOperator["VODACOM"] = "Vodacom";
|
|
11
11
|
NetworkOperator["AIRTEL"] = "Airtel";
|
|
12
|
+
// Preserve the value "Tigo" bse our backend still recognizes it for payout channel codes
|
|
13
|
+
// It should not be seen anywhere for we have NetworkOperatorInfo.displayName & NetworkOperatorInfo.mobileMoneyService
|
|
14
|
+
// as labels we can use on the frontend
|
|
12
15
|
NetworkOperator["TIGO"] = "Tigo";
|
|
13
16
|
NetworkOperator["HALOTEL"] = "Halotel";
|
|
14
17
|
})(NetworkOperator || (exports.NetworkOperator = NetworkOperator = {}));
|
|
@@ -34,8 +37,8 @@ exports.NETWORK_OPERATOR_CONFIG = {
|
|
|
34
37
|
id: NetworkOperator.TIGO,
|
|
35
38
|
mobileNumberPrefixes: ["71", "65", "67", "77"],
|
|
36
39
|
displayName: "Yas",
|
|
37
|
-
mobileMoneyService: "Mixx",
|
|
38
|
-
brandColor: "
|
|
40
|
+
mobileMoneyService: "Mixx by Yas",
|
|
41
|
+
brandColor: "yellow",
|
|
39
42
|
},
|
|
40
43
|
[NetworkOperator.HALOTEL]: {
|
|
41
44
|
id: NetworkOperator.HALOTEL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,UAAU;IACpB,sBAAsB;IACtB,GAAG,QAAQ;IACX,wBAAwB;IACxB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,8BAA8B;IAC9B,SAAS,cAAc;IACvB,qBAAqB;IACrB,MAAM,WAAW;IACjB,qBAAqB;IACrB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,4BAA4B,iCAAiC;IAC7D,8CAA8C;IAC9C,2BAA2B,gCAAgC;IAC3D,wCAAwC;IACxC,wBAAwB,6BAA6B;IACrD,4CAA4C;IAC5C,yBAAyB,8BAA8B;IACvD,uCAAuC;IACvC,uBAAuB,4BAA4B;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,yBAAyB;IACzB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;kCAUb,gBAAgB;iCAUhB,gBAAgB;8BAWhB,gBAAgB;+BAUhB,gBAAgB;6BAWhB,gBAAgB;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,GACvB,gBAAgB,EAAE,CAIpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAGT;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgB;IAExC,OAAO;IAEP;;OAEG;IACH,WAAkB,QAAQ,kBAEzB;IAED;;;OAGG;IACH,OAAO,CAAC,UAAU,CAOhB;IAEF;;;;OAIG;IACU,cAAc,CAAC,IAAI,EAAE;QAChC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,UAAU,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC;QAEvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmFjB;;;;;OAKG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,mBAAmB;IAwBjC;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;;;OAIG;IACH,OAAO,CAAC,qCAAqC;IA6B7C;;;;OAIG;IACH,OAAO,CAAC,SAAS,CACyB;CAC3C"}
|
|
@@ -140,7 +140,10 @@ class ReportManager {
|
|
|
140
140
|
configurable: true,
|
|
141
141
|
writable: true,
|
|
142
142
|
value: () => {
|
|
143
|
-
|
|
143
|
+
let url = index_js_1.ConfigService.instance.pdfMakerBaseUrl;
|
|
144
|
+
if (url.trim().length === 0) {
|
|
145
|
+
url = "https://api.afloat.money/pdf-maker";
|
|
146
|
+
}
|
|
144
147
|
if (url.endsWith("/"))
|
|
145
148
|
return url.slice(0, -1);
|
|
146
149
|
return url;
|
|
@@ -190,7 +193,7 @@ class ReportManager {
|
|
|
190
193
|
// deno-lint-ignore no-explicit-any
|
|
191
194
|
const queryParams = {
|
|
192
195
|
...(args.query || {}),
|
|
193
|
-
|
|
196
|
+
fileFormat: args.fileFormat,
|
|
194
197
|
};
|
|
195
198
|
// Build the query string
|
|
196
199
|
const searchParams = new URLSearchParams();
|