Skip to content

docs(SOSO-440): write conversion policy concept#18

Merged
wagnert merged 6 commits intodevelopfrom
feature/write-conversion-policy
Mar 12, 2026
Merged

docs(SOSO-440): write conversion policy concept#18
wagnert merged 6 commits intodevelopfrom
feature/write-conversion-policy

Conversation

@wagnert
Copy link
Member

@wagnert wagnert commented Mar 12, 2026

Summary

  • Concept document for WriteConversionPolicyInterface — optional locale-aware date formatting on write operations
  • Strategy Pattern design (analogous to UnknownFieldPolicyInterface)
  • Phase 1: Date/DateTime/ChangeTimestamp conversion (ISO → locale format)
  • Phase 2: extensible architecture for Percent/Price/Decimal (requires API research)

Key Design Decisions

  1. Strategy Pattern over boolean flag — consistent with existing architecture
  2. Conversion after validation — ensures only valid values are converted
  3. NoOp as default — no breaking change, explicit opt-in required
  4. Builds on SOSO-439 — reuses getLocaleDateFormat() for conversion logic

Concept Document

See docs/SOSO-440/FEATURE_CONCEPT.md for full specification including:

  • Interface design with code examples
  • Integration points (DynamicTable, DynamicTableFactory)
  • Complete test strategy
  • Phase 2 extensibility plan
  • Risk assessment

Refs: #17

wagnert added 6 commits March 12, 2026 10:38
Design concept for WriteConversionPolicyInterface (Strategy Pattern) that
optionally converts field values to locale-specific formats before sending
to AppSheet API.

Key decisions:
- Strategy Pattern analog to UnknownFieldPolicyInterface
- Conversion AFTER validation (ensures only valid values are converted)
- NoOp as default (no breaking change, explicit opt-in)
- Phase 1: Date/DateTime/ChangeTimestamp
- Phase 2: extensible for Percent/Price/Decimal (requires API research)

Refs: #17
- Version corrected from v3.4.0 to v3.3.0 (ships with SOSO-439)
- Added critical round-trip scenario documentation (find → update)
- Added round-trip test cases ensuring locale-formatted dates pass through unchanged

Refs: #17
… formatting

Add WriteConversionPolicyInterface (Strategy Pattern) with two implementations:
- NoOpWriteConversionPolicy (default, backward compatible)
- LocaleWriteConversionPolicy (converts ISO dates to locale format on write)

Conversion is applied AFTER validation, BEFORE sending to AppSheet API.
Only add() and update() apply conversion; delete() does not.

Includes 46 tests (31 unit + 15 integration), all 417 tests pass.

Refs: SOSO-440, #17
Adds concept document for adding --locale support to inspect and
add-table CLI commands, ensuring generated schemas include locale
for locale-aware validation (SOSO-439) and write conversion (SOSO-440).

Refs: #19
Replace manual --locale CLI flag with automatic locale detection
from AppSheet API response data. The SchemaInspector analyzes
date field values to determine separator and part order, then
maps to a representative locale (de-DE, en-US, en-GB, ja-JP).

Ambiguous cases (all date parts ≤ 12) default to en-US for '/'
and de-DE for '.' separators.

Refs: #19
@wagnert wagnert merged commit 4153e40 into develop Mar 12, 2026
4 checks passed
@wagnert wagnert deleted the feature/write-conversion-policy branch March 12, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant