Commit graph

70 commits

Author SHA1 Message Date
4997493139
refactor: implement proper notification handling via after_action hooks
Refactor notification handling according to Ash best practices
2025-12-16 15:15:36 +01:00
f7c33bfc7d
fix: resolve notification handling and maintain after_action for cycle regeneration 2025-12-16 15:15:36 +01:00
b517594141
refactor: reduce nesting depth in regenerate_cycles_on_type_change
Split the function into smaller, focused functions to reduce nesting depth
2025-12-16 15:15:36 +01:00
358b1bfdb1
fix: address code review points for cycle regeneration
1. Fix critical notifications bug
2. Fix today inconsistency
3. Add advisory lock around deletion
4. Improve helper function documentation
5. Improve error message UX
2025-12-16 15:15:35 +01:00
5b66d49fcd
fix: prevent deadlocks by detecting existing transactions 2025-12-16 15:15:35 +01:00
3733ad9d89
fix: make cycle regeneration atomic on type change
Make cycle regeneration synchronous in the same transaction as the member
update to ensure atomicity.
2025-12-16 15:15:33 +01:00
4384086245
refactor: reduce nesting depth and improve code readability
- Replace Enum.map |> Enum.join with Enum.map_join for efficiency
- Extract helper functions to reduce nesting depth from 4 to 2
- Rename is_current_cycle? to current_cycle? following Elixir conventions
2025-12-16 15:15:33 +01:00
2d1d650c28
feat: regenerate cycles when membership fee type changes (same interval)
- Implemented regenerate_cycles_on_type_change helper in Member resource
- Cycles that haven't ended yet (cycle_end >= today) are deleted and regenerated
- Paid and suspended cycles remain unchanged (not deleted)
- CycleGenerator reloads member with new membership_fee_type_id
- Adjusted tests to work with current cycles only (no future cycles)
- All integration tests passing

Phase 4 completed: Cycle regeneration on type change
2025-12-16 15:15:33 +01:00
cd915531c2
feat: add validation for same-interval membership fee type changes 2025-12-16 15:15:33 +01:00
673e90d179
feat: add cycle status calculations to Member resource 2025-12-16 15:15:32 +01:00
651f518215
Merge branch 'main' into feature/278_membership_fee_settings
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-16 15:12:51 +01:00
8bfa5b7d1d chore: remove immutable from custom fields 2025-12-16 14:35:00 +01:00
8cbd481709 refactor: migrate MembershipFeeSettingsLive to AshPhoenix.Form 2025-12-12 19:05:41 +01:00
9e441213be feat: improve error handling in settings validation for default_membership_fee_type_id 2025-12-12 19:02:22 +01:00
96729cb2f4 refactor: replace ContributionSettingsLive mockup with MembershipFeeSettingsLive in navigation 2025-12-12 18:05:19 +01:00
da1fd3da73 feat: implement full CRUD for membership fee types with settings UI
- Add interval immutability and deletion prevention validations
- Add settings validation for default_membership_fee_type_id
- Create MembershipFeeSettingsLive for admin UI with form handling
- Add comprehensive test coverage (unit, integration, settings)
2025-12-12 17:52:52 +01:00
2e8c9eeccb feat: add error logging in after_action cycle generation hooks
- Log warnings when cycle generation fails in Member create/update
- Extract generate_fn to reduce code duplication
- Improves debuggability of silent failures
2025-12-12 16:09:37 +01:00
7e4d3e0a60 refactor: use sql_sandbox config instead of env for sync/async
- Replace Application.get_env(:mv, :env) with :sql_sandbox config
- Remove redundant :env config from test.exs
- More explicit and less error-prone for test environment detection
2025-12-12 16:05:39 +01:00
162d06da21
feat: implement automatic cycle generation for members
All checks were successful
continuous-integration/drone/push Build is passing
- Add CycleGenerator module with advisory lock mechanism
- Add SetMembershipFeeStartDate change for auto-calculation
- Extend Settings with include_joining_cycle and default_membership_fee_type_id
- Add scheduled job skeleton for future Oban integration
2025-12-11 21:26:58 +01:00
4d1b33357e feat(membership-fees): add database schema and Ash domain structure 2025-12-11 18:46:48 +01:00
00fe471bc0 fix: custom field substring search - pass id as parameter
All checks were successful
continuous-integration/drone/push Build is passing
Fragment 'member_id = id' did not resolve correctly. Now passes id as
Ash expression. Also changed LIKE to ILIKE for case-insensitive search.
2025-12-11 14:04:13 +01:00
ca5fad0dcc
security: add input sanitization for search queries
All checks were successful
continuous-integration/drone/push Build is passing
- Escape SQL LIKE wildcards (% and _) to prevent pattern injection
- Limit search query length to 100 characters
- Apply sanitization in both :search action and linking filters
- FTS and fuzzy search use unsanitized query (wildcards not special there)
2025-12-11 13:49:07 +01:00
1ec6188884
perf: remove custom field search from user-linking autocomplete
Custom field LIKE queries on JSONB are expensive (no index).
User linking only needs name/email search for autocomplete.
Custom fields are still searchable via main member search (uses FTS index).
Remove unnecessary credo:disable as function complexity is now acceptable.
2025-12-11 13:49:07 +01:00
062dad99fb
refactor: remove unused fields parameter from fuzzy_search API
The fields parameter was accepted but never used in the :search action.
Simplify API to only accept the query parameter.
Update @doc to reflect the actual functionality.
2025-12-11 13:49:07 +01:00
12f95c1998
docs: document fuzzy search similarity threshold strategy
Explain the two-tier matching approach:
- % operator with server-wide threshold (0.3) for fast index scans
- similarity functions with configurable threshold (0.2) for edge cases
Add rationale for threshold value based on German name testing
2025-12-11 13:49:06 +01:00
add855c8cb
refactor: remove redundant ilike filter in build_substring_filter
contains(city, ^query) already produces ILIKE '%query%'
ilike(city, ^pattern) with pattern="%query%" is identical
2025-12-11 13:49:06 +01:00
265e976d94
fix: simplify JSONB extraction - remove redundant operators
- Replace 4 LIKE checks with 2 in build_custom_field_filter
- Simplify CASE blocks in migration trigger functions
- ->> operator always returns text, no need for -> + ::text fallback
- Performance improvement: 50% fewer LIKE operations
2025-12-11 13:49:05 +01:00
8c361cfc88 feat: updates query in member ressource 2025-12-11 13:44:30 +01:00
f0613fe1e5 Merge branch 'main' into feature/209_hide_field_dropdown
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-03 12:52:12 +01:00
c8968636a8 feat: remove birth_date field from Member resource
All checks were successful
continuous-integration/drone/push Build is passing
Users who need birthday data can use custom fields instead.
Closes #161
2025-12-02 14:58:50 +01:00
13f77b5c0a
Refactor column visibility logic
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-02 14:18:27 +01:00
dce2053ce7 formatting and refactor member fields constant 2025-12-02 14:17:53 +01:00
397cbde9d6 feat: adds member visibility settings 2025-12-02 14:16:02 +01:00
d039e4bb7d formatting and refactor member fields constant
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-02 10:02:52 +01:00
82e41916d2 feat: adds member visibility settings 2025-12-02 09:23:23 +01:00
37553d8d6c feat: adds settings live view and updated seeds 2025-12-01 10:42:10 +01:00
193618eace chore: adds settings ressource and migration 2025-12-01 10:42:10 +01:00
11179e51f0 chore: show in overview attribute to custom field 2025-12-01 08:50:06 +01:00
df05eafc99 refactor: simplify Member.available_for_linking action to 9 lines
Extract filter logic into apply_linking_filters/3 helper, add Credo disable for fuzzy search complexity
2025-11-20 21:44:29 +01:00
9a03485604
refactor: add typespecs and module constants
- Add @spec for public functions in Member and UserLive.Form
- Replace magic numbers with module constants:
  - @member_search_limit = 10
  - @default_similarity_threshold = 0.2
- Add comprehensive @doc for filter_by_email_match and fuzzy_search
2025-11-20 16:51:45 +01:00
39b285a714
feat: add member fuzzy search for linking (#168) 2025-11-20 16:51:43 +01:00
2af23f4042
feat: custom field deletion 2025-11-20 15:04:08 +01:00
edf8b2b79e
feat: add custom field slug 2025-11-20 14:23:25 +01:00
2b3c94d3b2
fix: Allow optional email values in custom fields
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-13 18:40:18 +01:00
e9290b7156 feat: Add validation constraints and tests for CustomField and CustomFieldValue 2025-11-13 18:37:58 +01:00
8400e727a7
refactor: Rename Property/PropertyType to CustomFieldValue/CustomField
All checks were successful
continuous-integration/drone/push Build is passing
Complete refactoring of resources, database tables, code references, tests, and documentation for improved naming consistency.
2025-11-13 18:04:53 +01:00
150bba2ef8
docs: enable Credo ModuleDoc check and fix remaining modules
Add @moduledoc to Secrets, LiveHelpers, AuthOverrides, and Membership domain.
Enable Credo.Check.Readability.ModuleDoc in .credo.exs.
2025-11-13 11:20:33 +01:00
8fd981806e
docs: add @moduledoc to core membership resources
Add comprehensive module documentation to Member, Property, PropertyType, and Email.
Improves code discoverability and enables ExDoc generation.
2025-11-13 11:20:32 +01:00
a69ccf0ff9 fix: added email serach and ommitted fields 2025-11-12 11:55:35 +01:00
0c75776915 formatting
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-30 17:20:07 +01:00