//
//  ScenicSettlementAPI.swift
//  suixinkan
//
//  Created by Codex on 2026/6/25.
//

import Foundation
import Combine

/// 景区结算服务协议，定义结算申请提交能力。
@MainActor
protocol ScenicSettlementServing {
    /// 提交单个景区的结算申请。
    func scenicSettlementSubmit(_ request: ScenicSettlementSubmitRequest) async throws
}

@MainActor
/// 景区结算 API，封装结算申请提交网络请求。
final class ScenicSettlementAPI {
    private let client: APIClient

    /// 初始化景区结算 API，并注入共享网络客户端。
    init(client: APIClient) {
        self.client = client
    }

    /// 提交单个景区的结算申请。
    func scenicSettlementSubmit(_ request: ScenicSettlementSubmitRequest) async throws {
        let _: EmptyPayload = try await client.send(
            APIRequest(
                method: .post,
                path: "/api/yf-handset-app/photog/scenic-settlement/submit",
                body: request
            )
        )
    }
}

extension ScenicSettlementAPI: ScenicSettlementServing {}
