Commit graph

466 commits

Author SHA1 Message Date
93216f3ee6 Harden NoActor check with runtime environment guard
Add Mix.env() check to match?/3 for defense in depth.
Document NoActor pattern in CODE_GUIDELINES.md.
2026-01-22 21:36:09 +01:00
429042cbba feat(auth): add User resource authorization policies
Implement bypass for READ + HasPermission for UPDATE pattern
Extend HasPermission check to support User resource scope :own
2026-01-22 19:19:22 +01:00
d07f1984cd Move require Logger to module level
All checks were successful
continuous-integration/drone/push Build is passing
Move require Logger statements from function/case level to module level
for better code organization and consistency with Elixir best practices
2026-01-21 08:35:34 +01:00
b0ddf99117 Add admin authorization check for regenerate cycles button
Restrict UI access to cycle regeneration to administrators only
to prevent policy bypass via user interface
2026-01-21 08:02:38 +01:00
7e9de8e95b Add logging for fail-open email uniqueness validations
Log warnings when query errors occur in email uniqueness checks
to improve visibility of data integrity issues
2026-01-21 08:02:33 +01:00
5c3657fed1 Use SystemActor opts for cycle deletion operations
Pass actor_opts to delete_cycles/1 to ensure proper authorization
when MembershipFeeCycle policies are enforced
2026-01-21 08:02:32 +01:00
006b1aaf06 Replace Mix.env() with Config.sql_sandbox?() in SystemActor
Use Application config instead of Mix.env() to prevent
runtime crashes in production releases where Mix is not available
2026-01-21 08:02:31 +01:00
c5bd58e7d3 Add @spec type annotations to SystemActor functions
Add type specifications for all private functions to improve
static analysis with Dialyzer and documentation quality.
2026-01-20 23:16:39 +01:00
a3cf8571ff Document System Actor pattern in code guidelines
Add section explaining when and how to use system actor for systemic operations.
Include examples and distinction between user mode and system mode.
2026-01-20 22:10:11 +01:00
c64b74588f Use system actor for cycle generation
Update cycle generator, member hooks, and job to use system actor.
Remove actor parameters as cycle generation is a mandatory side effect.
2026-01-20 22:09:20 +01:00
f0169c95b7 Use system actor for email uniqueness validation
Update email validation modules to use system actor for queries.
This ensures data integrity checks always run regardless of user permissions.
2026-01-20 22:09:19 +01:00
8acd92e8d4 Use system actor for email synchronization
Update email sync loader and changes to use system actor instead of user actor.
This ensures email sync always works regardless of user permissions.
2026-01-20 22:09:18 +01:00
ddb1252831 Add System Actor helper for systemic operations
Introduce Mv.Helpers.SystemActor module with lazy loading
for operations that must always run regardless of user permissions.
System actor has admin role and auto-creates in test environment.
2026-01-20 22:09:16 +01:00
433f008af8 refactor: Reduce function complexity and nesting depth
- Extract helper functions from process_chunk to reduce nesting
- Extract format_error_message from extract_changeset_error
- Split extract_error_message into smaller functions to reduce complexity
- Fixes Credo refactoring opportunities
2026-01-20 16:05:32 +01:00
0abcf540bb refactor: Replace length/1 with empty list comparison
Replace expensive length/1 calls with direct list comparison
to fix Credo warnings about performance
2026-01-20 15:58:15 +01:00
cafd1d4ebc
refactor: Remove deprecated LiveViews
- Remove CustomFieldValueLive (Index, Form, Show)
- Remove ContributionTypeLive.Index
- Remove ContributionPeriodLive.Show
- Remove corresponding routes from router
- Remove references in CustomFieldValueLive.Index
2026-01-20 15:50:08 +01:00
9c2cff6307
docs: Update domain Public API documentation 2026-01-20 15:50:08 +01:00
b380f63cf6
chore: update docs 2026-01-20 14:31:13 +01:00
b84431879c Merge pull request 'fix admin database seeding closes #357' (#358) from bugfix/reseeding-database-not-working into main
Reviewed-on: #358
2026-01-19 14:17:12 +01:00
d9b659e5ea
fix: linting + tests 2026-01-19 14:09:19 +01:00
584442076e
fix: add error message to form 2026-01-19 12:47:17 +01:00
ac0e272cca refactor: change length for performance 2026-01-19 12:37:39 +01:00
b70dd3d98f formatting 2026-01-19 12:02:34 +01:00
3cbd90ecdd feat: adds error capping 2026-01-19 12:02:28 +01:00
24426c7786 Merge branch 'main' into feature/333_validation 2026-01-19 11:46:14 +01:00
7da037d81d refactor: adds schemales changeset and validation constant 2026-01-19 11:43:51 +01:00
8b3cc6a6b2 feat: adds row validation 2026-01-19 11:22:11 +01:00
54d96136b7
fix: link/button semantics 2026-01-16 17:16:06 +01:00
c86ae6aa9d
fix: sidebar accessibility 2026-01-16 14:17:15 +01:00
c3515b4105
feat: adjust display of submenu 2026-01-16 13:53:31 +01:00
74af41c8ab
feat: reorder sidebar 2026-01-16 12:46:45 +01:00
6dc398fa5a refactor: reduce complexity 2026-01-15 17:00:17 +01:00
67072f0c52 feat: adds header header normalization 2026-01-15 16:11:09 +01:00
8a5d012895 refactor parser 2026-01-15 12:15:22 +01:00
3bbe9895ee fix: improve CSV parser error handling 2026-01-15 11:08:22 +01:00
68e19bea18 feat: add csv parser 2026-01-15 10:10:02 +01:00
4b41ab37bb Merge branch 'main' into feature/330_import_service_skeleton 2026-01-14 12:30:40 +01:00
fb71b7ddb1 fix struct inconsistencies
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-14 09:49:40 +01:00
b103ae3a5f
i18n: Update English translations
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-13 16:30:32 +01:00
89fbd55250
refactor: Reduce nesting depth in UserLive.Form.load_members_for_linking 2026-01-13 15:21:00 +01:00
fba0ea5ec0
fix: Replace Ash.read! with error handling in CustomFieldValueLive.Index
- Replace Ash.read! with Ash.read and proper error handling in mount/3
2026-01-13 15:21:00 +01:00
eb81d5f7cb
refactor: Simplify UserLive.Form handle_event and improve error handling
- Extract handle_member_linking, perform_member_link_action helpers
- Extract handle_save_success, get_action_name, handle_member_link_error
- Replace hardcoded strings with gettext translations
- Use submit_form wrapper for consistent actor handling
- Group all handle_event/3 clauses together
- Add early return in load_members_for_linking if actor is nil
2026-01-13 15:17:07 +01:00
a22081f288
refactor: Replace bang calls with error handling in Index LiveViews
- Replace Ash.get!/Ash.destroy! with Ash.get/Ash.destroy
- Add case statements for Forbidden, NotFound, and generic errors
- Display user-friendly flash messages for all error cases
- Use Enum.map_join/3 for efficient error formatting
2026-01-13 15:17:07 +01:00
77ae5c4888
refactor: Use submit_form wrapper in all LiveView forms
- Replace AshPhoenix.Form.submit with submit_form/3 wrapper
- Import current_actor and submit_form from LiveHelpers
- Consistent actor handling in all form submissions
2026-01-13 15:17:06 +01:00
897677a782
refactor: Replace actor option patterns with ash_actor_opts helper
- Replace if actor, do: [actor: actor], else: [] with Mv.Helpers.ash_actor_opts/1
- Update email_sync/loader.ex, member validations, member.ex, cycle_generator.ex
- Consistent actor handling across non-LiveView modules
2026-01-13 15:17:06 +01:00
555ae15173
feat: Add shared helper functions for actor handling
- Add Mv.Helpers module with ash_actor_opts/1 helper
- Add current_actor/1 with @spec to LiveHelpers
- Add ash_actor_opts/1 delegate and submit_form/3 wrapper to LiveHelpers
- Standardize actor access pattern across LiveViews
2026-01-13 15:17:06 +01:00
351eac4c02
Fix error handling and actor access in MemberLive.Index
Replace bang calls with proper error handling and use current_actor/1
helper for consistent actor access.
2026-01-13 15:17:05 +01:00
cd7e6b0843
Use current_actor/1 helper in all LiveViews
Replace inconsistent actor access patterns with current_actor/1 helper
and ensure actor is passed to all Ash operations for proper authorization.
2026-01-13 15:16:00 +01:00
74fe60f768
Pass actor parameter to member email validation
Extract actor from changeset context and pass it to Ash.read and
Ash.load calls in email uniqueness validation.
2026-01-13 15:16:00 +01:00
5ffd2b334e
Pass actor parameter through email sync operations
Extract actor from changeset context and pass it to all email sync
loader functions to ensure proper authorization when loading linked
users and members.
2026-01-13 15:16:00 +01:00