Skip to end of metadata
Go to start of metadata

A number of people have expressed interest in a CiviCRM booking component. Let's try to get our needs/desires for such a project outlined here:

In a Nutshell

We want a system where configurable "resources" can be reserved, paid for, and then used, by CiviCRM contacts.

We want these bookings to be recorded in CiviCRM and accessible via search, report, contact tab, etc.

Proposed Schema

The "Resource" entity

Sort of a cross between a few other entity types (think "contact" meets "event" meets "activity type") this entity would have the following properties:

  • Name
  • Description
  • Type (preconfigured? configurable? unnecessary?)
  • Price(s)
  • Capacity/units of some sort
  • Limit - how many of these are available at a time?
  • Parent/child relationship to other resources
  • Custom data?  - For example room layout (this may effect capacity)

MM: I was thinking that we could model this as an activity type, e.g. Create a new activity type, call it a Video Camera, and the way of creating a booking is recording an activity of this type.

I was also thinking that we should use Price sets here on the activity/event.  We'd nee to make some price sets time dependent and others one off.

Sgladstone:  I was thinking it may be useful to generalize the "subcontact" type features in CiviCRM. What I had in mind: When a new subcontact type is defined, the parent could be a generic object called "Entity".  Entity's only fields would be name, description, and external id.  Everything else would be custom fields for that particiular contact type.    Also, the current built-in contact types "household", "organization", and "individual" would be decendants of the new "entity" contact type. 

EM To what extent can we re-use event functionality? Conceptually it is much like an event except there is a range of times & an activity is recorded - (based on MM's suggestion which I like). But other things, like payment, pricesets, Capacity are somewhat in common with events.

Coleman: I don't think a resource as we're talking about it is an activity or a contact, and we'll be better served by having it stand on its own rather than trying to make it fit into a mold not made for it.

Oliver: Added some basic custom data examples

Phil B: We offer a discount to groups depending on their status. Public Sector, For-Profit etc pay 100%, 30% discount for charities, 60% for community groups (3 or less staff). If we could associate a discount with an organisation, that would be great. The status of the organisation would have to be verified to stop misuse.

The "Booking" entity

Kind of like "participant" or "activity," this entity records that contact(s) has booked one or more resources

  • Creator CID
  • Target CIDs (the people this booking is for)
  • Creation date
  • Total Price
  • Amount Paid (this maybe shouldn't be a DB column, but can be calculated based on contributions attributed to this entity)
  • Status
  • Notes
  • Custom data

The "Booked Resource" entity

A child of the booking entity, we create one of these for each resource booked, so that more than one resource can be booked (or the same one more than once, like a room from 2-3pm and 7-8pm) in a single booking.

  • Booking ID
  • Start datetime
  • End datetime
  • Resource ID
  • Price
  • setup timetrame
  • teardown timeframe

Sgladstone:  I added the field "permanent/owned" to cover situations where the resource was essentially purchased outright, or is a very long-term arrangement.   This could apply to several situations: The organization has sub-leased a space to a tenant on a long term basis. For example, some organizations rent a section of their building to another organization, where the "tenant" has use of the space for 15 years and may have helped to pay for remodeling the space. 

Coleman: I removed Sgladstone's permanant/owned field, because I think the same thing can be achieved by just leaving end date blank. Correct me if I'm wrong. 

sgladstone: Leaving end date blank in the db is fine, we just need to make sure the user interface makes this fool-proof in that someone should not be able to easily forget to put in an end-date by mistake.  Also there will need to be filters in the search/reporting areas to hide any permanent/owned resources from the calendar, to avoid cluttering up the calendar.

EM I was thinking the booked resource would be a contact. Since in many instances the resources might be people in the DB. People could make specific contact types bookable (now that we will have the ability for people to have multiple types)

sgladstone: I added "setup timeframe" and "teardown timeframe". These would be filled in by the facility admin staff in the following situations: Someone has booked a large room for a complex event, where the organization's  staff needs 25 minutes to setup the tables/chairs/food/etc for the event. The staff also needs 30 minutes after the event to clean up the room.   The person who is making the room reservation would make the booking from 5pm - 7pm, then the staff would fill in the setup and tear down times later based on the complexity of the event details.   So the room would not be available for a different booking until 7:30pm. 

Integration with CiviContribute

I (Coleman) think we need to avoid falling into the trap that the rest of CiviCRM is still struggling out of, where there is a 1-1 relationship between obligations and payments. If we can abstract the payment system so that any number of payments (from any number of contacts) can be attributed to the same booking, then that allows people to pay deposits, pay in installments, get a partial refund, crowdsource, etc.

  • The ability to generate an invoice linked to a contribution page would be wonderful
  • Contributions can be FKed to a booking. This component can ship with a reserved contribution type "Booking Payment"

EM - I would like to look at extending the concept developed for CiviMember whereby an item in a price set can be associated with a membership type. In general I would like to see price sets become the underlying structure for all contributions as maintaing two structures is an over-head. But also, I think pricesets offer much more flexibility - the Room with tea & coffee facilities being a good example.

The U.I.

EM - so 3 parts to the UI, booking form, administration & viewing. Viewing seems to be already discussed as being a tab - with obviously reports as well. Presumably on that tab we'd want to flick between calendar & records view.

Availablity calendar

This shows the availability of each resource. Might be nice to be able to view mutiple resources on one calendar, so you can do things like find out when the two rooms you want to book and the projector are available.

Booking form

Not sure if this is seperate from the calendar at the moment, perhaps it is linked from it.

Use Case Scenarios

Lots of people have different uses in mind for this. Let's briefly outline each one here so we make sure the above is flexible enough to accommodate them all.

Guest Accommodations

Woolman has a few guest houses and cabins. Rooms in a house can be rented separately, or the entire house can be rented as one. So we need a parent=>child relationship between these resources so that if someone books the whole house, each of the rooms inherits the status "reserved" during that time period. We charge individuals per person, per night, and we charge groups per building used. Other amenities can be added, like meals and linen service. We generate an invoice for each group, they pay a security deposit, cleaning fee, etc. These technically aren't resources, but they need to somehow be included in the price.

Meeting room / space booking

Organization has a meeting room that they want to rent out.  They want members of their organization to be able to view availability for the room and to be able to book the room.  There is a price associated with the room, which is an hourly rate.  They might also want to book extras like Tea and Coffee.
Oliver: An added complexity is that room booking hourly rates are often different based upon weekday / evening / weekend rates etc.

Booking a time with a person

The organization has a number of teachers who parents need to schedule meetings with. For example during the week of parent/teacher conferences, there may be 20 teachers and 400 parents. Each parent can book an appointment time with a teacher lasting 15 minutes. The choices would be at 3pm, 3:15pm, 3:30... until the last choice at 7:45pm.

The organization may offer paid tutoring with a set of 5 tutors. The tutors each have a set schedule where the person can sign up for a tutoring session. ( Tutoring sessions may be paid, free or only free for members of the organization) 

In many situations the person booking the tutor is NOT the person being tutored. For example: George Jetson will book and pay for a tutoring appointment on behalf on his son Elroy.  The tutor would need to know that the appointment is with Elroy Jetson. The tutor may not need to know or even care that George booked the appointment. 

Coleman: I don't think this will be a problem. Just book the tutoring for Elroy, and George can pay.

Reserving seats

The organization has a large auditorium with numbered seats. For certain special events, people can purchase a seat for that event.   In some cases, a large donor may own a permanent seat that they sit in every year. Other seats are in flux and can be purchased by different people each year. 

The administrator of the organization would need to quickly identify which seats are available/open for a certain event, or available for an outright permanent purchase. 

In some cases the person who purchased the seats will also be the person occupying/sitting in the seat. However, there will also be many situations where the purchaser is buying a block of 5 seats, where 4 of the 5 seats are occupied by a guest.   

Coleman: I think there's a line somewhere between CiviBooking and CiviEvent. This sounds way over the line to me. But we need to get more clear about these specs and the difference between the two, and possible points of intersection. 

sgladstone: Perhaps a solution would be to create the possibility of an event registration process with a link to a CiviBooking process  For example: A parent registering their child for a school program could also schedule a tutor at the same time.   Or someone sets up a CiviEvent for a large meeting/conference, where they also need to allow self-service registration for the attendees. In this case there is a need to link the CiviEvent to the room that is booked for the event.( There is already a spot on the event config to specify location. This could be enhanced to include room booked for that event.) That way the person setting up the room knows how many chairs to set up, how much food/coffee to set out, etc.      Or if staff reassigns the event to a different room, that would be reflected on the event details.

Another thought I had where there is already overlap is in priceset fields that include a participant limit.  In a sense, those types of priceset fields represent a "resource" that can be consumed. 

Notes/Misc:

Some other projects/products that might give ideas on how bookings are handled:

http://mrbs.sourceforge.net/ (Open Source, PHP)

http://sourceforge.net/projects/phpscheduleit/ (Open Source, PHP)

http://drupal.org/project/merci (Drupal module , MERCi)

http://www.dea.com/Industries/nonprofit/default.aspx  (Commercial product)

Making It Happen

At some point (when these specs seem solid enough to implement) let's consider starting a MIH to fund some paid developer time in addition to all the volunteer work we're committing to. Speaking of which... who's up for putting some time into this?

Oliver: We have some money which we can contribute towards a MIH for this.

Labels:
  1. Oct 12, 2011

    Looking good.

    I'm keen on making a start on this over the next two weeks. Would be great to get some phases in this.  I'm keen to deliver the easy stuff that my client needs initially in a way we can build on in a further phase.

  2. Oct 12, 2011

    Good stuff - use cases for the room & for the person cover the needs I have had expressed to me in the past. I guess where more than one person can attend the question of marking attendance will eventually come up. Lobo's Civi School looked at this in part didn't it?

    1. Oct 12, 2011

      Probably we would just use civiEvent to record attendees.

      Perhaps in the future there can be integration between these two components so bookings can be associated with an event.

  3. Oct 12, 2011

    I've been musing on the suggestion of making the "resource" a contact type. It's a nice idea but needs thinking through. Initial thoughts:

    • Adding a 4th contact type to civicrm would not be trivial. The whole system is kind of hard-wired for the "big 3" (individual, organization, and household)
    • But it would be cool to be able to have resource sub-types, and the model makes sense.
    • If a resource is just another type of contact, then it would make sense to be able to book resources, and just as easily book a person (or an organization)
    • This has come up for me before... an org wanted to keep track of neighborhood fruit trees. No entity type in CiviCRM made sense for that... it's definitely not a person! Having a 4th type of contact could have a million uses.
    1. Oct 14, 2011

      I'm not too keen on the "Resource as contact type" concept. Unless it was completely "hidden" from the end-user, I think it would be quite confusing. Salesforce allows you to define "generic" custom record types - but then you'd still have to build the appropriate workflows around each new entity.

      1. Oct 17, 2011

        Agreed. Let's have a resource be its own entity, as outlined above, and try to get some phases for this project in place.

  4. Oct 19, 2011

    Keep me informed as to how I can contribute.

    1. Oct 20, 2011

      Hey Phil,

      Thanks for the interest in CiviBooking.

      How would you like to help?  If you can tell us a bit more about your skill set and what resources and time you have available, we can definitley find something for you to do.

      Michael

  5. Oct 19, 2011

    hey guys,

    svn.civicrm.org/civicrm/branches/v4.1.booking is where the development is happening.  i'm on irc working on this from now until friday 28 october. please ping me there or via email if you want to join in :)

  6. Oct 20, 2011

    Trying to work out how to integrate this with the work you guys have already done. I wrote this a few years ago and then started developing it in CakePHP, but have never got round to finishing it.

    USER PROCESS - REGISTRATION

    • User registers the following details with site:
      • User chooses a login and password
      • Contact at organisation
      • Organisations Name
      • Organisations Address (don't know whether this would be better under the contact?)
      • A discount rate depending on what kind of organisation they are (small charity, big charity, business etc)
      • Possibly a captcha, but not too sure.
    • The software emails the supervisor to notify them of a new user
    • The supervisor logs on and approves the user or requests evidence of the organisations discount status and sets a suitable payment period.
    • Confirmation email is sent to the new user, clarifying their username.

    USER PROCESS - BOOKING

    • User logs on with login and password
    • User is presented with a calendar (http://arshaw.com/fullcalendar/ or similar), where available bookings are highlighted
    • User clicks on an available booking and is given the chance to make just one booking or to go back to the calendar and make more and whether they want to hire any sub-resources .
    • User can click on a booking they have made to delete it before they confirm
    • User is displayed a list of their bookings and the cost and is asked to confirm.
    • Invoice is emailed to user and is asked to pay within the payment period.
    • Email is sent to supervisor to let them know about new booking.
    • If payment is not made within 2 days of the payment period a reminder email is sent to the user and supervisor.
    • If payment is not made within the payment period, the booking is removed and an email is sent to the user and supervisor.
    • If payment is made within the payment period, the supervisor confirms the booking and a receipt is sent to the organisation.

    SUPERVISOR PROCESS - APPROVING NEW USER

    • Supervisor can choose to look at list of approved, banned and awaiting approval users.
    • Supervisor can change status of each user.
    • Super-Supervisors can also create Supervisors. 

    SUPERVISOR PROCESS - CONFIRMING PAYMENT

    • Supervisor can choose to look at a list of bookings that are: paid, awaiting payment and unpaid/automatically cancelled booking.
    • Supervisor can change the status of the booking, but must refer to the bank statement it appears on.
    • Supervisor can reinstate booking if payment arrives or is promised after payment period has ended.

    SUPERVISOR PROCESS - EXPORTING TO GENERAL LEDGER

    • Sales only hit the journal when they are paid.
    • Supervisor presses a button which lists the total paid for sales for the last 12 months, this number is used in the general ledger of the organisation.
    • Supervisor can press on a month for a breakdown of sales and when they were paid.

    SUPERVISOR PROCESS - CREATING RESOURCES

    • A resource can be a meeting room
    • A sub-resource can be a projector / laptop / flip chart etc (resourceType) but can only be booked with a resource.
    • The number of sub-resources must be stated.
    • The resource has bookable slots defined for it (I don't know how to link the booking slots between the booking and the resource) 
    • The resource has times at which they are unavailable (used for bank holidays and variable opening times).
    • The resource has a name, description and a photo.
  7. Nov 17, 2011

    As Eileen was talking about marking attendance you might be interested in the Make It Happen I'm trying to get off the ground about recurring events and attendance reporting. See the Wiki and blog pages if you're interested as there may be some integration possibilities between these two developments.


Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.