mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-08 18:42:01 -04:00
Per code review feedback from @objecttothis: - Create app/Enums/RewardOperation.php with Deduct, Restore, Adjust cases - Update Reward_lib::adjustRewardPoints() to use RewardOperation enum instead of string parameter for operation type - Update tests to use RewardOperation::Deduct/Restore enum values Benefits: - Type safety: Cannot pass invalid operation string - IDE autocomplete support for operation types - Compile-time error for typos instead of runtime failure - Self-documenting code with explicit cases
15 lines
286 B
PHP
15 lines
286 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
/**
|
|
* Reward operation types for customer points adjustments.
|
|
*
|
|
* Used by Reward_lib to perform type-safe reward point operations.
|
|
*/
|
|
enum RewardOperation: string
|
|
{
|
|
case Deduct = 'deduct';
|
|
case Restore = 'restore';
|
|
case Adjust = 'adjust';
|
|
} |