Skip to content

Commit

Permalink
Merge pull request #373 from ostelco/feature/bugfix-sample-agent
Browse files Browse the repository at this point in the history
Feature/bugfix sample agent
  • Loading branch information
vihangpatil authored Oct 12, 2018
2 parents e499d99 + fa716ec commit 82452ba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
File renamed without changes.
15 changes: 9 additions & 6 deletions sample-agent/generate-test-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ createOffer:
isDefault: true
offerLabel: Top Up
priceLabel: 200 NOK
productLabel: +1GB
createSegments:
- id: $SEGMENT_1
EOF
Expand All @@ -69,6 +70,7 @@ createOffer:
isDefault: true
offerLabel: Top Up
priceLabel: 200 NOK
productLabel: +2GB
createSegments:
- id: $SEGMENT_2
EOF
Expand All @@ -87,6 +89,7 @@ createOffer:
isDefault: true
offerLabel: Special offer
priceLabel: 50 NOK
productLabel: +1GB
createSegments:
- id: $SEGMENT_3
EOF
Expand Down Expand Up @@ -130,15 +133,15 @@ EOF
echo "$0: INFO Successfully created demo scripts in directyory $TARGET_DIR"
echo "$0: INFO To initialize run initialization scripts:"
echo "$0: INFO"
echo "$0: INFO apply_yaml.sh offer $TARGET_DIR/init1.yml"
echo "$0: INFO apply_yaml.sh offer $TARGET_DIR/init2.yml"
echo "$0: INFO apply_yaml.sh offer $TARGET_DIR/init3.yml"
echo "$0: INFO ./apply_yaml.sh offer $TARGET_DIR/init1.yml"
echo "$0: INFO ./apply_yaml.sh offer $TARGET_DIR/init2.yml"
echo "$0: INFO ./apply_yaml.sh offer $TARGET_DIR/init3.yml"
echo "$0: INFO"
echo "$0: INFO During the test, run the test steps:"
echo "$0: INFO"
echo "$0: INFO apply_yaml.sh segments $TARGET_DIR/step1.yml"
echo "$0: INFO apply_yaml.sh segments $TARGET_DIR/setep2.yml"
echo "$0: INFO ./apply_yaml.sh segments $TARGET_DIR/step1.yml"
echo "$0: INFO ./apply_yaml.sh segments $TARGET_DIR/step2.yml"
echo "$0: INFO"
echo "$0: INFO To reset to initial state (e.g. before running a demo/test again):"
echo "$0: INFO"
echo "$0: INFO apply_yaml.sh segments $TARGET_DIR/reset.yml"
echo "$0: INFO ./apply_yaml.sh segments $TARGET_DIR/reset.yml"
18 changes: 15 additions & 3 deletions tools/neo4j-admin-tools/src/main/resources/init.cypher
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// For country:NO
CREATE (:Product {`id`: '1GB_249NOK',
CREATE (:Product {`id`: '1GB_0NOK',
`presentation/isDefault`: 'true',
`presentation/offerLabel`: '',
`presentation/priceLabel`: 'Free',
`presentation/productLabel`: '+1GB',
`price/amount`: '0',
`price/currency`: '',
`properties/noOfBytes`: '1_000_000_000',
`sku`: '1GB_0NOK'});

CREATE (:Product {`id`: '1GB_249NOK',
`presentation/offerLabel`: 'Default Offer',
`presentation/priceLabel`: '249 NOK',
`presentation/productLabel`: '+1GB',
Expand Down Expand Up @@ -40,6 +49,11 @@ CREATE (:Segment {`id`: 'country-no'});

CREATE (:Offer {`id`: 'default_offer-no'});

MATCH (n:Offer {id: 'default_offer-no'})
WITH n
MATCH (m:Product {id: '1GB_0NOK'})
CREATE (n)-[:OFFER_HAS_PRODUCT]->(m);

MATCH (n:Offer {id: 'default_offer-no'})
WITH n
MATCH (m:Product {id: '1GB_249NOK'})
Expand Down Expand Up @@ -77,8 +91,6 @@ CREATE (:Product {`id`: '1GB_1SGD',
`sku`: '1GB_1SGD'});

CREATE (:Product {`id`: '3GB_1.5SGD',
`presentation/isDefault`: 'true',
`presentation/isOffer`: 'true',
`presentation/offerLabel`: 'Default Offer',
`presentation/priceLabel`: '1.5 SGD',
`presentation/productLabel`: '+3GB',
Expand Down

0 comments on commit 82452ba

Please sign in to comment.