pike13-cli 0.1.4
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 +7 -0
- data/CHANGELOG.md +196 -0
- data/CONTRIBUTING.md +96 -0
- data/LICENSE.txt +21 -0
- data/README.md +896 -0
- data/bin/pike13 +6 -0
- data/completions/_pike13 +229 -0
- data/completions/pike13.bash +112 -0
- data/lib/pike13/cli/commands/account/business.rb +22 -0
- data/lib/pike13/cli/commands/account/confirmation.rb +21 -0
- data/lib/pike13/cli/commands/account/password.rb +21 -0
- data/lib/pike13/cli/commands/account/person.rb +22 -0
- data/lib/pike13/cli/commands/account.rb +33 -0
- data/lib/pike13/cli/commands/base.rb +350 -0
- data/lib/pike13/cli/commands/concerns/formattable_command.rb +48 -0
- data/lib/pike13/cli/commands/concerns/reporting_query.rb +59 -0
- data/lib/pike13/cli/commands/desk/appointment.rb +58 -0
- data/lib/pike13/cli/commands/desk/booking.rb +56 -0
- data/lib/pike13/cli/commands/desk/business.rb +20 -0
- data/lib/pike13/cli/commands/desk/custom_field.rb +27 -0
- data/lib/pike13/cli/commands/desk/event.rb +32 -0
- data/lib/pike13/cli/commands/desk/event_occurrence.rb +64 -0
- data/lib/pike13/cli/commands/desk/event_occurrence_note.rb +82 -0
- data/lib/pike13/cli/commands/desk/event_occurrence_visit.rb +26 -0
- data/lib/pike13/cli/commands/desk/event_occurrence_waitlist_entry.rb +26 -0
- data/lib/pike13/cli/commands/desk/form_of_payment.rb +75 -0
- data/lib/pike13/cli/commands/desk/invoice.rb +29 -0
- data/lib/pike13/cli/commands/desk/location.rb +29 -0
- data/lib/pike13/cli/commands/desk/make_up.rb +51 -0
- data/lib/pike13/cli/commands/desk/note.rb +71 -0
- data/lib/pike13/cli/commands/desk/pack.rb +20 -0
- data/lib/pike13/cli/commands/desk/pack_product.rb +101 -0
- data/lib/pike13/cli/commands/desk/payment.rb +44 -0
- data/lib/pike13/cli/commands/desk/person.rb +98 -0
- data/lib/pike13/cli/commands/desk/person_plan.rb +27 -0
- data/lib/pike13/cli/commands/desk/person_visit.rb +27 -0
- data/lib/pike13/cli/commands/desk/person_waitlist_entry.rb +27 -0
- data/lib/pike13/cli/commands/desk/person_waiver.rb +27 -0
- data/lib/pike13/cli/commands/desk/plan.rb +29 -0
- data/lib/pike13/cli/commands/desk/plan_product.rb +35 -0
- data/lib/pike13/cli/commands/desk/punch.rb +20 -0
- data/lib/pike13/cli/commands/desk/refund.rb +31 -0
- data/lib/pike13/cli/commands/desk/revenue_category.rb +36 -0
- data/lib/pike13/cli/commands/desk/sales_tax.rb +36 -0
- data/lib/pike13/cli/commands/desk/service.rb +29 -0
- data/lib/pike13/cli/commands/desk/staff_member.rb +35 -0
- data/lib/pike13/cli/commands/desk/visit.rb +36 -0
- data/lib/pike13/cli/commands/desk/waitlist_entry.rb +69 -0
- data/lib/pike13/cli/commands/desk.rb +172 -0
- data/lib/pike13/cli/commands/front/appointment.rb +31 -0
- data/lib/pike13/cli/commands/front/booking.rb +56 -0
- data/lib/pike13/cli/commands/front/branding.rb +17 -0
- data/lib/pike13/cli/commands/front/business.rb +17 -0
- data/lib/pike13/cli/commands/front/event.rb +22 -0
- data/lib/pike13/cli/commands/front/event_occurrence.rb +35 -0
- data/lib/pike13/cli/commands/front/event_occurrence_note.rb +35 -0
- data/lib/pike13/cli/commands/front/event_occurrence_waitlist_eligibility.rb +27 -0
- data/lib/pike13/cli/commands/front/form_of_payment.rb +83 -0
- data/lib/pike13/cli/commands/front/location.rb +22 -0
- data/lib/pike13/cli/commands/front/person.rb +17 -0
- data/lib/pike13/cli/commands/front/person_plan.rb +26 -0
- data/lib/pike13/cli/commands/front/person_visit.rb +26 -0
- data/lib/pike13/cli/commands/front/person_waitlist_entry.rb +26 -0
- data/lib/pike13/cli/commands/front/person_waiver.rb +26 -0
- data/lib/pike13/cli/commands/front/plan_product.rb +31 -0
- data/lib/pike13/cli/commands/front/plan_terms.rb +42 -0
- data/lib/pike13/cli/commands/front/service.rb +22 -0
- data/lib/pike13/cli/commands/front.rb +113 -0
- data/lib/pike13/cli/commands/report/clients.rb +27 -0
- data/lib/pike13/cli/commands/report/enrollments.rb +27 -0
- data/lib/pike13/cli/commands/report/event_occurrence_staff_members.rb +31 -0
- data/lib/pike13/cli/commands/report/event_occurrences.rb +31 -0
- data/lib/pike13/cli/commands/report/invoice_item_transactions.rb +31 -0
- data/lib/pike13/cli/commands/report/invoice_items.rb +31 -0
- data/lib/pike13/cli/commands/report/invoices.rb +27 -0
- data/lib/pike13/cli/commands/report/monthly_business_metrics.rb +31 -0
- data/lib/pike13/cli/commands/report/pays.rb +27 -0
- data/lib/pike13/cli/commands/report/person_plans.rb +31 -0
- data/lib/pike13/cli/commands/report/staff_members.rb +31 -0
- data/lib/pike13/cli/commands/report/transactions.rb +27 -0
- data/lib/pike13/cli/commands/report.rb +77 -0
- data/lib/pike13/cli/config.rb +26 -0
- data/lib/pike13/cli/formatter.rb +142 -0
- data/lib/pike13/cli/progress.rb +85 -0
- data/lib/pike13/cli/thor_nested_subcommand.rb +37 -0
- data/lib/pike13/cli/version.rb +7 -0
- data/lib/pike13/cli.rb +70 -0
- metadata +187 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "base"
|
|
4
|
+
require_relative "desk/person"
|
|
5
|
+
require_relative "desk/event"
|
|
6
|
+
require_relative "desk/event_occurrence"
|
|
7
|
+
require_relative "desk/event_occurrence_note"
|
|
8
|
+
require_relative "desk/event_occurrence_visit"
|
|
9
|
+
require_relative "desk/event_occurrence_waitlist_entry"
|
|
10
|
+
require_relative "desk/booking"
|
|
11
|
+
require_relative "desk/appointment"
|
|
12
|
+
require_relative "desk/visit"
|
|
13
|
+
require_relative "desk/invoice"
|
|
14
|
+
require_relative "desk/payment"
|
|
15
|
+
require_relative "desk/refund"
|
|
16
|
+
require_relative "desk/location"
|
|
17
|
+
require_relative "desk/service"
|
|
18
|
+
require_relative "desk/staff_member"
|
|
19
|
+
require_relative "desk/plan"
|
|
20
|
+
require_relative "desk/note"
|
|
21
|
+
require_relative "desk/custom_field"
|
|
22
|
+
require_relative "desk/revenue_category"
|
|
23
|
+
require_relative "desk/sales_tax"
|
|
24
|
+
require_relative "desk/make_up"
|
|
25
|
+
require_relative "desk/waitlist_entry"
|
|
26
|
+
require_relative "desk/person_visit"
|
|
27
|
+
require_relative "desk/person_plan"
|
|
28
|
+
require_relative "desk/person_waitlist_entry"
|
|
29
|
+
require_relative "desk/person_waiver"
|
|
30
|
+
require_relative "desk/form_of_payment"
|
|
31
|
+
require_relative "desk/pack"
|
|
32
|
+
require_relative "desk/punch"
|
|
33
|
+
require_relative "desk/plan_product"
|
|
34
|
+
require_relative "desk/pack_product"
|
|
35
|
+
require_relative "desk/business"
|
|
36
|
+
|
|
37
|
+
module Pike13
|
|
38
|
+
module CLI
|
|
39
|
+
module Commands
|
|
40
|
+
class Desk < Base
|
|
41
|
+
desc "business SUBCOMMAND", "Manage business details"
|
|
42
|
+
subcommand "business", Desk::Business
|
|
43
|
+
|
|
44
|
+
desc "people SUBCOMMAND", "Manage people"
|
|
45
|
+
subcommand "people", Desk::Person
|
|
46
|
+
|
|
47
|
+
desc "events SUBCOMMAND", "Manage events"
|
|
48
|
+
subcommand "events", Desk::Event
|
|
49
|
+
|
|
50
|
+
desc "event_occurrences SUBCOMMAND", "Manage event occurrences"
|
|
51
|
+
subcommand "event_occurrences", Desk::EventOccurrence
|
|
52
|
+
|
|
53
|
+
desc "eo SUBCOMMAND", "Manage event occurrences (shortcut)"
|
|
54
|
+
subcommand "eo", Desk::EventOccurrence
|
|
55
|
+
|
|
56
|
+
desc "event_occurrence_notes SUBCOMMAND", "Manage event occurrence notes"
|
|
57
|
+
subcommand "event_occurrence_notes", Desk::EventOccurrenceNote
|
|
58
|
+
|
|
59
|
+
desc "eon SUBCOMMAND", "Manage event occurrence notes (shortcut)"
|
|
60
|
+
subcommand "eon", Desk::EventOccurrenceNote
|
|
61
|
+
|
|
62
|
+
desc "event_occurrence_visits SUBCOMMAND", "Manage event occurrence visits"
|
|
63
|
+
subcommand "event_occurrence_visits", Desk::EventOccurrenceVisit
|
|
64
|
+
|
|
65
|
+
desc "event_occurrence_waitlist_entries SUBCOMMAND", "Manage event occurrence waitlist entries"
|
|
66
|
+
subcommand "event_occurrence_waitlist_entries", Desk::EventOccurrenceWaitlistEntry
|
|
67
|
+
|
|
68
|
+
desc "bookings SUBCOMMAND", "Manage bookings"
|
|
69
|
+
subcommand "bookings", Desk::Booking
|
|
70
|
+
|
|
71
|
+
desc "appointments SUBCOMMAND", "Manage appointments"
|
|
72
|
+
subcommand "appointments", Desk::Appointment
|
|
73
|
+
|
|
74
|
+
desc "visits SUBCOMMAND", "Manage visits"
|
|
75
|
+
subcommand "visits", Desk::Visit
|
|
76
|
+
|
|
77
|
+
desc "invoices SUBCOMMAND", "Manage invoices"
|
|
78
|
+
subcommand "invoices", Desk::Invoice
|
|
79
|
+
|
|
80
|
+
desc "payments SUBCOMMAND", "Manage payments"
|
|
81
|
+
subcommand "payments", Desk::Payment
|
|
82
|
+
|
|
83
|
+
desc "refunds SUBCOMMAND", "Manage refunds"
|
|
84
|
+
subcommand "refunds", Desk::Refund
|
|
85
|
+
|
|
86
|
+
desc "locations SUBCOMMAND", "Manage locations"
|
|
87
|
+
subcommand "locations", Desk::Location
|
|
88
|
+
|
|
89
|
+
desc "services SUBCOMMAND", "Manage services"
|
|
90
|
+
subcommand "services", Desk::Service
|
|
91
|
+
|
|
92
|
+
desc "staff SUBCOMMAND", "Manage staff members"
|
|
93
|
+
subcommand "staff", Desk::StaffMember
|
|
94
|
+
|
|
95
|
+
desc "plans SUBCOMMAND", "Manage plans"
|
|
96
|
+
subcommand "plans", Desk::Plan
|
|
97
|
+
|
|
98
|
+
desc "notes SUBCOMMAND", "Manage person notes"
|
|
99
|
+
subcommand "notes", Desk::Note
|
|
100
|
+
|
|
101
|
+
desc "custom_fields SUBCOMMAND", "Manage custom fields"
|
|
102
|
+
subcommand "custom_fields", Desk::CustomField
|
|
103
|
+
|
|
104
|
+
desc "cf SUBCOMMAND", "Manage custom fields (shortcut)"
|
|
105
|
+
subcommand "cf", Desk::CustomField
|
|
106
|
+
|
|
107
|
+
desc "revenue_categories SUBCOMMAND", "Manage revenue categories"
|
|
108
|
+
subcommand "revenue_categories", Desk::RevenueCategory
|
|
109
|
+
|
|
110
|
+
desc "rc SUBCOMMAND", "Manage revenue categories (shortcut)"
|
|
111
|
+
subcommand "rc", Desk::RevenueCategory
|
|
112
|
+
|
|
113
|
+
desc "sales_taxes SUBCOMMAND", "Manage sales taxes"
|
|
114
|
+
subcommand "sales_taxes", Desk::SalesTax
|
|
115
|
+
|
|
116
|
+
desc "st SUBCOMMAND", "Manage sales taxes (shortcut)"
|
|
117
|
+
subcommand "st", Desk::SalesTax
|
|
118
|
+
|
|
119
|
+
desc "make_ups SUBCOMMAND", "Manage make-ups"
|
|
120
|
+
subcommand "make_ups", Desk::MakeUp
|
|
121
|
+
|
|
122
|
+
desc "mu SUBCOMMAND", "Manage make-ups (shortcut)"
|
|
123
|
+
subcommand "mu", Desk::MakeUp
|
|
124
|
+
|
|
125
|
+
desc "waitlist SUBCOMMAND", "Manage waitlist entries"
|
|
126
|
+
subcommand "waitlist", Desk::WaitlistEntry
|
|
127
|
+
|
|
128
|
+
desc "person_visits SUBCOMMAND", "Manage person visits"
|
|
129
|
+
subcommand "person_visits", Desk::PersonVisit
|
|
130
|
+
|
|
131
|
+
desc "pv SUBCOMMAND", "Manage person visits (shortcut)"
|
|
132
|
+
subcommand "pv", Desk::PersonVisit
|
|
133
|
+
|
|
134
|
+
desc "person_plans SUBCOMMAND", "Manage person plans"
|
|
135
|
+
subcommand "person_plans", Desk::PersonPlan
|
|
136
|
+
|
|
137
|
+
desc "ppl SUBCOMMAND", "Manage person plans (shortcut)"
|
|
138
|
+
subcommand "ppl", Desk::PersonPlan
|
|
139
|
+
|
|
140
|
+
desc "person_waitlist SUBCOMMAND", "Manage person waitlist entries"
|
|
141
|
+
subcommand "person_waitlist", Desk::PersonWaitlistEntry
|
|
142
|
+
|
|
143
|
+
desc "pwl SUBCOMMAND", "Manage person waitlist entries (shortcut)"
|
|
144
|
+
subcommand "pwl", Desk::PersonWaitlistEntry
|
|
145
|
+
|
|
146
|
+
desc "person_waivers SUBCOMMAND", "Manage person waivers"
|
|
147
|
+
subcommand "person_waivers", Desk::PersonWaiver
|
|
148
|
+
|
|
149
|
+
desc "pw SUBCOMMAND", "Manage person waivers (shortcut)"
|
|
150
|
+
subcommand "pw", Desk::PersonWaiver
|
|
151
|
+
|
|
152
|
+
desc "forms_of_payment SUBCOMMAND", "Manage forms of payment"
|
|
153
|
+
subcommand "forms_of_payment", Desk::FormOfPayment
|
|
154
|
+
|
|
155
|
+
desc "fop SUBCOMMAND", "Manage forms of payment (shortcut)"
|
|
156
|
+
subcommand "fop", Desk::FormOfPayment
|
|
157
|
+
|
|
158
|
+
desc "packs SUBCOMMAND", "Manage packs"
|
|
159
|
+
subcommand "packs", Desk::Pack
|
|
160
|
+
|
|
161
|
+
desc "punches SUBCOMMAND", "Manage punches"
|
|
162
|
+
subcommand "punches", Desk::Punch
|
|
163
|
+
|
|
164
|
+
desc "plan_products SUBCOMMAND", "Manage plan products"
|
|
165
|
+
subcommand "plan_products", Desk::PlanProduct
|
|
166
|
+
|
|
167
|
+
desc "pack_products SUBCOMMAND", "Manage pack products"
|
|
168
|
+
subcommand "pack_products", Desk::PackProduct
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Appointment < Base
|
|
8
|
+
desc "available SERVICE_ID", "Find available appointment slots (client view)"
|
|
9
|
+
format_options
|
|
10
|
+
option :date, type: :string, required: true, desc: "Date to check (YYYY-MM-DD)"
|
|
11
|
+
option :location_ids, type: :array, desc: "Location IDs to filter by"
|
|
12
|
+
option :staff_member_ids, type: :array, desc: "Staff member IDs to filter by"
|
|
13
|
+
def available(service_id)
|
|
14
|
+
validate_date_format(options[:date], "date")
|
|
15
|
+
|
|
16
|
+
handle_error do
|
|
17
|
+
params = { date: options[:date] }
|
|
18
|
+
params[:location_ids] = options[:location_ids] if options[:location_ids]
|
|
19
|
+
params[:staff_member_ids] = options[:staff_member_ids] if options[:staff_member_ids]
|
|
20
|
+
|
|
21
|
+
result = with_progress("Fetching available slots") do
|
|
22
|
+
Pike13::Front::Appointment.find_available_slots(service_id: service_id, **params)
|
|
23
|
+
end
|
|
24
|
+
output(result)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Booking < Base
|
|
8
|
+
desc "get ID", "Get a booking by ID (client view)"
|
|
9
|
+
format_options
|
|
10
|
+
def get(id)
|
|
11
|
+
handle_error { output(Pike13::Front::Booking.find(id)) }
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
desc "create", "Create a booking (client view)"
|
|
15
|
+
format_options
|
|
16
|
+
option :event_occurrence_id, type: :numeric, required: true, desc: "Event occurrence ID"
|
|
17
|
+
option :person_id, type: :numeric, required: true, desc: "Person ID"
|
|
18
|
+
def create
|
|
19
|
+
handle_error do
|
|
20
|
+
require "securerandom"
|
|
21
|
+
attributes = {
|
|
22
|
+
event_occurrence_id: options[:event_occurrence_id],
|
|
23
|
+
person_id: options[:person_id],
|
|
24
|
+
idempotency_token: SecureRandom.uuid
|
|
25
|
+
}
|
|
26
|
+
result = Pike13::Front::Booking.create(attributes)
|
|
27
|
+
output(result)
|
|
28
|
+
success_message "Booking created successfully"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc "update ID", "Update a booking (client view)"
|
|
33
|
+
format_options
|
|
34
|
+
option :state, type: :string, desc: "Booking state"
|
|
35
|
+
def update(id)
|
|
36
|
+
handle_error do
|
|
37
|
+
attributes = {}
|
|
38
|
+
attributes[:state] = options[:state] if options[:state]
|
|
39
|
+
result = Pike13::Front::Booking.update(id, attributes)
|
|
40
|
+
output(result)
|
|
41
|
+
success_message "Booking updated successfully"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
desc "delete ID", "Delete a booking (client view)"
|
|
46
|
+
def delete(id)
|
|
47
|
+
handle_error do
|
|
48
|
+
Pike13::Front::Booking.destroy(id)
|
|
49
|
+
success_message "Booking #{id} deleted successfully"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Branding < Base
|
|
8
|
+
desc "show", "Get branding"
|
|
9
|
+
format_options
|
|
10
|
+
def show
|
|
11
|
+
handle_error { output(Pike13::Front::Branding.find) }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Business < Base
|
|
8
|
+
desc "show", "Get business info"
|
|
9
|
+
format_options
|
|
10
|
+
def show
|
|
11
|
+
handle_error { output(Pike13::Front::Business.find) }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Event < Base
|
|
8
|
+
desc "list", "List events (client view)"
|
|
9
|
+
format_options
|
|
10
|
+
def list
|
|
11
|
+
handle_error do
|
|
12
|
+
result = with_progress("Fetching events") do
|
|
13
|
+
Pike13::Front::Event.all
|
|
14
|
+
end
|
|
15
|
+
output(result)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class EventOccurrence < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front event_occurrences"
|
|
11
|
+
end
|
|
12
|
+
desc "list", "List event occurrences (client view)"
|
|
13
|
+
format_options
|
|
14
|
+
option :from, type: :string, desc: "Start date (YYYY-MM-DD)"
|
|
15
|
+
option :to, type: :string, desc: "End date (YYYY-MM-DD)"
|
|
16
|
+
def list
|
|
17
|
+
validate_date_format(options[:from], "from") if options[:from]
|
|
18
|
+
validate_date_format(options[:to], "to") if options[:to]
|
|
19
|
+
|
|
20
|
+
handle_error do
|
|
21
|
+
params = {}
|
|
22
|
+
params[:from] = options[:from] if options[:from]
|
|
23
|
+
params[:to] = options[:to] if options[:to]
|
|
24
|
+
|
|
25
|
+
result = with_progress("Fetching event occurrences") do
|
|
26
|
+
Pike13::Front::EventOccurrence.all(**params)
|
|
27
|
+
end
|
|
28
|
+
output(result)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class EventOccurrenceNote < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front event_occurrence_notes"
|
|
11
|
+
end
|
|
12
|
+
desc "list EVENT_OCCURRENCE_ID", "List notes for an event occurrence"
|
|
13
|
+
format_options
|
|
14
|
+
def list(event_occurrence_id)
|
|
15
|
+
handle_error do
|
|
16
|
+
result = with_progress("Fetching event occurrence notes") do
|
|
17
|
+
Pike13::Front::EventOccurrenceNote.all(event_occurrence_id: event_occurrence_id)
|
|
18
|
+
end
|
|
19
|
+
output(result)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "get EVENT_OCCURRENCE_ID ID", "Get a specific note for an event occurrence"
|
|
24
|
+
format_options
|
|
25
|
+
def get(event_occurrence_id, id)
|
|
26
|
+
handle_error do
|
|
27
|
+
result = Pike13::Front::EventOccurrenceNote.find(event_occurrence_id: event_occurrence_id, id: id)
|
|
28
|
+
output(result)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class EventOccurrenceWaitlistEligibility < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front event_occurrence_waitlist_eligibilities"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
desc "list EVENT_OCCURRENCE_ID", "List waitlist eligibility for an event occurrence"
|
|
14
|
+
format_options
|
|
15
|
+
def list(event_occurrence_id)
|
|
16
|
+
handle_error do
|
|
17
|
+
result = with_progress("Fetching waitlist eligibility") do
|
|
18
|
+
Pike13::Front::EventOccurrenceWaitlistEligibility.all(event_occurrence_id: event_occurrence_id)
|
|
19
|
+
end
|
|
20
|
+
output(result)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class FormOfPayment < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front forms_of_payment"
|
|
11
|
+
end
|
|
12
|
+
desc "list PERSON_ID", "List forms of payment for a person (client view)"
|
|
13
|
+
format_options
|
|
14
|
+
def list(person_id)
|
|
15
|
+
handle_error do
|
|
16
|
+
result = with_progress("Fetching forms of payment") do
|
|
17
|
+
Pike13::Front::FormOfPayment.all(person_id: person_id)
|
|
18
|
+
end
|
|
19
|
+
output(result)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
desc "get PERSON_ID FOP_ID", "Get a form of payment by ID (client view)"
|
|
24
|
+
format_options
|
|
25
|
+
def get(person_id, fop_id)
|
|
26
|
+
handle_error do
|
|
27
|
+
result = Pike13::Front::FormOfPayment.find(person_id: person_id, id: fop_id)
|
|
28
|
+
output(result)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
desc "me FOP_ID", "Get own form of payment by ID (client view)"
|
|
33
|
+
format_options
|
|
34
|
+
def me(fop_id)
|
|
35
|
+
handle_error do
|
|
36
|
+
result = Pike13::Front::FormOfPayment.find_me(id: fop_id)
|
|
37
|
+
output(result)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
desc "create PERSON_ID", "Create a form of payment (client view)"
|
|
42
|
+
format_options
|
|
43
|
+
option :type, type: :string, required: true, desc: "Payment type (creditcard, ach, etc.)"
|
|
44
|
+
option :token, type: :string, required: true, desc: "Payment token from payment processor"
|
|
45
|
+
option :is_default, type: :boolean, default: false, desc: "Set as default payment method"
|
|
46
|
+
def create(person_id)
|
|
47
|
+
handle_error do
|
|
48
|
+
attributes = {
|
|
49
|
+
type: options[:type],
|
|
50
|
+
token: options[:token],
|
|
51
|
+
is_default: options[:is_default]
|
|
52
|
+
}
|
|
53
|
+
result = Pike13::Front::FormOfPayment.create(person_id: person_id, attributes: attributes)
|
|
54
|
+
output(result)
|
|
55
|
+
success_message "Form of payment created successfully"
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
desc "update PERSON_ID FOP_ID", "Update a form of payment (client view)"
|
|
60
|
+
format_options
|
|
61
|
+
option :is_default, type: :boolean, desc: "Set as default payment method"
|
|
62
|
+
def update(person_id, fop_id)
|
|
63
|
+
handle_error do
|
|
64
|
+
attributes = {}
|
|
65
|
+
attributes[:is_default] = options[:is_default] if options.key?(:is_default)
|
|
66
|
+
result = Pike13::Front::FormOfPayment.update(person_id: person_id, id: fop_id, attributes: attributes)
|
|
67
|
+
output(result)
|
|
68
|
+
success_message "Form of payment updated successfully"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
desc "delete PERSON_ID FOP_ID", "Delete a form of payment (client view)"
|
|
73
|
+
def delete(person_id, fop_id)
|
|
74
|
+
handle_error do
|
|
75
|
+
Pike13::Front::FormOfPayment.destroy(person_id: person_id, id: fop_id)
|
|
76
|
+
success_message "Form of payment #{fop_id} deleted successfully"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Location < Base
|
|
8
|
+
desc "list", "List locations (client view)"
|
|
9
|
+
format_options
|
|
10
|
+
def list
|
|
11
|
+
handle_error do
|
|
12
|
+
result = with_progress("Fetching locations") do
|
|
13
|
+
Pike13::Front::Location.all
|
|
14
|
+
end
|
|
15
|
+
output(result)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class Person < Base
|
|
8
|
+
desc "me", "Get current authenticated client user"
|
|
9
|
+
format_options
|
|
10
|
+
def me
|
|
11
|
+
handle_error { output(Pike13::Front::Person.me) }
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class PersonPlan < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front person_plans"
|
|
11
|
+
end
|
|
12
|
+
desc "list PERSON_ID", "List plans for a person (client view)"
|
|
13
|
+
format_options
|
|
14
|
+
def list(person_id)
|
|
15
|
+
handle_error do
|
|
16
|
+
result = with_progress("Fetching person plans") do
|
|
17
|
+
Pike13::Front::PersonPlan.all(person_id: person_id)
|
|
18
|
+
end
|
|
19
|
+
output(result)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class PersonVisit < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front person_visits"
|
|
11
|
+
end
|
|
12
|
+
desc "list PERSON_ID", "List visits for a person (client view)"
|
|
13
|
+
format_options
|
|
14
|
+
def list(person_id)
|
|
15
|
+
handle_error do
|
|
16
|
+
result = with_progress("Fetching person visits") do
|
|
17
|
+
Pike13::Front::PersonVisit.all(person_id: person_id)
|
|
18
|
+
end
|
|
19
|
+
output(result)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class PersonWaitlistEntry < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front person_waitlist"
|
|
11
|
+
end
|
|
12
|
+
desc "list PERSON_ID", "List waitlist entries for a person (client view)"
|
|
13
|
+
format_options
|
|
14
|
+
def list(person_id)
|
|
15
|
+
handle_error do
|
|
16
|
+
result = with_progress("Fetching person waitlist entries") do
|
|
17
|
+
Pike13::Front::PersonWaitlistEntry.all(person_id: person_id)
|
|
18
|
+
end
|
|
19
|
+
output(result)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class PersonWaiver < Base
|
|
8
|
+
# Override base_usage to match the actual subcommand registration
|
|
9
|
+
def self.base_usage
|
|
10
|
+
"front person_waivers"
|
|
11
|
+
end
|
|
12
|
+
desc "list PERSON_ID", "List waivers for a person (client view)"
|
|
13
|
+
format_options
|
|
14
|
+
def list(person_id)
|
|
15
|
+
handle_error do
|
|
16
|
+
result = with_progress("Fetching person waivers") do
|
|
17
|
+
Pike13::Front::PersonWaiver.all(person_id: person_id)
|
|
18
|
+
end
|
|
19
|
+
output(result)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pike13
|
|
4
|
+
module CLI
|
|
5
|
+
module Commands
|
|
6
|
+
class Front < Base
|
|
7
|
+
class PlanProduct < Base
|
|
8
|
+
desc "list", "List all plan products"
|
|
9
|
+
format_options
|
|
10
|
+
def list
|
|
11
|
+
handle_error do
|
|
12
|
+
result = with_progress("Fetching plan products") do
|
|
13
|
+
Pike13::Front::PlanProduct.all
|
|
14
|
+
end
|
|
15
|
+
output(result)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
desc "get ID", "Get a plan product by ID"
|
|
20
|
+
format_options
|
|
21
|
+
def get(id)
|
|
22
|
+
handle_error do
|
|
23
|
+
result = Pike13::Front::PlanProduct.find(id)
|
|
24
|
+
output(result)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|