feat: 백제약품 잔고 API 엔드포인트 추가
GET /api/baekje/balance - 잔고액 조회
This commit is contained in:
parent
ddba17ae08
commit
241e65aaf1
@ -233,3 +233,30 @@ def api_search_for_order():
|
|||||||
result['count'] = len(filtered)
|
result['count'] = len(filtered)
|
||||||
|
|
||||||
return jsonify(result)
|
return jsonify(result)
|
||||||
|
|
||||||
|
|
||||||
|
# ========== 잔고 조회 ==========
|
||||||
|
|
||||||
|
@baekje_bp.route('/balance', methods=['GET'])
|
||||||
|
def api_get_balance():
|
||||||
|
"""
|
||||||
|
잔고액 조회
|
||||||
|
|
||||||
|
GET /api/baekje/balance
|
||||||
|
GET /api/baekje/balance?year=2026
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"balance": 14193234,
|
||||||
|
"monthly": [
|
||||||
|
{"month": "2026-03", "sales": 6935133, "balance": 14193234, ...},
|
||||||
|
{"month": "2026-02", "sales": 18600692, "balance": 7258101, ...}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
year = flask_request.args.get('year', '').strip()
|
||||||
|
|
||||||
|
session = get_baekje_session()
|
||||||
|
result = session.get_balance(year if year else None)
|
||||||
|
return jsonify(result)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user