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.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +196 -0
  3. data/CONTRIBUTING.md +96 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +896 -0
  6. data/bin/pike13 +6 -0
  7. data/completions/_pike13 +229 -0
  8. data/completions/pike13.bash +112 -0
  9. data/lib/pike13/cli/commands/account/business.rb +22 -0
  10. data/lib/pike13/cli/commands/account/confirmation.rb +21 -0
  11. data/lib/pike13/cli/commands/account/password.rb +21 -0
  12. data/lib/pike13/cli/commands/account/person.rb +22 -0
  13. data/lib/pike13/cli/commands/account.rb +33 -0
  14. data/lib/pike13/cli/commands/base.rb +350 -0
  15. data/lib/pike13/cli/commands/concerns/formattable_command.rb +48 -0
  16. data/lib/pike13/cli/commands/concerns/reporting_query.rb +59 -0
  17. data/lib/pike13/cli/commands/desk/appointment.rb +58 -0
  18. data/lib/pike13/cli/commands/desk/booking.rb +56 -0
  19. data/lib/pike13/cli/commands/desk/business.rb +20 -0
  20. data/lib/pike13/cli/commands/desk/custom_field.rb +27 -0
  21. data/lib/pike13/cli/commands/desk/event.rb +32 -0
  22. data/lib/pike13/cli/commands/desk/event_occurrence.rb +64 -0
  23. data/lib/pike13/cli/commands/desk/event_occurrence_note.rb +82 -0
  24. data/lib/pike13/cli/commands/desk/event_occurrence_visit.rb +26 -0
  25. data/lib/pike13/cli/commands/desk/event_occurrence_waitlist_entry.rb +26 -0
  26. data/lib/pike13/cli/commands/desk/form_of_payment.rb +75 -0
  27. data/lib/pike13/cli/commands/desk/invoice.rb +29 -0
  28. data/lib/pike13/cli/commands/desk/location.rb +29 -0
  29. data/lib/pike13/cli/commands/desk/make_up.rb +51 -0
  30. data/lib/pike13/cli/commands/desk/note.rb +71 -0
  31. data/lib/pike13/cli/commands/desk/pack.rb +20 -0
  32. data/lib/pike13/cli/commands/desk/pack_product.rb +101 -0
  33. data/lib/pike13/cli/commands/desk/payment.rb +44 -0
  34. data/lib/pike13/cli/commands/desk/person.rb +98 -0
  35. data/lib/pike13/cli/commands/desk/person_plan.rb +27 -0
  36. data/lib/pike13/cli/commands/desk/person_visit.rb +27 -0
  37. data/lib/pike13/cli/commands/desk/person_waitlist_entry.rb +27 -0
  38. data/lib/pike13/cli/commands/desk/person_waiver.rb +27 -0
  39. data/lib/pike13/cli/commands/desk/plan.rb +29 -0
  40. data/lib/pike13/cli/commands/desk/plan_product.rb +35 -0
  41. data/lib/pike13/cli/commands/desk/punch.rb +20 -0
  42. data/lib/pike13/cli/commands/desk/refund.rb +31 -0
  43. data/lib/pike13/cli/commands/desk/revenue_category.rb +36 -0
  44. data/lib/pike13/cli/commands/desk/sales_tax.rb +36 -0
  45. data/lib/pike13/cli/commands/desk/service.rb +29 -0
  46. data/lib/pike13/cli/commands/desk/staff_member.rb +35 -0
  47. data/lib/pike13/cli/commands/desk/visit.rb +36 -0
  48. data/lib/pike13/cli/commands/desk/waitlist_entry.rb +69 -0
  49. data/lib/pike13/cli/commands/desk.rb +172 -0
  50. data/lib/pike13/cli/commands/front/appointment.rb +31 -0
  51. data/lib/pike13/cli/commands/front/booking.rb +56 -0
  52. data/lib/pike13/cli/commands/front/branding.rb +17 -0
  53. data/lib/pike13/cli/commands/front/business.rb +17 -0
  54. data/lib/pike13/cli/commands/front/event.rb +22 -0
  55. data/lib/pike13/cli/commands/front/event_occurrence.rb +35 -0
  56. data/lib/pike13/cli/commands/front/event_occurrence_note.rb +35 -0
  57. data/lib/pike13/cli/commands/front/event_occurrence_waitlist_eligibility.rb +27 -0
  58. data/lib/pike13/cli/commands/front/form_of_payment.rb +83 -0
  59. data/lib/pike13/cli/commands/front/location.rb +22 -0
  60. data/lib/pike13/cli/commands/front/person.rb +17 -0
  61. data/lib/pike13/cli/commands/front/person_plan.rb +26 -0
  62. data/lib/pike13/cli/commands/front/person_visit.rb +26 -0
  63. data/lib/pike13/cli/commands/front/person_waitlist_entry.rb +26 -0
  64. data/lib/pike13/cli/commands/front/person_waiver.rb +26 -0
  65. data/lib/pike13/cli/commands/front/plan_product.rb +31 -0
  66. data/lib/pike13/cli/commands/front/plan_terms.rb +42 -0
  67. data/lib/pike13/cli/commands/front/service.rb +22 -0
  68. data/lib/pike13/cli/commands/front.rb +113 -0
  69. data/lib/pike13/cli/commands/report/clients.rb +27 -0
  70. data/lib/pike13/cli/commands/report/enrollments.rb +27 -0
  71. data/lib/pike13/cli/commands/report/event_occurrence_staff_members.rb +31 -0
  72. data/lib/pike13/cli/commands/report/event_occurrences.rb +31 -0
  73. data/lib/pike13/cli/commands/report/invoice_item_transactions.rb +31 -0
  74. data/lib/pike13/cli/commands/report/invoice_items.rb +31 -0
  75. data/lib/pike13/cli/commands/report/invoices.rb +27 -0
  76. data/lib/pike13/cli/commands/report/monthly_business_metrics.rb +31 -0
  77. data/lib/pike13/cli/commands/report/pays.rb +27 -0
  78. data/lib/pike13/cli/commands/report/person_plans.rb +31 -0
  79. data/lib/pike13/cli/commands/report/staff_members.rb +31 -0
  80. data/lib/pike13/cli/commands/report/transactions.rb +27 -0
  81. data/lib/pike13/cli/commands/report.rb +77 -0
  82. data/lib/pike13/cli/config.rb +26 -0
  83. data/lib/pike13/cli/formatter.rb +142 -0
  84. data/lib/pike13/cli/progress.rb +85 -0
  85. data/lib/pike13/cli/thor_nested_subcommand.rb +37 -0
  86. data/lib/pike13/cli/version.rb +7 -0
  87. data/lib/pike13/cli.rb +70 -0
  88. metadata +187 -0
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pike13
4
+ module CLI
5
+ module Commands
6
+ class Front < Base
7
+ class PlanTerms < Base
8
+ desc "list PLAN_ID", "List plan terms for a plan"
9
+ format_options
10
+ def list(plan_id)
11
+ handle_error do
12
+ result = with_progress("Fetching plan terms") do
13
+ Pike13::Front::PlanTerms.all(plan_id: plan_id)
14
+ end
15
+ output(result)
16
+ end
17
+ end
18
+
19
+ desc "get PLAN_ID TERMS_ID", "Get specific plan terms"
20
+ format_options
21
+ def get(plan_id, terms_id)
22
+ handle_error do
23
+ result = Pike13::Front::PlanTerms.find(plan_id: plan_id, plan_terms_id: terms_id)
24
+ output(result)
25
+ end
26
+ end
27
+
28
+ desc "complete PLAN_ID TERMS_ID", "Complete plan terms"
29
+ format_options
30
+ def complete(plan_id, terms_id)
31
+ handle_error do
32
+ result = with_progress("Completing plan terms") do
33
+ Pike13::Front::PlanTerms.complete(plan_id: plan_id, plan_terms_id: terms_id)
34
+ end
35
+ output(result)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ 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 Service < Base
8
+ desc "list", "List services (client view)"
9
+ format_options
10
+ def list
11
+ handle_error do
12
+ result = with_progress("Fetching services") do
13
+ Pike13::Front::Service.all
14
+ end
15
+ output(result)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,113 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "front/person"
5
+ require_relative "front/event"
6
+ require_relative "front/event_occurrence"
7
+ require_relative "front/event_occurrence_note"
8
+ require_relative "front/event_occurrence_waitlist_eligibility"
9
+ require_relative "front/plan_product"
10
+ require_relative "front/plan_terms"
11
+ require_relative "front/service"
12
+ require_relative "front/location"
13
+ require_relative "front/appointment"
14
+ require_relative "front/booking"
15
+ require_relative "front/business"
16
+ require_relative "front/branding"
17
+ require_relative "front/person_visit"
18
+ require_relative "front/person_plan"
19
+ require_relative "front/person_waitlist_entry"
20
+ require_relative "front/person_waiver"
21
+ require_relative "front/form_of_payment"
22
+
23
+ module Pike13
24
+ module CLI
25
+ module Commands
26
+ class Front < Base
27
+ desc "people SUBCOMMAND", "Manage people"
28
+ subcommand "people", Front::Person
29
+
30
+ desc "events SUBCOMMAND", "Manage events"
31
+ subcommand "events", Front::Event
32
+
33
+ desc "event_occurrences SUBCOMMAND", "Manage event occurrences"
34
+ subcommand "event_occurrences", Front::EventOccurrence
35
+
36
+ desc "eo SUBCOMMAND", "Manage event occurrences (shortcut)"
37
+ subcommand "eo", Front::EventOccurrence
38
+
39
+ desc "event_occurrence_notes SUBCOMMAND", "Manage event occurrence notes"
40
+ subcommand "event_occurrence_notes", Front::EventOccurrenceNote
41
+
42
+ desc "eon SUBCOMMAND", "Manage event occurrence notes (shortcut)"
43
+ subcommand "eon", Front::EventOccurrenceNote
44
+
45
+ desc "event_occurrence_waitlist_eligibilities SUBCOMMAND", "Manage waitlist eligibility"
46
+ subcommand "event_occurrence_waitlist_eligibilities", Front::EventOccurrenceWaitlistEligibility
47
+
48
+ desc "eowe SUBCOMMAND", "Manage waitlist eligibility (shortcut)"
49
+ subcommand "eowe", Front::EventOccurrenceWaitlistEligibility
50
+
51
+ desc "plan_products SUBCOMMAND", "Manage plan products"
52
+ subcommand "plan_products", Front::PlanProduct
53
+
54
+ desc "pp SUBCOMMAND", "Manage plan products (shortcut)"
55
+ subcommand "pp", Front::PlanProduct
56
+
57
+ desc "plan_terms SUBCOMMAND", "Manage plan terms"
58
+ subcommand "plan_terms", Front::PlanTerms
59
+
60
+ desc "pt SUBCOMMAND", "Manage plan terms (shortcut)"
61
+ subcommand "pt", Front::PlanTerms
62
+
63
+ desc "services SUBCOMMAND", "Manage services"
64
+ subcommand "services", Front::Service
65
+
66
+ desc "locations SUBCOMMAND", "Manage locations"
67
+ subcommand "locations", Front::Location
68
+
69
+ desc "appointments SUBCOMMAND", "Manage appointments"
70
+ subcommand "appointments", Front::Appointment
71
+
72
+ desc "bookings SUBCOMMAND", "Manage bookings"
73
+ subcommand "bookings", Front::Booking
74
+
75
+ desc "business SUBCOMMAND", "Business info"
76
+ subcommand "business", Front::Business
77
+
78
+ desc "branding SUBCOMMAND", "Branding info"
79
+ subcommand "branding", Front::Branding
80
+
81
+ desc "person_visits SUBCOMMAND", "Manage person visits"
82
+ subcommand "person_visits", Front::PersonVisit
83
+
84
+ desc "pv SUBCOMMAND", "Manage person visits (shortcut)"
85
+ subcommand "pv", Front::PersonVisit
86
+
87
+ desc "person_plans SUBCOMMAND", "Manage person plans"
88
+ subcommand "person_plans", Front::PersonPlan
89
+
90
+ desc "ppl SUBCOMMAND", "Manage person plans (shortcut)"
91
+ subcommand "ppl", Front::PersonPlan
92
+
93
+ desc "person_waitlist SUBCOMMAND", "Manage person waitlist entries"
94
+ subcommand "person_waitlist", Front::PersonWaitlistEntry
95
+
96
+ desc "pwl SUBCOMMAND", "Manage person waitlist entries (shortcut)"
97
+ subcommand "pwl", Front::PersonWaitlistEntry
98
+
99
+ desc "person_waivers SUBCOMMAND", "Manage person waivers"
100
+ subcommand "person_waivers", Front::PersonWaiver
101
+
102
+ desc "pw SUBCOMMAND", "Manage person waivers (shortcut)"
103
+ subcommand "pw", Front::PersonWaiver
104
+
105
+ desc "forms_of_payment SUBCOMMAND", "Manage forms of payment"
106
+ subcommand "forms_of_payment", Front::FormOfPayment
107
+
108
+ desc "fop SUBCOMMAND", "Manage forms of payment (shortcut)"
109
+ subcommand "fop", Front::FormOfPayment
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class Clients < Base
10
+ include Concerns::ReportingQuery
11
+
12
+ desc "query", "Query clients report"
13
+ def query
14
+ handle_error do
15
+ params = build_query_params
16
+ params[:fields] ||= %w[person_id full_name email client_since_date]
17
+ result = with_progress("Fetching clients report") do
18
+ Pike13::Reporting::Clients.query(**params)
19
+ end
20
+ output(result)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class Enrollments < Base
10
+ include Concerns::ReportingQuery
11
+
12
+ desc "query", "Query enrollments report"
13
+ def query
14
+ handle_error do
15
+ params = build_query_params
16
+ params[:fields] ||= %w[person_id event_occurrence_id state]
17
+ result = with_progress("Fetching enrollments report") do
18
+ Pike13::Reporting::Enrollments.query(**params)
19
+ end
20
+ output(result)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class EventOccurrenceStaffMembers < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report event_occurrence_staff"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query event occurrence staff members report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[person_id full_name event_name service_date enrollment_count]
21
+ result = with_progress("Fetching event occurrence staff members report") do
22
+ Pike13::Reporting::EventOccurrenceStaffMembers.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class EventOccurrences < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report event_occurrences"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query event occurrences report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[event_occurrence_id event_name service_date enrollment_count capacity]
21
+ result = with_progress("Fetching event occurrences report") do
22
+ Pike13::Reporting::EventOccurrences.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class InvoiceItemTransactions < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report invoice_item_transactions"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query invoice item transactions report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[transaction_id transaction_date payment_method net_paid_amount]
21
+ result = with_progress("Fetching invoice item transactions report") do
22
+ Pike13::Reporting::InvoiceItemTransactions.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class InvoiceItems < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report invoice_items"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query invoice items report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[invoice_item_id product_name expected_amount net_paid_amount]
21
+ result = with_progress("Fetching invoice items report") do
22
+ Pike13::Reporting::InvoiceItems.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class Invoices < Base
10
+ include Concerns::ReportingQuery
11
+
12
+ desc "query", "Query invoices report"
13
+ def query
14
+ handle_error do
15
+ params = build_query_params
16
+ params[:fields] ||= %w[invoice_id invoice_number expected_amount outstanding_amount invoice_state]
17
+ result = with_progress("Fetching invoices report") do
18
+ Pike13::Reporting::Invoices.query(**params)
19
+ end
20
+ output(result)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class MonthlyBusinessMetrics < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report monthly_metrics"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query monthly business metrics report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[month_start_date net_paid_amount member_count new_client_count]
21
+ result = with_progress("Fetching monthly business metrics report") do
22
+ Pike13::Reporting::MonthlyBusinessMetrics.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class Pays < Base
10
+ include Concerns::ReportingQuery
11
+
12
+ desc "query", "Query pays report"
13
+ def query
14
+ handle_error do
15
+ params = build_query_params
16
+ params[:fields] ||= %w[pay_id staff_name service_name final_pay_amount pay_state]
17
+ result = with_progress("Fetching pays report") do
18
+ Pike13::Reporting::Pays.query(**params)
19
+ end
20
+ output(result)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class PersonPlans < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report person_plans"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query person plans report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[person_plan_id person_id plan_name start_date is_available]
21
+ result = with_progress("Fetching person plans report") do
22
+ Pike13::Reporting::PersonPlans.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class StaffMembers < Base
10
+ # Override base_usage to match the actual subcommand registration
11
+ def self.base_usage
12
+ "report staff_members"
13
+ end
14
+ include Concerns::ReportingQuery
15
+
16
+ desc "query", "Query staff members report"
17
+ def query
18
+ handle_error do
19
+ params = build_query_params
20
+ params[:fields] ||= %w[person_id full_name email role person_state]
21
+ result = with_progress("Fetching staff members report") do
22
+ Pike13::Reporting::StaffMembers.query(**params)
23
+ end
24
+ output(result)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../concerns/reporting_query"
4
+
5
+ module Pike13
6
+ module CLI
7
+ module Commands
8
+ class Report < Base
9
+ class Transactions < Base
10
+ include Concerns::ReportingQuery
11
+
12
+ desc "query", "Query transactions report"
13
+ def query
14
+ handle_error do
15
+ params = build_query_params
16
+ params[:fields] ||= %w[transaction_id transaction_date payment_method transaction_amount invoice_id]
17
+ result = with_progress("Fetching transactions report") do
18
+ Pike13::Reporting::Transactions.query(**params)
19
+ end
20
+ output(result)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "report/clients"
5
+ require_relative "report/transactions"
6
+ require_relative "report/enrollments"
7
+ require_relative "report/monthly_business_metrics"
8
+ require_relative "report/invoices"
9
+ require_relative "report/event_occurrences"
10
+ require_relative "report/event_occurrence_staff_members"
11
+ require_relative "report/invoice_items"
12
+ require_relative "report/invoice_item_transactions"
13
+ require_relative "report/pays"
14
+ require_relative "report/person_plans"
15
+ require_relative "report/staff_members"
16
+
17
+ module Pike13
18
+ module CLI
19
+ module Commands
20
+ class Report < Base
21
+ desc "clients SUBCOMMAND", "Query clients report"
22
+ subcommand "clients", Report::Clients
23
+
24
+ desc "transactions SUBCOMMAND", "Query transactions report"
25
+ subcommand "transactions", Report::Transactions
26
+
27
+ desc "tx SUBCOMMAND", "Query transactions report (shortcut)"
28
+ subcommand "tx", Report::Transactions
29
+
30
+ desc "enrollments SUBCOMMAND", "Query enrollments report"
31
+ subcommand "enrollments", Report::Enrollments
32
+
33
+ desc "monthly_metrics SUBCOMMAND", "Query monthly business metrics"
34
+ subcommand "monthly_metrics", Report::MonthlyBusinessMetrics
35
+
36
+ desc "mm SUBCOMMAND", "Query monthly business metrics (shortcut)"
37
+ subcommand "mm", Report::MonthlyBusinessMetrics
38
+
39
+ desc "invoices SUBCOMMAND", "Query invoices report"
40
+ subcommand "invoices", Report::Invoices
41
+
42
+ desc "event_occurrences SUBCOMMAND", "Query event occurrences report"
43
+ subcommand "event_occurrences", Report::EventOccurrences
44
+
45
+ desc "eo SUBCOMMAND", "Query event occurrences report (shortcut)"
46
+ subcommand "eo", Report::EventOccurrences
47
+
48
+ desc "event_occurrence_staff SUBCOMMAND", "Query event occurrence staff members report"
49
+ subcommand "event_occurrence_staff", Report::EventOccurrenceStaffMembers
50
+
51
+ desc "eos SUBCOMMAND", "Query event occurrence staff members report (shortcut)"
52
+ subcommand "eos", Report::EventOccurrenceStaffMembers
53
+
54
+ desc "invoice_items SUBCOMMAND", "Query invoice items report"
55
+ subcommand "invoice_items", Report::InvoiceItems
56
+
57
+ desc "ii SUBCOMMAND", "Query invoice items report (shortcut)"
58
+ subcommand "ii", Report::InvoiceItems
59
+
60
+ desc "invoice_item_transactions SUBCOMMAND", "Query invoice item transactions report"
61
+ subcommand "invoice_item_transactions", Report::InvoiceItemTransactions
62
+
63
+ desc "iit SUBCOMMAND", "Query invoice item transactions report (shortcut)"
64
+ subcommand "iit", Report::InvoiceItemTransactions
65
+
66
+ desc "pays SUBCOMMAND", "Query pays report"
67
+ subcommand "pays", Report::Pays
68
+
69
+ desc "person_plans SUBCOMMAND", "Query person plans report"
70
+ subcommand "person_plans", Report::PersonPlans
71
+
72
+ desc "staff_members SUBCOMMAND", "Query staff members report"
73
+ subcommand "staff_members", Report::StaffMembers
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pike13
4
+ module CLI
5
+ # Configuration management for Pike13 CLI
6
+ # Reads credentials from environment variables
7
+ class Config
8
+ # Configure the Pike13 gem with credentials from environment
9
+ #
10
+ # @raise [RuntimeError] if required environment variables are missing
11
+ # @return [void]
12
+ def self.configure_pike13!
13
+ access_token = ENV.fetch("PIKE13_ACCESS_TOKEN", nil)
14
+ base_url = ENV.fetch("PIKE13_BASE_URL", nil)
15
+
16
+ raise "PIKE13_ACCESS_TOKEN environment variable is required" unless access_token
17
+ raise "PIKE13_BASE_URL environment variable is required" unless base_url
18
+
19
+ Pike13.configure do |config|
20
+ config.access_token = access_token
21
+ config.base_url = base_url
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end