def update_caches(update_cache_entities: typing.Tuple[SubscriptionCacheEntity, ...]):  # type: ignore[no-untyped-def]
    """
    Update the cache objects for an update_cache_entity in the database.
    """

    organisations = Organisation.objects.select_related(
        "subscription_information_cache", "subscription"
    ).all()

    organisation_info_cache_dict: typing.Dict[
        int, OrganisationSubscriptionInformationCache
    ] = {
        org.id: getattr(org, "subscription_information_cache", None)
        or OrganisationSubscriptionInformationCache(organisation=org)
        for org in organisations
    }

    if SubscriptionCacheEntity.INFLUX in update_cache_entities:
        _update_caches_with_influx_data(organisation_info_cache_dict)

    if SubscriptionCacheEntity.CHARGEBEE in update_cache_entities:
        _update_caches_with_chargebee_data(organisations, organisation_info_cache_dict)

    to_update = []
    to_create = []

    for subscription_info_cache in organisation_info_cache_dict.values():
        if subscription_info_cache.id:
            to_update.append(subscription_info_cache)
        else:
            to_create.append(subscription_info_cache)

    OrganisationSubscriptionInformationCache.objects.bulk_create(to_create)
    OrganisationSubscriptionInformationCache.objects.bulk_update(
        to_update,
        fields=[
            "api_calls_24h",
            "api_calls_7d",
            "api_calls_30d",
            "allowed_seats",
            "allowed_30d_api_calls",
            "chargebee_email",
            "chargebee_updated_at",
            "influx_updated_at",
        ],
    )

    Update the cache objects for an update_cache_entity in the database.
    
api/organisations/subscription_info_cache.py