Last active
January 31, 2024 03:23
-
-
Save dkosoko23/47dda3971955987d97c89388e5cf50c5 to your computer and use it in GitHub Desktop.
Updated Review & Endorsement
This file contains hidden or 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
const Review = sequelize.define('Review', { | |
userId: DataTypes.UUID, | |
providerNPI: DataTypes.BIGINT, | |
ratingFields: DataTypes.JSON, | |
rating: DataTypes.INTEGER, | |
isReported: DataTypes.INTEGER, | |
message: DataTypes.TEXT | |
}, { | |
tableName: 'reviews' | |
}) | |
const Endorsement = sequelize.define('Endorsement', { | |
endorserNPI: DataTypes.BIGINT, | |
endorseeNPI: DataTypes.BIGINT, | |
areas: { | |
type: DataTypes.STRING, | |
get() { | |
const areasString = this.getDataValue('areas'); | |
return areasString ? areasString.split(';') : []; | |
}, | |
set(val) { | |
this.setDataValue('areas', val.join(';')); | |
}, | |
}, | |
isEndorsement: DataTypes.BOOLEAN, | |
message: { | |
type: DataTypes.TEXT, | |
defaultValue: '' | |
}, | |
isReported: DataTypes.INTEGER, | |
anonymous: DataTypes.BOOLEAN, | |
userId: DataTypes.UUID | |
}, { | |
tableName: 'endorsements' | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment