Skip to content

Commit

Permalink
Remove obsolete statuses from StatusEnum (CFM-7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Nov 19, 2025
1 parent a6f178f commit 894b32a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
18 changes: 0 additions & 18 deletions app/resources/locales/en_US/enumeration.po
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,6 @@ msgstr "Set"
msgid "StatusEnum.A"
msgstr "Active"

msgid "StatusEnum.C"
msgstr "Confirmed"

msgid "StatusEnum.D"
msgstr "Archived"

Expand All @@ -645,9 +642,6 @@ msgstr "Duplicate"
msgid "StatusEnum.GP"
msgstr "Grace Period"

msgid "StatusEnum.I"
msgstr "Invited"

msgid "StatusEnum.LK"
msgstr "Locked"

Expand All @@ -657,27 +651,15 @@ msgstr "Denied"
msgid "StatusEnum.P"
msgstr "Pending"

msgid "StatusEnum.PA"
msgstr "Pending Approval"

msgid "StatusEnum.PC"
msgstr "Pending Confirmation"

msgid "StatusEnum.PS"
msgstr "Pending Activation"

msgid "StatusEnum.S"
msgstr "Suspended"

msgid "StatusEnum.X"
msgstr "Declined"

msgid "StatusEnum.XP"
msgstr "Expired"

msgid "StatusEnum.Y"
msgstr "Approved"

msgid "SuspendableStatusEnum.A"
msgstr "Active"

Expand Down
16 changes: 1 addition & 15 deletions app/src/Lib/Enum/StatusEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,15 @@

class StatusEnum extends StandardEnum {
const Active = 'A';
const Approved = 'Y';
// Archived was Deleted in v4, so we reuse "D" to simplify upgrading
const Archived = 'D';
const Confirmed = 'C';
const Denied = 'N';
const Duplicate = 'D2';
const Expired = 'XP';
const GracePeriod = 'GP';
const Invited = 'I';
const Locked = 'LK';
const Pending = 'P';
const PendingActivation = 'PS';
const PendingApproval = 'PA';
const PendingConfirmation = 'PC';
const Suspended = 'S';
const Declined = 'X';

/**
* Map a status value to its "preference" or "rank" for status recalculation.
Expand Down Expand Up @@ -75,18 +68,11 @@ public static function rank(string $status): int {
self::Suspended => 13,
self::Expired => 12,

// Then invitation statuses
self::Approved => 11,
self::PendingApproval => 10,
self::Confirmed => 9,
self::PendingConfirmation => 8,
self::Invited => 7,
// Then pending statuses
self::PendingActivation => 6,
self::Pending => 5, // It's not clear this is used for anything

// Denied and Declined are below expired since other roles are more likely to have been used
self::Denied => 4,
self::Declined => 3,

// Finally, we generally don't want Archived or Duplicate unless all roles are deleted or duplicates
self::Archived => 2,
Expand Down

0 comments on commit 894b32a

Please sign in to comment.