Skip to content

feat: Add session fragment #1693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,077 changes: 0 additions & 1,077 deletions app/schemas/org.fossasia.openevent.general.OpenEventDatabase/1.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"formatVersion": 1,
"database": {
"version": 3,
"identityHash": "1badd5e17f181e602314a4244c04cf56",
"version": 5,
"identityHash": "77cfd0b7528a803833b63c64c6d1db89",
"entities": [
{
"tableName": "Event",
Expand Down Expand Up @@ -1098,7 +1098,7 @@
},
{
"tableName": "Speaker",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, `email` TEXT, `photoUrl` TEXT, `shortBiography` TEXT, `longBiography` TEXT, `speakingExperience` TEXT, `location` TEXT, `country` TEXT, `city` TEXT, `organisation` TEXT, `gender` TEXT, `website` TEXT, `twitter` TEXT, `facebook` TEXT, `linkedin` TEXT, `github` TEXT, `isFeatured` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, `email` TEXT, `photoUrl` TEXT, `shortBiography` TEXT, `longBiography` TEXT, `speakingExperience` TEXT, `position` TEXT, `mobile` TEXT, `location` TEXT, `country` TEXT, `city` TEXT, `organisation` TEXT, `gender` TEXT, `website` TEXT, `twitter` TEXT, `facebook` TEXT, `linkedin` TEXT, `github` TEXT, `isFeatured` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -1142,6 +1142,18 @@
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "position",
"columnName": "position",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mobile",
"columnName": "mobile",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "location",
"columnName": "location",
Expand Down Expand Up @@ -1284,12 +1296,298 @@
]
}
]
},
{
"tableName": "Sponsor",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, `description` TEXT, `url` TEXT, `logoUrl` TEXT, `level` INTEGER NOT NULL, `type` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "logoUrl",
"columnName": "logoUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "level",
"columnName": "level",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "SponsorWithEvent",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`event_id` INTEGER NOT NULL, `sponsor_id` INTEGER NOT NULL, PRIMARY KEY(`event_id`, `sponsor_id`), FOREIGN KEY(`event_id`) REFERENCES `Event`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`sponsor_id`) REFERENCES `Sponsor`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "eventId",
"columnName": "event_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "sponsorId",
"columnName": "sponsor_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"event_id",
"sponsor_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_SponsorWithEvent_event_id",
"unique": false,
"columnNames": [
"event_id"
],
"createSql": "CREATE INDEX `index_SponsorWithEvent_event_id` ON `${TABLE_NAME}` (`event_id`)"
},
{
"name": "index_SponsorWithEvent_sponsor_id",
"unique": false,
"columnNames": [
"sponsor_id"
],
"createSql": "CREATE INDEX `index_SponsorWithEvent_sponsor_id` ON `${TABLE_NAME}` (`sponsor_id`)"
}
],
"foreignKeys": [
{
"table": "Event",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"event_id"
],
"referencedColumns": [
"id"
]
},
{
"table": "Sponsor",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"sponsor_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "Session",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `shortAbstract` TEXT, `comments` TEXT, `longAbstract` TEXT, `level` TEXT, `signupUrl` TEXT, `endsAt` TEXT, `language` TEXT, `title` TEXT, `startsAt` TEXT, `slidesUrl` TEXT, `averageRating` REAL, `submittedAt` TEXT, `deletedAt` TEXT, `subtitle` TEXT, `createdAt` TEXT, `state` TEXT, `lastModifiedAt` TEXT, `videoUrl` TEXT, `audioUrl` TEXT, `sessionType` TEXT, `microlocation` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "shortAbstract",
"columnName": "shortAbstract",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "comments",
"columnName": "comments",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "longAbstract",
"columnName": "longAbstract",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "level",
"columnName": "level",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "signupUrl",
"columnName": "signupUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "endsAt",
"columnName": "endsAt",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "language",
"columnName": "language",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "startsAt",
"columnName": "startsAt",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "slidesUrl",
"columnName": "slidesUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "averageRating",
"columnName": "averageRating",
"affinity": "REAL",
"notNull": false
},
{
"fieldPath": "submittedAt",
"columnName": "submittedAt",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "deletedAt",
"columnName": "deletedAt",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "subtitle",
"columnName": "subtitle",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "state",
"columnName": "state",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "lastModifiedAt",
"columnName": "lastModifiedAt",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "videoUrl",
"columnName": "videoUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "audioUrl",
"columnName": "audioUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "sessionType",
"columnName": "sessionType",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "microlocation",
"columnName": "microlocation",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_Session_sessionType",
"unique": false,
"columnNames": [
"sessionType"
],
"createSql": "CREATE INDEX `index_Session_sessionType` ON `${TABLE_NAME}` (`sessionType`)"
},
{
"name": "index_Session_microlocation",
"unique": false,
"columnNames": [
"microlocation"
],
"createSql": "CREATE INDEX `index_Session_microlocation` ON `${TABLE_NAME}` (`microlocation`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"1badd5e17f181e602314a4244c04cf56\")"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"77cfd0b7528a803833b63c64c6d1db89\")"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import org.fossasia.openevent.general.event.topic.EventTopicsDao
import org.fossasia.openevent.general.event.types.EventTypeConverter
import org.fossasia.openevent.general.order.Order
import org.fossasia.openevent.general.order.OrderDao
import org.fossasia.openevent.general.sessions.Session
import org.fossasia.openevent.general.sessions.SessionDao
import org.fossasia.openevent.general.sessions.microlocation.MicroLocationConverter
import org.fossasia.openevent.general.sessions.sessiontype.SessionTypeConverter
import org.fossasia.openevent.general.social.SocialLink
import org.fossasia.openevent.general.social.SocialLinksDao
import org.fossasia.openevent.general.speakers.Speaker
Expand All @@ -36,10 +40,10 @@ import org.fossasia.openevent.general.ticket.TicketIdConverter

@Database(entities = [Event::class, User::class, SocialLink::class, Ticket::class, Attendee::class,
EventTopic::class, Order::class, CustomForm::class, Speaker::class, SpeakerWithEvent::class, Sponsor::class,
SponsorWithEvent::class], version = 4)
SponsorWithEvent::class, Session::class], version = 5)
@TypeConverters(EventIdConverter::class, EventTopicConverter::class, EventTypeConverter::class,
EventSubTopicConverter::class, TicketIdConverter::class,
AttendeeIdConverter::class, ListAttendeeIdConverter::class)
EventSubTopicConverter::class, TicketIdConverter::class, MicroLocationConverter::class,
AttendeeIdConverter::class, ListAttendeeIdConverter::class, SessionTypeConverter::class)
abstract class OpenEventDatabase : RoomDatabase() {

abstract fun eventDao(): EventDao
Expand All @@ -63,4 +67,6 @@ abstract class OpenEventDatabase : RoomDatabase() {
abstract fun sponsorDao(): SponsorDao

abstract fun sponsorWithEventDao(): SponsorWithEventDao

abstract fun sessionDao(): SessionDao
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,15 @@ interface SpeakerClickListener {
*/
fun onClick(speakerId: Long)
}

/**
* The callback interface for Speaker item clicks
*/
interface SessionClickListener {
/**
* The function to be invoked when a speaker item is clicked
*
* @param sessionId The ID of the clicked session
*/
fun onClick(sessionId: Long)
}
Loading