chore: acquire-core migration monorepo (legacy C + Spring Boot target skeleton)
Some checks failed
ci / build (push) Failing after 2s

TxCore/ECPG legacy 매입·정산 C 슬라이스(빌드검증) + Spring Boot 멀티모듈 골격(mvn test green) + MIGRATION.md 전환룰 + CI(boot 빌드).
This commit is contained in:
forge-bot 2026-07-18 09:55:46 +00:00
commit ff0b0b60a2
31 changed files with 2208 additions and 0 deletions

View file

@ -0,0 +1,45 @@
/*
* acq_util.h - (//)
*/
#ifndef ACQ_UTIL_H
#define ACQ_UTIL_H
#include "msg_layout.h"
/* ---- util_date.c : 일자/영업일 ---- */
/* YYYYMMDD 형식 유효성 검사. 유효=1, 아니면 0 */
int date_is_valid(const char *yyyymmdd);
/* 요일 계산 (0=일 ... 6=토). 실패 시 -1 */
int date_weekday(const char *yyyymmdd);
/* 주말(토/일) 여부. 1=주말 */
int date_is_weekend(const char *yyyymmdd);
/* 다음 영업일(주말 건너뜀)을 out(YYYYMMDD, 최소 9바이트)에 기록. 0=성공 */
int date_next_business(const char *yyyymmdd, char *out);
/* 오늘 일자를 YYYYMMDD 로 out 에 기록 */
void date_today(char *out);
/* ---- util_amount.c : 금액/통화 ---- */
/* zero-pad 금액 문자열(len 폭)을 long 으로 파싱. 실패 시 <0 */
long amount_parse(const char *field, int len);
/* long 금액을 폭 len 의 zero-pad 문자열로 out 에 기록. 0=성공 */
int amount_format(long amount, char *out, int len);
/* 원화 콤마 포맷 (예: 12500 -> "12,500"). out 은 32바이트 권장 */
void amount_format_won(long amount, char *out, int outlen);
/* 금액 범위 검증 (1 이상, 한도 이하). 1=유효 */
int amount_is_valid(long amount);
/* ---- util_msg.c : 전문 pack/unpack ---- */
/* 고정폭 필드를 널종료 문자열 out 으로 복사(우측 공백 trim). */
void msg_field_copy(char *out, const char *field, int len);
/* 널종료 문자열 src 를 폭 len 필드에 좌측정렬/우측공백으로 기록 */
void msg_field_set(char *field, const char *src, int len);
/* 숫자 문자열 src 를 폭 len 필드에 zero-pad 로 기록 */
void msg_field_set_num(char *field, const char *src, int len);
/* 100바이트 raw 버퍼를 acq_msg_t 로 매핑(길이검증). 0=성공 */
int msg_unpack(acq_msg_t *msg, const char *raw, int rawlen);
/* acq_msg_t 를 raw(최소 MSG_ACQ_LEN) 로 직렬화. 0=성공 */
int msg_pack(const acq_msg_t *msg, char *raw, int rawlen);
/* 필수항목(전문구분/가맹점/카드/금액/일자) 존재 검증. 0=성공 */
int msg_validate(const acq_msg_t *msg);
#endif /* ACQ_UTIL_H */