feat: custom field deletion

This commit is contained in:
Moritz 2025-11-13 20:03:58 +01:00
parent 21ec86839a
commit 2af23f4042
Signed by: moritz
GPG key ID: 1020A035E5DD0824
11 changed files with 938 additions and 16 deletions

View file

@ -25,11 +25,12 @@ defmodule Mv.Membership.CustomFieldValue do
## Relationships
- `belongs_to :member` - The member this custom field value belongs to (CASCADE delete)
- `belongs_to :custom_field` - The custom field definition
- `belongs_to :custom_field` - The custom field definition (CASCADE delete)
## Constraints
- Each member can have only one custom field value per custom field (unique composite index)
- Custom field values are deleted when the associated member is deleted (CASCADE)
- Custom field values are deleted when the associated custom field is deleted (CASCADE)
- String values maximum length: 10,000 characters
- Email values maximum length: 254 characters (RFC 5321)
@ -46,12 +47,19 @@ defmodule Mv.Membership.CustomFieldValue do
references do
reference :member, on_delete: :delete
reference :custom_field, on_delete: :delete
end
end
actions do
defaults [:create, :read, :update, :destroy]
default_accept [:value, :member_id, :custom_field_id]
read :by_custom_field_id do
argument :custom_field_id, :uuid, allow_nil?: false
filter expr(custom_field_id == ^arg(:custom_field_id))
end
end
attributes do