@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 CHANGED
@@ -1,142 +1,134 @@
1
+ ```markdown
1
2
  # @temboplus/frontend-core
2
3
 
3
- A foundational JavaScript/TypeScript library that powers TemboPlus front-end applications. This library provides essential tools and data models that ensure consistency across all TemboPlus projects.
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
- ## What's Inside
6
+ ## Core Features
6
7
 
7
- The library contains:
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
- * **Utilities**: Ready-to-use helper functions for common development tasks
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
- ## Key Data Models
15
+ This library offers a set of meticulously crafted data models, each designed to handle specific data types with precision:
15
16
 
16
- - **PhoneNumber**: International phone number handling with country-specific validation
17
- - **TZPhoneNumber**: Tanzania-specific phone number handling with network operator identification
18
- - **Amount**: Currency value handling with formatting and conversion
19
- - **Currency**: Comprehensive currency information with symbols, formatting rules, and validation
20
- - **Country**: Standardized country data with ISO codes and validation
21
- - **Bank**: Standardized bank account information management
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 library includes a `ReportManager` for downloading reports in different formats across various TemboPlus projects:
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
- await ReportManager.instance.downloadReport({
37
- token: "your-auth-token",
38
- projectType: ProjectType.DASHBOARD,
39
- reportType: ReportType.MERCHANT_DISBURSEMENT_REPORT,
40
- fileFormat: FileFormat.PDF,
41
- query: {
42
- startDate: "2023-01-01T00:00:00.000Z",
43
- endDate: "2023-01-31T00:00:00.000Z"
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
- const dashboardReports = getReportsByProject(ProjectType.DASHBOARD);
47
+ function getAllDashboardReports(){
48
+ const dashboardReports = getReportsByProject(ProjectType.DASHBOARD);
49
+ return dashboardReports;
50
+ }
50
51
  ```
51
52
 
52
- ### Available Report Types
53
-
54
- The library supports the following report types:
53
+ ### Supported Report Types
55
54
 
56
- - **Dashboard Reports**:
57
- - `MERCHANT_DISBURSEMENT_REPORT`: Detailed breakdown of payments made to merchants
58
- - `TRANSACTION_REVENUE_SUMMARY`: Summary of all revenue transactions by period
59
-
60
- - **Afloat Reports**:
61
- - `CUSTOMER_WALLET_ACTIVITY`: Detailed record of all customer wallet transactions
62
- - `CUSTOMER_PROFILE_SNAPSHOT`: Current account information and status
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 library provides a centralized configuration service for managing application settings:
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
- pdfMakerBaseUrl: 'https://api.temboplus.com/pdf-maker'
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
- ## Working with Data Models
77
+ ## Data Model Validation
84
78
 
85
- Each data model in our library comes with three key validation methods:
79
+ Each data model includes validation methods to ensure data integrity:
86
80
 
87
- ### 1. Checking Object Types with `is`
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
- // someObject is a valid PhoneNumber
92
- console.log(phoneNumber.label);
90
+ console.log(someObject.label);
93
91
  }
94
- ```
95
-
96
- ### 2. Validating Input Data with `canConstruct`
97
92
 
98
- ```typescript
93
+ // Using canConstruct()
99
94
  if (Amount.canConstruct(userInput)) {
100
95
  const amount = Amount.from(userInput);
101
96
  }
102
- ```
103
97
 
104
- ### 3. Verifying Instance Data with `validate`
105
-
106
- ```typescript
98
+ // Using validate()
107
99
  const phoneNumber = PhoneNumber.from("+1234567890");
108
100
  if (phoneNumber.validate()) {
109
- processPhoneNumber(phoneNumber);
101
+ // Process the valid phone number.
110
102
  }
111
103
  ```
112
104
 
113
- ## Static Access to Common Data
105
+ ## Static Data Access
114
106
 
115
- Many of our models provide convenient static access to common data:
107
+ Convenient static properties are available for accessing common data:
116
108
 
117
109
  ```typescript
118
- // Access countries by ISO code or full name
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
- // Access currencies by code or full name
116
+ // Currency access
123
117
  const usd = Currency.USD;
124
118
  const tzs = Currency.TANZANIAN_SHILLING;
125
119
 
126
- // Access banks by short name
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
- - [PhoneNumber Documentation](./docs/phone_number.md)
136
- - [Amount Documentation](./docs/amount.md)
137
- - [Bank Documentation](./docs/bank.md)
138
- - [Currency Documentation](./docs/currency.md)
139
- - [Country Documentation](./docs/country.md)
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
- ## Using Phone Numbers
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
- // For international phone numbers:
155
- const phone = PhoneNumber.from("+1 (202) 555-0123");
156
- console.log(phone.getWithFormat(PhoneNumberFormat.INTERNATIONAL)); // +12025550123
144
+ // International phone numbers
145
+ const internationalPhone = PhoneNumber.from("+1 (202) 555-0123");
146
+ console.log(internationalPhone.getWithFormat(PhoneNumberFormat.INTERNATIONAL)); // +12025550123
157
147
 
158
- // For Tanzania phone numbers:
159
- const tzPhone = TZPhoneNumber.from("0712345678");
160
- console.log(tzPhone.getWithFormat(PhoneNumberFormat.INTERNATIONAL)); // +255 712 345 678
161
- console.log(tzPhone.networkOperator.name); // "Vodacom"
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;IACjB,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"}
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: "blue",
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,CAIhB;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"}
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,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C,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
- const url = ConfigService.instance.pdfMakerBaseUrl;
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
- format: args.fileFormat,
187
+ fileFormat: args.fileFormat,
185
188
  };
186
189
  // Build the query string
187
190
  const searchParams = new URLSearchParams();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/frontend-core",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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;IACjB,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"}
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: "blue",
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,CAIhB;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"}
1
+ {"version":3,"file":"report_manager.d.ts","sourceRoot":"","sources":["../../../src/src/reports/report_manager.ts"],"names":[],"mappings":"AAGA;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;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
- const url = index_js_1.ConfigService.instance.pdfMakerBaseUrl;
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
- format: args.fileFormat,
196
+ fileFormat: args.fileFormat,
194
197
  };
195
198
  // Build the query string
196
199
  const searchParams = new URLSearchParams();