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.domain.DoorAccessControlConfigTarget;
import lombok.Data;

import javax.validation.constraints.Positive;

@Data(staticConstructor = "of")
public class DoorAccessControlConfigMappingDetailsSaveSO {
    @Positive
    private final long doorAccessControlMappingId;

    private final DoorAccessControlConfigTarget target;

    private final DoorAccessControlConfigSetting setting;

    public static DoorAccessControlConfigMappingDetailsSaveSO of(
      @Positive long doorAccessControlMappingId,
      @Positive long userId,
      @Positive long doorAccessControlId,
      DoorAccessControlConfigSetting setting
    ) {
        return of(doorAccessControlMappingId, DoorAccessControlConfigTarget.of(userId, doorAccessControlId), setting);
    }
}
