Database Constants¶
This document defines well-known constants.
Colors¶
Each group can have a color, which is represented as a hex value in the DB. This original choice was rather unfortunate because it doesn't account for dark mode or other custom modifications. So now we use the following table to specify the actual color to display. Also note the name of the color to be sent to analytics.
| Id (not used anywhere) | DB value | Light Mode | Dark Mode | Analytics name | Premium |
|---|---|---|---|---|---|
| YELLOW | #DBAF00 | #E6BB0F | #F1CA2C | premium_gold | true |
| ORANGE | #FF9800 | #E6820F | #F1962C | free_orange | false |
| RED | #F44336 | #E94135 | #ED645A | premium_red | true |
| PINK | #E91E63 | #C92C60 | #D74777 | free_pink | false |
| CYAN | #00BCD4 | #00B8CC | #00DCF5 | premium_cyan | true |
| BLUE | #2196F3 | #0087F5 | #1F9AFF | free_blue | false |
| NAVY_BLUE | #4C62E2 | #3E59E0 | #6177E5 | premium_royal_blue | true |
| DEEP_PURPLE | #7E57C2 | #7640B5 | #8B59C5 | premium_purple | true |
| TEAL | #009688 | #00A398 | #00CCBE | premium_teal | true |
| GREEN | #4CAF50 | #2DA03C | #36BF48 | free_green | false |
| BROWN | #795548 | #7E5B4E | #976D5E | free_brown | false |
| BLUE_GRAY | #607D8B | #526D7A | #678898 | premium_blue_grey | true |
Others¶
- changes/$groupId/$changeId
- action
- insert
- update
- delete
- currencyChange = group changed currency and all transactions' exchangeRate has been updated
- migrate = group was migrated, valid only for entity group
- archive + restore = group was archived / restored
- premiumPurchase = someone bought a Group Premium
- exchangeRatesChange = exchange rates were updated for the whole group
- send/receive/refund = sending, receiving and refunding of bitcoin lightning payments
- entity
- expense
- transfer
- allTransactions = valid only with delete action
- group
- member
- permission
- recurringTransaction
- bitcoin
- transactions/$groupId/$transactionId
- type
- expense
- transfer
- income
- recurringTemplates/$groupId/$templateId/recurrence
- period
- daily
- weekly
- monthly
- yearly
- monthlySetting (required, when period == monthly)
- lastDayOfMonth
- sameDayOfWeek
- sameDayOfMonth
- weeklySetting (optional, when period == weekly)
- [ mon .. sun ]
- permissions/$groupId/$userId
- level
- 10 = Read-only access
- 20 = Edit expenses & members
- 30 = Group owner
- pushRegistrations/$userId/$pushId
- platform
- android
- ios
- web
- windows
- users/$userId
- authProvider
- google
- facebook
- email
- apple
- currentTabId
- OVERVIEW (legacy)
- NEW_GROUP
- (or group id)
- subscriptions/$userId/$subscriptionId
- store
- googlePlay
- appStore
- windowsStore
- stripe
- type
- monthly
- yearly
- gift
- group
- featureReward
- feature (for `featureReward`)
- colors
- categories
- receipts
- recurringTransactions
- remindFriendsToPay
- charts
- exchangeRates
- advancedExport
- groupId (for `group`)
- can be empty - it's an empty slot
- can be group id - it's an active or expired Group Premium (GP) for an existing group
- can be `__EXPIRED_SUBSCRIPTION__` - it's an expired GP for a group which no longer exists
- backend sets this value to prevent old clients from offering this as an empty slot
- new clients should inspect `end` when offering available slots
- serverTasks/$type/$taskId
- $type
- verifyGroupPremium = Verifying in-app purchases
- verifySubscription = Verifying subscriptions
- currencyChange = Change of currency in the whole group
- deleteGroup = Delete a group and all of its contents
- deleteTransactions = Delete all transactions in a group. The point is to have only one Change generated for this
- archiveGroup = move all group data into storage, delete from database. Only the owner can do this
- previewGroup = temporarily restore group data from storage to database for preview. Any old member can do this. Data is automatically deleted after 1 day
- restoreGroup = permanently restores group from storage to database, removes entries from storage
- importMemberBalances = import balances from an existing CSV file import, source specifies the source application (Settle Up, Splitwise, ...)
- response
- code
- ok
- error