rapida-partner 3.6.0 → 3.6.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapida-partner",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "index.ts",
6
6
  "files": [
@@ -17,6 +17,11 @@ export interface IStoreOrdersModuleOptions {
17
17
 
18
18
  const ENTITY = "storeOrders";
19
19
 
20
+ // Um pedido por storeOrderId em cada workspace. Fica no contrato interno do
21
+ // form, de onde o gerador cria o índice único, e não no público: o reenvio do
22
+ // mesmo pedido pela loja é recusado em vez de duplicar.
23
+ const UNIQUE_STORE_ORDER = [{ identificator: "storeOrderIdPerWorkspace", fields: ["storeOrderId"] }];
24
+
20
25
  export const getStoreOrderForm = (options: IStoreOrdersModuleOptions = {}): IForm => ({
21
26
  componentType: "form",
22
27
  id: "storeOrderForm",
@@ -39,7 +44,7 @@ export const getStoreOrderForm = (options: IStoreOrdersModuleOptions = {}): IFor
39
44
  id: ENTITY,
40
45
  endpoint: STORE_ORDERS_ENDPOINT,
41
46
  actions: ["get", "getById", "update"],
42
- request: { entity: ENTITY, fields: [] },
47
+ request: { entity: ENTITY, fields: [], uniqueConstraints: UNIQUE_STORE_ORDER },
43
48
  },
44
49
  ],
45
50
  publicContracts: [
@@ -49,11 +54,7 @@ export const getStoreOrderForm = (options: IStoreOrdersModuleOptions = {}): IFor
49
54
  actions: ["create", "get", "update"],
50
55
  access: options.publicAccess ?? "trustedCallers",
51
56
  ...(options.allowedOrigins ? { allowedOrigins: options.allowedOrigins } : {}),
52
- request: {
53
- entity: ENTITY,
54
- fields: [],
55
- uniqueConstraints: [{ identificator: "storeOrderIdPerWorkspace", fields: ["storeOrderId"] }],
56
- },
57
+ request: { entity: ENTITY, fields: [] },
57
58
  },
58
59
  ],
59
60
  });