Skip to content

Align IokiSevice passing in ApiModels #100

@StefMa

Description

@StefMa

Right know we have a mixed api design.
Sometimes we add the ApiModels to the function, sometimes we creaet the ApiModels there.

Example - creating the ApiModel:

override suspend fun createPaymentMethodFromStripePaymentMethod(
stripePaymentMethodId: String,
): ApiResult<ApiPaymentMethodResponse> = apiCall<ApiBody<ApiPaymentMethodResponse>, ApiPaymentMethodResponse> {
val data = ApiPaymentMethodCreationRequest(
"stripe",
ApiPaymentMethodCreationRequest.Details(
stripePaymentMethodId = stripePaymentMethodId,
null,
null,
),
)
createPaymentMethod(body = ApiBody(data))
}

Example - passing in the ApiModel:

override suspend fun createDevice(deviceRequest: ApiDeviceRequest): ApiResult<ApiDeviceResponse> =
apiCall<ApiBody<ApiDeviceResponse>, ApiDeviceResponse> {
createDevice(body = ApiBody(deviceRequest))
}

We should align this and think about a common solution here.
Either passing in, or creating there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions