This repository was archived by the owner on Mar 28, 2023. It is now read-only.
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
Reconsider feeType enum #1865
Open
Description
Currently the Profile.ModeratorInfo.Fee.FeeType
value is ambiguous and we should consider improving or removing the field entirely.
Argument in favor of removal:
- feeType has the following enums:
FIXED
,PERCENTAGE
, andFIXED_WITH_PERCENTAGE
where bothFIXED
andPERCENTAGE
can be represented by justFIXED_PLUS_PERCENTAGE
values (because we allow0
values for either/bothfixedFee.Amount
or/andpercentage
amounts) - The only value this field appears to have is for validation which it cannot do since the fields allows both/either of the above fields to also be empty/zero (which go does not differentiate between).
Argument in favor of improvement:
- If the field is meant for validation, we should introduce
NO_FEE
and protect the feeType inputs as follows: -
NO_FEE
requires 0 for bothfixedFee
andpercentage
-
FIXED_FEE
requires 0 forpercentage
and postivie value forfixedFee.Amount
-
PERCENTAGE
requires 0 forfixedFee.Amount
and postivie value forpercentage
-
FIXED_PLUS_PERCENTAGE
requires postivie value forpercentage
andfixedFee.Amount
This can be discussed and included on the next schema change proposal.