latest
This commit is contained in:
4
bookstore-api/.idea/workspace.xml
generated
4
bookstore-api/.idea/workspace.xml
generated
@@ -930,12 +930,12 @@
|
||||
<workItem from="1486538831944" duration="450000" />
|
||||
<workItem from="1488378219247" duration="650000" />
|
||||
<workItem from="1488461561430" duration="18419000" />
|
||||
<workItem from="1488731165185" duration="12950000" />
|
||||
<workItem from="1488731165185" duration="13962000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="74962000" />
|
||||
<option name="totallyTimeSpent" value="75974000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="0" y="23" width="1280" height="797" extended-state="0" />
|
||||
|
||||
@@ -85,31 +85,31 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="userPayment : ${userPaymentList}">
|
||||
<tr *ngFor="let userPayment : userPaymentList">
|
||||
<td>
|
||||
<input type="radio" name="defaultUserPaymentId" th:value="${userPayment.id}" th:checked="${userPayment.defaultPayment}" />
|
||||
<input type="radio" name="defaultUserPaymentId" [(ngModel)]="userPayment.id" />
|
||||
<span>default</span>
|
||||
</td>
|
||||
<td th:text="${userPayment.cardName}">...</td>
|
||||
<td>{{{userPayment.cardName}}}</td>
|
||||
<td>
|
||||
<a th:href="@{/updateCreditCard(id=${userPayment.id})}"><i
|
||||
<a><i
|
||||
class="fa fa-pencil"></i></a>
|
||||
<a th:href="@{/removeCreditCard(id=${userPayment.id})}"><i
|
||||
<a><i
|
||||
class="fa fa-times"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="btn btn-primary" type="submit">Save</button>
|
||||
<button md-raised-button class="mat-primary" type="submit">Save</button>
|
||||
</form>
|
||||
</md-tab>
|
||||
<md-tab label="Add(Update) Credit Card">
|
||||
<form th:action="@{/addNewCreditCard}" method="post">
|
||||
<div class="bg-info" th:if="${updateUserPaymentInfo}">User info updated.</div>
|
||||
<input hidden="hidden" name="id" th:value="${userPayment.id}" />
|
||||
<form (ngSubmit)="addUpdateCreditCard()" method="post">
|
||||
<div class="bg-info" *ngIf="updateUserPaymentInfo">User info updated.</div>
|
||||
<input hidden="hidden" name="id" [(ngModel)]="userPayment.id" />
|
||||
<div class="form-group">
|
||||
<h5>* Give a name for your card: </h5>
|
||||
<input type="text" class="form-control" id="cardName" placeholder="Card Name" th:name="cardName" required="required" th:value="${userPayment.cardName}" />
|
||||
<input type="text" class="form-control" id="cardName" placeholder="Card Name" name="cardName" required="required" [(ngModel)]="userPayment.cardName" />
|
||||
</div>
|
||||
<!--Billing Address-->
|
||||
<hr/>
|
||||
@@ -118,29 +118,29 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="billingName">* Name</label>
|
||||
<input type="text" class="form-control" id="billingName" placeholder="Recevier Name" th:name="userBillingName" required="required" th:value="${userBilling.userBillingName}" />
|
||||
<input type="text" class="form-control" id="billingName" placeholder="Recevier Name" name="userBillingName" required="required" [(ngModel)]="userBilling.userBillingName" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="billingAddress">* Street Address</label>
|
||||
<input type="text" class="form-control" id="billingAddress" required="required" placeholder="Street Address 1" th:name="userBillingStreet1" th:value="${userBilling.userBillingStreet1}" />
|
||||
<input type="text" class="form-control" id="billingAddress" required="required" placeholder="Street Address 1" name="userBillingStreet1" [(ngModel)]="userBilling.userBillingStreet1" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" placeholder="Street Address 2" th:name="userBillingStreet2" th:value="${userBilling.userBillingStreet2}" />
|
||||
<input type="text" class="form-control" placeholder="Street Address 2" name="userBillingStreet2" [(ngModel)]="userBilling.userBillingStreet2" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label for="billingCity">* City</label>
|
||||
<input type="text" class="form-control" id="billingCity" required="required" placeholder="Your billing shippingAddressCity" th:name="userBillingCity" th:value="${userBilling.userBillingCity}" />
|
||||
<input type="text" class="form-control" id="billingCity" required="required" placeholder="Your billing shippingAddressCity" name="userBillingCity" [(ngModel)]="userBilling.userBillingCity" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label for="billingState">* State</label>
|
||||
<select id="billingState" class="form-control" th:name="userBillingState" th:value="${userBilling.userBillingState}" required="required">
|
||||
<select id="billingState" class="form-control" name="userBillingState" [(ngModel)]="userBilling.userBillingState" required="required">
|
||||
<option value="" disabled="disabled">Please select an option...
|
||||
</option>
|
||||
<option th:each="state : ${stateList}" th:text="${state}" th:selected="(${userBilling.userBillingState}== ${state})">...
|
||||
<option *ngFor="let state : stateList">{{state}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -148,7 +148,7 @@
|
||||
<div class="col-xs-4">
|
||||
<div class="form-group">
|
||||
<label for="billingZipcode">* Zipcode</label>
|
||||
<input type="text" class="form-control" id="billingZipcode" required="required" placeholder="Zipcode" th:name="userBillingZipcode" th:value="${userBilling.userBillingZipcode}" />
|
||||
<input type="text" class="form-control" id="billingZipcode" required="required" placeholder="Zipcode" name="userBillingZipcode" [(ngModel)]="userBilling.userBillingZipcode" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -163,7 +163,7 @@
|
||||
<br/>
|
||||
<div class="form-group">
|
||||
<label for="cardType">* Select Card Type:</label>
|
||||
<select class="form-control" id="cardType" th:name="type" th:value="${userPayment.type}">
|
||||
<select class="form-control" id="cardType" name="type" [(ngModel)]="userPayment.type">
|
||||
<option value="visa">Visa</option>
|
||||
<option value="mastercard">Mastercard</option>
|
||||
<option value="discover">Discover</option>
|
||||
@@ -172,12 +172,12 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cardHolder">* Card Holder</label>
|
||||
<input type="text" class="form-control" id="cardHolder" required="required" placeholder="Card Holder Name" th:name="holderName" th:value="${userPayment.holderName}" />
|
||||
<input type="text" class="form-control" id="cardHolder" required="required" placeholder="Card Holder Name" name="holderName" [(ngModel)]="userPayment.holderName" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cardNumber">* Card Number</label>
|
||||
<div class="input-group">
|
||||
<input required="required" id="cardNumber" type="tel" class="form-control" name="cardNumber" placeholder="Valid Card Number" th:name="cardNumber" th:value="${userPayment.cardNumber}" />
|
||||
<input required="required" id="cardNumber" type="tel" class="form-control" name="cardNumber" placeholder="Valid Card Number" name="cardNumber" [(ngModel)]="userPayment.cardNumber" />
|
||||
<span class="input-group-addon"><i class="fa fa-credit-card"
|
||||
aria-hidden="true"></i></span>
|
||||
</div>
|
||||
@@ -190,7 +190,7 @@
|
||||
<label>* Expiration Date</label>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<select class="form-control" name="expiryMonth" required="required" th:value="${userPayment.expiryMonth}">
|
||||
<select class="form-control" name="expiryMonth" required="required" [(ngModel)]="userPayment.expiryMonth">
|
||||
<option disabled="disabled">
|
||||
--Month--
|
||||
</option>
|
||||
@@ -209,7 +209,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<select class="form-control" name="expiryYear" th:value="${userPayment.expiryYear}">
|
||||
<select class="form-control" name="expiryYear" [(ngModel)]="userPayment.expiryYear">
|
||||
<option disabled="disabled">--Year--
|
||||
</option>
|
||||
<option value="17">2017</option>
|
||||
@@ -233,7 +233,7 @@
|
||||
<div class="col-xs-5 col-md-5 pull-right">
|
||||
<div class="form-group">
|
||||
<label for="cardCVC">CV Code</label>
|
||||
<input id="cardCVC" type="tel" class="form-control" name="cardCVC" placeholder="CVC" th:name="cvc" th:value="${userPayment.cvc}" />
|
||||
<input id="cardCVC" type="tel" class="form-control" name="cardCVC" placeholder="CVC" name="cvc" [(ngModel)]="userPayment.cvc" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,7 @@ export class MyProfileComponent implements OnInit {
|
||||
|
||||
private user: User = new User();
|
||||
|
||||
|
||||
constructor (private loginService: LoginService, private userService: UserService, private router: Router){
|
||||
}
|
||||
|
||||
|
||||
10
store-front/src/app/models/user-billing.ts
Normal file
10
store-front/src/app/models/user-billing.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export class UserBilling {
|
||||
public id: number;
|
||||
public userBillingName: string;
|
||||
public userBillingStreet1: string;
|
||||
public userBillingStreet2: string;
|
||||
public userBillingCity: string;
|
||||
public userBillingState: string;
|
||||
public userBillingCountry: string;
|
||||
public userBillingZipcode: string;
|
||||
}
|
||||
14
store-front/src/app/models/user-payment.ts
Normal file
14
store-front/src/app/models/user-payment.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import {UserBilling} from './user-billing';
|
||||
|
||||
export class UserPayment {
|
||||
public id: number;
|
||||
public type: string;
|
||||
public cardName: string;
|
||||
public cardNumber: string;
|
||||
public expiryMonth: number;
|
||||
public expiryYear: number;
|
||||
public cvc: number;
|
||||
public holderName: string;
|
||||
public defaultPayment: boolean;
|
||||
public userBilling: UserBilling;
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
import {UserPayment} from './user-payment';
|
||||
|
||||
export class User {
|
||||
public id: number;
|
||||
public firstName: string;
|
||||
public lastName: string;
|
||||
public username: string;
|
||||
public password: string;
|
||||
public email: string;
|
||||
public phone: string;
|
||||
public enabled: boolean;
|
||||
public userPaymentList: UserPayment[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user