@royalinvest/dto 0.69.17 → 0.69.19

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.
@@ -92,6 +92,7 @@ export declare const RABBITMQ_EXCHANGES: {
92
92
  readonly cancel: "job_scheduling.cancel";
93
93
  readonly report_status: "job_scheduling.report_status";
94
94
  readonly rent_payment_initiate: "job_execution.rent_payment_initiate";
95
+ readonly rent_payment_invoice_prepare: "job_execution.rent_payment_invoice_prepare";
95
96
  };
96
97
  readonly queues: {
97
98
  readonly job_scheduling: "job_scheduling_queue";
@@ -96,6 +96,7 @@ exports.RABBITMQ_EXCHANGES = {
96
96
  cancel: "job_scheduling.cancel",
97
97
  report_status: "job_scheduling.report_status",
98
98
  rent_payment_initiate: "job_execution.rent_payment_initiate",
99
+ rent_payment_invoice_prepare: "job_execution.rent_payment_invoice_prepare",
99
100
  },
100
101
  queues: {
101
102
  job_scheduling: "job_scheduling_queue",
package/dist/utils.d.ts CHANGED
@@ -4,3 +4,4 @@ export declare function fromMinorUnits(amountMinor: string, currency: CurrencyEn
4
4
  export declare function fromMinorUnitsExact(amountMinor: string, currency: CurrencyEnum): string;
5
5
  export declare function parseMajorToMinor(value: string, currency: CurrencyEnum): string;
6
6
  export declare function resolveLocale(uiLanguage: LocaleType, country?: CountryEnum | null): string;
7
+ export declare function formatMoney(amountMinor: string, currency: CurrencyEnum, locale: string): string;
package/dist/utils.js CHANGED
@@ -4,6 +4,7 @@ exports.fromMinorUnits = fromMinorUnits;
4
4
  exports.fromMinorUnitsExact = fromMinorUnitsExact;
5
5
  exports.parseMajorToMinor = parseMajorToMinor;
6
6
  exports.resolveLocale = resolveLocale;
7
+ exports.formatMoney = formatMoney;
7
8
  const config_1 = require("./config");
8
9
  // This is going to be used for web app to show amount in minor taking into account units configured for the currency
9
10
  function fromMinorUnits(amountMinor, currency) {
@@ -51,3 +52,11 @@ function resolveLocale(uiLanguage, country) {
51
52
  // Fallback: language-only default
52
53
  return config_1.DEFAULT_LOCALE_BY_LANGUAGE[uiLanguage] ?? "en-US";
53
54
  }
55
+ function formatMoney(amountMinor, currency, locale) {
56
+ const amountMajor = fromMinorUnits(amountMinor, currency);
57
+ return new Intl.NumberFormat(locale, {
58
+ style: "currency",
59
+ currency,
60
+ currencyDisplay: "symbol",
61
+ }).format(amountMajor);
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@royalinvest/dto",
3
- "version": "0.69.17",
3
+ "version": "0.69.19",
4
4
  "description": "Data Transfer Objects (DTOs) to carry data between frontend and backend processes.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",