moonhead 1.0.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/README.md +32 -0
- package/dist/components/layout/app-header.d.ts +1 -0
- package/dist/components/layout/app-header.js +1 -0
- package/dist/components/layout/app-sidebar.d.ts +9 -0
- package/dist/components/layout/app-sidebar.js +1 -0
- package/dist/components/layout/brand-logo.d.ts +2 -0
- package/dist/components/layout/brand-logo.js +1 -0
- package/dist/components/layout/user-menu.d.ts +6 -0
- package/dist/components/layout/user-menu.js +1 -0
- package/dist/components/ui/action-form.d.ts +10 -0
- package/dist/components/ui/action-form.js +1 -0
- package/dist/components/ui/alert-dialog.d.ts +14 -0
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/badge.d.ts +2 -0
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.js +1 -0
- package/dist/components/ui/card.d.ts +2 -0
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/combobox.d.ts +18 -0
- package/dist/components/ui/combobox.js +1 -0
- package/dist/components/ui/copy-button.d.ts +8 -0
- package/dist/components/ui/copy-button.js +1 -0
- package/dist/components/ui/country-select.d.ts +12 -0
- package/dist/components/ui/country-select.js +1 -0
- package/dist/components/ui/data-table.d.ts +11 -0
- package/dist/components/ui/data-table.js +1 -0
- package/dist/components/ui/date-range-picker.d.ts +25 -0
- package/dist/components/ui/date-range-picker.js +1 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/drawer.d.ts +24 -0
- package/dist/components/ui/drawer.js +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +17 -0
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/field.d.ts +7 -0
- package/dist/components/ui/field.js +1 -0
- package/dist/components/ui/fieldset.d.ts +4 -0
- package/dist/components/ui/fieldset.js +1 -0
- package/dist/components/ui/form-field.d.ts +17 -0
- package/dist/components/ui/form-field.js +1 -0
- package/dist/components/ui/form.d.ts +3 -0
- package/dist/components/ui/form.js +1 -0
- package/dist/components/ui/icon-tile.d.ts +5 -0
- package/dist/components/ui/icon-tile.js +1 -0
- package/dist/components/ui/identity.d.ts +6 -0
- package/dist/components/ui/identity.js +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/number-input.d.ts +19 -0
- package/dist/components/ui/number-input.js +1 -0
- package/dist/components/ui/otp-field.d.ts +6 -0
- package/dist/components/ui/otp-field.js +1 -0
- package/dist/components/ui/page-toolbar.d.ts +9 -0
- package/dist/components/ui/page-toolbar.js +1 -0
- package/dist/components/ui/password-input.d.ts +7 -0
- package/dist/components/ui/password-input.js +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +1 -0
- package/dist/components/ui/search-input.d.ts +4 -0
- package/dist/components/ui/search-input.js +1 -0
- package/dist/components/ui/section-card.d.ts +7 -0
- package/dist/components/ui/section-card.js +1 -0
- package/dist/components/ui/select-field.d.ts +19 -0
- package/dist/components/ui/select-field.js +1 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/sidebar.d.ts +27 -0
- package/dist/components/ui/sidebar.js +1 -0
- package/dist/components/ui/slider.d.ts +10 -0
- package/dist/components/ui/slider.js +1 -0
- package/dist/components/ui/sort-button.d.ts +5 -0
- package/dist/components/ui/sort-button.js +1 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +1 -0
- package/dist/components/ui/status-badge.d.ts +11 -0
- package/dist/components/ui/status-badge.js +1 -0
- package/dist/components/ui/switch-field.d.ts +18 -0
- package/dist/components/ui/switch-field.js +1 -0
- package/dist/components/ui/switch.d.ts +3 -0
- package/dist/components/ui/switch.js +1 -0
- package/dist/components/ui/table-pagination.d.ts +9 -0
- package/dist/components/ui/table-pagination.js +1 -0
- package/dist/components/ui/table.d.ts +18 -0
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/tag-input.d.ts +9 -0
- package/dist/components/ui/tag-input.js +1 -0
- package/dist/components/ui/text-link.d.ts +10 -0
- package/dist/components/ui/text-link.js +1 -0
- package/dist/components/ui/textarea.d.ts +2 -0
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/toast.d.ts +1 -0
- package/dist/components/ui/toast.js +1 -0
- package/dist/components/ui/tree.d.ts +32 -0
- package/dist/components/ui/tree.js +1 -0
- package/dist/db/client.d.ts +8 -0
- package/dist/db/client.js +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +1 -0
- package/dist/db/logger.d.ts +2 -0
- package/dist/db/logger.js +1 -0
- package/dist/db/migrations/20260628182304_wonderful_groot/migration.sql +289 -0
- package/dist/db/migrations/20260628182304_wonderful_groot/snapshot.json +3750 -0
- package/dist/db/migrations/20260630082829_wet_robin_chapel/migration.sql +2 -0
- package/dist/db/migrations/20260630082829_wet_robin_chapel/snapshot.json +3791 -0
- package/dist/db/migrations/20260702132335_wooden_iron_monger/migration.sql +48 -0
- package/dist/db/migrations/20260702132335_wooden_iron_monger/snapshot.json +4407 -0
- package/dist/db/migrations/20260702142948_vengeful_rhino/migration.sql +1 -0
- package/dist/db/migrations/20260702142948_vengeful_rhino/snapshot.json +4420 -0
- package/dist/db/migrations/20260702185813_curved_pyro/migration.sql +16 -0
- package/dist/db/migrations/20260702185813_curved_pyro/snapshot.json +4646 -0
- package/dist/db/migrations/20260702192041_shiny_franklin_storm/migration.sql +16 -0
- package/dist/db/migrations/20260702192041_shiny_franklin_storm/snapshot.json +4872 -0
- package/dist/db/migrations/20260704101548_bizarre_namorita/migration.sql +1 -0
- package/dist/db/migrations/20260704101548_bizarre_namorita/snapshot.json +4885 -0
- package/dist/db/migrations/20260704105911_sleepy_juggernaut/migration.sql +1 -0
- package/dist/db/migrations/20260704105911_sleepy_juggernaut/snapshot.json +4898 -0
- package/dist/db/migrations/20260704115959_lean_sandman/migration.sql +1 -0
- package/dist/db/migrations/20260704115959_lean_sandman/snapshot.json +4885 -0
- package/dist/db/migrations/20260707231532_daffy_captain_stacy/migration.sql +10 -0
- package/dist/db/migrations/20260707231532_daffy_captain_stacy/snapshot.json +4919 -0
- package/dist/db/migrations/20260708190355_spooky_jimmy_woo/migration.sql +3 -0
- package/dist/db/migrations/20260708190355_spooky_jimmy_woo/snapshot.json +4970 -0
- package/dist/db/migrations/20260711145212_drop_legacy_earning_status/migration.sql +7 -0
- package/dist/db/migrations/20260711145212_drop_legacy_earning_status/snapshot.json +4968 -0
- package/dist/db/migrations/20260712161249_dashboard_stat_indexes/migration.sql +3 -0
- package/dist/db/migrations/20260712161249_dashboard_stat_indexes/snapshot.json +5038 -0
- package/dist/db/migrations/20260713013911_add_payout_paid_at/migration.sql +2 -0
- package/dist/db/migrations/20260713013911_add_payout_paid_at/snapshot.json +5072 -0
- package/dist/db/schema/analytics-outbox.d.ts +145 -0
- package/dist/db/schema/analytics-outbox.js +1 -0
- package/dist/db/schema/audit-logs.d.ts +204 -0
- package/dist/db/schema/audit-logs.js +1 -0
- package/dist/db/schema/campaigns.d.ts +180 -0
- package/dist/db/schema/campaigns.js +1 -0
- package/dist/db/schema/casinos.d.ts +129 -0
- package/dist/db/schema/casinos.js +1 -0
- package/dist/db/schema/commission-rule-groups.d.ts +84 -0
- package/dist/db/schema/commission-rule-groups.js +1 -0
- package/dist/db/schema/commission-rules.d.ts +145 -0
- package/dist/db/schema/commission-rules.js +1 -0
- package/dist/db/schema/commissions.d.ts +242 -0
- package/dist/db/schema/commissions.js +1 -0
- package/dist/db/schema/conversions.d.ts +302 -0
- package/dist/db/schema/conversions.js +1 -0
- package/dist/db/schema/deals.d.ts +180 -0
- package/dist/db/schema/deals.js +1 -0
- package/dist/db/schema/earnings.d.ts +262 -0
- package/dist/db/schema/earnings.js +1 -0
- package/dist/db/schema/groups.d.ts +214 -0
- package/dist/db/schema/groups.js +1 -0
- package/dist/db/schema/index.d.ts +18 -0
- package/dist/db/schema/index.js +1 -0
- package/dist/db/schema/payouts.d.ts +182 -0
- package/dist/db/schema/payouts.js +1 -0
- package/dist/db/schema/platform-settings.d.ts +84 -0
- package/dist/db/schema/platform-settings.js +1 -0
- package/dist/db/schema/player-activity.d.ts +159 -0
- package/dist/db/schema/player-activity.js +1 -0
- package/dist/db/schema/revshare-carryover.d.ts +129 -0
- package/dist/db/schema/revshare-carryover.js +1 -0
- package/dist/db/schema/sessions.d.ts +213 -0
- package/dist/db/schema/sessions.js +1 -0
- package/dist/db/schema/table.d.ts +1 -0
- package/dist/db/schema/table.js +1 -0
- package/dist/db/schema/users.d.ts +609 -0
- package/dist/db/schema/users.js +1 -0
- package/dist/db/schema/verification-tokens.d.ts +106 -0
- package/dist/db/schema/verification-tokens.js +1 -0
- package/dist/db/types/branded.d.ts +3 -0
- package/dist/db/types/branded.js +0 -0
- package/dist/db/types/commission-rules.d.ts +70 -0
- package/dist/db/types/commission-rules.js +1 -0
- package/dist/db/types/index.d.ts +2 -0
- package/dist/db/types/index.js +1 -0
- package/dist/emails/admin/support-message.d.ts +39 -0
- package/dist/emails/admin/support-message.js +5 -0
- package/dist/emails/affiliate/activated.d.ts +33 -0
- package/dist/emails/affiliate/activated.js +1 -0
- package/dist/emails/affiliate/deal-notice.d.ts +35 -0
- package/dist/emails/affiliate/deal-notice.js +1 -0
- package/dist/emails/affiliate/invite.d.ts +35 -0
- package/dist/emails/affiliate/invite.js +1 -0
- package/dist/emails/affiliate/signup-verify.d.ts +35 -0
- package/dist/emails/affiliate/signup-verify.js +1 -0
- package/dist/emails/auth/password-reset.d.ts +37 -0
- package/dist/emails/auth/password-reset.js +1 -0
- package/dist/emails/layout.d.ts +10 -0
- package/dist/emails/layout.js +1 -0
- package/dist/emails/manager/affiliate-activated.d.ts +33 -0
- package/dist/emails/manager/affiliate-activated.js +1 -0
- package/dist/emails/manager/bulk-affiliates-activated.d.ts +33 -0
- package/dist/emails/manager/bulk-affiliates-activated.js +1 -0
- package/dist/emails/manager/invite.d.ts +35 -0
- package/dist/emails/manager/invite.js +1 -0
- package/dist/emails/manager/pending-approval.d.ts +33 -0
- package/dist/emails/manager/pending-approval.js +1 -0
- package/dist/emails/preview-env.d.ts +2 -0
- package/dist/emails/preview-env.js +1 -0
- package/dist/features/affiliates/actions.d.ts +60 -0
- package/dist/features/affiliates/actions.js +1 -0
- package/dist/features/affiliates/activation-email.d.ts +8 -0
- package/dist/features/affiliates/activation-email.js +1 -0
- package/dist/features/affiliates/bulk-approve.d.ts +2 -0
- package/dist/features/affiliates/bulk-approve.js +1 -0
- package/dist/features/affiliates/components/affiliate-actions-menu.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-actions-menu.js +1 -0
- package/dist/features/affiliates/components/affiliate-create-button.d.ts +1 -0
- package/dist/features/affiliates/components/affiliate-create-button.js +1 -0
- package/dist/features/affiliates/components/affiliate-detail-tabs.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-detail-tabs.js +1 -0
- package/dist/features/affiliates/components/affiliate-dialog.d.ts +11 -0
- package/dist/features/affiliates/components/affiliate-dialog.js +1 -0
- package/dist/features/affiliates/components/affiliate-profile-fields.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-profile-fields.js +1 -0
- package/dist/features/affiliates/components/affiliate-status-badge.d.ts +4 -0
- package/dist/features/affiliates/components/affiliate-status-badge.js +1 -0
- package/dist/features/affiliates/components/affiliate-status-tabs.d.ts +4 -0
- package/dist/features/affiliates/components/affiliate-status-tabs.js +1 -0
- package/dist/features/affiliates/components/affiliates-table.d.ts +10 -0
- package/dist/features/affiliates/components/affiliates-table.js +1 -0
- package/dist/features/affiliates/components/assign-parent-dialog.d.ts +5 -0
- package/dist/features/affiliates/components/assign-parent-dialog.js +1 -0
- package/dist/features/affiliates/components/detach-affiliate-confirm.d.ts +5 -0
- package/dist/features/affiliates/components/detach-affiliate-confirm.js +1 -0
- package/dist/features/affiliates/components/reject-affiliate-confirm.d.ts +5 -0
- package/dist/features/affiliates/components/reject-affiliate-confirm.js +1 -0
- package/dist/features/affiliates/components/sub-affiliate-invite-button.d.ts +3 -0
- package/dist/features/affiliates/components/sub-affiliate-invite-button.js +1 -0
- package/dist/features/affiliates/invite.d.ts +6 -0
- package/dist/features/affiliates/invite.js +1 -0
- package/dist/features/affiliates/list-params.d.ts +27 -0
- package/dist/features/affiliates/list-params.js +1 -0
- package/dist/features/affiliates/pending-notification.d.ts +18 -0
- package/dist/features/affiliates/pending-notification.js +1 -0
- package/dist/features/affiliates/sub-invite.d.ts +7 -0
- package/dist/features/affiliates/sub-invite.js +1 -0
- package/dist/features/audit/action-labels.d.ts +15 -0
- package/dist/features/audit/action-labels.js +1 -0
- package/dist/features/audit/components/audit-log-table.d.ts +5 -0
- package/dist/features/audit/components/audit-log-table.js +1 -0
- package/dist/features/audit/list-params.d.ts +2 -0
- package/dist/features/audit/list-params.js +1 -0
- package/dist/features/audit/read.d.ts +27 -0
- package/dist/features/audit/read.js +1 -0
- package/dist/features/auth/actions.d.ts +33 -0
- package/dist/features/auth/actions.js +1 -0
- package/dist/features/auth/authorization.d.ts +14 -0
- package/dist/features/auth/authorization.js +1 -0
- package/dist/features/auth/components/accept-invite-form.d.ts +3 -0
- package/dist/features/auth/components/accept-invite-form.js +1 -0
- package/dist/features/auth/components/forgot-password-form.d.ts +1 -0
- package/dist/features/auth/components/forgot-password-form.js +1 -0
- package/dist/features/auth/components/permissions-form.d.ts +5 -0
- package/dist/features/auth/components/permissions-form.js +1 -0
- package/dist/features/auth/components/reset-password-form.d.ts +3 -0
- package/dist/features/auth/components/reset-password-form.js +1 -0
- package/dist/features/auth/components/signin-form.d.ts +5 -0
- package/dist/features/auth/components/signin-form.js +1 -0
- package/dist/features/auth/components/signup-form.d.ts +1 -0
- package/dist/features/auth/components/signup-form.js +1 -0
- package/dist/features/auth/components/verify-email-form.d.ts +3 -0
- package/dist/features/auth/components/verify-email-form.js +1 -0
- package/dist/features/auth/password-reset.d.ts +6 -0
- package/dist/features/auth/password-reset.js +1 -0
- package/dist/features/auth/permissions.d.ts +49 -0
- package/dist/features/auth/permissions.js +1 -0
- package/dist/features/auth/require.d.ts +3 -0
- package/dist/features/auth/require.js +1 -0
- package/dist/features/auth/signup-email.d.ts +6 -0
- package/dist/features/auth/signup-email.js +1 -0
- package/dist/features/campaigns/actions.d.ts +53 -0
- package/dist/features/campaigns/actions.js +1 -0
- package/dist/features/campaigns/components/campaign-dialog.d.ts +7 -0
- package/dist/features/campaigns/components/campaign-dialog.js +1 -0
- package/dist/features/campaigns/components/campaign-row-actions.d.ts +8 -0
- package/dist/features/campaigns/components/campaign-row-actions.js +1 -0
- package/dist/features/campaigns/components/campaign-status-badge.d.ts +6 -0
- package/dist/features/campaigns/components/campaign-status-badge.js +1 -0
- package/dist/features/campaigns/components/campaign-status-tabs.d.ts +1 -0
- package/dist/features/campaigns/components/campaign-status-tabs.js +1 -0
- package/dist/features/campaigns/components/campaigns-table.d.ts +7 -0
- package/dist/features/campaigns/components/campaigns-table.js +1 -0
- package/dist/features/campaigns/components/create-campaign-button.d.ts +5 -0
- package/dist/features/campaigns/components/create-campaign-button.js +1 -0
- package/dist/features/campaigns/components/sub-id-builder.d.ts +4 -0
- package/dist/features/campaigns/components/sub-id-builder.js +1 -0
- package/dist/features/campaigns/components/tracking-link-box.d.ts +3 -0
- package/dist/features/campaigns/components/tracking-link-box.js +1 -0
- package/dist/features/campaigns/components/tracking-link-cell.d.ts +4 -0
- package/dist/features/campaigns/components/tracking-link-cell.js +1 -0
- package/dist/features/campaigns/components/tracking-link-dialog.d.ts +6 -0
- package/dist/features/campaigns/components/tracking-link-dialog.js +1 -0
- package/dist/features/campaigns/list-params.d.ts +14 -0
- package/dist/features/campaigns/list-params.js +1 -0
- package/dist/features/campaigns/tracking-url.d.ts +8 -0
- package/dist/features/campaigns/tracking-url.js +1 -0
- package/dist/features/casinos/actions.d.ts +39 -0
- package/dist/features/casinos/actions.js +1 -0
- package/dist/features/casinos/components/casino-create-button.d.ts +1 -0
- package/dist/features/casinos/components/casino-create-button.js +1 -0
- package/dist/features/casinos/components/casino-dialog.d.ts +11 -0
- package/dist/features/casinos/components/casino-dialog.js +1 -0
- package/dist/features/casinos/components/casino-form-fields.d.ts +7 -0
- package/dist/features/casinos/components/casino-form-fields.js +1 -0
- package/dist/features/casinos/components/casino-status-tabs.d.ts +1 -0
- package/dist/features/casinos/components/casino-status-tabs.js +1 -0
- package/dist/features/casinos/components/casinos-table.d.ts +6 -0
- package/dist/features/casinos/components/casinos-table.js +1 -0
- package/dist/features/casinos/components/delete-casino-confirm.d.ts +5 -0
- package/dist/features/casinos/components/delete-casino-confirm.js +1 -0
- package/dist/features/casinos/list-params.d.ts +14 -0
- package/dist/features/casinos/list-params.js +1 -0
- package/dist/features/commissions/actions.d.ts +76 -0
- package/dist/features/commissions/actions.js +1 -0
- package/dist/features/commissions/components/casino-bindings-field.d.ts +10 -0
- package/dist/features/commissions/components/casino-bindings-field.js +1 -0
- package/dist/features/commissions/components/commission-create-button.d.ts +1 -0
- package/dist/features/commissions/components/commission-create-button.js +1 -0
- package/dist/features/commissions/components/commission-detail-dialog.d.ts +5 -0
- package/dist/features/commissions/components/commission-detail-dialog.js +1 -0
- package/dist/features/commissions/components/commission-editor.d.ts +8 -0
- package/dist/features/commissions/components/commission-editor.js +1 -0
- package/dist/features/commissions/components/commission-read-view.d.ts +5 -0
- package/dist/features/commissions/components/commission-read-view.js +1 -0
- package/dist/features/commissions/components/commission-status-badge.d.ts +4 -0
- package/dist/features/commissions/components/commission-status-badge.js +1 -0
- package/dist/features/commissions/components/commission-status-tabs.d.ts +1 -0
- package/dist/features/commissions/components/commission-status-tabs.js +1 -0
- package/dist/features/commissions/components/commissions-table.d.ts +14 -0
- package/dist/features/commissions/components/commissions-table.js +1 -0
- package/dist/features/commissions/components/delete-commission-confirm.d.ts +5 -0
- package/dist/features/commissions/components/delete-commission-confirm.js +1 -0
- package/dist/features/commissions/components/duplicate-commission-dialog.d.ts +6 -0
- package/dist/features/commissions/components/duplicate-commission-dialog.js +1 -0
- package/dist/features/commissions/components/rule-editor/conditions-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/conditions-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/modifiers-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/modifiers-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/qualifiers-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/qualifiers-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/reducer.d.ts +102 -0
- package/dist/features/commissions/components/rule-editor/reducer.js +1 -0
- package/dist/features/commissions/components/rule-editor/rewards-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/rewards-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-card.d.ts +10 -0
- package/dist/features/commissions/components/rule-editor/rule-card.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-editor.d.ts +7 -0
- package/dist/features/commissions/components/rule-editor/rule-editor.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-group-card.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/rule-group-card.js +1 -0
- package/dist/features/commissions/components/rule-editor/state.d.ts +21 -0
- package/dist/features/commissions/components/rule-editor/state.js +1 -0
- package/dist/features/commissions/components/rule-groups-read-view.d.ts +4 -0
- package/dist/features/commissions/components/rule-groups-read-view.js +1 -0
- package/dist/features/commissions/list-params.d.ts +14 -0
- package/dist/features/commissions/list-params.js +1 -0
- package/dist/features/commissions/rule-validation.d.ts +173 -0
- package/dist/features/commissions/rule-validation.js +1 -0
- package/dist/features/dashboard/affiliate-queries.d.ts +14 -0
- package/dist/features/dashboard/affiliate-queries.js +1 -0
- package/dist/features/dashboard/clickhouse.d.ts +3 -0
- package/dist/features/dashboard/clickhouse.js +2 -0
- package/dist/features/dashboard/components/affiliate-charts.d.ts +5 -0
- package/dist/features/dashboard/components/affiliate-charts.js +1 -0
- package/dist/features/dashboard/components/affiliate-stats.d.ts +5 -0
- package/dist/features/dashboard/components/affiliate-stats.js +1 -0
- package/dist/features/dashboard/components/charts/funnel-chart.d.ts +11 -0
- package/dist/features/dashboard/components/charts/funnel-chart.js +1 -0
- package/dist/features/dashboard/components/charts/rank-bar-chart.d.ts +10 -0
- package/dist/features/dashboard/components/charts/rank-bar-chart.js +1 -0
- package/dist/features/dashboard/components/charts/time-series-chart.d.ts +12 -0
- package/dist/features/dashboard/components/charts/time-series-chart.js +1 -0
- package/dist/features/dashboard/components/charts-grid.d.ts +8 -0
- package/dist/features/dashboard/components/charts-grid.js +1 -0
- package/dist/features/dashboard/components/dashboard-charts.d.ts +4 -0
- package/dist/features/dashboard/components/dashboard-charts.js +1 -0
- package/dist/features/dashboard/components/dashboard-period-tabs.d.ts +1 -0
- package/dist/features/dashboard/components/dashboard-period-tabs.js +1 -0
- package/dist/features/dashboard/components/money-stat-card.d.ts +6 -0
- package/dist/features/dashboard/components/money-stat-card.js +1 -0
- package/dist/features/dashboard/components/stat-card.d.ts +6 -0
- package/dist/features/dashboard/components/stat-card.js +1 -0
- package/dist/features/dashboard/components/top-affiliates.d.ts +4 -0
- package/dist/features/dashboard/components/top-affiliates.js +1 -0
- package/dist/features/dashboard/list-params.d.ts +24 -0
- package/dist/features/dashboard/list-params.js +1 -0
- package/dist/features/dashboard/queries.d.ts +63 -0
- package/dist/features/dashboard/queries.js +1 -0
- package/dist/features/dashboard/series.d.ts +32 -0
- package/dist/features/dashboard/series.js +1 -0
- package/dist/features/deals/actions.d.ts +60 -0
- package/dist/features/deals/actions.js +1 -0
- package/dist/features/deals/components/affiliate-deals.d.ts +10 -0
- package/dist/features/deals/components/affiliate-deals.js +1 -0
- package/dist/features/deals/components/assign-deal-button.d.ts +9 -0
- package/dist/features/deals/components/assign-deal-button.js +1 -0
- package/dist/features/deals/components/deal-dialog.d.ts +19 -0
- package/dist/features/deals/components/deal-dialog.js +1 -0
- package/dist/features/deals/components/deal-row-actions.d.ts +6 -0
- package/dist/features/deals/components/deal-row-actions.js +1 -0
- package/dist/features/deals/components/deal-status-badge.d.ts +10 -0
- package/dist/features/deals/components/deal-status-badge.js +1 -0
- package/dist/features/deals/components/deal-status-tabs.d.ts +1 -0
- package/dist/features/deals/components/deal-status-tabs.js +1 -0
- package/dist/features/deals/components/delegate-deal-button.d.ts +8 -0
- package/dist/features/deals/components/delegate-deal-button.js +1 -0
- package/dist/features/deals/deal-assigned-email.d.ts +11 -0
- package/dist/features/deals/deal-assigned-email.js +1 -0
- package/dist/features/deals/deal-delegated-email.d.ts +13 -0
- package/dist/features/deals/deal-delegated-email.js +1 -0
- package/dist/features/deals/list-params.d.ts +14 -0
- package/dist/features/deals/list-params.js +1 -0
- package/dist/features/earnings/components/earnings-balances.d.ts +4 -0
- package/dist/features/earnings/components/earnings-balances.js +1 -0
- package/dist/features/earnings/components/earnings-ledger.d.ts +5 -0
- package/dist/features/earnings/components/earnings-ledger.js +1 -0
- package/dist/features/earnings/components/earnings-status-badge.d.ts +4 -0
- package/dist/features/earnings/components/earnings-status-badge.js +1 -0
- package/dist/features/earnings/components/earnings-status-tabs.d.ts +1 -0
- package/dist/features/earnings/components/earnings-status-tabs.js +1 -0
- package/dist/features/earnings/components/sub-affiliate-earnings.d.ts +4 -0
- package/dist/features/earnings/components/sub-affiliate-earnings.js +1 -0
- package/dist/features/earnings/list-params.d.ts +14 -0
- package/dist/features/earnings/list-params.js +1 -0
- package/dist/features/earnings/queries.d.ts +30 -0
- package/dist/features/earnings/queries.js +1 -0
- package/dist/features/groups/actions.d.ts +36 -0
- package/dist/features/groups/actions.js +1 -0
- package/dist/features/groups/components/delete-group-confirm.d.ts +5 -0
- package/dist/features/groups/components/delete-group-confirm.js +1 -0
- package/dist/features/groups/components/group-create-button.d.ts +1 -0
- package/dist/features/groups/components/group-create-button.js +1 -0
- package/dist/features/groups/components/group-dialog.d.ts +11 -0
- package/dist/features/groups/components/group-dialog.js +1 -0
- package/dist/features/groups/components/group-form-fields.d.ts +10 -0
- package/dist/features/groups/components/group-form-fields.js +1 -0
- package/dist/features/groups/components/group-status-tabs.d.ts +1 -0
- package/dist/features/groups/components/group-status-tabs.js +1 -0
- package/dist/features/groups/components/groups-table.d.ts +9 -0
- package/dist/features/groups/components/groups-table.js +1 -0
- package/dist/features/groups/list-params.d.ts +14 -0
- package/dist/features/groups/list-params.js +1 -0
- package/dist/features/managers/actions.d.ts +43 -0
- package/dist/features/managers/actions.js +1 -0
- package/dist/features/managers/components/manager-create-button.d.ts +1 -0
- package/dist/features/managers/components/manager-create-button.js +1 -0
- package/dist/features/managers/components/manager-dialog.d.ts +11 -0
- package/dist/features/managers/components/manager-dialog.js +1 -0
- package/dist/features/managers/components/manager-permissions-dialog.d.ts +7 -0
- package/dist/features/managers/components/manager-permissions-dialog.js +1 -0
- package/dist/features/managers/components/manager-profile-fields.d.ts +7 -0
- package/dist/features/managers/components/manager-profile-fields.js +1 -0
- package/dist/features/managers/components/manager-status-tabs.d.ts +1 -0
- package/dist/features/managers/components/manager-status-tabs.js +1 -0
- package/dist/features/managers/components/managers-table.d.ts +8 -0
- package/dist/features/managers/components/managers-table.js +1 -0
- package/dist/features/managers/invite.d.ts +6 -0
- package/dist/features/managers/invite.js +1 -0
- package/dist/features/managers/list-params.d.ts +14 -0
- package/dist/features/managers/list-params.js +1 -0
- package/dist/features/payouts/actions.d.ts +12 -0
- package/dist/features/payouts/actions.js +1 -0
- package/dist/features/payouts/balance.d.ts +2 -0
- package/dist/features/payouts/balance.js +1 -0
- package/dist/features/payouts/components/my-payouts-table.d.ts +5 -0
- package/dist/features/payouts/components/my-payouts-table.js +1 -0
- package/dist/features/payouts/components/payout-row-actions.d.ts +5 -0
- package/dist/features/payouts/components/payout-row-actions.js +1 -0
- package/dist/features/payouts/components/payout-status-badge.d.ts +4 -0
- package/dist/features/payouts/components/payout-status-badge.js +1 -0
- package/dist/features/payouts/components/payout-status-tabs.d.ts +1 -0
- package/dist/features/payouts/components/payout-status-tabs.js +1 -0
- package/dist/features/payouts/components/payouts-table.d.ts +6 -0
- package/dist/features/payouts/components/payouts-table.js +1 -0
- package/dist/features/payouts/components/request-payout-dialog.d.ts +4 -0
- package/dist/features/payouts/components/request-payout-dialog.js +1 -0
- package/dist/features/payouts/constants.d.ts +2 -0
- package/dist/features/payouts/constants.js +1 -0
- package/dist/features/payouts/list-params.d.ts +14 -0
- package/dist/features/payouts/list-params.js +1 -0
- package/dist/features/payouts/my-queries.d.ts +14 -0
- package/dist/features/payouts/my-queries.js +1 -0
- package/dist/features/payouts/queries.d.ts +14 -0
- package/dist/features/payouts/queries.js +1 -0
- package/dist/features/postbacks/actions.d.ts +27 -0
- package/dist/features/postbacks/actions.js +1 -0
- package/dist/features/postbacks/components/integration-dialog.d.ts +6 -0
- package/dist/features/postbacks/components/integration-dialog.js +1 -0
- package/dist/features/postbacks/components/postback-editor.d.ts +5 -0
- package/dist/features/postbacks/components/postback-editor.js +1 -0
- package/dist/features/postbacks/components/postbacks-table.d.ts +4 -0
- package/dist/features/postbacks/components/postbacks-table.js +1 -0
- package/dist/features/settings/actions.d.ts +2 -0
- package/dist/features/settings/actions.js +1 -0
- package/dist/features/settings/components/affiliate-approval-setting.d.ts +3 -0
- package/dist/features/settings/components/affiliate-approval-setting.js +1 -0
- package/dist/features/settings/components/manager-totp-setting.d.ts +3 -0
- package/dist/features/settings/components/manager-totp-setting.js +1 -0
- package/dist/features/support/actions.d.ts +12 -0
- package/dist/features/support/actions.js +1 -0
- package/dist/features/support/components/support-page.d.ts +4 -0
- package/dist/features/support/components/support-page.js +1 -0
- package/dist/features/support/email.d.ts +13 -0
- package/dist/features/support/email.js +1 -0
- package/dist/features/users/actions.d.ts +4 -0
- package/dist/features/users/actions.js +1 -0
- package/dist/features/users/components/password-section.d.ts +1 -0
- package/dist/features/users/components/password-section.js +1 -0
- package/dist/features/users/components/preferences-section.d.ts +4 -0
- package/dist/features/users/components/preferences-section.js +1 -0
- package/dist/features/users/components/settings-tabs.d.ts +1 -0
- package/dist/features/users/components/settings-tabs.js +1 -0
- package/dist/features/users/components/totp-section.d.ts +4 -0
- package/dist/features/users/components/totp-section.js +1 -0
- package/dist/features/users/list-params.d.ts +12 -0
- package/dist/features/users/list-params.js +1 -0
- package/dist/features/users/totp.d.ts +7 -0
- package/dist/features/users/totp.js +1 -0
- package/dist/i18n/config.d.ts +5 -0
- package/dist/i18n/config.js +1 -0
- package/dist/i18n/get-locale.d.ts +3 -0
- package/dist/i18n/get-locale.js +1 -0
- package/dist/i18n/locale.d.ts +2 -0
- package/dist/i18n/locale.js +1 -0
- package/dist/lib/actions/parse-form.d.ts +3 -0
- package/dist/lib/actions/parse-form.js +1 -0
- package/dist/lib/actions/state.d.ts +22 -0
- package/dist/lib/actions/state.js +0 -0
- package/dist/lib/audit/actions.d.ts +9 -0
- package/dist/lib/audit/actions.js +1 -0
- package/dist/lib/audit/record.d.ts +4 -0
- package/dist/lib/audit/record.js +1 -0
- package/dist/lib/auth/action.d.ts +45 -0
- package/dist/lib/auth/action.js +1 -0
- package/dist/lib/auth/config.d.ts +24 -0
- package/dist/lib/auth/config.js +1 -0
- package/dist/lib/auth/jwt.d.ts +17 -0
- package/dist/lib/auth/jwt.js +1 -0
- package/dist/lib/auth/password-options.d.ts +6 -0
- package/dist/lib/auth/password-options.js +1 -0
- package/dist/lib/auth/password.d.ts +3 -0
- package/dist/lib/auth/password.js +1 -0
- package/dist/lib/auth/session.d.ts +26 -0
- package/dist/lib/auth/session.js +1 -0
- package/dist/lib/auth/tokens.d.ts +43 -0
- package/dist/lib/auth/tokens.js +1 -0
- package/dist/lib/auth/totp-challenge.d.ts +4 -0
- package/dist/lib/auth/totp-challenge.js +1 -0
- package/dist/lib/auth/totp.d.ts +7 -0
- package/dist/lib/auth/totp.js +1 -0
- package/dist/lib/auth/verification-tokens.d.ts +19 -0
- package/dist/lib/auth/verification-tokens.js +1 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +1 -0
- package/dist/lib/countries.d.ts +18 -0
- package/dist/lib/countries.js +1 -0
- package/dist/lib/currencies.d.ts +6 -0
- package/dist/lib/currencies.js +1 -0
- package/dist/lib/data/countries-by-continent.json +257 -0
- package/dist/lib/db/errors.d.ts +4 -0
- package/dist/lib/db/errors.js +1 -0
- package/dist/lib/email/client.d.ts +6 -0
- package/dist/lib/email/client.js +1 -0
- package/dist/lib/email/env.d.ts +12 -0
- package/dist/lib/email/env.js +1 -0
- package/dist/lib/email/format.d.ts +5 -0
- package/dist/lib/email/format.js +1 -0
- package/dist/lib/email/locale.d.ts +3 -0
- package/dist/lib/email/locale.js +1 -0
- package/dist/lib/email/send.d.ts +12 -0
- package/dist/lib/email/send.js +1 -0
- package/dist/lib/env.d.ts +20 -0
- package/dist/lib/env.js +1 -0
- package/dist/lib/errors/codes.d.ts +72 -0
- package/dist/lib/errors/codes.js +1 -0
- package/dist/lib/errors/server.d.ts +10 -0
- package/dist/lib/errors/server.js +1 -0
- package/dist/lib/format.d.ts +3 -0
- package/dist/lib/format.js +1 -0
- package/dist/lib/hooks/use-deferred-dialog.d.ts +11 -0
- package/dist/lib/hooks/use-deferred-dialog.js +1 -0
- package/dist/lib/hooks/use-form-reset.d.ts +2 -0
- package/dist/lib/hooks/use-form-reset.js +1 -0
- package/dist/lib/hooks/use-form-toast.d.ts +2 -0
- package/dist/lib/hooks/use-form-toast.js +1 -0
- package/dist/lib/i18n/format-datetime.d.ts +1 -0
- package/dist/lib/i18n/format-datetime.js +1 -0
- package/dist/lib/i18n/relative-time.d.ts +1 -0
- package/dist/lib/i18n/relative-time.js +1 -0
- package/dist/lib/list-params.d.ts +51 -0
- package/dist/lib/list-params.js +1 -0
- package/dist/lib/money.d.ts +2 -0
- package/dist/lib/money.js +1 -0
- package/dist/lib/platform-settings.d.ts +5 -0
- package/dist/lib/platform-settings.js +1 -0
- package/dist/lib/preferences/actions.d.ts +1 -0
- package/dist/lib/preferences/actions.js +1 -0
- package/dist/lib/preferences/index.d.ts +15 -0
- package/dist/lib/preferences/index.js +1 -0
- package/dist/lib/preferences/read.d.ts +2 -0
- package/dist/lib/preferences/read.js +1 -0
- package/dist/lib/slug.d.ts +1 -0
- package/dist/lib/slug.js +1 -0
- package/dist/lib/toast.d.ts +13 -0
- package/dist/lib/toast.js +1 -0
- package/dist/lib/tracking-cache.d.ts +2 -0
- package/dist/lib/tracking-cache.js +1 -0
- package/dist/lib/users.d.ts +12 -0
- package/dist/lib/users.js +1 -0
- package/dist/lib/validation/zod.d.ts +30 -0
- package/dist/lib/validation/zod.js +1 -0
- package/dist/messages/de/emails.json +136 -0
- package/dist/messages/de/index.json +1104 -0
- package/dist/messages/en/emails.json +136 -0
- package/dist/messages/en/index.json +1104 -0
- package/dist/theme/config.d.ts +8 -0
- package/dist/theme/config.js +1 -0
- package/dist/theme/get-theme.d.ts +3 -0
- package/dist/theme/get-theme.js +1 -0
- package/dist/theme/theme.d.ts +2 -0
- package/dist/theme/theme.js +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
CREATE TYPE "campaign_status" AS ENUM('active', 'deactivated');--> statement-breakpoint
|
|
2
|
+
CREATE TYPE "commission_status" AS ENUM('draft', 'published', 'deactivated');--> statement-breakpoint
|
|
3
|
+
CREATE TYPE "commission_strategy" AS ENUM('rev_share', 'cpa', 'hybrid', 'custom');--> statement-breakpoint
|
|
4
|
+
CREATE TYPE "conversion_event" AS ENUM('registration', 'ftd', 'deposit', 'ngr', 'chargeback');--> statement-breakpoint
|
|
5
|
+
CREATE TYPE "conversion_product" AS ENUM('casino', 'sportsbook');--> statement-breakpoint
|
|
6
|
+
CREATE TYPE "conversion_status" AS ENUM('pending', 'locked', 'paid', 'rejected');--> statement-breakpoint
|
|
7
|
+
CREATE TYPE "deal_status" AS ENUM('active', 'deactivated');--> statement-breakpoint
|
|
8
|
+
CREATE TYPE "signup_source" AS ENUM('admin_invite', 'self_signup', 'affiliate_invite');--> statement-breakpoint
|
|
9
|
+
CREATE TYPE "user_role" AS ENUM('platform_admin', 'manager', 'affiliate');--> statement-breakpoint
|
|
10
|
+
CREATE TYPE "user_status" AS ENUM('active', 'blocked', 'rejected');--> statement-breakpoint
|
|
11
|
+
CREATE TYPE "verification_token_purpose" AS ENUM('invite', 'password_reset', 'email_verify');--> statement-breakpoint
|
|
12
|
+
CREATE TABLE "analytics_outbox" (
|
|
13
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
14
|
+
"event_type" text NOT NULL,
|
|
15
|
+
"payload" jsonb NOT NULL,
|
|
16
|
+
"attempts" integer DEFAULT 0 NOT NULL,
|
|
17
|
+
"last_error" text,
|
|
18
|
+
"available_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
19
|
+
"locked_at" timestamp with time zone,
|
|
20
|
+
"locked_by" text,
|
|
21
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
22
|
+
);
|
|
23
|
+
--> statement-breakpoint
|
|
24
|
+
CREATE TABLE "audit_logs" (
|
|
25
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
26
|
+
"actor_id" uuid,
|
|
27
|
+
"actor_role" "user_role" NOT NULL,
|
|
28
|
+
"actor_email" text,
|
|
29
|
+
"subject_id" uuid,
|
|
30
|
+
"action" text NOT NULL,
|
|
31
|
+
"target_type" text,
|
|
32
|
+
"target_id" text,
|
|
33
|
+
"target_label" text,
|
|
34
|
+
"metadata" jsonb,
|
|
35
|
+
"ip_address" text,
|
|
36
|
+
"user_agent" text,
|
|
37
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
38
|
+
);
|
|
39
|
+
--> statement-breakpoint
|
|
40
|
+
CREATE TABLE "campaigns" (
|
|
41
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
42
|
+
"affiliate_id" uuid NOT NULL,
|
|
43
|
+
"casino_id" uuid NOT NULL,
|
|
44
|
+
"commission_id" uuid NOT NULL,
|
|
45
|
+
"status" "campaign_status" DEFAULT 'active'::"campaign_status" NOT NULL,
|
|
46
|
+
"name" text NOT NULL,
|
|
47
|
+
"description" text,
|
|
48
|
+
"slug" text NOT NULL UNIQUE,
|
|
49
|
+
"allow_sub_ids" boolean DEFAULT true NOT NULL,
|
|
50
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
51
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
52
|
+
);
|
|
53
|
+
--> statement-breakpoint
|
|
54
|
+
CREATE TABLE "casinos" (
|
|
55
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
56
|
+
"name" text NOT NULL UNIQUE,
|
|
57
|
+
"is_active" boolean DEFAULT true NOT NULL,
|
|
58
|
+
"landing_url" text DEFAULT '' NOT NULL,
|
|
59
|
+
"tracking_param_name" text DEFAULT 'clickid' NOT NULL,
|
|
60
|
+
"postback_secret" text NOT NULL,
|
|
61
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
62
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
63
|
+
);
|
|
64
|
+
--> statement-breakpoint
|
|
65
|
+
CREATE TABLE "commission_rule_groups" (
|
|
66
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
67
|
+
"commission_id" uuid NOT NULL,
|
|
68
|
+
"priority" integer DEFAULT 100 NOT NULL,
|
|
69
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
70
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
71
|
+
);
|
|
72
|
+
--> statement-breakpoint
|
|
73
|
+
CREATE TABLE "commission_rules" (
|
|
74
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
75
|
+
"rule_group_id" uuid NOT NULL,
|
|
76
|
+
"position" integer DEFAULT 0 NOT NULL,
|
|
77
|
+
"qualifiers" jsonb DEFAULT '[]' NOT NULL,
|
|
78
|
+
"conditions" jsonb DEFAULT '{"id":"root","type":"AND","children":[]}' NOT NULL,
|
|
79
|
+
"modifiers" jsonb DEFAULT '{}' NOT NULL,
|
|
80
|
+
"rewards" jsonb DEFAULT '[]' NOT NULL,
|
|
81
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
82
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
83
|
+
);
|
|
84
|
+
--> statement-breakpoint
|
|
85
|
+
CREATE TABLE "commission_casinos" (
|
|
86
|
+
"commission_id" uuid,
|
|
87
|
+
"casino_id" uuid,
|
|
88
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
89
|
+
CONSTRAINT "commission_casinos_pkey" PRIMARY KEY("commission_id","casino_id")
|
|
90
|
+
);
|
|
91
|
+
--> statement-breakpoint
|
|
92
|
+
CREATE TABLE "commissions" (
|
|
93
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
94
|
+
"title" text,
|
|
95
|
+
"status" "commission_status" DEFAULT 'draft'::"commission_status" NOT NULL,
|
|
96
|
+
"strategy" "commission_strategy" DEFAULT 'rev_share'::"commission_strategy" NOT NULL,
|
|
97
|
+
"tags" text[] DEFAULT '{}'::text[] NOT NULL,
|
|
98
|
+
"currency" text DEFAULT 'EUR' NOT NULL,
|
|
99
|
+
"forgive_debts" boolean DEFAULT false NOT NULL,
|
|
100
|
+
"allow_sub_affiliates" boolean DEFAULT false NOT NULL,
|
|
101
|
+
"sub_affiliate_max_percent" numeric(5,2),
|
|
102
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
103
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
104
|
+
);
|
|
105
|
+
--> statement-breakpoint
|
|
106
|
+
CREATE TABLE "conversions" (
|
|
107
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
108
|
+
"click_id" uuid NOT NULL,
|
|
109
|
+
"campaign_id" uuid NOT NULL,
|
|
110
|
+
"casino_id" uuid NOT NULL,
|
|
111
|
+
"affiliate_id" uuid NOT NULL,
|
|
112
|
+
"event" "conversion_event" NOT NULL,
|
|
113
|
+
"product" "conversion_product",
|
|
114
|
+
"amount" numeric(14,2),
|
|
115
|
+
"currency" text,
|
|
116
|
+
"amount_base" numeric(14,2),
|
|
117
|
+
"casino_tx_id" text NOT NULL,
|
|
118
|
+
"status" "conversion_status" DEFAULT 'pending'::"conversion_status" NOT NULL,
|
|
119
|
+
"locked_until" timestamp with time zone,
|
|
120
|
+
"payout_id" uuid,
|
|
121
|
+
"raw_postback" jsonb NOT NULL,
|
|
122
|
+
"received_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
123
|
+
);
|
|
124
|
+
--> statement-breakpoint
|
|
125
|
+
CREATE TABLE "deals" (
|
|
126
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
127
|
+
"affiliate_id" uuid NOT NULL,
|
|
128
|
+
"commission_id" uuid NOT NULL,
|
|
129
|
+
"status" "deal_status" DEFAULT 'active'::"deal_status" NOT NULL,
|
|
130
|
+
"starts_at" timestamp with time zone NOT NULL,
|
|
131
|
+
"ends_at" timestamp with time zone,
|
|
132
|
+
"assigned_by_id" uuid,
|
|
133
|
+
"parent_deal_id" uuid,
|
|
134
|
+
"sub_affiliate_percent" numeric(5,2),
|
|
135
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
136
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
137
|
+
);
|
|
138
|
+
--> statement-breakpoint
|
|
139
|
+
CREATE TABLE "group_permissions" (
|
|
140
|
+
"group_id" uuid,
|
|
141
|
+
"permission" text,
|
|
142
|
+
CONSTRAINT "group_permissions_pkey" PRIMARY KEY("group_id","permission")
|
|
143
|
+
);
|
|
144
|
+
--> statement-breakpoint
|
|
145
|
+
CREATE TABLE "groups" (
|
|
146
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
147
|
+
"name" text NOT NULL UNIQUE,
|
|
148
|
+
"description" text,
|
|
149
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
150
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
151
|
+
);
|
|
152
|
+
--> statement-breakpoint
|
|
153
|
+
CREATE TABLE "user_groups" (
|
|
154
|
+
"user_id" uuid,
|
|
155
|
+
"group_id" uuid,
|
|
156
|
+
"assigned_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
157
|
+
CONSTRAINT "user_groups_pkey" PRIMARY KEY("user_id","group_id")
|
|
158
|
+
);
|
|
159
|
+
--> statement-breakpoint
|
|
160
|
+
CREATE TABLE "user_permissions" (
|
|
161
|
+
"user_id" uuid,
|
|
162
|
+
"permission" text,
|
|
163
|
+
CONSTRAINT "user_permissions_pkey" PRIMARY KEY("user_id","permission")
|
|
164
|
+
);
|
|
165
|
+
--> statement-breakpoint
|
|
166
|
+
CREATE TABLE "platform_settings" (
|
|
167
|
+
"id" boolean PRIMARY KEY DEFAULT true,
|
|
168
|
+
"require_manager_totp" boolean DEFAULT false NOT NULL,
|
|
169
|
+
"require_affiliate_approval" boolean DEFAULT false NOT NULL,
|
|
170
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
171
|
+
"updated_by" uuid
|
|
172
|
+
);
|
|
173
|
+
--> statement-breakpoint
|
|
174
|
+
CREATE TABLE "refresh_tokens" (
|
|
175
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
176
|
+
"session_id" uuid NOT NULL,
|
|
177
|
+
"token_hash" text NOT NULL UNIQUE,
|
|
178
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
179
|
+
"expires_at" timestamp with time zone NOT NULL,
|
|
180
|
+
"revoked_at" timestamp with time zone
|
|
181
|
+
);
|
|
182
|
+
--> statement-breakpoint
|
|
183
|
+
CREATE TABLE "sessions" (
|
|
184
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
185
|
+
"user_id" uuid NOT NULL,
|
|
186
|
+
"user_agent" text,
|
|
187
|
+
"ip_address" text,
|
|
188
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
189
|
+
"last_seen_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
190
|
+
"expires_at" timestamp with time zone NOT NULL
|
|
191
|
+
);
|
|
192
|
+
--> statement-breakpoint
|
|
193
|
+
CREATE TABLE "user_preferences" (
|
|
194
|
+
"user_id" uuid PRIMARY KEY,
|
|
195
|
+
"locale" text,
|
|
196
|
+
"theme" text,
|
|
197
|
+
"sidebar_collapsed" boolean DEFAULT false NOT NULL,
|
|
198
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
199
|
+
);
|
|
200
|
+
--> statement-breakpoint
|
|
201
|
+
CREATE TABLE "users" (
|
|
202
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
203
|
+
"email" text NOT NULL UNIQUE,
|
|
204
|
+
"first_name" text NOT NULL,
|
|
205
|
+
"last_name" text NOT NULL,
|
|
206
|
+
"password_hash" text,
|
|
207
|
+
"role" "user_role" DEFAULT 'affiliate'::"user_role" NOT NULL,
|
|
208
|
+
"status" "user_status" DEFAULT 'active'::"user_status" NOT NULL,
|
|
209
|
+
"signup_source" "signup_source" DEFAULT 'admin_invite'::"signup_source" NOT NULL,
|
|
210
|
+
"invite_accepted_at" timestamp with time zone DEFAULT now(),
|
|
211
|
+
"tos_accepted_at" timestamp with time zone,
|
|
212
|
+
"approved_at" timestamp with time zone,
|
|
213
|
+
"approved_by" uuid,
|
|
214
|
+
"parent_affiliate_id" uuid,
|
|
215
|
+
"totp_secret" text,
|
|
216
|
+
"totp_confirmed_at" timestamp with time zone,
|
|
217
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
218
|
+
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
|
|
219
|
+
);
|
|
220
|
+
--> statement-breakpoint
|
|
221
|
+
CREATE TABLE "verification_tokens" (
|
|
222
|
+
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
223
|
+
"user_id" uuid NOT NULL,
|
|
224
|
+
"purpose" "verification_token_purpose" NOT NULL,
|
|
225
|
+
"token_hash" text NOT NULL UNIQUE,
|
|
226
|
+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
227
|
+
"expires_at" timestamp with time zone NOT NULL
|
|
228
|
+
);
|
|
229
|
+
--> statement-breakpoint
|
|
230
|
+
CREATE INDEX "analytics_outbox_available_idx" ON "analytics_outbox" ("available_at","created_at");--> statement-breakpoint
|
|
231
|
+
CREATE INDEX "analytics_outbox_lock_idx" ON "analytics_outbox" ("locked_at");--> statement-breakpoint
|
|
232
|
+
CREATE INDEX "analytics_outbox_event_type_idx" ON "analytics_outbox" ("event_type");--> statement-breakpoint
|
|
233
|
+
CREATE INDEX "audit_logs_created_at_idx" ON "audit_logs" ("created_at" DESC NULLS LAST);--> statement-breakpoint
|
|
234
|
+
CREATE INDEX "audit_logs_actor_id_created_at_idx" ON "audit_logs" ("actor_id","created_at" DESC NULLS LAST);--> statement-breakpoint
|
|
235
|
+
CREATE INDEX "audit_logs_subject_id_created_at_idx" ON "audit_logs" ("subject_id","created_at" DESC NULLS LAST);--> statement-breakpoint
|
|
236
|
+
CREATE INDEX "audit_logs_actor_role_created_at_idx" ON "audit_logs" ("actor_role","created_at" DESC NULLS LAST);--> statement-breakpoint
|
|
237
|
+
CREATE INDEX "audit_logs_target_idx" ON "audit_logs" ("target_type","target_id");--> statement-breakpoint
|
|
238
|
+
CREATE INDEX "audit_logs_action_idx" ON "audit_logs" ("action");--> statement-breakpoint
|
|
239
|
+
CREATE INDEX "campaigns_affiliate_id_idx" ON "campaigns" ("affiliate_id");--> statement-breakpoint
|
|
240
|
+
CREATE INDEX "campaigns_casino_id_idx" ON "campaigns" ("casino_id");--> statement-breakpoint
|
|
241
|
+
CREATE INDEX "campaigns_commission_id_idx" ON "campaigns" ("commission_id");--> statement-breakpoint
|
|
242
|
+
CREATE INDEX "campaigns_status_idx" ON "campaigns" ("status");--> statement-breakpoint
|
|
243
|
+
CREATE INDEX "commission_rule_groups_commission_id_idx" ON "commission_rule_groups" ("commission_id");--> statement-breakpoint
|
|
244
|
+
CREATE INDEX "commission_rules_rule_group_id_idx" ON "commission_rules" ("rule_group_id");--> statement-breakpoint
|
|
245
|
+
CREATE INDEX "commission_casinos_casino_id_idx" ON "commission_casinos" ("casino_id");--> statement-breakpoint
|
|
246
|
+
CREATE UNIQUE INDEX "conversions_casino_tx_unique" ON "conversions" ("casino_id","casino_tx_id");--> statement-breakpoint
|
|
247
|
+
CREATE INDEX "conversions_campaign_idx" ON "conversions" ("campaign_id","received_at");--> statement-breakpoint
|
|
248
|
+
CREATE INDEX "conversions_affiliate_idx" ON "conversions" ("affiliate_id","received_at");--> statement-breakpoint
|
|
249
|
+
CREATE INDEX "conversions_status_idx" ON "conversions" ("status","locked_until");--> statement-breakpoint
|
|
250
|
+
CREATE INDEX "deals_affiliate_id_idx" ON "deals" ("affiliate_id");--> statement-breakpoint
|
|
251
|
+
CREATE INDEX "deals_commission_id_idx" ON "deals" ("commission_id");--> statement-breakpoint
|
|
252
|
+
CREATE INDEX "deals_status_idx" ON "deals" ("status");--> statement-breakpoint
|
|
253
|
+
CREATE INDEX "deals_parent_deal_id_idx" ON "deals" ("parent_deal_id");--> statement-breakpoint
|
|
254
|
+
CREATE UNIQUE INDEX "deals_parent_deal_affiliate_uniq" ON "deals" ("parent_deal_id","affiliate_id");--> statement-breakpoint
|
|
255
|
+
CREATE INDEX "user_groups_group_id_idx" ON "user_groups" ("group_id");--> statement-breakpoint
|
|
256
|
+
CREATE INDEX "refresh_tokens_session_id_idx" ON "refresh_tokens" ("session_id");--> statement-breakpoint
|
|
257
|
+
CREATE INDEX "refresh_tokens_expires_at_idx" ON "refresh_tokens" ("expires_at");--> statement-breakpoint
|
|
258
|
+
CREATE INDEX "sessions_user_id_idx" ON "sessions" ("user_id");--> statement-breakpoint
|
|
259
|
+
CREATE INDEX "sessions_expires_at_idx" ON "sessions" ("expires_at");--> statement-breakpoint
|
|
260
|
+
CREATE INDEX "users_role_created_at_idx" ON "users" ("role","created_at" DESC NULLS LAST);--> statement-breakpoint
|
|
261
|
+
CREATE INDEX "users_parent_affiliate_id_idx" ON "users" ("parent_affiliate_id");--> statement-breakpoint
|
|
262
|
+
CREATE UNIQUE INDEX "verification_tokens_user_purpose_idx" ON "verification_tokens" ("user_id","purpose");--> statement-breakpoint
|
|
263
|
+
ALTER TABLE "audit_logs" ADD CONSTRAINT "audit_logs_actor_id_users_id_fkey" FOREIGN KEY ("actor_id") REFERENCES "users"("id") ON DELETE SET NULL;--> statement-breakpoint
|
|
264
|
+
ALTER TABLE "audit_logs" ADD CONSTRAINT "audit_logs_subject_id_users_id_fkey" FOREIGN KEY ("subject_id") REFERENCES "users"("id") ON DELETE SET NULL;--> statement-breakpoint
|
|
265
|
+
ALTER TABLE "campaigns" ADD CONSTRAINT "campaigns_affiliate_id_users_id_fkey" FOREIGN KEY ("affiliate_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
266
|
+
ALTER TABLE "campaigns" ADD CONSTRAINT "campaigns_casino_id_casinos_id_fkey" FOREIGN KEY ("casino_id") REFERENCES "casinos"("id") ON DELETE RESTRICT;--> statement-breakpoint
|
|
267
|
+
ALTER TABLE "campaigns" ADD CONSTRAINT "campaigns_commission_id_commissions_id_fkey" FOREIGN KEY ("commission_id") REFERENCES "commissions"("id") ON DELETE RESTRICT;--> statement-breakpoint
|
|
268
|
+
ALTER TABLE "commission_rule_groups" ADD CONSTRAINT "commission_rule_groups_commission_id_commissions_id_fkey" FOREIGN KEY ("commission_id") REFERENCES "commissions"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
269
|
+
ALTER TABLE "commission_rules" ADD CONSTRAINT "commission_rules_rule_group_id_commission_rule_groups_id_fkey" FOREIGN KEY ("rule_group_id") REFERENCES "commission_rule_groups"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
270
|
+
ALTER TABLE "commission_casinos" ADD CONSTRAINT "commission_casinos_commission_id_commissions_id_fkey" FOREIGN KEY ("commission_id") REFERENCES "commissions"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
271
|
+
ALTER TABLE "commission_casinos" ADD CONSTRAINT "commission_casinos_casino_id_casinos_id_fkey" FOREIGN KEY ("casino_id") REFERENCES "casinos"("id") ON DELETE RESTRICT;--> statement-breakpoint
|
|
272
|
+
ALTER TABLE "conversions" ADD CONSTRAINT "conversions_campaign_id_campaigns_id_fkey" FOREIGN KEY ("campaign_id") REFERENCES "campaigns"("id");--> statement-breakpoint
|
|
273
|
+
ALTER TABLE "conversions" ADD CONSTRAINT "conversions_casino_id_casinos_id_fkey" FOREIGN KEY ("casino_id") REFERENCES "casinos"("id");--> statement-breakpoint
|
|
274
|
+
ALTER TABLE "conversions" ADD CONSTRAINT "conversions_affiliate_id_users_id_fkey" FOREIGN KEY ("affiliate_id") REFERENCES "users"("id");--> statement-breakpoint
|
|
275
|
+
ALTER TABLE "deals" ADD CONSTRAINT "deals_affiliate_id_users_id_fkey" FOREIGN KEY ("affiliate_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
276
|
+
ALTER TABLE "deals" ADD CONSTRAINT "deals_commission_id_commissions_id_fkey" FOREIGN KEY ("commission_id") REFERENCES "commissions"("id") ON DELETE RESTRICT;--> statement-breakpoint
|
|
277
|
+
ALTER TABLE "deals" ADD CONSTRAINT "deals_assigned_by_id_users_id_fkey" FOREIGN KEY ("assigned_by_id") REFERENCES "users"("id") ON DELETE SET NULL;--> statement-breakpoint
|
|
278
|
+
ALTER TABLE "deals" ADD CONSTRAINT "deals_parent_deal_id_deals_id_fkey" FOREIGN KEY ("parent_deal_id") REFERENCES "deals"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
279
|
+
ALTER TABLE "group_permissions" ADD CONSTRAINT "group_permissions_group_id_groups_id_fkey" FOREIGN KEY ("group_id") REFERENCES "groups"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
280
|
+
ALTER TABLE "user_groups" ADD CONSTRAINT "user_groups_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
281
|
+
ALTER TABLE "user_groups" ADD CONSTRAINT "user_groups_group_id_groups_id_fkey" FOREIGN KEY ("group_id") REFERENCES "groups"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
282
|
+
ALTER TABLE "user_permissions" ADD CONSTRAINT "user_permissions_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
283
|
+
ALTER TABLE "platform_settings" ADD CONSTRAINT "platform_settings_updated_by_users_id_fkey" FOREIGN KEY ("updated_by") REFERENCES "users"("id") ON DELETE SET NULL;--> statement-breakpoint
|
|
284
|
+
ALTER TABLE "refresh_tokens" ADD CONSTRAINT "refresh_tokens_session_id_sessions_id_fkey" FOREIGN KEY ("session_id") REFERENCES "sessions"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
285
|
+
ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
286
|
+
ALTER TABLE "user_preferences" ADD CONSTRAINT "user_preferences_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
|
|
287
|
+
ALTER TABLE "users" ADD CONSTRAINT "users_approved_by_users_id_fkey" FOREIGN KEY ("approved_by") REFERENCES "users"("id") ON DELETE SET NULL;--> statement-breakpoint
|
|
288
|
+
ALTER TABLE "users" ADD CONSTRAINT "users_parent_affiliate_id_users_id_fkey" FOREIGN KEY ("parent_affiliate_id") REFERENCES "users"("id") ON DELETE SET NULL;--> statement-breakpoint
|
|
289
|
+
ALTER TABLE "verification_tokens" ADD CONSTRAINT "verification_tokens_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;
|