Skip to content
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
Open
@placer14

Description

@placer14

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, and FIXED_WITH_PERCENTAGE where both FIXED and PERCENTAGE can be represented by just FIXED_PLUS_PERCENTAGE values (because we allow 0 values for either/both fixedFee.Amount or/and percentage 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 both fixedFee and percentage
    • FIXED_FEE requires 0 for percentage and postivie value for fixedFee.Amount
    • PERCENTAGE requires 0 for fixedFee.Amount and postivie value for percentage
    • FIXED_PLUS_PERCENTAGE requires postivie value for percentage and fixedFee.Amount

This can be discussed and included on the next schema change proposal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions