Commit graph

510 commits

Author SHA1 Message Date
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
82897d5cd3 refactor: improve cycle generation code quality and documentation
All checks were successful
continuous-integration/drone/push Build is passing
- Remove Process.sleep calls from integration tests (tests run synchronously in SQL sandbox)
- Improve error handling: membership_fee_type_not_found now returns changeset error instead of just logging
- Clarify partial_failure documentation: successful_cycles are not persisted on rollback
- Update documentation: joined_at → join_date, left_at → exit_date
- Document PostgreSQL advisory locks per member (not whole table lock)
- Document gap handling: explicitly deleted cycles are not recreated
2025-12-12 17:41:22 +01:00
e6ac5d1ab1 fix: handle Ash notifications in CycleGenerator transactions
All checks were successful
continuous-integration/drone/push Build is passing
- Use return_notifications?: true when creating cycles within transaction
- Collect notifications and send them after transaction commits
- Prevents 'Missed notifications' warnings in test output
- Notifications are now properly sent via Ash.Notifier.notify/1
2025-12-12 16:53:57 +01:00
f7fc1f4897 test: fix date dependencies in cycle generator tests
- Add create_member_with_cycles helper that uses fixed 'today' date
- Update tests to use explicit 'today:' option instead of Date.utc_today()
- Prevents test failures when current date changes (e.g., in 2026+)
- Tests now explicitly delete and regenerate cycles with fixed dates
- Ensures consistent test behavior regardless of execution date
2025-12-12 16:41:44 +01:00
0b986db635 fix: CycleGenerator generates from last cycle, not filling gaps
- Change algorithm to start from last existing cycle instead of start_date
- Deleted cycles (gaps) are no longer automatically filled
- Add test to verify gaps remain unfilled
- Update documentation to clarify gap handling behavior
2025-12-12 16:33:39 +01:00
272a8a8afc test: make CycleGenerator tests more robust
- Replace weak assertions (>= 0, if length > 0) with concrete expectations
- Remove unnecessary Process.sleep calls (tests run synchronously)
- Add get_member_cycles helper for direct cycle verification
- Tests now validate actual generated cycles instead of relying on async behavior
2025-12-12 16:25:41 +01:00
cf8a1fa30d feat: improve error handling in CycleGenerator
- Handle Task crashes in async_stream with {:exit, reason}
- Return {:error, {:partial_failure, successes, errors}} when some cycles fail
- Previously returned {:ok, successful} even on partial failures
- Improves debuggability and allows callers to handle partial failures
2025-12-12 16:23:12 +01:00
a99f56969d feat: include inactive members in batch cycle generation
- Remove exit_date filter from generate_cycles_for_all_members query
- Inactive members now get cycles generated up to their exit_date
- Add tests for inactive member processing and exit_date boundary
- Document exit_date == cycle_start behavior (cycle still generated)
2025-12-12 16:21:36 +01:00
b693ab1e26 refactor: improve SetMembershipFeeStartDate change module
- Add warning logging for unexpected errors (not missing prerequisites)
- Use CalendarCycles.interval() type instead of generic atom()
- Update moduledoc to reflect actual usage (no where clause needed)
2025-12-12 16:16:11 +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
ecddf55331
docs: fix CalendarCycles documentation to match actual implementation
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 20:21:20 +01:00
b257c9897f
refactor: improve CalendarCycles API and tests based on code review
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 20:08:19 +01:00
822d06ed54
feat: implement calendar-based cycle calculation functions
All checks were successful
continuous-integration/drone/push Build is passing
Add CalendarCycles module with functions for all interval types.
Includes comprehensive tests for edge cases.
2025-12-11 19:45:01 +01:00
ebbf347e42 fix(membership-fees): add DB constraints for enum and decimal precision
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 18:46:48 +01:00
4d1b33357e feat(membership-fees): add database schema and Ash domain structure 2025-12-11 18:46:48 +01:00
e563d12be3 Merge pull request 'chore(deps): update ghcr.io/sebadob/rauthy docker tag to v0.33.1' (#179) from renovate/ghcr.io-sebadob-rauthy-0.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #179
2025-12-11 18:46:22 +01:00
Renovate Bot
2abbb789b7 chore(deps): update ghcr.io/sebadob/rauthy docker tag to v0.33.1
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 18:44:05 +01:00
045f0dc603 Merge pull request 'chore(deps): update dependency just to v1.45.0' (#269) from renovate/asdf-tool-versions into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #269
2025-12-11 18:42:16 +01:00
Renovate Bot
f480c12bb0 chore(deps): update dependency just to v1.45.0
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 18:39:45 +01:00
2d259e8083 Merge pull request 'chore(deps): update postgres to v17.7' (#253) from renovate/postgres into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #253
2025-12-11 17:05:08 +01:00
15bc2223f0
chore: update prod postgres to version 17.7
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 16:47:02 +01:00
Renovate Bot
110e7f6cbd
chore(deps): update postgres to v17.7 2025-12-11 16:45:56 +01:00
3710d70024 Merge pull request 'Member Fee Concept closes #210' (#221) from docs/210_payment-concept into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #221
Reviewed-by: carla <carla@noreply.git.local-it.org>
2025-12-11 15:54:29 +01:00
3fd8483231 docs: small changes based on review
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 15:52:32 +01:00
f5ef16ec20 docs: change wording
contribution -> membership fee
period -> cycle
2025-12-11 15:52:32 +01:00
85a66f800e Merge pull request 'chore(deps): update dependency gettext to v1' (#185) from renovate/major-mix-dependencies into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #185
2025-12-11 15:28:45 +01:00
Renovate Bot
dbcfe6a29f chore(deps): update dependency gettext to v1
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 14:56:19 +01:00
0a2632102c Merge pull request 'chore(deps): update mix dependencies' (#249) from renovate/mix-dependencies into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #249
2025-12-11 14:55:51 +01:00
9dba4d1019
fix: credo warnings
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 14:21:40 +01:00
Renovate Bot
1c60bc77b4 chore(deps): update mix dependencies
Some checks reported errors
continuous-integration/drone/push Build was killed
2025-12-11 14:17:40 +01:00
d5ac168add Merge pull request 'Implements search for custom fields closes #196' (#266) from feature/196_search_custom_fields into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #266
2025-12-11 14:07:40 +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
014ef04853 docs: updated docs
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 13:44:30 +01:00
8c361cfc88 feat: updates query in member ressource 2025-12-11 13:44:30 +01:00
c2302c5861 chore: adds migration for ts vector custom field 2025-12-11 13:44:30 +01:00
a729d81bb9 test: adds tests for custom field search 2025-12-11 13:44:30 +01:00
37495095c9 Merge pull request 'chore(deps): update renovate/renovate docker tag to v42' (#257) from renovate/renovate-renovate-42.x into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #257
2025-12-11 13:26:13 +01:00
Renovate Bot
9150188922 chore(deps): update renovate/renovate docker tag to v42
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 02:30:06 +00:00
9ff7d7d17b Merge pull request 'Fix small UI issues closes #220' (#259) from feature/220_ui_issues_2 into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #259
2025-12-11 02:13:29 +01:00
b1f6d29ca1
Merge remote-tracking branch 'origin/main' into feature/220_ui_issues_2
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 01:49:12 +01:00
a8cf6e1b18
chore: update gettext
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-11 01:04:08 +01:00
720f640229
fix: test
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-11 00:55:50 +01:00