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

Global use of Faker (rather than Data) #36

Merged
merged 1 commit into from
May 28, 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
18 changes: 9 additions & 9 deletions src/data/demo/categories.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import CategoryData from '@data/faker/category';
import FakerCategory from '@data/faker/category';

const men: CategoryData = new CategoryData({
const men: FakerCategory = new FakerCategory({
id: 4,
name: 'Men',
description: 'T-shirts, sweaters, hoodies and men\'s accessories.',
position: 1,
displayed: true,
products: ['demo_1'],
});
const women: CategoryData = new CategoryData({
const women: FakerCategory = new FakerCategory({
id: 5,
name: 'Women',
description: 'T-shirts, sweaters, hoodies and women\'s accessories. From basics to original creations, '
Expand All @@ -17,15 +17,15 @@ const women: CategoryData = new CategoryData({
displayed: true,
products: ['demo_3'],
});
const stationnery: CategoryData = new CategoryData({
const stationnery: FakerCategory = new FakerCategory({
id: 7,
name: 'Stationery',
description: 'Notebooks, agendas, office accessories and more.',
position: 1,
displayed: true,
products: ['demo_8', 'demo_9', 'demo_10'],
});
const homeAccessories: CategoryData = new CategoryData({
const homeAccessories: FakerCategory = new FakerCategory({
id: 8,
name: 'Home Accessories',
description: 'Details matter! Liven up your interior with our selection of home accessories.',
Expand All @@ -35,15 +35,15 @@ const homeAccessories: CategoryData = new CategoryData({
});

export default {
home: new CategoryData({
home: new FakerCategory({
id: 2,
name: 'Home',
description: '',
metaTitle: '',
metaDescription: '',
displayed: true,
}),
clothes: new CategoryData({
clothes: new FakerCategory({
id: 3,
name: 'Clothes',
description: 'Discover our favorites fashionable discoveries, a selection of cool items to integrate in your '
Expand All @@ -58,7 +58,7 @@ export default {
}),
men,
women,
accessories: new CategoryData({
accessories: new FakerCategory({
id: 6,
name: 'Accessories',
description: 'Items and accessories for your desk',
Expand All @@ -72,7 +72,7 @@ export default {
}),
stationery: stationnery,
homeAccessories,
art: new CategoryData({
art: new FakerCategory({
id: 9,
name: 'Art',
description: 'Framed poster and vector images',
Expand Down
16 changes: 8 additions & 8 deletions src/data/demo/countries.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
import CountryData from '@data/faker/country';
import FakerCountry from '@data/faker/country';

export default {
france: new CountryData({
france: new FakerCountry({
id: 8,
name: 'France',
isoCode: 'FR',
callPrefix: '33',
zone: 'Europe',
active: true,
}),
netherlands: new CountryData({
netherlands: new FakerCountry({
id: 13,
name: 'Netherlands',
isoCode: 'NL',
callPrefix: '31',
zone: 'Europe',
active: false,
}),
unitedKingdom: new CountryData({
unitedKingdom: new FakerCountry({
id: 17,
name: 'United Kingdom',
isoCode: 'GB',
callPrefix: '44',
zone: 'Europe',
active: false,
}),
germany: new CountryData({
germany: new FakerCountry({
id: 1,
name: 'Germany',
isoCode: 'DE',
callPrefix: '49',
zone: 'Europe',
active: false,
}),
afghanistan: new CountryData({
afghanistan: new FakerCountry({
id: 231,
name: 'Afghanistan',
isoCode: 'AF',
callPrefix: '93',
zone: 'Asia',
active: false,
}),
unitedStates: new CountryData({
unitedStates: new FakerCountry({
id: 21,
name: 'United States',
isoCode: 'US',
callPrefix: '1',
zone: 'North America',
active: false,
}),
canada: new CountryData({
canada: new FakerCountry({
id: 4,
name: 'Canada',
isoCode: 'CA',
Expand Down
32 changes: 16 additions & 16 deletions src/data/demo/currencies.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CurrencyData from '@data/faker/currency';
import FakerCurrency from '@data/faker/currency';

export default {
euro: new CurrencyData({
euro: new FakerCurrency({
name: 'Euro',
frName: 'euro',
symbol: '€',
Expand All @@ -10,7 +10,7 @@ export default {
decimals: 2,
enabled: true,
}),
mad: new CurrencyData({
mad: new FakerCurrency({
name: 'Moroccan Dirham',
frName: 'dirham marocain',
symbol: 'MAD',
Expand All @@ -19,7 +19,7 @@ export default {
decimals: 2,
enabled: true,
}),
toman: new CurrencyData({
toman: new FakerCurrency({
name: 'Iranian toman',
frName: 'Toman iranien',
symbol: 'TMN',
Expand All @@ -28,7 +28,7 @@ export default {
decimals: 2,
enabled: true,
}),
chileanPeso: new CurrencyData({
chileanPeso: new FakerCurrency({
name: 'Chilean Peso',
frName: 'peso chilien',
symbol: '$',
Expand All @@ -37,7 +37,7 @@ export default {
decimals: 0,
enabled: true,
}),
dzd: new CurrencyData({
dzd: new FakerCurrency({
name: 'Algerian Dinar',
frName: 'dinar algérien',
symbol: 'DZD',
Expand All @@ -46,7 +46,7 @@ export default {
decimals: 2,
enabled: true,
}),
tnd: new CurrencyData({
tnd: new FakerCurrency({
name: 'Tunisian Dinar',
frName: 'dinar tunisien',
symbol: 'TND',
Expand All @@ -55,7 +55,7 @@ export default {
decimals: 3,
enabled: true,
}),
try: new CurrencyData({
try: new FakerCurrency({
name: 'Turkish Lira',
frName: 'livre turque',
symbol: '₺',
Expand All @@ -64,7 +64,7 @@ export default {
decimals: 2,
enabled: true,
}),
usd: new CurrencyData({
usd: new FakerCurrency({
name: 'US Dollar',
frName: 'dollar des États-Unis',
symbol: '$',
Expand All @@ -73,7 +73,7 @@ export default {
decimals: 2,
enabled: true,
}),
aed: new CurrencyData({
aed: new FakerCurrency({
name: 'United Arab Emirates Dirham',
frName: 'dirham des Émirats arabes unis',
symbol: 'AED',
Expand All @@ -82,7 +82,7 @@ export default {
decimals: 2,
enabled: true,
}),
lyd: new CurrencyData({
lyd: new FakerCurrency({
name: 'Libyan Dinar',
frName: 'dinar libyen',
symbol: 'LYD',
Expand All @@ -91,7 +91,7 @@ export default {
decimals: 3,
enabled: true,
}),
lsl: new CurrencyData({
lsl: new FakerCurrency({
name: 'Lesotho Loti',
frName: 'loti lesothan',
symbol: 'LSL',
Expand All @@ -100,7 +100,7 @@ export default {
decimals: 2,
enabled: true,
}),
all: new CurrencyData({
all: new FakerCurrency({
name: 'Albanian Lek',
frName: 'lek albanais',
symbol: 'ALL',
Expand All @@ -109,7 +109,7 @@ export default {
decimals: 0,
enabled: true,
}),
gbp: new CurrencyData({
gbp: new FakerCurrency({
name: 'British Pound',
frName: 'livre sterling',
symbol: 'GBP',
Expand All @@ -118,7 +118,7 @@ export default {
decimals: 2,
enabled: true,
}),
jpy: new CurrencyData({
jpy: new FakerCurrency({
name: 'Japanese Yen',
frName: 'yen japonais',
symbol: 'JPY',
Expand All @@ -127,7 +127,7 @@ export default {
decimals: 0,
enabled: true,
}),
pyg: new CurrencyData({
pyg: new FakerCurrency({
name: 'Paraguayan Guarani',
frName: 'guaraní paraguayen',
symbol: 'PYG',
Expand Down
4 changes: 2 additions & 2 deletions src/data/demo/customers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SocialTitles from '@data/demo/socialTitles';
import CustomerData from '@data/faker/customer';
import FakerCustomer from '@data/faker/customer';

export default {
johnDoe: new CustomerData({
johnDoe: new FakerCustomer({
id: 2,
socialTitle: SocialTitles.Mr.name,
firstName: 'John',
Expand Down
8 changes: 4 additions & 4 deletions src/data/demo/groups.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import GroupData from '@data/faker/group';
import FakerGroup from '@data/faker/group';

export default {
visitor: new GroupData({
visitor: new FakerGroup({
id: 1,
name: 'Visitor',
discount: 0,
shownPrices: true,
}),
guest: new GroupData({
guest: new FakerGroup({
id: 2,
name: 'Guest',
discount: 0,
shownPrices: true,
}),
customer: new GroupData({
customer: new FakerGroup({
id: 3,
name: 'Customer',
discount: 0,
Expand Down
30 changes: 15 additions & 15 deletions src/data/demo/modules.ts
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
import ModuleData from '@data/faker/module';
import FakerModule from '@data/faker/module';

export default {
blockwishlist: new ModuleData({
blockwishlist: new FakerModule({
tag: 'blockwishlist',
name: 'Wishlist',
}),
psApiResources: new ModuleData({
psApiResources: new FakerModule({
tag: 'ps_apiresources',
name: 'PrestaShop API Resources',
}),
psBanner: new ModuleData({
psBanner: new FakerModule({
tag: 'ps_banner',
name: 'Banner',
}),
psCashOnDelivery: new ModuleData({
psCashOnDelivery: new FakerModule({
tag: 'ps_cashondelivery',
name: 'Cash on delivery (COD)',
}),
psCheckPayment: new ModuleData({
psCheckPayment: new FakerModule({
tag: 'ps_checkpayment',
name: 'Payments by check',
}),
psEmailAlerts: new ModuleData({
psEmailAlerts: new FakerModule({
tag: 'ps_emailalerts',
name: 'Mail alerts',
releaseZip: 'https://github.com/PrestaShop/ps_emailalerts/releases/download/v2.4.2/ps_emailalerts.zip',
}),
psEmailSubscription: new ModuleData({
psEmailSubscription: new FakerModule({
tag: 'ps_emailsubscription',
name: 'Newsletter subscription',
}),
psFacetedSearch: new ModuleData({
psFacetedSearch: new FakerModule({
tag: 'ps_facetedsearch',
name: 'Faceted search',
releaseZip: 'https://github.com/PrestaShop/ps_facetedsearch/releases/download/v3.14.1/ps_facetedsearch.zip',
}),
psThemeCusto: new ModuleData({
psThemeCusto: new FakerModule({
tag: 'ps_themecusto',
name: 'Theme Customization',
}),
contactForm: new ModuleData({
contactForm: new FakerModule({
tag: 'contactform',
name: 'Contact form',
}),
themeCustomization: new ModuleData({
themeCustomization: new FakerModule({
tag: 'ps_themecusto',
name: 'Theme Customization',
}),
availableQuantities: new ModuleData({
availableQuantities: new FakerModule({
tag: 'statsstock',
name: 'Available quantities',
}),
mainMenu: new ModuleData({
mainMenu: new FakerModule({
tag: 'ps_mainmenu',
name: 'Main menu',
}),
keycloak: new ModuleData({
keycloak: new FakerModule({
tag: 'keycloak_connector_demo',
name: 'Keycloak OAuth2 connector demo',
releaseZip: 'https://github.com/PrestaShop/keycloak_connector_demo/releases/download/v1.0.4/keycloak_connector_demo.zip',
Expand Down
Loading
Loading