Feature: Finance Management Scenario: Create finance record as admin Given I login as "admin@perauset.org" When I create a finance record "Office Supplies" with amount 150 and type "expense" Then the response status should be 200 And the response body field "name" should be "Office Supplies" And the response body field "recordType" should be "expense" And I store the response field "financeId" as "financeId" Scenario: List finance records Given I login as "admin@perauset.org" When I create a finance record "Boat Fuel" with amount 200 and type "expense" Then the response status should be 200 When I list finance records Then the response status should be 200 And the response body field "items" should be truthy Scenario: Update finance record Given I login as "admin@perauset.org" When I create a finance record "Garden Tools" with amount 75 and type "expense" Then the response status should be 200 And I store the response field "financeId" as "financeId" When I update the finance record with name "Garden Tools (Updated)" Then the response status should be 200 And the response body field "name" should be "Garden Tools (Updated)" Scenario: Link finance record to entity Given I login as "admin@perauset.org" When I create a finance record "Kitchen Equipment" with amount 500 and type "expense" Then the response status should be 200 And I store the response field "financeId" as "financeId" When I create an inventory item "Blender" with unit "pieces" quantity 2 and minimum 1 Then the response status should be 200 And I store the response field "itemId" as "itemId" When I link the finance record to entity type "inventory_item" Then the response status should be 200 And the response body field "linkId" should be truthy Scenario: List links for finance record Given I login as "admin@perauset.org" When I create a finance record "Retreat Supplies" with amount 300 and type "expense" Then the response status should be 200 And I store the response field "financeId" as "financeId" When I create an inventory item "Yoga Mats" with unit "pieces" quantity 10 and minimum 2 Then the response status should be 200 And I store the response field "itemId" as "itemId" When I link the finance record to entity type "inventory_item" Then the response status should be 200 When I list finance links for the current finance record Then the response status should be 200 And the response body field "items" should be truthy Scenario: Unpermissioned user cannot create finance records Given a user "guest@test.org" exists with roles "guest" And I login as "guest@test.org" When I create a finance record "Forbidden Record" with amount 100 and type "expense" Then the response status should be 403