lesli_help 0.1.0

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 (97) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +5 -0
  3. data/app/assets/config/lesli_help_manifest.js +38 -0
  4. data/app/assets/images/lesli_help/help-logo.svg +9 -0
  5. data/app/assets/javascripts/lesli_help/application.js +6203 -0
  6. data/app/assets/stylesheets/lesli_help/application.css +15 -0
  7. data/app/controllers/lesli_help/accounts_controller.rb +60 -0
  8. data/app/controllers/lesli_help/application_controller.rb +4 -0
  9. data/app/controllers/lesli_help/dashboard/components_controller.rb +92 -0
  10. data/app/controllers/lesli_help/dashboards_controller.rb +36 -0
  11. data/app/controllers/lesli_help/tickets_controller.rb +171 -0
  12. data/app/helpers/lesli_help/accounts_helper.rb +4 -0
  13. data/app/helpers/lesli_help/application_helper.rb +4 -0
  14. data/app/helpers/lesli_help/dashboards_helper.rb +4 -0
  15. data/app/jobs/lesli_help/application_job.rb +4 -0
  16. data/app/mailers/lesli_help/application_mailer.rb +6 -0
  17. data/app/models/lesli_help/account.rb +38 -0
  18. data/app/models/lesli_help/application_record.rb +5 -0
  19. data/app/models/lesli_help/dashboard/component.rb +18 -0
  20. data/app/models/lesli_help/dashboard.rb +28 -0
  21. data/app/models/lesli_help/ticket.rb +39 -0
  22. data/app/services/lesli_help/ticket_service.rb +120 -0
  23. data/app/views/layouts/lesli_help/application.html.erb +15 -0
  24. data/app/views/lesli_help/accounts/_account.html.erb +2 -0
  25. data/app/views/lesli_help/accounts/_form.html.erb +17 -0
  26. data/app/views/lesli_help/accounts/edit.html.erb +10 -0
  27. data/app/views/lesli_help/accounts/index.html.erb +14 -0
  28. data/app/views/lesli_help/accounts/new.html.erb +9 -0
  29. data/app/views/lesli_help/accounts/show.html.erb +10 -0
  30. data/app/views/lesli_help/dashboards/edit.html.erb +1 -0
  31. data/app/views/lesli_help/dashboards/index.html.erb +1 -0
  32. data/app/views/lesli_help/dashboards/new.html.erb +1 -0
  33. data/app/views/lesli_help/dashboards/show.html.erb +1 -0
  34. data/app/views/lesli_help/partials/_engine-navigation.html.erb +39 -0
  35. data/app/views/lesli_help/tickets/edit.html.erb +20 -0
  36. data/app/views/lesli_help/tickets/index.html.erb +34 -0
  37. data/app/views/lesli_help/tickets/new.html.erb +20 -0
  38. data/app/views/lesli_help/tickets/show.html.erb +20 -0
  39. data/config/locales/translations.en.yml +23 -0
  40. data/config/locales/translations.es.yml +23 -0
  41. data/config/routes.rb +51 -0
  42. data/db/migrate/v1/0702000110_create_lesli_help_accounts.rb +42 -0
  43. data/db/migrate/v1/0702000210_create_lesli_help_account_settings.rb +46 -0
  44. data/db/migrate/v1/0702050110_create_lesli_help_dashboards.rb +50 -0
  45. data/db/migrate/v1/0702050210_create_lesli_help_dashboard_components.rb +50 -0
  46. data/db/migrate/v1/0702100110_create_lesli_help_slas.rb +59 -0
  47. data/db/migrate/v1/0702110110_create_lesli_help_tickets.rb +93 -0
  48. data/db/seed/development.rb +43 -0
  49. data/db/seed/production.rb +31 -0
  50. data/db/seed/test.rb +31 -0
  51. data/db/seeds.rb +43 -0
  52. data/db/tables/0702010110_create_cloud_help_catalogs.rb +8 -0
  53. data/db/tables/0702010210_create_cloud_help_catalog_ticket_categories.rb +44 -0
  54. data/db/tables/0702010310_create_cloud_help_catalog_ticket_priorities.rb +46 -0
  55. data/db/tables/0702010410_create_cloud_help_catalog_ticket_types.rb +44 -0
  56. data/db/tables/0702010510_create_cloud_help_catalog_ticket_sources.rb +44 -0
  57. data/db/tables/0702010610_create_cloud_help_catalog_ticket_workspaces.rb +38 -0
  58. data/db/tables/0702020110_create_cloud_help_workflows.rb +47 -0
  59. data/db/tables/0702020210_create_cloud_help_workflow_statuses.rb +47 -0
  60. data/db/tables/0702020310_create_cloud_help_workflow_associations.rb +29 -0
  61. data/db/tables/0702020410_create_cloud_help_workflow_actions.rb +18 -0
  62. data/db/tables/0702020510_create_cloud_help_workflow_checks.rb +20 -0
  63. data/db/tables/0702030110_create_cloud_help_custom_fields.rb +15 -0
  64. data/db/tables/0702040110_create_cloud_help_custom_validations.rb +16 -0
  65. data/db/tables/0702040210_create_cloud_help_custom_validation_rules.rb +16 -0
  66. data/db/tables/0702040310_create_cloud_help_custom_validation_fields.rb +16 -0
  67. data/db/tables/0702100310_create_cloud_help_ticket_actions.rb +16 -0
  68. data/db/tables/0702100410_create_cloud_help_ticket_activities.rb +15 -0
  69. data/db/tables/0702100510_create_cloud_help_ticket_discussions.rb +17 -0
  70. data/db/tables/0702100610_create_cloud_help_ticket_files.rb +16 -0
  71. data/db/tables/0702100710_create_cloud_help_ticket_subscribers.rb +16 -0
  72. data/db/tables/0702101010_create_cloud_help_ticket_timelines.rb +14 -0
  73. data/db/tables/0702101110_create_cloud_help_ticket_assignments.rb +15 -0
  74. data/db/tables/0702101210_create_cloud_help_ticket_histories.rb +15 -0
  75. data/db/tables/0702110310_create_cloud_help_sla_actions.rb +17 -0
  76. data/db/tables/0702110410_create_cloud_help_sla_activities.rb +15 -0
  77. data/db/tables/0702110510_create_cloud_help_sla_discussions.rb +17 -0
  78. data/db/tables/0702110610_create_cloud_help_sla_files.rb +16 -0
  79. data/db/tables/0702110710_create_cloud_help_sla_subscribers.rb +16 -0
  80. data/db/tables/0702111010_create_cloud_help_sla_associations.rb +13 -0
  81. data/lib/lesli_help/engine.rb +50 -0
  82. data/lib/lesli_help/version.rb +4 -0
  83. data/lib/lesli_help.rb +6 -0
  84. data/lib/tasks/lesli_help_tasks.rake +4 -0
  85. data/lib/vue/application.js +85 -0
  86. data/lib/vue/apps/dashboard/show.vue +43 -0
  87. data/lib/vue/apps/tickets/components/assignments.vue +93 -0
  88. data/lib/vue/apps/tickets/components/form.vue +252 -0
  89. data/lib/vue/apps/tickets/components/internal-comments.vue +107 -0
  90. data/lib/vue/apps/tickets/components/sla-info.vue +115 -0
  91. data/lib/vue/apps/tickets/index.vue +171 -0
  92. data/lib/vue/apps/tickets/new.vue +92 -0
  93. data/lib/vue/apps/tickets/show.vue +177 -0
  94. data/lib/vue/stores/tickets.js +275 -0
  95. data/lib/vue/stores/translations.json +56 -0
  96. data/readme.md +71 -0
  97. metadata +155 -0
@@ -0,0 +1,43 @@
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
+ 25.times do |index|
36
+ current_user.account.help.tickets.create!({
37
+ :subject => "Demo ticket ##{index}",
38
+ :description => "My printer number #{index} is not working",
39
+ :deadline => 1.week.from_now,
40
+ :user => current_user,
41
+ :creator => current_user
42
+ })
43
+ 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,43 @@
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
+ "LesliHelp",
40
+ "Version: #{LesliHelp::VERSION}",
41
+ "Build: #{LesliHelp::BUILD}")
42
+ load LesliHelp::Engine.root.join("db", "seed", "#{ Rails.env.downcase }.rb")
43
+ end
@@ -0,0 +1,8 @@
1
+ class CreateCloudHelpCatalogs < ActiveRecord::Migration[6.0]
2
+ def change
3
+ #create_table :cloud_help_catalogs do |t|
4
+ #
5
+ # t.timestamps
6
+ #end
7
+ end
8
+ 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 CreateCloudHelpCatalogTicketCategories < ActiveRecord::Migration[6.0]
34
+ def change
35
+ create_table :cloud_help_catalog_ticket_categories do |t|
36
+ t.string :name
37
+ t.string :ancestry, index: true
38
+
39
+ t.datetime :deleted_at, index: true
40
+ t.timestamps
41
+ end
42
+ add_reference(:cloud_help_catalog_ticket_categories, :account, foreign_key: { to_table: :cloud_help_accounts }, index: { name: "help_catalog_ticket_categories_accounts" })
43
+ end
44
+ end
@@ -0,0 +1,46 @@
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 CreateCloudHelpCatalogTicketPriorities < ActiveRecord::Migration[6.0]
34
+ def change
35
+ create_table :cloud_help_catalog_ticket_priorities do |t|
36
+ t.string :name
37
+ t.integer :weight
38
+ t.integer :days_to_deadline
39
+
40
+ # acts_as_paranoid
41
+ t.datetime :deleted_at, index: true
42
+ t.timestamps
43
+ end
44
+ add_reference(:cloud_help_catalog_ticket_priorities, :account, foreign_key: { to_table: :cloud_help_accounts })
45
+ end
46
+ 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 CreateCloudHelpCatalogTicketTypes < ActiveRecord::Migration[6.0]
34
+ def change
35
+ create_table :cloud_help_catalog_ticket_types 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_types, :account, foreign_key: { to_table: :cloud_help_accounts })
43
+ end
44
+ 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,38 @@
1
+ =begin
2
+
3
+ Copyright (c) 2022, all rights reserved.
4
+
5
+ All the information provided by this platform is protected by international laws related to
6
+ industrial property, intellectual property, copyright and relative international laws.
7
+ All intellectual or industrial property rights of the code, texts, trade mark, design,
8
+ pictures and any other information belongs to the owner of this platform.
9
+
10
+ Without the written permission of the owner, any replication, modification,
11
+ transmission, publication is strictly forbidden.
12
+
13
+ For more information read the license file including with this software.
14
+
15
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ // ·
17
+
18
+ =end
19
+ class CreateCloudHelpCatalogTicketWorkspaces < ActiveRecord::Migration[6.1]
20
+ def change
21
+ create_table :cloud_help_catalog_ticket_workspaces do |t|
22
+ t.string :name
23
+ t.boolean :default, default: false
24
+
25
+ # acts_as_paranoid
26
+ t.datetime :deleted_at, index: true
27
+
28
+ t.timestamps
29
+ end
30
+
31
+ add_reference(
32
+ :cloud_help_catalog_ticket_workspaces,
33
+ :account,
34
+ foreign_key: { to_table: :cloud_help_accounts },
35
+ index: { name: "help_catalog_ticket_workspaces_accounts" }
36
+ )
37
+ end
38
+ 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
@@ -0,0 +1,16 @@
1
+ class CreateCloudHelpTicketActions < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000003_actions.json")))
4
+ create_table :cloud_help_ticket_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
+ add_reference :cloud_help_ticket_actions, :users, foreign_key: true
14
+ add_reference :cloud_help_ticket_actions, :cloud_help_tickets, foreign_key: true, index: { name: "help_ticket_actions_tickets" }
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ class CreateCloudHelpTicketActivities < ActiveRecord::Migration[6.0]
2
+ def change
3
+ table_base_structure = JSON.parse(File.read(Rails.root.join("db","structure","00000004_activities.json")))
4
+ create_table :cloud_help_ticket_activities 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_ticket_activities, :cloud_help_tickets, foreign_key: true
14
+ end
15
+ end