Ejemplo n.º 1
0

@notify_command()
@click.option('-p',
              '--provider_name',
              required=True,
              type=click.Choice(PROVIDERS))
@click.option('-c',
              '--cost',
              required=True,
              help='Cost (pence) per message including decimals',
              type=float)
@click.option('-d',
              '--valid_from',
              required=True,
              type=click_dt(format='%Y-%m-%dT%H:%M:%S'))
def create_provider_rates(provider_name, cost, valid_from):
    """
    Backfill rates for a given provider
    """
    cost = Decimal(cost)
    dao_create_provider_rates(provider_name, valid_from, cost)


@notify_command()
@click.option('-u',
              '--user_email_prefix',
              required=True,
              help="""
    Functional test user email prefix. eg "notify-test-preview"
""")  # noqa
Ejemplo n.º 2
0
        # Then we need to turn it into a click.Command - that's what command_group.add_command expects.
        @click.command(name=self.name)
        @functools.wraps(func)
        @flask.cli.with_appcontext
        def wrapper(*args, **kwargs):
            return func(*args, **kwargs)

        command_group.add_command(wrapper)

        return wrapper


@notify_command()
@click.option('-p', '--provider_name', required=True, type=click.Choice(PROVIDERS))
@click.option('-c', '--cost', required=True, help='Cost (pence) per message including decimals', type=float)
@click.option('-d', '--valid_from', required=True, type=click_dt(format='%Y-%m-%dT%H:%M:%S'))
def create_provider_rates(provider_name, cost, valid_from):
    """
    Backfill rates for a given provider
    """
    cost = Decimal(cost)
    dao_create_provider_rates(provider_name, valid_from, cost)


@notify_command()
@click.option('-u', '--user_email_prefix', required=True, help="""
    Functional test user email prefix. eg "notify-test-preview"
""")  # noqa
def purge_functional_test_data(user_email_prefix):
    """
    Remove non-seeded functional test data
Ejemplo n.º 3
0

@notify_command()
@click.option('-p',
              '--provider_name',
              required=True,
              type=click.Choice(PROVIDERS))
@click.option('-c',
              '--cost',
              required=True,
              help='Cost (pence) per message including decimals',
              type=float)
@click.option('-d',
              '--valid_from',
              required=True,
              type=click_dt(format='%Y-%m-%dT%H:%M:%S'))
def create_provider_rates(provider_name, cost, valid_from):
    """
    Backfill rates for a given provider
    """
    cost = Decimal(cost)
    dao_create_provider_rates(provider_name, valid_from, cost)


@notify_command()
@click.option('-u',
              '--user_email_prefix',
              required=True,
              help="""
    Functional test user email prefix. eg "notify-test-preview"
""")  # noqa
Ejemplo n.º 4
0
@notify_command()
@click.option("-p",
              "--provider_name",
              required=True,
              type=click.Choice(PROVIDERS))
@click.option(
    "-c",
    "--cost",
    required=True,
    help="Cost (pence) per message including decimals",
    type=float,
)
@click.option("-d",
              "--valid_from",
              required=True,
              type=click_dt(format="%Y-%m-%dT%H:%M:%S"))
def create_provider_rates(provider_name, cost, valid_from):
    """
    Backfill rates for a given provider
    """
    cost = Decimal(cost)
    dao_create_provider_rates(provider_name, valid_from, cost)


@notify_command()
@click.option(
    "-u",
    "--user_email_prefix",
    required=True,
    help="""
    Functional test user email prefix. eg "notify-test-preview"