Skip to content

Commit 0007aa0

Browse files
authored
Merge pull request #172 from Progi1984/fa
`FakerShop` : Add id & theme
2 parents 081ff16 + 6a67a24 commit 0007aa0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/data/faker/shop.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {faker} from '@faker-js/faker';
77
* @class
88
*/
99
export default class FakerShop {
10+
public id: number;
11+
1012
public readonly name: string;
1113

1214
public readonly shopGroup: string;
@@ -15,11 +17,16 @@ export default class FakerShop {
1517

1618
public readonly categoryRoot: string;
1719

20+
public readonly theme: string;
21+
1822
/**
1923
* Constructor for class ShopGroupData
2024
* @param shopToCreate {ShopCreator} Could be used to force the value of some members
2125
*/
2226
constructor(shopToCreate: ShopCreator) {
27+
/** @type {number} ID of the shop */
28+
this.id = 0;
29+
2330
/** @type {string} Name of the shop */
2431
this.name = shopToCreate.name || `shop_${faker.lorem.word()}`;
2532

@@ -31,5 +38,17 @@ export default class FakerShop {
3138

3239
/** @type {string} Root category of the shop */
3340
this.categoryRoot = shopToCreate.categoryRoot;
41+
42+
/** @type {string} Front Theme of the shop */
43+
this.theme = shopToCreate.theme || 'classic';
44+
}
45+
46+
/**
47+
* @param {number} id
48+
*/
49+
setID(id: number): this {
50+
this.id = id;
51+
52+
return this;
3453
}
3554
}

src/data/types/shop.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ type ShopCreator = {
33
shopGroup: string
44
color?: string
55
categoryRoot: string
6+
theme?: string
67
};
78

89
export default ShopCreator;

0 commit comments

Comments
 (0)