SvkRepository

interface SvkRepository

Repository interface providing a contract for data operations related to the application.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun authenticate(token: String): UserDto

Authenticates the user based on the provided token.

Link copied to clipboard
abstract suspend fun deleteActiveTransport()

Deletes the active transport from the local database.

Link copied to clipboard
abstract suspend fun deleteImage(imageUuid: UUID)

Deletes the image with the specified UUID.

Link copied to clipboard
abstract suspend fun finishTransport()

Marks the active transport as finished on the server.

Link copied to clipboard
abstract suspend fun finishTransportByRouteNumber(routeNumber: String)

Marks the transport with the specified route number as finished on the server.

Link copied to clipboard
abstract suspend fun getActiveTransport(): Transport

Retrieves the active transport from the local database.

Link copied to clipboard
abstract suspend fun getHealth(): HealthDto

Retrieves the health information from the server.

Link copied to clipboard
abstract suspend fun getLocalUserByEmail(email: String): UserRoomEntity

Retrieves a local user by their email address.

Link copied to clipboard
abstract suspend fun insertCargo(cargo: Cargo)

Inserts a cargo locally into the database.

Link copied to clipboard
abstract suspend fun insertImage(imageUuid: UUID, userId: Int, routeNumber: String, localUri: Uri)

Inserts an image locally into the database.

Link copied to clipboard
abstract suspend fun insertLocalUser(user: UserDto)

Inserts a local user into the database.

Link copied to clipboard
abstract suspend fun insertTransport(transport: Transport)

Inserts a transport locally into the database.

Link copied to clipboard
abstract suspend fun login(loginDto: LoginDto): UserDto

Attempts to authenticate the user based on the provided LoginDto.

Link copied to clipboard
abstract suspend fun patchTransport(transport: Transport): TransportDto

Updates an existing transport on the server.

Link copied to clipboard
abstract suspend fun postImage(image: File): String

Uploads an image to the server.

Link copied to clipboard
abstract suspend fun postTransport(transport: Transport): TransportDto

Posts a transport to the server.

Link copied to clipboard
abstract suspend fun register(body: LoginDto): UserDto

Registers a new user on the server.

Link copied to clipboard
abstract suspend fun syncTransports()

Synchronizes transports with the server.

Link copied to clipboard
abstract suspend fun updateCargo(oldCargoNumber: String, newCargoNumber: String)

Updates the cargo number for a given transport.

Link copied to clipboard
abstract suspend fun updateLocalTransport(transport: Transport)

Updates a local transport in the database.