def only_build_once_rule(mod, g, p):
    """
    **Constraint Name**: GenNewBin_Only_Build_Once_Constraint
    **Enforced Over**: GEN_NEW_BIN_OPR_PRDS

    Once a project is built, it cannot be built again in another vintage
    until its lifetime is expired. We sum all binary build decisions of
    vintages operational in the current period and limit this to be less
    than or equal than 1.

    Note: this constraint could be generalized into a min and max build
    constraint if we want to allow multiple units to be built.
    """

    return (
        sum(
            mod.GenNewBin_Build[g, v]
            for (gen, v) in mod.GEN_NEW_BIN_VNTS_OPR_IN_PERIOD[p]
            if gen == g
        )
        <= 1
    )