2021-08-07 17:03:06 +00:00
|
|
|
//
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
2021-12-15 09:04:43 +00:00
|
|
|
import type { Person } from '@anticrm/contact'
|
|
|
|
import type { Class, Ref, Space, Timestamp } from '@anticrm/core'
|
|
|
|
import type { Asset, Plugin } from '@anticrm/platform'
|
2021-08-07 17:03:06 +00:00
|
|
|
import { plugin } from '@anticrm/platform'
|
2021-12-21 09:42:18 +00:00
|
|
|
import { CreateFn, createKanbanTemplate, KanbanTemplate, KanbanTemplateSpace, SpaceWithStates, Task } from '@anticrm/task'
|
2021-08-07 17:03:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-12-02 09:09:37 +00:00
|
|
|
export interface Vacancy extends SpaceWithStates {
|
|
|
|
fullDescription?: string
|
|
|
|
attachments?: number
|
|
|
|
dueTo?: Timestamp
|
|
|
|
location?: string
|
|
|
|
company?: string
|
|
|
|
}
|
2021-08-07 17:03:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export interface Candidates extends Space {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-08-31 14:54:47 +00:00
|
|
|
export interface Candidate extends Person {
|
2021-09-12 14:47:49 +00:00
|
|
|
title?: string
|
2021-09-26 10:48:15 +00:00
|
|
|
applications?: number
|
2021-10-04 15:46:06 +00:00
|
|
|
onsite?: boolean
|
|
|
|
remote?: boolean
|
2021-11-25 11:18:31 +00:00
|
|
|
source?: string
|
2021-08-31 14:54:47 +00:00
|
|
|
}
|
2021-08-07 17:03:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
2021-12-15 09:04:43 +00:00
|
|
|
export interface Applicant extends Task {
|
2021-10-30 10:13:55 +00:00
|
|
|
attachments?: number
|
2021-11-30 11:14:30 +00:00
|
|
|
comments?: number
|
2021-08-07 17:03:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const recruitId = 'recruit' as Plugin
|
|
|
|
|
2021-12-21 09:42:18 +00:00
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
const recruit = plugin(recruitId, {
|
2021-09-26 09:16:55 +00:00
|
|
|
class: {
|
2021-09-26 10:48:15 +00:00
|
|
|
Applicant: '' as Ref<Class<Applicant>>,
|
2021-11-17 13:34:40 +00:00
|
|
|
Candidate: '' as Ref<Class<Candidate>>,
|
2021-12-02 09:09:37 +00:00
|
|
|
Candidates: '' as Ref<Class<Candidates>>,
|
|
|
|
Vacancy: '' as Ref<Class<Vacancy>>
|
2021-09-26 09:16:55 +00:00
|
|
|
},
|
2021-08-07 17:03:06 +00:00
|
|
|
icon: {
|
|
|
|
RecruitApplication: '' as Asset,
|
2021-12-02 09:09:37 +00:00
|
|
|
Vacancy: '' as Asset,
|
|
|
|
Location: '' as Asset,
|
2021-12-03 09:04:35 +00:00
|
|
|
Calendar: '' as Asset,
|
2021-12-17 09:04:49 +00:00
|
|
|
Create: '' as Asset,
|
|
|
|
Application: '' as Asset
|
2021-12-21 09:42:18 +00:00
|
|
|
},
|
|
|
|
space: {
|
|
|
|
VacancyTemplates: '' as Ref<KanbanTemplateSpace>
|
|
|
|
},
|
|
|
|
template: {
|
|
|
|
DefaultVacancy: '' as Ref<KanbanTemplate>
|
2021-08-07 17:03:06 +00:00
|
|
|
}
|
|
|
|
})
|
2021-12-21 09:42:18 +00:00
|
|
|
|
|
|
|
export default recruit
|
|
|
|
|
|
|
|
const defaultKanban = {
|
|
|
|
states: [
|
|
|
|
{ color: '#7C6FCD', title: 'HR Interview' },
|
|
|
|
{ color: '#6F7BC5', title: 'Technical Interview' },
|
|
|
|
{ color: '#77C07B', title: 'Test task' },
|
|
|
|
{ color: '#A5D179', title: 'Offer' }
|
|
|
|
],
|
|
|
|
doneStates: [
|
|
|
|
{ isWon: true, title: 'Won' },
|
|
|
|
{ isWon: false, title: 'Lost' }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @public
|
|
|
|
*/
|
|
|
|
export const createDefaultKanbanTemplate = async (create: CreateFn): Promise<void> => {
|
|
|
|
await createKanbanTemplate(create)({
|
|
|
|
kanbanId: recruit.template.DefaultVacancy,
|
|
|
|
space: recruit.space.VacancyTemplates,
|
|
|
|
title: 'Default vacancy',
|
|
|
|
states: defaultKanban.states,
|
|
|
|
doneStates: defaultKanban.doneStates
|
|
|
|
})
|
|
|
|
}
|