Skip to content

Conversation

@Jlazofacto
Copy link
Contributor

@Jlazofacto Jlazofacto commented Aug 25, 2025

Summary by CodeRabbit

  • New Features

    • Added a new Peru credit note example for “boleta” documents and broadened Peru document examples with detailed headers, exports, and shipping sections.
  • Documentation

    • Updated the public Postman collection link/ID.
    • Renamed a Peru credit note example for clarity.
    • Standardized JSON formatting hints across requests.
  • Tests

    • Expanded Peru test coverage with additional country-specific payloads.
    • Adjusted Mexico’s invoice lifecycle request to preserve full request bodies during execution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

Walkthrough

Postman collection metadata was updated; numerous Peru-specific request entries were added and renamed, with payload adjustments and pe_* sections. Mexico gained a protocolProfileBehavior flag on one entry. Many requests now specify JSON body language options. All changes occur within the single Postman collection file.

Changes

Cohort / File(s) Summary
Collection metadata updates
koywe-billing.postman_collection.json
Updated _postman_id and _collection_link to a new collection identity.
Peru test entries
koywe-billing.postman_collection.json
Renamed Peru credit-note entry; changed receiver_country_id from 80 to 83; added new Peru credit note for boleta (document_type_id 155) with pe_header/pe_exports/pe_shipping; expanded Peru payloads across categories.
Mexico behavior tweaks
koywe-billing.postman_collection.json
Added protocolProfileBehavior: { disableBodyPruning: true } to the “Invoice issuance lifecycle” request.
Explicit JSON formatting
koywe-billing.postman_collection.json
Added options.raw.language = "json" to numerous POST request bodies for consistent JSON handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paw on parchment bright,
New IDs moon-hop into the night.
Peru now packs its pe_dreams true,
Mexico keeps bodies whole, too.
JSON whispers, neat and clean—
A rabbit signs: “Ship the green!” 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch RB-1006-peru-agregar-documentacion-temas-de-boleta-nominativa-para-extranjeros-y-para-consumidor-final-sin-datos-de-receptor

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
koywe-billing.postman_collection.json (1)

2540-2576: Critical fix: receiver_country_id must be Peru, not Mexico

In the Create new documents – Credit note (Nota de crédito emitida para boleta) request (koywe-billing.postman_collection.json, lines 2540–2576), the payload incorrectly uses Mexico’s country ID:

--- a/koywe-billing.postman_collection.json
+++ a/koywe-billing.postman_collection.json
@@ 2540,2576
-      "receiver_country_id": "80",
+      "receiver_country_id": "83",

• “80” corresponds to Mexico, but the receiver is in Peru (use “83”)
• Please also verify that document_type_id: "155" correctly maps to “Nota de crédito emitida para boleta” in both sandbox and production environments to prevent future mismatches.

🧹 Nitpick comments (2)
koywe-billing.postman_collection.json (2)

3-8: Collection ID/link changed — confirm downstream impact and update references

The _postman_id and _collection_link now point to a new collection. If you have monitors, CI steps, or shared documentation pointing to the previous public link, they’ll break. Please:

  • Update README/Confluence and any onboarding docs with the new share link.
  • Verify team/monitors still target the intended collection.

2540-2576: Optional: reduce copy-paste errors using variables

The new Peru examples repeat account_id, country codes, and tax IDs. Consider Postman variables (e.g., {{pe_country_id}} = 83) to prevent future mismatches like the ones above.

If useful, I can push a variant of this collection that parameterizes common Perú fields.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8eed158 and eaea7bd.

📒 Files selected for processing (1)
  • koywe-billing.postman_collection.json (3 hunks)
🔇 Additional comments (3)
koywe-billing.postman_collection.json (3)

2500-2500: Rename improves clarity

“Credit note (Nota de crédito emitida para factura)” is clearer than the prior generic label. Good change.


2517-2522: Good: explicit JSON language option

Explicit options.raw.language = "json" avoids Postman body editor misformatting. Keep this pattern.


2523-2535: Endpoint OK

URL and method are consistent with the rest of the collection for documents creation.

"body": {
"mode": "raw",
"raw": "{\r\n \"header\": {\r\n \"account_id\": 16268,\r\n \"document_type_id\": \"98\",\r\n \"received_issued_flag\": 0,\r\n \"issue_date\": \"2025-01-27\",\r\n \"issuer_tax_id_code\": \"20610383727\",\r\n \"issuer_tax_id_type\": \"PE-RUC\",\r\n \"issuer_legal_name\": \"<string>\",\r\n \"issuer_address\": \"<string>\",\r\n \"issuer_district\": \"<string>\",\r\n \"issuer_city\": \"<string>\",\r\n\t \"issuer_department\":\"<string>\",\r\n \"issuer_country_id\": \"80\",\r\n \"issuer_phone\": \"<string>\",\r\n \"issuer_activity\": \"<string>\",\r\n\t \"issuer_postalcode\":\"12345456\",\r\n \"receiver_tax_id_code\": \"20473731828\",\r\n \"receiver_tax_id_type\": \"PE-RUC\",\r\n \"receiver_legal_name\": \"ESCUELA KEMPER URGATES\",\r\n \"receiver_address\": \"<string>\",\r\n \"receiver_district\": \"<string>\",\r\n \"receiver_city\": \"<string>\",\r\n\t \"receiver_department\":\"<string>\",\r\n \"receiver_country_id\": \"80\",\r\n \"receiver_phone\": \"<string>\",\r\n \"receiver_activity\": \"<string>\",\r\n\t \"receiver_postalcode\":\"12343456\",\r\n \"payment_conditions\": \"0\",\r\n \"currency_id\": 7,\r\n\t \"additional\":{\r\n \"pe_header\":{\r\n \"signature_id\":\"ASDFG\",\r\n \"operation_type\":\"0101\"\r\n }\r\n }\r\n },\r\n \"details\": [\r\n {\r\n \"quantity\": 1,\r\n \"line_description\": \"Prueba Koywe\",\r\n \"unit_measure\": \"NIU\",\r\n \"unit_price\": 1000,\r\n \"long_description\": \"Test descripcion\",\r\n \"modifier_amount\": 0,\r\n \"total_taxes\": 180,\r\n \"modifier_percentage\": 0,\r\n \"total_amount_line\": 1180,\r\n \"sku\": \"3245\",\r\n \"taxes\": [\r\n {\r\n \"tax_type_id\": \"413\",\r\n \"tax_percentage\": 18,\r\n \"tax_amount\": 180\r\n }\r\n ]\r\n }\r\n ],\r\n \"references\": [\r\n\t {\r\n\t\t \"document_type_id\": \"96\",\r\n\t\t \"reference_number\": \"F001-00000087\",\r\n\t\t \"reference_code\": \"01\",\r\n\t\t \"description\": \"Anulacion solicitada por el emisor\",\r\n\t\t \"reference_date\": \"2025-01-27\"\r\n\t }\r\n ],\r\n \"totals\": {\r\n \"net_amount\": 1000,\r\n \"taxes_amount\": 180,\r\n \"total_amount\": 1180\r\n }\r\n}\r\n",
"raw": "{\r\n \"header\": {\r\n \"account_id\": 16268,\r\n \"document_type_id\": \"98\",\r\n \"received_issued_flag\": 0,\r\n \"issue_date\": \"2025-01-27\",\r\n \"issuer_tax_id_code\": \"20610383727\",\r\n \"issuer_tax_id_type\": \"PE-RUC\",\r\n \"issuer_legal_name\": \"<string>\",\r\n \"issuer_address\": \"<string>\",\r\n \"issuer_district\": \"<string>\",\r\n \"issuer_city\": \"<string>\",\r\n\t \"issuer_department\":\"<string>\",\r\n \"issuer_country_id\": \"80\",\r\n \"issuer_phone\": \"<string>\",\r\n \"issuer_activity\": \"<string>\",\r\n\t \"issuer_postalcode\":\"12345456\",\r\n \"receiver_tax_id_code\": \"20473731828\",\r\n \"receiver_tax_id_type\": \"PE-RUC\",\r\n \"receiver_legal_name\": \"ESCUELA KEMPER URGATES\",\r\n \"receiver_address\": \"<string>\",\r\n \"receiver_district\": \"<string>\",\r\n \"receiver_city\": \"<string>\",\r\n\t \"receiver_department\":\"<string>\",\r\n \"receiver_country_id\": \"83\",\r\n \"receiver_phone\": \"<string>\",\r\n \"receiver_activity\": \"<string>\",\r\n\t \"receiver_postalcode\":\"12343456\",\r\n \"payment_conditions\": \"0\",\r\n \"currency_id\": 7,\r\n\t \"additional\":{\r\n \"pe_header\":{\r\n \"signature_id\":\"ASDFG\",\r\n \"operation_type\":\"0101\"\r\n }\r\n }\r\n },\r\n \"details\": [\r\n {\r\n \"quantity\": 1,\r\n \"line_description\": \"Prueba Koywe\",\r\n \"unit_measure\": \"NIU\",\r\n \"unit_price\": 1000,\r\n \"long_description\": \"Test descripcion\",\r\n \"modifier_amount\": 0,\r\n \"total_taxes\": 180,\r\n \"modifier_percentage\": 0,\r\n \"total_amount_line\": 1180,\r\n \"sku\": \"3245\",\r\n \"taxes\": [\r\n {\r\n \"tax_type_id\": \"413\",\r\n \"tax_percentage\": 18,\r\n \"tax_amount\": 180\r\n }\r\n ]\r\n }\r\n ],\r\n \"references\": [\r\n\t {\r\n\t\t \"document_type_id\": \"96\",\r\n\t\t \"reference_number\": \"F001-00000087\",\r\n\t\t \"reference_code\": \"01\",\r\n\t\t \"description\": \"Anulacion solicitada por el emisor\",\r\n\t\t \"reference_date\": \"2025-01-27\"\r\n\t }\r\n ],\r\n \"totals\": {\r\n \"net_amount\": 1000,\r\n \"taxes_amount\": 180,\r\n \"total_amount\": 1180\r\n }\r\n}\r\n\r\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Peru credit note for invoice: wrong issuer_country_id (should be 83 for Peru)

This example is under Perú but sets "issuer_country_id": "80" (Mexico). Suggest fixing to "83".

Apply this targeted diff inside the raw JSON payload string:

-      "issuer_country_id": "80",
+      "issuer_country_id": "83",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"raw": "{\r\n \"header\": {\r\n \"account_id\": 16268,\r\n \"document_type_id\": \"98\",\r\n \"received_issued_flag\": 0,\r\n \"issue_date\": \"2025-01-27\",\r\n \"issuer_tax_id_code\": \"20610383727\",\r\n \"issuer_tax_id_type\": \"PE-RUC\",\r\n \"issuer_legal_name\": \"<string>\",\r\n \"issuer_address\": \"<string>\",\r\n \"issuer_district\": \"<string>\",\r\n \"issuer_city\": \"<string>\",\r\n\t \"issuer_department\":\"<string>\",\r\n \"issuer_country_id\": \"80\",\r\n \"issuer_phone\": \"<string>\",\r\n \"issuer_activity\": \"<string>\",\r\n\t \"issuer_postalcode\":\"12345456\",\r\n \"receiver_tax_id_code\": \"20473731828\",\r\n \"receiver_tax_id_type\": \"PE-RUC\",\r\n \"receiver_legal_name\": \"ESCUELA KEMPER URGATES\",\r\n \"receiver_address\": \"<string>\",\r\n \"receiver_district\": \"<string>\",\r\n \"receiver_city\": \"<string>\",\r\n\t \"receiver_department\":\"<string>\",\r\n \"receiver_country_id\": \"83\",\r\n \"receiver_phone\": \"<string>\",\r\n \"receiver_activity\": \"<string>\",\r\n\t \"receiver_postalcode\":\"12343456\",\r\n \"payment_conditions\": \"0\",\r\n \"currency_id\": 7,\r\n\t \"additional\":{\r\n \"pe_header\":{\r\n \"signature_id\":\"ASDFG\",\r\n \"operation_type\":\"0101\"\r\n }\r\n }\r\n },\r\n \"details\": [\r\n {\r\n \"quantity\": 1,\r\n \"line_description\": \"Prueba Koywe\",\r\n \"unit_measure\": \"NIU\",\r\n \"unit_price\": 1000,\r\n \"long_description\": \"Test descripcion\",\r\n \"modifier_amount\": 0,\r\n \"total_taxes\": 180,\r\n \"modifier_percentage\": 0,\r\n \"total_amount_line\": 1180,\r\n \"sku\": \"3245\",\r\n \"taxes\": [\r\n {\r\n \"tax_type_id\": \"413\",\r\n \"tax_percentage\": 18,\r\n \"tax_amount\": 180\r\n }\r\n ]\r\n }\r\n ],\r\n \"references\": [\r\n\t {\r\n\t\t \"document_type_id\": \"96\",\r\n\t\t \"reference_number\": \"F001-00000087\",\r\n\t\t \"reference_code\": \"01\",\r\n\t\t \"description\": \"Anulacion solicitada por el emisor\",\r\n\t\t \"reference_date\": \"2025-01-27\"\r\n\t }\r\n ],\r\n \"totals\": {\r\n \"net_amount\": 1000,\r\n \"taxes_amount\": 180,\r\n \"total_amount\": 1180\r\n }\r\n}\r\n\r\n",
\t \"issuer_department\":\"<string>\",
\"issuer_country_id\": \"83\",
\"issuer_phone\": \"<string>\",
🤖 Prompt for AI Agents
In koywe-billing.postman_collection.json around line 2516, the raw JSON payload
sets issuer_country_id to "80" (Mexico) while the request is for Perú; change
the issuer_country_id value to "83" to correctly indicate Peru within the raw
JSON string (ensure you only modify that field value inside the raw string and
preserve the surrounding JSON formatting and escaping).

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