generated from ThomasF34/admitech-nodejs-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
candidature.ts
119 lines (113 loc) · 3.68 KB
/
candidature.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import db from '../database/config/database';
import { Model, DataTypes, HasManyCreateAssociationMixin, HasManyGetAssociationsMixin } from 'sequelize';
import PastYearExp from './pastyearexp';
import Attachment from './attachment';
class Candidature extends Model {
public id!: number;
public phone!: string;
public draft!: boolean;
public first_name!: string;
public last_name!: string;
public nationnality!: string;
public birth_date!: Date;
public birth_place!: string;
public family_status!: string;
public address!: string;
public postal_code!: string;
public city!: string;
public state!: string;
public bac_name!: string;
public bac_year!: Date;
public bac_mention!: string;
public bac_realname!: string;
public last_facility_name!: string;
public last_facility_address!: string;
public last_facility_postal_code!: string;
public last_facility_city!: string;
public last_facility_state!: string;
public native_lang_name!: string;
public first_lang_name!: string;
public second_lang_name!: string;
public third_lang_name!: string;
public first_lang_level!: string;
public second_lang_level!: string;
public third_lang_level!: string;
public internships!: string;
public travels!: string;
public it_knowledge!: string;
public sports_interests!: string;
public strengths!: string;
public other_apply!: boolean;
public other_apply_name!: string;
public other_apply_place!: string;
public other_apply_apprentise!: boolean;
public candidate_comment!: string;
public admin_comment!: string;
public status!: number;
public branch!: string;
public certified!: boolean;
public certified_at!: Date;
public created_at!: Date;
public updated_at!: Date;
public UserId!: number;
public createAttachment!: HasManyCreateAssociationMixin<Attachment>;
public createExperience!: HasManyCreateAssociationMixin<PastYearExp>;
public getAttachments!: HasManyGetAssociationsMixin<Attachment>;
}
Candidature.init({
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
phone: DataTypes.STRING,
draft: DataTypes.BOOLEAN,
first_name: DataTypes.STRING,
last_name: DataTypes.STRING,
nationnality: DataTypes.STRING,
birth_date: DataTypes.DATEONLY,
birth_place: DataTypes.STRING,
family_status: DataTypes.STRING,
address: DataTypes.STRING,
postal_code: DataTypes.STRING,
city: DataTypes.STRING,
state: DataTypes.STRING,
bac_name: DataTypes.STRING,
bac_year: DataTypes.INTEGER,
bac_mention: DataTypes.STRING,
bac_realname: DataTypes.STRING,
last_facility_name: DataTypes.STRING,
last_facility_address: DataTypes.STRING,
last_facility_postal_code: DataTypes.STRING,
last_facility_city: DataTypes.STRING,
last_facility_state: DataTypes.STRING,
native_lang_name: DataTypes.STRING,
first_lang_name: DataTypes.STRING,
second_lang_name: DataTypes.STRING,
third_lang_name: DataTypes.STRING,
first_lang_level: DataTypes.STRING,
second_lang_level: DataTypes.STRING,
third_lang_level: DataTypes.STRING,
internships: DataTypes.TEXT,
travels: DataTypes.TEXT,
it_knowledge: DataTypes.TEXT,
sports_interests: DataTypes.TEXT,
strengths: DataTypes.TEXT,
other_apply: DataTypes.BOOLEAN,
other_apply_name: DataTypes.STRING,
other_apply_place: DataTypes.STRING,
other_apply_apprentise: DataTypes.BOOLEAN,
candidate_comment: DataTypes.TEXT,
admin_comment: DataTypes.TEXT,
status: DataTypes.INTEGER,
branch: DataTypes.STRING,
certified: DataTypes.BOOLEAN,
certified_at: DataTypes.DATE,
}, {
underscored: true,
timestamps: true,
sequelize: db
});
Candidature.hasMany(PastYearExp, { as: 'experiences' });
Candidature.hasMany(Attachment, { as: 'attachments' });
export = Candidature