clover_sandbox_simulator 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a04f7b532c1ce8fd74de943d7a9458b0b29f151ef33a86c80dd3166531dc4225
4
- data.tar.gz: b5745bcc29c8a40ff846e80c512b69f007e5f2851c4f06ed5ad44e837ac96134
3
+ metadata.gz: 9f684b2338da3333984bdf63a1abb0ff18112be9cd5e210e4f2dc3ded17b554f
4
+ data.tar.gz: 193f13605291b79ead034124638c03fc863089e364f73bb1cb4f829281ce00ae
5
5
  SHA512:
6
- metadata.gz: d10a6a0404d3524cd99b9f5864095ca022aba117f5cbe0d911a276be5ca6bd7f537b62ff4dad06cdf621587534f0b7dc8a2e8b2bb114c868662a6ffe4d4b55ea
7
- data.tar.gz: d86c9a3b0459db818e2023885856901b2fe60a89244ca6639131e523b6cd86779128ecba8f381e563b725523c1eb441b2d246259f7e19137df2fad057ac67a85
6
+ metadata.gz: dadd0674dd7b51f92e3df36ad084282fb068831149208fa37cb2238b904a3a2bbb4336433ad88efae1bd0fea9bd2703c0925f5972711decc0aa415798c27f816
7
+ data.tar.gz: 388a79a26a9425fce232d21e08de3b9b9f1dcf86bea42175e27e605fd2c48215dfb78b274ebd28ec40195a1ac8584259766f7801889866f9f1898d6540cd0902
@@ -217,11 +217,14 @@ module CloverSandboxSimulator
217
217
  @merchant_name = merchant["CLOVER_MERCHANT_NAME"]
218
218
  # CLOVER_API_TOKEN = static API token (never expires)
219
219
  # CLOVER_ACCESS_TOKEN = OAuth JWT token (expires, can be refreshed)
220
- # Prefer static API token if available, fall back to OAuth token
220
+ # PRIVATE_TOKEN = Ecommerce API key (can also serve as Bearer token for Platform API)
221
+ # Prefer static API token, fall back to OAuth token, then PRIVATE_TOKEN
221
222
  if merchant["CLOVER_API_TOKEN"].to_s.length > 10
222
223
  @api_token = merchant["CLOVER_API_TOKEN"]
223
224
  elsif merchant["CLOVER_ACCESS_TOKEN"].to_s.length > 10
224
225
  @api_token = merchant["CLOVER_ACCESS_TOKEN"]
226
+ elsif merchant["PRIVATE_TOKEN"].to_s.length > 10
227
+ @api_token = merchant["PRIVATE_TOKEN"]
225
228
  end
226
229
  @refresh_token = merchant["CLOVER_REFRESH_TOKEN"] if merchant["CLOVER_REFRESH_TOKEN"].to_s.length > 10
227
230
  @public_token = merchant["PUBLIC_TOKEN"] unless merchant["PUBLIC_TOKEN"].to_s.empty?
@@ -0,0 +1,24 @@
1
+ {
2
+ "categories": [
3
+ {
4
+ "name": "Haircuts",
5
+ "sort_order": 1,
6
+ "description": "Cuts and trims for all ages"
7
+ },
8
+ {
9
+ "name": "Color Services",
10
+ "sort_order": 2,
11
+ "description": "Color, highlights, and balayage"
12
+ },
13
+ {
14
+ "name": "Spa Treatments",
15
+ "sort_order": 3,
16
+ "description": "Massage and facials"
17
+ },
18
+ {
19
+ "name": "Nail Services",
20
+ "sort_order": 4,
21
+ "description": "Manicures and pedicures"
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,88 @@
1
+ {
2
+ "combos": [
3
+ {
4
+ "id": "cut_and_color",
5
+ "name": "Cut & Color Package",
6
+ "description": "Haircut + any color service for 10% off",
7
+ "discount_type": "percentage",
8
+ "discount_value": 10,
9
+ "required_components": [
10
+ {
11
+ "category": "Haircuts",
12
+ "quantity": 1
13
+ },
14
+ {
15
+ "category": "Color Services",
16
+ "quantity": 1
17
+ }
18
+ ],
19
+ "applies_to": "total",
20
+ "max_discount_amount": 2500,
21
+ "active": true
22
+ },
23
+ {
24
+ "id": "mani_pedi",
25
+ "name": "Mani-Pedi Combo",
26
+ "description": "Manicure + Pedicure for 15% off",
27
+ "discount_type": "percentage",
28
+ "discount_value": 15,
29
+ "required_components": [
30
+ {
31
+ "category": "Nail Services",
32
+ "quantity": 2
33
+ }
34
+ ],
35
+ "applies_to": "total",
36
+ "max_discount_amount": 1500,
37
+ "active": true
38
+ },
39
+ {
40
+ "id": "spa_day",
41
+ "name": "Spa Day Package",
42
+ "description": "Massage + Facial + Manicure for $25 off",
43
+ "discount_type": "fixed",
44
+ "discount_value": 2500,
45
+ "required_components": [
46
+ {
47
+ "category": "Spa Treatments",
48
+ "quantity": 2
49
+ },
50
+ {
51
+ "category": "Nail Services",
52
+ "quantity": 1
53
+ }
54
+ ],
55
+ "applies_to": "total",
56
+ "max_discount_amount": null,
57
+ "active": true
58
+ },
59
+ {
60
+ "id": "bridal_package",
61
+ "name": "Bridal Package",
62
+ "description": "Haircut + Color + Manicure + Facial for 20% off",
63
+ "discount_type": "percentage",
64
+ "discount_value": 20,
65
+ "required_components": [
66
+ {
67
+ "category": "Haircuts",
68
+ "quantity": 1
69
+ },
70
+ {
71
+ "category": "Color Services",
72
+ "quantity": 1
73
+ },
74
+ {
75
+ "category": "Nail Services",
76
+ "quantity": 1
77
+ },
78
+ {
79
+ "category": "Spa Treatments",
80
+ "quantity": 1
81
+ }
82
+ ],
83
+ "applies_to": "total",
84
+ "max_discount_amount": 5000,
85
+ "active": true
86
+ }
87
+ ]
88
+ }
@@ -0,0 +1,96 @@
1
+ {
2
+ "coupon_codes": [
3
+ {
4
+ "code": "NEWCLIENT20",
5
+ "name": "New Client 20% Off",
6
+ "description": "20% off for first-time clients",
7
+ "discount_type": "percentage",
8
+ "discount_value": 20,
9
+ "min_order_amount": 0,
10
+ "max_discount_amount": 5000,
11
+ "valid_from": "2024-01-01T00:00:00Z",
12
+ "valid_until": "2027-12-31T23:59:59Z",
13
+ "usage_limit": null,
14
+ "usage_count": 0,
15
+ "single_use_per_customer": true,
16
+ "new_customers_only": true,
17
+ "stackable": false,
18
+ "applicable_categories": null,
19
+ "excluded_categories": null,
20
+ "active": true
21
+ },
22
+ {
23
+ "code": "RELAX15",
24
+ "name": "Relaxation Discount",
25
+ "description": "15% off any spa treatment",
26
+ "discount_type": "percentage",
27
+ "discount_value": 15,
28
+ "min_order_amount": 0,
29
+ "max_discount_amount": 2500,
30
+ "valid_from": "2024-01-01T00:00:00Z",
31
+ "valid_until": "2027-12-31T23:59:59Z",
32
+ "usage_limit": null,
33
+ "usage_count": 0,
34
+ "single_use_per_customer": false,
35
+ "stackable": false,
36
+ "applicable_categories": ["Spa Treatments"],
37
+ "excluded_categories": null,
38
+ "active": true
39
+ },
40
+ {
41
+ "code": "NAILS10",
42
+ "name": "$10 Off Nails",
43
+ "description": "$10 off any nail service",
44
+ "discount_type": "fixed",
45
+ "discount_value": 1000,
46
+ "min_order_amount": 2500,
47
+ "max_discount_amount": null,
48
+ "valid_from": "2024-01-01T00:00:00Z",
49
+ "valid_until": "2027-12-31T23:59:59Z",
50
+ "usage_limit": 200,
51
+ "usage_count": 42,
52
+ "single_use_per_customer": true,
53
+ "stackable": false,
54
+ "applicable_categories": ["Nail Services"],
55
+ "excluded_categories": null,
56
+ "active": true
57
+ },
58
+ {
59
+ "code": "BIRTHDAY25",
60
+ "name": "Birthday Special",
61
+ "description": "25% off for your birthday month",
62
+ "discount_type": "percentage",
63
+ "discount_value": 25,
64
+ "min_order_amount": 0,
65
+ "max_discount_amount": null,
66
+ "valid_from": "2024-01-01T00:00:00Z",
67
+ "valid_until": "2027-12-31T23:59:59Z",
68
+ "usage_limit": null,
69
+ "usage_count": 0,
70
+ "single_use_per_customer": true,
71
+ "birthday_required": true,
72
+ "stackable": false,
73
+ "applicable_categories": null,
74
+ "excluded_categories": null,
75
+ "active": true
76
+ },
77
+ {
78
+ "code": "REFER20",
79
+ "name": "Referral Code",
80
+ "description": "20% off when referred by a friend",
81
+ "discount_type": "percentage",
82
+ "discount_value": 20,
83
+ "min_order_amount": 0,
84
+ "max_discount_amount": 4000,
85
+ "valid_from": "2024-01-01T00:00:00Z",
86
+ "valid_until": "2027-12-31T23:59:59Z",
87
+ "usage_limit": null,
88
+ "usage_count": 0,
89
+ "single_use_per_customer": true,
90
+ "stackable": false,
91
+ "applicable_categories": null,
92
+ "excluded_categories": null,
93
+ "active": true
94
+ }
95
+ ]
96
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "discounts": [
3
+ {
4
+ "id": "new_client",
5
+ "name": "New Client Special",
6
+ "percentage": 20,
7
+ "description": "20% off first visit for new clients",
8
+ "type": "customer",
9
+ "auto_apply": false
10
+ },
11
+ {
12
+ "id": "referral_discount",
13
+ "name": "Referral Reward",
14
+ "percentage": 15,
15
+ "description": "15% off when referred by an existing client",
16
+ "type": "customer",
17
+ "auto_apply": false
18
+ },
19
+ {
20
+ "id": "senior_discount",
21
+ "name": "Senior Discount",
22
+ "percentage": 10,
23
+ "description": "10% off for seniors 65+",
24
+ "type": "customer",
25
+ "auto_apply": false
26
+ },
27
+ {
28
+ "id": "loyalty_bronze",
29
+ "name": "Loyalty - Bronze",
30
+ "percentage": 5,
31
+ "description": "5% off for 5+ visits",
32
+ "type": "loyalty",
33
+ "min_visits": 5,
34
+ "auto_apply": true
35
+ },
36
+ {
37
+ "id": "loyalty_silver",
38
+ "name": "Loyalty - Silver",
39
+ "percentage": 10,
40
+ "description": "10% off for 10+ visits",
41
+ "type": "loyalty",
42
+ "min_visits": 10,
43
+ "auto_apply": true
44
+ },
45
+ {
46
+ "id": "loyalty_gold",
47
+ "name": "Loyalty - Gold",
48
+ "percentage": 15,
49
+ "description": "15% off for 25+ visits",
50
+ "type": "loyalty",
51
+ "min_visits": 25,
52
+ "auto_apply": true
53
+ },
54
+ {
55
+ "id": "ten_off_color",
56
+ "name": "$10 Off Color Service",
57
+ "amount": 1000,
58
+ "description": "$10 off any color service over $80",
59
+ "type": "threshold",
60
+ "min_order_amount": 8000,
61
+ "auto_apply": false
62
+ },
63
+ {
64
+ "id": "twenty_off",
65
+ "name": "$20 Off",
66
+ "amount": 2000,
67
+ "description": "$20 off services over $100",
68
+ "type": "threshold",
69
+ "min_order_amount": 10000,
70
+ "auto_apply": false
71
+ },
72
+ {
73
+ "id": "nail_addon_discount",
74
+ "name": "Nail Add-On 50% Off",
75
+ "percentage": 50,
76
+ "description": "50% off nail art when added to any manicure or pedicure",
77
+ "type": "line_item",
78
+ "applicable_categories": ["Nail Services"],
79
+ "auto_apply": false
80
+ },
81
+ {
82
+ "id": "weekday_special",
83
+ "name": "Weekday Special",
84
+ "percentage": 10,
85
+ "description": "10% off services Monday-Wednesday",
86
+ "type": "time_based",
87
+ "time_rules": {
88
+ "valid_days": [1, 2, 3]
89
+ },
90
+ "auto_apply": true
91
+ }
92
+ ]
93
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "gift_cards": [
3
+ {
4
+ "card_number": "7012345678901234",
5
+ "initial_balance": 5000,
6
+ "current_balance": 5000,
7
+ "status": "ACTIVE",
8
+ "description": "$50 Salon Gift Card - Full balance"
9
+ },
10
+ {
11
+ "card_number": "7023456789012345",
12
+ "initial_balance": 10000,
13
+ "current_balance": 10000,
14
+ "status": "ACTIVE",
15
+ "description": "$100 Salon Gift Card - Full balance"
16
+ },
17
+ {
18
+ "card_number": "7034567890123456",
19
+ "initial_balance": 15000,
20
+ "current_balance": 15000,
21
+ "status": "ACTIVE",
22
+ "description": "$150 Salon Gift Card - Full balance"
23
+ },
24
+ {
25
+ "card_number": "7045678901234567",
26
+ "initial_balance": 10000,
27
+ "current_balance": 4500,
28
+ "status": "ACTIVE",
29
+ "description": "$100 Salon Gift Card - Partially used ($45 remaining)"
30
+ },
31
+ {
32
+ "card_number": "7056789012345678",
33
+ "initial_balance": 20000,
34
+ "current_balance": 20000,
35
+ "status": "ACTIVE",
36
+ "description": "$200 Salon Gift Card - Full balance"
37
+ }
38
+ ],
39
+ "purchase_denominations": [
40
+ { "amount": 5000, "label": "$50 Salon Gift Card" },
41
+ { "amount": 10000, "label": "$100 Salon Gift Card" },
42
+ { "amount": 15000, "label": "$150 Salon Gift Card" },
43
+ { "amount": 20000, "label": "$200 Salon Gift Card" },
44
+ { "amount": 25000, "label": "$250 Salon Gift Card" }
45
+ ],
46
+ "note": "Salon gift cards — popular for gifts and celebrations"
47
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "items": [
3
+ {
4
+ "name": "Women's Haircut",
5
+ "price": 5500,
6
+ "category": "Haircuts",
7
+ "description": "Full haircut and style (45 min)"
8
+ },
9
+ {
10
+ "name": "Men's Haircut",
11
+ "price": 3000,
12
+ "category": "Haircuts",
13
+ "description": "Classic cut and finish (30 min)"
14
+ },
15
+ {
16
+ "name": "Children's Haircut",
17
+ "price": 2000,
18
+ "category": "Haircuts",
19
+ "description": "Kids cut, ages 12 and under (20 min)"
20
+ },
21
+ {
22
+ "name": "Bang Trim",
23
+ "price": 1500,
24
+ "category": "Haircuts",
25
+ "description": "Quick bang trim between cuts (15 min)"
26
+ },
27
+ {
28
+ "name": "Full Color",
29
+ "price": 12000,
30
+ "category": "Color Services",
31
+ "description": "All-over single process color (120 min)"
32
+ },
33
+ {
34
+ "name": "Highlights (Partial)",
35
+ "price": 9000,
36
+ "category": "Color Services",
37
+ "description": "Partial foil highlights (90 min)"
38
+ },
39
+ {
40
+ "name": "Highlights (Full)",
41
+ "price": 15000,
42
+ "category": "Color Services",
43
+ "description": "Full head foil highlights (120 min)"
44
+ },
45
+ {
46
+ "name": "Balayage",
47
+ "price": 18000,
48
+ "category": "Color Services",
49
+ "description": "Hand-painted color technique (150 min)"
50
+ },
51
+ {
52
+ "name": "Swedish Massage (60min)",
53
+ "price": 9500,
54
+ "category": "Spa Treatments",
55
+ "description": "Relaxation full-body massage"
56
+ },
57
+ {
58
+ "name": "Deep Tissue Massage (60min)",
59
+ "price": 11000,
60
+ "category": "Spa Treatments",
61
+ "description": "Therapeutic deep pressure massage"
62
+ },
63
+ {
64
+ "name": "Hot Stone Massage (60min)",
65
+ "price": 12000,
66
+ "category": "Spa Treatments",
67
+ "description": "Heated basalt stone therapy massage"
68
+ },
69
+ {
70
+ "name": "Facial (60min)",
71
+ "price": 8500,
72
+ "category": "Spa Treatments",
73
+ "description": "Customized facial with extractions"
74
+ },
75
+ {
76
+ "name": "Manicure",
77
+ "price": 2500,
78
+ "category": "Nail Services",
79
+ "description": "Classic manicure with polish (30 min)"
80
+ },
81
+ {
82
+ "name": "Pedicure",
83
+ "price": 3500,
84
+ "category": "Nail Services",
85
+ "description": "Classic pedicure with polish (45 min)"
86
+ },
87
+ {
88
+ "name": "Gel Manicure",
89
+ "price": 4000,
90
+ "category": "Nail Services",
91
+ "description": "Long-lasting gel polish manicure (45 min)"
92
+ },
93
+ {
94
+ "name": "Acrylic Full Set",
95
+ "price": 5500,
96
+ "category": "Nail Services",
97
+ "description": "Full set of acrylic nail extensions (60 min)"
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "modifier_groups": [
3
+ {
4
+ "name": "Stylist Level",
5
+ "min_required": 0,
6
+ "max_allowed": 1,
7
+ "modifiers": [
8
+ { "name": "Junior Stylist", "price": 0 },
9
+ { "name": "Senior Stylist", "price": 1500 },
10
+ { "name": "Master Stylist", "price": 3000 },
11
+ { "name": "Artistic Director", "price": 5000 }
12
+ ]
13
+ },
14
+ {
15
+ "name": "Add-On Treatments",
16
+ "min_required": 0,
17
+ "max_allowed": 3,
18
+ "modifiers": [
19
+ { "name": "Deep Conditioning Treatment", "price": 2500 },
20
+ { "name": "Scalp Treatment", "price": 2000 },
21
+ { "name": "Gloss Treatment", "price": 3500 },
22
+ { "name": "Olaplex Treatment", "price": 4500 },
23
+ { "name": "Keratin Treatment", "price": 8000 }
24
+ ]
25
+ },
26
+ {
27
+ "name": "Nail Art",
28
+ "min_required": 0,
29
+ "max_allowed": 1,
30
+ "modifiers": [
31
+ { "name": "Simple Design (2 nails)", "price": 500 },
32
+ { "name": "Full Art (all nails)", "price": 1500 },
33
+ { "name": "Chrome/Ombre Finish", "price": 1000 },
34
+ { "name": "French Tips", "price": 800 }
35
+ ]
36
+ },
37
+ {
38
+ "name": "Massage Upgrade",
39
+ "min_required": 0,
40
+ "max_allowed": 2,
41
+ "modifiers": [
42
+ { "name": "Aromatherapy", "price": 1000 },
43
+ { "name": "CBD Oil", "price": 1500 },
44
+ { "name": "Extended 30 min", "price": 5000 },
45
+ { "name": "Couples Room", "price": 2000 }
46
+ ]
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "tax_rates": [
3
+ {
4
+ "name": "Service Tax",
5
+ "rate": 8.25,
6
+ "is_default": true,
7
+ "description": "Standard sales tax on salon and spa services"
8
+ }
9
+ ],
10
+ "category_tax_mapping": {
11
+ "Haircuts": ["Service Tax"],
12
+ "Color Services": ["Service Tax"],
13
+ "Spa Treatments": ["Service Tax"],
14
+ "Nail Services": ["Service Tax"],
15
+ "default": ["Service Tax"]
16
+ }
17
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "tenders": [
3
+ {
4
+ "label": "Cash",
5
+ "label_key": "com.clover.tender.cash",
6
+ "opens_cash_drawer": true,
7
+ "weight": 25
8
+ },
9
+ {
10
+ "label": "Check",
11
+ "label_key": "com.clover.tender.check",
12
+ "opens_cash_drawer": true,
13
+ "weight": 5
14
+ },
15
+ {
16
+ "label": "Gift Card",
17
+ "label_key": "com.clover.tender.external_gift_card",
18
+ "opens_cash_drawer": false,
19
+ "weight": 20
20
+ },
21
+ {
22
+ "label": "External Payment",
23
+ "label_key": "com.clover.tender.external_payment",
24
+ "opens_cash_drawer": false,
25
+ "weight": 10
26
+ },
27
+ {
28
+ "label": "Mobile Payment",
29
+ "label_key": "com.clover.tender.mobile_payment",
30
+ "opens_cash_drawer": false,
31
+ "weight": 20
32
+ },
33
+ {
34
+ "label": "Store Credit",
35
+ "label_key": "com.clover.tender.store_credit",
36
+ "opens_cash_drawer": false,
37
+ "weight": 10
38
+ }
39
+ ],
40
+ "note": "Credit Card and Debit Card are intentionally excluded - they are broken in Clover sandbox"
41
+ }
@@ -10,7 +10,7 @@ require "dotenv"
10
10
  Dotenv.load
11
11
 
12
12
  module CloverSandboxSimulator
13
- VERSION = "1.5.1"
13
+ VERSION = "1.6.0"
14
14
 
15
15
  class Error < StandardError; end
16
16
  class ConfigurationError < Error; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clover_sandbox_simulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dan1d
@@ -257,6 +257,15 @@ files:
257
257
  - lib/clover_sandbox_simulator/data/restaurant/modifiers.json
258
258
  - lib/clover_sandbox_simulator/data/restaurant/tax_rates.json
259
259
  - lib/clover_sandbox_simulator/data/restaurant/tenders.json
260
+ - lib/clover_sandbox_simulator/data/salon_spa/categories.json
261
+ - lib/clover_sandbox_simulator/data/salon_spa/combos.json
262
+ - lib/clover_sandbox_simulator/data/salon_spa/coupon_codes.json
263
+ - lib/clover_sandbox_simulator/data/salon_spa/discounts.json
264
+ - lib/clover_sandbox_simulator/data/salon_spa/gift_cards.json
265
+ - lib/clover_sandbox_simulator/data/salon_spa/items.json
266
+ - lib/clover_sandbox_simulator/data/salon_spa/modifiers.json
267
+ - lib/clover_sandbox_simulator/data/salon_spa/tax_rates.json
268
+ - lib/clover_sandbox_simulator/data/salon_spa/tenders.json
260
269
  - lib/clover_sandbox_simulator/database.rb
261
270
  - lib/clover_sandbox_simulator/db/factories/api_requests.rb
262
271
  - lib/clover_sandbox_simulator/db/factories/business_types.rb