Skip to content

Instantly share code, notes, and snippets.

@metaperl
Created July 26, 2010 17:16
Show Gist options
  • Select an option

  • Save metaperl/490859 to your computer and use it in GitHub Desktop.

Select an option

Save metaperl/490859 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use lib '/usr/local/vwh/bin/make-dml';
use Storable;
use MKDML;
use Nimbus::DB;
sub main {
my @product = qw(SRegisterNew SPrivateRegNew);
my %desc = (SRegisterNew => '1st time registration',
SPrivateRegNew => '1st time private status');
my @segment = qw(com org net info biz us co.uk);
my @channel = resultset('Channel')->get_column('channel')->all;
for my $product (@product) {
my $key = { product => $product, prod_version => 'legacy' };
my $val = { description => $desc{$product}, family => 'dnr', cycle => 'Y' };
MKDML::BOTH(PRODUCT => $key, $val);
my $billable_key = { %$key, feetype => 'SETUP' };
MKDML::BOTH(BILLABLE => $billable_key, {});
for my $channel (@channel) {
my $channel_key = { %$key, channel => $channel };
MKDML::BOTH(CHANPROD => $channel_key, {});
for my $segment (@segment) {
my $segment_key = { %$channel_key, segment => $segment };
$val = { url => '', status => 'A' };
MKDML::BOTH( CHANPRODSEG => $segment_key, $val );
$segment_key->{feetype} = 'SETUP';
$val = { points => 0.0 } ;
delete $key->{currency};
MKDML::BOTH( BILLABLE_POINTS => $segment_key, $val );
delete $val->{points};
$segment_key->{currency} = 840;
$val->{price} = $val->{minprice} = 995;
MKDML::BOTH( BILLABLE_PRICE => $segment_key, $val );
}
}
}
MKDML::SAVE;
}
main;
m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment