@reactionary/fake 0.10.25 → 0.10.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,6 +40,7 @@ class FakeProductCapability extends ProductCapability {
40
40
  seed: 42,
41
41
  locale: [en, base]
42
42
  });
43
+ const isOrganic = generator.datatype.boolean({ probability: 0.2 });
43
44
  const result = {
44
45
  identifier: {
45
46
  key: body
@@ -66,7 +67,35 @@ class FakeProductCapability extends ProductCapability {
66
67
  parentCategories: [],
67
68
  published: true,
68
69
  sharedAttributes: [],
69
- variants: []
70
+ variants: [],
71
+ complianceData: {
72
+ ce_marking: generator.datatype.boolean({ probability: 0.2 }),
73
+ weee_symbol: generator.datatype.boolean({ probability: 0.2 }),
74
+ additional_disclosures: generator.datatype.boolean({ probability: 0.2 }) ? generator.lorem.sentence() : void 0,
75
+ composition: generator.datatype.boolean({ probability: 0.2 }) ? generator.lorem.sentence() : void 0,
76
+ energy_class: generator.datatype.boolean({ probability: 0.2 }) ? ["A", "B", "C", "D", "E", "F", "G"].at(generator.number.int({ min: 0, max: 6 })) : void 0,
77
+ garan_duration: generator.datatype.boolean({ probability: 0.1 }) ? generator.number.int({ min: 3, max: 5 }) * 12 : void 0,
78
+ organic: {
79
+ is_organic: isOrganic,
80
+ certificate_url: isOrganic ? generator.internet.url() : void 0,
81
+ agriculture_origin: isOrganic ? generator.location.country() : void 0,
82
+ control_body_code: isOrganic ? "DKK-OEK-" + generator.number.int({ min: 1e3, max: 9999 }) : void 0,
83
+ certification_type: isOrganic ? ["EU_ORGANIC_LEAF", "GOTS", "ECOCERT"].at(generator.number.int({ min: 0, max: 2 })) : void 0
84
+ },
85
+ traceability: {
86
+ product_identifier: "BATCH-" + generator.number.int({ min: 1e3, max: 9999 }),
87
+ manufacturer: {
88
+ name: generator.company.name(),
89
+ postal_address: generator.address.streetAddress() + " " + generator.address.country() + "-" + generator.address.zipCode() + " " + generator.address.city(),
90
+ electronic_address: generator.internet.email({ provider: "example.com" })
91
+ },
92
+ eu_responsible_person: {
93
+ name: generator.company.name(),
94
+ postal_address: generator.address.streetAddress() + " " + generator.address.country() + "-" + generator.address.zipCode() + " " + generator.address.city(),
95
+ electronic_address: generator.internet.email({ provider: "example.com" })
96
+ }
97
+ }
98
+ }
70
99
  };
71
100
  return this.factory.parseProduct(this.context, result);
72
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/fake",
3
- "version": "0.10.25",
3
+ "version": "0.10.26",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/Solteq/reactionary.git"
10
10
  },
11
11
  "dependencies": {
12
- "@reactionary/core": "0.10.25",
12
+ "@reactionary/core": "0.10.26",
13
13
  "zod": "4.1.9",
14
14
  "@faker-js/faker": "^9.8.0"
15
15
  },