Skip to content

chore(retentions): add new retentions method for support drafts#282

Open
raul-facturapi wants to merge 1 commit into
mainfrom
chore/retention_drafts
Open

chore(retentions): add new retentions method for support drafts#282
raul-facturapi wants to merge 1 commit into
mainfrom
chore/retention_drafts

Conversation

@raul-facturapi

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the v2 OpenAPI specs (Spanish + English) to support “draft” retentions, including creating retentions as drafts, editing drafts, copying an existing retention into a draft, and stamping a draft when ready.

Changes:

  • Document draft creation behavior (status: "draft") and add is_ready_to_stamp to the Retention schema.
  • Add new endpoints for draft workflows: update draft (PUT /retentions/{retention_id}), copy to draft, and stamp draft.
  • Add status filtering to the retentions list endpoint and adjust cancellation docs/params for draft vs non-draft retentions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
website/openapi_v2.yaml Spanish OpenAPI updates for draft retentions, new endpoints, status filtering, and schema changes.
website/openapi_v2.en.yaml English OpenAPI updates mirroring the Spanish draft retention additions and schema/endpoint changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/openapi_v2.yaml
Comment on lines +6180 to +6186
type: object
discriminator:
propertyName: status
mapping:
valid: "#/components/schemas/Retention"
pending: "#/components/schemas/Retention"
draft: "#/components/schemas/Retention"
Comment on lines +5963 to +5969
type: object
discriminator:
propertyName: status
mapping:
valid: "#/components/schemas/Retention"
pending: "#/components/schemas/Retention"
draft: "#/components/schemas/Retention"
Comment thread website/openapi_v2.yaml
Comment on lines +6330 to +6345
schema:
oneOf:
- type: string
enum:
- draft
- pending
- valid
- canceled
- type: array
items:
type: string
enum:
- draft
- pending
- valid
- canceled
Comment on lines +6114 to +6129
schema:
oneOf:
- type: string
enum:
- draft
- pending
- valid
- canceled
- type: array
items:
type: string
enum:
- draft
- pending
- valid
- canceled
Comment thread website/openapi_v2.yaml
Comment on lines +6516 to +6523
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthenticated"
"429":
$ref: "#/components/responses/RateLimited"
"500":
$ref: "#/components/responses/UnexpectedError"
Comment on lines +6300 to +6307
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthenticated"
"429":
$ref: "#/components/responses/RateLimited"
"500":
$ref: "#/components/responses/UnexpectedError"
Comment thread website/openapi_v2.yaml
Comment on lines 16954 to +16966
RetentionInput:
type: object
required:
- customer
- cve_retenc
- periodo
- totales
properties:
status:
type: string
enum:
- draft
description: |
Estado inicial de la retención. Si se envía `draft`, la retención se
guardará como borrador y no se timbrará ni se enviará al SAT. También
al enviar `draft`, `customer`, `cve_retenc`, `periodo` y `totales`
pueden omitirse o enviarse como `null`.
example: draft
Comment on lines 16713 to +16725
RetentionInput:
type: object
required:
- customer
- cve_retenc
- periodo
- totales
properties:
status:
type: string
enum:
- draft
description: |
Initial status of the retention. If `draft` is sent, the retention
will be saved as a draft and will not be stamped or sent to the SAT.
When `draft` is sent, `customer`, `cve_retenc`, `periodo`, and
`totales` may be omitted or sent as `null`.
example: draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants