package com.yuchen.saas.park.api.commons.enums;

import com.yuchen.saas.park.api.commons.CodeAble;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import static com.yuchen.saas.park.api.commons.enums.DoorAccessControlUserType.*;

@Getter
@RequiredArgsConstructor
public enum DoorAccessControlConfigMappingType implements CodeAble {
    //组织绑定设备组21
    DEPARTMENT_GROUP(DEPARTMENT, DoorAccessControlType.GROUP),
    //组织绑定设备20
    DEPARTMENT_PERSONAL(DEPARTMENT, DoorAccessControlType.PERSONAL),
    //人员分组绑定设备组11
    GROUP_GROUP(GROUP, DoorAccessControlType.GROUP),
    //人员分组绑定设备10
    GROUP_PERSONAL(GROUP, DoorAccessControlType.PERSONAL),
    //个人绑定门禁组1
    PERSONAL_GROUP(PERSONAL, DoorAccessControlType.GROUP),
    //个人绑定设备0
    PERSONAL_PERSONAL(PERSONAL, DoorAccessControlType.PERSONAL);

    private final DoorAccessControlUserType doorAccessControlUserType;
    private final DoorAccessControlType doorAccessControlType;

    @Override
    public int getCode() {
        return doorAccessControlUserType.getCode() * 10 + doorAccessControlType.getCode();
    }
}
