function copyPackageMemberOverridesTx
copyPackageMemberOverridesTx(
tx: TxScope,
sourceListingId: number,
newListingId: number,
): Promise<void>

Copy the source's package overrides onto the duplicate's membership rows in the SAME transaction that inserted them (the create write's afterWrite), so a failure rolls the whole duplicate back rather than leaving a live member at the default price. The flat group and per-day group_day price rows are copied only for package groups the NEW listing actually joined (the duplicate form may untick some of the source's groups) — scoping each source row's encoded group to the clone's group_listings, exactly as the quantity copy does. Otherwise a copied override for a non-joined group would lurk invisibly and resurrect the source's price if the clone were later added to that package.

Parameters

sourceListingId: number
newListingId: number

Return Type

Promise<void>

Usage

import { copyPackageMemberOverridesTx } from "docs/database.ts";