/*
 * PAY_CONFIRM.pgc - py 모듈 서비스 PAY_CONFIRM (one service = one file).
 * 지급 확정(confirm): 지급 파일 상태를 확정(C)으로 전이하고 확정 시각 기록.
 * Moved verbatim from the former inline py_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by py_svr at tpsvrinit.
 */
#include "PAY_CONFIRM.h"

void PAY_CONFIRM(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    EXEC SQL BEGIN DECLARE SECTION;
    long h_file;
    EXEC SQL END DECLARE SECTION;
    h_file = getl(b, T_ID2);
    EXEC SQL UPDATE py_file SET status = 'C', confirmed_at = now() WHERE file_id = :h_file;
    if (sqlca.sqlcode < 0 || sqlca.sqlcode == 100) FAIL(b);
    OK(b);
}
