4.3 KiB
Field Contracts
XML structure
Root: /RES_DETAIL
Reservation sequence:
/RES_DETAIL/LIST_G_GROUP_BY1/G_GROUP_BY1/LIST_G_RESERVATION/G_RESERVATION
| Reservation source | Daily field |
|---|---|
ADULTS |
ADULTS |
BLOCK_CODE |
BLOCK_CODE |
CF_CHILDREN |
CHILDREN |
COMPANY_NAME |
COMPANY_NAME |
CONFIRMATION_NO |
CONFIRMATION_NO |
DISP_ROOM_NO |
DISP_ROOM_NO |
EFFECTIVE_RATE_AMOUNT |
EFFECTIVE_RATE_AMOUNT |
FULL_NAME |
FULL_NAME |
LIST_G_COMMENT_RESV_NAME_ID/G_COMMENT_RESV_NAME_ID/RES_COMMENT |
RES_COMMENT |
LIST_G_DEPT_ID/G_DEPT_ID/TRACE_TEXT |
TRACE_TEXT |
NO_OF_ROOMS |
NO_OF_ROOMS |
PRODUCTS |
PRODUCTS |
RATE_CODE |
RATE_CODE |
ROOM_CATEGORY_LABEL |
ROOM_CATEGORY_LABEL |
TRUNC_BEGIN |
ARRIVAL |
TRUNC_END |
DEPARTURE |
| computed | NIGHTS |
| approved zero-price exception or price reference | REAL PRICE |
computed REAL PRICE * NO_OF_ROOMS * NIGHTS |
TOTAL PRICE |
The group business-date candidates are GROUPBY1_SORT_COL (YYYYMMDD) and GROUPBY1_COL (DD-MM-YY). Every retained reservation TRUNC_BEGIN must equal that business date.
For direct XML processing, source_sequence is the one-based G_RESERVATION order and source_location is reservation[N]. Because XML is not an Excel source, source_worksheet and source_row_no are both null. The deterministic channel destination is stored separately as channel_key, including in daily mode where no monthly workbook is created.
The structured Group Code comes only from the selected RES_COMMENT:
group_code_key = upper(trim(RES_COMMENT))
When the trimmed comment is empty, group_code_key is null and booking_source_match_status is missing_group_code. Never substitute BLOCK_CODE or another XML value.
Daily XLSX exact columns
BLOCK_CODEADULTSCHILDRENCOMPANY_NAMECONFIRMATION_NODISP_ROOM_NOEFFECTIVE_RATE_AMOUNTFULL_NAMERES_COMMENTTRACE_TEXTNO_OF_ROOMSPRODUCTSRATE_CODEROOM_CATEGORY_LABELARRIVALDEPARTURENIGHTSREAL PRICETOTAL PRICE
Monthly channel XLSX exact columns
Every ordinary monthly worksheet has exactly 19 columns:
ARRIVALDEPARTURENIGHTSADULTSCHILDRENBLOCK_CODENO_OF_ROOMSCOMPANY_NAMECONFIRMATION_NODISP_ROOM_NORATE_AMOUNTFULL_NAMERES_COMMENTTRACE_TEXTPRODUCTSRATE_CODEROOM_CATEGORY_LABELREAL PRICETOTAL PRICE
The fixed DY-AI-Easy-KB worksheet has exactly the same first 19 columns plus:
KB(100/晚/间)
Map daily EFFECTIVE_RATE_AMOUNT to monthly RATE_AMOUNT. Map all other monthly fields, including REAL PRICE and TOTAL PRICE, by field name rather than by the daily column index. In both reports, enforce TOTAL PRICE = REAL PRICE * NO_OF_ROOMS * NIGHTS. On DY-AI-Easy-KB, compute KB(100/晚/间) = NO_OF_ROOMS * 100; do not multiply KB by NIGHTS and do not add it to TOTAL PRICE. Store all derived values as static numbers, including numeric zeros produced by the approved company-plus-rate-code exception.
The Finance payload uses the same named values without reopening either workbook:
EFFECTIVE_RATE_AMOUNT/ monthlyRATE_AMOUNT→effective_rate_amountROOM_CATEGORY_LABEL→room_category_labelREAL PRICE→real_priceTOTAL PRICE→total_priceKB(100/晚/间)→kb_amount- destination worksheet →
channel_key
Required retained-reservation values
RATE_CODE, COMPANY_NAME, CONFIRMATION_NO, DISP_ROOM_NO, EFFECTIVE_RATE_AMOUNT, FULL_NAME, ADULTS, CF_CHILDREN, NO_OF_ROOMS, ARRIVAL, and DEPARTURE must be present and valid after whitelist filtering. Adults and children must be non-negative, room count must be positive, the effective rate amount must be non-negative, and departure must not be earlier than arrival. Same-day arrival and departure is valid and produces NIGHTS = 0. BLOCK_CODE, PRODUCTS, ROOM_CATEGORY_LABEL, RES_COMMENT, and TRACE_TEXT may be blank.
The complete Finance JSON field list and nullability rules are authoritative in structured-result.schema.json; database-adapter semantics are in structured-output.md.