Compare commits
2 commits
d9ebbab5a4
...
158ac52d97
| Author | SHA1 | Date | |
|---|---|---|---|
| 158ac52d97 | |||
| 7f77eb7023 |
1 changed files with 22 additions and 10 deletions
|
|
@ -249,12 +249,15 @@ find_member = fn email -> Enum.find(all_members, &(&1.email == email)) end
|
|||
# Add custom field values for Hans Müller
|
||||
if hans = find_member.("hans.mueller@example.de") do
|
||||
[
|
||||
{find_field.("Membership Number"), %{"_union_type" => "string", "_union_value" => "M-2023-001"}},
|
||||
{find_field.("Membership Number"),
|
||||
%{"_union_type" => "string", "_union_value" => "M-2023-001"}},
|
||||
{find_field.("T-Shirt Size"), %{"_union_type" => "string", "_union_value" => "L"}},
|
||||
{find_field.("Newsletter Subscription"), %{"_union_type" => "boolean", "_union_value" => true}},
|
||||
{find_field.("Newsletter Subscription"),
|
||||
%{"_union_type" => "boolean", "_union_value" => true}},
|
||||
{find_field.("Membership Type"), %{"_union_type" => "string", "_union_value" => "Regular"}},
|
||||
{find_field.("Parking Permit"), %{"_union_type" => "boolean", "_union_value" => true}},
|
||||
{find_field.("Secondary Email"), %{"_union_type" => "email", "_union_value" => "hans.m@private.de"}}
|
||||
{find_field.("Secondary Email"),
|
||||
%{"_union_type" => "email", "_union_value" => "hans.m@private.de"}}
|
||||
]
|
||||
|> Enum.each(fn {field, value} ->
|
||||
if field do
|
||||
|
|
@ -272,11 +275,14 @@ end
|
|||
# Add custom field values for Greta Schmidt
|
||||
if greta = find_member.("greta.schmidt@example.de") do
|
||||
[
|
||||
{find_field.("Membership Number"), %{"_union_type" => "string", "_union_value" => "M-2023-015"}},
|
||||
{find_field.("Membership Number"),
|
||||
%{"_union_type" => "string", "_union_value" => "M-2023-015"}},
|
||||
{find_field.("T-Shirt Size"), %{"_union_type" => "string", "_union_value" => "M"}},
|
||||
{find_field.("Newsletter Subscription"), %{"_union_type" => "boolean", "_union_value" => true}},
|
||||
{find_field.("Newsletter Subscription"),
|
||||
%{"_union_type" => "boolean", "_union_value" => true}},
|
||||
{find_field.("Membership Type"), %{"_union_type" => "string", "_union_value" => "Student"}},
|
||||
{find_field.("Emergency Contact"), %{"_union_type" => "string", "_union_value" => "Anna Schmidt, +49301234567"}}
|
||||
{find_field.("Emergency Contact"),
|
||||
%{"_union_type" => "string", "_union_value" => "Anna Schmidt, +49301234567"}}
|
||||
]
|
||||
|> Enum.each(fn {field, value} ->
|
||||
if field do
|
||||
|
|
@ -294,12 +300,15 @@ end
|
|||
# Add custom field values for Friedrich Wagner
|
||||
if friedrich = find_member.("friedrich.wagner@example.de") do
|
||||
[
|
||||
{find_field.("Membership Number"), %{"_union_type" => "string", "_union_value" => "M-2022-042"}},
|
||||
{find_field.("Membership Number"),
|
||||
%{"_union_type" => "string", "_union_value" => "M-2022-042"}},
|
||||
{find_field.("T-Shirt Size"), %{"_union_type" => "string", "_union_value" => "XL"}},
|
||||
{find_field.("Newsletter Subscription"), %{"_union_type" => "boolean", "_union_value" => false}},
|
||||
{find_field.("Newsletter Subscription"),
|
||||
%{"_union_type" => "boolean", "_union_value" => false}},
|
||||
{find_field.("Membership Type"), %{"_union_type" => "string", "_union_value" => "Senior"}},
|
||||
{find_field.("Parking Permit"), %{"_union_type" => "boolean", "_union_value" => false}},
|
||||
{find_field.("Date of Last Medical Check"), %{"_union_type" => "date", "_union_value" => ~D[2024-03-15]}}
|
||||
{find_field.("Date of Last Medical Check"),
|
||||
%{"_union_type" => "date", "_union_value" => ~D[2024-03-15]}}
|
||||
]
|
||||
|> Enum.each(fn {field, value} ->
|
||||
if field do
|
||||
|
|
@ -328,5 +337,8 @@ IO.puts(
|
|||
" - Linked members: Maria Weber ↔ maria.weber@example.de, Thomas Klein ↔ thomas.klein@example.de"
|
||||
)
|
||||
|
||||
IO.puts(" - Custom field values: Sample data for Hans (6 fields), Greta (5 fields), Friedrich (6 fields)")
|
||||
IO.puts(
|
||||
" - Custom field values: Sample data for Hans (6 fields), Greta (5 fields), Friedrich (6 fields)"
|
||||
)
|
||||
|
||||
IO.puts("🔗 Visit the application to see user-member relationships and custom fields in action!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue