Skip to content

Commit

Permalink
Merge pull request #174 from haseebzaki-07/new_branch_3
Browse files Browse the repository at this point in the history
Added Station Schema : Fixes issue #159
  • Loading branch information
dhairyagothi authored Oct 10, 2024
2 parents 96f405b + dde6aee commit 19b9f99
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions backend/models/Stations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import mongoose from "mongoose";

const Schema = mongoose.Schema;

const stationSchema = new Schema(
{
name: {
type: String,
required: true,
trim: true,
},
location: {
type: {
postalCode: {
type: Number,
required: true,
trim: true,
},
city: {
type: String,
required: true,
trim: true,
},
state: {
type: String,
required: true,
trim: true,
},
},
required: true,
},
stationCode: {
type: String,
required: true,
trim: true,
unique: true,
},
capacity: {
type: Number,
required: true,
},
services: {
type: [String], // An array to list services like cloakroom, parking, restrooms, etc.
required: true,
},
},
{
timestamps: true,
}
);

const Station = mongoose.model("Station", stationSchema);
export default Station;

0 comments on commit 19b9f99

Please sign in to comment.