-
Notifications
You must be signed in to change notification settings - Fork 45
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
Conversation
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this 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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
prisma/schema.prisma
Outdated
type DocumentType | ||
size Int | ||
mimeType String | ||
uploadProvider UploadProviders |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
prisma/schema.prisma
Outdated
} | ||
|
||
model DocumentFields { |
There was a problem hiding this comment.
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
prisma/schema.prisma
Outdated
SIGNED | ||
} | ||
|
||
model DocumentRecepients { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this 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 🔥
No description provided.