def update_all_offers_active_status_job(filters: dict,
                                        is_active: bool) -> None:
    query = offers_repository.get_offers_by_filters(
        user_id=filters["user_id"],
        user_is_admin=filters["is_user_admin"],
        offerer_id=filters["offerer_id"],
        status=filters["status"],
        venue_id=filters["venue_id"],
        category_id=filters["category_id"],
        name_keywords_or_isbn=filters["name_or_isbn"],
        creation_mode=filters["creation_mode"],
        period_beginning_date=filters["period_beginning_date"],
        period_ending_date=filters["period_ending_date"],
    )
    offers_api.batch_update_offers(query, {"isActive": is_active})
Esempio n. 2
0
def update_all_venue_offers_withdrawal_details_job(venue, withdrawal_details: str) -> None:
    query = Offer.query.filter(Offer.venueId == venue.id)

    offers_api.batch_update_offers(query, {"withdrawalDetails": withdrawal_details})
Esempio n. 3
0
def patch_offers_active_status(body: offers_serialize.PatchOfferActiveStatusBodyModel) -> None:
    query = offers_repository.get_offers_by_ids(current_user, body.ids)
    offers_api.batch_update_offers(query, {"isActive": body.is_active})
Esempio n. 4
0
def update_all_venue_offers_accessibility_job(
        venue, accessibility: dict[str, bool]) -> None:
    query = Offer.query.filter(Offer.venueId == venue.id)

    offers_api.batch_update_offers(query, accessibility)
def update_all_venue_offers_email_job(venue, email: str) -> None:
    query = Offer.query.filter(Offer.venueId == venue.id)

    offers_api.batch_update_offers(query, {"bookingEmail": email})