package com.iqser.red.service.persistence.v1.internal.api.controller;

import static com.knecon.fforesight.databasetenantcommons.providers.utils.MagicConverter.convert;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.iqser.red.service.persistence.management.v1.processor.service.WatermarkService;
import com.iqser.red.service.persistence.service.v1.api.internal.resources.WatermarkResource;
import com.iqser.red.service.persistence.service.v1.api.shared.model.WatermarkModel;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
public class WatermarkInternalController implements WatermarkResource {

    private final WatermarkService watermarkService;


    public WatermarkModel getWatermark(@PathVariable(WATERMARK_ID_PARAMETER_NAME) long watermarkId) {

        return convert(watermarkService.getWatermark(watermarkId), WatermarkModel.class);
    }

}
