timeoverflow icon indicating copy to clipboard operation
timeoverflow copied to clipboard

Direct Transfers Between Allied Organizations

Open gmartincor opened this issue 7 months ago • 0 comments

Direct Transfers Between Allied Organizations

https://github.com/user-attachments/assets/06463d99-7bca-4cb0-9e8e-29ca4bda3649

Description

This PR adds functionality to perform direct transfers between torganizations that have an active alliance.

Changes Made

New Controller

  • Implementation of OrganizationTransfersController to manage specific transfers between allied organizations.

View Modifications

  • Added "Transfer Hours" button on the organization detail view when an active alliance exists
  • Created form to perform transfers between organizations
  • Interface to display completed transfers with a specific label

Transfer Helper Modification

  • Implementation of the is_bank_to_bank_transfer? method to identify direct transfers made between organizations

Route Configuration

  • New routes for the direct transfer flow between organizations

Tests

  • Tests for the OrganizationTransfersController verifying permissions and correct flow
  • Tests for the TransfersHelper with the newly implemented method

Behavior

  • Only administrators can perform direct transfers from their time bank
  • Transfers are only allowed between banks that have an alliance with "accepted" status
  • Transfers are identified with a special label "Bank-to-Bank Transfer"
  • The balance of both organizations' accounts is updated
  • No post is associated with these transfers, as they represent direct collaborations between banks

Security

  • Validations to ensure only administrators can perform direct transfers
  • Verification of the existence and status of the alliance between organizations before allowing transfers
  • Restriction of allowed parameters to prevent mass assignments

gmartincor avatar May 20 '25 09:05 gmartincor