Skip to content

Commit e88096e

Browse files
CCM-13367: Allocation Logic (#540)
* CCM-13372 - Select Preferred Pack * CCM-13371 - Determine Eligible packs * CCM-13372 - Update pk and sk values * CCM-13882 - Calculate-Supplier-Weighting * CCM-13384 calculate allocation factors * test supplier config * handle non existent overall allocations * store current allocations * debug logging * error checking * lambda permissions * fix date type * more logging * increment correct supplier * refactor for clarity * add priority * unit tests * moved types to separate file * rationalise logging * updated to store total daily allocations per supplier * dev test data and ITs * turn it on! * pre review tidy * review changes * handle concurrent updates and inserts * CCM-13378: Handle No Supplier Available * add check for illogical allocation percentage * test review changes * fix test for allocator parsing event schema * rebase fixes
1 parent c83dd9c commit e88096e

106 files changed

Lines changed: 5677 additions & 450 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/suppliers/letter-variant/client1-campaign.json renamed to config/suppliers/letter-variant/client1-campaign1.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"campaignIds": [
3-
"client1-campaign"
3+
"client1-campaign1"
44
],
55
"clientId": "client1",
66
"constraints": {
@@ -25,12 +25,13 @@
2525
"value": 6
2626
}
2727
},
28-
"description": "Colour printing, campaign envelope, Attachment",
29-
"id": "client1-campaign",
30-
"name": "Client1 - campaign",
28+
"description": "Colour printing, campaign1 envelope, Attachment",
29+
"id": "client1-campaign1",
30+
"name": "Client1 - Campaign1",
3131
"packSpecificationIds": [
32-
"client1-campaign"
32+
"client1-campaign1"
3333
],
34+
"priority": 1,
3435
"status": "INT",
3536
"type": "STANDARD",
3637
"volumeGroupId": "volumeGroup-test3"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign2"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail, colour printing",
29+
"id": "client1-campaign2",
30+
"name": "Client1 - CAMPAIGN2",
31+
"packSpecificationIds": [
32+
"client1-campaign2"
33+
],
34+
"priority": 1,
35+
"status": "INT",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign3"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail?, colour printing, booklet",
29+
"id": "client1-campaign3",
30+
"name": "Client1 - Campaign 3",
31+
"packSpecificationIds": [
32+
"client1-campaign3"
33+
],
34+
"priority": 2,
35+
"status": "INT",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign4"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail, colour printing, campaign4 envelope",
29+
"id": "client1-campaign4",
30+
"name": "Client1 - Campaign 4",
31+
"packSpecificationIds": [
32+
"client1-campaign4"
33+
],
34+
"priority": 3,
35+
"status": "INT",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign5"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail, colour printing, Campaign 5 envelope",
29+
"id": "client1-campaign5",
30+
"name": "Client1 - Campaign 5",
31+
"packSpecificationIds": [
32+
"client1-campaign5"
33+
],
34+
"priority": 4,
35+
"status": "PROD",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign6"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 4
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 8
26+
}
27+
},
28+
"description": "Colour printing, Campaign 6 envelope, Attachment",
29+
"id": "client1-campaign6",
30+
"name": "Client1 - Campaign 6",
31+
"packSpecificationIds": [
32+
"client1-campaign6"
33+
],
34+
"priority": 5,
35+
"status": "INT",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign7 "
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Economy, colour printing",
29+
"id": "client1-campaign7",
30+
"name": "Client1 - Campaign 7",
31+
"packSpecificationIds": [
32+
"notify-c5-colour"
33+
],
34+
"priority": 50,
35+
"status": "INT",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"client1-campaign8"
4+
],
5+
"clientId": "client1",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail?, colour printing, booklet",
29+
"id": "client1-campaign8",
30+
"name": "Client1 - Campaign 8",
31+
"packSpecificationIds": [
32+
"client1-campaign8"
33+
],
34+
"priority": 7,
35+
"status": "INT",
36+
"type": "STANDARD",
37+
"volumeGroupId": "volumeGroup-test3"
38+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"clientId": "Client 2",
3+
"constraints": {
4+
"blackCoveragePercentage": {
5+
"operator": "LESS_THAN",
6+
"value": 20
7+
},
8+
"colourCoveragePercentage": {
9+
"operator": "LESS_THAN",
10+
"value": 10
11+
},
12+
"deliveryDays": {
13+
"operator": "LESS_THAN",
14+
"value": 3
15+
},
16+
"sheets": {
17+
"operator": "LESS_THAN",
18+
"value": 5
19+
},
20+
"sides": {
21+
"operator": "LESS_THAN",
22+
"value": 10
23+
}
24+
},
25+
"description": "Letter with admail postage tariff",
26+
"id": "client2-admail",
27+
"name": "Admail letter",
28+
"packSpecificationIds": [
29+
"notify-admail"
30+
],
31+
"priority": 8,
32+
"status": "INT",
33+
"type": "STANDARD",
34+
"volumeGroupId": "volumeGroup-test3"
35+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"clientId": "client3",
3+
"constraints": {
4+
"blackCoveragePercentage": {
5+
"operator": "LESS_THAN",
6+
"value": 20
7+
},
8+
"deliveryDays": {
9+
"operator": "LESS_THAN",
10+
"value": 1
11+
},
12+
"sheets": {
13+
"operator": "LESS_THAN",
14+
"value": 4
15+
},
16+
"sides": {
17+
"operator": "LESS_THAN",
18+
"value": 8
19+
}
20+
},
21+
"description": "Same Day, Braille, Whitemail, Booklet",
22+
"id": "client3-abnormal-results-braille",
23+
"name": "Client 3 Braille Abnormal Results",
24+
"packSpecificationIds": [
25+
"client3-abnormal-results-braille"
26+
],
27+
"priority": 10,
28+
"status": "INT",
29+
"type": "BRAILLE",
30+
"volumeGroupId": "volumeGroup-test3"
31+
}

0 commit comments

Comments
 (0)