update
This commit is contained in:
@@ -10,13 +10,15 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import java.util.ListIterator;
|
||||
|
||||
import lodge.reservation.IReservation;
|
||||
import lodge.reservation.Reservation;
|
||||
import lodge.reservationsystem.DataRepository;
|
||||
import lodge.reservation.IReservation;
|
||||
|
||||
/**
|
||||
* Concrete account data class for account json storage record.
|
||||
* Collects account attributes, and hash instance to enforce uniqueness.
|
||||
*/
|
||||
public class Account {
|
||||
private String account_number = "-99";
|
||||
private String phone_number;
|
||||
|
||||
@@ -13,8 +13,8 @@ import lodge.data.Account;
|
||||
import lodge.data.AccountList;
|
||||
import lodge.data.Address;
|
||||
import lodge.data.EmailAddress;
|
||||
import lodge.reservation.Reservation;
|
||||
import lodge.reservation.IReservation;
|
||||
import lodge.reservation.Reservation;
|
||||
|
||||
public final class AccomodationManager {
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class AccomodationManager {
|
||||
}
|
||||
|
||||
// Load / Deserialize Account
|
||||
public void load(Path file) throws Exception {
|
||||
protected void load(Path file) throws Exception {
|
||||
|
||||
Account account = DataRepository.LoadAccount(file);
|
||||
if (account == null) {
|
||||
|
||||
@@ -11,6 +11,9 @@ import lodge.data.Address;
|
||||
import lodge.data.KitchenTypeEnum;
|
||||
import lodge.reservation.Reservation;
|
||||
|
||||
/**
|
||||
* Concrete reservation data class for reservation storage record
|
||||
*/
|
||||
public final class CabinReservation extends Reservation {
|
||||
|
||||
public CabinReservation() {
|
||||
@@ -19,7 +22,7 @@ public final class CabinReservation extends Reservation {
|
||||
this.setNumberOfBeds(1);
|
||||
this.setKitchen(KitchenTypeEnum.Kitchenette);
|
||||
}
|
||||
|
||||
|
||||
public CabinReservation(final Address physical_address) {
|
||||
super();
|
||||
this.setType('C');
|
||||
|
||||
@@ -12,7 +12,10 @@ import lodge.data.Address;
|
||||
import lodge.data.KitchenTypeEnum;
|
||||
import lodge.reservation.Reservation;
|
||||
|
||||
public final class HotelReservation extends Reservation{
|
||||
/**
|
||||
* Concrete reservation data class for reservation storage record
|
||||
*/
|
||||
public final class HotelReservation extends Reservation {
|
||||
|
||||
public HotelReservation() {
|
||||
super();
|
||||
@@ -24,9 +27,9 @@ public final class HotelReservation extends Reservation{
|
||||
this.setNumberOfFloors(1);
|
||||
this.setKitchen(KitchenTypeEnum.Kitchenette);
|
||||
}
|
||||
|
||||
|
||||
public static Reservation copy(String reservationType) {
|
||||
return new HotelReservation();
|
||||
return new HotelReservation();
|
||||
}
|
||||
|
||||
public HotelReservation(final Address physical_address) {
|
||||
|
||||
@@ -11,6 +11,9 @@ import lodge.data.Address;
|
||||
import lodge.data.KitchenTypeEnum;
|
||||
import lodge.reservation.Reservation;
|
||||
|
||||
/**
|
||||
* Concrete reservation data class for reservation storage record
|
||||
*/
|
||||
public final class HouseReservation extends Reservation {
|
||||
|
||||
public HouseReservation() {
|
||||
@@ -24,7 +27,7 @@ public final class HouseReservation extends Reservation {
|
||||
}
|
||||
|
||||
public static Reservation copy(String reservationType) {
|
||||
return new HouseReservation();
|
||||
return new HouseReservation();
|
||||
}
|
||||
|
||||
public HouseReservation(final Address physical_address) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "Account":{"account_number": "A1450981765","phone_number": "701-456-7890","mailing_address": { "Address":{"street": "10 wilco ave","city": "wilco","state": "WY","zip": "82801"}},"email_address": { "EmailAddress":{"email": "wilco@wyommin.net"}},"reservations":[{"CabinReservation":{"reservation_number":"R0535276622"}},{"HouseReservation":{"reservation_number":"R0499811708"}},{"CabinReservation":{"reservation_number":"R0535276622"}},{"HouseReservation":{"reservation_number":"R0499811708"}}]}}
|
||||
{ "Account":{"account_number": "A1450981765","phone_number": "701-456-7890","mailing_address": { "Address":{"street": "10 wilco ave","city": "wilco","state": "WY","zip": "82801"}},"email_address": { "EmailAddress":{"email": "wilco@wyommin.net"}},"reservations":[{"CabinReservation":{"reservation_number":"R0535276622"}},{"HouseReservation":{"reservation_number":"R0499811708"}}]}}
|
||||
@@ -1 +1 @@
|
||||
{ "Account":{"account_number": "A2074212339","phone_number": "301-356-3890","mailing_address": { "Address":{"street": "30 Amstadam ave","city": "New York","state": "NY","zip": "12010"}},"email_address": { "EmailAddress":{"email": "newbee952@aol.com"}},"reservations":[{"HotelReservation":{"reservation_number":"R0123087344"}},{"CabinReservation":{"reservation_number":"R2042828431"}},{"HotelReservation":{"reservation_number":"R0123087344"}},{"CabinReservation":{"reservation_number":"R2042828431"}}]}}
|
||||
{ "Account":{"account_number": "A2074212339","phone_number": "301-356-3890","mailing_address": { "Address":{"street": "30 Amstadam ave","city": "New York","state": "NY","zip": "12010"}},"email_address": { "EmailAddress":{"email": "newbee952@aol.com"}},"reservations":[{"HotelReservation":{"reservation_number":"R0123087344"}},{"CabinReservation":{"reservation_number":"R2042828431"}}]}}
|
||||
@@ -1 +1,33 @@
|
||||
{ "HotelReservation":{"reservation_type": "HotelReservation","reservation_number": "R0123087344","reservation_status": "Draft","reservation_start_date": "2025-09-05T10:00Z[UTC]","reservation_end_date": "2025-09-09T10:00Z[UTC]","account_number": "A2074212339","physical_address": { "Address":{"street": "400 hotel ave","city": "Maryland City","state": "MD","zip": "20723"}},"mailing_address": { "Address":{"street": "400 hotel ave","city": "Maryland City","state": "MD","zip": "20723"}},"kitchen": "Kitchenette","numberOfBeds": "2","numberOfBedRooms": "1","numberOfBathRooms": "1","numberOfFloors": "1","squareFeet": "450","price": "410.0"}}
|
||||
{
|
||||
"HotelReservation": {
|
||||
"reservation_type": "HotelReservation",
|
||||
"reservation_number": "R0123087344",
|
||||
"reservation_status": "Canceled",
|
||||
"reservation_start_date": "2025-09-05T10:00Z[UTC]",
|
||||
"reservation_end_date": "2025-09-09T10:00Z[UTC]",
|
||||
"account_number": "A2074212339",
|
||||
"physical_address": {
|
||||
"Address": {
|
||||
"street": "400 hotel ave",
|
||||
"city": "Maryland City",
|
||||
"state": "MD",
|
||||
"zip": "20723"
|
||||
}
|
||||
},
|
||||
"mailing_address": {
|
||||
"Address": {
|
||||
"street": "400 hotel ave",
|
||||
"city": "Maryland City",
|
||||
"state": "MD",
|
||||
"zip": "20723"
|
||||
}
|
||||
},
|
||||
"kitchen": "Kitchenette",
|
||||
"numberOfBeds": "2",
|
||||
"numberOfBedRooms": "1",
|
||||
"numberOfBathRooms": "1",
|
||||
"numberOfFloors": "1",
|
||||
"squareFeet": "450",
|
||||
"price": "410.0"
|
||||
}
|
||||
}
|
||||
@@ -1 +1,33 @@
|
||||
{ "HouseReservation":{"reservation_type": "HouseReservation","reservation_number": "R0499811708","reservation_status": "Draft","reservation_start_date": "2025-09-05T10:00Z[UTC]","reservation_end_date": "2025-09-09T10:00Z[UTC]","account_number": "A1450981765","physical_address": { "Address":{"street": "3000 Osage ave","city": "GreenBelt","state": "MD","zip": "20740"}},"mailing_address": { "Address":{"street": "40012 College ave","city": "College Park","state": "MD","zip": "20740"}},"kitchen": "Kitchenette","numberOfBeds": "2","numberOfBedRooms": "1","numberOfBathRooms": "1","numberOfFloors": "1","squareFeet": "450","price": "360.0"}}
|
||||
{
|
||||
"HouseReservation": {
|
||||
"reservation_type": "HouseReservation",
|
||||
"reservation_number": "R0499811708",
|
||||
"reservation_status": "Draft",
|
||||
"reservation_start_date": "2025-09-05T10:00Z[UTC]",
|
||||
"reservation_end_date": "2025-09-09T10:00Z[UTC]",
|
||||
"account_number": "A1450981765",
|
||||
"physical_address": {
|
||||
"Address": {
|
||||
"street": "3000 Osage ave",
|
||||
"city": "GreenBelt",
|
||||
"state": "MD",
|
||||
"zip": "20740"
|
||||
}
|
||||
},
|
||||
"mailing_address": {
|
||||
"Address": {
|
||||
"street": "40012 College ave",
|
||||
"city": "College Park",
|
||||
"state": "MD",
|
||||
"zip": "20740"
|
||||
}
|
||||
},
|
||||
"kitchen": "Kitchenette",
|
||||
"numberOfBeds": "2",
|
||||
"numberOfBedRooms": "1",
|
||||
"numberOfBathRooms": "1",
|
||||
"numberOfFloors": "1",
|
||||
"squareFeet": "450",
|
||||
"price": "360.0"
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
{ "CabinReservation":{"reservation_type": "CabinReservation","reservation_number": "R0535276622","reservation_status": "Draft","reservation_start_date": "2025-09-05T10:00Z[UTC]","reservation_end_date": "2025-09-09T10:00Z[UTC]","account_number": "A1450981765","physical_address": { "Address":{"street": "40 cabin ave","city": "Carnelian","state": "CA","zip": "96140"}},"mailing_address": { "Address":{"street": "40 cabin ave","city": "Carnelian Bay","state": "CA","zip": "96140"}},"kitchen": "Kitchenette","numberOfBeds": "2","numberOfBedRooms": "1","numberOfBathRooms": "1","numberOfFloors": "1","squareFeet": "450","price": "360.0"}}
|
||||
{ "CabinReservation":{"reservation_type": "CabinReservation","reservation_number": "R0535276622","reservation_status": "Completed","reservation_start_date": "2025-09-05T10:00Z[UTC]","reservation_end_date": "2025-09-09T10:00Z[UTC]","account_number": "A1450981765","physical_address": { "Address":{"street": "40 cabin ave","city": "Carnelian","state": "CA","zip": "96140"}},"mailing_address": { "Address":{"street": "40 cabin ave","city": "Carnelian Bay","state": "CA","zip": "96140"}},"kitchen": "Kitchenette","numberOfBeds": "2","numberOfBedRooms": "1","numberOfBathRooms": "1","numberOfFloors": "1","squareFeet": "450","price": "360.0"}}
|
||||
Reference in New Issue
Block a user