package com.saas.shared.dto.mapper;

import com.saas.admin.dto.response.PermissionResponse;
import com.saas.admin.entity.Permission;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2025-10-22T21:40:37+0100",
    comments = "version: 1.6.3, compiler: javac, environment: Java 25 (Homebrew)"
)
@Component
public class PermissionMapperImpl implements PermissionMapper {

    @Override
    public PermissionResponse toResponse(Permission permission) {
        if ( permission == null ) {
            return null;
        }

        PermissionResponse.PermissionResponseBuilder permissionResponse = PermissionResponse.builder();

        permissionResponse.id( permission.getId() );
        permissionResponse.resource( permission.getResource() );
        permissionResponse.action( permission.getAction() );
        permissionResponse.description( permission.getDescription() );
        permissionResponse.isActive( permission.getIsActive() );
        permissionResponse.isSystem( permission.getIsSystem() );
        permissionResponse.createdAt( permission.getCreatedAt() );

        permissionResponse.permissionString( permission.getPermissionString() );

        return permissionResponse.build();
    }

    @Override
    public List<PermissionResponse> toResponseList(List<Permission> permissions) {
        if ( permissions == null ) {
            return null;
        }

        List<PermissionResponse> list = new ArrayList<PermissionResponse>( permissions.size() );
        for ( Permission permission : permissions ) {
            list.add( toResponse( permission ) );
        }

        return list;
    }
}
