pure-orm 2.0.0 → 2.3.0

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.
Files changed (37) hide show
  1. package/README.md +36 -11
  2. package/examples/order-more/bo/customer.js +18 -0
  3. package/examples/order-more/bo/customers.js +9 -0
  4. package/examples/order-more/bo/line-item.js +33 -0
  5. package/examples/order-more/bo/line-items.js +9 -0
  6. package/examples/order-more/bo/order.js +49 -0
  7. package/examples/order-more/bo/orders.js +9 -0
  8. package/examples/order-more/bo/parcel-event.js +19 -0
  9. package/examples/order-more/bo/parcel-events.js +9 -0
  10. package/examples/order-more/bo/parcel-line-item.js +24 -0
  11. package/examples/order-more/bo/parcel-line-items.js +9 -0
  12. package/examples/order-more/bo/parcel.js +18 -0
  13. package/examples/order-more/bo/parcels.js +9 -0
  14. package/examples/order-more/bo/physical-address.js +30 -0
  15. package/examples/order-more/bo/physical-addresses.js +12 -0
  16. package/examples/order-more/bo/refund.js +28 -0
  17. package/examples/order-more/bo/refunds.js +9 -0
  18. package/examples/order-more/bo/utm-medium.js +13 -0
  19. package/examples/order-more/bo/utm-source.js +13 -0
  20. package/examples/order-more/business-objects.js +11 -1
  21. package/package.json +1 -1
  22. package/src/bo/base-bo.js +31 -18
  23. package/src/bo/base-bo.spec.js +180 -0
  24. package/test-utils/eleven/results.json +818 -0
  25. package/test-utils/nine/bo/base.js +5 -0
  26. package/test-utils/nine/bo/feature-switch.js +18 -0
  27. package/test-utils/nine/bo/feature-switches.js +12 -0
  28. package/test-utils/nine/business-objects.js +7 -0
  29. package/test-utils/nine/results.json +12 -0
  30. package/test-utils/ten/results.json +899 -0
  31. package/test-utils/twelve/bo/base.js +5 -0
  32. package/test-utils/twelve/bo/member.js +16 -0
  33. package/test-utils/twelve/bo/members.js +9 -0
  34. package/test-utils/twelve/bo/prompt.js +20 -0
  35. package/test-utils/twelve/bo/prompts.js +9 -0
  36. package/test-utils/twelve/business-objects.js +8 -0
  37. package/test-utils/twelve/results.json +8 -0
@@ -0,0 +1,5 @@
1
+ const { createBaseBO } = require('pure-orm');
2
+ const getBusinessObjects = require('../business-objects');
3
+
4
+ const constructor = createBaseBO({ getBusinessObjects });
5
+ module.exports = constructor;
@@ -0,0 +1,18 @@
1
+ const Base = require('./base');
2
+ const FeatureSwitches = require('./feature-switches');
3
+
4
+ class FeatureSwitch extends Base {
5
+ get BoCollection() {
6
+ return FeatureSwitches;
7
+ }
8
+
9
+ static get tableName() {
10
+ return 'feature_switch';
11
+ }
12
+
13
+ static get sqlColumnsData() {
14
+ return ['id', 'label', 'on'];
15
+ }
16
+ }
17
+
18
+ module.exports = FeatureSwitch;
@@ -0,0 +1,12 @@
1
+ const { BaseBoCollection } = require('../../../src/index');
2
+
3
+ class FeatureSwitches extends BaseBoCollection {
4
+ static get displayName() {
5
+ return 'featureSwitches';
6
+ }
7
+ static get Bo() {
8
+ return require('./feature-switch'); // eslint-disable-line
9
+ }
10
+ }
11
+
12
+ module.exports = FeatureSwitches;
@@ -0,0 +1,7 @@
1
+ /* eslint-disable global-require */
2
+ const getBusinessObjects = () => [
3
+ // These need to be imported here to get around circular dependencies
4
+ require('./bo/feature-switch')
5
+ ];
6
+
7
+ module.exports = getBusinessObjects;
@@ -0,0 +1,12 @@
1
+ [
2
+ {
3
+ "feature_switch#id": "google_one_tap_sign_in",
4
+ "feature_switch#label": "Google One Tap Sign In",
5
+ "feature_switch#on": true
6
+ },
7
+ {
8
+ "feature_switch#id": "website_live_chat",
9
+ "feature_switch#label": "Website Live Chat",
10
+ "feature_switch#on": false
11
+ }
12
+ ]