pike13 0.1.0 → 0.1.2
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 +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +2 -1
- data/lib/pike13/api/v2/account/business.rb +0 -5
- data/lib/pike13/api/v2/desk/make_up.rb +0 -5
- data/lib/pike13/validators.rb +12 -34
- data/lib/pike13/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5117c5f082b975cbb6e9a129a6307053ec1f467d38308afe24720177bd83672
|
|
4
|
+
data.tar.gz: ad02587897b224c080c5f239fb76a9006a020467a408a570397a03fb685d2d7c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ae0eb982ed50a1ada4b807be1ae05aa891a8a9ff92552dfe86bb872ddd2e22d0f5d93073b823a15345ede7c33c0df60e0ea51f1f081f586bef2ac4135b7713c
|
|
7
|
+
data.tar.gz: 87559b54a79aee56f30a28f4cf6cd3b12b65d73a9d6863d89de77075dd7bfaea0fe3f9f7108759e94fe57fcfe01755a1f2fcc9db02f87f1ad3da55c81de00384
|
data/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [0.1.2] - 2025-11-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Desk::MakeUp**: Removed unsupported `find(id)` method that was not supported by the Pike13 API v2.
|
|
12
|
+
|
|
13
|
+
## [0.1.1] - 2025-11-02
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **Account::Business**: Removed undocumented `find(id)` method that was not supported by the Pike13 API v2. The API only supports listing all businesses via `GET /account/businesses` endpoint.
|
|
9
17
|
|
|
10
18
|
## [0.1.0] - 2025-10-31
|
|
11
19
|
|
data/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Pike13 Ruby Client
|
|
2
2
|
|
|
3
|
+
[](https://github.com/juanhuttemann/pike13-ruby/actions/workflows/ci.yml)
|
|
4
|
+
|
|
3
5
|
A Ruby gem for interacting with the Pike13 API, supporting both:
|
|
4
6
|
- **[Core API](https://developer.pike13.com/docs/api/v2)** - CRUD operations for managing people, events, invoices, and more
|
|
5
7
|
- **[Reporting API](https://developer.pike13.com/docs/reporting/v3)** - Advanced analytics and reporting queries
|
|
@@ -256,7 +258,6 @@ Pike13::Desk::Note.destroy(person_id: 123, id: 1000)
|
|
|
256
258
|
#### Make-Ups
|
|
257
259
|
|
|
258
260
|
```ruby
|
|
259
|
-
Pike13::Desk::MakeUp.find(1100) # Find make-up
|
|
260
261
|
Pike13::Desk::MakeUp.reasons # List make-up reasons
|
|
261
262
|
Pike13::Desk::MakeUp.generate(visit_id: 456, make_up_reason_id: 5, free_form_reason: "Client was sick")
|
|
262
263
|
```
|
data/lib/pike13/validators.rb
CHANGED
|
@@ -11,13 +11,9 @@ module Pike13
|
|
|
11
11
|
# @raise [ValidationError] if token is invalid
|
|
12
12
|
# @return [Boolean] true if valid
|
|
13
13
|
def self.validate_idempotency_token!(token)
|
|
14
|
-
if token.nil? || token.to_s.strip.empty?
|
|
15
|
-
raise ValidationError, "Idempotency token cannot be blank"
|
|
16
|
-
end
|
|
14
|
+
raise ValidationError, "Idempotency token cannot be blank" if token.nil? || token.to_s.strip.empty?
|
|
17
15
|
|
|
18
|
-
unless token.is_a?(String)
|
|
19
|
-
raise ValidationError, "Idempotency token must be a string, got #{token.class}"
|
|
20
|
-
end
|
|
16
|
+
raise ValidationError, "Idempotency token must be a string, got #{token.class}" unless token.is_a?(String)
|
|
21
17
|
|
|
22
18
|
if token.length > 255
|
|
23
19
|
raise ValidationError, "Idempotency token must be 255 characters or less, got #{token.length}"
|
|
@@ -32,9 +28,7 @@ module Pike13
|
|
|
32
28
|
# @raise [ValidationError] if attributes are invalid
|
|
33
29
|
# @return [Boolean] true if valid
|
|
34
30
|
def self.validate_note_attributes!(attributes)
|
|
35
|
-
unless attributes.is_a?(Hash)
|
|
36
|
-
raise ValidationError, "Note attributes must be a hash, got #{attributes.class}"
|
|
37
|
-
end
|
|
31
|
+
raise ValidationError, "Note attributes must be a hash, got #{attributes.class}" unless attributes.is_a?(Hash)
|
|
38
32
|
|
|
39
33
|
if attributes.key?(:body) || attributes.key?("body")
|
|
40
34
|
raise ValidationError,
|
|
@@ -47,9 +41,7 @@ module Pike13
|
|
|
47
41
|
end
|
|
48
42
|
|
|
49
43
|
note_value = attributes[:note] || attributes["note"]
|
|
50
|
-
if note_value.to_s.strip.empty?
|
|
51
|
-
raise ValidationError, "Note text cannot be blank"
|
|
52
|
-
end
|
|
44
|
+
raise ValidationError, "Note text cannot be blank" if note_value.to_s.strip.empty?
|
|
53
45
|
|
|
54
46
|
true
|
|
55
47
|
end
|
|
@@ -62,13 +54,11 @@ module Pike13
|
|
|
62
54
|
def self.validate_form_of_payment_type!(type)
|
|
63
55
|
valid_types = %w[creditcard ach]
|
|
64
56
|
|
|
65
|
-
unless type.is_a?(String)
|
|
66
|
-
raise ValidationError, "Form of payment type must be a string, got #{type.class}"
|
|
67
|
-
end
|
|
57
|
+
raise ValidationError, "Form of payment type must be a string, got #{type.class}" unless type.is_a?(String)
|
|
68
58
|
|
|
69
59
|
unless valid_types.include?(type.downcase)
|
|
70
60
|
raise ValidationError,
|
|
71
|
-
"Form of payment type must be one of: #{valid_types.join(
|
|
61
|
+
"Form of payment type must be one of: #{valid_types.join(", ")}. Got: '#{type}'"
|
|
72
62
|
end
|
|
73
63
|
|
|
74
64
|
true
|
|
@@ -80,15 +70,11 @@ module Pike13
|
|
|
80
70
|
# @raise [ValidationError] if parameters are invalid
|
|
81
71
|
# @return [Boolean] true if valid
|
|
82
72
|
def self.validate_booking_params!(params)
|
|
83
|
-
unless params.is_a?(Hash)
|
|
84
|
-
raise ValidationError, "Booking parameters must be a hash, got #{params.class}"
|
|
85
|
-
end
|
|
73
|
+
raise ValidationError, "Booking parameters must be a hash, got #{params.class}" unless params.is_a?(Hash)
|
|
86
74
|
|
|
87
75
|
# Check for idempotency token
|
|
88
76
|
token = params[:idempotency_token] || params["idempotency_token"]
|
|
89
|
-
if token
|
|
90
|
-
validate_idempotency_token!(token)
|
|
91
|
-
end
|
|
77
|
+
validate_idempotency_token!(token) if token
|
|
92
78
|
|
|
93
79
|
# Require either event_occurrence_id or leases array
|
|
94
80
|
has_event = params[:event_occurrence_id] || params["event_occurrence_id"]
|
|
@@ -108,27 +94,19 @@ module Pike13
|
|
|
108
94
|
# @raise [ValidationError] if attributes are invalid
|
|
109
95
|
# @return [Boolean] true if valid
|
|
110
96
|
def self.validate_person_attributes!(attributes)
|
|
111
|
-
unless attributes.is_a?(Hash)
|
|
112
|
-
raise ValidationError, "Person attributes must be a hash, got #{attributes.class}"
|
|
113
|
-
end
|
|
97
|
+
raise ValidationError, "Person attributes must be a hash, got #{attributes.class}" unless attributes.is_a?(Hash)
|
|
114
98
|
|
|
115
99
|
# Check required fields
|
|
116
100
|
first_name = attributes[:first_name] || attributes["first_name"]
|
|
117
101
|
last_name = attributes[:last_name] || attributes["last_name"]
|
|
118
102
|
|
|
119
|
-
if first_name.to_s.strip.empty?
|
|
120
|
-
raise ValidationError, "Person must have a first_name"
|
|
121
|
-
end
|
|
103
|
+
raise ValidationError, "Person must have a first_name" if first_name.to_s.strip.empty?
|
|
122
104
|
|
|
123
|
-
if last_name.to_s.strip.empty?
|
|
124
|
-
raise ValidationError, "Person must have a last_name"
|
|
125
|
-
end
|
|
105
|
+
raise ValidationError, "Person must have a last_name" if last_name.to_s.strip.empty?
|
|
126
106
|
|
|
127
107
|
# Validate email format if provided
|
|
128
108
|
email = attributes[:email] || attributes["email"]
|
|
129
|
-
if email && !email.to_s.match?(/\A[^@\s]+@[^@\s]+\z/)
|
|
130
|
-
raise ValidationError, "Invalid email format: #{email}"
|
|
131
|
-
end
|
|
109
|
+
raise ValidationError, "Invalid email format: #{email}" if email && !email.to_s.match?(/\A[^@\s]+@[^@\s]+\z/)
|
|
132
110
|
|
|
133
111
|
true
|
|
134
112
|
end
|
data/lib/pike13/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pike13
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juan Huttemann
|
|
@@ -23,7 +23,7 @@ dependencies:
|
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: '0.21'
|
|
26
|
-
description: A Ruby gem for interacting with the Pike13
|
|
26
|
+
description: A Ruby gem for interacting with the Pike13 API
|
|
27
27
|
email:
|
|
28
28
|
- juanfhuttemann@gmail.com
|
|
29
29
|
executables: []
|
|
@@ -142,5 +142,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
142
142
|
requirements: []
|
|
143
143
|
rubygems_version: 3.6.9
|
|
144
144
|
specification_version: 4
|
|
145
|
-
summary: Ruby client for the Pike13
|
|
145
|
+
summary: Ruby client for the Pike13 API
|
|
146
146
|
test_files: []
|