Skip to content

Add SimpleEngelsystemRepository in separate "engelsystem-repositories" library artifact.#16

Merged
johnjohndoe merged 1 commit into
masterfrom
engelsystem-repositories
May 10, 2025
Merged

Add SimpleEngelsystemRepository in separate "engelsystem-repositories" library artifact.#16
johnjohndoe merged 1 commit into
masterfrom
engelsystem-repositories

Conversation

@johnjohndoe

Copy link
Copy Markdown
Owner

Description

The engelsystem-repositories artifact returns a Flow<GetShiftsState> type from the suspending SimpleEngelsystemRepository#getShiftsState() function.

val api: EngelsystemApi = Api
val repository = SimpleEngelsystemRepository(
    callFactory = OkHttpClient.Builder().build(),
    api = api,
)

repository.getShiftsState(
    requestETag = "", // Pass an empty string or a previous ETag value for caching
    requestLastModifiedAt = "", // Pass an empty string or a previous Last-Modified value for caching
    baseUrl = BASE_URL,
    path = URL_PART_PATH,
    apiKey = API_KEY,
)
.collectLatest { state: GetShiftsState ->
    when (state) {
        is Success -> {
            val shifts = state.shifts
            val responseETag = state.responseETag
            val responseLastModifiedAt = state.responseLastModifiedAt
        }
        is Error -> {
            val httpStatusCode = state.httpStatusCode
            val errorMessage = state.errorMessage
        }
        is Failure -> {
            val throwable = state.throwable
        }
    }
}

…" library artifact.

+ Update deployment to handle both modules.
@github-actions

Copy link
Copy Markdown

Test Results

24 tests  +10   24 ✅ +10   3s ⏱️ -1s
 7 suites + 2    0 💤 ± 0 
 7 files   + 2    0 ❌ ± 0 

Results for commit 8465220. ± Comparison against base commit 80a3ca4.

@johnjohndoe johnjohndoe self-assigned this May 10, 2025
@johnjohndoe johnjohndoe merged commit d91cfb7 into master May 10, 2025
5 checks passed
@johnjohndoe johnjohndoe deleted the engelsystem-repositories branch May 10, 2025 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant