mno-enterprise-api 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -0
- data/Rakefile +12 -0
- data/app/assets/javascripts/mno_enterprise/angular/loading-page.app.js.coffee +156 -0
- data/app/assets/javascripts/mno_enterprise/application.js +13 -0
- data/app/controllers/devise/password_expired_controller.rb +55 -0
- data/app/controllers/mno_enterprise/auth/confirmations_controller.rb +5 -0
- data/app/controllers/mno_enterprise/auth/omniauth_callbacks_controller.rb +30 -0
- data/app/controllers/mno_enterprise/auth/passwords_controller.rb +5 -0
- data/app/controllers/mno_enterprise/auth/registrations_controller.rb +5 -0
- data/app/controllers/mno_enterprise/auth/sessions_controller.rb +7 -0
- data/app/controllers/mno_enterprise/auth/unlocks_controller.rb +5 -0
- data/app/controllers/mno_enterprise/deletion_requests_controller.rb +5 -0
- data/app/controllers/mno_enterprise/impersonate_controller.rb +48 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/audit_events_controller.rb +16 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/base_resource_controller.rb +5 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/cloud_apps_controller.rb +46 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/invoices_controller.rb +47 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/organizations_controller.rb +27 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/tenant_invoices_controller.rb +14 -0
- data/app/controllers/mno_enterprise/jpi/v1/admin/users_controller.rb +63 -0
- data/app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb +24 -0
- data/app/controllers/mno_enterprise/jpi/v1/app_instances_sync_controller.rb +36 -0
- data/app/controllers/mno_enterprise/jpi/v1/base_resource_controller.rb +32 -0
- data/app/controllers/mno_enterprise/jpi/v1/current_users_controller.rb +5 -0
- data/app/controllers/mno_enterprise/jpi/v1/deletion_requests_controller.rb +5 -0
- data/app/controllers/mno_enterprise/jpi/v1/impac/dashboards_controller.rb +5 -0
- data/app/controllers/mno_enterprise/jpi/v1/impac/kpis_controller.rb +80 -0
- data/app/controllers/mno_enterprise/jpi/v1/impac/widgets_controller.rb +63 -0
- data/app/controllers/mno_enterprise/jpi/v1/industry_bundle_controller.rb +25 -0
- data/app/controllers/mno_enterprise/jpi/v1/marketplace_controller.rb +22 -0
- data/app/controllers/mno_enterprise/jpi/v1/organizations_controller.rb +5 -0
- data/app/controllers/mno_enterprise/jpi/v1/shopping_cart_controller.rb +93 -0
- data/app/controllers/mno_enterprise/jpi/v1/teams_controller.rb +88 -0
- data/app/controllers/mno_enterprise/org_invites_controller.rb +5 -0
- data/app/controllers/mno_enterprise/pages_controller.rb +5 -0
- data/app/controllers/mno_enterprise/provision_controller.rb +5 -0
- data/app/controllers/mno_enterprise/status_controller.rb +27 -0
- data/app/controllers/mno_enterprise/webhook/o_auth_controller.rb +5 -0
- data/app/mailers/mno_enterprise/system_notification_mailer.rb +5 -0
- data/app/models/mno_enterprise/health_check.rb +16 -0
- data/app/views/devise/password_expired/show.html.haml +32 -0
- data/app/views/mno_enterprise/auth/confirmations/default/_form.html.haml +49 -0
- data/app/views/mno_enterprise/auth/confirmations/default/_lounge.html.haml +34 -0
- data/app/views/mno_enterprise/auth/confirmations/default/_show.html.haml +10 -0
- data/app/views/mno_enterprise/auth/confirmations/lounge.html.haml +4 -0
- data/app/views/mno_enterprise/auth/confirmations/material/_form.html.haml +44 -0
- data/app/views/mno_enterprise/auth/confirmations/material/_lounge.html.haml +18 -0
- data/app/views/mno_enterprise/auth/confirmations/material/_show.html.haml +21 -0
- data/app/views/mno_enterprise/auth/confirmations/new.html.haml +31 -0
- data/app/views/mno_enterprise/auth/confirmations/show.html.haml +4 -0
- data/app/views/mno_enterprise/auth/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/mno_enterprise/auth/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/mno_enterprise/auth/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/mno_enterprise/auth/passwords/edit.html.haml +53 -0
- data/app/views/mno_enterprise/auth/passwords/new.html.haml +34 -0
- data/app/views/mno_enterprise/auth/registrations/default/_form.html.haml +35 -0
- data/app/views/mno_enterprise/auth/registrations/default/_new.html.haml +11 -0
- data/app/views/mno_enterprise/auth/registrations/material/_form.html.haml +30 -0
- data/app/views/mno_enterprise/auth/registrations/material/_new.html.haml +10 -0
- data/app/views/mno_enterprise/auth/registrations/new.html.haml +4 -0
- data/app/views/mno_enterprise/auth/sessions/default/_form.html.haml +17 -0
- data/app/views/mno_enterprise/auth/sessions/default/_new.html.haml +11 -0
- data/app/views/mno_enterprise/auth/sessions/material/_form.html.haml +26 -0
- data/app/views/mno_enterprise/auth/sessions/material/_new.html.haml +11 -0
- data/app/views/mno_enterprise/auth/sessions/new.html.haml +4 -0
- data/app/views/mno_enterprise/auth/shared/_links.html.haml +24 -0
- data/app/views/mno_enterprise/auth/unlocks/new.html.haml +10 -0
- data/app/views/mno_enterprise/deletion_requests/show.html.haml +131 -0
- data/app/views/mno_enterprise/jpi/v1/admin/audit_events/_audit_event.json.jbuilder +5 -0
- data/app/views/mno_enterprise/jpi/v1/admin/audit_events/index.json.jbuilder +4 -0
- data/app/views/mno_enterprise/jpi/v1/admin/cloud_apps/_cloud_app.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/cloud_apps/index.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/cloud_apps/show.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/invoices/_invoice.json.jbuilder +2 -0
- data/app/views/mno_enterprise/jpi/v1/admin/invoices/index.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/invoices/show.json.jbuilder +2 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/_credit_card.json.jbuilder +7 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/_invoices.json.jbuilder +8 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/_member.json.jbuilder +14 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/_organization.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/in_arrears.json.jbuilder +8 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/index.json.jbuilder +7 -0
- data/app/views/mno_enterprise/jpi/v1/admin/organizations/show.json.jbuilder +11 -0
- data/app/views/mno_enterprise/jpi/v1/admin/tenant_invoices/_tenant_invoice.json.jbuilder +5 -0
- data/app/views/mno_enterprise/jpi/v1/admin/tenant_invoices/index.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/tenant_invoices/show.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/users/_user.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/admin/users/index.json.jbuilder +2 -0
- data/app/views/mno_enterprise/jpi/v1/admin/users/show.json.jbuilder +9 -0
- data/app/views/mno_enterprise/jpi/v1/app_instances/_resource.json.jbuilder +23 -0
- data/app/views/mno_enterprise/jpi/v1/app_instances/index.json.jbuilder +9 -0
- data/app/views/mno_enterprise/jpi/v1/app_instances/show.json.jbuilder +3 -0
- data/app/views/mno_enterprise/jpi/v1/billing/index.json.jbuilder +0 -0
- data/app/views/mno_enterprise/jpi/v1/current_users/show.json.jbuilder +37 -0
- data/app/views/mno_enterprise/jpi/v1/impac/dashboards/_dashboard.json.jbuilder +9 -0
- data/app/views/mno_enterprise/jpi/v1/impac/dashboards/index.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/impac/dashboards/show.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/impac/kpis/_kpi.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/impac/kpis/show.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/impac/widgets/_widget.json.jbuilder +6 -0
- data/app/views/mno_enterprise/jpi/v1/impac/widgets/show.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/marketplace/_app.json.jbuilder +14 -0
- data/app/views/mno_enterprise/jpi/v1/marketplace/index.json.jbuilder +3 -0
- data/app/views/mno_enterprise/jpi/v1/marketplace/show.json.jbuilder +3 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_arrears.json.jbuilder +11 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_billing.json.jbuilder +4 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_credit_card.json.jbuilder +7 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_current_user.json.jbuilder +5 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_invoices.json.jbuilder +8 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_member.json.jbuilder +13 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/_organization.json.jbuilder +13 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/credit_card.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/index.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/members.json.jbuilder +3 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/show.json.jbuilder +15 -0
- data/app/views/mno_enterprise/jpi/v1/organizations/show_reduced.json.jbuilder +3 -0
- data/app/views/mno_enterprise/jpi/v1/shopping_cart/organizations.json.jbuilder +5 -0
- data/app/views/mno_enterprise/jpi/v1/shopping_cart/show.json.jbuilder +59 -0
- data/app/views/mno_enterprise/jpi/v1/shopping_cart/show_item.json.jbuilder +34 -0
- data/app/views/mno_enterprise/jpi/v1/teams/_team.json.jbuilder +20 -0
- data/app/views/mno_enterprise/jpi/v1/teams/index.json.jbuilder +1 -0
- data/app/views/mno_enterprise/jpi/v1/teams/show.json.jbuilder +3 -0
- data/app/views/mno_enterprise/pages/app_access_unauthorized.html.haml +19 -0
- data/app/views/mno_enterprise/pages/app_logout.html.haml +18 -0
- data/app/views/mno_enterprise/pages/billing_details_required.html.haml +19 -0
- data/app/views/mno_enterprise/pages/loading.html.erb +69 -0
- data/app/views/mno_enterprise/provision/_provision_apps.html.haml +42 -0
- data/app/views/mno_enterprise/provision/_select_organization.html.haml +17 -0
- data/app/views/mno_enterprise/provision/new.html.haml +4 -0
- data/app/views/mno_enterprise/webhook/o_auth/authorize.html.haml +26 -0
- data/app/views/mno_enterprise/webhook/o_auth/providers/myob.html.haml +29 -0
- data/app/views/mno_enterprise/webhook/o_auth/providers/xero.html.haml +34 -0
- data/config/initializers/devise.rb +273 -0
- data/config/initializers/devise_extension.rb +9 -0
- data/config/initializers/devise_log.rb +12 -0
- data/config/initializers/health_check.rb +35 -0
- data/config/initializers/main_app_version.rb +6 -0
- data/config/routes.rb +152 -0
- data/lib/mno-enterprise-api.rb +1 -0
- data/lib/mno_enterprise/api.rb +14 -0
- data/lib/mno_enterprise/api/engine.rb +9 -0
- data/lib/mno_enterprise/concerns/controllers/deletion_requests_controller.rb +108 -0
- data/lib/mno_enterprise/concerns/controllers/jpi/v1/admin/base_resource_controller.rb +34 -0
- data/lib/mno_enterprise/concerns/controllers/jpi/v1/current_users_controller.rb +58 -0
- data/lib/mno_enterprise/concerns/controllers/jpi/v1/deletion_requests_controller.rb +69 -0
- data/lib/mno_enterprise/concerns/controllers/jpi/v1/impac/dashboards_controller.rb +76 -0
- data/lib/mno_enterprise/concerns/controllers/jpi/v1/organizations_controller.rb +180 -0
- data/lib/mno_enterprise/concerns/controllers/org_invites_controller.rb +44 -0
- data/lib/mno_enterprise/concerns/controllers/pages_controller.rb +78 -0
- data/lib/mno_enterprise/concerns/controllers/provision_controller.rb +71 -0
- data/lib/mno_enterprise/concerns/controllers/webhook/o_auth_controller.rb +107 -0
- data/lib/mno_enterprise/concerns/mailers/system_notification_mailer.rb +158 -0
- data/lib/mno_enterprise/event_logger.rb +32 -0
- data/spec/controllers/mno_enterprise/auth/confirmation_controller_spec.rb +68 -0
- data/spec/controllers/mno_enterprise/deletion_requests_controller_spec.rb +141 -0
- data/spec/controllers/mno_enterprise/impersonate_controller_spec.rb +48 -0
- data/spec/controllers/mno_enterprise/jpi/v1/admin/audit_events_controller_spec.rb +51 -0
- data/spec/controllers/mno_enterprise/jpi/v1/admin/cloud_apps_controller_spec.rb +92 -0
- data/spec/controllers/mno_enterprise/jpi/v1/admin/invoices_controller_spec.rb +159 -0
- data/spec/controllers/mno_enterprise/jpi/v1/admin/organizations_controller_spec.rb +116 -0
- data/spec/controllers/mno_enterprise/jpi/v1/admin/tenant_invoices_controller_spec.rb +92 -0
- data/spec/controllers/mno_enterprise/jpi/v1/admin/users_controller_spec.rb +136 -0
- data/spec/controllers/mno_enterprise/jpi/v1/app_instances_controller_spec.rb +76 -0
- data/spec/controllers/mno_enterprise/jpi/v1/app_instances_sync_controller_spec.rb +94 -0
- data/spec/controllers/mno_enterprise/jpi/v1/current_users_controller_spec.rb +128 -0
- data/spec/controllers/mno_enterprise/jpi/v1/deletion_requests_controller_spec.rb +72 -0
- data/spec/controllers/mno_enterprise/jpi/v1/impac/kpis_controller_spec.rb +80 -0
- data/spec/controllers/mno_enterprise/jpi/v1/marketplace_controller_spec.rb +115 -0
- data/spec/controllers/mno_enterprise/jpi/v1/organizations_controller_spec.rb +516 -0
- data/spec/controllers/mno_enterprise/jpi/v1/team_controller_spec.rb +86 -0
- data/spec/controllers/mno_enterprise/org_invites_controller_spec.rb +29 -0
- data/spec/controllers/mno_enterprise/pages_controller_spec.rb +49 -0
- data/spec/controllers/mno_enterprise/provision_controller_spec.rb +94 -0
- data/spec/controllers/mno_enterprise/status_controller_spec.rb +34 -0
- data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +104 -0
- data/spec/lib/mno_enterprise/event_logger_spec.rb +28 -0
- data/spec/mailer/mno_enterprise/system_notification_mailer_spec.rb +132 -0
- data/spec/rails_helper.rb +94 -0
- data/spec/requests/devise/authentication_spec.rb +43 -0
- data/spec/requests/devise/registration_spec.rb +64 -0
- data/spec/routing/devise/confirmation_routing_spec.rb +20 -0
- data/spec/routing/devise/passwords_routing_spec.rb +24 -0
- data/spec/routing/devise/registrations_routing_spec.rb +16 -0
- data/spec/routing/devise/sessions_routing_spec.rb +20 -0
- data/spec/routing/mno_enterprise/deletion_requests_controller_routing_spec.rb +20 -0
- data/spec/routing/mno_enterprise/impersonate_controller_routing.spec.rb +15 -0
- data/spec/routing/mno_enterprise/jpi/v1/admin/audit_events_controller_routing_spec.rb +11 -0
- data/spec/routing/mno_enterprise/jpi/v1/admin/cloud_apps_controller_routing_spec.rb +24 -0
- data/spec/routing/mno_enterprise/jpi/v1/admin/invoices_controller_routing_spec.rb +37 -0
- data/spec/routing/mno_enterprise/jpi/v1/admin/organizations_controller_routing_spec.rb +20 -0
- data/spec/routing/mno_enterprise/jpi/v1/admin/tenant_invoices_controller_routing_spec.rb +16 -0
- data/spec/routing/mno_enterprise/jpi/v1/admin/users_controller_routing_spec.rb +24 -0
- data/spec/routing/mno_enterprise/jpi/v1/app_instances_controller_routing_spec.rb +12 -0
- data/spec/routing/mno_enterprise/jpi/v1/app_instances_sync_controller_routing_spec.rb +15 -0
- data/spec/routing/mno_enterprise/jpi/v1/current_users_controller_routing_spec.rb +28 -0
- data/spec/routing/mno_enterprise/jpi/v1/deletion_requests_controller_routing_spec.rb +24 -0
- data/spec/routing/mno_enterprise/jpi/v1/impac/kpis_controller_routing_spec.rb +22 -0
- data/spec/routing/mno_enterprise/jpi/v1/marketplace_controller_routing_spec.rb +16 -0
- data/spec/routing/mno_enterprise/jpi/v1/organizations_controller_routing_spec.rb +44 -0
- data/spec/routing/mno_enterprise/jpi/v1/teams_controller_routing_spec.rb +36 -0
- data/spec/routing/mno_enterprise/org_invites_controller_routing_spec.rb +12 -0
- data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +29 -0
- data/spec/routing/mno_enterprise/provision_controller_routing_spec.rb +15 -0
- data/spec/routing/mno_enterprise/status_controller_routing_spec.rb +19 -0
- data/spec/routing/mno_enterprise/webhook/o_auth_controller_routing_spec.rb +27 -0
- data/spec/spec_helper.rb +88 -0
- metadata +402 -0
@@ -0,0 +1 @@
|
|
1
|
+
json.extract! cloud_app, :id, :uid, :name, :tiny_description, :description, :api_key, :metadata_url, :details, :terms_url
|
@@ -0,0 +1 @@
|
|
1
|
+
json.cloud_apps @cloud_apps, partial: 'cloud_app', as: :cloud_app
|
@@ -0,0 +1 @@
|
|
1
|
+
json.cloud_app @cloud_app, :id, :uid, :name, :tiny_description, :description, :api_key, :metadata_url, :details
|
@@ -0,0 +1 @@
|
|
1
|
+
json.invoices @invoices, partial: 'invoice', as: :invoice
|
@@ -0,0 +1,14 @@
|
|
1
|
+
if member.is_a?(MnoEnterprise::User)
|
2
|
+
json.id member.id
|
3
|
+
json.uid member.uid
|
4
|
+
json.entity 'User'
|
5
|
+
json.name member.name
|
6
|
+
json.surname member.surname
|
7
|
+
json.email member.email
|
8
|
+
json.role member.role(organization)
|
9
|
+
elsif member.is_a?(MnoEnterprise::OrgInvite)
|
10
|
+
json.id member.id
|
11
|
+
json.entity 'OrgInvite'
|
12
|
+
json.email member.user_email
|
13
|
+
json.role member.user_role
|
14
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
json.extract! organization, :id, :name, :uid, :soa_enabled, :created_at
|
@@ -0,0 +1,11 @@
|
|
1
|
+
json.organization do
|
2
|
+
json.partial! 'organization', organization: @organization
|
3
|
+
json.members @organization.members, partial: 'member', as: :member, organization: @organization
|
4
|
+
json.partial! 'credit_card', credit_card: @organization.credit_card
|
5
|
+
json.partial! 'invoices', organization: @organization
|
6
|
+
json.active_apps @organization_active_apps do |instance|
|
7
|
+
json.extract! instance, :id, :name, :stack, :uid
|
8
|
+
json.app_name instance.app.name
|
9
|
+
json.app_logo instance.app.logo
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
json.extract! tenant_invoice, :id, :started_at, :ended_at, :created_at, :updated_at, :paid_at, :slug
|
2
|
+
|
3
|
+
json.total_portfolio_amount AccountingjsSerializer.serialize(tenant_invoice.total_portfolio_amount)
|
4
|
+
json.total_commission_amount AccountingjsSerializer.serialize(tenant_invoice.total_commission_amount)
|
5
|
+
json.non_commissionable_amount AccountingjsSerializer.serialize(tenant_invoice.non_commissionable_amount)
|
@@ -0,0 +1 @@
|
|
1
|
+
json.tenant_invoices @tenant_invoices, partial: 'tenant_invoice', as: :tenant_invoice
|
@@ -0,0 +1 @@
|
|
1
|
+
json.tenant_invoice @tenant_invoice, :id, :started_at, :ended_at, :created_at, :updated_at, :paid_at, :slug
|
@@ -0,0 +1 @@
|
|
1
|
+
json.extract! user, :id, :uid, :email, :name, :surname, :admin_role, :created_at
|
@@ -0,0 +1,9 @@
|
|
1
|
+
json.user do
|
2
|
+
json.extract! @user, :id, :uid, :email, :phone, :name, :surname, :admin_role, :created_at, :confirmed_at, :last_sign_in_at
|
3
|
+
json.organizations @user_organizations do |org|
|
4
|
+
json.id org.id
|
5
|
+
json.uid org.uid
|
6
|
+
json.name org.name
|
7
|
+
json.created_at org.created_at
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
json.id app_instance.id
|
2
|
+
json.uid app_instance.uid
|
3
|
+
json.stack app_instance.stack
|
4
|
+
json.name app_instance.name
|
5
|
+
json.status app_instance.status
|
6
|
+
json.oauth_keys_valid app_instance.oauth_keys_valid
|
7
|
+
#json.http_url app_instance.http_url
|
8
|
+
#json.microsoft_trial_url app_instance.microsoft_trial_url
|
9
|
+
json.created_at app_instance.created_at
|
10
|
+
|
11
|
+
if app_instance.oauth_company
|
12
|
+
json.oauth_company_name app_instance.oauth_company
|
13
|
+
end
|
14
|
+
#
|
15
|
+
# if app_instance.connector_stack? && app_instance.oauth_keys && app_instance.oauth_keys[:version]
|
16
|
+
# json.connector_version app_instance.oauth_keys[:version]
|
17
|
+
# end
|
18
|
+
|
19
|
+
app_instance.app.tap do |a|
|
20
|
+
json.app_name a.name
|
21
|
+
json.app_nid a.nid
|
22
|
+
json.logo a.logo
|
23
|
+
end
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
json.cache! ['v1', @user.cache_key] do
|
2
|
+
json.current_user do
|
3
|
+
json.id @user.id
|
4
|
+
json.name @user.name
|
5
|
+
json.surname @user.surname
|
6
|
+
json.email @user.email
|
7
|
+
json.logged_in !!@user.id
|
8
|
+
json.created_at @user.created_at ? @user.created_at.iso8601 : nil
|
9
|
+
json.company @user.company
|
10
|
+
json.phone @user.phone
|
11
|
+
json.phone_country_code @user.phone_country_code
|
12
|
+
json.country_code @user.geo_country_code || 'US'
|
13
|
+
json.website @user.website
|
14
|
+
json.sso_session @user.sso_session
|
15
|
+
json.admin_role @user.admin_role
|
16
|
+
|
17
|
+
# Embed association if user is persisted
|
18
|
+
if @user.id
|
19
|
+
json.organizations do
|
20
|
+
json.array! (@user.organizations || []) do |o|
|
21
|
+
json.id o.id
|
22
|
+
json.uid o.uid
|
23
|
+
json.name o.name
|
24
|
+
json.currency o.billing_currency
|
25
|
+
json.current_user_role o.role
|
26
|
+
json.has_myob_essentials_only o.has_myob_essentials_only?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
if @user.deletion_request.present?
|
31
|
+
json.deletion_request do
|
32
|
+
json.extract! @user.deletion_request, :id, :token
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
json.extract! dashboard, :id, :name, :full_name, :widgets_templates, :currency
|
2
|
+
|
3
|
+
json.data_sources dashboard.organizations.compact.map do |org|
|
4
|
+
json.id org.id
|
5
|
+
json.uid org.uid
|
6
|
+
json.label org.name
|
7
|
+
end
|
8
|
+
json.widgets dashboard.sorted_widgets, partial: 'mno_enterprise/jpi/v1/impac/widgets/widget', as: :widget
|
9
|
+
json.kpis dashboard.kpis, partial: 'mno_enterprise/jpi/v1/impac/kpis/kpi', as: :kpi
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @dashboards, partial: 'dashboard', as: :dashboard
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! 'dashboard', dashboard: @dashboard
|
@@ -0,0 +1 @@
|
|
1
|
+
json.extract! kpi, :id, :name, :element_watched, :endpoint, :source, :targets, :settings, :extra_params
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! 'kpi', kpi: @kpi
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! 'widget', widget: @widget
|
@@ -0,0 +1,14 @@
|
|
1
|
+
json.extract! app, :id, :nid, :name, :stack, :key_benefits, :categories, :tags, :tiny_description,
|
2
|
+
:testimonials, :pictures, :pricing_plans
|
3
|
+
|
4
|
+
json.description markdown(app.sanitized_description)
|
5
|
+
|
6
|
+
json.is_responsive app.responsive?
|
7
|
+
json.is_star_ready app.star_ready?
|
8
|
+
json.is_connec_ready app.connec_ready?
|
9
|
+
json.is_coming_soon app.coming_soon?
|
10
|
+
json.single_billing app.single_billing?
|
11
|
+
|
12
|
+
if app.logo
|
13
|
+
json.logo app.logo.to_s
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# arrears_situations ||= @organization.arrears_situations.in_progress
|
2
|
+
#
|
3
|
+
# json.arrears_situations do
|
4
|
+
# json.array! [arrears_situations].flatten do |sit|
|
5
|
+
# json.id sit.id
|
6
|
+
# json.owner_id sit.owner_id
|
7
|
+
# json.owner_type sit.owner_type
|
8
|
+
# json.category sit.category
|
9
|
+
# json.status sit.status
|
10
|
+
# end
|
11
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
json.credit_card do
|
2
|
+
if credit_card
|
3
|
+
json.extract! credit_card, :id, :title,:first_name,:last_name,:month,:year,:country,:billing_address,:billing_city,:billing_postcode, :billing_country
|
4
|
+
json.number credit_card.masked_number
|
5
|
+
json.verification_value 'CVV'
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
json.invoices do
|
2
|
+
json.array! organization.invoices.order_by('ended_at.desc') do |invoice|
|
3
|
+
json.period invoice.period_label
|
4
|
+
json.amount AccountingjsSerializer.serialize(invoice.total_due)
|
5
|
+
json.paid invoice.paid?
|
6
|
+
json.link mno_enterprise.invoice_path(invoice.slug)
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
if member.is_a?(MnoEnterprise::User)
|
2
|
+
json.id member.id
|
3
|
+
json.entity 'User'
|
4
|
+
json.name member.name
|
5
|
+
json.surname member.surname
|
6
|
+
json.email member.email
|
7
|
+
json.role member.role(organization)
|
8
|
+
elsif member.is_a?(MnoEnterprise::OrgInvite)
|
9
|
+
json.id member.id
|
10
|
+
json.entity 'OrgInvite'
|
11
|
+
json.email member.user_email
|
12
|
+
json.role member.user_role
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
json.extract! organization, :id, :name, :soa_enabled #, :current_support_plan
|
2
|
+
# json.show_new_db_features !!organization.get_meta_data(:show_new_db_features)
|
3
|
+
# if organization.support_plan
|
4
|
+
# json.custom_training_credits organization.support_plan.custom_training_credits
|
5
|
+
# end
|
6
|
+
|
7
|
+
# json.bootstrap_tasks do
|
8
|
+
# json.app_launched (@organization.app_instances.count > 0)
|
9
|
+
# json.credit_card_details @organization.credit_card?
|
10
|
+
# json.data_uploaded !!@organization.get_meta_data(:data_uploaded)
|
11
|
+
# json.colleagues_invited (@organization.orga_invites.count > 0)
|
12
|
+
# json.connec_promo !!@organization.get_meta_data(:connec_promo)
|
13
|
+
# end
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! 'credit_card', credit_card: @credit_card
|
@@ -0,0 +1 @@
|
|
1
|
+
json.organizations @organizations, partial: 'organization', as: :organization
|
@@ -0,0 +1,15 @@
|
|
1
|
+
json.organization do
|
2
|
+
json.partial! 'organization', organization: @organization
|
3
|
+
json.members @organization.members, partial: 'member', as: :member, organization: @organization
|
4
|
+
end
|
5
|
+
|
6
|
+
json.current_user do
|
7
|
+
json.partial! 'current_user', user: current_user, organization: @organization
|
8
|
+
end
|
9
|
+
|
10
|
+
if current_user.role(@organization) == 'Super Admin'
|
11
|
+
json.partial! 'billing', organization: @organization
|
12
|
+
json.partial! 'invoices', organization: @organization
|
13
|
+
json.partial! 'credit_card', credit_card: @organization.credit_card
|
14
|
+
#json.partial! 'arrears', arrears_situations: @organization.arrears_situations.in_progress
|
15
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
json.id @cart.id
|
2
|
+
json.pdfUrl @cart.read_attribute(:pdf) ? cart_invoice_url(@cart.slug) : nil
|
3
|
+
|
4
|
+
json.content do
|
5
|
+
json.appInstances (@cart.content[:app_instances] || {}).values
|
6
|
+
json.services (@cart.content[:services] || {}).values
|
7
|
+
json.support @cart.content[:support]
|
8
|
+
json.deal @cart.content[:deal]
|
9
|
+
end
|
10
|
+
|
11
|
+
json.total do
|
12
|
+
json.monthly @cart.total_monthly
|
13
|
+
json.monthlyRaw @cart.total_monthly_raw
|
14
|
+
|
15
|
+
json.hourly @cart.total_hourly
|
16
|
+
json.adhoc @cart.total_adhoc
|
17
|
+
|
18
|
+
json.upfrontWithTax @cart.total_upfront_with_tax
|
19
|
+
json.upfrontTax @cart.total_upfront_tax
|
20
|
+
|
21
|
+
json.upfront @cart.total_upfront
|
22
|
+
json.upfrontBeforeCredit @cart.total_upfront_before_credit
|
23
|
+
json.upfrontRaw @cart.total_upfront_raw
|
24
|
+
|
25
|
+
json.upfrontSavings @cart.total_upfront_savings
|
26
|
+
json.supportCredit @cart.total_support_credit
|
27
|
+
end
|
28
|
+
|
29
|
+
json.orderList @cart.order_list
|
30
|
+
|
31
|
+
json.setting do
|
32
|
+
json.prepayMonths @cart.prepay_months
|
33
|
+
json.reductionPercent @cart.reduction_whole_percent
|
34
|
+
json.underFreeTrial @cart.under_free_trial?
|
35
|
+
json.freeTrialEligible @cart.free_trial_eligible?
|
36
|
+
json.creditCardRequired @cart.credit_card_required?
|
37
|
+
json.monthlyCreditAvailable @cart.monthly_credit_available?
|
38
|
+
json.ownedSupportPlan @cart.owned_support_plan
|
39
|
+
end
|
40
|
+
|
41
|
+
json.creditCard do
|
42
|
+
if @cart.credit_card
|
43
|
+
cc = @cart.credit_card
|
44
|
+
|
45
|
+
json.id cc.id
|
46
|
+
json.title cc.title
|
47
|
+
json.first_name cc.first_name
|
48
|
+
json.last_name cc.last_name
|
49
|
+
json.number cc.masked_number
|
50
|
+
json.month cc.month
|
51
|
+
json.year cc.year
|
52
|
+
json.country cc.country
|
53
|
+
|
54
|
+
json.billing_address cc.billing_address
|
55
|
+
json.billing_city cc.billing_city
|
56
|
+
json.billing_postcode cc.billing_postcode
|
57
|
+
json.billing_country cc.billing_country
|
58
|
+
end
|
59
|
+
end
|