create-nextjs-cms 0.9.2 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nextjs-cms",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -113,7 +113,7 @@ export default function Form({
113
113
  }) {
114
114
  const t = useI18n()
115
115
  const session = useSession()
116
- const locale = session?.data?.user?.language
116
+ const language = session?.data?.user?.language
117
117
 
118
118
  // When editing a non-default locale, only show fields marked as localized
119
119
  const isTranslationMode = !!(contentLocale && defaultLocale && contentLocale.code !== defaultLocale.code)
@@ -137,92 +137,92 @@ export default function Form({
137
137
  switch (input.type) {
138
138
  case 'select_multiple':
139
139
  schema = schema.extend({
140
- [input.name]: selectMultipleFieldSchema(input as SelectMultipleFieldClientConfig, locale),
140
+ [input.name]: selectMultipleFieldSchema(input as SelectMultipleFieldClientConfig, language),
141
141
  })
142
142
  break
143
143
  case 'select':
144
144
  schema = schema.extend({
145
- [input.name]: selectFieldSchema(input as SelectFieldClientConfig, locale),
145
+ [input.name]: selectFieldSchema(input as SelectFieldClientConfig, language),
146
146
  })
147
147
  break
148
148
 
149
149
  case 'date':
150
150
  schema = schema.extend({
151
- [input.name]: dateFieldSchema(input as DateFieldClientConfig, locale),
151
+ [input.name]: dateFieldSchema(input as DateFieldClientConfig, language),
152
152
  })
153
153
  break
154
154
 
155
155
  case 'checkbox':
156
156
  schema = schema.extend({
157
- [input.name]: checkboxFieldSchema(input as CheckboxFieldClientConfig, locale),
157
+ [input.name]: checkboxFieldSchema(input as CheckboxFieldClientConfig, language),
158
158
  })
159
159
  break
160
160
 
161
161
  case 'text':
162
162
  schema = schema.extend({
163
- [input.name]: textFieldSchema(input as TextFieldClientConfig, locale),
163
+ [input.name]: textFieldSchema(input as TextFieldClientConfig, language),
164
164
  })
165
165
  break
166
166
 
167
167
  case 'textarea':
168
168
  schema = schema.extend({
169
- [input.name]: textareaFieldSchema(input as TextAreaFieldClientConfig, locale),
169
+ [input.name]: textareaFieldSchema(input as TextAreaFieldClientConfig, language),
170
170
  })
171
171
  break
172
172
 
173
173
  case 'rich_text':
174
174
  schema = schema.extend({
175
- [input.name]: richTextFieldSchema(input as RichTextFieldClientConfig, locale),
175
+ [input.name]: richTextFieldSchema(input as RichTextFieldClientConfig, language),
176
176
  })
177
177
  break
178
178
 
179
179
  case 'photo':
180
180
  if (formType === 'edit' && !!input.value) break
181
181
  schema = schema.extend({
182
- [input.name]: photoFieldSchema(input as PhotoFieldClientConfig, locale),
182
+ [input.name]: photoFieldSchema(input as PhotoFieldClientConfig, language),
183
183
  })
184
184
  break
185
185
 
186
186
  case 'document':
187
187
  if (formType === 'edit' && !!input.value) break
188
188
  schema = schema.extend({
189
- [input.name]: documentFieldSchema(input as DocumentFieldClientConfig, locale),
189
+ [input.name]: documentFieldSchema(input as DocumentFieldClientConfig, language),
190
190
  })
191
191
  break
192
192
 
193
193
  case 'video':
194
194
  if (formType === 'edit' && !!input.value) break
195
195
  schema = schema.extend({
196
- [input.name]: videoFieldSchema(input as VideoFieldClientConfig, locale),
196
+ [input.name]: videoFieldSchema(input as VideoFieldClientConfig, language),
197
197
  })
198
198
  break
199
199
 
200
200
  case 'number':
201
201
  schema = schema.extend({
202
- [input.name]: numberFieldSchema(input as NumberFieldClientConfig, locale),
202
+ [input.name]: numberFieldSchema(input as NumberFieldClientConfig, language),
203
203
  })
204
204
  break
205
205
  case 'color':
206
206
  schema = schema.extend({
207
- [input.name]: colorFieldSchema(input as ColorFieldClientConfig, locale),
207
+ [input.name]: colorFieldSchema(input as ColorFieldClientConfig, language),
208
208
  })
209
209
  break
210
210
 
211
211
  case 'map':
212
212
  schema = schema.extend({
213
- [input.name]: mapFieldSchema(input as MapFieldClientConfig, locale),
213
+ [input.name]: mapFieldSchema(input as MapFieldClientConfig, language),
214
214
  })
215
215
  break
216
216
 
217
217
  case 'password':
218
218
  schema = schema.extend({
219
- [input.name]: passwordFieldSchema(input as PasswordFieldClientConfig, locale),
219
+ [input.name]: passwordFieldSchema(input as PasswordFieldClientConfig, language),
220
220
  })
221
221
  break
222
222
 
223
223
  case 'slug':
224
224
  schema = schema.extend({
225
- [input.name]: slugFieldSchema(input as SlugFieldClientConfig, locale),
225
+ [input.name]: slugFieldSchema(input as SlugFieldClientConfig, language),
226
226
  })
227
227
  break
228
228
  }
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState, useMemo } from 'react'
1
+ import { useEffect, useState, useMemo } from 'react'
2
2
  import FormInputElement from '@/components/form/FormInputElement'
3
3
  import SelectBox from '@/components/SelectBox'
4
4
  import LoadingSpinners from '@/components/LoadingSpinners'
@@ -23,7 +23,7 @@ export default function SelectFormInput({
23
23
  }) {
24
24
  const t = useI18n()
25
25
  const session = useSession()
26
- const locale = session?.data?.user?.language
26
+ const language = session?.data?.user?.language
27
27
 
28
28
  /**
29
29
  * Create options array with translated placeholder option.
@@ -38,7 +38,7 @@ export default function SelectFormInput({
38
38
  // Add the translated placeholder option at the beginning
39
39
  // @ts-ignore - This is a type-hack to add the placeholder `select` option with undefined value
40
40
  return [{ value: undefined, label: t('select') as string }, ...optionsWithoutPlaceholder]
41
- }, [input.options, t, locale])
41
+ }, [input.options, t, language])
42
42
 
43
43
  const depth = input.section ? input.section.depth : 1
44
44
  const [parent] = useAutoAnimate(/* optional config */)
@@ -1,475 +1,475 @@
1
- import {mysqlTable,int,longtext,mysqlEnum,varchar,index,unique,primaryKey,boolean,double,timestamp} from 'drizzle-orm/mysql-core'
2
-
3
- export const AppInfoTable = mysqlTable('app_info', {
4
- id: int('id').autoincrement().notNull().primaryKey(),
5
- aboutEn: longtext('about_en').notNull(),
6
- aboutAr: longtext('about_ar').notNull(),
7
- aboutTr: longtext('about_tr').notNull(),
8
- privacyEn: longtext('privacy_en').notNull(),
9
- privacyAr: longtext('privacy_ar').notNull(),
10
- privacyTr: longtext('privacy_tr').notNull()
11
- });
12
-
13
-
14
- export const UserReportsTable = mysqlTable('user_reports', {
15
- id: int('id').autoincrement().notNull().primaryKey(),
16
- contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
17
- reportType: mysqlEnum('report_type', ['explicit_content', 'wrong_information', 'no_longer_available', 'user_not_responsive', 'other']).notNull(),
18
- contentId: int('content_id').notNull(),
19
- catId: int('cat_id').notNull(),
20
- userId: int('user_id'),
21
- appId: varchar('app_id', { length: 36 }).notNull(),
22
- title: varchar('title', { length: 255 }).notNull(),
23
- slug: varchar('slug', { length: 255 }).notNull()
24
- }, (table) => [
25
- index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.appId),
26
- unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.appId),
27
- unique('slug_unique').on(table.slug)
28
- ]);
29
-
30
-
31
- export const TestSectionTable = mysqlTable('test_section', {
32
- id: int('id').autoincrement().notNull().primaryKey(),
33
- contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
34
- price: int('price'),
35
- appId: varchar('app_id', { length: 36 }).notNull(),
36
- title: varchar('title', { length: 255 }).notNull(),
37
- photo: varchar('photo', { length: 255 }),
38
- category: varchar('category', { length: 255 }),
39
- file: varchar('file', { length: 255 }).notNull()
40
- }, (table) => [
41
- index('unique_user_report_index').on(table.contentType, table.price, table.appId),
42
- unique('unique_user_report').on(table.contentType, table.price, table.appId),
43
- unique('price_unique').on(table.price)
44
- ]);
45
-
46
-
47
- export const TestTagsTable = mysqlTable('test_tags', {
48
- testId: varchar('test_id', { length: 255 }).notNull(),
49
- tagName: varchar('tag_name', { length: 255 }).notNull(),
50
- locale: varchar('locale', { length: 255 })
51
- }, (table) => [
52
- primaryKey({ columns: [table.testId, table.tagName, table.locale] })
53
- ]);
54
-
55
-
56
- export const TestSectionLocalesTable = mysqlTable('test_section_locales', {
57
- id: int('id').autoincrement().notNull().primaryKey(),
58
- parentId: int('parent_id').notNull(),
59
- locale: varchar('locale', { length: 10 }).notNull(),
60
- contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
61
- price: int('price'),
62
- appId: varchar('app_id', { length: 36 }).notNull(),
63
- title: varchar('title', { length: 255 }).notNull(),
64
- photo: varchar('photo', { length: 255 }),
65
- category: varchar('category', { length: 255 })
66
- }, (table) => [
67
- unique('test_section_locales_parent_id_locale_unique').on(table.parentId, table.locale)
68
- ]);
69
-
70
-
71
- export const FeaturedSliderTable = mysqlTable('featured_slider', {
72
- id: int('id').autoincrement().notNull().primaryKey(),
73
- image: varchar('image', { length: 255 }).notNull(),
74
- titleEn: varchar('title_en', { length: 255 }).notNull(),
75
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
76
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
77
- descEn: longtext('desc_en').notNull(),
78
- descAr: longtext('desc_ar').notNull(),
79
- descTr: longtext('desc_tr').notNull()
80
- }, (table) => [
81
- unique('title_en_unique').on(table.titleEn),
82
- unique('title_ar_unique').on(table.titleAr),
83
- unique('title_tr_unique').on(table.titleTr)
84
- ]);
85
-
86
-
87
- export const MenuSettingsTable = mysqlTable('menu_settings', {
88
- id: int('id').autoincrement().notNull().primaryKey(),
89
- taxRate: varchar('tax_rate', { length: 255 }),
90
- hideSlider: boolean('hide_slider')
91
- });
92
-
93
-
94
- export const ServicesTable = mysqlTable('services', {
95
- id: int('id').autoincrement().notNull().primaryKey(),
96
- title: varchar('title', { length: 255 }).notNull(),
97
- catId: int('cat_id').notNull(),
98
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
99
- price: int('price'),
100
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
101
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
102
- desc: longtext('desc'),
103
- latitude: double('latitude'),
104
- longitude: double('longitude'),
105
- viewCount: int('view_count'),
106
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
107
- govId: int('gov_id').notNull(),
108
- districtId: int('district_id').notNull(),
109
- subDistrictId: int('sub_district_id'),
110
- townId: int('town_id')
111
- }, (table) => [
112
- index('title_index').on(table.title),
113
- unique('title_unique').on(table.title)
114
- ]);
115
-
116
-
117
- export const RealestateTable = mysqlTable('realestate', {
118
- id: int('id').autoincrement().notNull().primaryKey(),
119
- catId: int('cat_id').notNull(),
120
- title: varchar('title', { length: 255 }).notNull(),
121
- price: int('price').notNull(),
122
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
123
- spaceGross: int('space_gross').notNull(),
124
- spaceNet: int('space_net').notNull(),
125
- latitude: double('latitude').notNull(),
126
- longitude: double('longitude').notNull(),
127
- roomCount: varchar('room_count', { length: 255 }),
128
- buildingAge: varchar('building_age', { length: 255 }),
129
- floorCount: varchar('floor_count', { length: 255 }),
130
- bathroomCount: varchar('bathroom_count', { length: 255 }),
131
- floorLocation: varchar('floor_location', { length: 255 }),
132
- heatingType: varchar('heating_type', { length: 255 }),
133
- kitchenType: varchar('kitchen_type', { length: 255 }),
134
- balcony: boolean('balcony'),
135
- lift: boolean('lift'),
136
- parkingType: varchar('parking_type', { length: 255 }),
137
- furnished: boolean('furnished'),
138
- belongsToSite: boolean('belongs_to_site'),
139
- siteName: varchar('site_name', { length: 255 }),
140
- installments: boolean('installments'),
141
- exchangeable: boolean('exchangeable'),
142
- fromWhom: varchar('from_whom', { length: 255 }),
143
- buildingMembershipFees: int('building_membership_fees'),
144
- deposit: int('deposit'),
145
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
146
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
147
- desc: longtext('desc'),
148
- viewCount: int('view_count'),
149
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
150
- govId: int('gov_id').notNull(),
151
- districtId: int('district_id').notNull(),
152
- subDistrictId: int('sub_district_id'),
153
- townId: int('town_id')
154
- }, (table) => [
155
- index('title_index').on(table.title),
156
- unique('title_unique').on(table.title)
157
- ]);
158
-
159
-
160
- export const HomepageSliderTable = mysqlTable('homepage_slider', {
161
- id: int('id').autoincrement().notNull().primaryKey(),
162
- titleEn: varchar('title_en', { length: 255 }).notNull(),
163
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
164
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
165
- subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
166
- subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
167
- subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
168
- photo: varchar('photo', { length: 255 }).notNull(),
169
- buttonUrl: varchar('button_url', { length: 255 }),
170
- buttonTextEn: varchar('button_text_en', { length: 255 }),
171
- buttonTextAr: varchar('button_text_ar', { length: 255 }),
172
- buttonTextTr: varchar('button_text_tr', { length: 255 }),
173
- buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
174
- });
175
-
176
-
177
- export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
178
- id: int('id').autoincrement().notNull().primaryKey(),
179
- userId: int('user_id').notNull(),
180
- contestId: varchar('contest_id', { length: 255 }).notNull()
181
- }, (table) => [
182
- unique('contest_subscriber_unique').on(table.contestId, table.userId)
183
- ]);
184
-
185
-
186
- export const ContestsTable = mysqlTable('contests', {
187
- id: int('id').autoincrement().notNull().primaryKey(),
188
- date: timestamp('date').notNull(),
189
- prize: varchar('prize', { length: 255 }).notNull(),
190
- winnerId: int('winner_id'),
191
- tags: varchar('tags', { length: 255 })
192
- });
193
-
194
-
195
- export const NotificationsTable = mysqlTable('notifications', {
196
- id: int('id').autoincrement().notNull().primaryKey(),
197
- type: mysqlEnum('type', ['ad_price_updated', 'ad_updated', 'ad_activated', 'ad_pending_review', 'ad_expired', 'ad_rejected', 'ad_viewed', 'ad_favorited', 'ad_shared', 'ad_reported', 'ad_deleted', 'ad_created', 'contest_winner', 'contest_reminder', 'contest_created', 'custom']).notNull(),
198
- contentId: int('content_id'),
199
- contentCatId: int('content_cat_id'),
200
- userId: int('user_id'),
201
- message: varchar('message', { length: 255 })
202
- }, (table) => [
203
- index('type_index').on(table.type),
204
- unique('unique_notification').on(table.type, table.contentId, table.contentCatId)
205
- ]);
206
-
207
-
208
- export const ModerationTable = mysqlTable('moderation', {
209
- id: int('id').autoincrement().notNull().primaryKey(),
210
- contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
211
- contentId: int('content_id').notNull(),
212
- catId: int('cat_id'),
213
- userId: int('user_id').notNull(),
214
- flagged: int('flagged').notNull(),
215
- result: varchar('result', { length: 255 }).notNull()
216
- }, (table) => [
217
- index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.userId),
218
- unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.userId)
219
- ]);
220
-
221
-
222
- export const JobsTable = mysqlTable('jobs', {
223
- id: int('id').autoincrement().notNull().primaryKey(),
224
- title: varchar('title', { length: 255 }).notNull(),
225
- catId: int('cat_id').notNull(),
226
- salary: int('salary'),
227
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
228
- workMethod: varchar('work_method', { length: 255 }).notNull(),
229
- minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
230
- experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
231
- remote: boolean('remote'),
232
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
233
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
234
- desc: longtext('desc'),
235
- latitude: double('latitude'),
236
- longitude: double('longitude'),
237
- viewCount: int('view_count'),
238
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
239
- govId: int('gov_id').notNull(),
240
- districtId: int('district_id').notNull(),
241
- subDistrictId: int('sub_district_id'),
242
- townId: int('town_id')
243
- }, (table) => [
244
- index('title_index').on(table.title),
245
- unique('title_unique').on(table.title)
246
- ]);
247
-
248
-
249
- export const FurnitureTable = mysqlTable('furniture', {
250
- id: int('id').autoincrement().notNull().primaryKey(),
251
- title: varchar('title', { length: 255 }).notNull(),
252
- catId: int('cat_id').notNull(),
253
- condition: varchar('condition', { length: 255 }).notNull(),
254
- price: int('price').notNull(),
255
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
256
- exchangeable: boolean('exchangeable'),
257
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
258
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
259
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
260
- desc: longtext('desc'),
261
- latitude: double('latitude'),
262
- longitude: double('longitude'),
263
- viewCount: int('view_count'),
264
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
265
- govId: int('gov_id').notNull(),
266
- districtId: int('district_id').notNull(),
267
- subDistrictId: int('sub_district_id'),
268
- townId: int('town_id')
269
- }, (table) => [
270
- index('title_index').on(table.title),
271
- unique('title_unique').on(table.title)
272
- ]);
273
-
274
-
275
- export const FiltersTable = mysqlTable('filters', {
276
- id: int('id').autoincrement().notNull().primaryKey(),
277
- title: varchar('title', { length: 255 }).notNull(),
278
- Key: varchar('_key', { length: 255 }).notNull(),
279
- fieldName: varchar('field_name', { length: 255 }).notNull(),
280
- type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
281
- tableName: varchar('table_name', { length: 255 }),
282
- isMandatory: boolean('is_mandatory')
283
- }, (table) => [
284
- unique('title_unique').on(table.title),
285
- unique('key_unique').on(table.Key)
286
- ]);
287
-
288
-
289
- export const FaqTable = mysqlTable('faq', {
290
- id: int('id').autoincrement().notNull().primaryKey(),
291
- qEn: varchar('q_en', { length: 255 }).notNull(),
292
- qAr: varchar('q_ar', { length: 255 }).notNull(),
293
- qTr: varchar('q_tr', { length: 255 }),
294
- aEn: longtext('a_en').notNull(),
295
- aAr: longtext('a_ar'),
296
- aTr: longtext('a_tr')
297
- }, (table) => [
298
- unique('faq_q_en_unique').on(table.qEn),
299
- unique('title_ar_unique').on(table.qAr),
300
- unique('title_tr_unique').on(table.qTr)
301
- ]);
302
-
303
-
304
- export const ErrorsTable = mysqlTable('errors', {
305
- id: int('id').autoincrement().notNull().primaryKey(),
306
- title: varchar('title', { length: 255 }).notNull(),
307
- caseId: varchar('case_id', { length: 255 }).notNull(),
308
- userId: int('user_id'),
309
- itemSlug: varchar('item_slug', { length: 255 }),
310
- desc: longtext('desc'),
311
- isResolved: boolean('is_resolved')
312
- }, (table) => [
313
- unique('key_unique').on(table.caseId)
314
- ]);
315
-
316
-
317
- export const ElectronicsTable = mysqlTable('electronics', {
318
- id: int('id').autoincrement().notNull().primaryKey(),
319
- title: varchar('title', { length: 255 }).notNull(),
320
- catId: int('cat_id').notNull(),
321
- condition: varchar('condition', { length: 255 }).notNull(),
322
- price: int('price').notNull(),
323
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
324
- exchangeable: boolean('exchangeable'),
325
- installments: boolean('installments'),
326
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
327
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
328
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
329
- desc: longtext('desc'),
330
- latitude: double('latitude'),
331
- longitude: double('longitude'),
332
- viewCount: int('view_count'),
333
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
334
- govId: int('gov_id').notNull(),
335
- districtId: int('district_id').notNull(),
336
- subDistrictId: int('sub_district_id'),
337
- townId: int('town_id')
338
- }, (table) => [
339
- index('title_index').on(table.title),
340
- unique('title_unique').on(table.title)
341
- ]);
342
-
343
-
344
- export const ClothesTable = mysqlTable('clothes', {
345
- id: int('id').autoincrement().notNull().primaryKey(),
346
- title: varchar('title', { length: 255 }).notNull(),
347
- catId: int('cat_id').notNull(),
348
- condition: varchar('condition', { length: 255 }).notNull(),
349
- price: int('price').notNull(),
350
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
351
- exchangeable: boolean('exchangeable'),
352
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
353
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
354
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
355
- desc: longtext('desc'),
356
- latitude: double('latitude'),
357
- longitude: double('longitude'),
358
- viewCount: int('view_count'),
359
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
360
- govId: int('gov_id').notNull(),
361
- districtId: int('district_id').notNull(),
362
- subDistrictId: int('sub_district_id'),
363
- townId: int('town_id')
364
- }, (table) => [
365
- index('title_index').on(table.title),
366
- unique('title_unique').on(table.title)
367
- ]);
368
-
369
-
370
- export const CatsTable = mysqlTable('cats', {
371
- id: int('id').autoincrement().notNull().primaryKey(),
372
- catOrder: int('cat_order').notNull(),
373
- slug: varchar('slug', { length: 255 }).notNull(),
374
- titleEn: varchar('title_en', { length: 255 }).notNull(),
375
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
376
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
377
- fullTitleEn: varchar('full_title_en', { length: 255 }),
378
- fullTitleAr: varchar('full_title_ar', { length: 255 }),
379
- fullTitleTr: varchar('full_title_tr', { length: 255 }),
380
- image: varchar('image', { length: 255 }),
381
- metaDescEn: varchar('meta_desc_en', { length: 255 }),
382
- metaDescAr: varchar('meta_desc_ar', { length: 255 }),
383
- metaDescTr: varchar('meta_desc_tr', { length: 255 }),
384
- filters: varchar('filters', { length: 255 }),
385
- tableName: varchar('table_name', { length: 255 }).notNull(),
386
- adCount: int('ad_count'),
387
- parentId: int('parent_id'),
388
- level: int('level')
389
- }, (table) => [
390
- unique('cats_slug_unique').on(table.slug)
391
- ]);
392
-
393
-
394
- export const CarsTable = mysqlTable('cars', {
395
- id: int('id').autoincrement().notNull().primaryKey(),
396
- modelYear: int('model_year').notNull(),
397
- model: varchar('model', { length: 255 }).notNull(),
398
- title: varchar('title', { length: 255 }).notNull(),
399
- catId: int('cat_id').notNull(),
400
- govId: int('gov_id').notNull(),
401
- districtId: int('district_id').notNull(),
402
- subDistrictId: int('sub_district_id'),
403
- townId: int('town_id'),
404
- price: int('price').notNull(),
405
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
406
- condition: varchar('condition', { length: 255 }).notNull(),
407
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
408
- engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
409
- enginePower: varchar('engine_power', { length: 255 }).notNull(),
410
- tractionType: varchar('traction_type', { length: 255 }).notNull(),
411
- bodyType: varchar('body_type', { length: 255 }).notNull(),
412
- gearType: varchar('gear_type', { length: 255 }).notNull(),
413
- fuelType: varchar('fuel_type', { length: 255 }).notNull(),
414
- exchangeable: boolean('exchangeable'),
415
- installments: boolean('installments'),
416
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
417
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
418
- desc: longtext('desc'),
419
- latitude: double('latitude'),
420
- longitude: double('longitude'),
421
- viewCount: int('view_count'),
422
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
423
- }, (table) => [
424
- index('title_index').on(table.title)
425
- ]);
426
-
427
-
428
- export const CarsDbTable = mysqlTable('cars_db', {
429
- id: int('id').autoincrement().notNull().primaryKey(),
430
- name: varchar('name', { length: 255 }).notNull(),
431
- parentId: int('parent_id'),
432
- level: int('level')
433
- }, (table) => [
434
- index('cars_db_name_idx').on(table.name)
435
- ]);
436
-
437
-
438
- export const BooksTable = mysqlTable('books', {
439
- id: int('id').autoincrement().notNull().primaryKey(),
440
- title: varchar('title', { length: 255 }).notNull(),
441
- catId: int('cat_id').notNull(),
442
- condition: varchar('condition', { length: 255 }).notNull(),
443
- price: int('price').notNull(),
444
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
445
- exchangeable: boolean('exchangeable'),
446
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
447
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
448
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
449
- desc: longtext('desc'),
450
- latitude: double('latitude'),
451
- longitude: double('longitude'),
452
- viewCount: int('view_count'),
453
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
454
- govId: int('gov_id').notNull(),
455
- districtId: int('district_id').notNull(),
456
- subDistrictId: int('sub_district_id'),
457
- townId: int('town_id')
458
- }, (table) => [
459
- index('title_index').on(table.title),
460
- unique('title_unique').on(table.title)
461
- ]);
462
-
463
-
464
- export const AddressTable = mysqlTable('address', {
465
- id: int('id').autoincrement().notNull().primaryKey(),
466
- catOrder: int('cat_order').notNull(),
467
- titleEn: varchar('title_en', { length: 255 }).notNull(),
468
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
469
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
470
- image: varchar('image', { length: 255 }),
471
- path: varchar('path', { length: 255 }),
472
- parentId: int('parent_id'),
473
- level: int('level')
474
- });
475
-
1
+ import {mysqlTable,int,longtext,mysqlEnum,varchar,index,unique,primaryKey,boolean,double,timestamp} from 'drizzle-orm/mysql-core'
2
+
3
+ export const AppInfoTable = mysqlTable('app_info', {
4
+ id: int('id').autoincrement().notNull().primaryKey(),
5
+ aboutEn: longtext('about_en').notNull(),
6
+ aboutAr: longtext('about_ar').notNull(),
7
+ aboutTr: longtext('about_tr').notNull(),
8
+ privacyEn: longtext('privacy_en').notNull(),
9
+ privacyAr: longtext('privacy_ar').notNull(),
10
+ privacyTr: longtext('privacy_tr').notNull()
11
+ });
12
+
13
+
14
+ export const UserReportsTable = mysqlTable('user_reports', {
15
+ id: int('id').autoincrement().notNull().primaryKey(),
16
+ contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
17
+ reportType: mysqlEnum('report_type', ['explicit_content', 'wrong_information', 'no_longer_available', 'user_not_responsive', 'other']).notNull(),
18
+ contentId: int('content_id').notNull(),
19
+ catId: int('cat_id').notNull(),
20
+ userId: int('user_id'),
21
+ appId: varchar('app_id', { length: 36 }).notNull(),
22
+ title: varchar('title', { length: 255 }).notNull(),
23
+ slug: varchar('slug', { length: 255 }).notNull()
24
+ }, (table) => [
25
+ index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.appId),
26
+ unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.appId),
27
+ unique('slug_unique').on(table.slug)
28
+ ]);
29
+
30
+
31
+ export const TestSectionTable = mysqlTable('test_section', {
32
+ id: int('id').autoincrement().notNull().primaryKey(),
33
+ contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
34
+ price: int('price'),
35
+ appId: varchar('app_id', { length: 36 }).notNull(),
36
+ title: varchar('title', { length: 255 }).notNull(),
37
+ photo: varchar('photo', { length: 255 }),
38
+ category: varchar('category', { length: 255 }).notNull(),
39
+ file: varchar('file', { length: 255 }).notNull()
40
+ }, (table) => [
41
+ index('unique_user_report_index').on(table.contentType, table.price, table.appId),
42
+ unique('unique_user_report').on(table.contentType, table.price, table.appId),
43
+ unique('price_unique').on(table.price)
44
+ ]);
45
+
46
+
47
+ export const TestTagsTable = mysqlTable('test_tags', {
48
+ testId: varchar('test_id', { length: 255 }).notNull(),
49
+ tagName: varchar('tag_name', { length: 255 }).notNull(),
50
+ locale: varchar('locale', { length: 255 })
51
+ }, (table) => [
52
+ primaryKey({ columns: [table.testId, table.tagName, table.locale] })
53
+ ]);
54
+
55
+
56
+ export const TestSectionLocalesTable = mysqlTable('test_section_locales', {
57
+ id: int('id').autoincrement().notNull().primaryKey(),
58
+ parentId: int('parent_id').notNull(),
59
+ locale: varchar('locale', { length: 10 }).notNull(),
60
+ contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
61
+ price: int('price'),
62
+ appId: varchar('app_id', { length: 36 }).notNull(),
63
+ title: varchar('title', { length: 255 }).notNull(),
64
+ photo: varchar('photo', { length: 255 }),
65
+ category: varchar('category', { length: 255 }).notNull()
66
+ }, (table) => [
67
+ unique('test_section_locales_parent_id_locale_unique').on(table.parentId, table.locale)
68
+ ]);
69
+
70
+
71
+ export const FeaturedSliderTable = mysqlTable('featured_slider', {
72
+ id: int('id').autoincrement().notNull().primaryKey(),
73
+ image: varchar('image', { length: 255 }).notNull(),
74
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
75
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
76
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
77
+ descEn: longtext('desc_en').notNull(),
78
+ descAr: longtext('desc_ar').notNull(),
79
+ descTr: longtext('desc_tr').notNull()
80
+ }, (table) => [
81
+ unique('title_en_unique').on(table.titleEn),
82
+ unique('title_ar_unique').on(table.titleAr),
83
+ unique('title_tr_unique').on(table.titleTr)
84
+ ]);
85
+
86
+
87
+ export const MenuSettingsTable = mysqlTable('menu_settings', {
88
+ id: int('id').autoincrement().notNull().primaryKey(),
89
+ taxRate: varchar('tax_rate', { length: 255 }),
90
+ hideSlider: boolean('hide_slider')
91
+ });
92
+
93
+
94
+ export const ServicesTable = mysqlTable('services', {
95
+ id: int('id').autoincrement().notNull().primaryKey(),
96
+ title: varchar('title', { length: 255 }).notNull(),
97
+ catId: int('cat_id').notNull(),
98
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
99
+ price: int('price'),
100
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
101
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
102
+ desc: longtext('desc'),
103
+ latitude: double('latitude'),
104
+ longitude: double('longitude'),
105
+ viewCount: int('view_count'),
106
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
107
+ govId: int('gov_id').notNull(),
108
+ districtId: int('district_id').notNull(),
109
+ subDistrictId: int('sub_district_id'),
110
+ townId: int('town_id')
111
+ }, (table) => [
112
+ index('title_index').on(table.title),
113
+ unique('title_unique').on(table.title)
114
+ ]);
115
+
116
+
117
+ export const RealestateTable = mysqlTable('realestate', {
118
+ id: int('id').autoincrement().notNull().primaryKey(),
119
+ catId: int('cat_id').notNull(),
120
+ title: varchar('title', { length: 255 }).notNull(),
121
+ price: int('price').notNull(),
122
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
123
+ spaceGross: int('space_gross').notNull(),
124
+ spaceNet: int('space_net').notNull(),
125
+ latitude: double('latitude').notNull(),
126
+ longitude: double('longitude').notNull(),
127
+ roomCount: varchar('room_count', { length: 255 }),
128
+ buildingAge: varchar('building_age', { length: 255 }),
129
+ floorCount: varchar('floor_count', { length: 255 }),
130
+ bathroomCount: varchar('bathroom_count', { length: 255 }),
131
+ floorLocation: varchar('floor_location', { length: 255 }),
132
+ heatingType: varchar('heating_type', { length: 255 }),
133
+ kitchenType: varchar('kitchen_type', { length: 255 }),
134
+ balcony: boolean('balcony'),
135
+ lift: boolean('lift'),
136
+ parkingType: varchar('parking_type', { length: 255 }),
137
+ furnished: boolean('furnished'),
138
+ belongsToSite: boolean('belongs_to_site'),
139
+ siteName: varchar('site_name', { length: 255 }),
140
+ installments: boolean('installments'),
141
+ exchangeable: boolean('exchangeable'),
142
+ fromWhom: varchar('from_whom', { length: 255 }),
143
+ buildingMembershipFees: int('building_membership_fees'),
144
+ deposit: int('deposit'),
145
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
146
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
147
+ desc: longtext('desc'),
148
+ viewCount: int('view_count'),
149
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
150
+ govId: int('gov_id').notNull(),
151
+ districtId: int('district_id').notNull(),
152
+ subDistrictId: int('sub_district_id'),
153
+ townId: int('town_id')
154
+ }, (table) => [
155
+ index('title_index').on(table.title),
156
+ unique('title_unique').on(table.title)
157
+ ]);
158
+
159
+
160
+ export const HomepageSliderTable = mysqlTable('homepage_slider', {
161
+ id: int('id').autoincrement().notNull().primaryKey(),
162
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
163
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
164
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
165
+ subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
166
+ subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
167
+ subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
168
+ photo: varchar('photo', { length: 255 }).notNull(),
169
+ buttonUrl: varchar('button_url', { length: 255 }),
170
+ buttonTextEn: varchar('button_text_en', { length: 255 }),
171
+ buttonTextAr: varchar('button_text_ar', { length: 255 }),
172
+ buttonTextTr: varchar('button_text_tr', { length: 255 }),
173
+ buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
174
+ });
175
+
176
+
177
+ export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
178
+ id: int('id').autoincrement().notNull().primaryKey(),
179
+ userId: int('user_id').notNull(),
180
+ contestId: varchar('contest_id', { length: 255 }).notNull()
181
+ }, (table) => [
182
+ unique('contest_subscriber_unique').on(table.contestId, table.userId)
183
+ ]);
184
+
185
+
186
+ export const ContestsTable = mysqlTable('contests', {
187
+ id: int('id').autoincrement().notNull().primaryKey(),
188
+ date: timestamp('date').notNull(),
189
+ prize: varchar('prize', { length: 255 }).notNull(),
190
+ winnerId: int('winner_id'),
191
+ tags: varchar('tags', { length: 255 })
192
+ });
193
+
194
+
195
+ export const NotificationsTable = mysqlTable('notifications', {
196
+ id: int('id').autoincrement().notNull().primaryKey(),
197
+ type: mysqlEnum('type', ['ad_price_updated', 'ad_updated', 'ad_activated', 'ad_pending_review', 'ad_expired', 'ad_rejected', 'ad_viewed', 'ad_favorited', 'ad_shared', 'ad_reported', 'ad_deleted', 'ad_created', 'contest_winner', 'contest_reminder', 'contest_created', 'custom']).notNull(),
198
+ contentId: int('content_id'),
199
+ contentCatId: int('content_cat_id'),
200
+ userId: int('user_id'),
201
+ message: varchar('message', { length: 255 })
202
+ }, (table) => [
203
+ index('type_index').on(table.type),
204
+ unique('unique_notification').on(table.type, table.contentId, table.contentCatId)
205
+ ]);
206
+
207
+
208
+ export const ModerationTable = mysqlTable('moderation', {
209
+ id: int('id').autoincrement().notNull().primaryKey(),
210
+ contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
211
+ contentId: int('content_id').notNull(),
212
+ catId: int('cat_id'),
213
+ userId: int('user_id').notNull(),
214
+ flagged: int('flagged').notNull(),
215
+ result: varchar('result', { length: 255 }).notNull()
216
+ }, (table) => [
217
+ index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.userId),
218
+ unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.userId)
219
+ ]);
220
+
221
+
222
+ export const JobsTable = mysqlTable('jobs', {
223
+ id: int('id').autoincrement().notNull().primaryKey(),
224
+ title: varchar('title', { length: 255 }).notNull(),
225
+ catId: int('cat_id').notNull(),
226
+ salary: int('salary'),
227
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
228
+ workMethod: varchar('work_method', { length: 255 }).notNull(),
229
+ minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
230
+ experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
231
+ remote: boolean('remote'),
232
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
233
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
234
+ desc: longtext('desc'),
235
+ latitude: double('latitude'),
236
+ longitude: double('longitude'),
237
+ viewCount: int('view_count'),
238
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
239
+ govId: int('gov_id').notNull(),
240
+ districtId: int('district_id').notNull(),
241
+ subDistrictId: int('sub_district_id'),
242
+ townId: int('town_id')
243
+ }, (table) => [
244
+ index('title_index').on(table.title),
245
+ unique('title_unique').on(table.title)
246
+ ]);
247
+
248
+
249
+ export const FurnitureTable = mysqlTable('furniture', {
250
+ id: int('id').autoincrement().notNull().primaryKey(),
251
+ title: varchar('title', { length: 255 }).notNull(),
252
+ catId: int('cat_id').notNull(),
253
+ condition: varchar('condition', { length: 255 }).notNull(),
254
+ price: int('price').notNull(),
255
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
256
+ exchangeable: boolean('exchangeable'),
257
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
258
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
259
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
260
+ desc: longtext('desc'),
261
+ latitude: double('latitude'),
262
+ longitude: double('longitude'),
263
+ viewCount: int('view_count'),
264
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
265
+ govId: int('gov_id').notNull(),
266
+ districtId: int('district_id').notNull(),
267
+ subDistrictId: int('sub_district_id'),
268
+ townId: int('town_id')
269
+ }, (table) => [
270
+ index('title_index').on(table.title),
271
+ unique('title_unique').on(table.title)
272
+ ]);
273
+
274
+
275
+ export const FiltersTable = mysqlTable('filters', {
276
+ id: int('id').autoincrement().notNull().primaryKey(),
277
+ title: varchar('title', { length: 255 }).notNull(),
278
+ Key: varchar('_key', { length: 255 }).notNull(),
279
+ fieldName: varchar('field_name', { length: 255 }).notNull(),
280
+ type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
281
+ tableName: varchar('table_name', { length: 255 }),
282
+ isMandatory: boolean('is_mandatory')
283
+ }, (table) => [
284
+ unique('title_unique').on(table.title),
285
+ unique('key_unique').on(table.Key)
286
+ ]);
287
+
288
+
289
+ export const FaqTable = mysqlTable('faq', {
290
+ id: int('id').autoincrement().notNull().primaryKey(),
291
+ qEn: varchar('q_en', { length: 255 }).notNull(),
292
+ qAr: varchar('q_ar', { length: 255 }).notNull(),
293
+ qTr: varchar('q_tr', { length: 255 }),
294
+ aEn: longtext('a_en').notNull(),
295
+ aAr: longtext('a_ar'),
296
+ aTr: longtext('a_tr')
297
+ }, (table) => [
298
+ unique('faq_q_en_unique').on(table.qEn),
299
+ unique('title_ar_unique').on(table.qAr),
300
+ unique('title_tr_unique').on(table.qTr)
301
+ ]);
302
+
303
+
304
+ export const ErrorsTable = mysqlTable('errors', {
305
+ id: int('id').autoincrement().notNull().primaryKey(),
306
+ title: varchar('title', { length: 255 }).notNull(),
307
+ caseId: varchar('case_id', { length: 255 }).notNull(),
308
+ userId: int('user_id'),
309
+ itemSlug: varchar('item_slug', { length: 255 }),
310
+ desc: longtext('desc'),
311
+ isResolved: boolean('is_resolved')
312
+ }, (table) => [
313
+ unique('key_unique').on(table.caseId)
314
+ ]);
315
+
316
+
317
+ export const ElectronicsTable = mysqlTable('electronics', {
318
+ id: int('id').autoincrement().notNull().primaryKey(),
319
+ title: varchar('title', { length: 255 }).notNull(),
320
+ catId: int('cat_id').notNull(),
321
+ condition: varchar('condition', { length: 255 }).notNull(),
322
+ price: int('price').notNull(),
323
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
324
+ exchangeable: boolean('exchangeable'),
325
+ installments: boolean('installments'),
326
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
327
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
328
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
329
+ desc: longtext('desc'),
330
+ latitude: double('latitude'),
331
+ longitude: double('longitude'),
332
+ viewCount: int('view_count'),
333
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
334
+ govId: int('gov_id').notNull(),
335
+ districtId: int('district_id').notNull(),
336
+ subDistrictId: int('sub_district_id'),
337
+ townId: int('town_id')
338
+ }, (table) => [
339
+ index('title_index').on(table.title),
340
+ unique('title_unique').on(table.title)
341
+ ]);
342
+
343
+
344
+ export const ClothesTable = mysqlTable('clothes', {
345
+ id: int('id').autoincrement().notNull().primaryKey(),
346
+ title: varchar('title', { length: 255 }).notNull(),
347
+ catId: int('cat_id').notNull(),
348
+ condition: varchar('condition', { length: 255 }).notNull(),
349
+ price: int('price').notNull(),
350
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
351
+ exchangeable: boolean('exchangeable'),
352
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
353
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
354
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
355
+ desc: longtext('desc'),
356
+ latitude: double('latitude'),
357
+ longitude: double('longitude'),
358
+ viewCount: int('view_count'),
359
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
360
+ govId: int('gov_id').notNull(),
361
+ districtId: int('district_id').notNull(),
362
+ subDistrictId: int('sub_district_id'),
363
+ townId: int('town_id')
364
+ }, (table) => [
365
+ index('title_index').on(table.title),
366
+ unique('title_unique').on(table.title)
367
+ ]);
368
+
369
+
370
+ export const CatsTable = mysqlTable('cats', {
371
+ id: int('id').autoincrement().notNull().primaryKey(),
372
+ catOrder: int('cat_order').notNull(),
373
+ slug: varchar('slug', { length: 255 }).notNull(),
374
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
375
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
376
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
377
+ fullTitleEn: varchar('full_title_en', { length: 255 }),
378
+ fullTitleAr: varchar('full_title_ar', { length: 255 }),
379
+ fullTitleTr: varchar('full_title_tr', { length: 255 }),
380
+ image: varchar('image', { length: 255 }),
381
+ metaDescEn: varchar('meta_desc_en', { length: 255 }),
382
+ metaDescAr: varchar('meta_desc_ar', { length: 255 }),
383
+ metaDescTr: varchar('meta_desc_tr', { length: 255 }),
384
+ filters: varchar('filters', { length: 255 }),
385
+ tableName: varchar('table_name', { length: 255 }).notNull(),
386
+ adCount: int('ad_count'),
387
+ parentId: int('parent_id'),
388
+ level: int('level')
389
+ }, (table) => [
390
+ unique('cats_slug_unique').on(table.slug)
391
+ ]);
392
+
393
+
394
+ export const CarsTable = mysqlTable('cars', {
395
+ id: int('id').autoincrement().notNull().primaryKey(),
396
+ modelYear: int('model_year').notNull(),
397
+ model: varchar('model', { length: 255 }).notNull(),
398
+ title: varchar('title', { length: 255 }).notNull(),
399
+ catId: int('cat_id').notNull(),
400
+ govId: int('gov_id').notNull(),
401
+ districtId: int('district_id').notNull(),
402
+ subDistrictId: int('sub_district_id'),
403
+ townId: int('town_id'),
404
+ price: int('price').notNull(),
405
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
406
+ condition: varchar('condition', { length: 255 }).notNull(),
407
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
408
+ engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
409
+ enginePower: varchar('engine_power', { length: 255 }).notNull(),
410
+ tractionType: varchar('traction_type', { length: 255 }).notNull(),
411
+ bodyType: varchar('body_type', { length: 255 }).notNull(),
412
+ gearType: varchar('gear_type', { length: 255 }).notNull(),
413
+ fuelType: varchar('fuel_type', { length: 255 }).notNull(),
414
+ exchangeable: boolean('exchangeable'),
415
+ installments: boolean('installments'),
416
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
417
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
418
+ desc: longtext('desc'),
419
+ latitude: double('latitude'),
420
+ longitude: double('longitude'),
421
+ viewCount: int('view_count'),
422
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
423
+ }, (table) => [
424
+ index('title_index').on(table.title)
425
+ ]);
426
+
427
+
428
+ export const CarsDbTable = mysqlTable('cars_db', {
429
+ id: int('id').autoincrement().notNull().primaryKey(),
430
+ name: varchar('name', { length: 255 }).notNull(),
431
+ parentId: int('parent_id'),
432
+ level: int('level')
433
+ }, (table) => [
434
+ index('cars_db_name_idx').on(table.name)
435
+ ]);
436
+
437
+
438
+ export const BooksTable = mysqlTable('books', {
439
+ id: int('id').autoincrement().notNull().primaryKey(),
440
+ title: varchar('title', { length: 255 }).notNull(),
441
+ catId: int('cat_id').notNull(),
442
+ condition: varchar('condition', { length: 255 }).notNull(),
443
+ price: int('price').notNull(),
444
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
445
+ exchangeable: boolean('exchangeable'),
446
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
447
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
448
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
449
+ desc: longtext('desc'),
450
+ latitude: double('latitude'),
451
+ longitude: double('longitude'),
452
+ viewCount: int('view_count'),
453
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
454
+ govId: int('gov_id').notNull(),
455
+ districtId: int('district_id').notNull(),
456
+ subDistrictId: int('sub_district_id'),
457
+ townId: int('town_id')
458
+ }, (table) => [
459
+ index('title_index').on(table.title),
460
+ unique('title_unique').on(table.title)
461
+ ]);
462
+
463
+
464
+ export const AddressTable = mysqlTable('address', {
465
+ id: int('id').autoincrement().notNull().primaryKey(),
466
+ catOrder: int('cat_order').notNull(),
467
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
468
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
469
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
470
+ image: varchar('image', { length: 255 }),
471
+ path: varchar('path', { length: 255 }),
472
+ parentId: int('parent_id'),
473
+ level: int('level')
474
+ });
475
+
@@ -59,13 +59,13 @@
59
59
  "drizzle-zod": "^0.8.3",
60
60
  "eslint-plugin-drizzle": "^0.2.3",
61
61
  "file-type": "^20.1.0",
62
- "isomorphic-dompurify": "^2.21.0",
62
+ "isomorphic-dompurify": "^3.7.1",
63
63
  "lodash-es": "^4.17.21",
64
64
  "lucide-react": "^0.563.0",
65
65
  "nanoid": "^5.1.2",
66
66
  "next": "16.1.1",
67
67
  "next-themes": "^0.4.6",
68
- "nextjs-cms": "0.9.2",
68
+ "nextjs-cms": "0.9.4",
69
69
  "plaiceholder": "^3.0.0",
70
70
  "prettier-plugin-tailwindcss": "^0.7.2",
71
71
  "qrcode": "^1.5.4",