@glissandoo/lib 1.115.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.
- package/functions/auth.d.ts +1 -3
- package/functions/customer.d.ts +0 -4
- package/functions/event.d.ts +22 -0
- package/functions/event.js +1 -1
- package/functions/eventPlayer.d.ts +2 -0
- package/functions/eventPlayer.js +1 -1
- package/functions/eventRepertory.d.ts +0 -2
- package/functions/eventRepertory.js +1 -1
- package/functions/eventoPayout.d.ts +70 -0
- package/functions/groupModule.d.ts +13 -0
- package/functions/groupPayment.d.ts +62 -0
- package/functions/groupPayoutRule.d.ts +18 -0
- package/functions/groupRepertory.d.ts +0 -110
- package/functions/index.d.ts +12 -30
- package/functions/index.js +13 -31
- package/functions/misc.d.ts +0 -6
- package/functions/regions.js +13 -31
- package/helpers/appScenes.d.ts +2 -0
- package/helpers/appScenes.js +3 -1
- package/helpers/auth.d.ts +9 -2
- package/helpers/auth.js +14 -33
- package/helpers/badges.js +1 -1
- package/helpers/collections.js +2 -2
- package/helpers/communicationTemplate/index.d.ts +2 -3
- package/helpers/communicationTemplate/index.js +5 -5
- package/helpers/currency.d.ts +4 -19
- package/helpers/currency.js +264 -72
- package/helpers/dlinks.js +1 -1
- package/helpers/errors.d.ts +7 -2
- package/helpers/errors.js +7 -2
- package/helpers/glissandooAdmin.d.ts +3 -0
- package/helpers/glissandooAdmin.js +6 -0
- package/helpers/instruments/index.d.ts +0 -17
- package/helpers/instruments/index.js +1 -5
- package/helpers/instruments/lists.d.ts +3 -3
- package/helpers/instruments/lists.js +5 -5
- package/helpers/musicStyles/index.d.ts +4 -22
- package/helpers/musicStyles/index.js +35 -114
- package/helpers/notifications/index.js +1 -1
- package/helpers/objects.d.ts +1 -5
- package/helpers/objects.js +6 -7
- package/helpers/paymentForecast.d.ts +37 -0
- package/helpers/paymentForecast.js +58 -0
- package/helpers/payoutRules.d.ts +45 -0
- package/helpers/payoutRules.js +166 -0
- package/helpers/plans.js +2 -2
- package/helpers/rates.d.ts +1 -1
- package/helpers/slate.d.ts +5 -64
- package/helpers/slate.js +1 -7
- package/helpers/ts-extras/array-includes.js +2 -1
- package/helpers/ts-extras/as-mutable.js +2 -1
- package/helpers/ts-extras/assert-error.js +2 -1
- package/helpers/ts-extras/index.js +1 -1
- package/helpers/ts-extras/is-defined.js +2 -1
- package/helpers/ts-extras/is-empty.js +2 -1
- package/helpers/ts-extras/is-infinite.js +2 -1
- package/helpers/ts-extras/is-present.js +2 -1
- package/helpers/ts-extras/object-entries.d.ts +1 -1
- package/helpers/ts-extras/object-from-entries.d.ts +1 -1
- package/helpers/ts-extras/object-has-own.js +2 -1
- package/helpers/ts-extras/object-keys.d.ts +1 -1
- package/helpers/ts-extras/object-keys.js +1 -0
- package/helpers/ts-extras/set-has.js +2 -1
- package/helpers/types.d.ts +0 -26
- package/helpers/types.js +5 -25
- package/lang/ca.json +97 -325
- package/lang/de.json +97 -325
- package/lang/en.json +97 -325
- package/lang/es.json +97 -325
- package/lang/eu.json +97 -325
- package/lang/fr.json +97 -325
- package/lang/gl.json +97 -325
- package/lang/index.js +2 -3
- package/lang/it.json +97 -325
- package/lang/nl.json +97 -325
- package/lang/pt.json +97 -325
- package/models/Communication/types.d.ts +16 -0
- package/models/Communication/types.js +9 -3
- package/models/Counters/Group/Analytics/types.js +1 -1
- package/models/Customer/index.d.ts +1 -1
- package/models/Customer/index.js +3 -3
- package/models/Customer/types.js +1 -1
- package/models/Evento/Player/index.d.ts +1 -0
- package/models/Evento/Player/index.js +3 -0
- package/models/Evento/Player/types.d.ts +1 -0
- package/models/Evento/Player/types.js +3 -3
- package/models/Evento/Repertory/types.d.ts +1 -2
- package/models/Evento/index.d.ts +4 -3
- package/models/Evento/index.js +10 -5
- package/models/Evento/types.d.ts +43 -2
- package/models/Evento/types.js +42 -8
- package/models/Federation/index.d.ts +1 -1
- package/models/Federation/index.js +3 -3
- package/models/Group/Analytics/types.js +1 -1
- package/models/Group/Payment/index.d.ts +45 -0
- package/models/Group/Payment/index.js +110 -0
- package/models/Group/Payment/supabase.d.ts +16 -0
- package/models/Group/Payment/supabase.js +46 -0
- package/models/Group/Payment/types.d.ts +96 -0
- package/models/Group/Payment/types.js +26 -0
- package/models/Group/Player/types.js +1 -1
- package/models/Group/Repertory/File/Section/index.d.ts +3 -3
- package/models/Group/Repertory/File/Section/index.js +2 -3
- package/models/Group/Repertory/File/Section/types.d.ts +0 -7
- package/models/Group/Repertory/File/Section/types.js +1 -1
- package/models/Group/Repertory/File/index.d.ts +2 -4
- package/models/Group/Repertory/File/index.js +4 -4
- package/models/Group/Repertory/FilePath/index.d.ts +4 -3
- package/models/Group/Repertory/index.d.ts +4 -12
- package/models/Group/Repertory/index.js +0 -9
- package/models/Group/Repertory/types.d.ts +32 -21
- package/models/Group/Repertory/types.js +18 -8
- package/models/Group/index.d.ts +20 -15
- package/models/Group/index.js +34 -16
- package/models/Group/types.d.ts +96 -6
- package/models/Group/types.js +63 -8
- package/models/Instrument/{fromRecord.d.ts → group.d.ts} +5 -4
- package/models/Instrument/{fromRecord.js → group.js} +10 -10
- package/models/Instrument/index.d.ts +0 -2
- package/models/Instrument/index.js +1 -38
- package/models/Inventory/Item/types.js +2 -2
- package/models/Inventory/types.js +1 -1
- package/models/Notification/types.d.ts +4 -1
- package/models/Notification/types.js +5 -2
- package/models/Offer/types.d.ts +12 -0
- package/models/Offer/types.js +15 -2
- package/models/Partnership/Partner/types.js +1 -1
- package/models/Partnership/Payment/types.js +2 -2
- package/models/Partnership/index.d.ts +1 -1
- package/models/Partnership/index.js +3 -3
- package/models/Partnership/types.js +1 -1
- package/models/Repertory/types.d.ts +0 -12
- package/models/Repertory/types.js +2 -2
- package/models/User/Group/index.js +2 -1
- package/models/User/index.d.ts +1 -1
- package/models/User/index.js +3 -3
- package/models/User/types.d.ts +1 -2
- package/models/User/types.js +7 -7
- package/models/WebhookEvent/types.js +1 -1
- package/package.json +20 -28
- package/types/firestore.d.ts +1 -0
- package/types/firestore.js +1 -1
- package/types/payoutRule.d.ts +126 -0
- package/types/payoutRule.js +34 -0
- package/types/payoutRule.ts +132 -0
- package/types/supabase/generated.d.ts +545 -3113
- package/types/supabase/generated.js +0 -9
- package/types/supabase/generated.ts +581 -3080
- package/types/supabase/index.d.ts +19 -155
- package/types/supabase/index.js +0 -15
- package/types/supabase/index.ts +21 -288
- package/types/supabase/overwrites/comm.d.ts +18 -0
- package/types/supabase/overwrites/comm.ts +18 -0
- package/types/supabase/overwrites/comm_history.d.ts +10 -0
- package/types/supabase/overwrites/comm_history.ts +10 -0
- package/types/supabase/overwrites/{tables/event/index.d.ts → event.d.ts} +1 -1
- package/types/supabase/overwrites/{tables/event/index.ts → event.ts} +1 -1
- package/types/supabase/overwrites/event_history.d.ts +10 -0
- package/types/supabase/overwrites/event_history.ts +10 -0
- package/types/supabase/overwrites/{tables/group/index.d.ts → group.d.ts} +5 -2
- package/types/supabase/overwrites/{tables/group/index.ts → group.ts} +6 -2
- package/types/supabase/overwrites/group_history.d.ts +9 -0
- package/types/supabase/overwrites/group_history.ts +9 -0
- package/types/supabase/overwrites/index.d.ts +1 -1
- package/types/supabase/overwrites/index.ts +1 -1
- package/types/supabase/overwrites/{tables/offer/index.d.ts → offer.d.ts} +2 -6
- package/types/supabase/overwrites/{tables/offer/index.ts → offer.ts} +2 -7
- package/types/supabase/overwrites/offer_history.d.ts +10 -0
- package/types/supabase/overwrites/offer_history.ts +10 -0
- package/types/supabase/overwrites/repertoire.d.ts +12 -0
- package/types/supabase/overwrites/repertoire.ts +12 -0
- package/types/supabase/overwrites/repertoire_history.d.ts +10 -0
- package/types/supabase/overwrites/repertoire_history.ts +10 -0
- package/functions/composer.d.ts +0 -13
- package/functions/composerComposition.d.ts +0 -102
- package/functions/composerNotification.d.ts +0 -38
- package/functions/composerPayout.d.ts +0 -20
- package/helpers/catalogBridge.d.ts +0 -121
- package/helpers/catalogBridge.js +0 -95
- package/helpers/compositionCategories/genres.d.ts +0 -922
- package/helpers/compositionCategories/genres.js +0 -940
- package/helpers/compositionCategories/index.d.ts +0 -2
- package/helpers/compositionCategories/index.js +0 -18
- package/helpers/compositionCategories/styles.d.ts +0 -181
- package/helpers/compositionCategories/styles.js +0 -197
- package/helpers/compositionSoloistOffstageParts/index.d.ts +0 -34
- package/helpers/compositionSoloistOffstageParts/index.js +0 -117
- package/helpers/currencyConversion.d.ts +0 -45
- package/helpers/currencyConversion.js +0 -119
- package/helpers/dataStructures/trees/index.d.ts +0 -12
- package/helpers/dataStructures/trees/index.js +0 -71
- package/helpers/dataStructures/trees/types.d.ts +0 -14
- package/helpers/dataStructures/trees/types.js +0 -5
- package/helpers/externalUrls.d.ts +0 -12
- package/helpers/externalUrls.js +0 -40
- package/models/CompositionGenre/index.d.ts +0 -9
- package/models/CompositionGenre/index.js +0 -16
- package/models/CompositionStyle/index.d.ts +0 -9
- package/models/CompositionStyle/index.js +0 -16
- package/models/supabase/Comm/index.d.ts +0 -24
- package/models/supabase/Comm/index.js +0 -68
- package/models/supabase/Comm/types.d.ts +0 -6
- package/models/supabase/CommHistory/index.d.ts +0 -22
- package/models/supabase/CommHistory/index.js +0 -37
- package/models/supabase/CommHistory/types.d.ts +0 -11
- package/models/supabase/CommHistory/types.js +0 -9
- package/models/supabase/Composer/Composition/Acquisition/index.d.ts +0 -4
- package/models/supabase/Composer/Composition/Acquisition/index.js +0 -9
- package/models/supabase/Composer/Composition/Acquisition/types.d.ts +0 -36
- package/models/supabase/Composer/Composition/Favorite/index.d.ts +0 -4
- package/models/supabase/Composer/Composition/Favorite/index.js +0 -9
- package/models/supabase/Composer/Composition/Favorite/types.d.ts +0 -6
- package/models/supabase/Composer/Composition/View/index.d.ts +0 -4
- package/models/supabase/Composer/Composition/View/index.js +0 -9
- package/models/supabase/Composer/Composition/View/types.d.ts +0 -6
- package/models/supabase/Composer/Composition/index.d.ts +0 -5284
- package/models/supabase/Composer/Composition/index.js +0 -166
- package/models/supabase/Composer/Composition/types.d.ts +0 -96
- package/models/supabase/Composer/Composition/types.js +0 -32
- package/models/supabase/Composer/Notification/index.d.ts +0 -4
- package/models/supabase/Composer/Notification/index.js +0 -9
- package/models/supabase/Composer/Notification/types.d.ts +0 -39
- package/models/supabase/Composer/Notification/types.js +0 -27
- package/models/supabase/Composer/Payout/index.d.ts +0 -4
- package/models/supabase/Composer/Payout/index.js +0 -9
- package/models/supabase/Composer/Payout/status.d.ts +0 -1
- package/models/supabase/Composer/Payout/types.d.ts +0 -5
- package/models/supabase/Composer/PerformanceAttendance/types.d.ts +0 -4
- package/models/supabase/Composer/index.d.ts +0 -78
- package/models/supabase/Composer/index.js +0 -105
- package/models/supabase/Composer/types.d.ts +0 -6
- package/models/supabase/EventHistory/index.d.ts +0 -22
- package/models/supabase/EventHistory/index.js +0 -37
- package/models/supabase/EventHistory/types.d.ts +0 -36
- package/models/supabase/EventHistory/types.js +0 -34
- package/models/supabase/GroupHistory/index.d.ts +0 -21
- package/models/supabase/GroupHistory/index.js +0 -34
- package/models/supabase/GroupHistory/types.d.ts +0 -27
- package/models/supabase/GroupHistory/types.js +0 -25
- package/models/supabase/Model/index.d.ts +0 -10
- package/models/supabase/Model/index.js +0 -21
- package/models/supabase/OfferHistory/index.d.ts +0 -22
- package/models/supabase/OfferHistory/index.js +0 -37
- package/models/supabase/OfferHistory/types.d.ts +0 -18
- package/models/supabase/OfferHistory/types.js +0 -16
- package/models/supabase/Repertoire/index.d.ts +0 -16
- package/models/supabase/Repertoire/index.js +0 -43
- package/models/supabase/Repertoire/types.d.ts +0 -6
- package/models/supabase/RepertoireHistory/index.d.ts +0 -22
- package/models/supabase/RepertoireHistory/index.js +0 -37
- package/models/supabase/RepertoireHistory/types.d.ts +0 -21
- package/models/supabase/RepertoireHistory/types.js +0 -19
- package/models/supabase/User/Group/index.d.ts +0 -11
- package/models/supabase/User/Group/index.js +0 -30
- package/models/supabase/User/Group/types.d.ts +0 -6
- package/models/supabase/User/index.d.ts +0 -13
- package/models/supabase/User/index.js +0 -37
- package/models/supabase/User/types.d.ts +0 -6
- package/types/supabase/catalog.d.ts +0 -46
- package/types/supabase/catalog.js +0 -2
- package/types/supabase/catalog.ts +0 -67
- package/types/supabase/composerMetrics.d.ts +0 -27
- package/types/supabase/composerMetrics.js +0 -2
- package/types/supabase/composerMetrics.ts +0 -26
- package/types/supabase/overwrites/tables/comm/model.d.ts +0 -4
- package/types/supabase/overwrites/tables/comm/model.js +0 -2
- package/types/supabase/overwrites/tables/comm/model.ts +0 -4
- package/types/supabase/overwrites/tables/comm_history/index.d.ts +0 -7
- package/types/supabase/overwrites/tables/comm_history/index.js +0 -2
- package/types/supabase/overwrites/tables/comm_history/index.ts +0 -9
- package/types/supabase/overwrites/tables/comm_history/model.d.ts +0 -10
- package/types/supabase/overwrites/tables/comm_history/model.js +0 -2
- package/types/supabase/overwrites/tables/comm_history/model.ts +0 -13
- package/types/supabase/overwrites/tables/common/index.js +0 -2
- package/types/supabase/overwrites/tables/composer/index.d.ts +0 -9
- package/types/supabase/overwrites/tables/composer/index.js +0 -2
- package/types/supabase/overwrites/tables/composer/index.ts +0 -10
- package/types/supabase/overwrites/tables/composer/model.d.ts +0 -12
- package/types/supabase/overwrites/tables/composer/model.js +0 -2
- package/types/supabase/overwrites/tables/composer/model.ts +0 -15
- package/types/supabase/overwrites/tables/composer/publicModel.d.ts +0 -11
- package/types/supabase/overwrites/tables/composer/publicModel.js +0 -2
- package/types/supabase/overwrites/tables/composer/publicModel.ts +0 -15
- package/types/supabase/overwrites/tables/composerComposition/index.d.ts +0 -18
- package/types/supabase/overwrites/tables/composerComposition/index.js +0 -2
- package/types/supabase/overwrites/tables/composerComposition/index.ts +0 -24
- package/types/supabase/overwrites/tables/composerComposition/model.d.ts +0 -9
- package/types/supabase/overwrites/tables/composerComposition/model.js +0 -2
- package/types/supabase/overwrites/tables/composerComposition/model.ts +0 -26
- package/types/supabase/overwrites/tables/composerComposition/publicModel.d.ts +0 -9
- package/types/supabase/overwrites/tables/composerComposition/publicModel.js +0 -2
- package/types/supabase/overwrites/tables/composerComposition/publicModel.ts +0 -37
- package/types/supabase/overwrites/tables/composerNotification/index.d.ts +0 -19
- package/types/supabase/overwrites/tables/composerNotification/index.js +0 -2
- package/types/supabase/overwrites/tables/composerNotification/index.ts +0 -25
- package/types/supabase/overwrites/tables/composerOwnedTransaction/model.d.ts +0 -2
- package/types/supabase/overwrites/tables/composerOwnedTransaction/model.js +0 -2
- package/types/supabase/overwrites/tables/composerOwnedTransaction/model.ts +0 -3
- package/types/supabase/overwrites/tables/composerPayout/index.d.ts +0 -7
- package/types/supabase/overwrites/tables/composerPayout/index.js +0 -2
- package/types/supabase/overwrites/tables/composerPayout/index.ts +0 -8
- package/types/supabase/overwrites/tables/compositionAcquisition/index.d.ts +0 -4
- package/types/supabase/overwrites/tables/compositionAcquisition/index.js +0 -2
- package/types/supabase/overwrites/tables/compositionAcquisition/index.ts +0 -8
- package/types/supabase/overwrites/tables/compositionAcquisition/model.d.ts +0 -6
- package/types/supabase/overwrites/tables/compositionAcquisition/model.js +0 -2
- package/types/supabase/overwrites/tables/compositionAcquisition/model.ts +0 -11
- package/types/supabase/overwrites/tables/compositionFavorite/index.d.ts +0 -1
- package/types/supabase/overwrites/tables/compositionFavorite/index.js +0 -2
- package/types/supabase/overwrites/tables/compositionFavorite/index.ts +0 -2
- package/types/supabase/overwrites/tables/compositionFavorite/model.d.ts +0 -1
- package/types/supabase/overwrites/tables/compositionFavorite/model.js +0 -2
- package/types/supabase/overwrites/tables/compositionFavorite/model.ts +0 -1
- package/types/supabase/overwrites/tables/compositionView/index.d.ts +0 -1
- package/types/supabase/overwrites/tables/compositionView/index.js +0 -2
- package/types/supabase/overwrites/tables/compositionView/index.ts +0 -2
- package/types/supabase/overwrites/tables/compositionView/model.d.ts +0 -1
- package/types/supabase/overwrites/tables/compositionView/model.js +0 -2
- package/types/supabase/overwrites/tables/compositionView/model.ts +0 -1
- package/types/supabase/overwrites/tables/currencyExchangeRate/index.d.ts +0 -16
- package/types/supabase/overwrites/tables/currencyExchangeRate/index.js +0 -2
- package/types/supabase/overwrites/tables/currencyExchangeRate/index.ts +0 -18
- package/types/supabase/overwrites/tables/event/index.js +0 -2
- package/types/supabase/overwrites/tables/event_history/index.d.ts +0 -7
- package/types/supabase/overwrites/tables/event_history/index.js +0 -2
- package/types/supabase/overwrites/tables/event_history/index.ts +0 -9
- package/types/supabase/overwrites/tables/event_history/model.d.ts +0 -10
- package/types/supabase/overwrites/tables/event_history/model.js +0 -2
- package/types/supabase/overwrites/tables/event_history/model.ts +0 -13
- package/types/supabase/overwrites/tables/group/index.js +0 -2
- package/types/supabase/overwrites/tables/group_history/index.d.ts +0 -7
- package/types/supabase/overwrites/tables/group_history/index.js +0 -2
- package/types/supabase/overwrites/tables/group_history/index.ts +0 -9
- package/types/supabase/overwrites/tables/group_history/model.d.ts +0 -10
- package/types/supabase/overwrites/tables/group_history/model.js +0 -2
- package/types/supabase/overwrites/tables/group_history/model.ts +0 -13
- package/types/supabase/overwrites/tables/offer/index.js +0 -2
- package/types/supabase/overwrites/tables/offer_history/index.d.ts +0 -7
- package/types/supabase/overwrites/tables/offer_history/index.js +0 -2
- package/types/supabase/overwrites/tables/offer_history/index.ts +0 -9
- package/types/supabase/overwrites/tables/offer_history/model.d.ts +0 -10
- package/types/supabase/overwrites/tables/offer_history/model.js +0 -2
- package/types/supabase/overwrites/tables/offer_history/model.ts +0 -13
- package/types/supabase/overwrites/tables/repertoire/model.d.ts +0 -7
- package/types/supabase/overwrites/tables/repertoire/model.js +0 -2
- package/types/supabase/overwrites/tables/repertoire/model.ts +0 -7
- package/types/supabase/overwrites/tables/repertoire_history/index.d.ts +0 -7
- package/types/supabase/overwrites/tables/repertoire_history/index.js +0 -2
- package/types/supabase/overwrites/tables/repertoire_history/index.ts +0 -9
- package/types/supabase/overwrites/tables/repertoire_history/model.d.ts +0 -10
- package/types/supabase/overwrites/tables/repertoire_history/model.js +0 -2
- package/types/supabase/overwrites/tables/repertoire_history/model.ts +0 -13
- package/types/supabase/overwrites/tables/user/index.d.ts +0 -11
- package/types/supabase/overwrites/tables/user/index.js +0 -2
- package/types/supabase/overwrites/tables/user/index.ts +0 -13
- /package/functions/{composer.js → eventoPayout.js} +0 -0
- /package/functions/{composerComposition.js → groupModule.js} +0 -0
- /package/functions/{composerNotification.js → groupPayment.js} +0 -0
- /package/functions/{composerPayout.js → groupPayoutRule.js} +0 -0
- /package/{models/supabase/Comm/types.js → types/supabase/overwrites/comm.js} +0 -0
- /package/{models/supabase/Composer/Composition/Acquisition/types.js → types/supabase/overwrites/comm_history.js} +0 -0
- /package/{models/supabase/Composer/Composition/Favorite/types.js → types/supabase/overwrites/event.js} +0 -0
- /package/{models/supabase/Composer/Composition/View/types.js → types/supabase/overwrites/event_history.js} +0 -0
- /package/{models/supabase/Composer/Payout/status.js → types/supabase/overwrites/group.js} +0 -0
- /package/{models/supabase/Composer/Payout/types.js → types/supabase/overwrites/group_history.js} +0 -0
- /package/{models/supabase/Composer/PerformanceAttendance/types.js → types/supabase/overwrites/offer.js} +0 -0
- /package/{models/supabase/Composer/types.js → types/supabase/overwrites/offer_history.js} +0 -0
- /package/{models/supabase/Repertoire/types.js → types/supabase/overwrites/repertoire.js} +0 -0
- /package/{models/supabase/User/Group/types.js → types/supabase/overwrites/repertoire_history.js} +0 -0
- /package/types/supabase/overwrites/{tables/common/index.d.ts → utils.d.ts} +0 -0
- /package/{models/supabase/User/types.js → types/supabase/overwrites/utils.js} +0 -0
- /package/types/supabase/overwrites/{tables/common/index.ts → utils.ts} +0 -0
package/models/User/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = require("lodash");
|
|
7
7
|
const collections_1 = require("../../helpers/collections");
|
|
8
|
-
const
|
|
8
|
+
const glissandooAdmin_1 = require("../../helpers/glissandooAdmin");
|
|
9
9
|
const objects_1 = require("../../helpers/objects");
|
|
10
10
|
const utils_1 = require("../../helpers/utils");
|
|
11
11
|
const lang_1 = require("../../lang");
|
|
@@ -153,8 +153,8 @@ class User extends extended_1.default {
|
|
|
153
153
|
get lastWebLoginAt() {
|
|
154
154
|
return this.data.lastWebLoginAt || null;
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
return (0,
|
|
156
|
+
get glissandooAdminUrl() {
|
|
157
|
+
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.User, this.id);
|
|
158
158
|
}
|
|
159
159
|
get customerIds() {
|
|
160
160
|
return this.data.customerIds || [];
|
package/models/User/types.d.ts
CHANGED
package/models/User/types.js
CHANGED
|
@@ -5,13 +5,13 @@ var UserRole;
|
|
|
5
5
|
(function (UserRole) {
|
|
6
6
|
UserRole["SuperAdmin"] = "admin";
|
|
7
7
|
UserRole["User"] = "user";
|
|
8
|
-
})(UserRole
|
|
8
|
+
})(UserRole = exports.UserRole || (exports.UserRole = {}));
|
|
9
9
|
var UserRegisterVia;
|
|
10
10
|
(function (UserRegisterVia) {
|
|
11
11
|
UserRegisterVia["Web"] = "web";
|
|
12
12
|
UserRegisterVia["App"] = "app";
|
|
13
13
|
UserRegisterVia["Invitation"] = "invitation";
|
|
14
|
-
})(UserRegisterVia
|
|
14
|
+
})(UserRegisterVia = exports.UserRegisterVia || (exports.UserRegisterVia = {}));
|
|
15
15
|
var UserAppConfig;
|
|
16
16
|
(function (UserAppConfig) {
|
|
17
17
|
UserAppConfig["DefaultGroupId"] = "default_group_id";
|
|
@@ -24,7 +24,7 @@ var UserAppConfig;
|
|
|
24
24
|
UserAppConfig["OffersFilterCountry"] = "offers_filter_country";
|
|
25
25
|
UserAppConfig["OffersFilterInstrument"] = "offers_filter_instrument";
|
|
26
26
|
UserAppConfig["OffersFilterMusicStyle"] = "offers_filter_music_style";
|
|
27
|
-
})(UserAppConfig
|
|
27
|
+
})(UserAppConfig = exports.UserAppConfig || (exports.UserAppConfig = {}));
|
|
28
28
|
var UserDashboardConfig;
|
|
29
29
|
(function (UserDashboardConfig) {
|
|
30
30
|
UserDashboardConfig["DefaultGroupId"] = "default_group_id";
|
|
@@ -32,18 +32,18 @@ var UserDashboardConfig;
|
|
|
32
32
|
UserDashboardConfig["RepertoireOrderBy"] = "repertoire_order_by";
|
|
33
33
|
UserDashboardConfig["RepertoireOrderDirection"] = "repertoire_order_direction";
|
|
34
34
|
UserDashboardConfig["EventsType"] = "events_type";
|
|
35
|
-
})(UserDashboardConfig
|
|
35
|
+
})(UserDashboardConfig = exports.UserDashboardConfig || (exports.UserDashboardConfig = {}));
|
|
36
36
|
var UserNotificationSettings;
|
|
37
37
|
(function (UserNotificationSettings) {
|
|
38
38
|
UserNotificationSettings["AttendanceConfirmed"] = "enabled_attendance_confirmed";
|
|
39
39
|
UserNotificationSettings["AttendanceDeclined"] = "enabled_attendance_declined";
|
|
40
40
|
UserNotificationSettings["NewMembers"] = "enabled_new_members";
|
|
41
|
-
})(UserNotificationSettings
|
|
41
|
+
})(UserNotificationSettings = exports.UserNotificationSettings || (exports.UserNotificationSettings = {}));
|
|
42
42
|
var UserEmailSettings;
|
|
43
43
|
(function (UserEmailSettings) {
|
|
44
44
|
UserEmailSettings["ReminderBiweeklyEvents"] = "enabled_reminder_biweekly_events";
|
|
45
45
|
UserEmailSettings["Newsletter"] = "enabled_newsletter";
|
|
46
|
-
})(UserEmailSettings
|
|
46
|
+
})(UserEmailSettings = exports.UserEmailSettings || (exports.UserEmailSettings = {}));
|
|
47
47
|
var UserEventsFilter;
|
|
48
48
|
(function (UserEventsFilter) {
|
|
49
49
|
UserEventsFilter[UserEventsFilter["Month"] = 1] = "Month";
|
|
@@ -51,4 +51,4 @@ var UserEventsFilter;
|
|
|
51
51
|
UserEventsFilter[UserEventsFilter["SemiAnnual"] = 6] = "SemiAnnual";
|
|
52
52
|
UserEventsFilter[UserEventsFilter["Annual"] = 12] = "Annual";
|
|
53
53
|
UserEventsFilter[UserEventsFilter["Always"] = 1000] = "Always";
|
|
54
|
-
})(UserEventsFilter
|
|
54
|
+
})(UserEventsFilter = exports.UserEventsFilter || (exports.UserEventsFilter = {}));
|
|
@@ -6,4 +6,4 @@ var WebhookEventSource;
|
|
|
6
6
|
WebhookEventSource["stripe"] = "stripe";
|
|
7
7
|
WebhookEventSource["messageBird"] = "messageBird";
|
|
8
8
|
WebhookEventSource["gocardless"] = "gocardless";
|
|
9
|
-
})(WebhookEventSource
|
|
9
|
+
})(WebhookEventSource = exports.WebhookEventSource || (exports.WebhookEventSource = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissandoo/lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.117.0",
|
|
4
4
|
"description": "Glissandoo library js",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -14,57 +14,49 @@
|
|
|
14
14
|
"lint:single": "eslint",
|
|
15
15
|
"lint": "eslint --ext .ts ./src",
|
|
16
16
|
"postversion": "git push && git push --tags",
|
|
17
|
-
"prepare": "npm run build:link",
|
|
17
|
+
"prepare": "rm -rf ./lib && npm run build:link",
|
|
18
18
|
"preversion": "npm run lint",
|
|
19
19
|
"publish:beta": "npm publish --tag beta",
|
|
20
20
|
"set-husky": "node scripts/setHusky.js",
|
|
21
|
-
"supabase:dev:env:update": "firebase --project=dev functions:secrets:set SUPABASE_ENV --data-file supabase/.env
|
|
22
|
-
"supabase:dev:env:download": "firebase --project=dev functions:secrets:access SUPABASE_ENV > supabase/.env
|
|
23
|
-
"supabase:prod:env:update": "firebase --project=production functions:secrets:set SUPABASE_ENV --data-file supabase/.env
|
|
24
|
-
"supabase:prod:env:download": "firebase --project=production functions:secrets:access SUPABASE_ENV > supabase/.env
|
|
21
|
+
"supabase:dev:env:update": "firebase --project=dev functions:secrets:set SUPABASE_ENV --data-file supabase/.dev.env",
|
|
22
|
+
"supabase:dev:env:download": "firebase --project=dev functions:secrets:access SUPABASE_ENV > supabase/.dev.env",
|
|
23
|
+
"supabase:prod:env:update": "firebase --project=production functions:secrets:set SUPABASE_ENV --data-file supabase/.prod.env",
|
|
24
|
+
"supabase:prod:env:download": "firebase --project=production functions:secrets:access SUPABASE_ENV > supabase/.prod.env",
|
|
25
25
|
"runtimeconfig:download": "firebase functions:secrets:access RUNTIMECONFIG > .runtimeconfig.json",
|
|
26
|
-
"supabase:
|
|
27
|
-
"supabase:
|
|
28
|
-
"supabase:
|
|
29
|
-
"supabase:
|
|
30
|
-
"supabase:
|
|
31
|
-
"supabase:local:types": "npm run --silent supabase:local -- gen types typescript --local > src/types/supabase/generated.ts && prettier --write src/types/supabase/generated.ts",
|
|
26
|
+
"supabase:dev:link": "export $(grep -v '^#' supabase/.dev.env | xargs) && supabase link --project-ref=$SUPABASE_PROJECT_REF",
|
|
27
|
+
"supabase:prod:link": "export $(grep -v '^#' supabase/.prod.env | xargs) && supabase link --project-ref=$SUPABASE_PROJECT_REF",
|
|
28
|
+
"supabase:dev": "export $(grep -v '^#' supabase/.dev.env | xargs) && LINKED_REF=$(supabase projects list | grep '●' | awk -F '|' '{print $3}' | xargs) && [ \"$LINKED_REF\" != \"$SUPABASE_PROJECT_REF\" ] && npm run supabase:dev:link; supabase",
|
|
29
|
+
"supabase:prod": "export $(grep -v '^#' supabase/.prod.env | xargs) && LINKED_REF=$(supabase projects list | grep '●' | awk -F '|' '{print $3}' | xargs) && [ \"$LINKED_REF\" != \"$SUPABASE_PROJECT_REF\" ] && npm run supabase:prod:link; supabase",
|
|
30
|
+
"supabase:local:types": "supabase gen types typescript --local > src/types/supabase/generated.ts; prettier --write src/types/supabase/generated.ts",
|
|
32
31
|
"supabase:prod:types": "supabase gen types typescript --project-id fqqdedotyiuyetimcflq > src/types/supabase/generated.ts; prettier --write src/types/supabase/generated.ts",
|
|
33
|
-
"supabase:local:seed:autosave": "node scripts/autosave_local_db_seed.js",
|
|
34
|
-
"supabase:local:seed:edit": "npm run supabase:local -- start && npm run supabase:local -- db reset && LOCAL_STATE_SUPABASE_SEED=supabase/seed.edit.sql node scripts/autosave_local_db_seed.js",
|
|
35
|
-
"supabase:local:seed:save": "node scripts/save_local_db_seed.js",
|
|
36
32
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
37
33
|
"translation:download": "localazy download",
|
|
38
34
|
"translation:upload": "localazy upload",
|
|
39
|
-
"tsc": "
|
|
40
|
-
"version": "npm run format && git add -A src && ./publish.sh"
|
|
35
|
+
"tsc": "cp package.json ./lib && tsc"
|
|
41
36
|
},
|
|
42
37
|
"author": "Glissandoo",
|
|
43
38
|
"license": "ISC",
|
|
44
39
|
"dependencies": {
|
|
45
|
-
"@glissandoo/icons": "^1.9.5",
|
|
46
40
|
"date-fns": "^3.6.0",
|
|
47
41
|
"date-fns-tz": "^3.1.3",
|
|
48
42
|
"lodash": "^4.17.21",
|
|
49
|
-
"type-fest": "4.8.3"
|
|
43
|
+
"type-fest": "^4.8.3"
|
|
50
44
|
},
|
|
51
45
|
"devDependencies": {
|
|
52
|
-
"@eslint/js": "^9.36.0",
|
|
53
46
|
"@google-cloud/firestore": "^7.1.0",
|
|
54
47
|
"@localazy/cli": "^1.6.5",
|
|
55
48
|
"@types/lodash": "^4.14.168",
|
|
56
49
|
"@types/node": "^14.18.42",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
51
|
+
"@typescript-eslint/parser": "^5.48.0",
|
|
57
52
|
"dotenv-cli": "^8.0.0",
|
|
58
|
-
"eslint": "^
|
|
59
|
-
"eslint-config-prettier": "^
|
|
60
|
-
"globals": "^16.4.0",
|
|
53
|
+
"eslint": "^7.24.0",
|
|
54
|
+
"eslint-config-prettier": "^8.2.0",
|
|
61
55
|
"husky": "^8.0.1",
|
|
62
56
|
"lint-staged": "^12.4.1",
|
|
63
|
-
"prettier": "^
|
|
64
|
-
"supabase": "2.
|
|
65
|
-
"
|
|
66
|
-
"typescript": "^5.9.3",
|
|
67
|
-
"typescript-eslint": "^8.45.0"
|
|
57
|
+
"prettier": "^2.2.1",
|
|
58
|
+
"supabase": "^2.104.0",
|
|
59
|
+
"typescript": "^4.9.4"
|
|
68
60
|
},
|
|
69
61
|
"lint-staged": {
|
|
70
62
|
"*.{ts,json}": "npm run format:single --"
|
package/types/firestore.d.ts
CHANGED
package/types/firestore.js
CHANGED
|
@@ -54,4 +54,4 @@ var GrpcStatus;
|
|
|
54
54
|
GrpcStatus[GrpcStatus["UNAVAILABLE"] = 14] = "UNAVAILABLE";
|
|
55
55
|
GrpcStatus[GrpcStatus["DATA_LOSS"] = 15] = "DATA_LOSS";
|
|
56
56
|
GrpcStatus[GrpcStatus["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED";
|
|
57
|
-
})(GrpcStatus
|
|
57
|
+
})(GrpcStatus = exports.GrpcStatus || (exports.GrpcStatus = {}));
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
/**
|
|
3
|
+
* Shared types for the payout rules engine.
|
|
4
|
+
* Rules live at two levels:
|
|
5
|
+
* - Group level (templates, can be `pinned` to auto-apply to new events)
|
|
6
|
+
* - Event level (snapshot copied from the group when payout is initialized)
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PayoutRuleType {
|
|
9
|
+
EntityShare = "entityShare",
|
|
10
|
+
DefaultExpense = "defaultExpense",
|
|
11
|
+
PlayerMultiplier = "playerMultiplier",
|
|
12
|
+
PlayerBonus = "playerBonus",
|
|
13
|
+
PlayerFixed = "playerFixed",
|
|
14
|
+
PlayerExclude = "playerExclude"
|
|
15
|
+
}
|
|
16
|
+
export declare enum PayoutRuleConditionOperator {
|
|
17
|
+
Eq = "eq",
|
|
18
|
+
Neq = "neq",
|
|
19
|
+
Gt = "gt",
|
|
20
|
+
Gte = "gte",
|
|
21
|
+
Lt = "lt",
|
|
22
|
+
Lte = "lte",
|
|
23
|
+
In = "in",
|
|
24
|
+
Nin = "nin"
|
|
25
|
+
}
|
|
26
|
+
export type PayoutRuleConditionFieldKind = 'mainInstrument' | 'isGuest' | `custom.${string}`;
|
|
27
|
+
export type PayoutRuleConditionValue = string | number | boolean | string[] | number[] | null;
|
|
28
|
+
export interface PayoutRuleCondition {
|
|
29
|
+
field: PayoutRuleConditionFieldKind;
|
|
30
|
+
operator: PayoutRuleConditionOperator;
|
|
31
|
+
value: PayoutRuleConditionValue;
|
|
32
|
+
}
|
|
33
|
+
export declare enum PayoutRuleEntityShareMode {
|
|
34
|
+
Fixed = "fixed",
|
|
35
|
+
Percentage = "percentage"
|
|
36
|
+
}
|
|
37
|
+
export interface PayoutRuleEntityShareEffect {
|
|
38
|
+
mode: PayoutRuleEntityShareMode;
|
|
39
|
+
value: number;
|
|
40
|
+
}
|
|
41
|
+
export interface PayoutRuleDefaultExpenseEffect {
|
|
42
|
+
concept: string;
|
|
43
|
+
amount: number;
|
|
44
|
+
/**
|
|
45
|
+
* `null` = expense remains general (reduces the shared pot).
|
|
46
|
+
* Future: could materialize per-attendee expenses.
|
|
47
|
+
*/
|
|
48
|
+
assignTo: null;
|
|
49
|
+
}
|
|
50
|
+
export interface PayoutRulePlayerMultiplierEffect {
|
|
51
|
+
multiplier: number;
|
|
52
|
+
}
|
|
53
|
+
export interface PayoutRulePlayerBonusEffect {
|
|
54
|
+
amount: number;
|
|
55
|
+
}
|
|
56
|
+
export interface PayoutRulePlayerFixedEffect {
|
|
57
|
+
amount: number;
|
|
58
|
+
}
|
|
59
|
+
export type PayoutRulePlayerExcludeEffect = Record<string, never>;
|
|
60
|
+
export type PayoutRuleEffect = {
|
|
61
|
+
type: PayoutRuleType.EntityShare;
|
|
62
|
+
data: PayoutRuleEntityShareEffect;
|
|
63
|
+
} | {
|
|
64
|
+
type: PayoutRuleType.DefaultExpense;
|
|
65
|
+
data: PayoutRuleDefaultExpenseEffect;
|
|
66
|
+
} | {
|
|
67
|
+
type: PayoutRuleType.PlayerMultiplier;
|
|
68
|
+
data: PayoutRulePlayerMultiplierEffect;
|
|
69
|
+
} | {
|
|
70
|
+
type: PayoutRuleType.PlayerBonus;
|
|
71
|
+
data: PayoutRulePlayerBonusEffect;
|
|
72
|
+
} | {
|
|
73
|
+
type: PayoutRuleType.PlayerFixed;
|
|
74
|
+
data: PayoutRulePlayerFixedEffect;
|
|
75
|
+
} | {
|
|
76
|
+
type: PayoutRuleType.PlayerExclude;
|
|
77
|
+
data: PayoutRulePlayerExcludeEffect;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Common shape stored in both group templates and event snapshots.
|
|
81
|
+
*/
|
|
82
|
+
export interface PayoutRuleBaseData {
|
|
83
|
+
name: string;
|
|
84
|
+
description: string | null;
|
|
85
|
+
order: number;
|
|
86
|
+
conditions: PayoutRuleCondition[];
|
|
87
|
+
effect: PayoutRuleEffect;
|
|
88
|
+
createdAt: Timestamp;
|
|
89
|
+
createdBy: string;
|
|
90
|
+
editedAt: Timestamp | null;
|
|
91
|
+
editedBy: string | null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Helper used by the pure rules engine. Holds the minimal data
|
|
95
|
+
* required to evaluate conditions against a player.
|
|
96
|
+
*/
|
|
97
|
+
export interface PayoutRulePlayerInput {
|
|
98
|
+
id: string;
|
|
99
|
+
mainInstrument: string;
|
|
100
|
+
isGuest: boolean;
|
|
101
|
+
customFields: Record<string, string | number | boolean | null>;
|
|
102
|
+
}
|
|
103
|
+
export interface GroupPayoutRuleEntry {
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
order: number;
|
|
107
|
+
pinned: boolean;
|
|
108
|
+
conditions: PayoutRuleCondition[];
|
|
109
|
+
effect: PayoutRuleEffect;
|
|
110
|
+
createdAt: Timestamp;
|
|
111
|
+
createdBy: string;
|
|
112
|
+
editedAt: Timestamp | null;
|
|
113
|
+
editedBy: string | null;
|
|
114
|
+
}
|
|
115
|
+
export interface EventoPayoutRuleEntry {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
order: number;
|
|
119
|
+
sourceGroupRuleId: string | null;
|
|
120
|
+
conditions: PayoutRuleCondition[];
|
|
121
|
+
effect: PayoutRuleEffect;
|
|
122
|
+
createdAt: Timestamp;
|
|
123
|
+
createdBy: string;
|
|
124
|
+
editedAt: Timestamp | null;
|
|
125
|
+
editedBy: string | null;
|
|
126
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayoutRuleEntityShareMode = exports.PayoutRuleConditionOperator = exports.PayoutRuleType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Shared types for the payout rules engine.
|
|
6
|
+
* Rules live at two levels:
|
|
7
|
+
* - Group level (templates, can be `pinned` to auto-apply to new events)
|
|
8
|
+
* - Event level (snapshot copied from the group when payout is initialized)
|
|
9
|
+
*/
|
|
10
|
+
var PayoutRuleType;
|
|
11
|
+
(function (PayoutRuleType) {
|
|
12
|
+
PayoutRuleType["EntityShare"] = "entityShare";
|
|
13
|
+
PayoutRuleType["DefaultExpense"] = "defaultExpense";
|
|
14
|
+
PayoutRuleType["PlayerMultiplier"] = "playerMultiplier";
|
|
15
|
+
PayoutRuleType["PlayerBonus"] = "playerBonus";
|
|
16
|
+
PayoutRuleType["PlayerFixed"] = "playerFixed";
|
|
17
|
+
PayoutRuleType["PlayerExclude"] = "playerExclude";
|
|
18
|
+
})(PayoutRuleType = exports.PayoutRuleType || (exports.PayoutRuleType = {}));
|
|
19
|
+
var PayoutRuleConditionOperator;
|
|
20
|
+
(function (PayoutRuleConditionOperator) {
|
|
21
|
+
PayoutRuleConditionOperator["Eq"] = "eq";
|
|
22
|
+
PayoutRuleConditionOperator["Neq"] = "neq";
|
|
23
|
+
PayoutRuleConditionOperator["Gt"] = "gt";
|
|
24
|
+
PayoutRuleConditionOperator["Gte"] = "gte";
|
|
25
|
+
PayoutRuleConditionOperator["Lt"] = "lt";
|
|
26
|
+
PayoutRuleConditionOperator["Lte"] = "lte";
|
|
27
|
+
PayoutRuleConditionOperator["In"] = "in";
|
|
28
|
+
PayoutRuleConditionOperator["Nin"] = "nin";
|
|
29
|
+
})(PayoutRuleConditionOperator = exports.PayoutRuleConditionOperator || (exports.PayoutRuleConditionOperator = {}));
|
|
30
|
+
var PayoutRuleEntityShareMode;
|
|
31
|
+
(function (PayoutRuleEntityShareMode) {
|
|
32
|
+
PayoutRuleEntityShareMode["Fixed"] = "fixed";
|
|
33
|
+
PayoutRuleEntityShareMode["Percentage"] = "percentage";
|
|
34
|
+
})(PayoutRuleEntityShareMode = exports.PayoutRuleEntityShareMode || (exports.PayoutRuleEntityShareMode = {}));
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared types for the payout rules engine.
|
|
5
|
+
* Rules live at two levels:
|
|
6
|
+
* - Group level (templates, can be `pinned` to auto-apply to new events)
|
|
7
|
+
* - Event level (snapshot copied from the group when payout is initialized)
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export enum PayoutRuleType {
|
|
11
|
+
EntityShare = 'entityShare',
|
|
12
|
+
DefaultExpense = 'defaultExpense',
|
|
13
|
+
PlayerMultiplier = 'playerMultiplier',
|
|
14
|
+
PlayerBonus = 'playerBonus',
|
|
15
|
+
PlayerFixed = 'playerFixed',
|
|
16
|
+
PlayerExclude = 'playerExclude',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum PayoutRuleConditionOperator {
|
|
20
|
+
Eq = 'eq',
|
|
21
|
+
Neq = 'neq',
|
|
22
|
+
Gt = 'gt',
|
|
23
|
+
Gte = 'gte',
|
|
24
|
+
Lt = 'lt',
|
|
25
|
+
Lte = 'lte',
|
|
26
|
+
In = 'in',
|
|
27
|
+
Nin = 'nin',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type PayoutRuleConditionFieldKind = 'mainInstrument' | 'isGuest' | `custom.${string}`;
|
|
31
|
+
|
|
32
|
+
export type PayoutRuleConditionValue = string | number | boolean | string[] | number[] | null;
|
|
33
|
+
|
|
34
|
+
export interface PayoutRuleCondition {
|
|
35
|
+
field: PayoutRuleConditionFieldKind;
|
|
36
|
+
operator: PayoutRuleConditionOperator;
|
|
37
|
+
value: PayoutRuleConditionValue;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export enum PayoutRuleEntityShareMode {
|
|
41
|
+
Fixed = 'fixed',
|
|
42
|
+
Percentage = 'percentage',
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PayoutRuleEntityShareEffect {
|
|
46
|
+
mode: PayoutRuleEntityShareMode;
|
|
47
|
+
value: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PayoutRuleDefaultExpenseEffect {
|
|
51
|
+
concept: string;
|
|
52
|
+
amount: number;
|
|
53
|
+
/**
|
|
54
|
+
* `null` = expense remains general (reduces the shared pot).
|
|
55
|
+
* Future: could materialize per-attendee expenses.
|
|
56
|
+
*/
|
|
57
|
+
assignTo: null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface PayoutRulePlayerMultiplierEffect {
|
|
61
|
+
multiplier: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface PayoutRulePlayerBonusEffect {
|
|
65
|
+
amount: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PayoutRulePlayerFixedEffect {
|
|
69
|
+
amount: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type PayoutRulePlayerExcludeEffect = Record<string, never>;
|
|
73
|
+
|
|
74
|
+
export type PayoutRuleEffect =
|
|
75
|
+
| { type: PayoutRuleType.EntityShare; data: PayoutRuleEntityShareEffect }
|
|
76
|
+
| { type: PayoutRuleType.DefaultExpense; data: PayoutRuleDefaultExpenseEffect }
|
|
77
|
+
| { type: PayoutRuleType.PlayerMultiplier; data: PayoutRulePlayerMultiplierEffect }
|
|
78
|
+
| { type: PayoutRuleType.PlayerBonus; data: PayoutRulePlayerBonusEffect }
|
|
79
|
+
| { type: PayoutRuleType.PlayerFixed; data: PayoutRulePlayerFixedEffect }
|
|
80
|
+
| { type: PayoutRuleType.PlayerExclude; data: PayoutRulePlayerExcludeEffect };
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Common shape stored in both group templates and event snapshots.
|
|
84
|
+
*/
|
|
85
|
+
export interface PayoutRuleBaseData {
|
|
86
|
+
name: string;
|
|
87
|
+
description: string | null;
|
|
88
|
+
order: number;
|
|
89
|
+
conditions: PayoutRuleCondition[];
|
|
90
|
+
effect: PayoutRuleEffect;
|
|
91
|
+
createdAt: Timestamp;
|
|
92
|
+
createdBy: string;
|
|
93
|
+
editedAt: Timestamp | null;
|
|
94
|
+
editedBy: string | null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Helper used by the pure rules engine. Holds the minimal data
|
|
99
|
+
* required to evaluate conditions against a player.
|
|
100
|
+
*/
|
|
101
|
+
export interface PayoutRulePlayerInput {
|
|
102
|
+
id: string;
|
|
103
|
+
mainInstrument: string;
|
|
104
|
+
isGuest: boolean;
|
|
105
|
+
customFields: Record<string, string | number | boolean | null>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface GroupPayoutRuleEntry {
|
|
109
|
+
id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
order: number;
|
|
112
|
+
pinned: boolean;
|
|
113
|
+
conditions: PayoutRuleCondition[];
|
|
114
|
+
effect: PayoutRuleEffect;
|
|
115
|
+
createdAt: Timestamp;
|
|
116
|
+
createdBy: string;
|
|
117
|
+
editedAt: Timestamp | null;
|
|
118
|
+
editedBy: string | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface EventoPayoutRuleEntry {
|
|
122
|
+
id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
order: number;
|
|
125
|
+
sourceGroupRuleId: string | null;
|
|
126
|
+
conditions: PayoutRuleCondition[];
|
|
127
|
+
effect: PayoutRuleEffect;
|
|
128
|
+
createdAt: Timestamp;
|
|
129
|
+
createdBy: string;
|
|
130
|
+
editedAt: Timestamp | null;
|
|
131
|
+
editedBy: string | null;
|
|
132
|
+
}
|