fix(membership-fees): add DB constraints for enum and decimal precision
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Moritz 2025-12-11 17:06:10 +01:00
parent b37c312b15
commit 174b7696d3
6 changed files with 78 additions and 8 deletions

View file

@ -65,7 +65,8 @@ defmodule Mv.MembershipFees.MembershipFeeCycle do
attribute :amount, :decimal do
allow_nil? false
public? true
description "Fee amount for this cycle (stored for audit trail)"
description "Fee amount for this cycle (stored for audit trail, non-negative, max 2 decimal places)"
constraints min: 0, scale: 2
end
attribute :status, :atom do

View file

@ -63,7 +63,8 @@ defmodule Mv.MembershipFees.MembershipFeeType do
attribute :amount, :decimal do
allow_nil? false
public? true
description "Fee amount in default currency"
description "Fee amount in default currency (non-negative, max 2 decimal places)"
constraints min: 0, scale: 2
end
attribute :interval, :atom do