@the-inkwell/shared 0.1.164 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/dist/src/constants.js +276 -0
- package/dist/src/schema/admin/actions/index.js +32 -0
- package/dist/src/schema/admin/campaigns/index.js +68 -0
- package/dist/src/schema/admin/candidacies/index.js +83 -0
- package/dist/src/schema/admin/clients/index.js +30 -0
- package/dist/src/schema/admin/educations/index.js +23 -0
- package/dist/src/schema/admin/experiences/index.js +37 -0
- package/dist/src/schema/admin/files/index.js +7 -0
- package/dist/src/{types/models → schema}/admin/index.js +18 -1
- package/dist/src/schema/admin/jobFunctions/index.js +32 -0
- package/dist/src/schema/admin/listViews/index.js +22 -0
- package/dist/src/schema/admin/locations/index.js +16 -0
- package/dist/src/schema/admin/messages/index.js +51 -0
- package/dist/src/schema/admin/notes/index.js +27 -0
- package/dist/src/schema/admin/partners/index.js +25 -0
- package/dist/src/schema/admin/persons/index.js +194 -0
- package/dist/src/schema/admin/personsToBestPersons/index.js +18 -0
- package/dist/src/schema/admin/personsToSkills/index.js +18 -0
- package/dist/src/schema/admin/personsToTags/index.js +18 -0
- package/dist/src/schema/admin/positions/index.js +58 -0
- package/dist/src/schema/admin/positionsToSkills/index.js +18 -0
- package/dist/src/schema/admin/positionsToTags/index.js +18 -0
- package/dist/src/schema/admin/referrals/index.js +64 -0
- package/dist/src/schema/admin/referralsToMessages/index.js +55 -0
- package/dist/src/schema/admin/senders/index.js +16 -0
- package/dist/src/schema/admin/sendgrid/index.js +10 -0
- package/dist/src/schema/admin/settings/index.js +21 -0
- package/dist/src/schema/admin/skills/index.js +32 -0
- package/dist/src/schema/admin/tags/index.js +29 -0
- package/dist/src/schema/admin/websiteLandingPages/index.js +16 -0
- package/dist/src/schema/admin/websiteStaticPages/index.js +16 -0
- package/dist/src/schema/auth/index.js +11 -0
- package/dist/src/schema/core.js +1469 -0
- package/dist/src/{types/models → schema}/index.js +1 -1
- package/dist/src/utils.js +16 -0
- package/index.ts +2 -1
- package/package.json +9 -2
- package/src/constants.ts +299 -0
- package/src/schema/admin/actions/index.ts +65 -0
- package/src/schema/admin/campaigns/index.ts +111 -0
- package/src/schema/admin/candidacies/index.ts +138 -0
- package/src/schema/admin/clients/index.ts +65 -0
- package/src/schema/admin/dashboard/index.ts +10 -0
- package/src/schema/admin/educations/index.ts +71 -0
- package/src/schema/admin/experiences/index.ts +87 -0
- package/src/schema/admin/files/index.ts +10 -0
- package/src/schema/admin/index.ts +29 -0
- package/src/schema/admin/jobFunctions/index.ts +79 -0
- package/src/schema/admin/listViews/index.ts +58 -0
- package/src/schema/admin/locations/index.ts +42 -0
- package/src/schema/admin/messages/index.ts +88 -0
- package/src/schema/admin/notes/index.ts +56 -0
- package/src/schema/admin/partners/index.ts +60 -0
- package/src/schema/admin/persons/index.ts +294 -0
- package/src/schema/admin/personsToBestPersons/index.ts +67 -0
- package/src/schema/admin/personsToSkills/index.ts +61 -0
- package/src/schema/admin/personsToTags/index.ts +61 -0
- package/src/schema/admin/positions/index.ts +97 -0
- package/src/schema/admin/positionsToSkills/index.ts +64 -0
- package/src/schema/admin/positionsToTags/index.ts +61 -0
- package/src/schema/admin/referrals/index.ts +100 -0
- package/src/schema/admin/referralsToMessages/index.ts +121 -0
- package/src/schema/admin/senders/index.ts +50 -0
- package/src/schema/admin/sendgrid/index.ts +16 -0
- package/src/schema/admin/settings/index.ts +34 -0
- package/src/schema/admin/skills/index.ts +64 -0
- package/src/schema/admin/tags/index.ts +56 -0
- package/src/schema/admin/websiteLandingPages/index.ts +69 -0
- package/src/schema/admin/websiteStaticPages/index.ts +67 -0
- package/src/schema/auth/index.ts +14 -0
- package/src/schema/core.ts +1906 -0
- package/src/{types/models → schema}/index.ts +1 -1
- package/src/utils.ts +41 -0
- package/README.md +0 -9
- package/dist/src/constants/enums.js +0 -209
- package/dist/src/constants/index.js +0 -17
- package/dist/src/types/_schema/Action.js +0 -4
- package/dist/src/types/_schema/ActionNames.js +0 -4
- package/dist/src/types/_schema/Actions.js +0 -4
- package/dist/src/types/_schema/Admin.js +0 -4
- package/dist/src/types/_schema/Admins.js +0 -4
- package/dist/src/types/_schema/Campaign.js +0 -4
- package/dist/src/types/_schema/CampaignStatuses.js +0 -4
- package/dist/src/types/_schema/CampaignToPosition.js +0 -4
- package/dist/src/types/_schema/Campaigns.js +0 -4
- package/dist/src/types/_schema/CampaignsToPositions.js +0 -4
- package/dist/src/types/_schema/Candidacies.js +0 -4
- package/dist/src/types/_schema/Candidacy.js +0 -4
- package/dist/src/types/_schema/CandidacyFeedback.js +0 -4
- package/dist/src/types/_schema/CandidacyRatingCategories.js +0 -4
- package/dist/src/types/_schema/CandidacyRatingReasons.js +0 -4
- package/dist/src/types/_schema/CandidacyRatingToTag.js +0 -4
- package/dist/src/types/_schema/CandidacyRatings.js +0 -4
- package/dist/src/types/_schema/CandidacyRatingsToTags.js +0 -4
- package/dist/src/types/_schema/CandidacySources.js +0 -4
- package/dist/src/types/_schema/CandidacyStages.js +0 -4
- package/dist/src/types/_schema/CandidacyStatuses.js +0 -4
- package/dist/src/types/_schema/Certifications.js +0 -4
- package/dist/src/types/_schema/Client.js +0 -4
- package/dist/src/types/_schema/ClientStages.js +0 -4
- package/dist/src/types/_schema/ClientStatuses.js +0 -4
- package/dist/src/types/_schema/Clients.js +0 -4
- package/dist/src/types/_schema/Clubs.js +0 -4
- package/dist/src/types/_schema/Contract.js +0 -4
- package/dist/src/types/_schema/Contracts.js +0 -4
- package/dist/src/types/_schema/Conversation.js +0 -4
- package/dist/src/types/_schema/Conversations.js +0 -4
- package/dist/src/types/_schema/EducationDegrees.js +0 -4
- package/dist/src/types/_schema/EducationFields.js +0 -4
- package/dist/src/types/_schema/Educations.js +0 -4
- package/dist/src/types/_schema/EnrichmentSources.js +0 -4
- package/dist/src/types/_schema/Enrichments.js +0 -4
- package/dist/src/types/_schema/Experiences.js +0 -4
- package/dist/src/types/_schema/Genders.js +0 -4
- package/dist/src/types/_schema/Industries.js +0 -4
- package/dist/src/types/_schema/JobFunctions.js +0 -4
- package/dist/src/types/_schema/JobLevels.js +0 -4
- package/dist/src/types/_schema/Jwt.js +0 -4
- package/dist/src/types/_schema/Jwts.js +0 -4
- package/dist/src/types/_schema/ListView.js +0 -4
- package/dist/src/types/_schema/ListViewModels.js +0 -4
- package/dist/src/types/_schema/ListViews.js +0 -4
- package/dist/src/types/_schema/Message.js +0 -4
- package/dist/src/types/_schema/MessageChannels.js +0 -4
- package/dist/src/types/_schema/MessageTemplate.js +0 -4
- package/dist/src/types/_schema/MessageTemplates.js +0 -4
- package/dist/src/types/_schema/Messages.js +0 -4
- package/dist/src/types/_schema/Networks.js +0 -4
- package/dist/src/types/_schema/Note.js +0 -4
- package/dist/src/types/_schema/Notes.js +0 -4
- package/dist/src/types/_schema/Otp.js +0 -4
- package/dist/src/types/_schema/Otps.js +0 -4
- package/dist/src/types/_schema/Partners.js +0 -4
- package/dist/src/types/_schema/Person.js +0 -4
- package/dist/src/types/_schema/PersonCareerLevels.js +0 -4
- package/dist/src/types/_schema/PersonClub.js +0 -4
- package/dist/src/types/_schema/PersonClubs.js +0 -4
- package/dist/src/types/_schema/PersonDegrees.js +0 -4
- package/dist/src/types/_schema/PersonEnrichment.js +0 -4
- package/dist/src/types/_schema/PersonEnrichments.js +0 -4
- package/dist/src/types/_schema/PersonGenders.js +0 -4
- package/dist/src/types/_schema/PersonNetwork.js +0 -4
- package/dist/src/types/_schema/PersonNetworks.js +0 -4
- package/dist/src/types/_schema/PersonSkill.js +0 -4
- package/dist/src/types/_schema/PersonSkills.js +0 -4
- package/dist/src/types/_schema/PersonSources.js +0 -4
- package/dist/src/types/_schema/PersonToBestPerson.js +0 -4
- package/dist/src/types/_schema/PersonToPersonClub.js +0 -4
- package/dist/src/types/_schema/PersonToPersonNetwork.js +0 -4
- package/dist/src/types/_schema/PersonToPersonSkill.js +0 -4
- package/dist/src/types/_schema/PersonToTag.js +0 -4
- package/dist/src/types/_schema/Persons.js +0 -4
- package/dist/src/types/_schema/PersonsToBestPersons.js +0 -4
- package/dist/src/types/_schema/PersonsToCertifications.js +0 -4
- package/dist/src/types/_schema/PersonsToClubs.js +0 -4
- package/dist/src/types/_schema/PersonsToIndustries.js +0 -4
- package/dist/src/types/_schema/PersonsToNetworks.js +0 -4
- package/dist/src/types/_schema/PersonsToPersonClubs.js +0 -4
- package/dist/src/types/_schema/PersonsToPersonNetworks.js +0 -4
- package/dist/src/types/_schema/PersonsToPersonSkills.js +0 -4
- package/dist/src/types/_schema/PersonsToSkills.js +0 -4
- package/dist/src/types/_schema/PersonsToTags.js +0 -4
- package/dist/src/types/_schema/Position.js +0 -4
- package/dist/src/types/_schema/PositionRatingCategories.js +0 -4
- package/dist/src/types/_schema/PositionRatings.js +0 -4
- package/dist/src/types/_schema/PositionStages.js +0 -4
- package/dist/src/types/_schema/PositionStatuses.js +0 -4
- package/dist/src/types/_schema/Positions.js +0 -4
- package/dist/src/types/_schema/PositionsToIndustries.js +0 -4
- package/dist/src/types/_schema/PositionsToPersonSkills.js +0 -4
- package/dist/src/types/_schema/PositionsToSkills.js +0 -4
- package/dist/src/types/_schema/PositionsToTags.js +0 -4
- package/dist/src/types/_schema/PublicSchema.js +0 -4
- package/dist/src/types/_schema/Referral.js +0 -4
- package/dist/src/types/_schema/ReferralPayout.js +0 -4
- package/dist/src/types/_schema/ReferralPayouts.js +0 -4
- package/dist/src/types/_schema/ReferralSources.js +0 -4
- package/dist/src/types/_schema/ReferralToIntroMessage.js +0 -4
- package/dist/src/types/_schema/Referrals.js +0 -4
- package/dist/src/types/_schema/ReferralsToIntroMessages.js +0 -4
- package/dist/src/types/_schema/ReferralsToMessages.js +0 -4
- package/dist/src/types/_schema/Sender.js +0 -4
- package/dist/src/types/_schema/Senders.js +0 -4
- package/dist/src/types/_schema/Skills.js +0 -4
- package/dist/src/types/_schema/Tag.js +0 -4
- package/dist/src/types/_schema/Tags.js +0 -4
- package/dist/src/types/_schema/WebsiteBlock.js +0 -4
- package/dist/src/types/_schema/WebsiteBlocks.js +0 -4
- package/dist/src/types/_schema/WebsiteLandingPage.js +0 -4
- package/dist/src/types/_schema/WebsiteLandingPages.js +0 -4
- package/dist/src/types/_schema/WebsiteStaticPage.js +0 -4
- package/dist/src/types/_schema/WebsiteStaticPages.js +0 -4
- package/dist/src/types/admin/index.js +0 -19
- package/dist/src/types/admin/persons/index.js +0 -2
- package/dist/src/types/admin/website/index.js +0 -2
- package/dist/src/types/auth/index.js +0 -2
- package/dist/src/types/db.js +0 -6
- package/dist/src/types/http/admin/candidacies/index.js +0 -2
- package/dist/src/types/http/admin/index.js +0 -19
- package/dist/src/types/http/admin/persons/index.js +0 -2
- package/dist/src/types/http/admin/website/index.js +0 -2
- package/dist/src/types/http/auth/index.js +0 -2
- package/dist/src/types/http/index.js +0 -19
- package/dist/src/types/http/utils/index.js +0 -2
- package/dist/src/types/index.js +0 -18
- package/dist/src/types/models/admin/campaigns/index.js +0 -2
- package/dist/src/types/models/admin/candidacies/index.js +0 -2
- package/dist/src/types/models/admin/clients/index.js +0 -2
- package/dist/src/types/models/admin/conversations/index.js +0 -2
- package/dist/src/types/models/admin/listViews/index.js +0 -2
- package/dist/src/types/models/admin/locations/index.js +0 -2
- package/dist/src/types/models/admin/messages/index.js +0 -2
- package/dist/src/types/models/admin/partners/index.js +0 -2
- package/dist/src/types/models/admin/persons/index.js +0 -2
- package/dist/src/types/models/admin/positions/index.js +0 -23
- package/dist/src/types/models/admin/referrals/index.js +0 -2
- package/dist/src/types/models/admin/settings/index.js +0 -2
- package/dist/src/types/models/admin/website/_shared.js +0 -2
- package/dist/src/types/models/admin/website/home.js +0 -2
- package/dist/src/types/models/admin/website/index.js +0 -18
- package/dist/src/types/models/admin/website/shared.js +0 -2
- package/dist/src/types/models/auth/index.js +0 -2
- package/dist/src/types/schemas/Database.js +0 -4
- package/dist/src/types/schemas/index.js +0 -23
- package/dist/src/types/schemas/public/Action.js +0 -4
- package/dist/src/types/schemas/public/ActionNames.js +0 -4
- package/dist/src/types/schemas/public/Admin.js +0 -4
- package/dist/src/types/schemas/public/Campaign.js +0 -4
- package/dist/src/types/schemas/public/CampaignStatuses.js +0 -4
- package/dist/src/types/schemas/public/CampaignToPosition.js +0 -4
- package/dist/src/types/schemas/public/Candidacy.js +0 -4
- package/dist/src/types/schemas/public/CandidacyFeedback.js +0 -4
- package/dist/src/types/schemas/public/CandidacyRatingToTag.js +0 -4
- package/dist/src/types/schemas/public/CandidacySources.js +0 -4
- package/dist/src/types/schemas/public/CandidacyStatuses.js +0 -4
- package/dist/src/types/schemas/public/Client.js +0 -4
- package/dist/src/types/schemas/public/ClientStatuses.js +0 -4
- package/dist/src/types/schemas/public/Contract.js +0 -4
- package/dist/src/types/schemas/public/Conversation.js +0 -4
- package/dist/src/types/schemas/public/EnrichmentSources.js +0 -4
- package/dist/src/types/schemas/public/Jwt.js +0 -4
- package/dist/src/types/schemas/public/ListView.js +0 -4
- package/dist/src/types/schemas/public/ListViewModels.js +0 -4
- package/dist/src/types/schemas/public/Message.js +0 -4
- package/dist/src/types/schemas/public/MessageChannels.js +0 -4
- package/dist/src/types/schemas/public/MessageSender.js +0 -4
- package/dist/src/types/schemas/public/MessageTemplate.js +0 -4
- package/dist/src/types/schemas/public/Note.js +0 -4
- package/dist/src/types/schemas/public/Otp.js +0 -4
- package/dist/src/types/schemas/public/Person.js +0 -4
- package/dist/src/types/schemas/public/PersonCareerLevels.js +0 -4
- package/dist/src/types/schemas/public/PersonClub.js +0 -4
- package/dist/src/types/schemas/public/PersonDegrees.js +0 -4
- package/dist/src/types/schemas/public/PersonEnrichment.js +0 -4
- package/dist/src/types/schemas/public/PersonGenders.js +0 -4
- package/dist/src/types/schemas/public/PersonNetwork.js +0 -4
- package/dist/src/types/schemas/public/PersonSkill.js +0 -4
- package/dist/src/types/schemas/public/PersonSources.js +0 -4
- package/dist/src/types/schemas/public/PersonToBestPerson.js +0 -4
- package/dist/src/types/schemas/public/PersonToPersonClub.js +0 -4
- package/dist/src/types/schemas/public/PersonToPersonNetwork.js +0 -4
- package/dist/src/types/schemas/public/PersonToPersonSkill.js +0 -4
- package/dist/src/types/schemas/public/PersonToTag.js +0 -4
- package/dist/src/types/schemas/public/Position.js +0 -4
- package/dist/src/types/schemas/public/PositionStatuses.js +0 -4
- package/dist/src/types/schemas/public/PrismaMigrations.js +0 -4
- package/dist/src/types/schemas/public/PublicSchema.js +0 -4
- package/dist/src/types/schemas/public/Referral.js +0 -4
- package/dist/src/types/schemas/public/ReferralPayout.js +0 -4
- package/dist/src/types/schemas/public/ReferralSources.js +0 -4
- package/dist/src/types/schemas/public/ReferralToIntroMessage.js +0 -4
- package/dist/src/types/schemas/public/Sender.js +0 -4
- package/dist/src/types/schemas/public/Tag.js +0 -4
- package/dist/src/types/schemas/public/WebsiteBlock.js +0 -4
- package/dist/src/types/schemas/public/WebsiteLandingPage.js +0 -4
- package/dist/src/types/schemas/public/WebsiteStaticPage.js +0 -4
- package/dist/src/types/shared/index.js +0 -2
- package/dist/src/types/utils/index.js +0 -2
- package/dist/types/admin/index.js +0 -17
- package/dist/types/admin/website/index.js +0 -2
- package/dist/types/index.js +0 -17
- package/src/constants/enums.ts +0 -251
- package/src/constants/index.ts +0 -1
- package/src/types/_schema/ActionNames.ts +0 -11
- package/src/types/_schema/Actions.ts +0 -104
- package/src/types/_schema/Admins.ts +0 -49
- package/src/types/_schema/CampaignStatuses.ts +0 -10
- package/src/types/_schema/Campaigns.ts +0 -76
- package/src/types/_schema/CampaignsToPositions.ts +0 -33
- package/src/types/_schema/Candidacies.ts +0 -77
- package/src/types/_schema/CandidacyFeedback.ts +0 -55
- package/src/types/_schema/CandidacyRatingCategories.ts +0 -12
- package/src/types/_schema/CandidacyRatings.ts +0 -42
- package/src/types/_schema/CandidacySources.ts +0 -11
- package/src/types/_schema/CandidacyStages.ts +0 -14
- package/src/types/_schema/CandidacyStatuses.ts +0 -9
- package/src/types/_schema/Certifications.ts +0 -59
- package/src/types/_schema/ClientStages.ts +0 -12
- package/src/types/_schema/ClientStatuses.ts +0 -9
- package/src/types/_schema/Clients.ts +0 -69
- package/src/types/_schema/Contracts.ts +0 -68
- package/src/types/_schema/EducationDegrees.ts +0 -12
- package/src/types/_schema/EducationFields.ts +0 -18
- package/src/types/_schema/Educations.ts +0 -55
- package/src/types/_schema/EnrichmentSources.ts +0 -8
- package/src/types/_schema/Enrichments.ts +0 -68
- package/src/types/_schema/Experiences.ts +0 -87
- package/src/types/_schema/Genders.ts +0 -11
- package/src/types/_schema/Industries.ts +0 -53
- package/src/types/_schema/JobFunctions.ts +0 -53
- package/src/types/_schema/JobLevels.ts +0 -13
- package/src/types/_schema/Jwts.ts +0 -61
- package/src/types/_schema/ListViewModels.ts +0 -11
- package/src/types/_schema/ListViews.ts +0 -74
- package/src/types/_schema/MessageChannels.ts +0 -9
- package/src/types/_schema/MessageTemplates.ts +0 -53
- package/src/types/_schema/Messages.ts +0 -109
- package/src/types/_schema/Networks.ts +0 -59
- package/src/types/_schema/Notes.ts +0 -76
- package/src/types/_schema/Otps.ts +0 -67
- package/src/types/_schema/Partners.ts +0 -65
- package/src/types/_schema/PersonSources.ts +0 -11
- package/src/types/_schema/Persons.ts +0 -237
- package/src/types/_schema/PersonsToBestPersons.ts +0 -32
- package/src/types/_schema/PersonsToCertifications.ts +0 -26
- package/src/types/_schema/PersonsToNetworks.ts +0 -33
- package/src/types/_schema/PersonsToSkills.ts +0 -33
- package/src/types/_schema/PersonsToTags.ts +0 -33
- package/src/types/_schema/PositionRatingCategories.ts +0 -9
- package/src/types/_schema/PositionRatings.ts +0 -42
- package/src/types/_schema/PositionStages.ts +0 -12
- package/src/types/_schema/PositionStatuses.ts +0 -9
- package/src/types/_schema/Positions.ts +0 -119
- package/src/types/_schema/PositionsToIndustries.ts +0 -33
- package/src/types/_schema/PositionsToSkills.ts +0 -33
- package/src/types/_schema/PositionsToTags.ts +0 -33
- package/src/types/_schema/ReferralPayouts.ts +0 -29
- package/src/types/_schema/ReferralSources.ts +0 -11
- package/src/types/_schema/Referrals.ts +0 -83
- package/src/types/_schema/ReferralsToMessages.ts +0 -40
- package/src/types/_schema/Senders.ts +0 -65
- package/src/types/_schema/Skills.ts +0 -53
- package/src/types/_schema/Tags.ts +0 -53
- package/src/types/_schema/WebsiteBlocks.ts +0 -45
- package/src/types/_schema/WebsiteLandingPages.ts +0 -47
- package/src/types/_schema/WebsiteStaticPages.ts +0 -53
- package/src/types/index.ts +0 -2
- package/src/types/models/admin/campaigns/index.ts +0 -28
- package/src/types/models/admin/candidacies/index.ts +0 -69
- package/src/types/models/admin/clients/index.ts +0 -49
- package/src/types/models/admin/index.ts +0 -12
- package/src/types/models/admin/listViews/index.ts +0 -48
- package/src/types/models/admin/locations/index.ts +0 -28
- package/src/types/models/admin/messages/index.ts +0 -14
- package/src/types/models/admin/partners/index.ts +0 -36
- package/src/types/models/admin/persons/index.ts +0 -90
- package/src/types/models/admin/positions/index.ts +0 -72
- package/src/types/models/admin/referrals/index.ts +0 -67
- package/src/types/models/admin/settings/index.ts +0 -24
- package/src/types/models/admin/website/home.ts +0 -42
- package/src/types/models/admin/website/index.ts +0 -2
- package/src/types/models/admin/website/shared.ts +0 -40
- package/src/types/models/auth/index.ts +0 -6
- package/src/types/utils/index.ts +0 -15
- /package/dist/src/{types/admin/candidacies → schema/admin/dashboard}/index.js +0 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import {
|
|
7
|
+
client,
|
|
8
|
+
education,
|
|
9
|
+
experience,
|
|
10
|
+
industry,
|
|
11
|
+
jobFunction,
|
|
12
|
+
person,
|
|
13
|
+
skill,
|
|
14
|
+
tag
|
|
15
|
+
} from '../../core'
|
|
16
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
17
|
+
import { z } from 'zod/v4'
|
|
18
|
+
import {
|
|
19
|
+
LIST_REQUEST_SORT_DIRECTIONS,
|
|
20
|
+
PERSON_LIST_OPERATORS
|
|
21
|
+
} from '../../../constants'
|
|
22
|
+
import phone from 'phone'
|
|
23
|
+
|
|
24
|
+
//// validators
|
|
25
|
+
|
|
26
|
+
const emailSchema = z.string().trim().toLowerCase().email()
|
|
27
|
+
const phoneSchema = z
|
|
28
|
+
.string()
|
|
29
|
+
.transform((val) => phone(val.trim()).phoneNumber)
|
|
30
|
+
.pipe(z.string().startsWith('+'))
|
|
31
|
+
.nullable()
|
|
32
|
+
|
|
33
|
+
export const AdminPersonEducationSelectSchema = createSelectSchema(education, {
|
|
34
|
+
field: (schema) => schema.describe('Field of study'),
|
|
35
|
+
graduatedAt: z
|
|
36
|
+
.date()
|
|
37
|
+
.nullable()
|
|
38
|
+
.describe('Graduation date, use June 1 if exact date unknown')
|
|
39
|
+
}).pick({
|
|
40
|
+
id: true,
|
|
41
|
+
degree: true,
|
|
42
|
+
field: true,
|
|
43
|
+
school: true,
|
|
44
|
+
graduatedAt: true
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export const AdminPersonExperienceSelectSchema = createSelectSchema(
|
|
48
|
+
experience,
|
|
49
|
+
{
|
|
50
|
+
startDate: z.date().nullable(),
|
|
51
|
+
endDate: z.date().nullable()
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
.pick({
|
|
55
|
+
id: true,
|
|
56
|
+
title: true,
|
|
57
|
+
company: true,
|
|
58
|
+
level: true,
|
|
59
|
+
salary: true,
|
|
60
|
+
startDate: true,
|
|
61
|
+
endDate: true,
|
|
62
|
+
isCurrent: true
|
|
63
|
+
})
|
|
64
|
+
.extend({
|
|
65
|
+
jobFunction: z.string().nullable(),
|
|
66
|
+
industry: z.string().nullable()
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
export const AdminPersonCreateSchema = createInsertSchema(person).extend({
|
|
70
|
+
email: emailSchema
|
|
71
|
+
})
|
|
72
|
+
export const AdminPersonSelectSchema = createSelectSchema(person).extend({
|
|
73
|
+
skills: z.array(
|
|
74
|
+
createSelectSchema(skill).pick({
|
|
75
|
+
id: true,
|
|
76
|
+
name: true
|
|
77
|
+
})
|
|
78
|
+
),
|
|
79
|
+
tags: z.array(
|
|
80
|
+
createSelectSchema(tag).pick({
|
|
81
|
+
id: true,
|
|
82
|
+
name: true
|
|
83
|
+
})
|
|
84
|
+
),
|
|
85
|
+
client: createSelectSchema(client).pick({
|
|
86
|
+
id: true,
|
|
87
|
+
name: true
|
|
88
|
+
}),
|
|
89
|
+
educations: z.array(AdminPersonEducationSelectSchema),
|
|
90
|
+
experiences: z.array(AdminPersonExperienceSelectSchema),
|
|
91
|
+
_referralsCount: z.number().nullable().optional(),
|
|
92
|
+
_referredIndustries: z.array(z.string()).nullable().optional(),
|
|
93
|
+
_referredLocations: z.array(z.string()).nullable().optional(),
|
|
94
|
+
_referredSkills: z.array(z.string()).nullable().optional(),
|
|
95
|
+
_currentTitle: z.string().nullable().optional(),
|
|
96
|
+
_currentEmployer: z.string().nullable().optional(),
|
|
97
|
+
_currentSalary: z.number().nullable().optional(),
|
|
98
|
+
_careerLevel: z.number().nullable().optional(),
|
|
99
|
+
_currentJobFunction: z.string().nullable().optional(),
|
|
100
|
+
_currentIndustry: z.string().nullable().optional(),
|
|
101
|
+
_calculatedIsMember: z.boolean().optional(),
|
|
102
|
+
industries: z.array(
|
|
103
|
+
createSelectSchema(industry).pick({
|
|
104
|
+
id: true,
|
|
105
|
+
name: true,
|
|
106
|
+
slug: true
|
|
107
|
+
})
|
|
108
|
+
),
|
|
109
|
+
jobFunctions: z.array(
|
|
110
|
+
createSelectSchema(jobFunction).pick({
|
|
111
|
+
id: true,
|
|
112
|
+
name: true,
|
|
113
|
+
slug: true
|
|
114
|
+
})
|
|
115
|
+
)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
export const AdminPersonUpdateSchema = createUpdateSchema(person).extend({
|
|
119
|
+
email: emailSchema.optional(),
|
|
120
|
+
addedAt: z.coerce.date().optional(),
|
|
121
|
+
phone: phoneSchema.optional()
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
export const AdminPersonParamsSchema = AdminPersonSelectSchema.pick({
|
|
125
|
+
id: true,
|
|
126
|
+
email: true,
|
|
127
|
+
phone: true
|
|
128
|
+
}).partial()
|
|
129
|
+
|
|
130
|
+
export const AdminPersonUpdateParamsSchema = AdminPersonSelectSchema.pick({
|
|
131
|
+
id: true
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
export const AdminPersonDeleteParamsSchema = AdminPersonSelectSchema.pick({
|
|
135
|
+
id: true
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const FilterSchema = z.object({
|
|
139
|
+
field: z.string(),
|
|
140
|
+
isDynamicColumn: z.boolean(),
|
|
141
|
+
operator: z.enum(PERSON_LIST_OPERATORS),
|
|
142
|
+
value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])
|
|
143
|
+
})
|
|
144
|
+
const GeoSchema = z.object({
|
|
145
|
+
operator: z.string(),
|
|
146
|
+
referenceLat: z.number(),
|
|
147
|
+
referenceLon: z.number(),
|
|
148
|
+
radius: z.number()
|
|
149
|
+
})
|
|
150
|
+
const CustomQuerySchema = z.object({
|
|
151
|
+
custom: z.string(),
|
|
152
|
+
value: z.union([z.string(), z.number(), z.boolean(), z.array(z.string())])
|
|
153
|
+
})
|
|
154
|
+
// TODO - add type
|
|
155
|
+
const NestedFilterSchema: z.ZodType<any> = z.lazy(() =>
|
|
156
|
+
z.object({
|
|
157
|
+
and: z
|
|
158
|
+
.array(
|
|
159
|
+
z.union([
|
|
160
|
+
FilterSchema,
|
|
161
|
+
GeoSchema,
|
|
162
|
+
CustomQuerySchema,
|
|
163
|
+
NestedFilterSchema
|
|
164
|
+
])
|
|
165
|
+
)
|
|
166
|
+
.optional(),
|
|
167
|
+
or: z
|
|
168
|
+
.array(
|
|
169
|
+
z.union([
|
|
170
|
+
FilterSchema,
|
|
171
|
+
GeoSchema,
|
|
172
|
+
CustomQuerySchema,
|
|
173
|
+
NestedFilterSchema
|
|
174
|
+
])
|
|
175
|
+
)
|
|
176
|
+
.optional()
|
|
177
|
+
})
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
export const AdminPersonListQuerySchema = ListQuerySchema.extend({
|
|
181
|
+
sort: z
|
|
182
|
+
.array(
|
|
183
|
+
z.object({
|
|
184
|
+
field: z.string(),
|
|
185
|
+
direction: z.enum(LIST_REQUEST_SORT_DIRECTIONS)
|
|
186
|
+
})
|
|
187
|
+
)
|
|
188
|
+
.optional(),
|
|
189
|
+
filter: z
|
|
190
|
+
.union([FilterSchema, GeoSchema, CustomQuerySchema, NestedFilterSchema])
|
|
191
|
+
.optional()
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
export const AdminPersonConnectionsParamsSchema = AdminPersonSelectSchema.pick({
|
|
195
|
+
id: true
|
|
196
|
+
})
|
|
197
|
+
export const AdminPersonConnectionsPersonSchema = AdminPersonSelectSchema.pick({
|
|
198
|
+
id: true,
|
|
199
|
+
email: true,
|
|
200
|
+
fullName: true
|
|
201
|
+
})
|
|
202
|
+
export const AdminPersonConnectionsResultSchema = z.object({
|
|
203
|
+
sourcedPersons: z.array(AdminPersonConnectionsPersonSchema),
|
|
204
|
+
sourcedBy: AdminPersonConnectionsPersonSchema.nullable(),
|
|
205
|
+
bestPersons: z.array(
|
|
206
|
+
z.object({ bestPerson: AdminPersonConnectionsPersonSchema })
|
|
207
|
+
),
|
|
208
|
+
bestiedBy: z.array(
|
|
209
|
+
z.object({ bestiedBy: AdminPersonConnectionsPersonSchema })
|
|
210
|
+
),
|
|
211
|
+
referrals: z.array(
|
|
212
|
+
z.object({
|
|
213
|
+
candidacy: z.object({ person: AdminPersonConnectionsPersonSchema })
|
|
214
|
+
})
|
|
215
|
+
),
|
|
216
|
+
candidacies: z.array(
|
|
217
|
+
z.object({
|
|
218
|
+
referral: z
|
|
219
|
+
.object({ referrer: AdminPersonConnectionsPersonSchema })
|
|
220
|
+
.nullable()
|
|
221
|
+
})
|
|
222
|
+
)
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
//// types
|
|
226
|
+
|
|
227
|
+
type AdminPerson = z.infer<typeof AdminPersonSelectSchema>
|
|
228
|
+
|
|
229
|
+
export type AdminPersonExperienceResult = z.infer<
|
|
230
|
+
typeof AdminPersonExperienceSelectSchema
|
|
231
|
+
>
|
|
232
|
+
export type AdminPersonEducationResult = z.infer<
|
|
233
|
+
typeof AdminPersonEducationSelectSchema
|
|
234
|
+
>
|
|
235
|
+
|
|
236
|
+
// detail
|
|
237
|
+
export type AdminPersonParams = z.infer<typeof AdminPersonParamsSchema>
|
|
238
|
+
export type AdminPersonResult = AdminPerson
|
|
239
|
+
|
|
240
|
+
// list
|
|
241
|
+
export type AdminPersonListQuery = z.infer<typeof AdminPersonListQuerySchema>
|
|
242
|
+
export type AdminPersonListResult = ListResponse<
|
|
243
|
+
z.infer<typeof AdminPersonSelectSchema>
|
|
244
|
+
>
|
|
245
|
+
|
|
246
|
+
// create
|
|
247
|
+
export type AdminPersonCreateInput = z.infer<typeof AdminPersonCreateSchema>
|
|
248
|
+
export type AdminPersonCreateResult = Pick<AdminPerson, 'id'>
|
|
249
|
+
|
|
250
|
+
// update
|
|
251
|
+
export type AdminPersonUpdateParams = z.infer<
|
|
252
|
+
typeof AdminPersonUpdateParamsSchema
|
|
253
|
+
>
|
|
254
|
+
export type AdminPersonUpdateInput = Partial<AdminPerson>
|
|
255
|
+
|
|
256
|
+
// delete
|
|
257
|
+
export type AdminPersonDeleteParams = z.infer<
|
|
258
|
+
typeof AdminPersonDeleteParamsSchema
|
|
259
|
+
>
|
|
260
|
+
|
|
261
|
+
export const ResumeParserSchema = AdminPersonSelectSchema.pick({
|
|
262
|
+
firstName: true,
|
|
263
|
+
lastName: true,
|
|
264
|
+
email: true,
|
|
265
|
+
phone: true,
|
|
266
|
+
city: true,
|
|
267
|
+
state: true,
|
|
268
|
+
country: true,
|
|
269
|
+
gender: true,
|
|
270
|
+
linkedInUrl: true,
|
|
271
|
+
websiteUrl: true,
|
|
272
|
+
skills: true,
|
|
273
|
+
experiences: true,
|
|
274
|
+
educations: true
|
|
275
|
+
}).extend({
|
|
276
|
+
skills: z.array(z.string()),
|
|
277
|
+
experiences: z.array(
|
|
278
|
+
AdminPersonExperienceSelectSchema.extend({
|
|
279
|
+
jobFunction: z.string().nullable()
|
|
280
|
+
})
|
|
281
|
+
)
|
|
282
|
+
})
|
|
283
|
+
|
|
284
|
+
export type AdminPersonResumeParseResult = z.infer<typeof ResumeParserSchema>
|
|
285
|
+
|
|
286
|
+
export type AdminPersonConnectionsParams = z.infer<
|
|
287
|
+
typeof AdminPersonConnectionsParamsSchema
|
|
288
|
+
>
|
|
289
|
+
export type AdminPersonConnectionsPerson = z.infer<
|
|
290
|
+
typeof AdminPersonConnectionsPersonSchema
|
|
291
|
+
>
|
|
292
|
+
export type AdminPersonConnectionsResult = z.infer<
|
|
293
|
+
typeof AdminPersonConnectionsResultSchema
|
|
294
|
+
>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import { personToBestPerson } from '../../core'
|
|
7
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
8
|
+
import { z } from 'zod/v4'
|
|
9
|
+
|
|
10
|
+
const defaultParams = {
|
|
11
|
+
bestiedByPersonId: true,
|
|
12
|
+
bestPersonId: true
|
|
13
|
+
} as const
|
|
14
|
+
|
|
15
|
+
//// validators
|
|
16
|
+
|
|
17
|
+
export const AdminPersonToBestPersonCreateSchema =
|
|
18
|
+
createInsertSchema(personToBestPerson)
|
|
19
|
+
export const AdminPersonToBestPersonSelectSchema =
|
|
20
|
+
createSelectSchema(personToBestPerson)
|
|
21
|
+
export const AdminPersonToBestPersonUpdateSchema =
|
|
22
|
+
createUpdateSchema(personToBestPerson)
|
|
23
|
+
|
|
24
|
+
export const AdminPersonToBestPersonParamsSchema =
|
|
25
|
+
AdminPersonToBestPersonSelectSchema.pick(defaultParams)
|
|
26
|
+
export const AdminPersonToBestPersonListQuerySchema = ListQuerySchema
|
|
27
|
+
export const AdminPersonToBestPersonUpdateParamsSchema =
|
|
28
|
+
AdminPersonToBestPersonParamsSchema.pick(defaultParams)
|
|
29
|
+
export const AdminPersonToBestPersonDeleteParamsSchema =
|
|
30
|
+
AdminPersonToBestPersonParamsSchema.pick(defaultParams)
|
|
31
|
+
|
|
32
|
+
//// types
|
|
33
|
+
|
|
34
|
+
type AdminPersonToBestPerson = z.infer<
|
|
35
|
+
typeof AdminPersonToBestPersonSelectSchema
|
|
36
|
+
>
|
|
37
|
+
|
|
38
|
+
// detail
|
|
39
|
+
export type AdminPersonToBestPersonParams = z.infer<
|
|
40
|
+
typeof AdminPersonToBestPersonParamsSchema
|
|
41
|
+
>
|
|
42
|
+
export type AdminPersonToBestPersonResult = AdminPersonToBestPerson
|
|
43
|
+
|
|
44
|
+
// list
|
|
45
|
+
export type AdminPersonToBestPersonListQuery = z.infer<
|
|
46
|
+
typeof AdminPersonToBestPersonListQuerySchema
|
|
47
|
+
>
|
|
48
|
+
export type AdminPersonToBestPersonListResult = ListResponse<
|
|
49
|
+
z.infer<typeof AdminPersonToBestPersonSelectSchema>
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
// create
|
|
53
|
+
export type AdminPersonToBestPersonCreateInput = z.infer<
|
|
54
|
+
typeof AdminPersonToBestPersonCreateSchema
|
|
55
|
+
>
|
|
56
|
+
|
|
57
|
+
// update
|
|
58
|
+
export type AdminPersonToBestPersonUpdateParams = z.infer<
|
|
59
|
+
typeof AdminPersonToBestPersonUpdateParamsSchema
|
|
60
|
+
>
|
|
61
|
+
export type AdminPersonToBestPersonUpdateInput =
|
|
62
|
+
Partial<AdminPersonToBestPerson>
|
|
63
|
+
|
|
64
|
+
// delete
|
|
65
|
+
export type AdminPersonToBestPersonDeleteParams = z.infer<
|
|
66
|
+
typeof AdminPersonToBestPersonDeleteParamsSchema
|
|
67
|
+
>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import { personToSkill } from '../../core'
|
|
7
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
8
|
+
import { z } from 'zod/v4'
|
|
9
|
+
|
|
10
|
+
const defaultParams = {
|
|
11
|
+
personId: true,
|
|
12
|
+
skillId: true
|
|
13
|
+
} as const
|
|
14
|
+
|
|
15
|
+
//// validators
|
|
16
|
+
|
|
17
|
+
export const AdminPersonToSkillCreateSchema = createInsertSchema(personToSkill)
|
|
18
|
+
export const AdminPersonToSkillSelectSchema = createSelectSchema(personToSkill)
|
|
19
|
+
export const AdminPersonToSkillUpdateSchema = createUpdateSchema(personToSkill)
|
|
20
|
+
|
|
21
|
+
export const AdminPersonToSkillParamsSchema =
|
|
22
|
+
AdminPersonToSkillSelectSchema.pick(defaultParams)
|
|
23
|
+
export const AdminPersonToSkillListQuerySchema = ListQuerySchema
|
|
24
|
+
export const AdminPersonToSkillUpdateParamsSchema =
|
|
25
|
+
AdminPersonToSkillParamsSchema.pick(defaultParams)
|
|
26
|
+
export const AdminPersonToSkillDeleteParamsSchema =
|
|
27
|
+
AdminPersonToSkillParamsSchema.pick(defaultParams)
|
|
28
|
+
|
|
29
|
+
//// types
|
|
30
|
+
|
|
31
|
+
type AdminPersonToSkill = z.infer<typeof AdminPersonToSkillSelectSchema>
|
|
32
|
+
|
|
33
|
+
// detail
|
|
34
|
+
export type AdminPersonToSkillParams = z.infer<
|
|
35
|
+
typeof AdminPersonToSkillParamsSchema
|
|
36
|
+
>
|
|
37
|
+
export type AdminPersonToSkillResult = AdminPersonToSkill
|
|
38
|
+
|
|
39
|
+
// list
|
|
40
|
+
export type AdminPersonToSkillListQuery = z.infer<
|
|
41
|
+
typeof AdminPersonToSkillListQuerySchema
|
|
42
|
+
>
|
|
43
|
+
export type AdminPersonToSkillListResult = ListResponse<
|
|
44
|
+
z.infer<typeof AdminPersonToSkillSelectSchema>
|
|
45
|
+
>
|
|
46
|
+
|
|
47
|
+
// create
|
|
48
|
+
export type AdminPersonToSkillCreateInput = z.infer<
|
|
49
|
+
typeof AdminPersonToSkillCreateSchema
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
// update
|
|
53
|
+
export type AdminPersonToSkillUpdateParams = z.infer<
|
|
54
|
+
typeof AdminPersonToSkillUpdateParamsSchema
|
|
55
|
+
>
|
|
56
|
+
export type AdminPersonToSkillUpdateInput = Partial<AdminPersonToSkill>
|
|
57
|
+
|
|
58
|
+
// delete
|
|
59
|
+
export type AdminPersonToSkillDeleteParams = z.infer<
|
|
60
|
+
typeof AdminPersonToSkillDeleteParamsSchema
|
|
61
|
+
>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import { personToTag } from '../../core'
|
|
7
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
8
|
+
import { z } from 'zod/v4'
|
|
9
|
+
|
|
10
|
+
const defaultParams = {
|
|
11
|
+
personId: true,
|
|
12
|
+
tagId: true
|
|
13
|
+
} as const
|
|
14
|
+
|
|
15
|
+
//// validators
|
|
16
|
+
|
|
17
|
+
export const AdminPersonToTagCreateSchema = createInsertSchema(personToTag)
|
|
18
|
+
export const AdminPersonToTagSelectSchema = createSelectSchema(personToTag)
|
|
19
|
+
export const AdminPersonToTagUpdateSchema = createUpdateSchema(personToTag)
|
|
20
|
+
|
|
21
|
+
export const AdminPersonToTagParamsSchema =
|
|
22
|
+
AdminPersonToTagSelectSchema.pick(defaultParams)
|
|
23
|
+
export const AdminPersonToTagListQuerySchema = ListQuerySchema
|
|
24
|
+
export const AdminPersonToTagUpdateParamsSchema =
|
|
25
|
+
AdminPersonToTagParamsSchema.pick(defaultParams)
|
|
26
|
+
export const AdminPersonToTagDeleteParamsSchema =
|
|
27
|
+
AdminPersonToTagParamsSchema.pick(defaultParams)
|
|
28
|
+
|
|
29
|
+
//// types
|
|
30
|
+
|
|
31
|
+
type AdminPersonToTag = z.infer<typeof AdminPersonToTagSelectSchema>
|
|
32
|
+
|
|
33
|
+
// detail
|
|
34
|
+
export type AdminPersonToTagParams = z.infer<
|
|
35
|
+
typeof AdminPersonToTagParamsSchema
|
|
36
|
+
>
|
|
37
|
+
export type AdminPersonToTagResult = AdminPersonToTag
|
|
38
|
+
|
|
39
|
+
// list
|
|
40
|
+
export type AdminPersonToTagListQuery = z.infer<
|
|
41
|
+
typeof AdminPersonToTagListQuerySchema
|
|
42
|
+
>
|
|
43
|
+
export type AdminPersonToTagListResult = ListResponse<
|
|
44
|
+
z.infer<typeof AdminPersonToTagSelectSchema>
|
|
45
|
+
>
|
|
46
|
+
|
|
47
|
+
// create
|
|
48
|
+
export type AdminPersonToTagCreateInput = z.infer<
|
|
49
|
+
typeof AdminPersonToTagCreateSchema
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
// update
|
|
53
|
+
export type AdminPersonToTagUpdateParams = z.infer<
|
|
54
|
+
typeof AdminPersonToTagUpdateParamsSchema
|
|
55
|
+
>
|
|
56
|
+
export type AdminPersonToTagUpdateInput = Partial<AdminPersonToTag>
|
|
57
|
+
|
|
58
|
+
// delete
|
|
59
|
+
export type AdminPersonToTagDeleteParams = z.infer<
|
|
60
|
+
typeof AdminPersonToTagDeleteParamsSchema
|
|
61
|
+
>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import { client, industry, jobFunction, position, skill, tag } from '../../core'
|
|
7
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
8
|
+
import { z } from 'zod/v4'
|
|
9
|
+
|
|
10
|
+
//// validators
|
|
11
|
+
|
|
12
|
+
export const AdminPositionCreateSchema = createInsertSchema(position)
|
|
13
|
+
export const AdminPositionSelectSchema = createSelectSchema(position).extend({
|
|
14
|
+
client: createSelectSchema(client)
|
|
15
|
+
.pick({
|
|
16
|
+
id: true,
|
|
17
|
+
name: true
|
|
18
|
+
})
|
|
19
|
+
.nullable()
|
|
20
|
+
.optional(),
|
|
21
|
+
industry: createSelectSchema(industry)
|
|
22
|
+
.pick({
|
|
23
|
+
id: true,
|
|
24
|
+
name: true
|
|
25
|
+
})
|
|
26
|
+
.nullable(),
|
|
27
|
+
jobFunction: createSelectSchema(jobFunction)
|
|
28
|
+
.pick({
|
|
29
|
+
id: true,
|
|
30
|
+
name: true
|
|
31
|
+
})
|
|
32
|
+
.nullable(),
|
|
33
|
+
skills: z.array(
|
|
34
|
+
createSelectSchema(skill).pick({
|
|
35
|
+
id: true,
|
|
36
|
+
name: true
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
tags: z.array(
|
|
40
|
+
createSelectSchema(tag).pick({
|
|
41
|
+
id: true,
|
|
42
|
+
name: true
|
|
43
|
+
})
|
|
44
|
+
),
|
|
45
|
+
_referralsCount: z.number().optional(),
|
|
46
|
+
_openCandidaciesCount: z.number().optional()
|
|
47
|
+
})
|
|
48
|
+
export const AdminPositionUpdateSchema = createUpdateSchema(position, {
|
|
49
|
+
startedAt: z.coerce.date().nullable().optional(),
|
|
50
|
+
closedAt: z.coerce.date().nullable().optional()
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const AdminPositionParamsSchema = AdminPositionSelectSchema.pick({
|
|
54
|
+
id: true
|
|
55
|
+
})
|
|
56
|
+
export const AdminPositionListQuerySchema = ListQuerySchema.extend({
|
|
57
|
+
filter: z
|
|
58
|
+
.object({
|
|
59
|
+
isClosed: z.boolean().optional(),
|
|
60
|
+
clientId: z.string().optional()
|
|
61
|
+
})
|
|
62
|
+
.partial()
|
|
63
|
+
.optional()
|
|
64
|
+
})
|
|
65
|
+
export const AdminPositionUpdateParamsSchema = AdminPositionParamsSchema
|
|
66
|
+
export const AdminPositionDeleteParamsSchema = AdminPositionParamsSchema
|
|
67
|
+
|
|
68
|
+
//// types
|
|
69
|
+
|
|
70
|
+
type AdminPosition = z.infer<typeof AdminPositionSelectSchema>
|
|
71
|
+
|
|
72
|
+
// detail
|
|
73
|
+
export type AdminPositionParams = z.infer<typeof AdminPositionParamsSchema>
|
|
74
|
+
export type AdminPositionResult = AdminPosition
|
|
75
|
+
|
|
76
|
+
// list
|
|
77
|
+
export type AdminPositionListQuery = z.infer<
|
|
78
|
+
typeof AdminPositionListQuerySchema
|
|
79
|
+
>
|
|
80
|
+
export type AdminPositionListResult = ListResponse<
|
|
81
|
+
z.infer<typeof AdminPositionSelectSchema>
|
|
82
|
+
>
|
|
83
|
+
|
|
84
|
+
// create
|
|
85
|
+
export type AdminPositionCreateInput = z.infer<typeof AdminPositionCreateSchema>
|
|
86
|
+
export type AdminPositionCreateResult = Pick<AdminPosition, 'id'>
|
|
87
|
+
|
|
88
|
+
// update
|
|
89
|
+
export type AdminPositionUpdateParams = z.infer<
|
|
90
|
+
typeof AdminPositionUpdateParamsSchema
|
|
91
|
+
>
|
|
92
|
+
export type AdminPositionUpdateInput = z.infer<typeof AdminPositionUpdateSchema>
|
|
93
|
+
|
|
94
|
+
// delete
|
|
95
|
+
export type AdminPositionDeleteParams = z.infer<
|
|
96
|
+
typeof AdminPositionDeleteParamsSchema
|
|
97
|
+
>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import { positionToSkill } from '../../core'
|
|
7
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
8
|
+
import { z } from 'zod/v4'
|
|
9
|
+
|
|
10
|
+
const defaultParams = {
|
|
11
|
+
positionId: true,
|
|
12
|
+
skillId: true
|
|
13
|
+
} as const
|
|
14
|
+
|
|
15
|
+
//// validators
|
|
16
|
+
|
|
17
|
+
export const AdminPositionToSkillCreateSchema =
|
|
18
|
+
createInsertSchema(positionToSkill)
|
|
19
|
+
export const AdminPositionToSkillSelectSchema =
|
|
20
|
+
createSelectSchema(positionToSkill)
|
|
21
|
+
export const AdminPositionToSkillUpdateSchema =
|
|
22
|
+
createUpdateSchema(positionToSkill)
|
|
23
|
+
|
|
24
|
+
export const AdminPositionToSkillParamsSchema =
|
|
25
|
+
AdminPositionToSkillSelectSchema.pick(defaultParams)
|
|
26
|
+
export const AdminPositionToSkillListQuerySchema = ListQuerySchema
|
|
27
|
+
export const AdminPositionToSkillUpdateParamsSchema =
|
|
28
|
+
AdminPositionToSkillParamsSchema.pick(defaultParams)
|
|
29
|
+
export const AdminPositionToSkillDeleteParamsSchema =
|
|
30
|
+
AdminPositionToSkillParamsSchema.pick(defaultParams)
|
|
31
|
+
|
|
32
|
+
//// types
|
|
33
|
+
|
|
34
|
+
type AdminPositionToSkill = z.infer<typeof AdminPositionToSkillSelectSchema>
|
|
35
|
+
|
|
36
|
+
// detail
|
|
37
|
+
export type AdminPositionToSkillParams = z.infer<
|
|
38
|
+
typeof AdminPositionToSkillParamsSchema
|
|
39
|
+
>
|
|
40
|
+
export type AdminPositionToSkillResult = AdminPositionToSkill
|
|
41
|
+
|
|
42
|
+
// list
|
|
43
|
+
export type AdminPositionToSkillListQuery = z.infer<
|
|
44
|
+
typeof AdminPositionToSkillListQuerySchema
|
|
45
|
+
>
|
|
46
|
+
export type AdminPositionToSkillListResult = ListResponse<
|
|
47
|
+
z.infer<typeof AdminPositionToSkillSelectSchema>
|
|
48
|
+
>
|
|
49
|
+
|
|
50
|
+
// create
|
|
51
|
+
export type AdminPositionToSkillCreateInput = z.infer<
|
|
52
|
+
typeof AdminPositionToSkillCreateSchema
|
|
53
|
+
>
|
|
54
|
+
|
|
55
|
+
// update
|
|
56
|
+
export type AdminPositionToSkillUpdateParams = z.infer<
|
|
57
|
+
typeof AdminPositionToSkillUpdateParamsSchema
|
|
58
|
+
>
|
|
59
|
+
export type AdminPositionToSkillUpdateInput = Partial<AdminPositionToSkill>
|
|
60
|
+
|
|
61
|
+
// delete
|
|
62
|
+
export type AdminPositionToSkillDeleteParams = z.infer<
|
|
63
|
+
typeof AdminPositionToSkillDeleteParamsSchema
|
|
64
|
+
>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createInsertSchema,
|
|
3
|
+
createSelectSchema,
|
|
4
|
+
createUpdateSchema
|
|
5
|
+
} from 'drizzle-zod'
|
|
6
|
+
import { positionToTag } from '../../core'
|
|
7
|
+
import { ListQuerySchema, type ListResponse } from '../../../utils'
|
|
8
|
+
import { z } from 'zod/v4'
|
|
9
|
+
|
|
10
|
+
const defaultParams = {
|
|
11
|
+
positionId: true,
|
|
12
|
+
tagId: true
|
|
13
|
+
} as const
|
|
14
|
+
|
|
15
|
+
//// validators
|
|
16
|
+
|
|
17
|
+
export const AdminPositionToTagCreateSchema = createInsertSchema(positionToTag)
|
|
18
|
+
export const AdminPositionToTagSelectSchema = createSelectSchema(positionToTag)
|
|
19
|
+
export const AdminPositionToTagUpdateSchema = createUpdateSchema(positionToTag)
|
|
20
|
+
|
|
21
|
+
export const AdminPositionToTagParamsSchema =
|
|
22
|
+
AdminPositionToTagSelectSchema.pick(defaultParams)
|
|
23
|
+
export const AdminPositionToTagListQuerySchema = ListQuerySchema
|
|
24
|
+
export const AdminPositionToTagUpdateParamsSchema =
|
|
25
|
+
AdminPositionToTagParamsSchema.pick(defaultParams)
|
|
26
|
+
export const AdminPositionToTagDeleteParamsSchema =
|
|
27
|
+
AdminPositionToTagParamsSchema.pick(defaultParams)
|
|
28
|
+
|
|
29
|
+
//// types
|
|
30
|
+
|
|
31
|
+
type AdminPositionToTag = z.infer<typeof AdminPositionToTagSelectSchema>
|
|
32
|
+
|
|
33
|
+
// detail
|
|
34
|
+
export type AdminPositionToTagParams = z.infer<
|
|
35
|
+
typeof AdminPositionToTagParamsSchema
|
|
36
|
+
>
|
|
37
|
+
export type AdminPositionToTagResult = AdminPositionToTag
|
|
38
|
+
|
|
39
|
+
// list
|
|
40
|
+
export type AdminPositionToTagListQuery = z.infer<
|
|
41
|
+
typeof AdminPositionToTagListQuerySchema
|
|
42
|
+
>
|
|
43
|
+
export type AdminPositionToTagListResult = ListResponse<
|
|
44
|
+
z.infer<typeof AdminPositionToTagSelectSchema>
|
|
45
|
+
>
|
|
46
|
+
|
|
47
|
+
// create
|
|
48
|
+
export type AdminPositionToTagCreateInput = z.infer<
|
|
49
|
+
typeof AdminPositionToTagCreateSchema
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
// update
|
|
53
|
+
export type AdminPositionToTagUpdateParams = z.infer<
|
|
54
|
+
typeof AdminPositionToTagUpdateParamsSchema
|
|
55
|
+
>
|
|
56
|
+
export type AdminPositionToTagUpdateInput = Partial<AdminPositionToTag>
|
|
57
|
+
|
|
58
|
+
// delete
|
|
59
|
+
export type AdminPositionToTagDeleteParams = z.infer<
|
|
60
|
+
typeof AdminPositionToTagDeleteParamsSchema
|
|
61
|
+
>
|