Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate @data/demo from Core #42

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/data/demo/addresses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import FakerAddress from '@data/faker/address';

export default {
address_1: new FakerAddress({
id: 1,
firstName: 'Anonymous',
lastName: 'Anonymous',
address: 'Anonymous',
postalCode: '00000',
city: 'Anonymous',
country: 'France',
}),
address_2: new FakerAddress({
id: 2,
name: 'Mon adresse',
firstName: 'John',
lastName: 'DOE',
company: 'My Company',
address: '16, Main street',
secondAddress: '2nd floor',
postalCode: '75002',
city: 'Paris',
country: 'France',
phone: '0102030405',
}),
address_5: new FakerAddress({
id: 5,
dni: '',
alias: 'My address',
firstName: 'John',
lastName: 'DOE',
company: 'My Company',
vatNumber: '',
address: '16, Main street',
secondAddress: '2nd floor',
postalCode: '33133',
city: 'Miami',
state: 'Florida',
country: 'United States',
phone: '0102030405',
other: '',
}),
};
128 changes: 128 additions & 0 deletions src/data/demo/attributes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import AttributeData from '@data/faker/attribute';
import AttributeValueData from '@data/faker/attributeValue';

export default {
size: new AttributeData({
id: 1,
name: 'Size',
values: [
// 0 : small
new AttributeValueData({
id: 1,
value: 'S',
position: 1,
}),
// 1 : medium
new AttributeValueData({
id: 1,
value: 'M',
position: 1,
}),
// 2 : large
new AttributeValueData({
id: 1,
value: 'L',
position: 1,
}),
// 3 : xLarge
new AttributeValueData({
id: 1,
value: 'XL',
position: 1,
}),
],
position: 1,
}),
color: new AttributeData({
id: 2,
name: 'Color',
values: [
// 0 : grey
new AttributeValueData({
id: 5, value: 'Grey', color: '#AAB2BD', position: 1,
}),
// 1 : taupe
new AttributeValueData({
id: 6, value: 'Taupe', color: '#CFC4A6', position: 2,
}),
// 2 : beige
new AttributeValueData({
id: 7, value: 'Beige', color: '#f5f5dc', position: 3,
}),
// 3 : white
new AttributeValueData({
id: 8, value: 'White', color: '#ffffff', position: 4,
}),
// 4 : offWhite
new AttributeValueData({
id: 9, value: 'Off White', color: '#faebd7', position: 5,
}),
// 5 : red
new AttributeValueData({
id: 10, value: 'Red', color: '#E84C3D', position: 6,
}),
// 6 : black
new AttributeValueData({
id: 11, value: 'Black', color: '#434A54', position: 7,
}),
// 7 : camel
new AttributeValueData({
id: 12, value: 'Camel', color: '#C19A6B', position: 8,
}),
// 8 : orange
new AttributeValueData({
id: 13, value: 'Orange', color: '#F39C11', position: 9,
}),
// 9 : blue
new AttributeValueData({
id: 14, value: 'Blue', color: '#5D9CEC', position: 10,
}),
// 10 : green
new AttributeValueData({
id: 15, value: 'Green', color: '#A0D468', position: 11,
}),
// 11 : yellow
new AttributeValueData({
id: 16, value: 'Yellow', color: '#F1C40F', position: 12,
}),
// 12 : brown
new AttributeValueData({
id: 17, value: 'Brown', color: '#964B00', position: 13,
}),
// 13 : pink
new AttributeValueData({
id: 18, value: 'Pink', color: '#FCCACD', position: 14,
}),
],
position: 2,
}),
dimension: new AttributeData({
id: 3,
name: 'Dimension',
values: [
// 0 : first
new AttributeValueData({id: 19, value: '40*60cm', position: 1}),
// 1 : second
new AttributeValueData({id: 20, value: '60*90cm', position: 2}),
// 2 : third
new AttributeValueData({id: 21, value: '80*120cm', position: 3}),
],
position: 3,
}),
paperType: new AttributeData({
id: 4,
name: 'Paper Type',
values: [
// 0 : ruled
new AttributeValueData({id: 22, value: 'Rules', position: 1}),
// 1 : plain
new AttributeValueData({id: 23, value: 'Plain', position: 2}),
// 2 : squared
new AttributeValueData({id: 24, value: 'Squared', position: 3}),
// 3 : doted
new AttributeValueData({id: 25, value: 'Doted', position: 4}),
],
position: 4,
displayed: true,
}),
};
7 changes: 7 additions & 0 deletions src/data/demo/boPages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
pages: [
'Dashboard',
'Orders',
'Products',
],
};
22 changes: 22 additions & 0 deletions src/data/demo/brandAdresses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import BrandAddressData from '@data/faker/brandAddress';

export default {
brandAddress_3: new BrandAddressData({
id: 3,
brandName: '',
firstName: 'supplier',
lastName: 'supplier',
postalCode: '10153',
city: 'New York',
country: 'United States',
}),
brandAddress_4: new BrandAddressData({
id: 4,
brandName: 'Studio Design',
firstName: 'manufacturer',
lastName: 'manufacturer',
postalCode: '10154',
city: 'New York',
country: 'United States',
}),
};
18 changes: 18 additions & 0 deletions src/data/demo/brands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import BrandData from '@data/faker/brand';

export default {
brand_1: new BrandData({
id: 1,
name: 'Studio Design',
addresses: 1,
products: 9,
enabled: true,
}),
brand_2: new BrandData({
id: 2,
name: 'Graphic Corner',
addresses: 0,
products: 9,
enabled: true,
}),
};
39 changes: 39 additions & 0 deletions src/data/demo/carriers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import FakerCarrier from '@data/faker/carrier';

export default {
clickAndCollect: new FakerCarrier({
id: 1,
name: 'Click and collect',
delay: 'Pick up in-store',
enable: true,
freeShipping: true,
position: 1,
}),
myCarrier: new FakerCarrier({
id: 2,
name: 'My carrier',
delay: 'Delivery next day!',
priceTTC: 8.40,
price: 7.00,
enable: true,
freeShipping: false,
position: 2,
}),
myCheapCarrier: new FakerCarrier({
id: 3,
name: 'My cheap carrier',
delay: 'Buy more to pay less!',
enable: false,
freeShipping: false,
priceTTC: 6.00,
position: 3,
}),
myLightCarrier: new FakerCarrier({
id: 4,
name: 'My light carrier',
delay: 'The lighter the cheaper!',
enable: false,
freeShipping: false,
position: 4,
}),
};
44 changes: 44 additions & 0 deletions src/data/demo/cmsPage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import FakerCMSPage from '@data/faker/cmsPage';

export default {
delivery: new FakerCMSPage({
id: 1,
url: 'delivery',
title: 'Delivery',
metaTitle: '',
position: 1,
displayed: true,
}),
legalNotice: new FakerCMSPage({
id: 2,
url: 'legal-notice',
title: 'Legal Notice',
metaTitle: '',
position: 2,
displayed: true,
}),
termsAndCondition: new FakerCMSPage({
id: 3,
url: 'terms-and-conditions-of-use',
title: 'Terms and conditions of use',
metaTitle: '',
position: 3,
displayed: true,
}),
aboutUs: new FakerCMSPage({
id: 4,
url: 'about-us',
title: 'About us',
metaTitle: '',
position: 4,
displayed: true,
}),
securePayment: new FakerCMSPage({
id: 5,
url: 'secure-payment',
title: 'Secure payment',
metaTitle: '',
position: 5,
displayed: true,
}),
};
16 changes: 16 additions & 0 deletions src/data/demo/contacts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import FakerContact from '@data/faker/contact';

export default {
webmaster: new FakerContact({
id: 1,
title: 'Webmaster',
email: '[email protected]',
description: 'If a technical problem occurs on this website',
}),
customerService: new FakerContact({
id: 2,
title: 'Customer service',
email: '[email protected]',
description: 'For any question about a product, an order',
}),
};
16 changes: 16 additions & 0 deletions src/data/demo/employeeRoles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import FakerEmployeeRole from '@data/faker/employeeRole';

export default [
new FakerEmployeeRole({
name: 'SuperAdmin',
}),
new FakerEmployeeRole({
name: 'Logistician',
}),
new FakerEmployeeRole({
name: 'Translator',
}),
new FakerEmployeeRole({
name: 'Salesman',
}),
];
14 changes: 14 additions & 0 deletions src/data/demo/employees.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import FakerEmployee from '@data/faker/employee';

export default {
defaultEmployee: new FakerEmployee({
id: 1,
firstName: global.BO.FIRSTNAME,
lastName: global.BO.LASTNAME,
email: global.BO.EMAIL,
password: global.BO.PASSWD,
defaultPage: 'Dashboard',
language: 'English (English)',
active: true,
}),
};
42 changes: 42 additions & 0 deletions src/data/demo/features.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import FakerFeature from '@data/faker/feature';
import FakerFeatureValue from '@data/faker/featureValue';

export default {
composition: new FakerFeature({
id: 1,
position: 1,
name: 'Composition',
values: [
new FakerFeatureValue({
id: 1,
value: 'Polyester',
}),
new FakerFeatureValue({
id: 2,
value: 'Wool',
}),
new FakerFeatureValue({
id: 3,
value: 'Ceramic',
}),
new FakerFeatureValue({
id: 4,
value: 'Cotton',
}),
new FakerFeatureValue({
id: 5,
value: 'Recycled cardboard',
}),
new FakerFeatureValue({
id: 6,
value: 'Matt paper',
}),
],
}),
property: new FakerFeature({
id: 2,
position: 2,
name: 'Property',
values: [],
}),
};
Loading
Loading