Skip to content
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

feat: add basic document preview and update document schema #120

Merged
merged 40 commits into from
Feb 16, 2024

Conversation

G3root
Copy link
Collaborator

@G3root G3root commented Feb 14, 2024

No description provided.

Copy link

github-actions bot commented Feb 14, 2024

Thank you for following the naming conventions for pull request titles! 🙏

@G3root G3root requested a review from dahal February 15, 2024 04:48
Copy link
Contributor

@dahal dahal left a comment

Choose a reason for hiding this comment

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

I have left some comments, def a good start @G3root 💜

},
});
};
import { api } from "@/trpc/server";
Copy link
Contributor

@dahal dahal Feb 15, 2024

Choose a reason for hiding this comment

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

Quite curious, this is SSR page, why make a trpc call when you can call db directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

both does the job . They're colocated into tRPC because when tRPC 11 stabilizes, while calling a tRPC procedure (basically a fetch request) RSC can deduplicate requests while fetching the same data (since next.js monkey patches fetch).

type DocumentType
size Int
mimeType String
uploadProvider UploadProviders
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to mention providers. My understanding is R2, S3, minio all work with s3 aws-sdk api

COMPLETED
}

model Document {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets create a Template table to record these templates. Ideally document table will only have completed/signed documents, and these documents are the one we populate on /documents table.

EMAIL
}

model DocumentFields {
Copy link
Contributor

Choose a reason for hiding this comment

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

After creating Template table, this could be named to TemplateField <= singular and the columns could be

  • id
  • name
  • order (this is the order in which it should be filled out, for example if they have firstName, lastName, date, signature, they should be ordered as accordingly firstName first and signature last.)
  • position: JSON
    eg:
    {
      right: "100px",
      left: "200px",
      top: "300px",
      bottom: "400px"
    }
    
  • type
  • placeholder
  • required
  • templateId

SIGNED
}

model DocumentRecepients {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename this model to just EsignRecipient <= Singular (ideally all model/table names should be singular). And I think we need following columns

  • id
  • email (optional), if this is going to be sent to someone else (not part of the company, eg: new employees, advisors, investors before they are onboarded)
  • templateId (this is the template they are signing)
  • membershipId (and its association)
  • verificationToken, (create an association with VerificationToken table as well, this is to make sure the right recipient signs and we can expire them when not signed within given time)
  • status (instead of signingStatus)

@@ -230,21 +234,121 @@ model EquityPlan {
@@index([companyId])
}

model Bucket {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a generic table to hold upload data

@G3root G3root requested a review from dahal February 15, 2024 15:35
Copy link
Contributor

@dahal dahal left a comment

Choose a reason for hiding this comment

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

This is looking amazing, keep up the good work 🔥

@dahal dahal merged commit 924792b into main Feb 16, 2024
2 checks passed
@dahal dahal deleted the document-upload-new branch February 16, 2024 02:39
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.

None yet

2 participants