package com.erp.supplier.service;

import com.erp.supplier.dto.request.*;
import com.erp.supplier.dto.response.*;
import com.erp.supplier.entity.Supplier;
import java.util.List;
import com.erp.common.core.model.PageResponse;

public interface SupplierService {

    // ============ 供应商基础管理 ============

    PageResponse<SupplierResponse> listSuppliers(SupplierQueryRequest request);

    SupplierResponse getSupplier(Long id);

    SupplierResponse createSupplier(SupplierCreateRequest request, OperatorInfo operator);

    SupplierResponse updateSupplier(Long id, SupplierUpdateRequest request, OperatorInfo operator);

    void deleteSupplier(Long id, OperatorInfo operator);

    SupplierResponse auditSupplier(Long id, SupplierAuditRequest request, OperatorInfo operator);

    // ============ 供应商联系人管理 ============

    List<SupplierContactResponse> listContacts(Long supplierId);

    SupplierContactResponse createContact(Long supplierId, SupplierContactCreateRequest request, OperatorInfo operator);

    SupplierContactResponse updateContact(Long supplierId, Long contactId, SupplierContactUpdateRequest request, OperatorInfo operator);

    void deleteContact(Long supplierId, Long contactId, OperatorInfo operator);

    // ============ 供应商银行账户管理 ============

    List<SupplierBankAccountResponse> listBankAccounts(Long supplierId);

    SupplierBankAccountResponse createBankAccount(Long supplierId, SupplierBankAccountCreateRequest request, OperatorInfo operator);

    SupplierBankAccountResponse updateBankAccount(Long supplierId, Long accountId, SupplierBankAccountUpdateRequest request, OperatorInfo operator);

    void deleteBankAccount(Long supplierId, Long accountId, OperatorInfo operator);

    void setDefaultBankAccount(Long supplierId, Long accountId, OperatorInfo operator);

    // ============ 供应商评级管理 ============

    PageResponse<SupplierRatingResponse> listRatings(SupplierRatingQueryRequest request);

    SupplierRatingResponse getSupplierRating(Long id);

    SupplierRatingResponse createRating(SupplierRatingCreateRequest request, OperatorInfo operator);

    SupplierRatingResponse getLatestRatingBySupplierId(Long supplierId);

    // ============ 采购询价管理 ============

    PageResponse<ProcurementInquiryResponse> listInquiries(ProcurementInquiryQueryRequest request);

    ProcurementInquiryResponse getInquiry(Long id);

    ProcurementInquiryResponse createInquiry(ProcurementInquiryCreateRequest request, OperatorInfo operator);

    ProcurementInquiryResponse updateInquiry(Long id, ProcurementInquiryUpdateRequest request, OperatorInfo operator);

    ProcurementInquiryResponse sendInquiry(Long id, OperatorInfo operator);

    ProcurementInquiryResponse replyInquiry(Long id, java.math.BigDecimal quotedPrice, String quoteValidUntil, Integer deliveryCycle, OperatorInfo operator);

    ProcurementInquiryResponse confirmInquiry(Long id, String selectionReason, OperatorInfo operator);

    ProcurementInquiryResponse cancelInquiry(Long id, OperatorInfo operator);

    // ============ 统计分析 ============

    SupplierStatisticsResponse getStatistics();

    // ============ 辅助类 ============

    @lombok.Data
    @lombok.Builder
    class OperatorInfo {
        private Long operatorId;
        private String operatorName;
        private String ip;
        private String userAgent;
    }

    @lombok.Data
    @lombok.Builder
    class StatusOption {
        private String value;
        private String label;
    }
}
