-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create and download extracts after logging in
- Loading branch information
Showing
70 changed files
with
45,023 additions
and
280 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
17 changes: 0 additions & 17 deletions
17
core/common/src/main/java/com/jacob/wakatimeapp/core/common/data/dtos/CategoryDTO.kt
This file was deleted.
Oops, something went wrong.
This file contains 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
112 changes: 112 additions & 0 deletions
112
core/common/src/main/java/com/jacob/wakatimeapp/core/common/data/dtos/ExtractedDataDTO.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package com.jacob.wakatimeapp.core.common.data.dtos | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ExtractedDataDTO( | ||
val days: List<DayDTO>, | ||
val range: RangeDTO, | ||
val user: UserDTO, | ||
) { | ||
@Serializable | ||
data class DayDTO( | ||
val categories: List<CategoryDTO>, | ||
val date: String, | ||
val dependencies: List<DependencyDTO>, | ||
val editors: List<EditorDTO>, | ||
val languages: List<LanguageDTO>, | ||
val machines: List<MachineDTO>, | ||
val projects: List<ProjectDTO>, | ||
@SerialName("grand_total") val grandTotal: GrandTotalDTO, | ||
@SerialName("operating_systems") val operatingSystems: List<OperatingSystemDTO>, | ||
) { | ||
|
||
@Serializable | ||
data class ProjectDTO( | ||
val branches: List<BranchDTO>, | ||
val categories: List<CategoryDTO>, | ||
val dependencies: List<DependencyDTO>, | ||
val editors: List<EditorDTO>, | ||
val entities: List<EntityDTO>, | ||
val languages: List<LanguageDTO>, | ||
val machines: List<MachineDTO>, | ||
val name: String, | ||
@SerialName("grand_total") val grandTotal: GrandTotalDTO, | ||
@SerialName("operating_systems") val operatingSystems: List<OperatingSystemDTO>, | ||
) { | ||
@Serializable | ||
data class BranchDTO( | ||
val decimal: String, | ||
val digital: String, | ||
val hours: Int, | ||
val minutes: Int, | ||
val name: String, | ||
val percent: Double, | ||
val seconds: Int, | ||
val text: String, | ||
@SerialName("total_seconds") val totalSeconds: Double, | ||
) | ||
} | ||
} | ||
|
||
@Serializable | ||
data class RangeDTO( | ||
val end: Int, | ||
val start: Int, | ||
) | ||
|
||
@Serializable | ||
data class UserDTO( | ||
val bio: String?, | ||
val city: String?, | ||
val email: String?, | ||
val id: String, | ||
val location: String?, | ||
val photo: String?, | ||
val plan: String?, | ||
val timeout: Int?, | ||
val timezone: String?, | ||
val username: String, | ||
val website: String?, | ||
@SerialName("color_scheme") val colorScheme: String?, | ||
@SerialName("created_at") val createdAt: String?, | ||
@SerialName("date_format") val dateFormat: String?, | ||
@SerialName("default_dashboard_range") val defaultDashboardRange: String?, | ||
@SerialName("display_name") val displayName: String?, | ||
@SerialName("durations_slice_by") val durationsSliceBy: String?, | ||
@SerialName("full_name") val fullName: String?, | ||
@SerialName("github_username") val githubUsername: String?, | ||
@SerialName("has_basic_features") val hasBasicFeatures: Boolean, | ||
@SerialName("has_premium_features") val hasPremiumFeatures: Boolean, | ||
@SerialName("human_readable_website") val humanReadableWebsite: String?, | ||
@SerialName("invoice_id_format") val invoiceIdFormat: String?, | ||
@SerialName("is_email_confirmed") val isEmailConfirmed: Boolean, | ||
@SerialName("is_email_public") val isEmailPublic: Boolean, | ||
@SerialName("is_hireable") val isHireable: Boolean, | ||
@SerialName("is_onboarding_finished") val isOnboardingFinished: Boolean, | ||
@SerialName("languages_used_public") val languagesUsedPublic: Boolean, | ||
@SerialName("last_heartbeat_at") val lastHeartbeatAt: String?, | ||
@SerialName("last_plugin") val lastPlugin: String?, | ||
@SerialName("last_plugin_name") val lastPluginName: String?, | ||
@SerialName("last_project") val lastProject: String?, | ||
@SerialName("linkedin_username") val linkedinUsername: String?, | ||
@SerialName("logged_time_public") val loggedTimePublic: Boolean, | ||
@SerialName("meetings_over_coding") val meetingsOverCoding: Boolean, | ||
@SerialName("modified_at") val modifiedAt: String?, | ||
@SerialName("needs_payment_method") val needsPaymentMethod: Boolean, | ||
@SerialName("photo_public") val photoPublic: Boolean, | ||
@SerialName("profile_url") val profileUrl: String?, | ||
@SerialName("profile_url_escaped") val profileUrlEscaped: String?, | ||
@SerialName("public_email") val publicEmail: String?, | ||
@SerialName("public_profile_time_range") val publicProfileTimeRange: String?, | ||
@SerialName("share_all_time_badge") val shareAllTimeBadge: Boolean, | ||
@SerialName("share_last_year_days") val shareLastYearDays: String?, | ||
@SerialName("show_machine_name_ip") val showMachineNameIp: Boolean, | ||
@SerialName("time_format_24hr") val timeFormat24hr: Boolean, | ||
@SerialName("time_format_display") val timeFormatDisplay: String?, | ||
@SerialName("twitter_username") val twitterUsername: String?, | ||
@SerialName("weekday_start") val weekdayStart: Int, | ||
@SerialName("writes_only") val writesOnly: Boolean, | ||
) | ||
} |
14 changes: 14 additions & 0 deletions
14
core/common/src/main/java/com/jacob/wakatimeapp/core/common/data/local/AppDatabase.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.jacob.wakatimeapp.core.common.data.local | ||
|
||
import androidx.room.Database | ||
import androidx.room.RoomDatabase | ||
import androidx.room.TypeConverters | ||
import com.jacob.wakatimeapp.core.common.data.local.dao.ApplicationDao | ||
import com.jacob.wakatimeapp.core.common.data.local.entities.DayEntity | ||
import com.jacob.wakatimeapp.core.common.data.local.entities.ProjectPerDay | ||
|
||
@Database(entities = [DayEntity::class, ProjectPerDay::class], version = 1) | ||
@TypeConverters(WtaTypeConverters::class) | ||
abstract class AppDatabase : RoomDatabase() { | ||
internal abstract fun applicationDao(): ApplicationDao | ||
} |
21 changes: 21 additions & 0 deletions
21
core/common/src/main/java/com/jacob/wakatimeapp/core/common/data/local/WakaTimeAppDB.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.jacob.wakatimeapp.core.common.data.local | ||
|
||
import com.jacob.wakatimeapp.core.common.data.dtos.ExtractedDataDTO | ||
import com.jacob.wakatimeapp.core.common.data.local.dao.ApplicationDao | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
import kotlinx.datetime.LocalDate | ||
|
||
@Singleton | ||
class WakaTimeAppDB @Inject constructor( | ||
private val applicationDao: ApplicationDao, | ||
) { | ||
suspend fun getStatsForDay(date: LocalDate) = applicationDao.getStatsForDay(date) | ||
|
||
suspend fun getStatsForProject(name: String) = applicationDao.getStatsForProject(name) | ||
|
||
suspend fun getDateRangeInDb() = applicationDao.getDateRangeInDb() | ||
|
||
suspend fun insertExtractedData(extractedDataDTO: ExtractedDataDTO) = | ||
applicationDao.insertStatesForDay(extractedDataDTO) | ||
} |
Oops, something went wrong.