diff --git a/server/src/db/models/CheckIn.ts b/server/src/db/models/CheckIn.ts index 51a899f9e6ff47878c0634950e99bf806077957d..67ef320d6f1da43df72776b42f59652db66a261d 100644 --- a/server/src/db/models/CheckIn.ts +++ b/server/src/db/models/CheckIn.ts @@ -3,24 +3,26 @@ import { DataTypes, Model, Optional , Sequelize} from "sequelize"; interface CheckInAttributes { id: string; - checkin: Date; - checkout: Date; - clientID: string; + startTime: Date; + estimatedEndTime: Date; + email: string; + firstName: string; + lastName: string; + additionalClients: Array<string>; boatID: string; - destination: string; - note: string; } export interface CheckInAttributesInput extends Optional<CheckInAttributes, "id"> { } class CheckIn extends Model<CheckInAttributes, CheckInAttributesInput> implements CheckInAttributes { declare id: string; - declare checkin: Date; - declare checkout: Date; - declare clientID: string; + declare startTime: Date; + declare estimatedEndTime: Date; + declare email: string; + declare firstName: string; + declare lastName: string; + declare additionalClients: Array<string>; declare boatID: string; - declare destination: string; - declare note: string; declare readonly createdAt: Date; declare readonly updatedAt: Date; @@ -35,20 +37,28 @@ export const initCheckIn = async (sequelizeConnection: Sequelize) => { primaryKey: true, allowNull: false, }, - checkin: { + startTime: { type: DataTypes.DATE, allowNull: false, }, - checkout: { + estimatedEndTime: { type: DataTypes.DATE, allowNull: false, }, - clientID: { - type: DataTypes.UUID, - references: { - model: "customer", - key: "id", - }, + email: { + type: new DataTypes.STRING(), + allowNull: false, + }, + firstName: { + type: new DataTypes.STRING(), + allowNull: false, + }, + lastName: { + type: new DataTypes.STRING(), + allowNull: false, + }, + additionalClients: { + type: new DataTypes.ARRAY(DataTypes.STRING), }, boatID: { type: DataTypes.UUID, @@ -57,12 +67,6 @@ export const initCheckIn = async (sequelizeConnection: Sequelize) => { key: "id", }, }, - destination: { - type: new DataTypes.STRING(), - }, - note: { - type: new DataTypes.STRING(), - }, }, { tableName: "checkin",