Refactors grantAward to accept an array of recipientUserIds, adds
duplicate-award and eligibility checks per recipient, and returns a
per-recipient result summary. GrantAwardDialog gains a third step
showing grant results when some recipients fail. RecipientPicker is
rewritten to support multi-select with chip-based selected state and
a maxSelections cap.
Add transfer workflow components and utilities:
1. Transfer types and core functions (src/lib/transfers/index.ts):
- Type-safe transfer request and decision creation
- Appeal, cancel, and resolve core functions
- Server action conventions with error handling
2. Transfer UI components (src/components/frontend/transfers/):
- TransferActionDialog.tsx: Handle approval/rejection appeals
- TransferApprovalCard.tsx: Display approval decisions
- TransferNoteDialog.tsx: Add notes for transfers/appeals
- TransferRequestCard.tsx: Show transfer request details
- TransferResolutionCard.tsx: Display superuser resolutions
- TransfersView.tsx: Main transfers list page
- transferTypes.ts: Shared TypeScript types
3. Notification types (src/lib/transfers/notificationTypes.ts):
- Define notification type constants for transfer events
- Include TRANSFER_NOTIFICATION_TYPES for bridge filtering
4. Integration tests (tests/int/):
- transfer-requests.int.spec.ts: Test bot request polling
- transfer-bot-delivery.int.spec.ts: Test Discord notification delivery
These components and utilities complete the transfer workflow
implementation including approvals, appeals, and delivery.
Add AssignmentCard component integration showing user's assignments with transfer button.
Add RequestTransferDialog integration for requesting transfers.
Display current assignments as badges with leader indication.
Include proper loading states and error handling.
Update Payload configuration:
- Import AssignmentTransfers collection in src/payload.config.ts
Update notification system:
- src/lib/notifications/index.ts: Add transfer notification types
- Update notification helper to support new notification types
Update migrations index:
- src/migrations/index.ts: Register new assignment transfer migrations
These changes integrate the AssignmentTransfers collection into the
existing Payload configuration and notification infrastructure.
Add React components for assignment transfer user interface:
1. AssignmentCard.tsx: Display user's current assignment with transfer button.
Shows assignment details, current status, and allows initiating transfer requests.
2. RequestTransferDialog.tsx: Modal dialog for creating transfer requests.
- Selects target assignment from assignment list
- Optionally notes required for transfer
- Submits request to AssignmentTransfers collection
- Emits AssignmentTransferRequest event
3. Transfers page (src/app/(frontend)/transfers/): Transfer request list view.
- Requests card showing pending requests with requestor, target, current
- Approval cards for assignment leaders
- Appeal cards for rejected requests
- Completed/Cancelled status display
All components use shadcn/ui primitives, proper loading states, error handling,
and provide accessible keyboard navigation.
Add Discord bot services for assignment transfer interactions:
1. transferInteractions.ts: Handle button interactions for transfer requests,
approvals, rejections, appeals, completions, and cancellations.
2. transferRequests.ts: Poll for pending assignment transfers and trigger
notification delivery to Discord when status changes to pending/approved/rejected.
3. transferDelivery.ts: Deliver transfer notifications to users via DMs with
embeds showing status, details, and actions (approve/reject/appeal).
4. transferMessaging.ts: Provide Discord embed building for transfer messages
with status badges and action buttons.
5. Update bot index.ts: Add transfer button interaction handler with customId prefix "ptf-xfer:"
6. Update notificationBridge.ts: Exclude transfer notification types from general
notification polling to avoid duplication (Phase 2 feature).
Integration: Services are started via src/bot/services/index.ts and run alongside
existing mission and notification services.
Add event logging constants for assignment transfer events:
- AssignmentTransferRequest: Request initiated by user
- AssignmentTransferApprove: Leader approved transfer
- AssignmentTransferReject: Leader rejected transfer with reason
- AssignmentTransferAppeal: User appealed a rejection
- AssignmentTransferResolve: Final resolution by superuser
- AssignmentTransferComplete: Transfer completed successfully
- AssignmentTransferCancel: Transfer cancelled
Add assignment-transfers to GameEventLogs TARGET_COLLECTIONS
Add emitGameEvent support for all transfer event types in src/utils/event-log/emit.ts
This provides audit trail and notification support for the transfer workflow.