feat: add 4 example membership fee types to seed script
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b3016f0c81
commit
f39fd49af3
1 changed files with 34 additions and 0 deletions
|
|
@ -5,6 +5,39 @@
|
|||
|
||||
alias Mv.Membership
|
||||
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 <- [
|
||||
# Basic example fields (for testing)
|
||||
|
|
@ -332,6 +365,7 @@ end
|
|||
IO.puts("✅ Seeds completed successfully!")
|
||||
IO.puts("📝 Created sample data:")
|
||||
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(" - Admin user: admin@mv.local (password: testpassword)")
|
||||
IO.puts(" - Sample members: Hans, Greta, Friedrich")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue