Exclude PM room types from shared daily report processing

This commit is contained in:
Wyndham ARR committed 2026-10-08 22:30:04 +08:00
1 parent d3902dd857
commit f46efd6d9a
32 files changed
+968 -69

No files matched your search

@@ -12,7 +12,7 @@
## Scope
- 修复生产 OHIP 查询、环境内任务恢复及接口字段人工完善;保留 XML、原费率筛选、定价、日报/月报规则,并落实用户确认的取消预订排除规则。
- 修复生产 OHIP 查询、环境内任务恢复及接口字段人工完善;保留 XML、原费率筛选、定价、日报/月报规则,并落实用户确认的取消预订及 PM 房型排除规则。
## Intent And Constraints
@@ -255,3 +255,18 @@ Read: memory-index, project-positioning, current-state latest September sections
- User asks how PM was identified and what characteristics support it. Same-task ownership/feature/codex/base2417b1a/owned checkout/no peers and retained Project Context Loaded verified; Planning gate Passed for read-only source-evidence inspection. No new source request, report/rule change or hotel configuration assumption is authorized by this question.
- Reopened the saved original search/detail responses for all10 API0 price-unmatched rows. In every row search.roomStay.roomType, detail.roomStay.currentRoomInfo.roomType and detail.roomStay.roomRates[the9/16day].roomType explicitly equal PM. This is the same3-way agreement used by source_fields.agreed_room_type, not an inference from room-number prefix, zero amount or roomTypeCharged. Two examples: confirmation300638606/room9002 and300638238/room9004, all3 PM fields agree; both also have amount0 and adults0/children0. These latter features are auxiliary, never a standalone pseudo-room rule.
- Broader source count23 PM records (19 CheckedOut,4 Cancelled) should not be confused with the10 actionable unmatched PM records discussed here. Nothing establishes that PM is the only pseudo code in this hotel, or that every9xxx room/0-price reservation is pseudo. The official Oracle default-PM meaning remains supported by the links above, while actual report eligibility still requires the original report criterion. No code/data/price edits, Oracle calls, test suite, service action or actual generation occurred. Explain explicit roomType evidence separately from the not-yet-settled decision to exclude it from the report.
## Same-task Follow-up: User-approved PM Exclusion
- User explicitly confirms PM must not be included and requests updating processing rules. This resolves the PM inclusion-policy question above; exclusion is now authorized for both XML and OHIP input, before required-field checks/deduplication/pricing. Only exact trimmed/case-insensitive ROOM_CATEGORY_LABEL=PM is approved; do not infer from0 price,9xxx rooms, absent type, roomTypeCharged or other pseudo codes. Cancellation remains the first mutually exclusive exclusion. Original source records and prior staff decisions remain auditable.
- Concurrent task gate Passed: same20261008-production-review-9e7b feature/codex/owned checkout/codex/arr-production-review/base2417b1a, no peers; primary unknown docs untouched. Project Context Loaded: retained required memory-index/positioning/current-state/decision-index/ADR004,006,007/architecture/domain/evidence/reflection/commitments/stale context plus active task record/read-before-planning/planning-gate. New user authorization supersedes only the prior undecided-PM boundary. Relevant modules: shared processor/independent validator/schema, Finance validation/SQL contracts, upstream field review, local versioned runtime. Planning gate Passed.
- Plan: add explicit excluded_pm audit outcome and processing identity4.4.0 across shared XML/data rules and independent checks; extend ingestion/Finance schema and counts without altering prior published versions; prevent PM source-field prompts; regression-check both input paths, exclusions before validation/dedup/pricing, zero-priced physical-room retention and legacy contracts. Replay9/16 immutable capture offline, then safely activate the local rule and supersede its obsolete price-review job while retaining any decisions on still-relevant keys. Do not refetch Oracle, fabricate prices, overwrite completed real reports or silently reprocess published10/7. Required local maintenance will be rehearsed/backup/revision-checked; record material preservation limitations before any unsafe change.
- Implementation outcome: active processor4.4.0 shares the same explicit `is_pm_record` rule for XML and direct OHIP data. Existing text normalization runs before trimmed/case-insensitive PM comparison. Cancellation wins; PM then precedes rate/required fields/deduplication/pricing, and `excluded_pm` / `ROOM_TYPE_PM_EXCLUDED` retains every original/audit record with null price/channel facts. No price lookup, whitelist, normal zero-price or formula rule changed. Source review now uses the same normalized records for issues/counts/edit guards; prior PM decisions remain in immutable audit, with a manually completed room-type value still correctable before finalization. Chinese/English/Thai exclusion counts are visible. Package archives match their source.
- Finance outcome: added migration021 and explicit startup checks for both input paths; new independent PM count reconciles source rows and validates the excluded record shape.4.4 requires all8 outcome counters;4.3/4.2/retired v3 replay retain their old contracts. Upgrade leaves historical versions/records intact with the new count defaulting to0; rollback refuses committed PM-exclusion facts, existing mutation guards and role access remain.
- Verification: processor PM8 + cancellation9 distinct cases passed; ingestion/Finance61 distinct tests passed with disposable local PostgreSQL (no skips), including4.3→021 historical row preservation, both input paths, daily/monthly results, rejected-batch audit, idempotent retry, rollback and role checks. Root source-review/cancellation/executor run passed41 tests with1 PG class skipped before opt-in; the subsequently opted-in DirectFieldReviewPostgresTests and all6 final PM review cases passed7/7. Root package/runtime run passed28/28, JavaScript review passed34/34. Independent review identified differing emoji normalization in review counters/edit guard, fixed by sharing processor normalization and covered by a new PM😀 case; manual room-type correction is also covered. Preliminary runner name mistakes were corrected and are not represented as case failures or as passing tests. Git whitespace, node syntax, documentation structure and task ownership checks passed.
- Offline real9/16 replay: unchanged209-row OHIP source yields6 excluded cancellations,19 excluded PM,34 excluded rates,115 priced candidates and35 price-unmatched records in exactly1 key LIAN TAI/WHO2/1000. The unchanged184-row original XML yields0 cancellations/PM,34 rate exclusions and the same115+35 candidates/one key. This is evidence for this date after the explicit new PM policy, not a claim that the separately deferred universal API/XML population question is solved. No actual price or source value was invented, and no Oracle call occurred.
- Safe local activation: verified no active acquisition/processing queue, gracefully stopped the existing8875 service, cold-backed up the entire119MB private instance to `policy44-service-backup-20261008-142628`, then ran the privately rehearsed explicit upgrade. Schema021, instance hash, launcher and unfinished9/17 identity/receipt were advanced.9/17 remains editing revision4 with0 pending fields,18 cancellations and11 PM exclusions; no staff finalization occurred. Replayed9/16 from its original checkpoint using a source whose fetch method raises if called, creating a new immutable4.4 job/request; superseded/cancelled its old5-key review through the normal revision-checked cancellation method and preserved its1 user-saved0 decision in the old case/audit. No matching still-required price was saved, so the new1-key review remains open0/1.
- Local preservation evidence: existing Finance snapshot before/after matches exactly (1 prior version and58 audit records, comparing all old columns); newly added excluded_pm_rows remains0 for that historical version. Verified25 original handoff/review files unchanged. This includes preservation of completed10/7 rather than automatic reprocessing. New9/16 request `d89e8c15f9c94bd1a63411fa88e935d7`, job `arrbatch-517912e100e4f0dd6afecf1410b3e028f31eeecd85a0d26d`; old job remains separately auditable/cancelled. Service restarted with all local health flags ready. No production hotel writes, remote deployment/push or primary-checkout integration occurred.
- Product verification: authenticated API and CUA confirm9/16 one pending price key, Oracle amount1000,35 records/35 rooms/35 nights, blank processed price, disabled final generation; original XML upload remains present. Browser result tab retained as deliverable, screenshot `production-validation-20261007/pm-excluded-sept16-price-review-20261008.png`. Cold backup, raw replay, policy intent/completed receipt and upgrade script remain private outside Git. Actual9/16 daily/monthly generation awaits the user's price decision;0 remains accepted when explicitly confirmed.
- Promotion/follow-up: integration owner should promote the approved cancellation→PM→rate→validation→dedup→pricing order and schema021 deployment requirement. Retain the distinction between19 PM scope exclusions and10 removed unmatched PM reservations/4 removed price keys. User can now fill the sole LIAN TAI/WHO2/1000 processed-price key, save and confirm generation through the existing daily/monthly flow. Do not transfer the old PM0 value onto this different key or silently reprocess prior published reports.