-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
export const ORG_REVIEW_LOCATIONS = ['ONSITE', 'REMOTE', 'HYBRID'] as const; | ||
|
||
export const ORG_REVIEW_TIMEZONES = [ | ||
'ASYNC', | ||
'GMT-12', | ||
'GMT-11', | ||
'GMT-10', | ||
'GMT-09', | ||
'GMT-08', | ||
'GMT-07', | ||
'GMT-06', | ||
'GMT-05', | ||
'GMT-04', | ||
'GMT-03', | ||
'GMT-02', | ||
'GMT-01', | ||
'GMT', | ||
'GMT+01', | ||
'GMT+02', | ||
'GMT+03', | ||
'GMT+04', | ||
'GMT+05', | ||
'GMT+06', | ||
'GMT+07', | ||
'GMT+08', | ||
'GMT+09', | ||
'GMT+10', | ||
'GMT+11', | ||
'GMT+12', | ||
'GMT+13', | ||
'GMT+14', | ||
] as const; | ||
|
||
export const ORG_TEST_IDS = { | ||
ORG_CARD: 'org-card', | ||
} as const; | ||
|
||
export const ORG_RATING_LABELS = { | ||
benefits: 'Benefits' as const, | ||
careerGrowth: 'Career Growth' as const, | ||
diversityInclusion: 'Diversity & Inclusion' as const, | ||
management: 'Management' as const, | ||
product: 'Overall Product' as const, | ||
compensation: 'Compensation' as const, | ||
onboarding: 'Onboarding' as const, | ||
workLifeBalance: 'Work Life Balance' as const, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import { z } from 'zod'; | ||
|
||
import { | ||
fundingRoundSchema, | ||
investorSchema, | ||
jobInfoSchema, | ||
jobInfoTagsSchema, | ||
orgInfoSchema, | ||
projectAllInfoSchema, | ||
} from '@/shared/core/schemas'; | ||
|
||
import { ORG_REVIEW_LOCATIONS, ORG_REVIEW_TIMEZONES } from './constants'; | ||
|
||
export const orgListItemSchema = orgInfoSchema | ||
.pick({ | ||
orgId: true, | ||
name: true, | ||
location: true, | ||
headcountEstimate: true, | ||
logoUrl: true, | ||
aggregateRating: true, | ||
reviewCount: true, | ||
}) | ||
.merge( | ||
z.object({ | ||
url: z.string(), | ||
jobCount: z.number(), | ||
projectCount: z.number(), | ||
lastFundingDate: z.number(), | ||
lastFundingAmount: z.number(), | ||
community: z.array(z.string()), | ||
}), | ||
); | ||
export type OrgListItem = z.infer<typeof orgListItemSchema>; | ||
|
||
export const orgJobSchema = jobInfoSchema | ||
.pick({ | ||
id: true, | ||
title: true, | ||
shortUUID: true, | ||
summary: true, | ||
}) | ||
.merge(jobInfoTagsSchema); | ||
export type OrgJob = z.infer<typeof orgJobSchema>; | ||
|
||
const starRatingSchema = z.number().min(0).max(5).nullable(); | ||
export type StarRating = z.infer<typeof starRatingSchema>; | ||
|
||
export const orgRatingSchema = z.object({ | ||
benefits: starRatingSchema, | ||
careerGrowth: starRatingSchema, | ||
diversityInclusion: starRatingSchema, | ||
management: starRatingSchema, | ||
product: starRatingSchema, | ||
compensation: starRatingSchema, | ||
onboarding: starRatingSchema, | ||
workLifeBalance: starRatingSchema, | ||
}); | ||
export type OrgRating = z.infer<typeof orgRatingSchema>; | ||
|
||
export const orgCompensationSchema = z.object({ | ||
offersTokenAllocation: z.boolean(), | ||
salary: z.number().nullable(), | ||
currency: z.string().nullable(), | ||
}); | ||
export type OrgCompensation = z.infer<typeof orgCompensationSchema>; | ||
|
||
export const orgReviewLocationSchema = z.enum(ORG_REVIEW_LOCATIONS); | ||
export type OrgReviewLocation = z.infer<typeof orgReviewLocationSchema>; | ||
|
||
export const orgReviewTimezoneSchema = z.enum(ORG_REVIEW_TIMEZONES); | ||
export type OrgReviewTimezone = z.infer<typeof orgReviewTimezoneSchema>; | ||
|
||
export const orgStaffReviewSchema = z.object({ | ||
id: z.string().min(1).nullable(), | ||
title: z.string().nullable(), | ||
location: orgReviewLocationSchema.nullable(), | ||
timezone: orgReviewTimezoneSchema.nullable(), | ||
pros: z.string().min(1).max(500).nullable(), | ||
cons: z.string().min(1).max(500).nullable(), | ||
}); | ||
export type OrgStaffReview = z.infer<typeof orgStaffReviewSchema>; | ||
|
||
export const orgReviewSchema = z.object({ | ||
membershipStatus: z.string().min(1).nullable(), | ||
startDate: z.number().nullable(), | ||
endDate: z.number().nullable(), | ||
reviewedTimestamp: z.number().nullable(), | ||
commitCount: z.number().nullable(), | ||
compensation: orgCompensationSchema, | ||
rating: orgRatingSchema, | ||
review: orgStaffReviewSchema, | ||
}); | ||
export type OrgReview = z.infer<typeof orgReviewSchema>; | ||
|
||
export const orgDetailsSchema = z | ||
.object({ | ||
projects: z.array(projectAllInfoSchema), | ||
fundingRounds: z.array(fundingRoundSchema), | ||
investors: z.array(investorSchema), | ||
jobs: z.array(orgJobSchema), | ||
aggregateRating: starRatingSchema, | ||
aggregateRatings: orgRatingSchema, | ||
reviewCount: z.number(), | ||
reviews: z.array(orgReviewSchema.omit({ compensation: true })), | ||
}) | ||
.merge(orgInfoSchema); | ||
export type OrgDetails = z.infer<typeof orgDetailsSchema>; | ||
|
||
export const orgListQueryPageSchema = z.object({ | ||
page: z.number(), | ||
count: z.number(), | ||
total: z.number(), | ||
data: z.array(orgListItemSchema), | ||
}); | ||
export type OrgListQueryPage = z.infer<typeof orgListQueryPageSchema>; |