/*
 * ST_FUNDING.h - st 서비스 ST_FUNDING 카피북 (copybook / record header).
 * 가맹점 펀딩 항등식: 총매출 − 환불 − 채그백 − 수수료 − 리저브 = 입금.
 * gross(S)/refunds(C)/chargebacks(ac_dispute LOST)/fees(st_fee_component)/reserve(st_reserve)
 * 조회 후 deposit 산출 → st_merchant_funding UPSERT.
 */
#ifndef ST_FUNDING_H
#define ST_FUNDING_H

#include "st_svc.h"

typedef struct {
    char merchant_id[64];
    char biz_date[16];
    long gross_sales;
    long refunds;
    long chargebacks;
    long fees;      /* MDR 합계 */
    long reserve;
    long deposit;   /* 실제 입금액 */
    char funding_model[16];
} st_st_funding_rec_t;

void ST_FUNDING(TPSVCINFO *p);

#endif /* ST_FUNDING_H */
