Created
March 25, 2012 18:33
-
-
Save hjast/2198903 to your computer and use it in GitHub Desktop.
SyncedOrgInterface
This file contains hidden or 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
//Readonly synced organization. For example Crunch, 24 hour fitness or any gym with a custom CRM solution will use this interface | |
/* | |
2 Ways to do this | |
1. The data source is very complicated and can not be broken down into it's respecitves facs/ class Types or activities. | |
2. The data source can be mapped to Synced Facilities, synced class types, and synced activities. If this route is taken it allows us to | |
perform some boilerplate code. (for example, sync all synced facility in parallel, then sync all class types in parallel, then sync all activity collection in parallel. | |
*/ | |
trait ReadOnlySyncedOrg { | |
def facs: Option[Seq[SyncedFacility]] | |
def classTypes: Option[Seq[SyncedClassType]] | |
//For organization which do no have facilities (Meetup, but have activities which need to be synced) | |
def acts: Option[Seq[SyncedActivity]] | |
//Get org from the database | |
def getOrg: Option[Organization] | |
//If org not in database, then create otherwise sync this | |
def syncChanges | |
//Returns whether or not the organization is in the database | |
def isCreated:Boolean | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment