/*
 * LIMIT_SET.pgc - au 모듈 서비스 LIMIT_SET (one service = one file).
 * 카드 한도 설정/등록 (dbio upsert).
 * Moved verbatim from the former inline au_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by au_svr at tpsvrinit.
 */
#include "LIMIT_SET.h"

void LIMIT_SET(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char card[24];
    long lim = getl(b, T_AMT1);
    gets_(b, T_KEY1, card, sizeof(card));
    if (lim <= 0) lim = 1000000;
    if (audb_limit_set(card, lim) < 0) FAIL(b);
    OK(b);
}
