package com.sdtool.common.api.mall;

import com.sdtool.common.api.ScriptService;
import com.sdtool.common.entity.base.ProcessIdItem;
import com.sdtool.common.entity.base.ProcessStringItem;
import com.sdtool.common.entity.design.*;
import com.sdtool.common.entity.site.ERPTokenUser;
import com.sweetfish.service.RetResult;
import com.sweetfish.source.PageFlipper;
import org.rex.RMap;

import java.util.List;

public interface DesignService extends ScriptService {
    //region 字体
    RetResult<List<DesignFont>> getDesignFonts(RMap params, String dataSourceId, long supplierCode);

    RetResult<DesignFont> addDesignFont(DesignFont designFont, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignFont> voidDesignFont(DesignFont font, String dataSourceId, long supplierCode, ERPTokenUser currentUser);
    //endregion

    //region 模板
    RetResult<List<DesignTemplate>> queryDesignTemplates(RMap params, PageFlipper pageFlipper, String dataSourceId, long supplierCode);

    RetResult<DesignTemplate> getDesignTemplateEdit(long id, String dataSourceId, long supplierCode);

    RetResult<DesignTemplate> getDesignTemplateEdit(long id, RMap params, String dataSourceId, long supplierCode);

    //给前端客户设计传入参数并提供预览时使用,需要传入外部网站当前的session,用于唯一确认临时模板信息
    RetResult<DesignTemplate> getDesignTemplateEdit(long id, RMap params, String outerSessionId, String dataSourceId, long supplierCode);

    RetResult<DesignTemplate> getDesignTemplateImposition(long id, String dataSourceId, long supplierCode);

    RetResult<DesignTemplate> updateDesignTemplate(DesignTemplate template, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTemplate> updateDesignTemplateThumb(DesignTemplate template, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTemplate> voidDesignTemplate(DesignTemplate template, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    //暂存用户设计
    RetResult<DesignTemplate> tmpSaveUserDesign(DesignTemplate tmpTemplate, String dataSourceId, long supplierCode);
    //endregion

    //region 项目转跳需要
    RetResult<ProcessIdItem> saveCurrentUserTokenInfo(String virtualCode, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<ProcessStringItem> getCurrentUserTokenInfo(String virtualCode);
    //endregion

    //region 设计订单
    RetResult<List<DesignOrder>> queryDesignOrders(RMap params, PageFlipper pageFlipper, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignOrder> getDesignOrderEdit(long id, String dataSourceId, long supplierCode);

    RetResult<DesignOrder> getDesignOrderImposition(long id, String dataSourceId, long supplierCode);

    RetResult<DesignOrder> newDesignOrder(String outerSessionId, String svgContent, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignOrder> newDesignOrder(DesignTemplate customerDesign, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignOrder> updateDesignOrder(DesignOrder designOrder, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignOrder> downloadDesignPDF(String outerSessionId, String dataSourceId, long supplierCode);
    //endregion

    //region 模板标签档案
    //一开始先做扁平化的把,没必要type还有父级结构
    RetResult<List<DesignTagType>> queryDesignTagTypeFlatten(RMap params, String dataSourceId, long supplierCode, PageFlipper pageFlipper);


    RetResult<List<DesignTagType>> queryDesignTagType( String dataSourceId, long supplierCode);

    RetResult<DesignTagType> getDesignTagType(long idTagType, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTagType> newDesignTagType(DesignTagType tagType, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTagType> deleteDesignTagType(long id, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTagType> deleteDesignTagTypeFlatten(long id, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTagType> updateDesignTagType(DesignTagType tagType, String dataSourceId, long supplierCode, ERPTokenUser currentUser);


    RetResult<List<DesignTag>> queryDesignTags(RMap params, String dataSourceId, long supplierCode, PageFlipper pageFlipper);

    RetResult<DesignTag> newDesignTag(DesignTag designTag, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<List<DesignTag>> changeTagType(List<DesignTag> tagList, String dataSourceId, long supplierCode, ERPTokenUser currentUser);

    RetResult<DesignTag> deleteDesignTag(long id, String dataSourceId, long supplierCode, ERPTokenUser currentUser);
    //endregion

    //region 模板标签
    RetResult<List<TemplateTag>> getTemplateTags(long idTemplate, String dataSourceId, long supplierCode);

    RetResult<List<TemplateTag>> modifyTemplateTags(long idTemplate, List<DesignTag> tags, String dataSourceId, long supplierCode, ERPTokenUser currentUser);
    //endregion

}
