Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
9c06b60
Updated Welcome Message
jaltamiranobello Sep 8, 2024
d6a73a0
Added name to README.md file
mneedham01 Oct 29, 2024
a9943e0
Fernanda Testing
jaltamiranobello Oct 29, 2024
2f070cd
name added to read me
nmohamed54321 Oct 29, 2024
ff34f97
Merge pull request #3 from jaltamiranobello/nmohamed
jaltamiranobello Oct 29, 2024
9c5f831
Merge branch 'master' into maggie
jaltamiranobello Oct 29, 2024
31931ba
Merge pull request #2 from jaltamiranobello/maggie
jaltamiranobello Oct 29, 2024
79af37c
Merge branch 'master' into fernanda
jaltamiranobello Oct 29, 2024
5dbf6dd
Merge pull request #1 from jaltamiranobello/fernanda
jaltamiranobello Oct 29, 2024
87b5dab
Added new line
jaltamiranobello Oct 29, 2024
05fedee
Merge pull request #4 from jaltamiranobello/fernanda
jaltamiranobello Oct 29, 2024
c94c576
Testing branch
jaltamiranobello Oct 29, 2024
9c683a1
added name to readme
mmartin-smith Oct 29, 2024
72d8dee
Merge pull request #5 from jaltamiranobello/fernanda
jaltamiranobello Oct 29, 2024
ee9536f
Showing Nafisa
jaltamiranobello Oct 29, 2024
753252f
Merge pull request #6 from jaltamiranobello/fernanda
jaltamiranobello Oct 29, 2024
9d5f301
Merge pull request #7 from jaltamiranobello/Mackenzie
jaltamiranobello Oct 30, 2024
e2a965d
Creating a stub for the station class.
mmartin-smith Oct 30, 2024
65e73f3
Generated controller and views for Users class
mneedham01 Oct 30, 2024
7ce4c6b
Merge pull request #8 from jaltamiranobello/station_basics
jaltamiranobello Oct 31, 2024
12eb229
Merge pull request #9 from jaltamiranobello/maggie
jaltamiranobello Oct 31, 2024
e756e40
Created User Model and User Migration
jaltamiranobello Oct 31, 2024
1db2320
Merge pull request #10 from jaltamiranobello/fernanda
jaltamiranobello Oct 31, 2024
c4c80af
Coded verify_account method within Users controller -- should not be …
mneedham01 Oct 31, 2024
0c53d5b
Create controller for Director class with methods login, register, an…
mneedham01 Nov 2, 2024
2cfee9f
Created Customer database
jaltamiranobello Nov 2, 2024
157ae09
Created directory database
jaltamiranobello Nov 2, 2024
5e6ed11
Changed directory db name
jaltamiranobello Nov 2, 2024
78d4f8e
updated the nameof file for directory db
jaltamiranobello Nov 2, 2024
d5152ee
Updated name for contoller to director
jaltamiranobello Nov 2, 2024
9d0e616
Changed model name to Director
mneedham01 Nov 2, 2024
36f18dd
Continued Model changes, files that weren't added before.
mneedham01 Nov 2, 2024
ba40762
Deleted additional director migration file.
mneedham01 Nov 2, 2024
d635dcb
changes to schema
jaltamiranobello Nov 2, 2024
626288a
Added my name to README
mariaigartua Nov 1, 2024
e9967de
Added my name to README
mariaigartua Nov 2, 2024
e2138ee
Created Bike class and getters
mariaigartua Nov 2, 2024
f006613
Deleted get_battery_percentage
mneedham01 Nov 2, 2024
b6b564f
Updated Bike class and getters
mariaigartua Nov 2, 2024
9084d8a
Create controller for Director class with methods login, register, an…
mneedham01 Nov 2, 2024
1c88dd0
Created Customer database
jaltamiranobello Nov 2, 2024
39297f4
Created draft for login method
jaltamiranobello Nov 3, 2024
df5d78c
Edited verify_email function.
mneedham01 Nov 3, 2024
0ef7e8b
Deleted specification of parameters in functions
mneedham01 Nov 3, 2024
6be5c5d
changed name of verify_email to email_in_database for readability
mneedham01 Nov 3, 2024
3644f05
Created base for register method and added comments to login method
mneedham01 Nov 3, 2024
425e51e
Added comments to login
mneedham01 Nov 3, 2024
98434ec
Create controller for Director class with methods login, register, an…
mneedham01 Nov 2, 2024
4bd64c1
Created Customer database
jaltamiranobello Nov 2, 2024
926d97e
Created Bike class and getters
mariaigartua Nov 2, 2024
9b157b0
Created new method to start homepage and changed the root website
jaltamiranobello Nov 4, 2024
e5f05d9
Update the website root path
jaltamiranobello Nov 4, 2024
aeab05c
Commented out old methods and created a skeleton for loginpage
jaltamiranobello Nov 4, 2024
815d5b5
updating email_in_database method
jaltamiranobello Nov 4, 2024
0e5868b
deleted email_in_database method
jaltamiranobello Nov 4, 2024
f98124e
added validations to the Customer model
mneedham01 Nov 5, 2024
f1aaa1f
added comments to the validations
mneedham01 Nov 5, 2024
b6be992
added methods for registering a new Customer
mneedham01 Nov 5, 2024
d2ac81e
crud-ified the customer controller, adding new and create methods for…
mneedham01 Nov 5, 2024
cedcf67
added destroy action
mneedham01 Nov 5, 2024
f6660b0
added main action in directors controller and corresponding view
mneedham01 Nov 5, 2024
d8a2429
deleted repetitive routes in routes file and outdated actions
mneedham01 Nov 5, 2024
3949628
deleted views for actions that have been deleted
mneedham01 Nov 5, 2024
9748b93
filled in main view with welcome message, adjusted routes for that to…
mneedham01 Nov 5, 2024
9e6fd5c
Created a View Page for new action for Customer class -- Login form
mneedham01 Nov 5, 2024
ed8d823
Edited new page in Directors class to be registration form
mneedham01 Nov 5, 2024
c4ebd3d
Added links to registration and login form on Main page; added routes…
mneedham01 Nov 5, 2024
65ba38c
deleted verify_account and delete_account in Users class
mneedham01 Nov 5, 2024
58f98f4
added pseudocode for login method
mneedham01 Nov 5, 2024
72e4e77
corrected/added pseudocode for both login and register
mneedham01 Nov 5, 2024
d7dfe95
added first name, last name, email
mneedham01 Nov 5, 2024
dd368b3
changed username -> email
mneedham01 Nov 5, 2024
fba11c6
Method that requires specific paramaters to protect customer attributes
jaltamiranobello Nov 5, 2024
49755fc
Created Bike class and getters
mariaigartua Nov 2, 2024
cca5f3b
Created Card Class
mariaigartua Nov 5, 2024
1036eef
Created Card Class
mariaigartua Nov 5, 2024
8460ab4
Created Card Class
mariaigartua Nov 5, 2024
5c9f9d5
Updated Director New View to inlcude passwords as a parameter
jaltamiranobello Nov 5, 2024
899c053
added card migration to my repository
jaltamiranobello Nov 5, 2024
a1cf3e9
added password as a parameter to use in controller for customer
jaltamiranobello Nov 5, 2024
956f75e
added customer create method to instantiate customer objects when the…
jaltamiranobello Nov 5, 2024
b53a770
had the register button display the view for the log in after they ar…
jaltamiranobello Nov 5, 2024
b30cb35
made a method to register user
mneedham01 Nov 6, 2024
92cf0d0
changed routes
mneedham01 Nov 6, 2024
49d73fe
made login link go to the login form
jaltamiranobello Nov 7, 2024
b55af6e
Deleted a link_to from the register button to the customer/new path
jaltamiranobello Nov 7, 2024
ebb3cc0
added comments for understanding route.rb paths with get and post
jaltamiranobello Nov 7, 2024
d8c4acf
added comments that specify where the get and post for login path dir…
jaltamiranobello Nov 7, 2024
f23bda6
Created method login for controller
jaltamiranobello Nov 7, 2024
99c28fe
created view for login in director class to display form that asked f…
jaltamiranobello Nov 7, 2024
693956d
Updated the new view in customer class to serve as registration form
jaltamiranobello Nov 7, 2024
27b6de8
updated register and login paths to correspond to proper views in cus…
jaltamiranobello Nov 7, 2024
0a0f35d
Created method to get paramaters from user privately
jaltamiranobello Nov 7, 2024
edf0ed5
Updated create method to display if user registration was successful
jaltamiranobello Nov 7, 2024
dcd40f9
Changed html text to specify that the view is from the customer class
jaltamiranobello Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ GEM
digest
net-protocol
timeout
nio4r (2.5.8)
nio4r (2.7.4)
nokogiri (1.13.8-arm64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
Expand Down Expand Up @@ -223,6 +223,7 @@ GEM

PLATFORMS
arm64-darwin-20
arm64-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ValetBike
Smith College CSC223: Software Engineering
Group Members: Maggie, Nafisa, Fernanda, Mackenzie, Maria

Smith College CSC223: Software Engineering\
Starter App for ValetBike project

## Environment Configuration
Expand Down
13 changes: 13 additions & 0 deletions app/controllers/bike_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class BikeController < ApplicationController
def get_bike_id
self.bike_id
end

def get_station_id
self.station_id
end

def get_station_name
self.station
end
end
13 changes: 13 additions & 0 deletions app/controllers/card_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CardController < ApplicationController
def remove_card
end

def update_payment
end

def verify_payment
end

def pay
end
end
56 changes: 56 additions & 0 deletions app/controllers/customers_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
class CustomersController < ApplicationController
# the view for this action displays the form to login
def new
end

# processes the parameters of the login form to set current Customer
def create
@customer = Customer.new(customer_params)
if @customer.save
render('create')
else
render('new')
end
# user = User.find_by(username: params(:username))
# if user password is correct
# then set session[:user_id] = user.id
# send confirmation message
# re route to main page
# else, user password is incorrect
# send error message
end

# displays Customer data
def show
end

# the view for this action displays the form to edit Customer
def edit
end

# processes the parameters of the edit form
def update
end

# processes the deletion of account
def destroy
end

def start_trip
end

def end_trip
end

def past_trip_calculations
end

private
def customer_params
params.require(:customer).permit(
:firstName,
:lastName,
:email,
:password)
end
end
27 changes: 27 additions & 0 deletions app/controllers/directors_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class DirectorsController < ApplicationController

# the view for this action is the main page
def main
end

# the view for this action displays the form to register
def new
end

# intakes the parameters from the form to create a new Customer
def create
user = User.create(params[:customer])
if user.valid?
session[:user_id] = user.id
# change to json messaging in the future
puts "Successful Registration"
redirect_to(action: 'main')
else
puts "Unsuccessful Registration"
end
end

def login
end

end
17 changes: 16 additions & 1 deletion app/controllers/stations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,20 @@ class StationsController < ApplicationController
def index
@stations = Station.all.order(identifier: :asc)
end


def has_bike(bike_id)

end

def checkout_bike(bike_id)

end

def return_bike(bike_id)

end

def get_list_of_bikes(station_id)

end
end
2 changes: 2 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class UsersController < ApplicationController
end
2 changes: 2 additions & 0 deletions app/helpers/bike_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module BikeHelper
end
2 changes: 2 additions & 0 deletions app/helpers/card_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module CardHelper
end
2 changes: 2 additions & 0 deletions app/helpers/customers_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module CustomersHelper
end
2 changes: 2 additions & 0 deletions app/helpers/directors_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module DirectorsHelper
end
2 changes: 2 additions & 0 deletions app/helpers/users_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module UsersHelper
end
24 changes: 24 additions & 0 deletions app/models/card.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class Card < ApplicationRecord
# Example methods for the Card model

# Remove the card instance
def remove_card
destroy
end

# Verify the card
def verify
update(verified: true)
end

# Process a payment
def pay(amount)
if card_balance >= amount
update(card_balance: card_balance - amount)
true
else
false
end
end
end

20 changes: 20 additions & 0 deletions app/models/customer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Customer < ApplicationRecord
# email format -- not tested yet
EMAIL_REGEX = /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}\Z/i

# ensures that the Customer has each of these data points
validates_presence_of :identifier,
:firstName,
:lastName,
:email,
:password
# ensures that a customer cannot register if email already exists in database
validates_uniqueness_of :identifier,
:email
# ensures that the email is in the correct format -- not tested yet
validates :email, presence: true,
length: { maximum: 100 },
uniqueness: true,
format: { with: EMAIL_REGEX },
confirmation: true
end
2 changes: 2 additions & 0 deletions app/models/director.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Director < ApplicationRecord
end
2 changes: 2 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class User < ApplicationRecord
end
4 changes: 4 additions & 0 deletions app/views/bike/get_battery_percentage.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Bike#get_battery_percentage</h1>
<p>Find me in app/views/bike/get_battery_percentage.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/bike/get_bike_id.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Bike#get_bike_id</h1>
<p>Find me in app/views/bike/get_bike_id.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/bike/get_station_id.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Bike#get_station_id</h1>
<p>Find me in app/views/bike/get_station_id.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/bike/get_station_name.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Bike#get_station_name</h1>
<p>Find me in app/views/bike/get_station_name.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/card/pay.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Card#pay</h1>
<p>Find me in app/views/card/pay.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/card/remove_card.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Card#remove_card</h1>
<p>Find me in app/views/card/remove_card.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/card/update_payment.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Card#update_payment</h1>
<p>Find me in app/views/card/update_payment.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/card/verify_payment.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Card#verify_payment</h1>
<p>Find me in app/views/card/verify_payment.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/customers/create.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
</div class = "access create">
<h1> You are now registered!</h1>
<%= puts @customer.firstName%>
</div>
4 changes: 4 additions & 0 deletions app/views/customers/end_trip.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Customers#end_trip</h1>
<p>Find me in app/views/customers/end_trip.html.erb</p>
</div>
30 changes: 30 additions & 0 deletions app/views/customers/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
</div class = "access new">
<h1> Welcome to ValetBike</h1>

<p> Testing Registration in Customer Class</p>
<%= form_tag(register_path) do %>
<table summary = "registration">
<tr>
<th><%= label_tag(:firstName) %></th>
<td><%= text_field_tag(:firstName, params[:firstName]) %></td>
</tr>
<tr>
<th><%= label_tag(:lastName) %></th>
<td><%= text_field_tag(:lastName, params[:lastName]) %></td>
<tr>
<th><%= label_tag(:email) %></th>
<td><%= text_field_tag(:email, params[:email]) %></td>
</tr>
</tr>
<tr>
<th><%= label_tag(:password) %></th>
<td><%= password_field_tag(:password, params[:password]) %></td>
</tr>
</table>

<div class="form-buttons">
<%= submit_tag("Register") %>
</div>
<%end%>
</div>

4 changes: 4 additions & 0 deletions app/views/customers/past_trip_calculations.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Customers#past_trip_calculations</h1>
<p>Find me in app/views/customers/past_trip_calculations.html.erb</p>
</div>
4 changes: 4 additions & 0 deletions app/views/customers/start_trip.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Customers#start_trip</h1>
<p>Find me in app/views/customers/start_trip.html.erb</p>
</div>
21 changes: 21 additions & 0 deletions app/views/directors/login.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
</div class = "access login">
<h1> Welcome to ValetBike</h1>

<p> Testing Login</p>
<%= form_tag(login_path) do %>
<table summary = "login">
<tr>
<th><%= label_tag(:email) %></th>
<td><%= text_field_tag(:email, params[:email]) %></td>
</tr>
<tr>
<th><%= label_tag(:password) %></th>
<td><%= password_field_tag(:password, params[:password]) %></td>
</tr>
</table>

<div class="form-buttons">
<%= submit_tag("Log In") %>
</div>
<%end%>
</div>
9 changes: 9 additions & 0 deletions app/views/directors/main.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="page-section flexbox vertical stretch">
<div class="section-inner flexbox vertical stretch">
<div class="section-title">
Welcome to ValetBike, we are happy to help!
</div>
</div>
<li><%= link_to("Register", "/register") %></li>
<li><%= link_to("Login", "/login") %></li>
</div>
30 changes: 30 additions & 0 deletions app/views/directors/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
</div class = "access new">
<h1> Welcome to ValetBike</h1>

<p> Testing Registration</p>
<%= form_tag(register_path) do %>
<table summary = "registration">
<tr>
<th><%= label_tag(:firstName) %></th>
<td><%= text_field_tag(:firstName, params[:firstName]) %></td>
</tr>
<tr>
<th><%= label_tag(:lastName) %></th>
<td><%= text_field_tag(:lastName, params[:lastName]) %></td>
<tr>
<th><%= label_tag(:email) %></th>
<td><%= text_field_tag(:email, params[:email]) %></td>
</tr>
</tr>
<tr>
<th><%= label_tag(:password) %></th>
<td><%= password_field_tag(:password, params[:password]) %></td>
</tr>
</table>

<div class="form-buttons">
<%= submit_tag("Register") %>
</div>
<%end%>
</div>

2 changes: 1 addition & 1 deletion app/views/stations/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="page-section flexbox vertical stretch">
<div class="section-inner flexbox vertical stretch">
<div class="section-title">
Welcome to ValetBike!
Welcome to ValetBike, we are happy to help!
</div>
<div class="flexbox vertical stretch">
<% if @stations.present? %>
Expand Down
Loading