@glissandoo/lib 1.116.0 → 1.117.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.
Files changed (56) hide show
  1. package/functions/event.d.ts +22 -0
  2. package/functions/eventPlayer.d.ts +2 -0
  3. package/functions/eventoPayout.d.ts +70 -0
  4. package/functions/eventoPayout.js +2 -0
  5. package/functions/groupModule.d.ts +13 -0
  6. package/functions/groupModule.js +2 -0
  7. package/functions/groupPayment.d.ts +62 -0
  8. package/functions/groupPayment.js +2 -0
  9. package/functions/groupPayoutRule.d.ts +18 -0
  10. package/functions/groupPayoutRule.js +2 -0
  11. package/functions/index.d.ts +12 -0
  12. package/functions/index.js +12 -0
  13. package/functions/regions.js +12 -0
  14. package/helpers/appScenes.d.ts +2 -0
  15. package/helpers/appScenes.js +2 -0
  16. package/helpers/currency.d.ts +4 -0
  17. package/helpers/currency.js +277 -0
  18. package/helpers/errors.d.ts +7 -1
  19. package/helpers/errors.js +6 -0
  20. package/helpers/paymentForecast.d.ts +37 -0
  21. package/helpers/paymentForecast.js +58 -0
  22. package/helpers/payoutRules.d.ts +45 -0
  23. package/helpers/payoutRules.js +166 -0
  24. package/lang/ca.json +6 -0
  25. package/lang/de.json +6 -0
  26. package/lang/en.json +6 -0
  27. package/lang/es.json +6 -0
  28. package/lang/eu.json +6 -0
  29. package/lang/fr.json +6 -0
  30. package/lang/gl.json +6 -0
  31. package/lang/it.json +6 -0
  32. package/lang/nl.json +6 -0
  33. package/lang/pt.json +6 -0
  34. package/models/Evento/Player/index.d.ts +1 -0
  35. package/models/Evento/Player/index.js +3 -0
  36. package/models/Evento/Player/types.d.ts +1 -0
  37. package/models/Evento/index.d.ts +2 -0
  38. package/models/Evento/index.js +6 -0
  39. package/models/Evento/types.d.ts +13 -1
  40. package/models/Evento/types.js +3 -0
  41. package/models/Group/Payment/index.d.ts +45 -0
  42. package/models/Group/Payment/index.js +110 -0
  43. package/models/Group/Payment/supabase.d.ts +16 -0
  44. package/models/Group/Payment/supabase.js +46 -0
  45. package/models/Group/Payment/types.d.ts +96 -0
  46. package/models/Group/Payment/types.js +26 -0
  47. package/models/Group/index.d.ts +8 -1
  48. package/models/Group/index.js +19 -0
  49. package/models/Group/types.d.ts +30 -0
  50. package/models/Group/types.js +14 -1
  51. package/models/Notification/types.d.ts +4 -1
  52. package/models/Notification/types.js +3 -0
  53. package/package.json +1 -1
  54. package/types/payoutRule.d.ts +126 -0
  55. package/types/payoutRule.js +34 -0
  56. package/types/payoutRule.ts +132 -0
@@ -3,6 +3,7 @@ import { CreatedOn } from '../helpers/types';
3
3
  import { EventPlayerStatus } from '../models/Evento/Player/types';
4
4
  import { EventBasicData, EventData, EventQuestions, EventReminderOptions, EventRepeatPeriod, EventResponseDeadlineOptions, EventSelectionMode, EventStage, EventType } from '../models/Evento/types';
5
5
  import { GroupBasicData } from '../models/Group/types';
6
+ import { PayoutRuleCondition, PayoutRuleEffect } from '../types/payoutRule';
6
7
  export declare namespace EventoFbFunctionsTypes {
7
8
  export enum RelationAction {
8
9
  Single = "single",
@@ -41,10 +42,31 @@ export declare namespace EventoFbFunctionsTypes {
41
42
  };
42
43
  selectionMode: EventSelectionMode | null;
43
44
  sites?: boolean;
45
+ payout?: EventNewPayoutInput | null;
44
46
  questions?: Record<EventPlayerStatus, EventQuestions[]>;
45
47
  reminders?: EventReminderOptions[];
46
48
  }
47
49
  export type PublishResult = string[];
50
+ export interface EventNewPayoutRuleInput {
51
+ id: string;
52
+ name: string;
53
+ order: number;
54
+ sourceGroupRuleId: string | null;
55
+ conditions: PayoutRuleCondition[];
56
+ effect: PayoutRuleEffect;
57
+ }
58
+ export interface EventNewPayoutFixedExpenseInput {
59
+ concept: string;
60
+ amount: number;
61
+ assignedTo: string | null;
62
+ }
63
+ export interface EventNewPayoutInput {
64
+ enabled: boolean;
65
+ budget: number | null;
66
+ importByMember: number | null;
67
+ fixedExpenses: EventNewPayoutFixedExpenseInput[];
68
+ rules: EventNewPayoutRuleInput[];
69
+ }
48
70
  interface EditParamsBase {
49
71
  eventId: string;
50
72
  relations: RelationAction;
@@ -63,5 +63,7 @@ export declare namespace EventoPlayerFbFunctionsTypes {
63
63
  }
64
64
  interface VerifyGeoLocResult {
65
65
  status: 'success' | 'outOfRange' | 'outOfTime' | 'noLocation' | 'disabledVerify';
66
+ amount?: number;
67
+ currency?: string;
66
68
  }
67
69
  }
@@ -0,0 +1,70 @@
1
+ import { EventPayoutConfig } from '../models/Evento/types';
2
+ import { PayoutRuleCondition, PayoutRuleEffect } from '../types/payoutRule';
3
+ export declare namespace EventoPayoutFbFunctionsTypes {
4
+ interface InitializeParams {
5
+ eventId: string;
6
+ grossAmount: number;
7
+ importByMember: number | null;
8
+ currency: string;
9
+ fixedExpenses?: {
10
+ concept: string;
11
+ amount: number;
12
+ assignedTo: string;
13
+ }[];
14
+ }
15
+ interface InitializeResult {
16
+ config: EventPayoutConfig;
17
+ appliedRuleIds: string[];
18
+ materializedPaymentIds: string[];
19
+ }
20
+ interface UpdateConfigParams {
21
+ eventId: string;
22
+ grossAmount?: number;
23
+ importByMember?: number | null;
24
+ currency?: string;
25
+ }
26
+ type UpdateConfigResult = void;
27
+ }
28
+ export declare namespace EventoPayoutRuleFbFunctionsTypes {
29
+ interface CreateParams {
30
+ eventId: string;
31
+ name: string;
32
+ description: string | null;
33
+ order: number;
34
+ conditions: PayoutRuleCondition[];
35
+ effect: PayoutRuleEffect;
36
+ }
37
+ interface CreateResult {
38
+ id: string;
39
+ }
40
+ interface EditParams {
41
+ eventId: string;
42
+ ruleId: string;
43
+ name?: string;
44
+ description?: string | null;
45
+ order?: number;
46
+ conditions?: PayoutRuleCondition[];
47
+ effect?: PayoutRuleEffect;
48
+ }
49
+ type EditResult = void;
50
+ interface RemoveParams {
51
+ eventId: string;
52
+ ruleId: string;
53
+ }
54
+ type RemoveResult = void;
55
+ interface SetRulesInputEntry {
56
+ id: string;
57
+ name: string;
58
+ order: number;
59
+ sourceGroupRuleId: string | null;
60
+ conditions: PayoutRuleCondition[];
61
+ effect: PayoutRuleEffect;
62
+ }
63
+ interface SetRulesParams {
64
+ eventId: string;
65
+ rules: SetRulesInputEntry[];
66
+ }
67
+ interface SetRulesResult {
68
+ rules: import('../types/payoutRule').EventoPayoutRuleEntry[];
69
+ }
70
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { GroupModuleId } from '../models/Group/types';
2
+ export declare namespace GroupModuleFbFunctionsTypes {
3
+ interface EnableParams {
4
+ groupId: string;
5
+ moduleId: GroupModuleId;
6
+ }
7
+ type EnableResult = void;
8
+ interface DisableParams {
9
+ groupId: string;
10
+ moduleId: GroupModuleId;
11
+ }
12
+ type DisableResult = void;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,62 @@
1
+ import { GroupPaymentMethod, GroupPaymentStatus, GroupPaymentType } from '../models/Group/Payment/types';
2
+ export declare namespace GroupPaymentFbFunctionsTypes {
3
+ interface CreateParams {
4
+ groupId: string;
5
+ type: GroupPaymentType;
6
+ eventId?: string | null;
7
+ playerId?: string | null;
8
+ concept: string;
9
+ assignedTo: string;
10
+ totalAmount: number | null;
11
+ currency: string;
12
+ note?: string | null;
13
+ }
14
+ interface CreateResult {
15
+ id: string;
16
+ }
17
+ interface EditParams {
18
+ groupId: string;
19
+ paymentId: string;
20
+ concept?: string;
21
+ assignedTo?: string;
22
+ totalAmount?: number | null;
23
+ currency?: string;
24
+ note?: string | null;
25
+ paymentMethod?: GroupPaymentMethod;
26
+ }
27
+ type EditResult = void;
28
+ interface RemoveParams {
29
+ groupId: string;
30
+ paymentId: string;
31
+ }
32
+ type RemoveResult = void;
33
+ interface MarkPaidParams {
34
+ groupId: string;
35
+ paymentId: string;
36
+ paymentMethod: GroupPaymentMethod;
37
+ paidAt?: string;
38
+ note?: string | null;
39
+ }
40
+ type MarkPaidResult = void;
41
+ interface MarkCancelledParams {
42
+ groupId: string;
43
+ paymentId: string;
44
+ note?: string | null;
45
+ }
46
+ type MarkCancelledResult = void;
47
+ interface SetStatusParams {
48
+ groupId: string;
49
+ paymentId: string;
50
+ status: GroupPaymentStatus;
51
+ paymentMethod?: GroupPaymentMethod | null;
52
+ totalAmount?: number | null;
53
+ note?: string | null;
54
+ }
55
+ type SetStatusResult = void;
56
+ interface ListByUserParams {
57
+ userId: string;
58
+ status?: GroupPaymentStatus;
59
+ type?: GroupPaymentType;
60
+ limit?: number;
61
+ }
62
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { GroupPayoutRuleEntry, PayoutRuleCondition, PayoutRuleEffect } from '../types/payoutRule';
2
+ export declare namespace GroupPayoutRuleFbFunctionsTypes {
3
+ interface SetRulesInputEntry {
4
+ id: string;
5
+ name: string;
6
+ order: number;
7
+ pinned: boolean;
8
+ conditions: PayoutRuleCondition[];
9
+ effect: PayoutRuleEffect;
10
+ }
11
+ interface SetRulesParams {
12
+ groupId: string;
13
+ rules: SetRulesInputEntry[];
14
+ }
15
+ interface SetRulesResult {
16
+ rules: GroupPayoutRuleEntry[];
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -42,6 +42,9 @@ export declare enum FbFunctionName {
42
42
  EventPlayerSwitchInterest = "eventPlayer-switchInterest",
43
43
  EventPlayerValidateRollCall = "eventPlayer-validateRollCall",
44
44
  EventPlayerVerifyGeoLoc = "eventPlayer-verifyGeoLoc",
45
+ EventoPayoutInitialize = "event-payoutInitialize",
46
+ EventoPayoutUpdateConfig = "event-payoutUpdateConfig",
47
+ EventoPayoutRuleSet = "event-payoutRuleSet",
45
48
  EventPublish = "event-publish",
46
49
  EventRemove = "event-remove",
47
50
  EventRepertoryDownload = "eventRepertory-download",
@@ -89,6 +92,15 @@ export declare enum FbFunctionName {
89
92
  GroupPlayerEditFakeInfo = "groupPlayer-editFakeInfo",
90
93
  GroupPlayerSetPermissions = "groupPlayer-updatePermis",
91
94
  GroupPlayerUpdateInstruments = "groupPlayer-updateInstruments",
95
+ GroupPaymentCreate = "groupPayment-create",
96
+ GroupPaymentEdit = "groupPayment-edit",
97
+ GroupPaymentRemove = "groupPayment-remove",
98
+ GroupPaymentMarkPaid = "groupPayment-markPaid",
99
+ GroupPaymentMarkCancelled = "groupPayment-markCancelled",
100
+ GroupPaymentSetStatus = "groupPayment-setStatus",
101
+ GroupEnableModule = "groupModule-enable",
102
+ GroupDisableModule = "groupModule-disable",
103
+ GroupPayoutRuleSet = "group-payoutRuleSet",
92
104
  GroupPublish = "group-publish",
93
105
  GroupRemove = "group-remove",
94
106
  GroupRepertoryClaimMusicSheet = "groupRepertory-claimMusicSheet",
@@ -46,6 +46,9 @@ var FbFunctionName;
46
46
  FbFunctionName["EventPlayerSwitchInterest"] = "eventPlayer-switchInterest";
47
47
  FbFunctionName["EventPlayerValidateRollCall"] = "eventPlayer-validateRollCall";
48
48
  FbFunctionName["EventPlayerVerifyGeoLoc"] = "eventPlayer-verifyGeoLoc";
49
+ FbFunctionName["EventoPayoutInitialize"] = "event-payoutInitialize";
50
+ FbFunctionName["EventoPayoutUpdateConfig"] = "event-payoutUpdateConfig";
51
+ FbFunctionName["EventoPayoutRuleSet"] = "event-payoutRuleSet";
49
52
  FbFunctionName["EventPublish"] = "event-publish";
50
53
  FbFunctionName["EventRemove"] = "event-remove";
51
54
  FbFunctionName["EventRepertoryDownload"] = "eventRepertory-download";
@@ -93,6 +96,15 @@ var FbFunctionName;
93
96
  FbFunctionName["GroupPlayerEditFakeInfo"] = "groupPlayer-editFakeInfo";
94
97
  FbFunctionName["GroupPlayerSetPermissions"] = "groupPlayer-updatePermis";
95
98
  FbFunctionName["GroupPlayerUpdateInstruments"] = "groupPlayer-updateInstruments";
99
+ FbFunctionName["GroupPaymentCreate"] = "groupPayment-create";
100
+ FbFunctionName["GroupPaymentEdit"] = "groupPayment-edit";
101
+ FbFunctionName["GroupPaymentRemove"] = "groupPayment-remove";
102
+ FbFunctionName["GroupPaymentMarkPaid"] = "groupPayment-markPaid";
103
+ FbFunctionName["GroupPaymentMarkCancelled"] = "groupPayment-markCancelled";
104
+ FbFunctionName["GroupPaymentSetStatus"] = "groupPayment-setStatus";
105
+ FbFunctionName["GroupEnableModule"] = "groupModule-enable";
106
+ FbFunctionName["GroupDisableModule"] = "groupModule-disable";
107
+ FbFunctionName["GroupPayoutRuleSet"] = "group-payoutRuleSet";
96
108
  FbFunctionName["GroupPublish"] = "group-publish";
97
109
  FbFunctionName["GroupRemove"] = "group-remove";
98
110
  FbFunctionName["GroupRepertoryClaimMusicSheet"] = "groupRepertory-claimMusicSheet";
@@ -53,6 +53,9 @@ const regionByFunctions = {
53
53
  [index_1.FbFunctionName.EventPlayerSwitchInterest]: GCloudRegions.EuropeWest6,
54
54
  [index_1.FbFunctionName.EventPlayerValidateRollCall]: GCloudRegions.EuropeWest6,
55
55
  [index_1.FbFunctionName.EventPlayerVerifyGeoLoc]: GCloudRegions.EuropeWest6,
56
+ [index_1.FbFunctionName.EventoPayoutInitialize]: GCloudRegions.EuropeWest6,
57
+ [index_1.FbFunctionName.EventoPayoutUpdateConfig]: GCloudRegions.EuropeWest6,
58
+ [index_1.FbFunctionName.EventoPayoutRuleSet]: GCloudRegions.EuropeWest6,
56
59
  [index_1.FbFunctionName.EventPublish]: GCloudRegions.UsCentral1,
57
60
  [index_1.FbFunctionName.EventRemove]: GCloudRegions.UsCentral1,
58
61
  [index_1.FbFunctionName.EventRepertoryDownload]: GCloudRegions.EuropeWest6,
@@ -100,6 +103,15 @@ const regionByFunctions = {
100
103
  [index_1.FbFunctionName.GroupPlayerRemove]: GCloudRegions.UsCentral1,
101
104
  [index_1.FbFunctionName.GroupPlayerSetPermissions]: GCloudRegions.EuropeWest6,
102
105
  [index_1.FbFunctionName.GroupPlayerUpdateInstruments]: GCloudRegions.UsCentral1,
106
+ [index_1.FbFunctionName.GroupPaymentCreate]: GCloudRegions.EuropeWest6,
107
+ [index_1.FbFunctionName.GroupPaymentEdit]: GCloudRegions.EuropeWest6,
108
+ [index_1.FbFunctionName.GroupPaymentRemove]: GCloudRegions.EuropeWest6,
109
+ [index_1.FbFunctionName.GroupPaymentMarkPaid]: GCloudRegions.EuropeWest6,
110
+ [index_1.FbFunctionName.GroupPaymentMarkCancelled]: GCloudRegions.EuropeWest6,
111
+ [index_1.FbFunctionName.GroupPaymentSetStatus]: GCloudRegions.EuropeWest6,
112
+ [index_1.FbFunctionName.GroupEnableModule]: GCloudRegions.EuropeWest6,
113
+ [index_1.FbFunctionName.GroupDisableModule]: GCloudRegions.EuropeWest6,
114
+ [index_1.FbFunctionName.GroupPayoutRuleSet]: GCloudRegions.EuropeWest6,
103
115
  [index_1.FbFunctionName.GroupPublish]: GCloudRegions.EuropeWest6,
104
116
  [index_1.FbFunctionName.GroupRemove]: GCloudRegions.UsCentral1,
105
117
  [index_1.FbFunctionName.GroupRepertoryClaimMusicSheet]: GCloudRegions.UsCentral1,
@@ -79,7 +79,9 @@ export declare enum AppScenes {
79
79
  JoinInstrument = "SelectGroupInstrument",
80
80
  JoinView = "JoinView",
81
81
  Login = "Login",
82
+ GroupPaymentDetail = "GroupPaymentDetail",
82
83
  Modal = "Modal",
84
+ MyPayments = "MyPayments",
83
85
  NewGroup = "NewGroup",
84
86
  NewGroupInfo = "NewGroupInfo",
85
87
  NewGroupMusicMember = "NewGroupMusicMember",
@@ -83,7 +83,9 @@ var AppScenes;
83
83
  AppScenes["JoinInstrument"] = "SelectGroupInstrument";
84
84
  AppScenes["JoinView"] = "JoinView";
85
85
  AppScenes["Login"] = "Login";
86
+ AppScenes["GroupPaymentDetail"] = "GroupPaymentDetail";
86
87
  AppScenes["Modal"] = "Modal";
88
+ AppScenes["MyPayments"] = "MyPayments";
87
89
  AppScenes["NewGroup"] = "NewGroup";
88
90
  AppScenes["NewGroupInfo"] = "NewGroupInfo";
89
91
  AppScenes["NewGroupMusicMember"] = "NewGroupMusicMember";
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_CURRENCY = "EUR";
2
+ export declare const COUNTRY_TO_CURRENCY: Record<string, string>;
3
+ export declare const countryToCurrency: (country: string | null | undefined) => string;
4
+ export declare const getCurrencySymbol: (currency: string, locale?: string) => string;
@@ -0,0 +1,277 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCurrencySymbol = exports.countryToCurrency = exports.COUNTRY_TO_CURRENCY = exports.DEFAULT_CURRENCY = void 0;
4
+ exports.DEFAULT_CURRENCY = 'EUR';
5
+ exports.COUNTRY_TO_CURRENCY = {
6
+ AD: 'EUR',
7
+ AE: 'AED',
8
+ AF: 'AFN',
9
+ AG: 'XCD',
10
+ AI: 'XCD',
11
+ AL: 'ALL',
12
+ AM: 'AMD',
13
+ AO: 'AOA',
14
+ AQ: 'USD',
15
+ AR: 'ARS',
16
+ AS: 'USD',
17
+ AT: 'EUR',
18
+ AU: 'AUD',
19
+ AW: 'AWG',
20
+ AX: 'EUR',
21
+ AZ: 'AZN',
22
+ BA: 'BAM',
23
+ BB: 'BBD',
24
+ BD: 'BDT',
25
+ BE: 'EUR',
26
+ BF: 'XOF',
27
+ BG: 'BGN',
28
+ BH: 'BHD',
29
+ BI: 'BIF',
30
+ BJ: 'XOF',
31
+ BL: 'EUR',
32
+ BM: 'BMD',
33
+ BN: 'BND',
34
+ BO: 'BOB',
35
+ BQ: 'USD',
36
+ BR: 'BRL',
37
+ BS: 'BSD',
38
+ BT: 'BTN',
39
+ BV: 'NOK',
40
+ BW: 'BWP',
41
+ BY: 'BYN',
42
+ BZ: 'BZD',
43
+ CA: 'CAD',
44
+ CC: 'AUD',
45
+ CD: 'CDF',
46
+ CF: 'XAF',
47
+ CG: 'XAF',
48
+ CH: 'CHF',
49
+ CI: 'XOF',
50
+ CK: 'NZD',
51
+ CL: 'CLP',
52
+ CM: 'XAF',
53
+ CN: 'CNY',
54
+ CO: 'COP',
55
+ CR: 'CRC',
56
+ CU: 'CUP',
57
+ CV: 'CVE',
58
+ CW: 'ANG',
59
+ CX: 'AUD',
60
+ CY: 'EUR',
61
+ CZ: 'CZK',
62
+ DE: 'EUR',
63
+ DJ: 'DJF',
64
+ DK: 'DKK',
65
+ DM: 'XCD',
66
+ DO: 'DOP',
67
+ DZ: 'DZD',
68
+ EC: 'USD',
69
+ EE: 'EUR',
70
+ EG: 'EGP',
71
+ EH: 'MAD',
72
+ ER: 'ERN',
73
+ ES: 'EUR',
74
+ ET: 'ETB',
75
+ FI: 'EUR',
76
+ FJ: 'FJD',
77
+ FK: 'FKP',
78
+ FM: 'USD',
79
+ FO: 'DKK',
80
+ FR: 'EUR',
81
+ GA: 'XAF',
82
+ GB: 'GBP',
83
+ GD: 'XCD',
84
+ GE: 'GEL',
85
+ GF: 'EUR',
86
+ GG: 'GBP',
87
+ GH: 'GHS',
88
+ GI: 'GIP',
89
+ GL: 'DKK',
90
+ GM: 'GMD',
91
+ GN: 'GNF',
92
+ GP: 'EUR',
93
+ GQ: 'XAF',
94
+ GR: 'EUR',
95
+ GS: 'GBP',
96
+ GT: 'GTQ',
97
+ GU: 'USD',
98
+ GW: 'XOF',
99
+ GY: 'GYD',
100
+ HK: 'HKD',
101
+ HM: 'AUD',
102
+ HN: 'HNL',
103
+ HR: 'EUR',
104
+ HT: 'HTG',
105
+ HU: 'HUF',
106
+ ID: 'IDR',
107
+ IE: 'EUR',
108
+ IL: 'ILS',
109
+ IM: 'GBP',
110
+ IN: 'INR',
111
+ IO: 'USD',
112
+ IQ: 'IQD',
113
+ IR: 'IRR',
114
+ IS: 'ISK',
115
+ IT: 'EUR',
116
+ JE: 'GBP',
117
+ JM: 'JMD',
118
+ JO: 'JOD',
119
+ JP: 'JPY',
120
+ KE: 'KES',
121
+ KG: 'KGS',
122
+ KH: 'KHR',
123
+ KI: 'AUD',
124
+ KM: 'KMF',
125
+ KN: 'XCD',
126
+ KP: 'KPW',
127
+ KR: 'KRW',
128
+ KW: 'KWD',
129
+ KY: 'KYD',
130
+ KZ: 'KZT',
131
+ LA: 'LAK',
132
+ LB: 'LBP',
133
+ LC: 'XCD',
134
+ LI: 'CHF',
135
+ LK: 'LKR',
136
+ LR: 'LRD',
137
+ LS: 'LSL',
138
+ LT: 'EUR',
139
+ LU: 'EUR',
140
+ LV: 'EUR',
141
+ LY: 'LYD',
142
+ MA: 'MAD',
143
+ MC: 'EUR',
144
+ MD: 'MDL',
145
+ ME: 'EUR',
146
+ MF: 'EUR',
147
+ MG: 'MGA',
148
+ MH: 'USD',
149
+ MK: 'MKD',
150
+ ML: 'XOF',
151
+ MM: 'MMK',
152
+ MN: 'MNT',
153
+ MO: 'MOP',
154
+ MP: 'USD',
155
+ MQ: 'EUR',
156
+ MR: 'MRU',
157
+ MS: 'XCD',
158
+ MT: 'EUR',
159
+ MU: 'MUR',
160
+ MV: 'MVR',
161
+ MW: 'MWK',
162
+ MX: 'MXN',
163
+ MY: 'MYR',
164
+ MZ: 'MZN',
165
+ NA: 'NAD',
166
+ NC: 'XPF',
167
+ NE: 'XOF',
168
+ NF: 'AUD',
169
+ NG: 'NGN',
170
+ NI: 'NIO',
171
+ NL: 'EUR',
172
+ NO: 'NOK',
173
+ NP: 'NPR',
174
+ NR: 'AUD',
175
+ NU: 'NZD',
176
+ NZ: 'NZD',
177
+ OM: 'OMR',
178
+ PA: 'PAB',
179
+ PE: 'PEN',
180
+ PF: 'XPF',
181
+ PG: 'PGK',
182
+ PH: 'PHP',
183
+ PK: 'PKR',
184
+ PL: 'PLN',
185
+ PM: 'EUR',
186
+ PN: 'NZD',
187
+ PR: 'USD',
188
+ PS: 'ILS',
189
+ PT: 'EUR',
190
+ PW: 'USD',
191
+ PY: 'PYG',
192
+ QA: 'QAR',
193
+ RE: 'EUR',
194
+ RO: 'RON',
195
+ RS: 'RSD',
196
+ RU: 'RUB',
197
+ RW: 'RWF',
198
+ SA: 'SAR',
199
+ SB: 'SBD',
200
+ SC: 'SCR',
201
+ SD: 'SDG',
202
+ SE: 'SEK',
203
+ SG: 'SGD',
204
+ SH: 'SHP',
205
+ SI: 'EUR',
206
+ SJ: 'NOK',
207
+ SK: 'EUR',
208
+ SL: 'SLE',
209
+ SM: 'EUR',
210
+ SN: 'XOF',
211
+ SO: 'SOS',
212
+ SR: 'SRD',
213
+ SS: 'SSP',
214
+ ST: 'STN',
215
+ SV: 'USD',
216
+ SX: 'ANG',
217
+ SY: 'SYP',
218
+ SZ: 'SZL',
219
+ TC: 'USD',
220
+ TD: 'XAF',
221
+ TF: 'EUR',
222
+ TG: 'XOF',
223
+ TH: 'THB',
224
+ TJ: 'TJS',
225
+ TK: 'NZD',
226
+ TL: 'USD',
227
+ TM: 'TMT',
228
+ TN: 'TND',
229
+ TO: 'TOP',
230
+ TR: 'TRY',
231
+ TT: 'TTD',
232
+ TV: 'AUD',
233
+ TW: 'TWD',
234
+ TZ: 'TZS',
235
+ UA: 'UAH',
236
+ UG: 'UGX',
237
+ UM: 'USD',
238
+ US: 'USD',
239
+ UY: 'UYU',
240
+ UZ: 'UZS',
241
+ VA: 'EUR',
242
+ VC: 'XCD',
243
+ VE: 'VES',
244
+ VG: 'USD',
245
+ VI: 'USD',
246
+ VN: 'VND',
247
+ VU: 'VUV',
248
+ WF: 'XPF',
249
+ WS: 'WST',
250
+ XK: 'EUR',
251
+ YE: 'YER',
252
+ YT: 'EUR',
253
+ ZA: 'ZAR',
254
+ ZM: 'ZMW',
255
+ ZW: 'ZWG',
256
+ };
257
+ const countryToCurrency = (country) => {
258
+ if (!country)
259
+ return exports.DEFAULT_CURRENCY;
260
+ return exports.COUNTRY_TO_CURRENCY[country.toUpperCase()] || exports.DEFAULT_CURRENCY;
261
+ };
262
+ exports.countryToCurrency = countryToCurrency;
263
+ const getCurrencySymbol = (currency, locale) => {
264
+ try {
265
+ const parts = new Intl.NumberFormat(locale, {
266
+ style: 'currency',
267
+ currency,
268
+ currencyDisplay: 'symbol',
269
+ }).formatToParts(0);
270
+ const symbolPart = parts.find((p) => p.type === 'currency');
271
+ return symbolPart?.value || currency;
272
+ }
273
+ catch {
274
+ return currency;
275
+ }
276
+ };
277
+ exports.getCurrencySymbol = getCurrencySymbol;
@@ -69,7 +69,13 @@ export declare enum HttpsErrorMessages {
69
69
  ThemesWithCustomInstrumentsToBeDeleted = "error.group.themesWithCustomInstrumentsToBeDeleted",
70
70
  CustomerHasGroups = "error.customer.hasGroups",
71
71
  GroupPlayerEditInstumentsNotAllowed = "error.groupPlayer.editInstrumentsNotAllowed",
72
- InvalidEmail = "error.email.noValid"
72
+ InvalidEmail = "error.email.noValid",
73
+ InvalidGroupPayment = "error.groupPayment.noValid",
74
+ InvalidPayoutRule = "error.payoutRule.noValid",
75
+ GroupModuleAlreadyDisabled = "error.groupModule.alreadyDisabled",
76
+ GroupModuleAlreadyEnabled = "error.groupModule.alreadyEnabled",
77
+ GroupModuleNotEnabled = "error.groupModule.notEnabled",
78
+ EventPayoutNotInitialized = "error.eventPayout.notInitialized"
73
79
  }
74
80
  export interface HttpsErrorDetails extends Record<HttpsErrorMessages, unknown> {
75
81
  [HttpsErrorMessages.ThemesWithCustomInstrumentsToBeDeleted]: {
package/helpers/errors.js CHANGED
@@ -71,4 +71,10 @@ var HttpsErrorMessages;
71
71
  HttpsErrorMessages["CustomerHasGroups"] = "error.customer.hasGroups";
72
72
  HttpsErrorMessages["GroupPlayerEditInstumentsNotAllowed"] = "error.groupPlayer.editInstrumentsNotAllowed";
73
73
  HttpsErrorMessages["InvalidEmail"] = "error.email.noValid";
74
+ HttpsErrorMessages["InvalidGroupPayment"] = "error.groupPayment.noValid";
75
+ HttpsErrorMessages["InvalidPayoutRule"] = "error.payoutRule.noValid";
76
+ HttpsErrorMessages["GroupModuleAlreadyDisabled"] = "error.groupModule.alreadyDisabled";
77
+ HttpsErrorMessages["GroupModuleAlreadyEnabled"] = "error.groupModule.alreadyEnabled";
78
+ HttpsErrorMessages["GroupModuleNotEnabled"] = "error.groupModule.notEnabled";
79
+ HttpsErrorMessages["EventPayoutNotInitialized"] = "error.eventPayout.notInitialized";
74
80
  })(HttpsErrorMessages = exports.HttpsErrorMessages || (exports.HttpsErrorMessages = {}));
@@ -0,0 +1,37 @@
1
+ import { AEventPlayerBasicData, EventPayoutConfig, EventSelectionMode } from '../models/Evento/types';
2
+ import { AppliedRuleEntry } from './payoutRules';
3
+ export interface EventPaymentForecastEntry {
4
+ playerId: string;
5
+ displayName: string;
6
+ mainInstrument: string;
7
+ photoURL: string;
8
+ isGuest: boolean;
9
+ currency: string;
10
+ baseAmount: number | null;
11
+ totalAmount: number | null;
12
+ appliedRules: AppliedRuleEntry[];
13
+ }
14
+ export interface BuildEventPaymentForecastInput {
15
+ players: AEventPlayerBasicData[];
16
+ payout: EventPayoutConfig | null;
17
+ /** Set of player ids that already have at least one payment for this event (any status). */
18
+ playerIdsWithPayment: ReadonlySet<string>;
19
+ selectionMode: EventSelectionMode | null;
20
+ /** When true (event already roll-called) the forecast is no longer relevant. */
21
+ isRollCalled: boolean;
22
+ }
23
+ /**
24
+ * Computes the simulated ("forecast") payment rows shown in the event payments
25
+ * tab for players that don't yet have a real payment.
26
+ *
27
+ * Exclusion rules per player:
28
+ * - There is already a payment for the player on this event.
29
+ * - `status === Declined`.
30
+ * - When `selectionMode === Closed`, require `selected === true` (rejects
31
+ * `false` and `null`).
32
+ * - The payout rules engine returns `excluded` (PlayerExclude rule).
33
+ *
34
+ * Returns an empty array when no `payout` is configured for the event or when
35
+ * the event has already been roll-called (`isRollCalled`).
36
+ */
37
+ export declare function buildEventPaymentForecast({ players, payout, playerIdsWithPayment, selectionMode, isRollCalled, }: BuildEventPaymentForecastInput): EventPaymentForecastEntry[];