package com.airlock.iam.common.domain.model.user;

import com.airlock.iam.common.api.domain.model.locking.LockReason;

public interface Lockable {
   String id();

   void lock(LockReason var1);

   void lock(String var1);

   void unlock();

   UserLockState lockState();

   default boolean isLocked() {
      return this.lockState().isLocked();
   }

   default boolean isSelfUnlockSupported() {
      return this.lockState().getReason().map(LockReason::isSelfUnlockSupported).orElse(false);
   }
}
