import 'package:test_sa/models/enums/work_order_next_step.dart';

extension EnumExtensionsWorkOrder on WorkOrderNextStepEnum {
  int getIntFromWorkOrderNextStepEnum() {
    switch (this) {
      case WorkOrderNextStepEnum.onlyView:
        return 2;
      case WorkOrderNextStepEnum.markedAsFixed:
        return 3;
      case WorkOrderNextStepEnum.nTakeAction:
        return 5;

      case WorkOrderNextStepEnum.eRejectAccept:
        return 9;

      case WorkOrderNextStepEnum.eFixRemotelyNeedVisit:
        return 12;

      case WorkOrderNextStepEnum.eArrived:
        return 15;

      case WorkOrderNextStepEnum.verifyAssetDetail:
        return 16;

      case WorkOrderNextStepEnum.activity:
        return 17;

      case WorkOrderNextStepEnum.endWorkFlow:
        return 22;
      case WorkOrderNextStepEnum.assetRetirementManagementApproval:
        return 26;
    }
  }
}

extension IntExtensionsWorkOrder on int {
  WorkOrderNextStepEnum toWorkOrderNextStepEnum() {
    switch (this) {
      case 2:
        return WorkOrderNextStepEnum.onlyView;
        case 3:
        return WorkOrderNextStepEnum.markedAsFixed;
      case 5:
        return WorkOrderNextStepEnum.nTakeAction;
      case 9:
        return WorkOrderNextStepEnum.eRejectAccept;
      case 12:
        return WorkOrderNextStepEnum.eFixRemotelyNeedVisit;
      case 15:
        return WorkOrderNextStepEnum.eArrived;
      case 16:
        return WorkOrderNextStepEnum.verifyAssetDetail;
      case 17:
        return WorkOrderNextStepEnum.activity;
        case 22:
        return WorkOrderNextStepEnum.endWorkFlow;
        case 26:
        return WorkOrderNextStepEnum.assetRetirementManagementApproval;
      default:
        return WorkOrderNextStepEnum.onlyView;
    }
  }
}
