create-nextjs-cms 0.8.8 → 0.8.10

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.8.8",
3
+ "version": "0.8.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,8 +28,8 @@
28
28
  "prettier": "^3.3.3",
29
29
  "tsx": "^4.20.6",
30
30
  "typescript": "^5.9.2",
31
- "@lzcms/eslint-config": "0.3.0",
32
31
  "@lzcms/prettier-config": "0.1.0",
32
+ "@lzcms/eslint-config": "0.3.0",
33
33
  "@lzcms/tsconfig": "0.1.0"
34
34
  },
35
35
  "prettier": "@lzcms/prettier-config",
@@ -8,4 +8,4 @@ export const revalidate = 0
8
8
 
9
9
  // @refresh reset
10
10
 
11
- export const configLastUpdated = 1770208773203
11
+ export const configLastUpdated = 1773836696982
@@ -1,383 +1,448 @@
1
- import {mysqlTable,int,longtext,mysqlEnum,varchar,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
- });
25
-
26
-
27
- export const FeaturedSliderTable = mysqlTable('featured_slider', {
28
- id: int('id').autoincrement().notNull().primaryKey(),
29
- image: varchar('image', { length: 255 }).notNull(),
30
- titleEn: varchar('title_en', { length: 255 }).notNull(),
31
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
32
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
33
- descEn: longtext('desc_en').notNull(),
34
- descAr: longtext('desc_ar').notNull(),
35
- descTr: longtext('desc_tr').notNull()
36
- });
37
-
38
-
39
- export const MenuSettingsTable = mysqlTable('menu_settings', {
40
- id: int('id').autoincrement().notNull().primaryKey(),
41
- taxRate: varchar('tax_rate', { length: 255 }),
42
- hideSlider: boolean('hide_slider')
43
- });
44
-
45
-
46
- export const ServicesTable = mysqlTable('services', {
47
- id: int('id').autoincrement().notNull().primaryKey(),
48
- title: varchar('title', { length: 255 }).notNull(),
49
- catId: int('cat_id').notNull(),
50
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
51
- price: int('price'),
52
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
53
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
54
- desc: longtext('desc'),
55
- latitude: double('latitude'),
56
- longitude: double('longitude'),
57
- viewCount: int('view_count'),
58
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
59
- govId: int('gov_id').notNull(),
60
- districtId: int('district_id').notNull(),
61
- subDistrictId: int('sub_district_id'),
62
- townId: int('town_id')
63
- });
64
-
65
-
66
- export const RealestateTable = mysqlTable('realestate', {
67
- id: int('id').autoincrement().notNull().primaryKey(),
68
- catId: int('cat_id').notNull(),
69
- title: varchar('title', { length: 255 }).notNull(),
70
- price: int('price').notNull(),
71
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
72
- spaceGross: int('space_gross').notNull(),
73
- spaceNet: int('space_net').notNull(),
74
- latitude: double('latitude').notNull(),
75
- longitude: double('longitude').notNull(),
76
- roomCount: varchar('room_count', { length: 255 }),
77
- buildingAge: varchar('building_age', { length: 255 }),
78
- floorCount: varchar('floor_count', { length: 255 }),
79
- bathroomCount: varchar('bathroom_count', { length: 255 }),
80
- floorLocation: varchar('floor_location', { length: 255 }),
81
- heatingType: varchar('heating_type', { length: 255 }),
82
- kitchenType: varchar('kitchen_type', { length: 255 }),
83
- balcony: boolean('balcony'),
84
- lift: boolean('lift'),
85
- parkingType: varchar('parking_type', { length: 255 }),
86
- furnished: boolean('furnished'),
87
- belongsToSite: boolean('belongs_to_site'),
88
- siteName: varchar('site_name', { length: 255 }),
89
- installments: boolean('installments'),
90
- exchangeable: boolean('exchangeable'),
91
- fromWhom: varchar('from_whom', { length: 255 }),
92
- buildingMembershipFees: int('building_membership_fees'),
93
- deposit: int('deposit'),
94
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
95
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
96
- desc: longtext('desc'),
97
- viewCount: int('view_count'),
98
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
99
- govId: int('gov_id').notNull(),
100
- districtId: int('district_id').notNull(),
101
- subDistrictId: int('sub_district_id'),
102
- townId: int('town_id')
103
- });
104
-
105
-
106
- export const HomepageSliderTable = mysqlTable('homepage_slider', {
107
- id: int('id').autoincrement().notNull().primaryKey(),
108
- titleEn: varchar('title_en', { length: 255 }).notNull(),
109
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
110
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
111
- subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
112
- subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
113
- subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
114
- photo: varchar('photo', { length: 255 }).notNull(),
115
- buttonUrl: varchar('button_url', { length: 255 }),
116
- buttonTextEn: varchar('button_text_en', { length: 255 }),
117
- buttonTextAr: varchar('button_text_ar', { length: 255 }),
118
- buttonTextTr: varchar('button_text_tr', { length: 255 }),
119
- buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
120
- });
121
-
122
-
123
- export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
124
- id: int('id').autoincrement().notNull().primaryKey(),
125
- userId: int('user_id').notNull(),
126
- contestId: varchar('contest_id', { length: 255 }).notNull()
127
- });
128
-
129
-
130
- export const ContestsTable = mysqlTable('contests', {
131
- id: int('id').autoincrement().notNull().primaryKey(),
132
- date: timestamp('date').notNull(),
133
- prize: varchar('prize', { length: 255 }).notNull(),
134
- winnerId: int('winner_id'),
135
- tags: varchar('tags', { length: 255 })
136
- });
137
-
138
-
139
- export const NotificationsTable = mysqlTable('notifications', {
140
- id: int('id').autoincrement().notNull().primaryKey(),
141
- 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(),
142
- contentId: int('content_id'),
143
- contentCatId: int('content_cat_id'),
144
- userId: int('user_id'),
145
- message: varchar('message', { length: 255 })
146
- });
147
-
148
-
149
- export const ModerationTable = mysqlTable('moderation', {
150
- id: int('id').autoincrement().notNull().primaryKey(),
151
- contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
152
- contentId: int('content_id').notNull(),
153
- catId: int('cat_id'),
154
- userId: int('user_id').notNull(),
155
- flagged: int('flagged').notNull(),
156
- result: varchar('result', { length: 255 }).notNull()
157
- });
158
-
159
-
160
- export const JobsTable = mysqlTable('jobs', {
161
- id: int('id').autoincrement().notNull().primaryKey(),
162
- title: varchar('title', { length: 255 }).notNull(),
163
- catId: int('cat_id').notNull(),
164
- salary: int('salary'),
165
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
166
- workMethod: varchar('work_method', { length: 255 }).notNull(),
167
- minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
168
- experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
169
- remote: boolean('remote'),
170
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
171
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
172
- desc: longtext('desc'),
173
- latitude: double('latitude'),
174
- longitude: double('longitude'),
175
- viewCount: int('view_count'),
176
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
177
- govId: int('gov_id').notNull(),
178
- districtId: int('district_id').notNull(),
179
- subDistrictId: int('sub_district_id'),
180
- townId: int('town_id')
181
- });
182
-
183
-
184
- export const FurnitureTable = mysqlTable('furniture', {
185
- id: int('id').autoincrement().notNull().primaryKey(),
186
- title: varchar('title', { length: 255 }).notNull(),
187
- catId: int('cat_id').notNull(),
188
- condition: varchar('condition', { length: 255 }).notNull(),
189
- price: int('price').notNull(),
190
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
191
- exchangeable: boolean('exchangeable'),
192
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
193
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
194
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
195
- desc: longtext('desc'),
196
- latitude: double('latitude'),
197
- longitude: double('longitude'),
198
- viewCount: int('view_count'),
199
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
200
- govId: int('gov_id').notNull(),
201
- districtId: int('district_id').notNull(),
202
- subDistrictId: int('sub_district_id'),
203
- townId: int('town_id')
204
- });
205
-
206
-
207
- export const FiltersTable = mysqlTable('filters', {
208
- id: int('id').autoincrement().notNull().primaryKey(),
209
- title: varchar('title', { length: 255 }).notNull(),
210
- Key: varchar('_key', { length: 255 }).notNull(),
211
- fieldName: varchar('field_name', { length: 255 }).notNull(),
212
- type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
213
- tableName: varchar('table_name', { length: 255 }),
214
- isMandatory: boolean('is_mandatory')
215
- });
216
-
217
-
218
- export const FaqTable = mysqlTable('faq', {
219
- id: int('id').autoincrement().notNull().primaryKey(),
220
- qEn: varchar('q_en', { length: 255 }).notNull(),
221
- qAr: varchar('q_ar', { length: 255 }).notNull(),
222
- qTr: varchar('q_tr', { length: 255 }),
223
- aEn: longtext('a_en').notNull(),
224
- aAr: longtext('a_ar'),
225
- aTr: longtext('a_tr')
226
- });
227
-
228
-
229
- export const ErrorsTable = mysqlTable('errors', {
230
- id: int('id').autoincrement().notNull().primaryKey(),
231
- title: varchar('title', { length: 255 }).notNull(),
232
- caseId: varchar('case_id', { length: 255 }).notNull(),
233
- userId: int('user_id'),
234
- itemSlug: varchar('item_slug', { length: 255 }),
235
- desc: longtext('desc'),
236
- isResolved: boolean('is_resolved')
237
- });
238
-
239
-
240
- export const ElectronicsTable = mysqlTable('electronics', {
241
- id: int('id').autoincrement().notNull().primaryKey(),
242
- title: varchar('title', { length: 255 }).notNull(),
243
- catId: int('cat_id').notNull(),
244
- condition: varchar('condition', { length: 255 }).notNull(),
245
- price: int('price').notNull(),
246
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
247
- exchangeable: boolean('exchangeable'),
248
- installments: boolean('installments'),
249
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
250
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
251
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
252
- desc: longtext('desc'),
253
- latitude: double('latitude'),
254
- longitude: double('longitude'),
255
- viewCount: int('view_count'),
256
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
257
- govId: int('gov_id').notNull(),
258
- districtId: int('district_id').notNull(),
259
- subDistrictId: int('sub_district_id'),
260
- townId: int('town_id')
261
- });
262
-
263
-
264
- export const ClothesTable = mysqlTable('clothes', {
265
- id: int('id').autoincrement().notNull().primaryKey(),
266
- title: varchar('title', { length: 255 }).notNull(),
267
- catId: int('cat_id').notNull(),
268
- condition: varchar('condition', { length: 255 }).notNull(),
269
- price: int('price').notNull(),
270
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
271
- exchangeable: boolean('exchangeable'),
272
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
273
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
274
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
275
- desc: longtext('desc'),
276
- latitude: double('latitude'),
277
- longitude: double('longitude'),
278
- viewCount: int('view_count'),
279
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
280
- govId: int('gov_id').notNull(),
281
- districtId: int('district_id').notNull(),
282
- subDistrictId: int('sub_district_id'),
283
- townId: int('town_id')
284
- });
285
-
286
-
287
- export const CatsTable = mysqlTable('cats', {
288
- id: int('id').autoincrement().notNull().primaryKey(),
289
- catOrder: int('cat_order').notNull(),
290
- slug: varchar('slug', { length: 255 }).notNull(),
291
- titleEn: varchar('title_en', { length: 255 }).notNull(),
292
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
293
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
294
- fullTitleEn: varchar('full_title_en', { length: 255 }),
295
- fullTitleAr: varchar('full_title_ar', { length: 255 }),
296
- fullTitleTr: varchar('full_title_tr', { length: 255 }),
297
- image: varchar('image', { length: 255 }),
298
- metaDescEn: varchar('meta_desc_en', { length: 255 }),
299
- metaDescAr: varchar('meta_desc_ar', { length: 255 }),
300
- metaDescTr: varchar('meta_desc_tr', { length: 255 }),
301
- filters: varchar('filters', { length: 255 }),
302
- tableName: varchar('table_name', { length: 255 }).notNull(),
303
- adCount: int('ad_count'),
304
- parentId: int('parent_id'),
305
- level: int('level')
306
- });
307
-
308
-
309
- export const CarsTable = mysqlTable('cars', {
310
- id: int('id').autoincrement().notNull().primaryKey(),
311
- modelYear: int('model_year').notNull(),
312
- model: varchar('model', { length: 255 }).notNull(),
313
- title: varchar('title', { length: 255 }).notNull(),
314
- catId: int('cat_id').notNull(),
315
- govId: int('gov_id').notNull(),
316
- districtId: int('district_id').notNull(),
317
- subDistrictId: int('sub_district_id'),
318
- townId: int('town_id'),
319
- price: int('price').notNull(),
320
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
321
- condition: varchar('condition', { length: 255 }).notNull(),
322
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
323
- engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
324
- enginePower: varchar('engine_power', { length: 255 }).notNull(),
325
- tractionType: varchar('traction_type', { length: 255 }).notNull(),
326
- bodyType: varchar('body_type', { length: 255 }).notNull(),
327
- gearType: varchar('gear_type', { length: 255 }).notNull(),
328
- fuelType: varchar('fuel_type', { length: 255 }).notNull(),
329
- exchangeable: boolean('exchangeable'),
330
- installments: boolean('installments'),
331
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
332
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
333
- desc: longtext('desc'),
334
- latitude: double('latitude'),
335
- longitude: double('longitude'),
336
- viewCount: int('view_count'),
337
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
338
- });
339
-
340
-
341
- export const CarsDbTable = mysqlTable('cars_db', {
342
- id: int('id').autoincrement().notNull().primaryKey(),
343
- name: varchar('name', { length: 255 }).notNull(),
344
- parentId: int('parent_id'),
345
- level: int('level')
346
- });
347
-
348
-
349
- export const BooksTable = mysqlTable('books', {
350
- id: int('id').autoincrement().notNull().primaryKey(),
351
- title: varchar('title', { length: 255 }).notNull(),
352
- catId: int('cat_id').notNull(),
353
- condition: varchar('condition', { length: 255 }).notNull(),
354
- price: int('price').notNull(),
355
- currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
356
- exchangeable: boolean('exchangeable'),
357
- fromWhom: varchar('from_whom', { length: 255 }).notNull(),
358
- coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
359
- coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
360
- desc: longtext('desc'),
361
- latitude: double('latitude'),
362
- longitude: double('longitude'),
363
- viewCount: int('view_count'),
364
- status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
365
- govId: int('gov_id').notNull(),
366
- districtId: int('district_id').notNull(),
367
- subDistrictId: int('sub_district_id'),
368
- townId: int('town_id')
369
- });
370
-
371
-
372
- export const AddressTable = mysqlTable('address', {
373
- id: int('id').autoincrement().notNull().primaryKey(),
374
- catOrder: int('cat_order').notNull(),
375
- titleEn: varchar('title_en', { length: 255 }).notNull(),
376
- titleAr: varchar('title_ar', { length: 255 }).notNull(),
377
- titleTr: varchar('title_tr', { length: 255 }).notNull(),
378
- image: varchar('image', { length: 255 }),
379
- path: varchar('path', { length: 255 }),
380
- parentId: int('parent_id'),
381
- level: int('level')
382
- });
383
-
1
+ import {mysqlTable,int,longtext,mysqlEnum,varchar,index,unique,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
+ }, (table) => [
38
+ index('unique_user_report_index').on(table.contentType, table.price, table.appId),
39
+ unique('unique_user_report').on(table.contentType, table.price, table.appId),
40
+ unique('price_unique').on(table.price)
41
+ ]);
42
+
43
+
44
+ export const FeaturedSliderTable = mysqlTable('featured_slider', {
45
+ id: int('id').autoincrement().notNull().primaryKey(),
46
+ image: varchar('image', { length: 255 }).notNull(),
47
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
48
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
49
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
50
+ descEn: longtext('desc_en').notNull(),
51
+ descAr: longtext('desc_ar').notNull(),
52
+ descTr: longtext('desc_tr').notNull()
53
+ }, (table) => [
54
+ unique('title_en_unique').on(table.titleEn),
55
+ unique('title_ar_unique').on(table.titleAr),
56
+ unique('title_tr_unique').on(table.titleTr)
57
+ ]);
58
+
59
+
60
+ export const MenuSettingsTable = mysqlTable('menu_settings', {
61
+ id: int('id').autoincrement().notNull().primaryKey(),
62
+ taxRate: varchar('tax_rate', { length: 255 }),
63
+ hideSlider: boolean('hide_slider')
64
+ });
65
+
66
+
67
+ export const ServicesTable = mysqlTable('services', {
68
+ id: int('id').autoincrement().notNull().primaryKey(),
69
+ title: varchar('title', { length: 255 }).notNull(),
70
+ catId: int('cat_id').notNull(),
71
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
72
+ price: int('price'),
73
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
74
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
75
+ desc: longtext('desc'),
76
+ latitude: double('latitude'),
77
+ longitude: double('longitude'),
78
+ viewCount: int('view_count'),
79
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
80
+ govId: int('gov_id').notNull(),
81
+ districtId: int('district_id').notNull(),
82
+ subDistrictId: int('sub_district_id'),
83
+ townId: int('town_id')
84
+ }, (table) => [
85
+ index('title_index').on(table.title),
86
+ unique('title_unique').on(table.title)
87
+ ]);
88
+
89
+
90
+ export const RealestateTable = mysqlTable('realestate', {
91
+ id: int('id').autoincrement().notNull().primaryKey(),
92
+ catId: int('cat_id').notNull(),
93
+ title: varchar('title', { length: 255 }).notNull(),
94
+ price: int('price').notNull(),
95
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
96
+ spaceGross: int('space_gross').notNull(),
97
+ spaceNet: int('space_net').notNull(),
98
+ latitude: double('latitude').notNull(),
99
+ longitude: double('longitude').notNull(),
100
+ roomCount: varchar('room_count', { length: 255 }),
101
+ buildingAge: varchar('building_age', { length: 255 }),
102
+ floorCount: varchar('floor_count', { length: 255 }),
103
+ bathroomCount: varchar('bathroom_count', { length: 255 }),
104
+ floorLocation: varchar('floor_location', { length: 255 }),
105
+ heatingType: varchar('heating_type', { length: 255 }),
106
+ kitchenType: varchar('kitchen_type', { length: 255 }),
107
+ balcony: boolean('balcony'),
108
+ lift: boolean('lift'),
109
+ parkingType: varchar('parking_type', { length: 255 }),
110
+ furnished: boolean('furnished'),
111
+ belongsToSite: boolean('belongs_to_site'),
112
+ siteName: varchar('site_name', { length: 255 }),
113
+ installments: boolean('installments'),
114
+ exchangeable: boolean('exchangeable'),
115
+ fromWhom: varchar('from_whom', { length: 255 }),
116
+ buildingMembershipFees: int('building_membership_fees'),
117
+ deposit: int('deposit'),
118
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
119
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
120
+ desc: longtext('desc'),
121
+ viewCount: int('view_count'),
122
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
123
+ govId: int('gov_id').notNull(),
124
+ districtId: int('district_id').notNull(),
125
+ subDistrictId: int('sub_district_id'),
126
+ townId: int('town_id')
127
+ }, (table) => [
128
+ index('title_index').on(table.title),
129
+ unique('title_unique').on(table.title)
130
+ ]);
131
+
132
+
133
+ export const HomepageSliderTable = mysqlTable('homepage_slider', {
134
+ id: int('id').autoincrement().notNull().primaryKey(),
135
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
136
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
137
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
138
+ subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
139
+ subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
140
+ subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
141
+ photo: varchar('photo', { length: 255 }).notNull(),
142
+ buttonUrl: varchar('button_url', { length: 255 }),
143
+ buttonTextEn: varchar('button_text_en', { length: 255 }),
144
+ buttonTextAr: varchar('button_text_ar', { length: 255 }),
145
+ buttonTextTr: varchar('button_text_tr', { length: 255 }),
146
+ buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
147
+ });
148
+
149
+
150
+ export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
151
+ id: int('id').autoincrement().notNull().primaryKey(),
152
+ userId: int('user_id').notNull(),
153
+ contestId: varchar('contest_id', { length: 255 }).notNull()
154
+ }, (table) => [
155
+ unique('contest_subscriber_unique').on(table.contestId, table.userId)
156
+ ]);
157
+
158
+
159
+ export const ContestsTable = mysqlTable('contests', {
160
+ id: int('id').autoincrement().notNull().primaryKey(),
161
+ date: timestamp('date').notNull(),
162
+ prize: varchar('prize', { length: 255 }).notNull(),
163
+ winnerId: int('winner_id'),
164
+ tags: varchar('tags', { length: 255 })
165
+ });
166
+
167
+
168
+ export const NotificationsTable = mysqlTable('notifications', {
169
+ id: int('id').autoincrement().notNull().primaryKey(),
170
+ 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(),
171
+ contentId: int('content_id'),
172
+ contentCatId: int('content_cat_id'),
173
+ userId: int('user_id'),
174
+ message: varchar('message', { length: 255 })
175
+ }, (table) => [
176
+ index('type_index').on(table.type),
177
+ unique('unique_notification').on(table.type, table.contentId, table.contentCatId)
178
+ ]);
179
+
180
+
181
+ export const ModerationTable = mysqlTable('moderation', {
182
+ id: int('id').autoincrement().notNull().primaryKey(),
183
+ contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
184
+ contentId: int('content_id').notNull(),
185
+ catId: int('cat_id'),
186
+ userId: int('user_id').notNull(),
187
+ flagged: int('flagged').notNull(),
188
+ result: varchar('result', { length: 255 }).notNull()
189
+ }, (table) => [
190
+ index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.userId),
191
+ unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.userId)
192
+ ]);
193
+
194
+
195
+ export const JobsTable = mysqlTable('jobs', {
196
+ id: int('id').autoincrement().notNull().primaryKey(),
197
+ title: varchar('title', { length: 255 }).notNull(),
198
+ catId: int('cat_id').notNull(),
199
+ salary: int('salary'),
200
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
201
+ workMethod: varchar('work_method', { length: 255 }).notNull(),
202
+ minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
203
+ experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
204
+ remote: boolean('remote'),
205
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
206
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
207
+ desc: longtext('desc'),
208
+ latitude: double('latitude'),
209
+ longitude: double('longitude'),
210
+ viewCount: int('view_count'),
211
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
212
+ govId: int('gov_id').notNull(),
213
+ districtId: int('district_id').notNull(),
214
+ subDistrictId: int('sub_district_id'),
215
+ townId: int('town_id')
216
+ }, (table) => [
217
+ index('title_index').on(table.title),
218
+ unique('title_unique').on(table.title)
219
+ ]);
220
+
221
+
222
+ export const FurnitureTable = mysqlTable('furniture', {
223
+ id: int('id').autoincrement().notNull().primaryKey(),
224
+ title: varchar('title', { length: 255 }).notNull(),
225
+ catId: int('cat_id').notNull(),
226
+ condition: varchar('condition', { length: 255 }).notNull(),
227
+ price: int('price').notNull(),
228
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
229
+ exchangeable: boolean('exchangeable'),
230
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
231
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
232
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
233
+ desc: longtext('desc'),
234
+ latitude: double('latitude'),
235
+ longitude: double('longitude'),
236
+ viewCount: int('view_count'),
237
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
238
+ govId: int('gov_id').notNull(),
239
+ districtId: int('district_id').notNull(),
240
+ subDistrictId: int('sub_district_id'),
241
+ townId: int('town_id')
242
+ }, (table) => [
243
+ index('title_index').on(table.title),
244
+ unique('title_unique').on(table.title)
245
+ ]);
246
+
247
+
248
+ export const FiltersTable = mysqlTable('filters', {
249
+ id: int('id').autoincrement().notNull().primaryKey(),
250
+ title: varchar('title', { length: 255 }).notNull(),
251
+ Key: varchar('_key', { length: 255 }).notNull(),
252
+ fieldName: varchar('field_name', { length: 255 }).notNull(),
253
+ type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
254
+ tableName: varchar('table_name', { length: 255 }),
255
+ isMandatory: boolean('is_mandatory')
256
+ }, (table) => [
257
+ unique('title_unique').on(table.title),
258
+ unique('key_unique').on(table.Key)
259
+ ]);
260
+
261
+
262
+ export const FaqTable = mysqlTable('faq', {
263
+ id: int('id').autoincrement().notNull().primaryKey(),
264
+ qEn: varchar('q_en', { length: 255 }).notNull(),
265
+ qAr: varchar('q_ar', { length: 255 }).notNull(),
266
+ qTr: varchar('q_tr', { length: 255 }),
267
+ aEn: longtext('a_en').notNull(),
268
+ aAr: longtext('a_ar'),
269
+ aTr: longtext('a_tr')
270
+ }, (table) => [
271
+ unique('faq_q_en_unique').on(table.qEn),
272
+ unique('title_ar_unique').on(table.qAr),
273
+ unique('title_tr_unique').on(table.qTr)
274
+ ]);
275
+
276
+
277
+ export const ErrorsTable = mysqlTable('errors', {
278
+ id: int('id').autoincrement().notNull().primaryKey(),
279
+ title: varchar('title', { length: 255 }).notNull(),
280
+ caseId: varchar('case_id', { length: 255 }).notNull(),
281
+ userId: int('user_id'),
282
+ itemSlug: varchar('item_slug', { length: 255 }),
283
+ desc: longtext('desc'),
284
+ isResolved: boolean('is_resolved')
285
+ }, (table) => [
286
+ unique('key_unique').on(table.caseId)
287
+ ]);
288
+
289
+
290
+ export const ElectronicsTable = mysqlTable('electronics', {
291
+ id: int('id').autoincrement().notNull().primaryKey(),
292
+ title: varchar('title', { length: 255 }).notNull(),
293
+ catId: int('cat_id').notNull(),
294
+ condition: varchar('condition', { length: 255 }).notNull(),
295
+ price: int('price').notNull(),
296
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
297
+ exchangeable: boolean('exchangeable'),
298
+ installments: boolean('installments'),
299
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
300
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
301
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
302
+ desc: longtext('desc'),
303
+ latitude: double('latitude'),
304
+ longitude: double('longitude'),
305
+ viewCount: int('view_count'),
306
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
307
+ govId: int('gov_id').notNull(),
308
+ districtId: int('district_id').notNull(),
309
+ subDistrictId: int('sub_district_id'),
310
+ townId: int('town_id')
311
+ }, (table) => [
312
+ index('title_index').on(table.title),
313
+ unique('title_unique').on(table.title)
314
+ ]);
315
+
316
+
317
+ export const ClothesTable = mysqlTable('clothes', {
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
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
326
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
327
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
328
+ desc: longtext('desc'),
329
+ latitude: double('latitude'),
330
+ longitude: double('longitude'),
331
+ viewCount: int('view_count'),
332
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
333
+ govId: int('gov_id').notNull(),
334
+ districtId: int('district_id').notNull(),
335
+ subDistrictId: int('sub_district_id'),
336
+ townId: int('town_id')
337
+ }, (table) => [
338
+ index('title_index').on(table.title),
339
+ unique('title_unique').on(table.title)
340
+ ]);
341
+
342
+
343
+ export const CatsTable = mysqlTable('cats', {
344
+ id: int('id').autoincrement().notNull().primaryKey(),
345
+ catOrder: int('cat_order').notNull(),
346
+ slug: varchar('slug', { length: 255 }).notNull(),
347
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
348
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
349
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
350
+ fullTitleEn: varchar('full_title_en', { length: 255 }),
351
+ fullTitleAr: varchar('full_title_ar', { length: 255 }),
352
+ fullTitleTr: varchar('full_title_tr', { length: 255 }),
353
+ image: varchar('image', { length: 255 }),
354
+ metaDescEn: varchar('meta_desc_en', { length: 255 }),
355
+ metaDescAr: varchar('meta_desc_ar', { length: 255 }),
356
+ metaDescTr: varchar('meta_desc_tr', { length: 255 }),
357
+ filters: varchar('filters', { length: 255 }),
358
+ tableName: varchar('table_name', { length: 255 }).notNull(),
359
+ adCount: int('ad_count'),
360
+ parentId: int('parent_id'),
361
+ level: int('level')
362
+ }, (table) => [
363
+ unique('cats_slug_unique').on(table.slug)
364
+ ]);
365
+
366
+
367
+ export const CarsTable = mysqlTable('cars', {
368
+ id: int('id').autoincrement().notNull().primaryKey(),
369
+ modelYear: int('model_year').notNull(),
370
+ model: varchar('model', { length: 255 }).notNull(),
371
+ title: varchar('title', { length: 255 }).notNull(),
372
+ catId: int('cat_id').notNull(),
373
+ govId: int('gov_id').notNull(),
374
+ districtId: int('district_id').notNull(),
375
+ subDistrictId: int('sub_district_id'),
376
+ townId: int('town_id'),
377
+ price: int('price').notNull(),
378
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
379
+ condition: varchar('condition', { length: 255 }).notNull(),
380
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
381
+ engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
382
+ enginePower: varchar('engine_power', { length: 255 }).notNull(),
383
+ tractionType: varchar('traction_type', { length: 255 }).notNull(),
384
+ bodyType: varchar('body_type', { length: 255 }).notNull(),
385
+ gearType: varchar('gear_type', { length: 255 }).notNull(),
386
+ fuelType: varchar('fuel_type', { length: 255 }).notNull(),
387
+ exchangeable: boolean('exchangeable'),
388
+ installments: boolean('installments'),
389
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
390
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
391
+ desc: longtext('desc'),
392
+ latitude: double('latitude'),
393
+ longitude: double('longitude'),
394
+ viewCount: int('view_count'),
395
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
396
+ }, (table) => [
397
+ index('title_index').on(table.title)
398
+ ]);
399
+
400
+
401
+ export const CarsDbTable = mysqlTable('cars_db', {
402
+ id: int('id').autoincrement().notNull().primaryKey(),
403
+ name: varchar('name', { length: 255 }).notNull(),
404
+ parentId: int('parent_id'),
405
+ level: int('level')
406
+ }, (table) => [
407
+ index('cars_db_name_idx').on(table.name)
408
+ ]);
409
+
410
+
411
+ export const BooksTable = mysqlTable('books', {
412
+ id: int('id').autoincrement().notNull().primaryKey(),
413
+ title: varchar('title', { length: 255 }).notNull(),
414
+ catId: int('cat_id').notNull(),
415
+ condition: varchar('condition', { length: 255 }).notNull(),
416
+ price: int('price').notNull(),
417
+ currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
418
+ exchangeable: boolean('exchangeable'),
419
+ fromWhom: varchar('from_whom', { length: 255 }).notNull(),
420
+ coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
421
+ coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
422
+ desc: longtext('desc'),
423
+ latitude: double('latitude'),
424
+ longitude: double('longitude'),
425
+ viewCount: int('view_count'),
426
+ status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
427
+ govId: int('gov_id').notNull(),
428
+ districtId: int('district_id').notNull(),
429
+ subDistrictId: int('sub_district_id'),
430
+ townId: int('town_id')
431
+ }, (table) => [
432
+ index('title_index').on(table.title),
433
+ unique('title_unique').on(table.title)
434
+ ]);
435
+
436
+
437
+ export const AddressTable = mysqlTable('address', {
438
+ id: int('id').autoincrement().notNull().primaryKey(),
439
+ catOrder: int('cat_order').notNull(),
440
+ titleEn: varchar('title_en', { length: 255 }).notNull(),
441
+ titleAr: varchar('title_ar', { length: 255 }).notNull(),
442
+ titleTr: varchar('title_tr', { length: 255 }).notNull(),
443
+ image: varchar('image', { length: 255 }),
444
+ path: varchar('path', { length: 255 }),
445
+ parentId: int('parent_id'),
446
+ level: int('level')
447
+ });
448
+
@@ -65,7 +65,7 @@
65
65
  "nanoid": "^5.1.2",
66
66
  "next": "16.1.1",
67
67
  "next-themes": "^0.4.6",
68
- "nextjs-cms": "0.8.8",
68
+ "nextjs-cms": "0.8.10",
69
69
  "plaiceholder": "^3.0.0",
70
70
  "prettier-plugin-tailwindcss": "^0.7.2",
71
71
  "qrcode": "^1.5.4",