youcanbookme 0.0.1.alpha → 0.0.6.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{.rubocom.yml → .rubocop.yml} +12 -9
- data/CHANGELOG.md +37 -2
- data/README.md +22 -25
- data/lib/youcanbookme/client.rb +235 -13
- data/lib/youcanbookme/error.rb +1 -1
- data/lib/youcanbookme/http_command.rb +6 -1
- data/lib/youcanbookme/{common_module.rb → loggable.rb} +2 -2
- data/lib/youcanbookme/models/account.rb +153 -13
- data/lib/youcanbookme/models/account_allocation.rb +22 -0
- data/lib/youcanbookme/models/account_child.rb +20 -0
- data/lib/youcanbookme/models/{caligraph_safe_local_account.rb → account_parent.rb} +3 -2
- data/lib/youcanbookme/models/action.rb +5 -0
- data/lib/youcanbookme/models/answer.rb +0 -1
- data/lib/youcanbookme/models/booking.rb +8 -4
- data/lib/youcanbookme/models/booking_lobby.rb +2 -1
- data/lib/youcanbookme/models/calendar.rb +1 -1
- data/lib/youcanbookme/models/card.rb +0 -1
- data/lib/youcanbookme/models/event.rb +6 -9
- data/lib/youcanbookme/models/{participant.rb → event_participant.rb} +3 -2
- data/lib/youcanbookme/models/{reminder.rb → event_reminder.rb} +3 -3
- data/lib/youcanbookme/models/link.rb +0 -1
- data/lib/youcanbookme/models/model_utils.rb +8 -6
- data/lib/youcanbookme/models/name_and_address.rb +0 -1
- data/lib/youcanbookme/models/permission.rb +17 -5
- data/lib/youcanbookme/models/profile.rb +4 -3
- data/lib/youcanbookme/models/{profile_local_account.rb → profile_account.rb} +1 -2
- data/lib/youcanbookme/models/profile_afterwards.rb +0 -1
- data/lib/youcanbookme/models/profile_appointment_type.rb +0 -1
- data/lib/youcanbookme/models/profile_appointment_types.rb +0 -1
- data/lib/youcanbookme/models/profile_calendar.rb +6 -1
- data/lib/youcanbookme/models/profile_calendars.rb +0 -1
- data/lib/youcanbookme/models/profile_cancel_or_reschedule.rb +0 -1
- data/lib/youcanbookme/models/profile_display.rb +0 -1
- data/lib/youcanbookme/models/profile_payments.rb +1 -1
- data/lib/youcanbookme/models/profile_remote_account.rb +3 -2
- data/lib/youcanbookme/models/profile_remote_reminder.rb +0 -1
- data/lib/youcanbookme/models/profile_team_member.rb +0 -1
- data/lib/youcanbookme/models/profile_team_members.rb +1 -1
- data/lib/youcanbookme/models/profile_tentative.rb +0 -2
- data/lib/youcanbookme/models/profile_times.rb +1 -1
- data/lib/youcanbookme/models/profile_vouchers.rb +0 -1
- data/lib/youcanbookme/models/provider.rb +0 -1
- data/lib/youcanbookme/models/purchase.rb +8 -4
- data/lib/youcanbookme/models/purchases_sync_changes.rb +0 -1
- data/lib/youcanbookme/models/question.rb +1 -0
- data/lib/youcanbookme/models/remote_account.rb +8 -4
- data/lib/youcanbookme/models/template_event.rb +0 -1
- data/lib/youcanbookme/models/transaction.rb +6 -3
- data/lib/youcanbookme/models/warning.rb +0 -1
- data/lib/youcanbookme/version.rb +1 -1
- metadata +11 -20
- data/lib/youcanbookme/models/appointment_type.rb +0 -7
- data/lib/youcanbookme/models/caligraph_calendar.rb +0 -29
- data/lib/youcanbookme/models/caligraph_event.rb +0 -8
- data/lib/youcanbookme/models/caligraph_link.rb +0 -17
- data/lib/youcanbookme/models/caligraph_local_account.rb +0 -47
- data/lib/youcanbookme/models/caligraph_permission.rb +0 -32
- data/lib/youcanbookme/models/caligraph_remote_account.rb +0 -23
- data/lib/youcanbookme/models/instant.rb +0 -9
- data/lib/youcanbookme/models/local_account.rb +0 -180
- data/lib/youcanbookme/models/query.rb +0 -8
- data/lib/youcanbookme/models/team_member.rb +0 -8
@@ -1,13 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's BookingLobby model.
|
5
4
|
class BookingLobby
|
6
5
|
include ModelUtils
|
7
6
|
|
8
7
|
# @return [String]
|
9
8
|
attr_accessor :outboundUrl
|
10
9
|
# @return [String]
|
10
|
+
# ['UNKNOWN', 'PROBLEM_SUBSCRIPTION', 'PROBLEM_CANCELLED', 'PROBLEM_UNDECIDED', 'PROBLEM_TEMPORARY',
|
11
|
+
# 'PROBLEM_NO_INTEGRATION', 'WAITING', 'FORWARDING', 'CLOSED']
|
11
12
|
attr_accessor :status
|
12
13
|
end
|
13
14
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's Calendar model.
|
5
4
|
class Calendar
|
6
5
|
include ModelUtils
|
7
6
|
|
@@ -38,6 +37,7 @@ module YouCanBookMe
|
|
38
37
|
# @return [Array<YouCanBookMe::Link>]
|
39
38
|
attr_accessor :links
|
40
39
|
# @return [Integer]
|
40
|
+
# [0, 10, 20, 30]
|
41
41
|
attr_accessor :permissionLevel
|
42
42
|
# @return [Boolean]
|
43
43
|
attr_accessor :primary
|
@@ -1,15 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's Event model.
|
5
4
|
class Event
|
6
5
|
include ModelUtils
|
7
6
|
|
8
7
|
ASSOCIATION = {
|
9
8
|
calendar: Calendar,
|
10
9
|
links: Link,
|
11
|
-
participants:
|
12
|
-
reminders:
|
10
|
+
participants: EventParticipant,
|
11
|
+
reminders: EventReminder
|
13
12
|
}.freeze
|
14
13
|
|
15
14
|
# @return [String]
|
@@ -25,6 +24,7 @@ module YouCanBookMe
|
|
25
24
|
# @return [Boolean]
|
26
25
|
attr_accessor :dateOnly
|
27
26
|
# @return [Integer]
|
27
|
+
# [0, 10, 20, 25, 30]
|
28
28
|
attr_accessor :defaultShareLevel
|
29
29
|
# @return [String]
|
30
30
|
attr_accessor :description
|
@@ -35,8 +35,6 @@ module YouCanBookMe
|
|
35
35
|
# @return [String]
|
36
36
|
attr_accessor :endDateTime
|
37
37
|
# @return [String]
|
38
|
-
attr_accessor :endInstant
|
39
|
-
# @return [String]
|
40
38
|
attr_accessor :endTimeZone
|
41
39
|
# @return [String]
|
42
40
|
attr_accessor :endZonedDateTime
|
@@ -46,8 +44,6 @@ module YouCanBookMe
|
|
46
44
|
attr_accessor :failure
|
47
45
|
# @return [String]
|
48
46
|
attr_accessor :foregroundColor
|
49
|
-
# @return [Boolean]
|
50
|
-
attr_accessor :hasDescription
|
51
47
|
# @return [String]
|
52
48
|
attr_accessor :id
|
53
49
|
# @return [Array<YouCanBookMe::Link>]
|
@@ -56,7 +52,7 @@ module YouCanBookMe
|
|
56
52
|
attr_accessor :location
|
57
53
|
# @return [String]
|
58
54
|
attr_accessor :metadata
|
59
|
-
# @return [Array<YouCanBookMe::
|
55
|
+
# @return [Array<YouCanBookMe::EventParticipant>]
|
60
56
|
attr_accessor :participants
|
61
57
|
# @return [Boolean]
|
62
58
|
attr_accessor :private
|
@@ -68,7 +64,7 @@ module YouCanBookMe
|
|
68
64
|
attr_accessor :publicOnly
|
69
65
|
# @return [Array<String>]
|
70
66
|
attr_accessor :recurrences
|
71
|
-
# @return [Array<YouCanBookMe::
|
67
|
+
# @return [Array<YouCanBookMe::EventReminder>]
|
72
68
|
attr_accessor :reminders
|
73
69
|
# @return [Boolean]
|
74
70
|
attr_accessor :restricted
|
@@ -89,6 +85,7 @@ module YouCanBookMe
|
|
89
85
|
# @return [String]
|
90
86
|
attr_accessor :startZonedDateTime
|
91
87
|
# @return [String]
|
88
|
+
# ['confirmed', 'cancelled', 'tentative']
|
92
89
|
attr_accessor :status
|
93
90
|
# @return [String]
|
94
91
|
attr_accessor :title
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
|
5
|
-
class Participant
|
4
|
+
class EventParticipant
|
6
5
|
include ModelUtils
|
7
6
|
|
8
7
|
ASSOCIATION = {
|
@@ -18,8 +17,10 @@ module YouCanBookMe
|
|
18
17
|
# @return [Boolean]
|
19
18
|
attr_accessor :required
|
20
19
|
# @return [String]
|
20
|
+
# ['Attendee', 'Organizer', 'Performer', 'Speaker', 'Chair', 'None', 'Optional', 'Required']
|
21
21
|
attr_accessor :role
|
22
22
|
# @return [String]
|
23
|
+
# ['Accepted', 'Declined', 'Invited', 'Tentative']
|
23
24
|
attr_accessor :status
|
24
25
|
end
|
25
26
|
end
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
|
5
|
-
class Reminder
|
4
|
+
class EventReminder
|
6
5
|
include ModelUtils
|
7
6
|
|
8
7
|
ASSOCIATION = {
|
@@ -10,7 +9,8 @@ module YouCanBookMe
|
|
10
9
|
}.freeze
|
11
10
|
|
12
11
|
# @return [String]
|
13
|
-
|
12
|
+
# ['Email', 'PopUp', 'SMS']
|
13
|
+
attr_accessor :form
|
14
14
|
# @return [String]
|
15
15
|
attr_accessor :id
|
16
16
|
# @return [Array<YouCanBookMe::Link>]
|
@@ -33,9 +33,10 @@ module YouCanBookMe
|
|
33
33
|
end
|
34
34
|
|
35
35
|
# @param [String] prefix
|
36
|
+
# @param [Array<Symbol>] association_filters
|
36
37
|
# @param [Integer] max_depth
|
37
38
|
# @return [Array<String>]
|
38
|
-
def deep_fields(prefix = nil, max_depth: 3)
|
39
|
+
def deep_fields(prefix = nil, association_filters: nil, max_depth: 3) # rubocop:disable Metrics/PerceivedComplexity,Metrics/CyclomaticComplexity
|
39
40
|
ret_fields = []
|
40
41
|
fields(prefix).each do |field_with_prefix|
|
41
42
|
ret_fields << field_with_prefix
|
@@ -43,13 +44,14 @@ module YouCanBookMe
|
|
43
44
|
field = field_with_prefix.split('.')[-1].to_sym
|
44
45
|
next unless defined? self::ASSOCIATION
|
45
46
|
next unless self::ASSOCIATION.key? field
|
47
|
+
next if association_filters&.is_a?(Array) && !association_filters.include?(field)
|
46
48
|
|
47
49
|
child_klass = self::ASSOCIATION[field]
|
48
50
|
child_fields = if (self == child_klass) || depth >= max_depth
|
49
|
-
|
51
|
+
child_klass.fields(field_with_prefix)
|
50
52
|
else
|
51
|
-
|
52
|
-
|
53
|
+
child_klass.deep_fields(field_with_prefix, max_depth: max_depth)
|
54
|
+
end
|
53
55
|
child_fields.each { |c_field| ret_fields << c_field }
|
54
56
|
end
|
55
57
|
ret_fields
|
@@ -60,9 +62,9 @@ module YouCanBookMe
|
|
60
62
|
base.extend ClassMethods
|
61
63
|
end
|
62
64
|
|
63
|
-
|
65
|
+
private
|
64
66
|
|
65
|
-
def set_attributes(attrs)
|
67
|
+
def set_attributes(attrs) # rubocop:disable Metrics/PerceivedComplexity,Metrics/CyclomaticComplexity,Naming/AccessorMethodName
|
66
68
|
return if attrs.nil?
|
67
69
|
return unless attrs.is_a? Hash
|
68
70
|
return if attrs.empty?
|
@@ -1,14 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's Permission model.
|
5
4
|
class Permission
|
6
5
|
include ModelUtils
|
7
6
|
|
8
7
|
ASSOCIATION = {
|
9
8
|
databaseVersion: Permission,
|
10
|
-
|
11
|
-
|
9
|
+
fromAccount: Account,
|
10
|
+
fromLocalAccount: Account,
|
11
|
+
toAccount: Account,
|
12
|
+
toLocalAccount: Account
|
12
13
|
}.freeze
|
13
14
|
|
14
15
|
# @return [String]
|
@@ -17,23 +18,34 @@ module YouCanBookMe
|
|
17
18
|
attr_accessor :databaseVersion
|
18
19
|
# @return [String]
|
19
20
|
attr_accessor :expiresAt
|
20
|
-
# @return [YouCanBookMe::
|
21
|
+
# @return [YouCanBookMe::Account]
|
22
|
+
attr_accessor :fromAccount
|
23
|
+
# @return [YouCanBookMe::Account]
|
21
24
|
attr_accessor :fromLocalAccount
|
22
25
|
# @return [String]
|
23
26
|
attr_accessor :id
|
24
27
|
# @return [String]
|
28
|
+
# ['pushRequest']
|
25
29
|
attr_accessor :requestedAction
|
26
30
|
# @return [String]
|
27
31
|
attr_accessor :resource
|
28
32
|
# @return [String]
|
33
|
+
# ['REQUESTED', 'CONFIRMED', 'REJECTED']
|
29
34
|
attr_accessor :status
|
30
35
|
# @return [Integer]
|
31
36
|
attr_accessor :statusHibernate
|
32
|
-
# @return [YouCanBookMe::
|
37
|
+
# @return [YouCanBookMe::Account]
|
38
|
+
attr_accessor :toAccount
|
39
|
+
# @return [YouCanBookMe::Account]
|
33
40
|
attr_accessor :toLocalAccount
|
34
41
|
# @return [String]
|
42
|
+
# ['ACCOUNTANCY', 'ACCOUNT_ADMINISTRATE', 'ACCOUNT_READ', 'ACCOUNT_WRITE', 'CALENDAR_READ', 'CALENDAR_WRITE',
|
43
|
+
# 'GROUP_SUPPORT', 'PERMISSION_RECEIVE', 'PROFILE_CSS_WRITE', 'PROFILE_READ', 'PROFILE_WRITE', 'REFUND',
|
44
|
+
# 'REMOTE_ACCOUNT_READ', 'REMOTE_ACCOUNT_WRITE']
|
35
45
|
attr_accessor :type
|
36
46
|
# @return [String]
|
47
|
+
attr_accessor :typeHibernate
|
48
|
+
# @return [String]
|
37
49
|
attr_accessor :updatedAt
|
38
50
|
end
|
39
51
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's Profile model.
|
5
4
|
class Profile
|
6
5
|
include ModelUtils
|
7
6
|
|
@@ -9,7 +8,7 @@ module YouCanBookMe
|
|
9
8
|
actions: Action,
|
10
9
|
afterwards: ProfileAfterwards,
|
11
10
|
appointmentTypes: ProfileAppointmentTypes,
|
12
|
-
availableAccounts:
|
11
|
+
availableAccounts: ProfileAccount,
|
13
12
|
calendars: ProfileCalendars,
|
14
13
|
cancelOrReschedule: ProfileCancelOrReschedule,
|
15
14
|
databaseVersion: Profile,
|
@@ -44,7 +43,7 @@ module YouCanBookMe
|
|
44
43
|
attr_accessor :afterwards
|
45
44
|
# @return [YouCanBookMe::ProfileAppointmentTypes]
|
46
45
|
attr_accessor :appointmentTypes
|
47
|
-
# @return [Array<YouCanBookMe::
|
46
|
+
# @return [Array<YouCanBookMe::ProfileAccount>]
|
48
47
|
attr_accessor :availableAccounts
|
49
48
|
# @return [Array<YouCanBookMe::ProfileCalendars>]
|
50
49
|
attr_accessor :calendars
|
@@ -85,10 +84,12 @@ module YouCanBookMe
|
|
85
84
|
# @return [Array<YouCanBookMe::ProfileRemoteReminder>]
|
86
85
|
attr_accessor :remoteReminders
|
87
86
|
# @return [String]
|
87
|
+
# ['rescheduleBookingsForReview', 'migrateTo2049Theme']
|
88
88
|
attr_accessor :requestedAction
|
89
89
|
# @return [YouCanBookMe::ProfileAppointmentTypes]
|
90
90
|
attr_accessor :services
|
91
91
|
# @return [String]
|
92
|
+
# ['ONLINE', 'OFFLINE']
|
92
93
|
attr_accessor :status
|
93
94
|
# @return [String]
|
94
95
|
attr_accessor :subdomain
|
@@ -1,10 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's ProfileCalendar model.
|
5
4
|
class ProfileCalendar
|
6
5
|
include ModelUtils
|
7
6
|
|
7
|
+
ASSOCIATION = {
|
8
|
+
calendar: Calendar
|
9
|
+
}.freeze
|
10
|
+
|
11
|
+
# @return [YouCanBookMe::Calendar]
|
12
|
+
attr_accessor :calendar
|
8
13
|
# @return [String]
|
9
14
|
attr_accessor :id
|
10
15
|
# @return [String]
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's ProfilePayments model.
|
5
4
|
class ProfilePayments
|
6
5
|
include ModelUtils
|
7
6
|
|
@@ -12,6 +11,7 @@ module YouCanBookMe
|
|
12
11
|
# @return [Integer]
|
13
12
|
attr_accessor :currencyFactor
|
14
13
|
# @return [String]
|
14
|
+
# ['STRIPE', 'PAYMILL']
|
15
15
|
attr_accessor :partner
|
16
16
|
# @return [String]
|
17
17
|
attr_accessor :partnerDescription
|
@@ -1,14 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's ProfileRemoteAccount model.
|
5
4
|
class ProfileRemoteAccount
|
6
5
|
include ModelUtils
|
7
6
|
|
8
7
|
ASSOCIATION = {
|
9
8
|
calendars: ProfileCalendar
|
10
|
-
}
|
9
|
+
}.freeze
|
11
10
|
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :accountEmail
|
12
13
|
# @return [Array<YouCanBookMe::ProfileCalendar>]
|
13
14
|
attr_accessor :calendars
|
14
15
|
# @return [String]
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module YouCanBookMe
|
4
|
-
# YouCanBookMe's ProfileTeamMembers model.
|
5
4
|
class ProfileTeamMembers
|
6
5
|
include ModelUtils
|
7
6
|
|
@@ -12,6 +11,7 @@ module YouCanBookMe
|
|
12
11
|
# @return [Boolean]
|
13
12
|
attr_accessor :active
|
14
13
|
# @return [String]
|
14
|
+
# ['ORDERED_FIRST_FREE', 'RANDOM_FIRST_FREE']
|
15
15
|
attr_accessor :allocationStrategy
|
16
16
|
# @return [Boolean]
|
17
17
|
attr_accessor :allowTeamMemberChangeOnReschedule
|