-
Notifications
You must be signed in to change notification settings - Fork 91
chore(data-format): rnf invoice allow negative line items #1618
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
Conversation
WalkthroughThe JSON schema for the RNF invoice format was updated to change the validation pattern for the "unitPrice" field within invoice items. The pattern now allows both positive and negative integer strings, whereas previously only non-negative integers were permitted. No other fields or validation rules were modified in this update. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SchemaValidator
participant InvoiceJSON
User->>SchemaValidator: Submit InvoiceJSON with invoiceItems[].unitPrice
SchemaValidator->>InvoiceJSON: Validate unitPrice against pattern "^-?\d+$"
alt Pattern matches (positive or negative integer)
SchemaValidator-->>User: Validation succeeds
else Pattern does not match
SchemaValidator-->>User: Validation fails
end
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (2)
packages/data-format/src/format/rnf_invoice/rnf_invoice-0.0.3.json (2)
17-19: Consider bumping the schema version for this non-breaking enhancement.
Although relaxing the pattern is backward-compatible, we’ve introduced new functionality. To follow semver and data-format conventions, please increment the schema version (e.g., to0.0.4), update the"version"const, and rename the file accordingly (rnf_invoice-0.0.4.json).
1-7: Add a changelog entry for negativeunitPrice.
To aid maintainers and users, please document this update in the project’s CHANGELOG or release notes under the new version.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/data-format/src/format/rnf_invoice/rnf_invoice-0.0.3.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build-and-test
🔇 Additional comments (1)
packages/data-format/src/format/rnf_invoice/rnf_invoice-0.0.3.json (1)
126-128: Allow negative unit prices: pattern updated correctly.
The new regular expression"^-?\\d+$"properly permits an optional leading minus sign, enabling negative integer strings forunitPrice. This aligns precisely with the PR objective to support negative line items.
MantisClone
left a 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.
Does this warrant rnf_invoice 0.0.4?
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.
LGTM, but I'll let the RN team approve this.
@MantisClone I'd say there is no need for another format version, as the change is backward compatible. We've already made similar edits in the past, e.g. #852
Same answer as @alexandre-abrioux. No need to add a new format as there is backward compatiblity |
Description of the changes
Update the latest
rnf_invoicedata-format.It now accepts negative line items.
Summary by CodeRabbit