Skip to content

fix: Comprehensive field compatibility fixes #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maksimu
Copy link
Collaborator

@maksimu maksimu commented Jul 3, 2025

Field Type Definition Updates:

  • Update field-types.json with missing elements for complex fields
  • Fix phone field: add elements [region, number, ext, type]
  • Fix name field: change elements from [firstName, lastName, fullName] to [first, middle, last]
  • Fix bankAccount field: add missing otherType element
  • Fix privateKey field: add elements [publicKey, privateKey]
  • Fix schedule field: add elements [type, time, month]
  • Add missing appFiller field type with elements [applicationTitle, contentFilter, macroSequence]
  • Add missing pamResources field type with elements [controllerUid, folderUid, resourceRef]
  • Update complex field processing logic to handle new field definitions

Field Value Formatting Fixes:

  • Add automatic field validation and formatting in processFieldsForSDK()
  • Fix date fields: auto-convert Unix seconds to milliseconds
  • Fix card numbers: remove dashes, spaces, and dots from card numbers
  • Fix expiration dates: convert MM/YY to MM/YYYY format with smart year detection
  • Provide user warnings when field values are automatically reformatted

Testing & Infrastructure:

  • Add GetFieldType() helper function for testing field type definitions
  • Add comprehensive field loading tests in loader_test.go
  • Add field processing tests for new complex field types (appFiller, schedule)
  • Add field formatting tests with 25+ test cases covering edge cases
  • Add field reconstruction tests for complex field processing pipeline

Resolves issues with:

  • Field type mismatches between MCP and Commander
  • Date fields sending Unix timestamps in wrong format
  • Card numbers being created with dashes causing display issues
  • Expiration dates using MM/YY when Vault expects MM/YYYY
  • Missing field type definitions causing processing failures

@maksimu maksimu force-pushed the fix/field-formatting-issues branch from 0be0f92 to 322b5cf Compare July 3, 2025 20:58
@maksimu maksimu changed the title fix: Add automatic field value formatting for API compatibility fix: Comprehensive field compatibility fixes Jul 3, 2025
Copy link

@miroberts miroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Field Type Definition Updates:
- Update field-types.json with missing elements for complex fields
- Fix phone field: add elements [region, number, ext, type]
- Fix name field: change elements from [firstName, lastName, fullName] to [first, middle, last]
- Fix bankAccount field: add missing otherType element
- Fix privateKey field: add elements [publicKey, privateKey]
- Fix schedule field: add elements [type, time, month]
- Add missing appFiller field type with elements [applicationTitle, contentFilter, macroSequence]
- Add missing pamResources field type with elements [controllerUid, folderUid, resourceRef]
- Update complex field processing logic to handle new field definitions

Field Value Formatting Fixes:
- Add automatic field validation and formatting in processFieldsForSDK()
- Fix date fields: auto-convert Unix seconds to milliseconds
- Fix card numbers: remove dashes, spaces, and dots from card numbers
- Fix expiration dates: convert MM/YY to MM/YYYY format with smart year detection
- Provide user warnings when field values are automatically reformatted

Testing & Infrastructure:
- Add GetFieldType() helper function for testing field type definitions
- Add comprehensive field loading tests in loader_test.go
- Add field processing tests for new complex field types (appFiller, schedule)
- Add field formatting tests with 25+ test cases covering edge cases
- Add field reconstruction tests for complex field processing pipeline

Resolves issues with:
- Field type mismatches between MCP and Commander API expectations
- Date fields sending Unix timestamps in wrong format
- Card numbers being created with dashes causing display issues
- Expiration dates using MM/YY when Vault expects MM/YYYY
- Missing field type definitions causing processing failures

All changes ensure full compatibility with Commander API field requirements
and provide comprehensive test coverage for field processing pipeline.
@maksimu maksimu force-pushed the fix/field-formatting-issues branch from 322b5cf to d793502 Compare July 3, 2025 21:29
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.

2 participants