Files
SalesPipeline/backend/test_mapping.py
2026-01-27 19:08:46 +08:00

25 lines
836 B
Python

import sys
import os
import pandas as pd
from pathlib import Path
# Add the current directory and its parent to the path
current_dir = Path.cwd()
sys.path.append(str(current_dir))
from app.services.excel_parser import excel_parser
def test_mapping():
# Case 1: Sample mapping
df_sample = pd.DataFrame(columns=['Item', 'Type', '索樣數量PCS', '日期'])
mapping_sample = excel_parser.map_columns(df_sample, 'sample')
print(f"Sample Mapping: {mapping_sample}")
# Case 2: Order mapping
df_order = pd.DataFrame(columns=['客戶', '客戶代號', '訂單號碼', '內部料號', '訂單日期', '訂單需求量', '台幣金額', '明細行狀態'])
mapping_order = excel_parser.map_columns(df_order, 'order')
print(f"Order Mapping: {mapping_order}")
if __name__ == "__main__":
test_mapping()