snf_core 0.2.93 → 0.2.94

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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/snf_core/auth_controller.rb +33 -0
  3. data/config/routes.rb +1 -1
  4. data/db/migrate/20250226080323_create_snf_core_businesses.rb +1 -1
  5. data/db/migrate/20250305232530_create_snf_core_user_roles.rb +2 -2
  6. data/lib/snf_core/version.rb +1 -1
  7. data/spec/dummy/config/environments/development.rb +8 -10
  8. data/spec/dummy/db/schema.rb +27 -27
  9. data/spec/dummy/log/development.log +442 -0
  10. data/spec/dummy/log/test.log +71052 -0
  11. data/spec/dummy/tmp/storage/0d/06/0d06loox3k7eov84ctxqlr7es62y +0 -0
  12. data/spec/dummy/tmp/storage/0f/mg/0fmgfbcjx3062446r5sb74i1yaop +0 -0
  13. data/spec/dummy/tmp/storage/0g/42/0g42chjo4kjajnwuko4pxh65xioi +0 -0
  14. data/spec/dummy/tmp/storage/0j/yl/0jylvdj86zcf9py4jreuxm4jd27y +0 -0
  15. data/spec/dummy/tmp/storage/0l/au/0lauwyvh2jz4cb7crwjdi4dalw6o +0 -0
  16. data/spec/dummy/tmp/storage/1n/sv/1nsv43xgjo50ouaifq757ef6gy5f +0 -0
  17. data/spec/dummy/tmp/storage/1r/lw/1rlwjla8z1riqvrga2a3rvms670e +0 -0
  18. data/spec/dummy/tmp/storage/20/p4/20p4ymzjd3qy3sh9f9bbpxw2a8h2 +0 -0
  19. data/spec/dummy/tmp/storage/2n/r6/2nr6p9wt4jgsyk0pbvf7vagvrh8t +0 -0
  20. data/spec/dummy/tmp/storage/2r/ny/2rnybicjbrsw6pdmaoyj8f9sxxaq +0 -0
  21. data/spec/dummy/tmp/storage/38/wp/38wpttcqfkmm1sqh4rugrsli6arz +0 -0
  22. data/spec/dummy/tmp/storage/3t/1f/3t1fhar9eatf4oh3kh5ne77wjlo8 +0 -0
  23. data/spec/dummy/tmp/storage/42/cf/42cf3l7nla3bl64wezbhwd5yc6yi +0 -0
  24. data/spec/dummy/tmp/storage/52/ed/52ed6pa5bayxu966bnzd4r7vfr5i +0 -0
  25. data/spec/dummy/tmp/storage/5c/1i/5c1i8vfr81kibsmy2id9plp74oc5 +0 -0
  26. data/spec/dummy/tmp/storage/5g/4k/5g4kyd9z59me1jqxw94tcdijfy6u +0 -0
  27. data/spec/dummy/tmp/storage/5l/n8/5ln8h3958owro1x84wkcgdnu0jqc +0 -0
  28. data/spec/dummy/tmp/storage/5o/sq/5osq7rdic48at5pkcoqdpf0ios2p +0 -0
  29. data/spec/dummy/tmp/storage/60/ap/60apljsclrdokzuqhu179rt7obh2 +0 -0
  30. data/spec/dummy/tmp/storage/66/fc/66fcsnze3roffkv3kn82p1i1jihe +0 -0
  31. data/spec/dummy/tmp/storage/68/45/68451e6tuxl501pub9n9uvcxye8d +0 -0
  32. data/spec/dummy/tmp/storage/6x/o7/6xo7qmei42tzx4fkkos3vansvfm6 +0 -0
  33. data/spec/dummy/tmp/storage/7f/uh/7fuhzmriza5m3agsu0l0yovug7xi +0 -0
  34. data/spec/dummy/tmp/storage/83/ks/83ksy3z3h9c3zbtkdys99orqxnel +0 -0
  35. data/spec/dummy/tmp/storage/84/44/8444l1dt5w3csoc2jwnrnke5ug7p +0 -0
  36. data/spec/dummy/tmp/storage/86/ca/86calk6vmutaxfekc7egxnnca43l +0 -0
  37. data/spec/dummy/tmp/storage/8h/c8/8hc8rt6dfy91bjewm7tsybana0u6 +0 -0
  38. data/spec/dummy/tmp/storage/96/2l/962l3tf45ebi2ji3gj2vm6puqi8g +0 -0
  39. data/spec/dummy/tmp/storage/9r/pj/9rpjb9yprd0r2l3jxcdef35mkste +0 -0
  40. data/spec/dummy/tmp/storage/a5/od/a5odckpcox2euydeaq71bxrjrewq +0 -0
  41. data/spec/dummy/tmp/storage/ap/d0/apd00py96d0r36yugx13tpd5zbwx +0 -0
  42. data/spec/dummy/tmp/storage/ax/ci/axci3ungck10rkvktcx9qtvawrrp +0 -0
  43. data/spec/dummy/tmp/storage/b9/6v/b96v26bb40vjk7rzeqh5pakid6br +0 -0
  44. data/spec/dummy/tmp/storage/bd/qj/bdqj5lortwlvne25ff3yyalbb36s +0 -0
  45. data/spec/dummy/tmp/storage/c3/qp/c3qp7hmde07vm5h6l6knks723882 +0 -0
  46. data/spec/dummy/tmp/storage/c4/34/c434kxxkpwr1tu5bbxdw9gnaojcc +0 -0
  47. data/spec/dummy/tmp/storage/cf/gf/cfgfauaxy8972di6j3j7jhw5wnfl +0 -0
  48. data/spec/dummy/tmp/storage/ci/3u/ci3ujw5b51cm3av9ng0p65eglpsg +0 -0
  49. data/spec/dummy/tmp/storage/cp/86/cp866po3l9kro8r4nljypf7ity8n +0 -0
  50. data/spec/dummy/tmp/storage/cr/04/cr04d10tkfv52ktqgv5rw7gat9iw +0 -0
  51. data/spec/dummy/tmp/storage/d9/cf/d9cfyu98zmmi511iwma09ovl6com +0 -0
  52. data/spec/dummy/tmp/storage/df/bm/dfbmp6rymaqlly3dbpc24gh664gy +0 -0
  53. data/spec/dummy/tmp/storage/dn/0t/dn0t6pcrja6cjxglc7g30ir7yk64 +0 -0
  54. data/spec/dummy/tmp/storage/dz/8f/dz8ftt7idroaj4i1e6dlwnmtuu9y +0 -0
  55. data/spec/dummy/tmp/storage/fa/1u/fa1ugjfxcd8hrm98brl062qgxcq3 +0 -0
  56. data/spec/dummy/tmp/storage/fj/ou/fjougong6j06e046zrn8fskuhq5p +0 -0
  57. data/spec/dummy/tmp/storage/fl/aw/flawxyrk6bepl9e4qybqwhq3otea +0 -0
  58. data/spec/dummy/tmp/storage/fr/6y/fr6yhpy998uho3r0db4prsqfd30u +0 -0
  59. data/spec/dummy/tmp/storage/fr/cc/frccz5in1239kncwgb50cfcs8ujo +0 -0
  60. data/spec/dummy/tmp/storage/gh/4e/gh4eted2i4uuijdb99yug70e5oho +0 -0
  61. data/spec/dummy/tmp/storage/ho/cx/hocx3wofwlpt45jsn4hajeub2629 +0 -0
  62. data/spec/dummy/tmp/storage/i7/q5/i7q5v5qq4zfexcpe0x9jfw5iwi6e +0 -0
  63. data/spec/dummy/tmp/storage/iu/p5/iup5sduqqzumtymzw6g75kmtj4kq +0 -0
  64. data/spec/dummy/tmp/storage/ja/gd/jagd3s4q6qfpo12dhrit2p49dyic +0 -0
  65. data/spec/dummy/tmp/storage/k9/8i/k98igdz816l8eodso61imb4dvqx3 +0 -0
  66. data/spec/dummy/tmp/storage/km/5u/km5uprp4d8w6l4h7yzix3dono3pl +0 -0
  67. data/spec/dummy/tmp/storage/ko/j0/koj0d9vpwacdvxlzb68kllhfx2kv +0 -0
  68. data/spec/dummy/tmp/storage/l0/4j/l04jyb0j5ak89dqnliwqx1wyzftu +0 -0
  69. data/spec/dummy/tmp/storage/l1/f8/l1f8gfo9kkiv8cq3ag179j24dntk +0 -0
  70. data/spec/dummy/tmp/storage/l2/rf/l2rfsult7ix6hrssrjn7ntsk4ln2 +0 -0
  71. data/spec/dummy/tmp/storage/l7/kw/l7kwoq4oqz0m8cr0i3y8gdjk7r33 +0 -0
  72. data/spec/dummy/tmp/storage/lf/za/lfza3dsbodpk6z7iy09qbpl40frd +0 -0
  73. data/spec/dummy/tmp/storage/lp/v0/lpv0oveyj4fimz5qnr3m00qxto1y +0 -0
  74. data/spec/dummy/tmp/storage/m1/5t/m15t6klkta6age0fefcmjovfle8o +0 -0
  75. data/spec/dummy/tmp/storage/m5/kb/m5kb1ipzihfx7zp95bd9ycxj6bqr +0 -0
  76. data/spec/dummy/tmp/storage/mg/j1/mgj1jsli6wiilzm3jobz59s35pow +0 -0
  77. data/spec/dummy/tmp/storage/mh/fj/mhfj18ll8xk1a6torxs7qvp2aa4l +0 -0
  78. data/spec/dummy/tmp/storage/n2/ve/n2ve8ei20je4jmgn9j0gg2chgnxp +0 -0
  79. data/spec/dummy/tmp/storage/na/ft/naft1014ecwdt1jycd5ytz6xb71v +0 -0
  80. data/spec/dummy/tmp/storage/nn/32/nn32kv58hv553251wquaguwave7c +0 -0
  81. data/spec/dummy/tmp/storage/qj/cu/qjcun2xcpf24hyilgh4s0wmw2e4p +0 -0
  82. data/spec/dummy/tmp/storage/r7/zp/r7zpfxlptww5orr9moeadoj0g3kg +0 -0
  83. data/spec/dummy/tmp/storage/ra/d6/rad620vsvw8q9n9vvx8i6wljyfjz +0 -0
  84. data/spec/dummy/tmp/storage/rf/po/rfpocvfi81i4au539e67w8o94bbr +0 -0
  85. data/spec/dummy/tmp/storage/rz/9e/rz9e1eck0jk7ponsnlwi1gav505a +0 -0
  86. data/spec/dummy/tmp/storage/sg/30/sg30putzvuc4p01earzjr0u7f65i +0 -0
  87. data/spec/dummy/tmp/storage/sl/2u/sl2ufrosy5wej3jghaj8zmb0xiz8 +0 -0
  88. data/spec/dummy/tmp/storage/t7/bd/t7bdp3p4o9z3bmmla22dr2sej9le +0 -0
  89. data/spec/dummy/tmp/storage/t8/3p/t83p5pkfd8ageym4qcdzvwbg8i3h +0 -0
  90. data/spec/dummy/tmp/storage/u0/sz/u0szro8mpff4scduzbn9sm4q9mpo +0 -0
  91. data/spec/dummy/tmp/storage/u6/8m/u68mm1ppbb9zuk1w8cpgwq4fxnfl +0 -0
  92. data/spec/dummy/tmp/storage/ue/i3/uei37wn7tdo938m1ih3jponomr7k +0 -0
  93. data/spec/dummy/tmp/storage/up/86/up86jhycgirblh2hop31nskoj6h2 +0 -0
  94. data/spec/dummy/tmp/storage/ur/f0/urf0ml010ripl9eks0kitboy5hko +0 -0
  95. data/spec/dummy/tmp/storage/v1/a2/v1a2h0c0xy9cuejexqy3a8ix794i +0 -0
  96. data/spec/dummy/tmp/storage/y6/u6/y6u622dz88furl064b7ixmdrx0y1 +0 -0
  97. data/spec/dummy/tmp/storage/yh/lt/yhlt1d30zxc5e074164sw9f2lwtb +0 -0
  98. data/spec/dummy/tmp/storage/ys/kt/yskt9vfrlpw90zaqxorq9pfa383r +0 -0
  99. data/spec/dummy/tmp/storage/zb/ke/zbkeh8j7fx7u3fqu28anb6mso6xz +0 -0
  100. data/spec/dummy/tmp/storage/zf/bm/zfbmpgsfvuwwpvsa2i11z5x5usgp +0 -0
  101. data/spec/examples.txt +125 -123
  102. data/spec/factories/snf_core/users.rb +1 -1
  103. data/spec/mailers/previews/snf_core/auth_mailer_preview.rb +0 -1
  104. data/spec/models/snf_core/order_item_spec.rb +64 -64
  105. data/spec/models/snf_core/user_role_spec.rb +1 -1
  106. data/spec/requests/snf_core/auth_spec.rb +43 -1
  107. metadata +92 -3
  108. data/spec/dummy/tmp/pids/server.pid +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b38fdf5a28ae31895de9e31f1d8c85f1d0e7ec7aae6313a8fa62af050dca6ec7
4
- data.tar.gz: 070c26db82ee5898f353edd8004771dfeb8982b72537f7086ccdedbca48f3931
3
+ metadata.gz: 85e0a48d15038fbf0986e432723ef4b5d6789e2795ba1702e81a0b933542df23
4
+ data.tar.gz: c96837434bf4792ca8d109094aa2d21057dbba027e14f7ca781a215254a1ef63
5
5
  SHA512:
6
- metadata.gz: 51f96f02c01109df1587b8da16ee76b95ac64922bf672541ec4cbb73450ad52d939ba8f04fba5fa7b7e3d41fc3dba8c6d752c398937c34fdd4aa3a301eff6da0
7
- data.tar.gz: 53d6c5d6e5076997ba0dddc2da191fc522d59127e029cd9cd17378357dc4049a826b3c316d82b2903ddea56a7834262032ad17eaa8ebd3e5bf60f2a7c7a4aed9
6
+ metadata.gz: 22db5c47abc86de6990ba45f4785bd72c1ca7b456258da5e1c2fe503147eaec4df0d98025610c1eaa20c12265b412552e696603cc4d0a3bd2a02fc24039265c1
7
+ data.tar.gz: 9275800e26a3904270dd786c221942238689ea060919d5fadfa1e788b6889ae308f5a9eb6e2270287340ad8e105d9e8497dcb1d6c6c37774411c457a4a3ba745
@@ -2,6 +2,31 @@ module SnfCore
2
2
  class AuthController < ApplicationController
3
3
  before_action :token_service
4
4
 
5
+ def signup
6
+ ActiveRecord::Base.transaction do
7
+ @user = User.new(user_params)
8
+
9
+ if @user.save
10
+ @business = Business.new(
11
+ user: @user,
12
+ business_name: signup_params[:business_name],
13
+ tin_number: signup_params[:tin_number],
14
+ business_type: signup_params[:business_type],
15
+ )
16
+
17
+ if @business.save
18
+ render json: { success: true }, status: :created
19
+ else
20
+ raise ActiveRecord::Rollback
21
+ render json: { errors: @business.errors.full_messages }, status: :unprocessable_entity
22
+ end
23
+ else
24
+ render json: { errors: @user.errors.full_messages }, status: :unprocessable_entity
25
+ end
26
+ end
27
+ end
28
+
29
+
5
30
  def login
6
31
  user = User.find_by(phone_number: auth_params[:phone_number])
7
32
  return render json: { success: false, error: "User doesn't exist" }, status: :unauthorized unless user
@@ -66,5 +91,13 @@ module SnfCore
66
91
  def auth_params
67
92
  params.require(:auth).permit(:phone_number, :password, :password_confirmation, :reset_password_token, :new_password)
68
93
  end
94
+
95
+ def signup_params
96
+ params.require(:user).permit(:first_name, :middle_name, :last_name, :password, :phone_number, :business_name, :tin_number, :business_type)
97
+ end
98
+
99
+ def user_params
100
+ signup_params.slice(:first_name, :middle_name, :last_name, :password, :phone_number)
101
+ end
69
102
  end
70
103
  end
data/config/routes.rb CHANGED
@@ -3,5 +3,5 @@ SnfCore::Engine.routes.draw do
3
3
  post "auth/reset_password_request"
4
4
  post "auth/reset_password"
5
5
  post "auth/change_password"
6
-
6
+ post "auth/signup"
7
7
  end
@@ -6,7 +6,7 @@ class CreateSnfCoreBusinesses < ActiveRecord::Migration[8.0]
6
6
  t.string :tin_number, null: false
7
7
  t.integer :business_type, null: false
8
8
  t.datetime :verified_at
9
- t.integer :verification_status, null: false
9
+ t.integer :verification_status, null: false, default: 0
10
10
 
11
11
  t.timestamps
12
12
  end
@@ -1,8 +1,8 @@
1
1
  class CreateSnfCoreUserRoles < ActiveRecord::Migration[8.0]
2
2
  def change
3
3
  create_table :snf_core_user_roles do |t|
4
- t.references :user, null: false, foreign_key: {to_table: :snf_core_users}
5
- t.references :role, null: false, foreign_key: {to_table: :snf_core_roles}
4
+ t.references :user, null: false, foreign_key: { to_table: :snf_core_users }
5
+ t.references :role, null: false, foreign_key: { to_table: :snf_core_roles }
6
6
 
7
7
  t.timestamps
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module SnfCore
2
- VERSION = "0.2.93"
2
+ VERSION = "0.2.94"
3
3
  end
@@ -67,20 +67,18 @@ Rails.application.configure do
67
67
 
68
68
  config.action_mailer.delivery_method = :smtp
69
69
  host = 'localhost:3000'
70
- config.action_mailer.default_url_options = { :host => 'localhost:3000', protocol: 'http' }
70
+ config.action_mailer.default_url_options = { host: 'localhost:3000', protocol: 'http' }
71
71
 
72
72
  config.action_mailer.smtp_settings = {
73
- :address => "smtp.gmail.com",
74
- :port => 587,
75
- :domain => 'gmail.com',
76
- :user_name => "bunnabankauthmail@gmail.com",
77
- :password => "ietldojndspeakov",
78
- :authentication => "plain",
79
- :enable_starttls_auto => true
73
+ address: "smtp.gmail.com",
74
+ port: 587,
75
+ domain: 'gmail.com',
76
+ user_name: "bunnabankauthmail@gmail.com",
77
+ password: "ietldojndspeakov",
78
+ authentication: "plain",
79
+ enable_starttls_auto: true
80
80
  }
81
81
 
82
82
  config.action_mailer.delivery_method = :letter_opener
83
83
  config.action_mailer.perform_deliveries = true
84
-
85
-
86
84
  end
@@ -20,8 +20,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
20
20
  t.bigint "record_id", null: false
21
21
  t.bigint "blob_id", null: false
22
22
  t.datetime "created_at", null: false
23
- t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
24
- t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
23
+ t.index [ "blob_id" ], name: "index_active_storage_attachments_on_blob_id"
24
+ t.index [ "record_type", "record_id", "name", "blob_id" ], name: "index_active_storage_attachments_uniqueness", unique: true
25
25
  end
26
26
 
27
27
  create_table "active_storage_blobs", force: :cascade do |t|
@@ -33,13 +33,13 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
33
33
  t.bigint "byte_size", null: false
34
34
  t.string "checksum"
35
35
  t.datetime "created_at", null: false
36
- t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
36
+ t.index [ "key" ], name: "index_active_storage_blobs_on_key", unique: true
37
37
  end
38
38
 
39
39
  create_table "active_storage_variant_records", force: :cascade do |t|
40
40
  t.bigint "blob_id", null: false
41
41
  t.string "variation_digest", null: false
42
- t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
42
+ t.index [ "blob_id", "variation_digest" ], name: "index_active_storage_variant_records_uniqueness", unique: true
43
43
  end
44
44
 
45
45
  create_table "snf_core_addresses", force: :cascade do |t|
@@ -62,8 +62,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
62
62
  t.boolean "is_verified", default: false, null: false
63
63
  t.datetime "created_at", null: false
64
64
  t.datetime "updated_at", null: false
65
- t.index ["business_id"], name: "index_snf_core_business_documents_on_business_id"
66
- t.index ["verified_by_id"], name: "index_snf_core_business_documents_on_verified_by_id"
65
+ t.index [ "business_id" ], name: "index_snf_core_business_documents_on_business_id"
66
+ t.index [ "verified_by_id" ], name: "index_snf_core_business_documents_on_verified_by_id"
67
67
  end
68
68
 
69
69
  create_table "snf_core_businesses", force: :cascade do |t|
@@ -72,10 +72,10 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
72
72
  t.string "tin_number", null: false
73
73
  t.integer "business_type", null: false
74
74
  t.datetime "verified_at"
75
- t.integer "verification_status", null: false
75
+ t.integer "verification_status", default: 0, null: false
76
76
  t.datetime "created_at", null: false
77
77
  t.datetime "updated_at", null: false
78
- t.index ["user_id"], name: "index_snf_core_businesses_on_user_id"
78
+ t.index [ "user_id" ], name: "index_snf_core_businesses_on_user_id"
79
79
  end
80
80
 
81
81
  create_table "snf_core_categories", force: :cascade do |t|
@@ -84,7 +84,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
84
84
  t.bigint "parent_id"
85
85
  t.datetime "created_at", null: false
86
86
  t.datetime "updated_at", null: false
87
- t.index ["parent_id"], name: "index_snf_core_categories_on_parent_id"
87
+ t.index [ "parent_id" ], name: "index_snf_core_categories_on_parent_id"
88
88
  end
89
89
 
90
90
  create_table "snf_core_customer_groups", force: :cascade do |t|
@@ -95,8 +95,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
95
95
  t.bigint "customer_id", null: false
96
96
  t.datetime "created_at", null: false
97
97
  t.datetime "updated_at", null: false
98
- t.index ["customer_id"], name: "index_snf_core_customer_groups_on_customer_id"
99
- t.index ["group_id"], name: "index_snf_core_customer_groups_on_group_id"
98
+ t.index [ "customer_id" ], name: "index_snf_core_customer_groups_on_customer_id"
99
+ t.index [ "group_id" ], name: "index_snf_core_customer_groups_on_group_id"
100
100
  end
101
101
 
102
102
  create_table "snf_core_delivery_orders", force: :cascade do |t|
@@ -109,7 +109,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
109
109
  t.integer "status", null: false
110
110
  t.datetime "created_at", null: false
111
111
  t.datetime "updated_at", null: false
112
- t.index ["order_id"], name: "index_snf_core_delivery_orders_on_order_id"
112
+ t.index [ "order_id" ], name: "index_snf_core_delivery_orders_on_order_id"
113
113
  end
114
114
 
115
115
  create_table "snf_core_groups", force: :cascade do |t|
@@ -117,7 +117,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
117
117
  t.bigint "business_id", null: false
118
118
  t.datetime "created_at", null: false
119
119
  t.datetime "updated_at", null: false
120
- t.index ["business_id"], name: "index_snf_core_groups_on_business_id"
120
+ t.index [ "business_id" ], name: "index_snf_core_groups_on_business_id"
121
121
  end
122
122
 
123
123
  create_table "snf_core_order_items", force: :cascade do |t|
@@ -128,8 +128,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
128
128
  t.decimal "subtotal", null: false
129
129
  t.datetime "created_at", null: false
130
130
  t.datetime "updated_at", null: false
131
- t.index ["order_id"], name: "index_snf_core_order_items_on_order_id"
132
- t.index ["store_inventory_id"], name: "index_snf_core_order_items_on_store_inventory_id"
131
+ t.index [ "order_id" ], name: "index_snf_core_order_items_on_order_id"
132
+ t.index [ "store_inventory_id" ], name: "index_snf_core_order_items_on_store_inventory_id"
133
133
  end
134
134
 
135
135
  create_table "snf_core_orders", force: :cascade do |t|
@@ -139,8 +139,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
139
139
  t.decimal "total_amount", default: "0.0", null: false
140
140
  t.datetime "created_at", null: false
141
141
  t.datetime "updated_at", null: false
142
- t.index ["store_id"], name: "index_snf_core_orders_on_store_id"
143
- t.index ["user_id"], name: "index_snf_core_orders_on_user_id"
142
+ t.index [ "store_id" ], name: "index_snf_core_orders_on_store_id"
143
+ t.index [ "user_id" ], name: "index_snf_core_orders_on_user_id"
144
144
  end
145
145
 
146
146
  create_table "snf_core_products", force: :cascade do |t|
@@ -151,7 +151,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
151
151
  t.float "base_price"
152
152
  t.datetime "created_at", null: false
153
153
  t.datetime "updated_at", null: false
154
- t.index ["category_id"], name: "index_snf_core_products_on_category_id"
154
+ t.index [ "category_id" ], name: "index_snf_core_products_on_category_id"
155
155
  end
156
156
 
157
157
  create_table "snf_core_roles", force: :cascade do |t|
@@ -167,9 +167,9 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
167
167
  t.datetime "created_at", null: false
168
168
  t.datetime "updated_at", null: false
169
169
  t.integer "status", default: 0, null: false
170
- t.index ["product_id"], name: "index_snf_core_store_inventories_on_product_id"
171
- t.index ["store_id", "product_id"], name: "index_snf_core_store_inventories_on_store_id_and_product_id", unique: true
172
- t.index ["store_id"], name: "index_snf_core_store_inventories_on_store_id"
170
+ t.index [ "product_id" ], name: "index_snf_core_store_inventories_on_product_id"
171
+ t.index [ "store_id", "product_id" ], name: "index_snf_core_store_inventories_on_store_id_and_product_id", unique: true
172
+ t.index [ "store_id" ], name: "index_snf_core_store_inventories_on_store_id"
173
173
  end
174
174
 
175
175
  create_table "snf_core_stores", force: :cascade do |t|
@@ -180,8 +180,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
180
180
  t.bigint "address_id", null: false
181
181
  t.datetime "created_at", null: false
182
182
  t.datetime "updated_at", null: false
183
- t.index ["address_id"], name: "index_snf_core_stores_on_address_id"
184
- t.index ["business_id"], name: "index_snf_core_stores_on_business_id"
183
+ t.index [ "address_id" ], name: "index_snf_core_stores_on_address_id"
184
+ t.index [ "business_id" ], name: "index_snf_core_stores_on_business_id"
185
185
  end
186
186
 
187
187
  create_table "snf_core_user_roles", force: :cascade do |t|
@@ -189,8 +189,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
189
189
  t.bigint "role_id", null: false
190
190
  t.datetime "created_at", null: false
191
191
  t.datetime "updated_at", null: false
192
- t.index ["role_id"], name: "index_snf_core_user_roles_on_role_id"
193
- t.index ["user_id"], name: "index_snf_core_user_roles_on_user_id"
192
+ t.index [ "role_id" ], name: "index_snf_core_user_roles_on_role_id"
193
+ t.index [ "user_id" ], name: "index_snf_core_user_roles_on_user_id"
194
194
  end
195
195
 
196
196
  create_table "snf_core_users", force: :cascade do |t|
@@ -213,8 +213,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_06_074713) do
213
213
  t.boolean "is_active", default: true, null: false
214
214
  t.datetime "created_at", null: false
215
215
  t.datetime "updated_at", null: false
216
- t.index ["user_id"], name: "index_snf_core_wallets_on_user_id"
217
- t.index ["wallet_number"], name: "index_snf_core_wallets_on_wallet_number", unique: true
216
+ t.index [ "user_id" ], name: "index_snf_core_wallets_on_user_id"
217
+ t.index [ "wallet_number" ], name: "index_snf_core_wallets_on_wallet_number", unique: true
218
218
  end
219
219
 
220
220
  add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"