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

import com.yuchen.saas.park.api.commons.domain.BatchDoorAccessControl;
import com.yuchen.saas.park.api.commons.domain.DepartmentGroup;
import com.yuchen.saas.park.api.commons.domain.DoorAccessControlConfigSetting;
import com.yuchen.saas.park.api.commons.enums.DoorAccessControlConfigMappingType;
import com.yuchen.saas.park.service.service.domain.config.DoorAccessControlConfigMappingDetailsSaveSO;
import com.yuchen.saas.park.service.service.domain.config.DoorAccessControlConfigMappingSaveSO;
import com.yuchen.saas.park.service.service.domain.config.DoorAccessControlConfigTriggerSaveSO;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Positive;
import java.util.Set;

@SuppressWarnings("UnusedReturnValue")
public interface DoorAccessControlConfigMappingComponent {
    void deleteByTypeAndRefIds(DoorAccessControlConfigMappingType type, Set<@Positive Long> userRefIds, Set<@Positive Long> doorAccessControlRefIds, @Positive long timeConfigId);

    void deleteByDepartmentGroupAndRefIds(DoorAccessControlConfigMappingType type, Set<DepartmentGroup> groups, Set<@Positive Long> doorAccessControlRefIds, @Positive long timeConfigId);

    void deleteById(@Positive long id);

    void deleteByIds(Set<@Positive Long> ids);

    void batchBindByDepartment(@NotEmpty Set<DepartmentGroup> departmentGroups, BatchDoorAccessControl batchDoorAccessControl, DoorAccessControlConfigSetting setting);

    void batchBindByUserGroup(@NotEmpty Set<@Positive Long> userGroupIds, BatchDoorAccessControl batchDoorAccessControl, DoorAccessControlConfigSetting setting);

    void batchBindByUser(@NotEmpty Set<@Positive Long> userIds, BatchDoorAccessControl batchDoorAccessControl, DoorAccessControlConfigSetting setting);

    @Positive
    long saveMapping(DoorAccessControlConfigMappingSaveSO so);

    @Positive
    long saveDetails(DoorAccessControlConfigMappingDetailsSaveSO so);

    @Positive
    long saveTrigger(DoorAccessControlConfigTriggerSaveSO so);

    int queryUseNumByTemplateId(@Positive long templateId);
}
