-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmockData.js
More file actions
64 lines (56 loc) · 1.84 KB
/
mockData.js
File metadata and controls
64 lines (56 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* eslint-disable camelcase */
import range from 'lodash/range';
import faker from 'faker';
import md5 from 'md5';
const createdBefore = parseInt(Math.random() * 1000);
export const addressesTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
address1: faker.address.streetName(),
address2: faker.address.streetAddress(),
city: faker.address.city(),
country: faker.address.country(),
latitude: faker.address.latitude(),
longitude: faker.address.longitude()
}));
export const usersTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
email: faker.internet.email(),
password: md5(faker.internet.password()),
created_at: faker.date.recent(createdBefore)
}));
export const productsTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
name: faker.commerce.productName(),
category: 'Sports',
amount: faker.commerce.price()
}));
export const purchasedProductsTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
productId: (index + 1).toString(),
price: 500,
discount: faker.datatype.number(20),
deliveryDate: faker.date.recent(createdBefore),
storeId: (index + 2).toString()
}));
export const storesTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
name: faker.company.companyName(),
addressId: index + 1
}));
export const storeProductsTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
productId: index + 1,
storeId: index + 1
}));
export const suppliersTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
name: faker.company.companyName(),
addressId: index + 1
}));
export const supplierProductsTable = range(1, 10).map((_, index) => ({
id: (index + 1).toString(),
productId: index + 1,
supplierId: index + 1
}));