-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext
118 lines (113 loc) · 2.3 KB
/
text
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
/* eslint-disable no-trailing-spaces */
/* eslint-disable lines-between-class-members */
/* eslint-disable indent */
/* eslint-disable require-jsdoc */
import { Model, DataTypes } from "sequelize";
import { sequelize } from "../config/sequelize.config";
import User from "./user.model";
export interface ProfileAttributes {
id?: number;
userId?: string;
profileImage?: string;
fullName?: string;
email?: string;
gender?: string;
birthdate?: string;
preferredLanguage?: string;
preferredCurrency?: string;
street?: string;
city?: string;
state?: string;
postalCode?: string;
country?: string;
}
class Profile extends Model<ProfileAttributes> implements ProfileAttributes {
id!: number;
userId!: string;
profileImage!: string;
fullName!: string;
email!: string;
gender!: string;
birthdate!: string;
preferredLanguage!: string;
preferredCurrency!: string;
street!: string;
city!: string;
state!: string;
postalCode!: string;
country!: string;
length: any;
}
Profile.init(
{
id: {
type: DataTypes.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true,
},
userId: {
type: DataTypes.UUID,
references: {
model: "User",
key: "id",
},
allowNull: true,
},
profileImage: {
type: DataTypes.STRING,
allowNull: true,
},
fullName: {
type: DataTypes.STRING,
allowNull: true,
},
email: {
type: DataTypes.STRING,
allowNull: true,
},
gender: {
type: DataTypes.STRING,
allowNull: true,
},
birthdate: {
type: DataTypes.STRING,
allowNull: true,
},
preferredLanguage: {
type: DataTypes.STRING,
allowNull: true,
},
preferredCurrency: {
type: DataTypes.STRING,
allowNull: true,
},
street: {
type: DataTypes.STRING,
allowNull: true,
},
city: {
type: DataTypes.STRING,
allowNull: true,
},
state: {
type: DataTypes.STRING,
allowNull: true,
},
postalCode: {
type: DataTypes.STRING,
allowNull: true,
},
country: {
type: DataTypes.STRING,
allowNull: true,
},
},
{
sequelize,
modelName: "Profile",
tableName: "profiles",
}
);
// Profile.belongsTo(User,)
export default Profile;