/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.vinet.data;

import java.time.Instant;

public class IsolateTimeSlot extends TimeSlot {

  public IsolateTimeSlot(Instant start, Instant end, Isolate isolate) {
    super(start, end, isolate);
  }

  public Isolate getIsolate() {
    return (Isolate) registeredUser;
  }
}

@@ -632,253 +632,1634 @@
 ort 
-java.time.Instant;%0A%0Apublic class IsolateTimeSlot extends TimeSlot %7B%0A%0A  public IsolateTimeSlot(Instant start, Instant end, Isolate isolate) %7B%0A    super(start, end, isolate);%0A  %7D%0A%0A  public Isolate getIsolate() %7B%0A    return (Isolate) registeredUser
+com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.datastore.Key;%0Aimport java.time.Instant;%0A%0Apublic class IsolateTimeSlot extends TimeSlot implements Datastoreable%3CIsolateTimeSlot%3E%7B%0A  protected static String ISOLATE_TIME_SLOT_TABLE_NAME = %22IsolateTimeSlot%22;%0A%0A  protected final String ticketKey;%0A  protected final DatastoreService datastore;%0A  protected final String date;%0A%0A  public IsolateTimeSlot(Instant start, Instant end, Isolate isolate) %7B%0A    super(start, end, isolate);%0A    this.date = %22%22;%0A    this.ticketKey = %22%22;%0A    this.datastore = DatastoreServiceFactory.getDatastoreService();%0A  %7D%0A%0A  public IsolateTimeSlot(Instant start, Instant end, Isolate isolate, String date, String ticketKey) %7B%0A    super(start, end, isolate);%0A    this.date = date;%0A    this.ticketKey = ticketKey;%0A    this.datastore = DatastoreServiceFactory.getDatastoreService();%0A  %7D%0A%0A  public Isolate getIsolate() %7B%0A    return (Isolate) registeredUser;%0A  %7D%0A%0A  /**%0A   * Put this IsolateTimeSlot into Datstore.%0A   */%0A  @Override%0A  public void toDatastore() %7B%0A    /* TODO: Check that all instance variables are non-null before posting to Datastore. */%0A   final  Entity entity = new Entity(ISOLATE_TIME_SLOT_TABLE_NAME);%0A    entity.setProperty(%22ticketKey%22, ticketKey);%0A    entity.setProperty(%22isolateId%22, this.getIsolate().userId);%0A    entity.setProperty(%22date%22, date);%0A    entity.setProperty(%22startTime%22, start.toString());%0A    entity.setProperty(%22endTime%22, end.toString());%0A    this.datastore.put(entity)
 ;%0A  

update IsolateTimeSlot