Membership Fee Type Resource & Settings closes #278 #291
1 changed files with 34 additions and 0 deletions
|
|
@ -5,6 +5,39 @@
|
||||||
|
|
||||||
alias Mv.Membership
|
alias Mv.Membership
|
||||||
alias Mv.Accounts
|
alias Mv.Accounts
|
||||||
|
alias Mv.MembershipFees.MembershipFeeType
|
||||||
|
|
||||||
|
# Create example membership fee types
|
||||||
|
for fee_type_attrs <- [
|
||||||
|
%{
|
||||||
|
name: "Standard (Jährlich)",
|
||||||
|
amount: Decimal.new("120.00"),
|
||||||
|
interval: :yearly,
|
||||||
|
description: "Standard jährlicher Mitgliedsbeitrag"
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
name: "Standard (Halbjährlich)",
|
||||||
|
amount: Decimal.new("65.00"),
|
||||||
|
interval: :half_yearly,
|
||||||
|
description: "Standard halbjährlicher Mitgliedsbeitrag"
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
name: "Standard (Vierteljährlich)",
|
||||||
|
amount: Decimal.new("35.00"),
|
||||||
|
interval: :quarterly,
|
||||||
|
description: "Standard vierteljährlicher Mitgliedsbeitrag"
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
name: "Standard (Monatlich)",
|
||||||
|
amount: Decimal.new("12.00"),
|
||||||
|
interval: :monthly,
|
||||||
|
description: "Standard monatlicher Mitgliedsbeitrag"
|
||||||
|
}
|
||||||
|
] do
|
||||||
|
MembershipFeeType
|
||||||
|
|> Ash.Changeset.for_create(:create, fee_type_attrs)
|
||||||
|
|> Ash.create!(upsert?: true, upsert_identity: :unique_name)
|
||||||
|
end
|
||||||
|
|
||||||
for attrs <- [
|
for attrs <- [
|
||||||
# Basic example fields (for testing)
|
# Basic example fields (for testing)
|
||||||
|
|
@ -332,6 +365,7 @@ end
|
||||||
IO.puts("✅ Seeds completed successfully!")
|
IO.puts("✅ Seeds completed successfully!")
|
||||||
IO.puts("📝 Created sample data:")
|
IO.puts("📝 Created sample data:")
|
||||||
IO.puts(" - Global settings: club_name = #{default_club_name}")
|
IO.puts(" - Global settings: club_name = #{default_club_name}")
|
||||||
|
IO.puts(" - Membership fee types: 4 types (Yearly, Half-yearly, Quarterly, Monthly)")
|
||||||
IO.puts(" - Custom fields: 12 fields (String, Date, Boolean, Email, + 8 realistic fields)")
|
IO.puts(" - Custom fields: 12 fields (String, Date, Boolean, Email, + 8 realistic fields)")
|
||||||
IO.puts(" - Admin user: admin@mv.local (password: testpassword)")
|
IO.puts(" - Admin user: admin@mv.local (password: testpassword)")
|
||||||
IO.puts(" - Sample members: Hans, Greta, Friedrich")
|
IO.puts(" - Sample members: Hans, Greta, Friedrich")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue