-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from CA-G12/44-review-transactions-users
Init Payments, Reviews and Users Models
- Loading branch information
Showing
7 changed files
with
208 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,88 @@ | ||
const users = [ | ||
{ | ||
id: 1, | ||
first_name: 'أحمد', | ||
last_name: 'سعيد', | ||
email: '[email protected]', | ||
phone_number: '0591000100', | ||
role: 'admin', | ||
hased_password: '$2y$10$MKpnqAAinu5wjl/MYRc3U.XApWTaEexvI4DMaJA.XZTou5lvpSPfu', | ||
}, | ||
{ | ||
id: 2, | ||
first_name: 'خالد', | ||
last_name: 'عمر', | ||
email: '[email protected]', | ||
phone_number: '0591000200', | ||
role: 'user', | ||
hased_password: '$2y$10$ROMcXqVNwbepoV6ZdTsTa.6/iego9a72vzSK70pF/S8Oxe/y8tLeO', | ||
}, | ||
{ | ||
id: 3, | ||
first_name: 'سمير', | ||
last_name: 'عبد الله', | ||
email: '[email protected]', | ||
phone_number: '498-722-9258', | ||
role: 'user', | ||
hased_password: '$2y$10$NrRa5y454oIukcfU/iNDruP2iEJPm9UGlHqyhZiyd5mY1fy2vULkG', | ||
}, | ||
{ | ||
id: 4, | ||
first_name: 'مهند', | ||
last_name: 'محمد', | ||
email: '[email protected]', | ||
phone_number: '172-408-5906', | ||
role: 'user', | ||
hased_password: '$2y$10$dOSPYdqciJCM9U10HiWtCOg9j6jpMD69rMPV/2LI/dDL4SxLATkNG', | ||
}, | ||
{ | ||
id: 5, | ||
first_name: 'تميم', | ||
last_name: 'سليم', | ||
email: '[email protected]', | ||
phone_number: '910-220-7086', | ||
role: 'user', | ||
hased_password: '$2y$10$6Y1AcLQDLM7vSSu1A5dj9e61YgCFACEXoBP3NxJ4qX/1SeUUXLFtm', | ||
}, | ||
]; | ||
|
||
const payments = [ | ||
{ | ||
title: 'دفع فاتورة', | ||
description: | ||
'لقد قمت بدفع فاتورة بقيمة 80 شيكل', | ||
BillId: 4, | ||
}, | ||
{ | ||
title: 'دفع فاتورة', | ||
description: | ||
'لقد قمت بدفع فاتورة بقيمة 70 شيكل', | ||
BillId: 3, | ||
}, | ||
{ | ||
title: 'دفع فاتورة', | ||
description: | ||
'لقد قمت بدفع فاتورة بقيمة 90 شيكل', | ||
BillId: 1, | ||
}, | ||
]; | ||
|
||
const announcements = [ | ||
{ | ||
title: 'تنبيه لسكان البرج الكرام: فصل الطاقة الشمسية على الساعة السابعة مساء اليوم', | ||
title: | ||
'تنبيه لسكان البرج الكرام: فصل الطاقة الشمسية على الساعة السابعة مساء اليوم', | ||
start_date: '20/10/2022', | ||
end_date: '21/10/2022', | ||
}, | ||
{ | ||
title: ' تنبيه لسكان البرج الكرام: نعلمكم بأنه سيتم اليوم اغلاق المصعد لأغراض الصيانة على الساعة السادسة مساء لمدة ساعة', | ||
title: | ||
' تنبيه لسكان البرج الكرام: نعلمكم بأنه سيتم اليوم اغلاق المصعد لأغراض الصيانة على الساعة السادسة مساء لمدة ساعة', | ||
start_date: '20/10/2022', | ||
end_date: '21/10/2022', | ||
}, | ||
{ | ||
title: 'اليوم سيتم الاحتفال بذكرى انشاء البرج الثالثة الساعة السابعة مساء على الروف نتمنى حضوركم', | ||
title: | ||
'اليوم سيتم الاحتفال بذكرى انشاء البرج الثالثة الساعة السابعة مساء على الروف نتمنى حضوركم', | ||
start_date: '20/10/2022', | ||
end_date: '21/10/2022', | ||
}, | ||
|
@@ -19,46 +91,50 @@ const announcements = [ | |
const advertisements = [ | ||
{ | ||
title: 'شقة متاحة', | ||
description: ' متاح لدينا شقة فارغة بمساحة 140 متر مربع تحتوي على 3 غرف نوم ومطبخ على الطابق الرابع للمزيد من المعلومات يرجى التواصل', | ||
description: | ||
' متاح لدينا شقة فارغة بمساحة 140 متر مربع تحتوي على 3 غرف نوم ومطبخ على الطابق الرابع للمزيد من المعلومات يرجى التواصل', | ||
start_date: '20/10/2022', | ||
end_date: '30/10/2022', | ||
image: 'https://images.pexels.com/photos/7534561/pexels-photo-7534561.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940', | ||
image: | ||
'https://images.pexels.com/photos/7534561/pexels-photo-7534561.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940', | ||
}, | ||
{ | ||
title: 'مطلوب عامل نظافة', | ||
description: 'البرج بحاجة الى عامل نظافة براتب 800 شيكل شهريا ', | ||
start_date: '20/10/2022', | ||
end_date: '30/10/2022', | ||
image: 'https://images.pexels.com/photos/6197123/pexels-photo-6197123.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', | ||
image: | ||
'https://images.pexels.com/photos/6197123/pexels-photo-6197123.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', | ||
}, | ||
{ | ||
title: 'شقة متاحة ', | ||
description: 'متاح لدينا شقة فارغة بمساحة 190 متر مربع تحتوي على 3 غرف نوم ومطبخ على الطابق الخامس للمزيد من المعلومات يرجى التواصل', | ||
description: | ||
'متاح لدينا شقة فارغة بمساحة 190 متر مربع تحتوي على 3 غرف نوم ومطبخ على الطابق الخامس للمزيد من المعلومات يرجى التواصل', | ||
start_date: '20/10/2022', | ||
end_date: '30/10/2022', | ||
image: 'https://images.pexels.com/photos/5417293/pexels-photo-5417293.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', | ||
image: | ||
'https://images.pexels.com/photos/5417293/pexels-photo-5417293.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', | ||
}, | ||
|
||
]; | ||
|
||
const complaints = [ | ||
{ | ||
title: 'شكوى رقم 1', | ||
description: 'تفاصيل الشكوى', | ||
is_solved: true, | ||
user_id: 1, | ||
UserId: 1, | ||
}, | ||
{ | ||
title: 'شكوى رقم 2', | ||
description: 'تفاصيل الشكوى', | ||
is_solved: true, | ||
user_id: 2, | ||
UserId: 2, | ||
}, | ||
{ | ||
title: 'شكوى رقم 3', | ||
description: 'تفاصيل الشكوى', | ||
is_solved: true, | ||
user_id: 3, | ||
UserId: 3, | ||
}, | ||
]; | ||
|
||
|
@@ -126,7 +202,7 @@ const services = [ | |
const bills = [ | ||
{ | ||
total_price: 315, | ||
flat_id: 1, | ||
FlatId: 1, | ||
is_open: true, | ||
services: [ | ||
{ | ||
|
@@ -168,7 +244,7 @@ const bills = [ | |
}, | ||
{ | ||
total_price: 370, | ||
flat_id: 2, | ||
FlatId: 2, | ||
is_open: true, | ||
services: [ | ||
{ | ||
|
@@ -210,7 +286,7 @@ const bills = [ | |
}, | ||
{ | ||
total_price: 255, | ||
flat_id: 3, | ||
FlatId: 3, | ||
is_open: true, | ||
services: [ | ||
{ | ||
|
@@ -252,7 +328,7 @@ const bills = [ | |
}, | ||
{ | ||
total_price: 355, | ||
flat_id: 4, | ||
FlatId: 4, | ||
is_open: true, | ||
services: [ | ||
{ | ||
|
@@ -301,31 +377,32 @@ const flats = [ | |
area: 180, | ||
notes: 'شقة غربية', | ||
is_active: true, | ||
owner_id: 1, | ||
UserId: 1, | ||
}, | ||
{ | ||
flat_number: 102, | ||
area: 160, | ||
notes: 'شقة جنوبية', | ||
is_active: true, | ||
owner_id: 2, | ||
UserId: 2, | ||
}, | ||
{ | ||
flat_number: 103, | ||
area: 120, | ||
notes: 'شقة شرقية', | ||
is_active: true, | ||
owner_id: 3, | ||
UserId: 3, | ||
}, | ||
{ | ||
flat_number: 104, | ||
area: 180, | ||
notes: 'شقة شمالية', | ||
is_active: true, | ||
owner_id: 4, | ||
UserId: 4, | ||
}, | ||
]; | ||
|
||
export { | ||
announcements, advertisements, services, bills, flats, complaints, contactUs, | ||
announcements, advertisements, services, bills, flats, users, payments, | ||
complaints, contactUs, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { | ||
DataTypes, | ||
} from 'sequelize'; | ||
import sequelize from '../database/config/connection'; | ||
|
||
const Payment = sequelize.define( | ||
'Payment', | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
}, | ||
title: { | ||
type: DataTypes.STRING, | ||
allowNull: false, | ||
}, | ||
description: { | ||
type: DataTypes.TEXT, | ||
allowNull: true, | ||
}, | ||
}, | ||
); | ||
|
||
export default Payment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { | ||
DataTypes, | ||
} from 'sequelize'; | ||
import sequelize from '../database/config/connection'; | ||
|
||
const User = sequelize.define( | ||
'User', | ||
{ | ||
id: { | ||
type: DataTypes.INTEGER, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
}, | ||
first_name: { | ||
type: DataTypes.STRING, | ||
allowNull: false, | ||
}, | ||
last_name: { | ||
type: DataTypes.STRING, | ||
allowNull: false, | ||
}, | ||
email: { | ||
type: DataTypes.STRING, | ||
allowNull: true, | ||
validate: { | ||
isEmail: true, | ||
}, | ||
}, | ||
phone_number: { | ||
type: DataTypes.STRING, | ||
unique: true, | ||
allowNull: false, | ||
}, | ||
role: { | ||
type: DataTypes.ENUM('admin', 'user'), | ||
allowNull: false, | ||
}, | ||
hased_password: { | ||
type: DataTypes.STRING, | ||
validate: { | ||
is: /^[0-9a-f]{64}$/i, | ||
}, | ||
allowNull: false, | ||
}, | ||
}, | ||
); | ||
|
||
export default User; |
Oops, something went wrong.