<?php

namespace App\Forms\Customer\Wallet;

use App\Forms\Customer\CustomerForm;

abstract class WalletForm extends CustomerForm
{
  protected function __construct()
  {
    parent::__construct();
  }
  public function getFormRule(string $field, array $formRules): array
  {
    switch ($field) {
      case "user_uid":
      case "clientinfo_uid":
      case "amount":
      case "balance":
        $formRules[$field] = "required|numeric";
        break;
      case "title":
        $formRules[$field] = "required|trim|string";
        break;
      case "content":
        $formRules[$field] = "permit_empty|trim|string";
        break;
      default:
        $formRules = parent::getFormRule($field, $formRules);
        break;
    }
    return $formRules;
  }
}
