feat: enhance message retrieval logic with context-based filtering

- Updated the MessageSchema to include context-aware filtering for notifications, allowing retrieval of messages based on recipientId when the context is NOTIFICATION.
- Improved the resolve function to handle subscription checks, ensuring that unauthorized access is properly managed.
- Added error handling for cases where the context is not allowed, enhancing overall robustness of the message retrieval process.
This commit is contained in:
2024-12-09 19:08:25 +07:00
parent 4ba3077a9b
commit 9732d7b904
3 changed files with 10 additions and 7 deletions

View File

@@ -197,6 +197,7 @@ export class RefundTicketSchema extends PothosSchema {
bankName = 'Center Mentor Refund Account'
} else {
// Existing bank lookup for customers
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
const bank = banks.data.find((bank: any) => bank.bin === bankBin)
if (!bank) {
throw new Error('Bank not found')