Commit Graph

2900 Commits

Author SHA1 Message Date
lukebui
db4da56023 fix(medusa-js): correct invites resend path in js client (#6155)
Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2024-01-22 20:31:30 +00:00
Riqwan Thamir
daecd82a7c feat(utils): update joiner config for campaigns (#6161) 2024-01-22 20:39:26 +01:00
Adrien de Peretti
738e9115ec feat(workflows-sdk): run, registerStepSuccess and registerStepFailure shortcut (#6164)
**What**

Currently, when exporting a workflow using the workflowExport util, it is mandatory to first call the resulted function passing the container before being able to call run, registerStepSuccess or failure on it. Now, it is possible to either continue that way, or to directly call the run, registerStepSuccess or failure on the exported workflow and at that moment it is possible to pass a container if needed

e.g
```ts
const workflow = exportWorkflow("id" as any, "result_step", prepare)
const wfRunner = workflow(container)
wfRunner.run(...) // Here the container is not expected
```
or
```ts
const workflow = exportWorkflow("id" as any, "result_step", prepare)
workflow.run(...) // Here we can now pass an optional container 
```
2024-01-22 19:14:18 +00:00
Shahed Nasser
4792c55226 docs: migrate guides to TSDoc references (#6100) 2024-01-22 18:38:35 +01:00
Sebastian Rindom
f72340ad87 feat(customer): add remove from group, update group (#6158)
Open #6149 again - was merged to wrong base branch.
2024-01-22 13:49:13 +00:00
Riqwan Thamir
99045848fd feat(medusa,types,core-flows,utils): added delete endpoints for campaigns and promotions (#6152)
what:

adds delete endpoints for:
- campaigns (RESOLVES CORE-1686)
- promotions (RESOLVES CORE-1680)
2024-01-22 13:06:49 +00:00
Sebastian Rindom
76291823f4 feat(customers): add delete and update (#6148)
Depends on #6137 

**What**
- Add update and delete methods to the customer module
2024-01-22 12:31:46 +00:00
Riqwan Thamir
da5cc4cf7f feat(core-flows,medusa,utils): promotion and campaign create/update endpoint (#6130)
what:

- adds create endpoint for promotions including workflows and endpoint (RESOLVES CORE-1678)
- adds update endpoint for promotions including workflows and endpoint (RESOLVES CORE-1679)
- adds create endpoint for campaigns including workflows and endpoint (RESOLVES CORE-1684)
- adds update endpoint for campaigns including workflows and endpoint (RESOLVES CORE-1685)
2024-01-22 11:54:17 +00:00
Sebastian Rindom
a52586880c feat(customer): Introduce customer group (#6137)
**What**
Methods for:
- Bulk create customers
- Bulk and single create of customer groups
- Assigning customer <> group relationships
- listing of customers and customer groups

++ Uses new repository loading mechanism
2024-01-22 11:24:22 +00:00
Oli Juhl
fd78f5e242 feat(cart): Shipping method adjustments (#6119) 2024-01-22 11:29:20 +01:00
Frane Polić
d47e946496 feat(payment): PaymentCollection CRUD (#6124) 2024-01-22 11:04:46 +01:00
invalid w
3f41d818b6 chore(admin-ui): add key for gift-cards table cells map fn (#6154)
![image](https://github.com/medusajs/medusa/assets/24707417/e13ff43b-770e-4698-bb9a-e22b866069f6)
2024-01-22 09:43:23 +00:00
Oli Juhl
06b33a9b45 feat(cart): Line item adjustments (#6112) 2024-01-22 09:55:47 +01:00
Riqwan Thamir
af7af73745 feat(medusa,utils): added campaign get endpoints (#6125)
what:

adds endpoints for the following:

- list endpoint (RESOLVES CORE-1682)
- retrieve endpoint (RESOLVES CORE-1683)
2024-01-19 14:54:40 +00:00
Adrien de Peretti
5e655dd59b chore: Hide repository creation if they are not custom + add upsert support by default (#6127) 2024-01-19 15:09:38 +01:00
Sebastian Rindom
1b99c5dc22 fix(medusa): ensure transaction is reused when service calls itself (#6089)
**What**
- ProductService.create calls ProductService.retrieve before returning. This fix ensures that the manager created in the atomicPhase is used when ProductService.retrieve is called.

**Why**
- Without the explicit use of the same manager in the retrieve call, race conditions easily occur if you have concurrent ProductService.create calls. The code below can reproduce the scenario:
```javascript
  const productData = [
    {
      barcode: `1234233423-${Math.random() * 100}`,
      external_id: `1234233423-${Math.random() * 100}`,
      description: "super cool product",
      discountable: true,
      hs_code: "1234213",
      origin_country: "DK",
      title: `Super cool product ${Math.random() * 100}`,
      type: { value: "Eyewear" },
      sales_channels: [{ id: sc.id }],
    },
    {
      barcode: `1234233423-${Math.random() * 100}`,
      external_id: `random-external-id-${Math.random() * 100}`,
      description: "super cool product",
      discountable: true,
      hs_code: "1234213",
      origin_country: "DK",
      title: `Super cool product ${Math.random() * 100}`,
      type: { value: "Eyewear" },
      sales_channels: [{ id: sc.id }],
    },
  ];

  const result = await Promise.all(
    productData.map(async (product) => productService.create(product))
  );
```

**Explaination**

What happens is the following:

- Request 1 calls `ProductService.create`. This in turn calls `atomicPhase` which sets the `ProductService.transactionManager_ = txForReqOne`
- Request 1 creates the product in the DB with `txForReqOne`.
- Request 2 calls `ProductService.create`. This in turn calls `atomicPhase` which sets the `ProductService.transactionManager_ = txForReqTwo`
- Request 1 reaches the end of `ProductService.create` where `this.retrieve` is called. Because the ProductService is a singleton the retrieve call will attempt to use `txForReqTwo` to fetch the product. 
- **Error**: since `txForReqTwo` can't read the data of `txForReqOne`, the product is not found.



Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-01-19 11:03:17 +00:00
Sebastian Rindom
12aa1737d5 feat: customer module skeleton (#6126) 2024-01-19 10:18:54 +00:00
Riqwan Thamir
a12c28b7d5 feat(medusa,types): add promotion list/get endpoint (#6110)
what:

- adds get promotion endpoint (RESOLVES CORE-1677)
- adds list promotions endpoint (RESOLVES CORE-1676)
- uses new API routes
2024-01-18 16:01:19 +00:00
fPolic
16945f4fd2 Merge branch 'develop' into feat/payment-module-interfaces 2024-01-18 16:04:00 +01:00
fPolic
8e4e6b043d Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-18 16:01:51 +01:00
Frane Polić
844a5d990c feat: Payment module models (#6065) 2024-01-18 15:50:56 +01:00
invalid w
2cca3627c3 fix(admin-ui->Collections): add key for map fn. resolve #6106 (#6107)
resolve #6106.


just add key for map fn.
2024-01-18 14:32:45 +00:00
Kasper Fabricius Kristensen
e49b6944e3 feat(dashboard): 3.0 product collection (#6120) 2024-01-18 15:01:34 +01:00
Frane Polić
491848bb45 Merge branch 'develop' into feat/payment-module-models 2024-01-18 14:41:24 +01:00
Oli Juhl
b132ff7669 feat(cart): Add line items in cart-creation (#6114) 2024-01-18 14:39:40 +01:00
Frane Polić
af61195aad Merge branch 'develop' into feat/payment-module-models 2024-01-18 14:19:18 +01:00
Oli Juhl
7f7cb2a263 feat(cart): Shipping methods (#6101) 2024-01-18 12:16:15 +01:00
fPolic
c332375ff2 chore: update fields to new convention 2024-01-18 11:56:10 +01:00
fPolic
81544088d3 fix: change type 2024-01-18 10:52:14 +01:00
fPolic
a6aa09ad27 Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-18 10:51:28 +01:00
fPolic
d5af7cc5f9 fix: add column type 2024-01-18 10:50:46 +01:00
Sebastian Rindom
5cfb662ec0 fix: migrate segment subscribers + typescript support (#5904)
Fixes #6068.

**What**

- Uses new Subscriber API.
- Adds support for typescript files in Segment plugin.
- Adds a peerDependency on @medusajs/medusa for the version that introduced new Subscriber API.
2024-01-18 09:38:33 +00:00
Adrien de Peretti
130c641e5c chore: Abstract module services (#6087)
**What**
Create a service abstraction for the modules internal service layer. The objective is to reduce the effort of building new modules when the logic is the same or otherwise allow to override the default behavior.

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-01-18 09:20:08 +00:00
Kasper Fabricius Kristensen
80feb972cb feat(dashboard): Customer groups domain (#6098)
**What**
- Adds list, detail, edit, create, add customers views to the CG domain.

**Note**
- Missing metadata in forms (coming in separate PR for entire admin)
- Missing table filters (separate PR)

CLOSES CORE-1648
2024-01-17 14:25:59 +00:00
Carlos R. L. Rodrigues
19bbae61f8 fix(modules-sdk): create workflow returning step transformer (#6102) 2024-01-17 09:17:37 -03:00
fPolic
e7d8c53b04 Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-17 12:14:56 +01:00
fPolic
aa1585b52c feat: add region index 2024-01-17 12:14:30 +01:00
Philip Korsholm
2b9f98895e Feat(modules-sdk): Run hooks on application start (#6111)
**What**
- run `onApplicationStart` hook when starting modules
2024-01-17 10:46:44 +00:00
fPolic
57b88968a7 fix: update DTO 2024-01-17 10:59:59 +01:00
fPolic
dfcb5e7995 Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-17 10:57:35 +01:00
fPolic
6341533eb0 fix: region id 2024-01-17 10:55:03 +01:00
fPolic
e4438ae2e8 Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-17 09:43:23 +01:00
fPolic
ef7f51afe6 fix: remove is selected 2024-01-17 09:43:00 +01:00
Riqwan Thamir
68ddd866a5 feat(utils,types): add registerUsages for promotions + computeActions consider usage (#6094)
RESOLVES CORE-1639
RESOLVES CORE-1640
RESOLVES CORE-1634
2024-01-16 20:06:06 +00:00
Oli Juhl
a5e8bf06c6 feat(cart): Line items operations (#6066) 2024-01-16 15:44:49 +01:00
Kasper Fabricius Kristensen
6315a61189 feat(dashboard): add customers domain (#6093) 2024-01-16 15:23:45 +01:00
fPolic
ca0d6f5a9f fix: method overloads 2024-01-16 14:13:48 +01:00
fPolic
dcdb6df6f8 fix: listPaymentCollections shape 2024-01-16 12:26:07 +01:00
fPolic
33e5b7f72f fix: Payment merge 2024-01-16 12:25:24 +01:00
fPolic
67acdcdc92 Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces
# Conflicts:
#	packages/payment/src/models/payment.ts
2024-01-16 12:20:07 +01:00