-
Notifications
You must be signed in to change notification settings - Fork 176
feat(securities): express vesting & cliff in months instead of years #562
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| Vesting and cliff durations are now expressed in MONTHS instead of years. | ||
|
|
||
| - Rename "vestingYears" -> "vestingMonths" and "cliffYears" -> "cliffMonths" | ||
| on the "Share" and "Option" tables. | ||
| - Convert existing values from years to months by multiplying by 12 | ||
| (e.g. a 4-year / 1-year-cliff grant becomes 48 / 12 months). | ||
| */ | ||
|
|
||
| -- AlterTable | ||
| ALTER TABLE "Share" RENAME COLUMN "vestingYears" TO "vestingMonths"; | ||
| ALTER TABLE "Share" RENAME COLUMN "cliffYears" TO "cliffMonths"; | ||
|
|
||
| -- AlterTable | ||
| ALTER TABLE "Option" RENAME COLUMN "vestingYears" TO "vestingMonths"; | ||
| ALTER TABLE "Option" RENAME COLUMN "cliffYears" TO "cliffMonths"; | ||
|
|
||
| -- Convert existing durations from years to months | ||
| UPDATE "Share" SET "vestingMonths" = "vestingMonths" * 12, "cliffMonths" = "cliffMonths" * 12; | ||
| UPDATE "Option" SET "vestingMonths" = "vestingMonths" * 12, "cliffMonths" = "cliffMonths" * 12; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,13 +57,13 @@ export const ShareSchema = z | |
| example: 0, | ||
| }), | ||
|
|
||
| cliffYears: z.number().openapi({ | ||
| description: "Cliff Years", | ||
| example: 1, | ||
| cliffMonths: z.number().openapi({ | ||
| description: "Vesting cliff in months", | ||
| example: 12, | ||
| }), | ||
| vestingYears: z.number().openapi({ | ||
| description: "Vesting Years", | ||
| example: 4, | ||
| vestingMonths: z.number().openapi({ | ||
| description: "Total vesting period in months", | ||
| example: 48, | ||
|
Comment on lines
+60
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add integer and non-negative constraints to month fields in public API schema. The Proposed validation fix- cliffMonths: z.number().openapi({
+ cliffMonths: z.number().int().min(0).openapi({
description: "Vesting cliff in months",
example: 12,
}),
- vestingMonths: z.number().openapi({
+ vestingMonths: z.number().int().min(0).openapi({
description: "Total vesting period in months",
example: 48,🤖 Prompt for AI Agents |
||
| }), | ||
|
|
||
| companyLegends: z | ||
|
|
||
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.
Clarify the zero-cliff semantics.
cliffMonths = 0means “no cliff”, not necessarily immediate vesting whenvestingMonthsis still positive. Keep “immediate vesting” onvestingMonths = 0only.Proposed wording fix
Also applies to: 745-746
🤖 Prompt for AI Agents