mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-11-30 01:39:38 +01:00
feat(connector): link projects to database
This commit is contained in:
@@ -3,6 +3,7 @@ package io.anthonyberg.connector.shared
|
||||
import io.anthonyberg.connector.shared.database.DriverFactory
|
||||
import io.anthonyberg.connector.shared.database.ProjectDatabase
|
||||
import io.anthonyberg.connector.shared.entity.Project
|
||||
import kotlinx.datetime.Clock
|
||||
|
||||
/**
|
||||
* All database transactions for Project
|
||||
@@ -13,8 +14,10 @@ class ProjectTransaction (driverFactory: DriverFactory) {
|
||||
/**
|
||||
* Creates a project in the database.
|
||||
*/
|
||||
fun createProject(project: Project) {
|
||||
database.createProject(project)
|
||||
fun createProject(projectName: String, aircraftType: String) {
|
||||
val currentTime = Clock.System.now().toString()
|
||||
|
||||
database.createProject(name = projectName, aircraftType = aircraftType, createdUTC = currentTime)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,11 +32,11 @@ internal class ProjectDatabase (driverFactory: DriverFactory) {
|
||||
/**
|
||||
* Inserts a project into the database
|
||||
*/
|
||||
internal fun createProject(project: Project) {
|
||||
internal fun createProject(name: String, aircraftType: String, createdUTC: String) {
|
||||
dbQuery.createProject(
|
||||
name = project.name,
|
||||
aircraftType = project.aircraftType,
|
||||
createdUTC = project.createdUTC,
|
||||
name = name,
|
||||
aircraftType = aircraftType,
|
||||
createdUTC = createdUTC,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user