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