Skip to content

feat: resend document via API - #1226

Merged
Mythie merged 1 commit into
mainfrom
feat/resend-doc-from-api
Jul 12, 2024
Merged

Mythie merged 1 commit into
mainfrom
feat/resend-doc-from-api

Conversation

@catalinpit

@catalinpit catalinpit commented Jul 12, 2024 •

Copy link
Copy Markdown
Member

Allow users to re-send documents via the API.

Summary by CodeRabbit

  • New Features
    • Introduced the ability to resend documents for signing.
    • Added functionality to handle and track the status of document resending.
    • Implemented new response schemas for successful document resends.

@vercel

vercel Bot commented Jul 12, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
prd-app 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jul 12, 2024 10:38am
stg-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2024 10:38am
stg-docs ❌ Failed (Inspect) Jul 12, 2024 10:38am
stg-marketing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2024 10:38am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
prd-marketing ⬜️ Ignored (Inspect) Jul 12, 2024 10:38am

@coderabbitai

coderabbitai Bot commented Jul 12, 2024 •

Copy link
Copy Markdown
Contributor

Walkthrough

This update introduces a new feature in the API to resend documents for signing. The key additions include schemas for handling resend requests and responses, and a function to manage the document resending process, incorporating parameters such as document ID, recipients, user ID, and team ID. These changes ensure efficient and clear handling of document resend operations in the system.

Changes

File Change Summary
.../api/v1/contract.ts Added ZResendDocumentForSigningMutationSchema and ZSuccessfulResendDocumentResponseSchema to handle document resend operations.
.../api/v1/implementation.ts Introduced resendDocument function to manage resending documents with metadata, handling parameters such as document ID, recipients, user ID, and team ID.
.../api/v1/schema.ts Added schemas for recipient numbers, resend responses, and successful document uploads: ZResendDocumentForSigningMutationSchema and ZSuccessfulResendDocumentResponseSchema.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant API
    participant Auth
    participant DocumentService

    User->>API: Resend Document Request
    API->>Auth: Authenticate User
    Auth-->>API: User Authenticated
    API->>DocumentService: Resend Document (documentId, recipients, userId, teamId, metadata)
    DocumentService-->>API: Document Resend Status
    API-->>User: Resend Initiated/Failed
Loading

Poem

In the code, a change takes flight,
Resending docs with all its might. ✉️
Schemas new and functions blend,
Ensuring documents resend.
Clear and swift, it does its task,
Just ask, and it’s unmasked. 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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>.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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

Documentation and Community

  • 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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b0c0816 and 06bdacd.

Files selected for processing (3)
  • packages/api/v1/contract.ts (3 hunks)
  • packages/api/v1/implementation.ts (2 hunks)
  • packages/api/v1/schema.ts (1 hunks)
Additional comments not posted (8)
packages/api/v1/contract.ts (2)

20-20: Approved: Addition of ZResendDocumentForSigningMutationSchema.

The addition of this schema is appropriate for validating the body of the resend document request.


29-29: Approved: Addition of ZSuccessfulResendDocumentResponseSchema.

The addition of this schema is appropriate for validating the successful response of the resend document request.

packages/api/v1/schema.ts (4)

60-62: Approved: Addition of ZResendDocumentForSigningMutationSchema.

This schema appropriately validates an array of recipient numbers for the resend document request.


64-66: Approved: Addition of TResendDocumentForSigningMutationSchema.

This type ensures type safety by inferring the structure from the Zod schema.


68-70: Approved: Addition of ZSuccessfulResendDocumentResponseSchema.

This schema appropriately validates a response message string for the successful resend document request.


72-72: Approved: Addition of TResendDocumentResponseSchema.

This type ensures type safety by inferring the structure from the Zod schema.

packages/api/v1/implementation.ts (2)

12-12: Approved: Import of resendDocument.

This import is necessary for the implementation of the resendDocument function.


604-631: Approved: Implementation of resendDocument.

The function is well-implemented with proper error handling and status message returns.

However, ensure that the resendDocument function is correctly used and tested in the codebase.

Verification successful

Verified: The resendDocument function is correctly used and tested in the codebase.

The function is defined in packages/lib/server-only/document/resend-document.tsx and is integrated into various parts of the codebase, including the API and web application files.

  • packages/trpc/server/document-router/router.ts
  • packages/lib/server-only/document/resend-document.tsx
  • packages/api/v1/contract.ts
  • packages/api/v1/implementation.ts
  • apps/web/src/app/(dashboard)/documents/_action-items/resend-document.tsx
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `resendDocument` function in the codebase.

# Test: Search for the function usage. Expect: Only occurances of the new function.
rg --type javascript -A 5 $'resendDocument'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify the usage of `resendDocument` function in the codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type js -A 5 'resendDocument'

Length of output: 34


Script:

#!/bin/bash
# Description: Verify the definition and usage of the `resendDocument` function in the codebase.

# Search for the definition of the `resendDocument` function in the codebase.
rg --type js 'function resendDocument'

# Search for potential calls to `resendDocument` across the codebase.
rg --type js 'resendDocument('

Length of output: 154


Script:

#!/bin/bash
# Description: Verify the definition and usage of the `resendDocument` function in the codebase.

# Search for the definition of the `resendDocument` function in the codebase.
rg --type js 'function resendDocument'

# Search for potential calls to `resendDocument` across the codebase, escaping parentheses.
rg --type js 'resendDocument\('

Length of output: 74


Script:

#!/bin/bash
# Description: Search for any references to `resendDocument` in the codebase.

# Search for any occurrences of `resendDocument` across the codebase.
rg 'resendDocument'

Length of output: 1081

@catalinpit

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2024

Copy link
Copy Markdown
Contributor
Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Mythie
Mythie merged commit 7f5b273 into main Jul 12, 2024
@Mythie
Mythie deleted the feat/resend-doc-from-api branch July 12, 2024 11:03
dguyen pushed a commit that referenced this pull request Jul 19, 2024
Allow users to re-send documents via the API.

This branch had an error being deployed

1 failed and 2 active deployments
Preview – stg-marketing — 06bdacd8 Deployed Jul 12, 2024 by vercel[bot]
Preview – stg-docs — 06bdacd8 Deployed Jul 12, 2024 by vercel[bot]
Preview – stg-app — 06bdacd8 Deployed Jul 12, 2024 by vercel[bot]
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.

3 participants