Skip to content

Added lading support#2

Open
Anidem1995 wants to merge 6 commits intomainfrom
feat/AddLadingComplementSupport
Open

Added lading support#2
Anidem1995 wants to merge 6 commits intomainfrom
feat/AddLadingComplementSupport

Conversation

@Anidem1995
Copy link
Copy Markdown
Contributor

@Anidem1995 Anidem1995 commented Mar 20, 2026

Summary by CodeRabbit

  • New Features

    • Added comprehensive bill of lading support with new models for shipments, merchandise tracking, multiple transport methods (ground, maritime, aerial, rail), insurance details, and customs documentation.
    • Extended invoicing system with integrated bill of lading capability.
  • Chores

    • Updated project version to 4.0.372.

@Anidem1995 Anidem1995 requested a review from mendozagit March 20, 2026 22:34
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

This PR adds comprehensive bill of lading (Carta Porte) support to FiscalAPI by introducing approximately 20+ new model classes in the billOfLading package for transport, merchandise, customs, and logistics entities. It also bumps the project version from 4.0.360 to 4.0.372 and relocates the Examples class to its own package.

Changes

Cohort / File(s) Summary
Version and Package Updates
pom.xml, src/main/java/com/fiscalapi/examples/Examples.java
Updated project version from 4.0.360 to 4.0.372; moved Examples class from com.fiscalapi to com.fiscalapi.examples package.
Core Complement Integration
src/main/java/com/fiscalapi/models/invoicing/Complement.java
Added cartaPorte field of type CartaPorte with public getter and setter to enable bill of lading support in invoices.
Bill of Lading Core Model
src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java
Introduced primary CartaPorte class with 20+ fields including transport identifiers, distances, weights, and nested collections for regulatory (RegimenAduanero), location, merchandise, and transport mode entities.
Transport Mode Models
src/main/java/com/fiscalapi/models/invoicing/billOfLading/Autotransporte.java, TransporteMaritimo.java, TransporteAereo.java, TransporteFerroviario.java
Added four specialized transport mode classes with insurance, permit, vessel/aircraft/rail identifiers; maritime and rail variants include containers and cargo details with BigDecimal serialization for weights.
Merchandise and Cargo
src/main/java/com/fiscalapi/models/invoicing/billOfLading/Mercancia.java, DetalleMercancia.java, CantidadTransporta.java, GuiaIdentificacion.java
Introduced merchandise tracking classes; Mercancia is comprehensive with 35+ fields including pharmaceutical/hazmat metadata, nested documentation, and customs data; others handle weight details, transport quantities, and identification guides.
Customs and Documentation
src/main/java/com/fiscalapi/models/invoicing/billOfLading/DocumentoAduanero.java
Added DocumentoAduanero class for customs documentation with four string fields capturing document type, permit number, and importer RFC.
Location and Party Identification
src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java, UbicacionDomicilio.java, TipoFigura.java, TipoFiguraDomicilio.java
Introduced location (Ubicacion) with departure/arrival metadata and nested address; TipoFigura represents transport figures (agents/brokers) with RFC, license, and domicile details.
Regulatory Classification
src/main/java/com/fiscalapi/models/invoicing/billOfLading/RegimenAduanero.java, ParteTransporte.java
Added minimal identifier classes for customs regime and transport part classification.
Vehicles, Containers, and Equipment
src/main/java/com/fiscalapi/models/invoicing/billOfLading/Remolque.java, Carro.java, CarroContenedor.java, ContenedorMaritimo.java, RemolqueCCP.java, DerechoDePaso.java
Added vehicle and container tracking classes; rail Carro includes containers with weights; maritime ContenedorMaritimo includes certification dates and rail rights-of-way (DerechoDePaso) with custom BigDecimal serialization for distances/weights.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feat/add payroll support #1 — Introduced the Complement class with payroll/payment fields; this PR extends Complement by adding the new cartaPorte field for bill of lading support.

Suggested reviewers

  • mendozagit

Poem

🐰 Hop along with bills of lading bright,
Transport modes in packages tight,
Containers, customs, freight in flight,
The invoice flow is pure delight!
Twenty classes, all just right! 📦✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Added lading support' accurately describes the primary change—adding bill of lading (CartaPorte) model classes and integration into the Complement class.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/AddLadingComplementSupport

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@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: 17

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Autotransporte.java`:
- Line 9: The Autotransporte DTO currently doesn't inherit the project DTO
hierarchy; update its declaration so it extends the project's DTO base (e.g.,
change class Autotransporte to extend BaseDto from the
SerializableDto→AuditableDto→BaseDto chain) and add the necessary import(s) for
BaseDto (and any serialVersionUID if required by SerializableDto); ensure the
class therefore inherits id (from BaseDto) and createdAt/updatedAt (from
AuditableDto) as required by the project's DTO convention.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CantidadTransporta.java`:
- Line 8: The CantidadTransporta DTO is declared as a plain POJO; update its
declaration to extend the project DTO hierarchy by making CantidadTransporta
extend BaseDto (which inherits AuditableDto and SerializableDto in the project),
add the necessary import for BaseDto, and add any required serialVersionUID or
constructors if other DTOs in the hierarchy require them; ensure the class
signature uses "public class CantidadTransporta extends BaseDto" (and remove any
duplicate id/createdAt/updatedAt fields if present).

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java`:
- Line 9: CartaPorte is missing the required DTO inheritance chain; update the
class declaration for CartaPorte so it extends the DTO base chain
(SerializableDto → AuditableDto → BaseDto) by making it extend SerializableDto
(which in turn inherits AuditableDto and BaseDto), ensure the appropriate
imports for SerializableDto/AuditableDto/BaseDto are added, and remove any
duplicate id/createdAt/updatedAt fields if present so the class relies on the
inherited fields and behavior.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/DetalleMercancia.java`:
- Line 8: The DetalleMercancia class currently stands alone; update its
declaration so it extends the shared DTO hierarchy (BaseDto via
AuditableDto/SerializableDto) — e.g., change the class to extend AuditableDto or
BaseDto following the project's chain (SerializableDto → AuditableDto →
BaseDto), add the necessary import(s) for the chosen base class, and ensure any
required fields/methods (id, createdAt, updatedAt) or constructors align with
the inherited contract in DetalleMercancia.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/DocumentoAduanero.java`:
- Line 3: DocumentoAduanero is declared as a plain class but must participate in
the DTO inheritance chain; change its declaration to extend the BaseDto from the
DTO hierarchy (which itself extends AuditableDto and SerializableDto) so it
inherits id, createdAt and updatedAt fields. Update the class signature to
"public class DocumentoAduanero extends BaseDto" and add the necessary import
for BaseDto (and remove any conflicting fields/annotations that duplicate
id/createdAt/updatedAt) so the model follows the SerializableDto → AuditableDto
→ BaseDto hierarchy.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Domicilio.java`:
- Line 3: Domicilio currently does not inherit the project's DTO base chain;
update the class declaration for Domicilio to extend BaseDto (which already
inherits AuditableDto and SerializableDto) so it participates in the
SerializableDto → AuditableDto → BaseDto hierarchy, and add any required import
for BaseDto and a serialVersionUID if your DTOs declare one; locate the class
named Domicilio and change its declaration to extend BaseDto and ensure
imports/serialization fields are present.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Mercancia.java`:
- Line 14: Mercancia currently is a standalone model; update it to inherit the
DTO hierarchy by extending BaseDto (which already brings AuditableDto and
SerializableDto) so it complies with the DTO contract; locate the class
declaration for Mercancia and change it to extend BaseDto, remove any duplicate
id/createdAt/updatedAt fields if present, and ensure imports reference
BaseDto/AuditableDto/SerializableDto as needed.
- Around line 27-30: The fechaCaducidad field in Mercancia is annotated with a
JsonFormat pattern that includes milliseconds; update the JsonFormat pattern on
the fechaCaducidad field (the annotations on LocalDateTime fechaCaducidad in
class Mercancia) to use "yyyy-MM-dd'T'HH:mm:ss" to match
InvoiceConstants.SAT_DATE_FORMAT_OUT (remove the .SSS milliseconds portion) so
serialized values conform to the SDK SAT datetime output standard; keep the
existing JsonSerialize/JsonDeserialize annotations intact.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/ParteTransporte.java`:
- Line 3: ParteTransporte is declared as a standalone DTO but must inherit the
shared DTO chain; change its declaration to extend the top-level DTO in the
hierarchy (e.g. make ParteTransporte extend SerializableDto so it inherits
AuditableDto and BaseDto), add the proper import for SerializableDto, and ensure
any required serialVersionUID/constructors call super() if needed to satisfy the
parent classes (update class declaration "public class ParteTransporte" to
"public class ParteTransporte extends SerializableDto").

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/RegimenAduanero.java`:
- Line 3: Change the class declaration so RegimenAduanero inherits the DTO
hierarchy (e.g., "public class RegimenAduanero extends SerializableDto") so it
gets AuditableDto/BaseDto fields; add the appropriate import for SerializableDto
and update any constructors to call super() if required so the class compiles
and obtains id, createdAt and updatedAt from the DTO base hierarchy.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Remolque.java`:
- Line 3: Remolque is currently a plain POJO but must participate in the DTO
inheritance chain; change its declaration so it extends the project DTO base
(make Remolque extend BaseDto, which already chains SerializableDto →
AuditableDto → BaseDto), add the necessary import for BaseDto, and remove/adjust
any duplicate id/createdAt/updatedAt fields in Remolque so those come from the
inherited BaseDto/AuditableDto instead.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TipoFigura.java`:
- Line 5: TipoFigura is currently a plain class; change its declaration to
extend the project's DTO hierarchy by making it extend BaseDto (which itself
inherits AuditableDto and SerializableDto), add the necessary import for
BaseDto, and ensure any required serialVersionUID or no-arg constructor
expectations from SerializableDto/AuditableDto are satisfied so the DTO conforms
to the SerializableDto → AuditableDto → BaseDto contract.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteAereo.java`:
- Line 3: The TransporteAereo model must extend the project's DTO hierarchy;
update the class declaration for TransporteAereo to extend the existing BaseDto
(which sits on top of AuditableDto and SerializableDto in the chain), add the
necessary import for BaseDto, and remove any duplicate id/createdAt/updatedAt
fields from TransporteAereo so it relies on the inherited fields and behavior.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java`:
- Line 9: The railway DTO classes (e.g., TransporteFerroviario and the other
DTOs noted in this file) currently do not inherit the required DTO hierarchy;
update each DTO class declaration to extend the project's base DTO chain by
making them extend BaseDto (which in turn inherits AuditableDto and
SerializableDto) — e.g., change "public class TransporteFerroviario" to "public
class TransporteFerroviario extends BaseDto" and apply the same change to the
other DTO classes at the other locations so they inherit id and audit fields.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java`:
- Line 9: The new DTO classes (e.g., TransporteMaritimo) are not inheriting the
required project DTO chain; update their class declarations to extend BaseDto
(which itself extends AuditableDto and SerializableDto) so id, createdAt and
updatedAt are available, add the necessary import for BaseDto, and apply the
same change to the other two DTO-like classes referenced at the other locations
(the classes introduced at the other two spots) so they all inherit the DTO
hierarchy.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java`:
- Line 13: Ubicacion is declared as a plain POJO but must participate in the DTO
inheritance chain; update the class declaration for Ubicacion to extend the
project's DTO base (e.g., change to "public class Ubicacion extends BaseDto")
and add the necessary import for BaseDto so it inherits id, createdAt/updatedAt
and Serializable behavior via BaseDto → AuditableDto → SerializableDto; ensure
no other DTO fields are duplicated (remove local id/createdAt/updatedAt if
present).
- Around line 25-29: The JsonFormat pattern on the Ubicacion class field
fechaHoraSalidaLlegada currently includes milliseconds; change the annotation on
fechaHoraSalidaLlegada (the `@JsonFormat` on the field) to use the
SAT_DATE_FORMAT_OUT pattern "yyyy-MM-dd'T'HH:mm:ss" (remove ".SSS"), ensuring
`@JsonSerialize/`@JsonDeserialize remain intact so Jackson serializes/deserializes
exactly to the SDK's SAT format.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2f2198e4-4c61-4e1b-ace5-a4e37014ce32

📥 Commits

Reviewing files that changed from the base of the PR and between a405b2f and 6273f18.

📒 Files selected for processing (20)
  • pom.xml
  • src/main/java/com/fiscalapi/examples/EjemplosCartaPorteReferencias.java
  • src/main/java/com/fiscalapi/examples/EjemplosCartaPorteValores.java
  • src/main/java/com/fiscalapi/examples/Examples.java
  • src/main/java/com/fiscalapi/models/invoicing/Complement.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Autotransporte.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/CantidadTransporta.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/DetalleMercancia.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/DocumentoAduanero.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Domicilio.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Mercancia.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/ParteTransporte.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/RegimenAduanero.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Remolque.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TipoFigura.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteAereo.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java

import java.math.BigDecimal;
import java.util.List;

public class Autotransporte {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Autotransporte must extend the project DTO base hierarchy.

Line 9 defines a model DTO without inheriting from the required DTO chain.

As per coding guidelines **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Autotransporte.java`
at line 9, The Autotransporte DTO currently doesn't inherit the project DTO
hierarchy; update its declaration so it extends the project's DTO base (e.g.,
change class Autotransporte to extend BaseDto from the
SerializableDto→AuditableDto→BaseDto chain) and add the necessary import(s) for
BaseDto (and any serialVersionUID if required by SerializableDto); ensure the
class therefore inherits id (from BaseDto) and createdAt/updatedAt (from
AuditableDto) as required by the project's DTO convention.


import java.math.BigDecimal;

public class CantidadTransporta {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

CantidadTransporta should inherit from the required DTO hierarchy.

Line 8 declares this DTO as a standalone POJO instead of extending the project DTO base chain.

As per coding guidelines **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CantidadTransporta.java`
at line 8, The CantidadTransporta DTO is declared as a plain POJO; update its
declaration to extend the project DTO hierarchy by making CantidadTransporta
extend BaseDto (which inherits AuditableDto and SerializableDto in the project),
add the necessary import for BaseDto, and add any required serialVersionUID or
constructors if other DTOs in the hierarchy require them; ensure the class
signature uses "public class CantidadTransporta extends BaseDto" (and remove any
duplicate id/createdAt/updatedAt fields if present).

import java.math.BigDecimal;
import java.util.List;

public class CartaPorte {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

CartaPorte also needs to inherit from the DTO base chain.

Line 9 defines the class without the required SerializableDto → AuditableDto → BaseDto inheritance structure.

As per coding guidelines: "**/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java` at
line 9, CartaPorte is missing the required DTO inheritance chain; update the
class declaration for CartaPorte so it extends the DTO base chain
(SerializableDto → AuditableDto → BaseDto) by making it extend SerializableDto
(which in turn inherits AuditableDto and BaseDto), ensure the appropriate
imports for SerializableDto/AuditableDto/BaseDto are added, and remove any
duplicate id/createdAt/updatedAt fields if present so the class relies on the
inherited fields and behavior.


import java.math.BigDecimal;

public class DetalleMercancia {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

DetalleMercancia must extend the shared DTO hierarchy.

Line 8 declares a standalone class instead of inheriting from the required model base chain.

As per coding guidelines: "**/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/DetalleMercancia.java`
at line 8, The DetalleMercancia class currently stands alone; update its
declaration so it extends the shared DTO hierarchy (BaseDto via
AuditableDto/SerializableDto) — e.g., change the class to extend AuditableDto or
BaseDto following the project's chain (SerializableDto → AuditableDto →
BaseDto), add the necessary import(s) for the chosen base class, and ensure any
required fields/methods (id, createdAt, updatedAt) or constructors align with
the inherited contract in DetalleMercancia.

@@ -0,0 +1,31 @@
package com.fiscalapi.models.invoicing.billOfLading;

public class DocumentoAduanero {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

DocumentoAduanero should inherit from the DTO base hierarchy.

Line 3 introduces a DTO in models without extending the required base DTO chain.

As per coding guidelines **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/DocumentoAduanero.java`
at line 3, DocumentoAduanero is declared as a plain class but must participate
in the DTO inheritance chain; change its declaration to extend the BaseDto from
the DTO hierarchy (which itself extends AuditableDto and SerializableDto) so it
inherits id, createdAt and updatedAt fields. Update the class signature to
"public class DocumentoAduanero extends BaseDto" and add the necessary import
for BaseDto (and remove any conflicting fields/annotations that duplicate
id/createdAt/updatedAt) so the model follows the SerializableDto → AuditableDto
→ BaseDto hierarchy.

@@ -0,0 +1,103 @@
package com.fiscalapi.models.invoicing.billOfLading;

public class TransporteAereo {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

TransporteAereo should extend the mandated DTO hierarchy.

Line 3 currently defines a standalone model class in a path where DTO inheritance is required.

As per coding guidelines: "**/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteAereo.java`
at line 3, The TransporteAereo model must extend the project's DTO hierarchy;
update the class declaration for TransporteAereo to extend the existing BaseDto
(which sits on top of AuditableDto and SerializableDto in the chain), add the
necessary import for BaseDto, and remove any duplicate id/createdAt/updatedAt
fields from TransporteAereo so it relies on the inherited fields and behavior.

import java.math.BigDecimal;
import java.util.List;

public class TransporteFerroviario {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

New railway transport DTO classes bypass the mandated base DTO inheritance chain.

Line 9, Line 65, Line 88, and Line 139 define model DTOs without extending the required hierarchy. Please align these classes to the standard DTO base chain for consistent id and audit metadata behavior.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

Also applies to: 65-65, 88-88, 139-139

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java`
at line 9, The railway DTO classes (e.g., TransporteFerroviario and the other
DTOs noted in this file) currently do not inherit the required DTO hierarchy;
update each DTO class declaration to extend the project's base DTO chain by
making them extend BaseDto (which in turn inherits AuditableDto and
SerializableDto) — e.g., change "public class TransporteFerroviario" to "public
class TransporteFerroviario extends BaseDto" and apply the same change to the
other DTO classes at the other locations so they inherit id and audit fields.

import java.math.BigDecimal;
import java.util.List;

public class TransporteMaritimo {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

DTO hierarchy requirement is not applied to the new bill-of-lading models.

Line 9, Line 266, and Line 355 introduce DTO-like classes that do not extend the required DTO chain. Please inherit from the project DTO hierarchy so id, createdAt, and updatedAt are consistently available.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

Also applies to: 266-266, 355-355

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java`
at line 9, The new DTO classes (e.g., TransporteMaritimo) are not inheriting the
required project DTO chain; update their class declarations to extend BaseDto
(which itself extends AuditableDto and SerializableDto) so id, createdAt and
updatedAt are available, add the necessary import for BaseDto, and apply the
same change to the other two DTO-like classes referenced at the other locations
(the classes introduced at the other two spots) so they all inherit the DTO
hierarchy.

import java.math.BigDecimal;
import java.time.LocalDateTime;

public class Ubicacion {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

This model should inherit the required DTO chain.

Line 13 introduces Ubicacion as a plain POJO, which breaks the DTO inheritance requirement for models.

As per coding guidelines: "**/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java` at
line 13, Ubicacion is declared as a plain POJO but must participate in the DTO
inheritance chain; update the class declaration for Ubicacion to extend the
project's DTO base (e.g., change to "public class Ubicacion extends BaseDto")
and add the necessary import for BaseDto so it inherits id, createdAt/updatedAt
and Serializable behavior via BaseDto → AuditableDto → SerializableDto; ensure
no other DTO fields are duplicated (remove local id/createdAt/updatedAt if
present).

Comment on lines +25 to +29
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS")
@JsonSerialize(using = LocalDateTimeSerializer.class)
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
private LocalDateTime fechaHoraSalidaLlegada;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java

Repository: FiscalAPI/fiscalapi-java

Length of output: 5032


🏁 Script executed:

# Search for SAT output formatter patterns in the codebase
rg "yyyy-MM-dd.*HH:mm:ss" --type java -n

Repository: FiscalAPI/fiscalapi-java

Length of output: 2612


🏁 Script executed:

# Search for LocalDateTime serialization patterns
rg "LocalDateTime" --type java -B 3 -A 3 -n | head -100

Repository: FiscalAPI/fiscalapi-java

Length of output: 9738


Align fechaHoraSalidaLlegada format with SAT output pattern.

Line 25 currently serializes with milliseconds (...ss.SSS), but the SDK's SAT_DATE_FORMAT_OUT is yyyy-MM-dd'T'HH:mm:ss (without milliseconds). Code comments and the formatter constant explicitly require the pattern without fractions. Update to match the standard SAT pattern to prevent serialization inconsistencies.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java`
around lines 25 - 29, The JsonFormat pattern on the Ubicacion class field
fechaHoraSalidaLlegada currently includes milliseconds; change the annotation on
fechaHoraSalidaLlegada (the `@JsonFormat` on the field) to use the
SAT_DATE_FORMAT_OUT pattern "yyyy-MM-dd'T'HH:mm:ss" (remove ".SSS"), ensuring
`@JsonSerialize/`@JsonDeserialize remain intact so Jackson serializes/deserializes
exactly to the SDK's SAT format.

Copy link
Copy Markdown

@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: 3

♻️ Duplicate comments (3)
src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java (1)

9-9: ⚠️ Potential issue | 🟠 Major

Keep CartaPorte on the SDK DTO base chain.

CartaPorte is a model DTO and is currently declared as a plain class, so it misses the required inherited id, createdAt, and updatedAt fields. Please extend the project DTO base class and remove any duplicated metadata fields if they are added elsewhere.

♻️ Minimal shape of the change
-public class CartaPorte {
+public class CartaPorte extends BaseDto {

Add the corresponding BaseDto import used by the project.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java` at
line 9, CartaPorte is declared as a plain class but must participate in the SDK
DTO inheritance chain; update the class declaration to extend the project's DTO
base (BaseDto) so it inherits id, createdAt and updatedAt (i.e., ensure it
extends BaseDto which itself extends AuditableDto/SerializableDto per project
conventions), add the necessary import for BaseDto, and remove any locally
declared metadata fields (id, createdAt, updatedAt) from CartaPorte to avoid
duplication.
src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java (1)

9-9: ⚠️ Potential issue | 🟠 Major

Apply the DTO base inheritance here too.

TransporteMaritimo is still a plain model class under models, so it does not inherit the required id, createdAt, and updatedAt DTO fields. Please extend the project DTO base class that represents the full hierarchy.

♻️ Minimal shape of the change
-public class TransporteMaritimo {
+public class TransporteMaritimo extends BaseDto {

Add the corresponding BaseDto import used by the project.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java`
at line 9, TransporteMaritimo is a plain model and must extend the project DTO
hierarchy so it includes id, createdAt and updatedAt; update the class
declaration to extend BaseDto (which itself extends AuditableDto and
SerializableDto) and add the appropriate import for BaseDto; ensure the class
signature uses "public class TransporteMaritimo extends BaseDto" and remove any
conflicting fields that duplicate id/createdAt/updatedAt if present.
src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java (1)

5-5: ⚠️ Potential issue | 🟠 Major

Make the railway DTO inherit from the common DTO base.

TransporteFerroviario is under models but does not extend the required DTO hierarchy, so consumers will not get the standard id and audit metadata shape.

♻️ Minimal shape of the change
-public class TransporteFerroviario {
+public class TransporteFerroviario extends BaseDto {

Add the corresponding BaseDto import used by the project.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java`
at line 5, TransporteFerroviario currently does not extend the project's DTO
base hierarchy; update the class to extend BaseDto (which itself extends
AuditableDto and SerializableDto) and add the appropriate import for BaseDto,
ensuring the class signature becomes "public class TransporteFerroviario extends
BaseDto" so consumers receive the id and audit metadata fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Carro.java`:
- Line 9: Carro currently declares an empty DTO class; update it to extend the
project's DTO hierarchy by importing and extending BaseDto (which itself extends
AuditableDto and SerializableDto) so Carro inherits id, createdAt and updatedAt;
modify the class declaration to extend BaseDto and add the required import for
BaseDto (ensure package name matches project imports) so Carro aligns with other
DTOs.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CarroContenedor.java`:
- Line 8: CarroContenedor currently doesn't extend the DTO hierarchy; change its
declaration to extend BaseDto (which itself extends AuditableDto and
SerializableDto) and add the corresponding import for BaseDto; ensure the class
signature uses "extends BaseDto" (symbol: CarroContenedor) and remove any
conflicting fields now provided by the base classes, keeping
constructors/getters compatible with the inherited id, createdAt and updatedAt
properties.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/ContenedorMaritimo.java`:
- Line 12: ContenedorMaritimo is a DTO but currently a plain class; update its
declaration to extend the project DTO hierarchy by making it extend BaseDto
(which already inherits AuditableDto and SerializableDto), and add the
corresponding import for BaseDto at the top of the file; ensure the class
signature changes from "public class ContenedorMaritimo" to extend BaseDto so it
inherits id, createdAt and updatedAt fields consistent with other DTOs.

---

Duplicate comments:
In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java`:
- Line 9: CartaPorte is declared as a plain class but must participate in the
SDK DTO inheritance chain; update the class declaration to extend the project's
DTO base (BaseDto) so it inherits id, createdAt and updatedAt (i.e., ensure it
extends BaseDto which itself extends AuditableDto/SerializableDto per project
conventions), add the necessary import for BaseDto, and remove any locally
declared metadata fields (id, createdAt, updatedAt) from CartaPorte to avoid
duplication.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java`:
- Line 5: TransporteFerroviario currently does not extend the project's DTO base
hierarchy; update the class to extend BaseDto (which itself extends AuditableDto
and SerializableDto) and add the appropriate import for BaseDto, ensuring the
class signature becomes "public class TransporteFerroviario extends BaseDto" so
consumers receive the id and audit metadata fields.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java`:
- Line 9: TransporteMaritimo is a plain model and must extend the project DTO
hierarchy so it includes id, createdAt and updatedAt; update the class
declaration to extend BaseDto (which itself extends AuditableDto and
SerializableDto) and add the appropriate import for BaseDto; ensure the class
signature uses "public class TransporteMaritimo extends BaseDto" and remove any
conflicting fields that duplicate id/createdAt/updatedAt if present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea5259d5-1449-4a72-9bd0-314015a91589

📥 Commits

Reviewing files that changed from the base of the PR and between 6273f18 and 4228ab9.

📒 Files selected for processing (19)
  • src/main/java/com/fiscalapi/examples/EjemplosCartaPorteReferencias.java
  • src/main/java/com/fiscalapi/examples/EjemplosCartaPorteValores.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Autotransporte.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Carro.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/CarroContenedor.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/CartaPorte.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/ContenedorMaritimo.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/DerechoDePaso.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/DocumentoAduanero.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/GuiaIdentificacion.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Mercancia.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/RemolqueCCP.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TipoFigura.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TipoFiguraDomicilio.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteAereo.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteFerroviario.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteMaritimo.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/UbicacionDomicilio.java
✅ Files skipped from review due to trivial changes (6)
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/RemolqueCCP.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/DerechoDePaso.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TipoFiguraDomicilio.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/GuiaIdentificacion.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Autotransporte.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/UbicacionDomicilio.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Ubicacion.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/DocumentoAduanero.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TipoFigura.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/TransporteAereo.java
  • src/main/java/com/fiscalapi/models/invoicing/billOfLading/Mercancia.java

import java.math.BigDecimal;
import java.util.List;

public class Carro {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Inherit the standard DTO fields for this nested model.

Carro is a model DTO but currently bypasses the common DTO hierarchy. Please extend the project DTO base class so its shape stays consistent with the rest of the SDK.

♻️ Minimal shape of the change
-public class Carro {
+public class Carro extends BaseDto {

Add the corresponding BaseDto import used by the project.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/fiscalapi/models/invoicing/billOfLading/Carro.java` at line
9, Carro currently declares an empty DTO class; update it to extend the
project's DTO hierarchy by importing and extending BaseDto (which itself extends
AuditableDto and SerializableDto) so Carro inherits id, createdAt and updatedAt;
modify the class declaration to extend BaseDto and add the required import for
BaseDto (ensure package name matches project imports) so Carro aligns with other
DTOs.


import java.math.BigDecimal;

public class CarroContenedor {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Extend the DTO hierarchy for the container DTO.

CarroContenedor is in the model package but does not inherit the standard DTO base chain, leaving out the common id and audit metadata contract.

♻️ Minimal shape of the change
-public class CarroContenedor {
+public class CarroContenedor extends BaseDto {

Add the corresponding BaseDto import used by the project.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/CarroContenedor.java`
at line 8, CarroContenedor currently doesn't extend the DTO hierarchy; change
its declaration to extend BaseDto (which itself extends AuditableDto and
SerializableDto) and add the corresponding import for BaseDto; ensure the class
signature uses "extends BaseDto" (symbol: CarroContenedor) and remove any
conflicting fields now provided by the base classes, keeping
constructors/getters compatible with the inherited id, createdAt and updatedAt
properties.

import java.time.LocalDateTime;
import java.util.List;

public class ContenedorMaritimo {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Extend the required DTO hierarchy.

ContenedorMaritimo is under models but is declared as a plain class, so it misses the standard id/audit/serialization inheritance chain. Please extend the project DTO base class that completes this hierarchy, e.g. BaseDto if that is the leaf class in this SDK.

♻️ Minimal shape of the change
-public class ContenedorMaritimo {
+public class ContenedorMaritimo extends BaseDto {

Add the corresponding BaseDto import used by the project.

As per coding guidelines: **/models/**/*.java: All DTOs must extend the DTO hierarchy: SerializableDtoAuditableDto (with createdAt, updatedAt fields) → BaseDto (with id field).

📝 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
public class ContenedorMaritimo {
public class ContenedorMaritimo extends BaseDto {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/fiscalapi/models/invoicing/billOfLading/ContenedorMaritimo.java`
at line 12, ContenedorMaritimo is a DTO but currently a plain class; update its
declaration to extend the project DTO hierarchy by making it extend BaseDto
(which already inherits AuditableDto and SerializableDto), and add the
corresponding import for BaseDto at the top of the file; ensure the class
signature changes from "public class ContenedorMaritimo" to extend BaseDto so it
inherits id, createdAt and updatedAt fields consistent with other DTOs.

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