use of com.github.drbookings.model.ser.BookingBeanSer in project drbookings by DrBookings.
the class ICalBookingFactory method build.
@Override
public Collection<BookingBeanSer> build() throws IOException {
final Collection<BookingBeanSer> result = new ArrayList<>();
final List<ICalendar> icals = Biweekly.parse(file).all();
for (final ICalendar ical : icals) {
for (final VEvent e : ical.getEvents()) {
try {
result.add(processEvent(e));
} catch (final Exception ex) {
if (logger.isInfoEnabled()) {
logger.info("Failed to process event ", e);
}
// ex.printStackTrace();
}
}
}
return result;
}
use of com.github.drbookings.model.ser.BookingBeanSer in project drbookings by DrBookings.
the class DataStore method transform.
public static BookingBeanSer transform(final BookingBean bb) {
final BookingBeanSer result = new BookingBeanSer();
result.checkInDate = bb.getCheckIn();
result.checkOutDate = bb.getCheckOut();
result.bookingId = bb.getId();
// result.grossEarnings = bb.getGrossEarnings();
result.grossEarningsExpression = bb.getGrossEarningsExpression();
result.guestName = bb.getGuest().getName();
result.roomName = bb.getRoom().getName();
result.source = bb.getBookingOrigin().getName();
result.welcomeMailSend = bb.isWelcomeMailSend();
result.serviceFee = bb.getServiceFee();
result.serviceFeePercent = bb.getServiceFeesPercent();
result.cleaningFees = bb.getCleaningFees();
result.checkInNote = bb.getCheckInNote();
result.paymentDone = bb.isPaymentDone();
result.specialRequestNote = bb.getSpecialRequestNote();
result.checkOutNote = bb.getCheckOutNote();
result.calendarIds = bb.getCalendarIds();
result.dateOfPayment = bb.getDateOfPayment();
result.splitBooking = bb.isSplitBooking();
result.paymentsSoFar = PaymentSer.transform(bb.getPayments());
return result;
}
use of com.github.drbookings.model.ser.BookingBeanSer in project drbookings by DrBookings.
the class Anonymiser method main.
public static void main(final String[] args) throws Exception {
final File file = new File("/home/alex/bookings-anonym.xml");
new BackupCreator().makeBackup(file);
final DataStore ds = new XMLStorage().load(file);
for (final Iterator<BookingBeanSer> it = ds.getBookingsSer().iterator(); it.hasNext(); ) {
final BookingBeanSer bs = it.next();
bs.guestName = new RandomString().ofLength(bs.guestName.length()).toString();
}
for (final Iterator<CleaningBeanSer> it = ds.getCleaningsSer().iterator(); it.hasNext(); ) {
final CleaningBeanSer bs = it.next();
bs.name = new RandomString().ofLength(bs.name.length()).toString();
}
new XMLStorage().save(ds, file);
}
Aggregations