@reactionary/source 0.0.41 → 0.0.48

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 (125) hide show
  1. package/.claude/settings.local.json +28 -0
  2. package/.env-template +8 -5
  3. package/.vscode/settings.json +5 -0
  4. package/README.md +41 -0
  5. package/core/package.json +3 -1
  6. package/core/src/cache/cache.interface.ts +14 -18
  7. package/core/src/cache/memory-cache.ts +56 -0
  8. package/core/src/cache/noop-cache.ts +5 -23
  9. package/core/src/cache/redis-cache.ts +28 -38
  10. package/core/src/client/client-builder.ts +3 -3
  11. package/core/src/client/client.ts +11 -9
  12. package/core/src/decorators/reactionary.decorator.ts +80 -8
  13. package/core/src/index.ts +5 -29
  14. package/core/src/initialization.ts +43 -0
  15. package/core/src/providers/analytics.provider.ts +1 -1
  16. package/core/src/providers/base.provider.ts +61 -25
  17. package/core/src/providers/cart-payment.provider.ts +57 -0
  18. package/core/src/providers/cart.provider.ts +131 -8
  19. package/core/src/providers/category.provider.ts +9 -9
  20. package/core/src/providers/identity.provider.ts +8 -7
  21. package/core/src/providers/index.ts +12 -0
  22. package/core/src/providers/inventory.provider.ts +4 -4
  23. package/core/src/providers/price.provider.ts +7 -7
  24. package/core/src/providers/product.provider.ts +17 -5
  25. package/core/src/providers/profile.provider.ts +22 -0
  26. package/core/src/providers/search.provider.ts +4 -4
  27. package/core/src/providers/store.provider.ts +14 -0
  28. package/core/src/schemas/capabilities.schema.ts +3 -1
  29. package/core/src/schemas/models/analytics.model.ts +1 -1
  30. package/core/src/schemas/models/cart.model.ts +16 -3
  31. package/core/src/schemas/models/identifiers.model.ts +90 -22
  32. package/core/src/schemas/models/identity.model.ts +23 -7
  33. package/core/src/schemas/models/index.ts +15 -0
  34. package/core/src/schemas/models/payment.model.ts +41 -0
  35. package/core/src/schemas/models/profile.model.ts +35 -0
  36. package/core/src/schemas/models/shipping-method.model.ts +14 -0
  37. package/core/src/schemas/models/store.model.ts +11 -0
  38. package/core/src/schemas/mutations/cart-payment.mutation.ts +21 -0
  39. package/core/src/schemas/mutations/cart.mutation.ts +62 -3
  40. package/core/src/schemas/mutations/identity.mutation.ts +8 -1
  41. package/core/src/schemas/mutations/index.ts +10 -0
  42. package/core/src/schemas/mutations/profile.mutation.ts +9 -0
  43. package/core/src/schemas/queries/cart-payment.query.ts +12 -0
  44. package/core/src/schemas/queries/cart.query.ts +1 -1
  45. package/core/src/schemas/queries/identity.query.ts +1 -1
  46. package/core/src/schemas/queries/index.ts +3 -0
  47. package/core/src/schemas/queries/inventory.query.ts +4 -12
  48. package/core/src/schemas/queries/price.query.ts +1 -1
  49. package/core/src/schemas/queries/profile.query.ts +7 -0
  50. package/core/src/schemas/queries/search.query.ts +1 -1
  51. package/core/src/schemas/queries/store.query.ts +11 -0
  52. package/core/src/schemas/session.schema.ts +31 -6
  53. package/eslint.config.mjs +7 -0
  54. package/examples/next/src/app/page.tsx +4 -12
  55. package/examples/node/package.json +1 -3
  56. package/examples/node/src/basic/basic-node-provider-model-extension.spec.ts +9 -8
  57. package/examples/node/src/basic/basic-node-provider-query-extension.spec.ts +4 -3
  58. package/examples/node/src/basic/basic-node-setup.spec.ts +4 -5
  59. package/nx.json +1 -0
  60. package/otel/src/metrics.ts +2 -1
  61. package/otel/src/provider-instrumentation.ts +2 -1
  62. package/otel/src/tracer.ts +7 -6
  63. package/otel/src/trpc-middleware.ts +3 -2
  64. package/package.json +2 -1
  65. package/providers/algolia/src/core/initialize.ts +4 -3
  66. package/providers/algolia/src/providers/product.provider.ts +15 -13
  67. package/providers/algolia/src/providers/search.provider.ts +9 -9
  68. package/providers/algolia/src/schema/capabilities.schema.ts +1 -1
  69. package/providers/algolia/src/test/search.provider.spec.ts +10 -10
  70. package/providers/algolia/src/test/test-utils.ts +9 -4
  71. package/providers/commercetools/README.md +27 -0
  72. package/providers/commercetools/src/core/client.ts +164 -117
  73. package/providers/commercetools/src/core/initialize.ts +24 -14
  74. package/providers/commercetools/src/providers/cart-payment.provider.ts +193 -0
  75. package/providers/commercetools/src/providers/cart.provider.ts +402 -125
  76. package/providers/commercetools/src/providers/category.provider.ts +35 -35
  77. package/providers/commercetools/src/providers/identity.provider.ts +23 -75
  78. package/providers/commercetools/src/providers/index.ts +2 -0
  79. package/providers/commercetools/src/providers/inventory.provider.ts +69 -40
  80. package/providers/commercetools/src/providers/price.provider.ts +79 -47
  81. package/providers/commercetools/src/providers/product.provider.ts +36 -30
  82. package/providers/commercetools/src/providers/profile.provider.ts +61 -0
  83. package/providers/commercetools/src/providers/search.provider.ts +16 -12
  84. package/providers/commercetools/src/providers/store.provider.ts +78 -0
  85. package/providers/commercetools/src/schema/capabilities.schema.ts +3 -1
  86. package/providers/commercetools/src/schema/commercetools.schema.ts +18 -0
  87. package/providers/commercetools/src/schema/configuration.schema.ts +2 -1
  88. package/providers/commercetools/src/test/cart-payment.provider.spec.ts +145 -0
  89. package/providers/commercetools/src/test/cart.provider.spec.ts +82 -22
  90. package/providers/commercetools/src/test/category.provider.spec.ts +18 -17
  91. package/providers/commercetools/src/test/identity.provider.spec.ts +88 -0
  92. package/providers/commercetools/src/test/inventory.provider.spec.ts +41 -0
  93. package/providers/commercetools/src/test/price.provider.spec.ts +9 -8
  94. package/providers/commercetools/src/test/product.provider.spec.ts +33 -5
  95. package/providers/commercetools/src/test/profile.provider.spec.ts +49 -0
  96. package/providers/commercetools/src/test/search.provider.spec.ts +8 -7
  97. package/providers/commercetools/src/test/store.provider.spec.ts +37 -0
  98. package/providers/commercetools/src/test/test-utils.ts +7 -31
  99. package/providers/fake/src/core/initialize.ts +96 -38
  100. package/providers/fake/src/providers/analytics.provider.ts +6 -5
  101. package/providers/fake/src/providers/cart.provider.ts +66 -19
  102. package/providers/fake/src/providers/category.provider.ts +12 -12
  103. package/providers/fake/src/providers/identity.provider.ts +22 -14
  104. package/providers/fake/src/providers/index.ts +1 -0
  105. package/providers/fake/src/providers/inventory.provider.ts +13 -13
  106. package/providers/fake/src/providers/price.provider.ts +13 -13
  107. package/providers/fake/src/providers/product.provider.ts +13 -10
  108. package/providers/fake/src/providers/search.provider.ts +7 -5
  109. package/providers/fake/src/providers/store.provider.ts +47 -0
  110. package/providers/fake/src/schema/capabilities.schema.ts +4 -1
  111. package/providers/fake/src/test/cart.provider.spec.ts +18 -18
  112. package/providers/fake/src/test/category.provider.spec.ts +55 -37
  113. package/providers/fake/src/test/price.provider.spec.ts +9 -14
  114. package/providers/fake/src/test/product.provider.spec.ts +27 -0
  115. package/providers/fake/src/test/test-utils.ts +2 -28
  116. package/providers/posthog/src/core/initialize.ts +3 -3
  117. package/providers/posthog/src/schema/capabilities.schema.ts +1 -1
  118. package/trpc/src/client.ts +42 -41
  119. package/trpc/src/index.ts +4 -3
  120. package/trpc/src/integration.spec.ts +11 -11
  121. package/trpc/src/server.ts +26 -24
  122. package/trpc/src/test-utils.ts +9 -4
  123. package/trpc/src/types.ts +24 -22
  124. package/core/src/cache/cache-evaluation.interface.ts +0 -19
  125. package/examples/node/src/test-utils.ts +0 -26
@@ -1,5 +1,5 @@
1
1
  import styles from './page.module.scss';
2
- import { ClientBuilder, NoOpCache, SessionSchema } from '@reactionary/core';
2
+ import { ClientBuilder, createInitialRequestContext, NoOpCache, SessionSchema } from '@reactionary/core';
3
3
  import { withFakeCapabilities } from '@reactionary/provider-fake';
4
4
  import { withCommercetoolsCapabilities } from '@reactionary/provider-commercetools';
5
5
 
@@ -23,17 +23,9 @@ export default async function Index() {
23
23
  )
24
24
  .withCache(new NoOpCache())
25
25
  .build();
26
-
27
-
28
- const session = SessionSchema.parse({
29
- id: '1234567890',
30
- languageContext: {
31
- countryCode: 'US',
32
- languageCode: 'en',
33
- currencyCode: 'USD',
34
- },
35
- });
36
26
 
27
+ const reqCtx = createInitialRequestContext();
28
+ reqCtx.correlationId = 'nextjs-request-' + (new Date().getTime());
37
29
  const search = await client.search.queryByTerm(
38
30
  {
39
31
  search: {
@@ -43,7 +35,7 @@ export default async function Index() {
43
35
  term: 'glass',
44
36
  },
45
37
  },
46
- session
38
+ reqCtx
47
39
  );
48
40
 
49
41
  return (
@@ -2,7 +2,5 @@
2
2
  "name": "@reactionary/examples-node",
3
3
  "version": "0.0.1",
4
4
  "private": true,
5
- "dependencies": {
6
- "@reactionary/core": "0.0.1"
7
- }
5
+ "dependencies": {}
8
6
  }
@@ -1,20 +1,21 @@
1
+ import type {
2
+ Cache,
3
+ ProductQueryById,
4
+ ProductQueryBySlug} from '@reactionary/core';
1
5
  import {
2
6
  ClientBuilder,
3
- Cache,
4
7
  NoOpCache,
5
- ProductSchema,
6
- ProductQueryById,
7
- ProductQueryBySlug,
8
+ ProductSchema
8
9
  } from '@reactionary/core';
9
10
  import {
10
11
  FakeProductProvider,
11
12
  withFakeCapabilities,
12
13
  } from '@reactionary/provider-fake';
13
- import { createAnonymousTestSession } from '../test-utils';
14
+ import { createInitialRequestContext } from '@reactionary/core'
14
15
  import z from 'zod';
15
16
 
16
17
  describe('basic node provider extension (models)', () => {
17
- const session = createAnonymousTestSession();
18
+ const reqCtx = createInitialRequestContext();
18
19
 
19
20
  const ExtendedProductModel = ProductSchema.extend({
20
21
  gtin: z.string().default('gtin-default'),
@@ -83,7 +84,7 @@ describe('basic node provider extension (models)', () => {
83
84
  {
84
85
  slug: '1234',
85
86
  },
86
- session
87
+ reqCtx
87
88
  );
88
89
 
89
90
  expect(product).toBeDefined();
@@ -95,7 +96,7 @@ describe('basic node provider extension (models)', () => {
95
96
  {
96
97
  id: '1234',
97
98
  },
98
- session
99
+ reqCtx
99
100
  );
100
101
 
101
102
  expect(product).toBeDefined();
@@ -1,9 +1,10 @@
1
+ import type {
2
+ Cache,
3
+ Product} from '@reactionary/core';
1
4
  import {
2
5
  ClientBuilder,
3
- Cache,
4
6
  NoOpCache,
5
- ProductSchema,
6
- Product,
7
+ ProductSchema
7
8
  } from '@reactionary/core';
8
9
  import {
9
10
  FakeProductProvider,
@@ -1,6 +1,5 @@
1
- import { buildClient, NoOpCache, SessionSchema } from '@reactionary/core';
1
+ import { buildClient, createInitialRequestContext, NoOpCache, SessionSchema } from '@reactionary/core';
2
2
  import { withFakeCapabilities } from '@reactionary/provider-fake';
3
- import { createAnonymousTestSession } from '../test-utils';
4
3
 
5
4
  describe('basic node setup', () => {
6
5
  const client = buildClient(
@@ -25,7 +24,7 @@ describe('basic node setup', () => {
25
24
  }
26
25
  );
27
26
 
28
- const session = createAnonymousTestSession();
27
+ const reqCtx = createInitialRequestContext();
29
28
 
30
29
  it('should only get back the enabled capabilities', async () => {
31
30
  expect(client.product).toBeDefined();
@@ -35,9 +34,9 @@ describe('basic node setup', () => {
35
34
  it('should be able to call the enabled capabilities', async () => {
36
35
  const product = await client.product.getBySlug({
37
36
  slug: '1234'
38
- }, session);
37
+ }, reqCtx);
39
38
 
40
39
  expect(product).toBeDefined();
41
- expect(product.slug).toBe('1234');
40
+ expect(product!.slug).toBe('1234');
42
41
  });
43
42
  });
package/nx.json CHANGED
@@ -66,6 +66,7 @@
66
66
  }
67
67
  },
68
68
  "release": {
69
+ "projectsRelationship": "fixed",
69
70
  "git": {
70
71
  "commit": false,
71
72
  "stageChanges": false,
@@ -1,4 +1,5 @@
1
- import { metrics, Meter, Counter, Histogram, UpDownCounter } from '@opentelemetry/api';
1
+ import type { Meter, Counter, Histogram, UpDownCounter } from '@opentelemetry/api';
2
+ import { metrics } from '@opentelemetry/api';
2
3
 
3
4
  const METER_NAME = '@reactionary/otel';
4
5
  const METER_VERSION = '0.0.1';
@@ -1,4 +1,5 @@
1
- import { Span, SpanKind } from '@opentelemetry/api';
1
+ import type { Span} from '@opentelemetry/api';
2
+ import { SpanKind } from '@opentelemetry/api';
2
3
  import { withSpan, setSpanAttributes } from './tracer';
3
4
  import { getMetrics } from './metrics';
4
5
 
@@ -1,12 +1,13 @@
1
- import {
2
- trace,
1
+ import type {
3
2
  Tracer,
4
- Span,
5
- SpanStatusCode,
6
- context as otelContext,
3
+ Span,
7
4
  Context,
8
5
  SpanOptions,
9
- Attributes,
6
+ Attributes} from '@opentelemetry/api';
7
+ import {
8
+ trace,
9
+ SpanStatusCode,
10
+ context as otelContext
10
11
  } from '@opentelemetry/api';
11
12
 
12
13
  const TRACER_NAME = '@reactionary/otel';
@@ -1,6 +1,7 @@
1
1
  import { TRPCError } from '@trpc/server';
2
- import {
3
- Span,
2
+ import type {
3
+ Span} from '@opentelemetry/api';
4
+ import {
4
5
  SpanKind,
5
6
  SpanStatusCode,
6
7
  } from '@opentelemetry/api';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/source",
3
- "version": "0.0.41",
3
+ "version": "0.0.48",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -39,6 +39,7 @@
39
39
  "express-session": "^1.18.1",
40
40
  "ioredis": "^5.6.1",
41
41
  "next": "~15.2.4",
42
+ "node-object-hash": "^3.1.1",
42
43
  "posthog-node": "^4.18.0",
43
44
  "react": "19.0.0",
44
45
  "react-dom": "19.0.0",
@@ -1,8 +1,9 @@
1
- import { Client, ProductSchema, Cache } from "@reactionary/core";
1
+ import type { Client, Cache } from "@reactionary/core";
2
+ import { ProductSchema } from "@reactionary/core";
2
3
  import { AlgoliaProductProvider } from "../providers/product.provider";
3
4
  import { AlgoliaSearchProvider } from "../providers/search.provider";
4
- import { AlgoliaCapabilities } from "../schema/capabilities.schema";
5
- import { AlgoliaConfiguration } from "../schema/configuration.schema";
5
+ import type { AlgoliaCapabilities } from "../schema/capabilities.schema";
6
+ import type { AlgoliaConfiguration } from "../schema/configuration.schema";
6
7
  import { AlgoliaSearchResultSchema } from "../schema/search.schema";
7
8
 
8
9
  export function withAlgoliaCapabilities(configuration: AlgoliaConfiguration, capabilities: AlgoliaCapabilities) {
@@ -1,13 +1,15 @@
1
- import {
2
- Product,
3
- ProductProvider,
4
- ProductQueryById,
5
- ProductQueryBySlug,
6
- Session,
7
- Cache
1
+ import type {
2
+ Product,
3
+ ProductQueryById,
4
+ ProductQueryBySlug,
5
+ RequestContext,
6
+ Cache
8
7
  } from '@reactionary/core';
9
- import { z } from 'zod';
10
- import { AlgoliaConfiguration } from '../schema/configuration.schema';
8
+ import {
9
+ ProductProvider
10
+ } from '@reactionary/core';
11
+ import type { z } from 'zod';
12
+ import type { AlgoliaConfiguration } from '../schema/configuration.schema';
11
13
 
12
14
  export class AlgoliaProductProvider<
13
15
  T extends Product = Product
@@ -22,7 +24,7 @@ export class AlgoliaProductProvider<
22
24
 
23
25
  public override async getById(
24
26
  payload: ProductQueryById,
25
- _session: Session
27
+ _reqCtx: RequestContext
26
28
  ): Promise<T> {
27
29
  // TODO: Implement Algolia product fetch by ID
28
30
  const result = this.newModel();
@@ -34,13 +36,13 @@ export class AlgoliaProductProvider<
34
36
  cache: { hit: false, key: payload.id },
35
37
  placeholder: true
36
38
  };
37
-
39
+
38
40
  return this.assert(result);
39
41
  }
40
42
 
41
43
  public override async getBySlug(
42
44
  payload: ProductQueryBySlug,
43
- _session: Session
45
+ _reqCtx: RequestContext
44
46
  ): Promise<T> {
45
47
  // TODO: Implement Algolia product fetch by slug
46
48
  const result = this.newModel();
@@ -52,7 +54,7 @@ export class AlgoliaProductProvider<
52
54
  cache: { hit: false, key: payload.slug },
53
55
  placeholder: true
54
56
  };
55
-
57
+
56
58
  return this.assert(result);
57
59
  }
58
60
  }
@@ -1,15 +1,15 @@
1
1
  import {
2
+ type SearchQueryByTerm,
3
+ type SearchResult,
4
+ type SearchResultFacet,
5
+ type SearchResultProduct,
6
+ type RequestContext,
7
+ type Cache,
2
8
  SearchProvider,
3
- SearchQueryByTerm,
4
- SearchResult,
5
- SearchResultFacet,
6
- SearchResultProduct,
7
- Session,
8
- Cache,
9
9
  } from '@reactionary/core';
10
10
  import { algoliasearch } from 'algoliasearch';
11
- import { z } from 'zod';
12
- import { AlgoliaConfiguration } from '../schema/configuration.schema';
11
+ import type { z } from 'zod';
12
+ import type { AlgoliaConfiguration } from '../schema/configuration.schema';
13
13
 
14
14
  export class AlgoliaSearchProvider<
15
15
  T extends SearchResult = SearchResult
@@ -24,7 +24,7 @@ export class AlgoliaSearchProvider<
24
24
 
25
25
  public override async queryByTerm(
26
26
  payload: SearchQueryByTerm,
27
- _session: Session
27
+ _reqCtx: RequestContext
28
28
  ): Promise<SearchResult> {
29
29
  const client = algoliasearch(this.config.appId, this.config.apiKey);
30
30
  const remote = await client.search<unknown>({
@@ -1,5 +1,5 @@
1
1
  import { CapabilitiesSchema } from "@reactionary/core";
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
 
4
4
  export const AlgoliaCapabilitiesSchema = CapabilitiesSchema.pick({
5
5
  product: true,
@@ -1,6 +1,6 @@
1
- import { NoOpCache, SearchResultSchema } from '@reactionary/core';
1
+ import 'dotenv/config';
2
+ import { createInitialRequestContext, NoOpCache, SearchResultSchema } from '@reactionary/core';
2
3
  import { AlgoliaSearchProvider } from '../providers/search.provider';
3
- import { createAnonymousTestSession } from './test-utils';
4
4
 
5
5
  describe('Algolia Search Provider', () => {
6
6
  const provider = new AlgoliaSearchProvider(
@@ -13,7 +13,7 @@ describe('Algolia Search Provider', () => {
13
13
  new NoOpCache()
14
14
  );
15
15
 
16
- const session = createAnonymousTestSession();
16
+ const reqCtx = createInitialRequestContext();
17
17
 
18
18
  it('should be able to get a result by term', async () => {
19
19
  const result = await provider.queryByTerm({ search: {
@@ -21,7 +21,7 @@ describe('Algolia Search Provider', () => {
21
21
  page: 0,
22
22
  pageSize: 20,
23
23
  facets: [],
24
- }}, session);
24
+ }}, reqCtx);
25
25
 
26
26
  expect(result.products.length).toBeGreaterThan(0);
27
27
  expect(result.facets.length).toBe(2);
@@ -35,14 +35,14 @@ describe('Algolia Search Provider', () => {
35
35
  page: 0,
36
36
  pageSize: 20,
37
37
  facets: [],
38
- }}, session);
38
+ }}, reqCtx);
39
39
 
40
40
  const secondPage = await provider.queryByTerm({ search: {
41
41
  term: 'glass',
42
42
  page: 1,
43
43
  pageSize: 20,
44
44
  facets: [],
45
- }}, session);
45
+ }}, reqCtx);
46
46
 
47
47
  expect(firstPage.identifier.page).toBe(0);
48
48
  expect(secondPage.identifier.page).toBe(1);
@@ -57,13 +57,13 @@ describe('Algolia Search Provider', () => {
57
57
  page: 0,
58
58
  pageSize: 2,
59
59
  facets: [],
60
- }}, session);
60
+ }}, reqCtx);
61
61
  const largePage = await provider.queryByTerm({ search: {
62
62
  term: 'glass',
63
63
  page: 0,
64
64
  pageSize: 30,
65
65
  facets: [],
66
- }}, session);
66
+ }}, reqCtx);
67
67
 
68
68
  expect(smallPage.products.length).toBe(2);
69
69
  expect(smallPage.identifier.pageSize).toBe(2);
@@ -77,14 +77,14 @@ describe('Algolia Search Provider', () => {
77
77
  page: 0,
78
78
  pageSize: 2,
79
79
  facets: [],
80
- }}, session);
80
+ }}, reqCtx);
81
81
 
82
82
  const filtered = await provider.queryByTerm({ search: {
83
83
  term: 'glass',
84
84
  page: 0,
85
85
  pageSize: 2,
86
86
  facets: [initial.facets[0].values[0].identifier],
87
- }}, session);
87
+ }}, reqCtx);
88
88
 
89
89
  expect(initial.pages).toBeGreaterThan(filtered.pages);
90
90
  });
@@ -1,4 +1,4 @@
1
- import { Session } from "@reactionary/core";
1
+ import type { Session } from "@reactionary/core";
2
2
 
3
3
  export function createAnonymousTestSession(): Session {
4
4
  return {
@@ -9,10 +9,15 @@ export function createAnonymousTestSession(): Session {
9
9
  cache: { hit: false, key: '' },
10
10
  placeholder: false,
11
11
  },
12
- id: '',
12
+ id: { userId: 'anonymous' },
13
13
  token: undefined,
14
14
  issued: new Date(),
15
- expiry: new Date(new Date().getTime() + 3600 * 1000), // 1 hour from now
15
+ expiry: new Date(new Date().getTime() + 3600 * 1000),
16
+ logonId: "",
17
+ createdAt: "",
18
+ updatedAt: "",
19
+ keyring: [],
20
+ currentService: undefined
16
21
  },
17
22
  languageContext: {
18
23
  locale: 'en-US',
@@ -23,4 +28,4 @@ export function createAnonymousTestSession(): Session {
23
28
  key: 'the-good-store',
24
29
  },
25
30
  };
26
- }
31
+ }
@@ -9,3 +9,30 @@ Run `nx build provider-commercetools` to build the library.
9
9
  ## Running unit tests
10
10
 
11
11
  Run `nx test provider-commercetools` to execute the unit tests via [Jest](https://jestjs.io).
12
+
13
+
14
+ # ASSUMPTIONS for backend config
15
+
16
+ - You will have 2 different channels for prices, one called `Offer Price` and one called `List Price`
17
+ - ProductVariants will all have unique SKU values.
18
+ - Your Supply Channels double as Store Locations
19
+
20
+
21
+
22
+ ## TODO List
23
+
24
+ ### Core
25
+ - [ ] Figure out if we are actually running as anonymous user towards CT. It feels weird right now.
26
+
27
+ ### Price
28
+ - [ ] PriceProvider should be able to use both embedded and standalone prices? Possible by querying through product-projection maybe?
29
+ - [ ] If not, using product-projection, the logic in https://docs.commercetools.com/api/pricing-and-discounts-overview#price-selection should be replicated
30
+ - [ ] add list price by convention. Like key: LP-<sku> or something.
31
+
32
+
33
+ ### Inventory
34
+ - [ ] Be traced and cached
35
+
36
+
37
+
38
+