({
transaction,
user,
}: {
transaction: UserTransaction;
user: LoggedUser;
})
| 10 | const QUEST_REWARD_REFERENCE_PREFIX = 'quest_reward:'; |
| 11 | |
| 12 | export const getTransactionType = ({ |
| 13 | transaction, |
| 14 | user, |
| 15 | }: { |
| 16 | transaction: UserTransaction; |
| 17 | user: LoggedUser; |
| 18 | }): TransactionItemType => { |
| 19 | if (!transaction.sender && !transaction.product) { |
| 20 | return 'purchase'; |
| 21 | } |
| 22 | |
| 23 | if (transaction.receiver.id === user.id) { |
| 24 | return 'receive'; |
| 25 | } |
| 26 | |
| 27 | if (transaction.sender?.id === user.id) { |
| 28 | return 'send'; |
| 29 | } |
| 30 | |
| 31 | return 'unknown'; |
| 32 | }; |
| 33 | |
| 34 | export const getTransactionLabel = ({ |
| 35 | transaction, |
no outgoing calls
no test coverage detected