pike13 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5f3e87a08c579d9ce3a38bf31c5b22005bddf994ccce24e7f00141acb05d7c6
4
- data.tar.gz: 6d4dda290d920e1c0a23fa00eb7eb7eeca1c9a6da0bb2e35430d6dc2860f4fac
3
+ metadata.gz: d5117c5f082b975cbb6e9a129a6307053ec1f467d38308afe24720177bd83672
4
+ data.tar.gz: ad02587897b224c080c5f239fb76a9006a020467a408a570397a03fb685d2d7c
5
5
  SHA512:
6
- metadata.gz: 85846555ad55cb506f48b72448e0299b80e3b74fb65c401087b953f8b5dce051f7a5ae24aac8a5779334871820763a9c0a8e773e8938059404c615bc0365085f
7
- data.tar.gz: 101ece99ffe6d5fd57f557e77e706b2ed8125e3cfa77eae1aba0dd3233ca8c05edf49c37503514f01ce6dc02aecf2701b6fcf6237e03e97d3bdf8ce7903c391d
6
+ metadata.gz: 1ae0eb982ed50a1ada4b807be1ae05aa891a8a9ff92552dfe86bb872ddd2e22d0f5d93073b823a15345ede7c33c0df60e0ea51f1f081f586bef2ac4135b7713c
7
+ data.tar.gz: 87559b54a79aee56f30a28f4cf6cd3b12b65d73a9d6863d89de77075dd7bfaea0fe3f9f7108759e94fe57fcfe01755a1f2fcc9db02f87f1ad3da55c81de00384
data/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ 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
+ ## [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
+
8
13
  ## [0.1.1] - 2025-11-02
9
14
 
10
15
  ### Fixed
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Pike13 Ruby Client
2
2
 
3
+ [![CI](https://github.com/juanhuttemann/pike13-ruby/actions/workflows/ci.yml/badge.svg)](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
  ```
@@ -10,7 +10,6 @@ module Pike13
10
10
  def all
11
11
  client.get("account/businesses")
12
12
  end
13
-
14
13
  end
15
14
  end
16
15
  end
@@ -6,11 +6,6 @@ module Pike13
6
6
  module Desk
7
7
  class MakeUp < Base
8
8
  class << self
9
- # GET /desk/make_ups/:id
10
- def find(id)
11
- client.get("desk/make_ups/#{id}")
12
- end
13
-
14
9
  # GET /desk/make_ups/reasons
15
10
  def reasons
16
11
  client.get("desk/make_ups/reasons")
@@ -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(', ')}. Got: '#{type}'"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pike13
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Huttemann