-
Notifications
You must be signed in to change notification settings - Fork 16
Record array fixes #1205
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
Record array fixes #1205
Conversation
WalkthroughIntroduces an internal schema type $RecordArrayPair as a record of string keys to $RecordArrayFieldValue and updates $InstrumentMeasureValue to be an array of $RecordArrayPair instead of an array of $RecordArrayFieldValue in packages/schemas/src/instrument/instrument.base.ts. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/api/src/instrument-records/instrument-records.service.ts(1 hunks)packages/schemas/src/instrument/instrument.base.ts(1 hunks)
🔇 Additional comments (2)
packages/schemas/src/instrument/instrument.base.ts (1)
95-98: Schema change correctly implements record-of-primitives structure.The conversion from a primitive union to
z.record(z.string(), z.union([...]))aligns with the PR objective to makeRecordArrayValuea record type with keys and primitive-typed values. This now properly represents array elements as objects rather than scalars.apps/api/src/instrument-records/instrument-records.service.ts (1)
433-441: Field iteration logic is correct.The iteration over
objectEntryfields and direct use ofdataValueformeasureValuealigns with the PR objective to parse the record and use raw field values.Verify this works as intended after fixing the control flow issue flagged above.
Works on some expand array data fixes
turns the RecordArrayValue into a record type with a key and primitive typed data values
changed expandData to parse the record instead of each value within it
adjusted error msg
Summary by CodeRabbit
Refactor
Chores