lesli_support 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +5 -0
- data/app/assets/config/lesli_support_manifest.js +38 -0
- data/app/assets/images/lesli_support/support-logo.svg +9 -0
- data/app/assets/javascripts/lesli_support/application.js +5011 -0
- data/app/assets/stylesheets/lesli_support/application.css +9 -0
- data/app/controllers/lesli_support/accounts_controller.rb +60 -0
- data/app/controllers/lesli_support/application_controller.rb +4 -0
- data/app/controllers/lesli_support/catalog_categories_controller.rb +60 -0
- data/app/controllers/lesli_support/catalog_priorities_controller.rb +60 -0
- data/app/controllers/lesli_support/catalog_types_controller.rb +60 -0
- data/app/controllers/lesli_support/catalog_workspaces_controller.rb +60 -0
- data/app/controllers/lesli_support/catalogs_controller.rb +12 -0
- data/app/controllers/lesli_support/dashboard/components_controller.rb +92 -0
- data/app/controllers/lesli_support/dashboards_controller.rb +36 -0
- data/app/controllers/lesli_support/options_controller.rb +23 -0
- data/app/controllers/lesli_support/ticket/discussions_controller.rb +5 -0
- data/app/controllers/lesli_support/tickets_controller.rb +169 -0
- data/app/helpers/lesli_support/accounts_helper.rb +4 -0
- data/app/helpers/lesli_support/application_helper.rb +4 -0
- data/app/helpers/lesli_support/catalog_categories_helper.rb +4 -0
- data/app/helpers/lesli_support/catalog_priorities_helper.rb +4 -0
- data/app/helpers/lesli_support/catalog_types_helper.rb +4 -0
- data/app/helpers/lesli_support/catalog_workspaces_helper.rb +4 -0
- data/app/helpers/lesli_support/catalogs_helper.rb +4 -0
- data/app/helpers/lesli_support/dashboards_helper.rb +4 -0
- data/app/helpers/lesli_support/options_helper.rb +4 -0
- data/app/helpers/lesli_support/ticket/discussions_helper.rb +4 -0
- data/app/jobs/lesli_support/application_job.rb +4 -0
- data/app/mailers/lesli_support/application_mailer.rb +6 -0
- data/app/models/lesli_support/account.rb +48 -0
- data/app/models/lesli_support/application_record.rb +5 -0
- data/app/models/lesli_support/catalog.rb +15 -0
- data/app/models/lesli_support/catalog_category.rb +5 -0
- data/app/models/lesli_support/catalog_priority.rb +5 -0
- data/app/models/lesli_support/catalog_type.rb +5 -0
- data/app/models/lesli_support/catalog_workspace.rb +5 -0
- data/app/models/lesli_support/dashboard/component.rb +18 -0
- data/app/models/lesli_support/dashboard.rb +15 -0
- data/app/models/lesli_support/option.rb +4 -0
- data/app/models/lesli_support/ticket/discussion.rb +7 -0
- data/app/models/lesli_support/ticket.rb +44 -0
- data/app/services/lesli_support/catalog_service.rb +139 -0
- data/app/services/lesli_support/ticket_service.rb +147 -0
- data/app/views/layouts/lesli_support/application.html.erb +15 -0
- data/app/views/lesli_support/accounts/_account.html.erb +2 -0
- data/app/views/lesli_support/accounts/_form.html.erb +17 -0
- data/app/views/lesli_support/accounts/edit.html.erb +10 -0
- data/app/views/lesli_support/accounts/index.html.erb +14 -0
- data/app/views/lesli_support/accounts/new.html.erb +9 -0
- data/app/views/lesli_support/accounts/show.html.erb +10 -0
- data/app/views/lesli_support/catalog_categories/_catalog_category.html.erb +2 -0
- data/app/views/lesli_support/catalog_categories/_form.html.erb +17 -0
- data/app/views/lesli_support/catalog_categories/edit.html.erb +10 -0
- data/app/views/lesli_support/catalog_categories/index.html.erb +14 -0
- data/app/views/lesli_support/catalog_categories/new.html.erb +9 -0
- data/app/views/lesli_support/catalog_categories/show.html.erb +10 -0
- data/app/views/lesli_support/catalog_priorities/_catalog_priority.html.erb +2 -0
- data/app/views/lesli_support/catalog_priorities/_form.html.erb +17 -0
- data/app/views/lesli_support/catalog_priorities/edit.html.erb +10 -0
- data/app/views/lesli_support/catalog_priorities/index.html.erb +14 -0
- data/app/views/lesli_support/catalog_priorities/new.html.erb +9 -0
- data/app/views/lesli_support/catalog_priorities/show.html.erb +10 -0
- data/app/views/lesli_support/catalog_types/_catalog_type.html.erb +2 -0
- data/app/views/lesli_support/catalog_types/_form.html.erb +17 -0
- data/app/views/lesli_support/catalog_types/edit.html.erb +10 -0
- data/app/views/lesli_support/catalog_types/index.html.erb +14 -0
- data/app/views/lesli_support/catalog_types/new.html.erb +9 -0
- data/app/views/lesli_support/catalog_types/show.html.erb +10 -0
- data/app/views/lesli_support/catalog_workspaces/_catalog_workspace.html.erb +2 -0
- data/app/views/lesli_support/catalog_workspaces/_form.html.erb +17 -0
- data/app/views/lesli_support/catalog_workspaces/edit.html.erb +10 -0
- data/app/views/lesli_support/catalog_workspaces/index.html.erb +14 -0
- data/app/views/lesli_support/catalog_workspaces/new.html.erb +9 -0
- data/app/views/lesli_support/catalog_workspaces/show.html.erb +10 -0
- data/app/views/lesli_support/catalogs/_catalog.html.erb +2 -0
- data/app/views/lesli_support/catalogs/_form.html.erb +17 -0
- data/app/views/lesli_support/catalogs/edit.html.erb +10 -0
- data/app/views/lesli_support/catalogs/index.html.erb +14 -0
- data/app/views/lesli_support/catalogs/new.html.erb +9 -0
- data/app/views/lesli_support/catalogs/show.html.erb +10 -0
- data/app/views/lesli_support/dashboards/edit.html.erb +1 -0
- data/app/views/lesli_support/dashboards/index.html.erb +1 -0
- data/app/views/lesli_support/dashboards/new.html.erb +1 -0
- data/app/views/lesli_support/dashboards/show.html.erb +1 -0
- data/app/views/lesli_support/options/_form.html.erb +17 -0
- data/app/views/lesli_support/options/_option.html.erb +2 -0
- data/app/views/lesli_support/options/edit.html.erb +10 -0
- data/app/views/lesli_support/options/index.html.erb +14 -0
- data/app/views/lesli_support/options/new.html.erb +9 -0
- data/app/views/lesli_support/options/show.html.erb +10 -0
- data/app/views/lesli_support/partials/_engine-navigation.html.erb +39 -0
- data/app/views/lesli_support/ticket/discussions/_discussion.html.erb +2 -0
- data/app/views/lesli_support/ticket/discussions/_form.html.erb +17 -0
- data/app/views/lesli_support/ticket/discussions/edit.html.erb +10 -0
- data/app/views/lesli_support/ticket/discussions/index.html.erb +14 -0
- data/app/views/lesli_support/ticket/discussions/new.html.erb +9 -0
- data/app/views/lesli_support/ticket/discussions/show.html.erb +10 -0
- data/app/views/lesli_support/tickets/edit.html.erb +20 -0
- data/app/views/lesli_support/tickets/index.html.erb +34 -0
- data/app/views/lesli_support/tickets/new.html.erb +20 -0
- data/app/views/lesli_support/tickets/show.html.erb +20 -0
- data/config/locales/translations.en.yml +43 -0
- data/config/locales/translations.es.yml +43 -0
- data/config/locales/translations.fr.yml +43 -0
- data/config/locales/translations.it.yml +43 -0
- data/config/locales/translations.pt.yml +43 -0
- data/config/routes.rb +61 -0
- data/db/migrate/v1/0702000110_create_lesli_support_accounts.rb +42 -0
- data/db/migrate/v1/0702000210_create_lesli_support_account_settings.rb +46 -0
- data/db/migrate/v1/0702010110_create_lesli_support_catalog_workspaces.rb +43 -0
- data/db/migrate/v1/0702010210_create_lesli_support_catalog_types.rb +42 -0
- data/db/migrate/v1/0702010310_create_lesli_support_catalog_categories.rb +43 -0
- data/db/migrate/v1/0702010410_create_lesli_support_catalog_priorities.rb +43 -0
- data/db/migrate/v1/0702050110_create_lesli_support_dashboards.rb +50 -0
- data/db/migrate/v1/0702050210_create_lesli_support_dashboard_components.rb +50 -0
- data/db/migrate/v1/0702100110_create_lesli_support_slas.rb +59 -0
- data/db/migrate/v1/0702110110_create_lesli_support_tickets.rb +99 -0
- data/db/migrate/v1/0702110510_create_lesli_support_ticket_discussions.rb +52 -0
- data/db/seed/development.rb +62 -0
- data/db/seed/production.rb +31 -0
- data/db/seed/test.rb +31 -0
- data/db/seeds.rb +45 -0
- data/db/tables/0702010510_create_cloud_help_catalog_ticket_sources.rb +44 -0
- data/db/tables/0702020110_create_cloud_help_workflows.rb +47 -0
- data/db/tables/0702020210_create_cloud_help_workflow_statuses.rb +47 -0
- data/db/tables/0702020310_create_cloud_help_workflow_associations.rb +29 -0
- data/db/tables/0702020410_create_cloud_help_workflow_actions.rb +18 -0
- data/db/tables/0702020510_create_cloud_help_workflow_checks.rb +20 -0
- data/db/tables/0702030110_create_cloud_help_custom_fields.rb +15 -0
- data/db/tables/0702040110_create_cloud_help_custom_validations.rb +16 -0
- data/db/tables/0702040210_create_cloud_help_custom_validation_rules.rb +16 -0
- data/db/tables/0702040310_create_cloud_help_custom_validation_fields.rb +16 -0
- data/db/tables/0702100310_create_cloud_help_ticket_actions.rb +16 -0
- data/db/tables/0702100410_create_cloud_help_ticket_activities.rb +15 -0
- data/db/tables/0702100610_create_cloud_help_ticket_files.rb +16 -0
- data/db/tables/0702100710_create_cloud_help_ticket_subscribers.rb +16 -0
- data/db/tables/0702101010_create_cloud_help_ticket_timelines.rb +14 -0
- data/db/tables/0702101110_create_cloud_help_ticket_assignments.rb +15 -0
- data/db/tables/0702101210_create_cloud_help_ticket_histories.rb +15 -0
- data/db/tables/0702110310_create_cloud_help_sla_actions.rb +17 -0
- data/db/tables/0702110410_create_cloud_help_sla_activities.rb +15 -0
- data/db/tables/0702110510_create_cloud_help_sla_discussions.rb +17 -0
- data/db/tables/0702110610_create_cloud_help_sla_files.rb +16 -0
- data/db/tables/0702110710_create_cloud_help_sla_subscribers.rb +16 -0
- data/db/tables/0702111010_create_cloud_help_sla_associations.rb +13 -0
- data/lib/lesli_support/engine.rb +50 -0
- data/lib/lesli_support/version.rb +4 -0
- data/lib/lesli_support.rb +6 -0
- data/lib/scss/application.scss +11 -0
- data/lib/tasks/lesli_support_tasks.rake +4 -0
- data/lib/vue/application.js +93 -0
- data/lib/vue/apps/dashboard/components/engine-version.vue +71 -0
- data/lib/vue/apps/dashboard/components/my-tasks.vue +77 -0
- data/lib/vue/apps/tickets/components/assignments.vue +93 -0
- data/lib/vue/apps/tickets/components/form.vue +305 -0
- data/lib/vue/apps/tickets/components/internal-comments.vue +107 -0
- data/lib/vue/apps/tickets/components/sla-info.vue +115 -0
- data/lib/vue/apps/tickets/index.vue +145 -0
- data/lib/vue/apps/tickets/new.vue +78 -0
- data/lib/vue/apps/tickets/show.vue +183 -0
- data/lib/vue/stores/tickets.js +276 -0
- data/lib/vue/stores/translations.json +272 -0
- data/readme.md +72 -0
- metadata +223 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class CreateLesliSupportSlas < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
create_table :lesli_support_slas do |t|
|
36
|
+
t.string :name
|
37
|
+
t.integer :expected_response_time
|
38
|
+
t.integer :expected_resolution_time
|
39
|
+
t.float :price_per_hour
|
40
|
+
t.text :body
|
41
|
+
t.text :provider_repercussions
|
42
|
+
t.text :client_repercussions
|
43
|
+
t.text :exceptions
|
44
|
+
t.boolean :default, default: false
|
45
|
+
|
46
|
+
# Main user
|
47
|
+
t.bigint :user_main_id
|
48
|
+
|
49
|
+
# acts_as_paranoid
|
50
|
+
t.datetime :deleted_at, index: true
|
51
|
+
|
52
|
+
t.timestamps
|
53
|
+
end
|
54
|
+
|
55
|
+
add_reference(:lesli_support_slas, :accounts, foreign_key: { to_table: :lesli_support_accounts })
|
56
|
+
add_reference(:lesli_support_slas, :users, foreign_key: { to_table: :lesli_users })
|
57
|
+
#add_reference(:lesli_support_slas, :statuses, foreign_key: true, index: { name: "help_slas_workflow_statuses" })
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class CreateLesliSupportTickets < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
create_table :lesli_support_tickets do |t|
|
36
|
+
t.string :subject
|
37
|
+
t.text :description
|
38
|
+
|
39
|
+
t.string :tags
|
40
|
+
t.decimal :hours_worked
|
41
|
+
t.string :reference_url
|
42
|
+
|
43
|
+
t.datetime :deadline
|
44
|
+
t.datetime :started_at
|
45
|
+
t.datetime :completed_at
|
46
|
+
|
47
|
+
t.datetime :deleted_at, index: true
|
48
|
+
t.timestamps
|
49
|
+
end
|
50
|
+
|
51
|
+
add_reference(
|
52
|
+
:lesli_support_tickets,
|
53
|
+
:catalog_workspace,
|
54
|
+
foreign_key: { to_table: :lesli_support_catalog_workspaces },
|
55
|
+
index: { name: "support_tickets_catalog_workspaces" }
|
56
|
+
)
|
57
|
+
|
58
|
+
add_reference(
|
59
|
+
:lesli_support_tickets,
|
60
|
+
:catalog_type,
|
61
|
+
foreign_key: { to_table: :lesli_support_catalog_types},
|
62
|
+
index: { name: "support_tickets_catalog_types" }
|
63
|
+
)
|
64
|
+
|
65
|
+
add_reference(
|
66
|
+
:lesli_support_tickets,
|
67
|
+
:catalog_category,
|
68
|
+
foreign_key: { to_table: :lesli_support_catalog_categories },
|
69
|
+
index: { name: "support_tickets_catalog_categories" }
|
70
|
+
)
|
71
|
+
|
72
|
+
add_reference(
|
73
|
+
:lesli_support_tickets,
|
74
|
+
:catalog_priority,
|
75
|
+
foreign_key: { to_table: :lesli_support_catalog_priorities },
|
76
|
+
index: { name: "support_tickets_catalog_priorities" }
|
77
|
+
)
|
78
|
+
|
79
|
+
=begin
|
80
|
+
add_reference(
|
81
|
+
:cloud_lesli_tickets,
|
82
|
+
:status,
|
83
|
+
foreign_key: { to_table: :cloud_help_workflow_statuses },
|
84
|
+
index: { name: "help_tickets_workflow_statuses" }
|
85
|
+
)
|
86
|
+
add_reference(
|
87
|
+
:cloud_lesli_tickets,
|
88
|
+
:source,
|
89
|
+
foreign_key: { to_table: :cloud_help_catalog_ticket_sources },
|
90
|
+
index: { name: "help_tickets_catalog_ticket_sources" }
|
91
|
+
)
|
92
|
+
=end
|
93
|
+
|
94
|
+
add_reference(:lesli_support_tickets, :slas, foreign_key: { to_table: :lesli_support_slas })
|
95
|
+
add_reference(:lesli_support_tickets, :user, foreign_key: { to_table: :lesli_users }) # Assigned user
|
96
|
+
add_reference(:lesli_support_tickets, :creator, foreign_key: { to_table: :lesli_users }) # Creator user
|
97
|
+
add_reference(:lesli_support_tickets, :account, foreign_key: { to_table: :lesli_support_accounts })
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class CreateLesliSupportTicketDiscussions < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
gem_path = Lesli::System.engine("Lesli", "dir")
|
36
|
+
table_base_structure = JSON.parse(File.read(File.join(gem_path, "db", "structure", "00000005_discussions.json")))
|
37
|
+
|
38
|
+
create_table :lesli_support_ticket_discussions do |t|
|
39
|
+
table_base_structure.each do |column|
|
40
|
+
t.send(
|
41
|
+
column["type"].parameterize.underscore.to_sym,
|
42
|
+
column["name"].parameterize.underscore.to_sym
|
43
|
+
)
|
44
|
+
end
|
45
|
+
t.timestamps
|
46
|
+
end
|
47
|
+
|
48
|
+
add_reference(:lesli_support_ticket_discussions, :discussion, foreign_key: { to_table: :lesli_support_ticket_discussions })
|
49
|
+
add_reference(:lesli_support_ticket_discussions, :ticket, foreign_key: { to_table: :lesli_support_tickets })
|
50
|
+
add_reference(:lesli_support_ticket_discussions, :user, foreign_key: { to_table: :lesli_users })
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
current_user = Lesli::User.first
|
34
|
+
|
35
|
+
current_user.account.support.catalog_workspaces.find_or_create_by!(:name => "Default", :default => true)
|
36
|
+
|
37
|
+
current_user.account.support.catalog_types.find_or_create_by!(:name => "development")
|
38
|
+
current_user.account.support.catalog_types.find_or_create_by!(:name => "question")
|
39
|
+
current_user.account.support.catalog_types.find_or_create_by!(:name => "bug")
|
40
|
+
|
41
|
+
current_user.account.support.catalog_categories.find_or_create_by!(:name => "user_namagement")
|
42
|
+
current_user.account.support.catalog_categories.find_or_create_by!(:name => "role_namagement")
|
43
|
+
current_user.account.support.catalog_categories.find_or_create_by!(:name => "account_namagement")
|
44
|
+
|
45
|
+
current_user.account.support.catalog_priorities.find_or_create_by!(:name => "low", :weight => 1)
|
46
|
+
current_user.account.support.catalog_priorities.find_or_create_by!(:name => "medium", :weight => 2)
|
47
|
+
current_user.account.support.catalog_priorities.find_or_create_by!(:name => "high", :weight => 3)
|
48
|
+
|
49
|
+
|
50
|
+
10.times do |index|
|
51
|
+
current_user.account.support.tickets.create!({
|
52
|
+
:subject => "Demo ticket ##{index}",
|
53
|
+
:description => "My printer number #{index} is not working",
|
54
|
+
:deadline => index.day.from_now,
|
55
|
+
:user => current_user,
|
56
|
+
:creator => current_user,
|
57
|
+
:catalog_workspace => current_user.account.support.catalog_workspaces.first,
|
58
|
+
:catalog_type => current_user.account.support.catalog_types.first,
|
59
|
+
:catalog_category => current_user.account.support.catalog_categories.first,
|
60
|
+
:catalog_priority => current_user.account.support.catalog_priorities.first
|
61
|
+
})
|
62
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
data/db/seed/test.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
data/db/seeds.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
|
34
|
+
# IMPORTANT:
|
35
|
+
# Seed files are only for development, if you need to create default resources for production
|
36
|
+
# you must use the initializer method in the Engine account model
|
37
|
+
if Rails.env.development?
|
38
|
+
L2.msg(
|
39
|
+
"LesliSupport",
|
40
|
+
"Version: #{LesliSupport::VERSION}",
|
41
|
+
"Build: #{LesliSupport::BUILD}")
|
42
|
+
|
43
|
+
# · load specific environment seeds
|
44
|
+
load LesliSupport::Engine.root.join("db", "seed", "#{ Rails.env.downcase }.rb")
|
45
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS development platform.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class CreateCloudHelpCatalogTicketSources < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
create_table :cloud_help_catalog_ticket_sources do |t|
|
36
|
+
t.string :name
|
37
|
+
|
38
|
+
# acts_as_paranoid
|
39
|
+
t.datetime :deleted_at, index: true
|
40
|
+
t.timestamps
|
41
|
+
end
|
42
|
+
add_reference(:cloud_help_catalog_ticket_sources, :account, foreign_key: { to_table: :cloud_help_accounts })
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS development platform.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class CreateCloudHelpWorkflows < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000201_workflows.json")))
|
36
|
+
create_table :cloud_help_workflows do |t|
|
37
|
+
table_base_structure.each do |column|
|
38
|
+
t.send(
|
39
|
+
column["type"].parameterize.underscore.to_sym,
|
40
|
+
column["name"].parameterize.underscore.to_sym
|
41
|
+
)
|
42
|
+
end
|
43
|
+
t.timestamps
|
44
|
+
end
|
45
|
+
add_reference(:cloud_help_workflows, :account, foreign_key: { to_table: :cloud_help_accounts })
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS development platform.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
class CreateCloudHelpWorkflowStatuses < ActiveRecord::Migration[6.0]
|
34
|
+
def change
|
35
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000202_workflow_statuses.json")))
|
36
|
+
create_table :cloud_help_workflow_statuses do |t|
|
37
|
+
table_base_structure.each do |column|
|
38
|
+
t.send(
|
39
|
+
column["type"].parameterize.underscore.to_sym,
|
40
|
+
column["name"].parameterize.underscore.to_sym
|
41
|
+
)
|
42
|
+
end
|
43
|
+
t.timestamps
|
44
|
+
end
|
45
|
+
add_reference(:cloud_help_workflow_statuses, :workflow, foreign_key: { to_table: :cloud_help_workflows })
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class CreateCloudHelpWorkflowAssociations < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000203_workflow_associations.json")))
|
4
|
+
create_table :cloud_help_workflow_associations do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
# Specific fields to which you can associate a workflow with
|
13
|
+
t.bigint :ticket_type
|
14
|
+
t.bigint :ticket_category
|
15
|
+
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index :cloud_help_workflow_associations, :ticket_type, name: "help_workflow_associations_ticket_types"
|
20
|
+
add_index :cloud_help_workflow_associations, :ticket_category, name: "help_workflow_associations_ticket_categories"
|
21
|
+
|
22
|
+
add_reference(
|
23
|
+
:cloud_help_workflow_associations,
|
24
|
+
:workflow,
|
25
|
+
foreign_key: { to_table: :cloud_help_workflows},
|
26
|
+
index: { name: "help_workflow_associations_workflows" }
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateCloudHelpWorkflowActions < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000204_workflow_actions.json")))
|
4
|
+
create_table :cloud_help_workflow_actions do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
add_reference :cloud_help_workflow_actions, :cloud_help_workflows, foreign_key: true, index: { name: "help_workflow_actions_workflows" }
|
15
|
+
add_foreign_key :cloud_help_workflow_actions, :cloud_help_workflow_statuses, column: :initial_status_id
|
16
|
+
add_foreign_key :cloud_help_workflow_actions, :cloud_help_workflow_statuses, column: :final_status_id
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateCloudHelpWorkflowChecks < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000205_workflow_checks.json")))
|
4
|
+
create_table :cloud_help_workflow_checks do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
add_reference :cloud_help_workflow_checks, :cloud_help_workflows, foreign_key: true, index: { name: "help_workflow_checks_workflows" }
|
15
|
+
add_foreign_key :cloud_help_workflow_checks, :cloud_help_workflow_statuses, column: :initial_status_id
|
16
|
+
add_foreign_key :cloud_help_workflow_checks, :cloud_help_workflow_statuses, column: :final_status_id
|
17
|
+
add_foreign_key :cloud_help_workflow_checks, :roles, column: :roles_id
|
18
|
+
add_foreign_key :cloud_help_workflow_checks, :users, column: :users_id
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateCloudHelpCustomFields < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000301_custom_fields.json")))
|
4
|
+
create_table :cloud_help_custom_fields do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_reference :cloud_help_custom_fields, :cloud_help_accounts, foreign_key: true, index: { name: "cloud_help_accounts_custom_fields" }
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateCloudHelpCustomValidations < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000401_custom_validations.json")))
|
4
|
+
create_table :cloud_help_custom_validations do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_reference :cloud_help_custom_validations, :users, foreign_key: true
|
14
|
+
add_reference :cloud_help_custom_validations, :cloud_help_accounts, foreign_key: true, index: { name: "help_custom_validations_accounts" }
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateCloudHelpCustomValidationRules < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000402_custom_validation_rules.json")))
|
4
|
+
create_table :cloud_help_custom_validation_rules do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_reference :cloud_help_custom_validation_rules, :users, foreign_key: true
|
14
|
+
add_reference :cloud_help_custom_validation_rules, :cloud_help_custom_validations, foreign_key: true, index: { name: "help_custom_validation_rules_validations" }
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateCloudHelpCustomValidationFields < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000403_custom_validation_fields.json")))
|
4
|
+
create_table :cloud_help_custom_validation_fields do |t|
|
5
|
+
table_base_structure.each do |column|
|
6
|
+
t.send(
|
7
|
+
column["type"].parameterize.underscore.to_sym,
|
8
|
+
column["name"].parameterize.underscore.to_sym
|
9
|
+
)
|
10
|
+
end
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_reference :cloud_help_custom_validation_fields, :users, foreign_key: true
|
14
|
+
add_reference :cloud_help_custom_validation_fields, :cloud_help_custom_validations, foreign_key: true, index: { name: "cloud_help_custom_validation_fields_validations" }
|
15
|
+
end
|
16
|
+
end
|