-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding reservation connected into the webAPI and the confirmation
- Loading branch information
1 parent
2c6eeb7
commit 9bf5297
Showing
12 changed files
with
133 additions
and
105 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
12 changes: 6 additions & 6 deletions
12
...BookingFrontend/src/app/features/reserve-confirmation/reserve-confirmation.component.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<div class="content"> | ||
<h4> <strong>!Gracias, {{reserveConfirmation.Name}} {{reserveConfirmation.LastName}}! </strong></h4> | ||
<h4><strong>Tu reserva en {{reserveConfirmation.Lodging.Name}} ha sido {{reserveConfirmation.DescriptionOfState}} | ||
<h4> <strong>!Gracias, {{reserveConfirmation.name}} {{reserveConfirmation.lastName}}! </strong></h4> | ||
<h4><strong>Tu reserva en {{reserveConfirmation.lodging.name}} ha sido {{reserveConfirmation.descriptionOfState}} | ||
</strong></h4> | ||
<p>Te esperamos a partir del <strong>{{reserveConfirmation.CheckIn | date: 'dd/MM/yyyy'}} </strong> </p> | ||
<p>{{reserveConfirmation.DescriptionForGuest}}</p> | ||
<p>Te esperamos a partir del <strong>{{reserveConfirmation.checkIn | date: 'dd/MM/yyyy'}} </strong> </p> | ||
<p>{{reserveConfirmation.descriptionForGuest}}</p> | ||
<h4>No olvide guardar su codigo de reserva:</h4> | ||
<h6><strong>{{reserveConfirmation.Id}}</strong></h6> | ||
<h6><strong>{{reserveConfirmation.id}}</strong></h6> | ||
<img class="confirmationImage" src="../../assets/img/confirmacion.jpg"> | ||
<h5>Ante cualquier inconveniente no dude en comunicarse:</h5> | ||
<h6>{{reserveConfirmation.PhoneNumberOfContact}}</h6> | ||
<h6>{{reserveConfirmation.phoneNumberOfContact}}</h6> | ||
</div> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,42 +4,27 @@ import { ReserveState } from 'src/app/models/ReserveState'; | |
import { ReserveModelForResponse } from '../../models/ReserveModelForResponse'; | ||
import { DescriptionOfState } from '../../models/ReserveState'; | ||
import { ReserveModelForRequestUpdate } from '../../models/ReserveModelForRequestUpdate'; | ||
import { ReserveModelForRequest } from 'src/app/models/ReserveModelForRequest'; | ||
import { Observable } from 'rxjs'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { environment } from 'src/environments/environment'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class ReserveService { | ||
uri = `${environment.baseUrl}api/reserves`; | ||
|
||
reserveExist(reserveId: string): boolean { | ||
return true; | ||
// this is a call to the ReserveController in the webAPI to get the reserve by the id, | ||
// and in this case if we get a 200 means that reserve exist, in other case not. | ||
} | ||
|
||
getReserveById(reserveId: string): ReserveModelForResponse { | ||
const reserveModel: ReserveModelForResponse = { | ||
Id: '40a749b8-6c68-4705-af8f-25b967b4c7aa', | ||
Name: 'Joaquin', | ||
PhoneNumberOfContact: 244087645, | ||
QuantityOfAdult: 1, | ||
QuantityOfBaby: 2, | ||
QuantityOfChild: 3, | ||
QuantityOfRetired: 4, | ||
TotalPrice: 1240, | ||
LastName: 'Lamela', | ||
Email: '[email protected]', | ||
CheckIn: new Date(), | ||
CheckOut: new Date(), | ||
DescriptionForGuest: 'Lo invitamos a pasar un momento asombroso', | ||
ReserveState: ReserveState.Aceptada, | ||
DescriptionOfState: DescriptionOfState.get(ReserveState.Aceptada), | ||
Lodging: { | ||
Name: 'Hotel Enjoy Conrad', | ||
Address: 'Parada 21, Playa Mansa', | ||
}, | ||
}; | ||
return reserveModel; | ||
// this is a call to the ReserveController in the webAPI to get the reserve by the id, | ||
// and in this case if we get a 200 means that reserve exist and i need to charge info | ||
constructor(private http: HttpClient) {} | ||
|
||
getReserveById(reserveId: string): Observable<ReserveModelForResponse> { | ||
return this.http.get<ReserveModelForResponse>(`${this.uri}/${reserveId}`); | ||
} | ||
|
||
updateReserve( | ||
|
@@ -50,5 +35,12 @@ export class ReserveService { | |
// and return the reserve update in ReserveModelForResponse | ||
} | ||
|
||
constructor() {} | ||
createReserve( | ||
reserveModelForRequest: ReserveModelForRequest | ||
): Observable<ReserveModelForResponse> { | ||
return this.http.post<ReserveModelForResponse>( | ||
this.uri, | ||
reserveModelForRequest | ||
); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...Frontend/Uru_NaturalBookingFrontend/src/app/models/LodgingModelForReserveResponseModel.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export class LodgingModelForReserveResponseModel{ | ||
public Name: string; | ||
public Address: string; | ||
export class LodgingModelForReserveResponseModel { | ||
public name: string; | ||
public address: string; | ||
} |
27 changes: 13 additions & 14 deletions
27
...aturalBookingFrontend/Uru_NaturalBookingFrontend/src/app/models/ReserveModelForRequest.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
export class ReserveModelForRequest { | ||
public name: string; | ||
|
||
public Name: string; | ||
public lastName: string; | ||
|
||
public LastName: string; | ||
public email: string; | ||
|
||
public Email: string; | ||
public checkIn: Date; | ||
|
||
public CheckIn: Date; | ||
public checkOut: Date; | ||
|
||
public CheckOut: Date; | ||
public quantityOfAdult: number; | ||
|
||
public QuantityOfAdult: number; | ||
public quantityOfChild: number; | ||
|
||
public QuantityOfChild: number; | ||
public quantityOfRetired: number; | ||
|
||
public QuantityOfRetired: number; | ||
public quantityOfBaby: number; | ||
|
||
public QuantityOfBaby: number; | ||
public idOfLodgingToReserve: string; | ||
|
||
public IdOfLodgingToReserve: string; | ||
|
||
public constructor(init?: Partial<ReserveModelForRequest>) { | ||
Object.assign(this, init); | ||
} | ||
public constructor(init?: Partial<ReserveModelForRequest>) { | ||
Object.assign(this, init); | ||
} | ||
} |
Oops, something went wrong.