Skip to content

Instantly share code, notes, and snippets.

@ferromir
Forked from jeffsteinmetz/gist:49a9e70bd0c187142515
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save ferromir/54c5dabc306a3f373dc3 to your computer and use it in GitHub Desktop.

Select an option

Save ferromir/54c5dabc306a3f373dc3 to your computer and use it in GitHub Desktop.
/*==============================================================================
User stories from the use cases
As a user
I want to create organizations
So that members have shared access to focussets.
As an organization admin
I want to have teams within an organization
So that users can be grouped by teams.
As an organization admin
I want to set access permissions to teams
So that teams have limited access to focussets.
As an user
I want to set the ownership of the focussets I create
So that focussets can owned by either me or an organization I belong.
As the ekho billing system
I want the owner of a focusset to have billing information
So that they can be charged.
As an focusset owner
I want to have the option to share my focussets
So that users outside my organization can have acces to my focussets.
==============================================================================*/
{
"Permission": {
"read": {
"type": "Boolean",
},
// For create, update and delete
"write": {
"type": "Boolean"
},
// For start, stop, archive and restore
"lifecycle": {
"type": "Boolean"
},
// Permission to share this focusset with other users
"share": {
"type": "Boolean"
}
},
"Focusset": {
// Owner can share this focusset with users from outside the organization
// by adding them here
"shared_with": {
"array": true,
"user_id": {
"type": "String"
},
"permission": {
"type": "Permission"
}
}
},
"Organization": {
"id": {
"type": "String",
"unique": true
},
"pricing_plan": {
"type": "String",
"valid_values": ["free", "partner", "professional", "enterprise"]
},
"creator": {
"type": "User"
},
"unique_name": {
"type": "String",
"unique": true
},
"full_name": {
"type": "String"
},
"created_at": {
"type": "ISO date"
},
"closed_at": {
"type": "ISO date",
"required": false
},
"billing": {
"type": "Billing"
},
"members": {
"type": "User",
"array": true,
},
// Focussets which owner is the organization.
// Are shared by default with the other members of this organization.
// Members have limited access depending on the team's permission.
"focussets": {
"type": "Focusset",
"array": true
},
"teams": {
"type": "Team",
"array": true
},
// I will need more info for these:
// Perhaps, account_limits might be part of a PricingPlan model since
// might be related
"account_limits": "TODO",
"user_default_limits": "TODO",
"available_datasources": "TODO",
"datasource_limits": "TODO"
},
"Billing": {
"address": {
"type": "String"
},
"contact": {
"type": "String"
},
"schedule": {
"type": "String",
"valid_values": ["monthly", "yearly"]
},
"provider": {
"type": "String",
"valid_values": ["swipe", "paypal"]
},
"provider_id": {
"type": "String"
},
"history": {
"array": true,
"charge_USD" : {
"type": "Decimal",
},
"schedule": {
"type": "String",
"valid_values": ["monthly", "yearly"]
},
"billed_at": {
"type": "ISO date"
},
"payed_at": {
"type": "ISO date"
}
}
},
"Team": {
"name": {
"type": "String",
"unique": true
},
// By default there will be 3 teams in every org:
// 1. Owners: creator belongs here by default, they have full permissions,
// only owners can manage members and teams.
// 2. Admins: have all permissions except for "share".
// 3. Watchers: read only permission. When a new members joins the org, joins this team by default.
// custom teams can be created and deleted, default teams can't be.
"custom": {
"type": "Boolean"
},
"permission": {
"type": "Permission"
},
"members": {
"type": "User",
"array": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment