package com.yuchen.saas.park.service.service.domain.config;

import com.yuchen.saas.park.api.commons.domain.DoorAccessControlConfigSetting;
import com.yuchen.saas.park.api.commons.enums.DoorAccessControlConfigMappingType;
import lombok.Data;

import javax.validation.constraints.Positive;

@Data(staticConstructor = "of")
public class DoorAccessControlConfigMappingSaveSO {
    private final DoorAccessControlConfigMappingType type;

    @Positive
    private final long userRefId;

    private final boolean recursive;

    @Positive
    private final long doorAccessControlRefId;

    private final DoorAccessControlConfigSetting setting;

    public static DoorAccessControlConfigMappingSaveSO of(DoorAccessControlConfigMappingType type, @Positive long userRefId, @Positive long doorAccessControlRefId, DoorAccessControlConfigSetting setting) {
        return of(type, userRefId, false, doorAccessControlRefId, setting);
    }
}
