Commit Graph

258 Commits

Author SHA1 Message Date
Adrien de Peretti
f49139b20f fix: custom link resolution in medusa app (#7950)
* fix custom link resolution in medusa app

* improve

* fix duplicate
2024-07-04 16:50:53 +02:00
Stevche Radevski
5544303b91 feat: Add support for managing tax inclusivity (#7943)
UI / HTTP / Workflows will come in separate PRs

REF CORE-2376
2024-07-04 14:50:09 +00:00
Adrien de Peretti
7b84d854f0 Feat/mikro orm based linkable (#7944)
**What**
- Generate simple linkable for mikro orm based modules 
- fix module util
- fix joiner config builder
- fix define link relationship extension
- fix migrations not loading custom links
2024-07-04 13:30:47 +00:00
Carlos R. L. Rodrigues
d036130604 fix(cart): add shipping method to cart (#7945) 2024-07-04 12:47:39 +00:00
Adrien de Peretti
cb36655b63 chore: Update defineMikroOrmCliConfig api (#7940)
* chore: Update defineMikroOrmCliConfig api

* update usage
2024-07-04 12:58:43 +02:00
Carlos R. L. Rodrigues
56394fe0d4 fix(order): order list payment and fulfillment status (#7934) 2024-07-04 06:37:25 -03:00
Adrien de Peretti
41c4307fc7 feat: define link util (#7931)
* feat: define link util

* handle pluralized fieldAlias for isList

* serviceName ar reference

* finalize

* todo

* WIP

* finalize

* fix tests

* update typings

* fix Module

* linkable

* update errors
2024-07-04 10:37:30 +02:00
Shahed Nasser
9b1688944e fix: fix docs link in payment provider tsdocs (#7939)
* fix: fix docs link in payment provider tsdocs

* add a note
2024-07-04 11:09:29 +03:00
Harminder Virk
cc3eb8698d fix: omit mikro orm entities values from the config (#7938) 2024-07-04 13:21:52 +05:30
Riqwan Thamir
78a4bcc700 fix(dashboard): breaking store page due to default currency (#7915)
* chore: fix breaking store page due to default currency

* fix: remote query checks all data when scoped by id

* chore: minor change
2024-07-04 09:37:36 +02:00
Harminder Virk
aa0390af4b Prettify DML properties when inferred (#7937) 2024-07-04 12:24:07 +05:30
Stevche Radevski
012a624ee4 feat: Flatten the provider config for all modules (#7930) 2024-07-03 16:57:12 +02:00
Riqwan Thamir
b6e4435c23 chore: cleanup migrations logs (#7924)
what:

when running `medusa run migrations`, cleanup logs with short descriptive message.

Before:

<img width="1262" alt="Screenshot 2024-07-03 at 14 31 36" src="https://github.com/medusajs/medusa/assets/5105988/504e9c24-371c-476d-9b6d-2dfe1a4088dc">

After:

<img width="1004" alt="Screenshot 2024-07-03 at 14 42 57" src="https://github.com/medusajs/medusa/assets/5105988/a89eaed5-04a4-4efb-a2e9-ca480f1eaa6e">
2024-07-03 13:53:59 +00:00
Adrien de Peretti
2711012d96 feat: Make the Module require the service name (#7923)
* feat: Make the Module require the service name

* finalize types
2024-07-03 15:44:57 +02:00
Riqwan Thamir
fdee0bd55a chore: use campaign http types from types package (#7922) 2024-07-03 14:13:44 +02:00
Adrien de Peretti
617a5972bf feat: refactor module joiner config and links generation (#7859)
* feat: refactor module joiner config and links generation

* improve typings

* WIP

* WIP

* WIP

* rename type file

* create link config

* finish typings and add utils

* improve links

* WIP typings

* finalize ExportModule utils

* finalize ExportModule utils

* fix: dml tests

* improve and fixes

* simplify typings with id changes

* add toJSON

* multiple fixes and entity builder fixes

* fix currency searchable

* fix tests

* medusa service refactoring

* cleanup

* cleanup and fixes

* make module name optional

* renaming

---------

Co-authored-by: Harminder Virk <virk.officials@gmail.com>
2024-07-03 13:12:49 +02:00
Carlos R. L. Rodrigues
a7844efd09 chore: move ModuleRegistrationName to utils (#7911) 2024-07-03 06:30:56 -03:00
Harminder Virk
46f15b4909 fix: inferring of relationship types (#7913)
FIXES: CORE-2448
2024-07-03 13:29:27 +05:30
Stevche Radevski
b4aa7fb9a7 fix: Disallow creating duplicate prices (#7866)
* fix: Disallow creating duplicate prices

* fix: Don't pass id to manager create in upsertWithReplace
2024-07-02 17:06:58 +02:00
Frane Polić
87375db9ef feat(dashboard): create shipment flow (#7898)
**What**
- add "Mark shipped" to Fulfillment section

---

CLOSES CORE-2427
2024-07-02 14:50:15 +00:00
Stevche Radevski
8244fe03b7 fix: Several fixes based on preview testing (#7906)
* fix: Add searchable properties on currency

* fix: Format product type dates in table

* fix: Preserve line whitespace in section row

* fix: Continue through tabs on Enter in create product form

* fix: Pagination in variant prices section

* fix: Add missing inventory edit item translation

* fix: Use the correct options URL for editing

* fix: Correctly get the variant title in inventory item details

* fix: Completely remove variant titles section in inventory item
2024-07-02 14:56:34 +02:00
Stevche Radevski
ef5f5363a1 fix: Delete before upsert in upsertWithReplace to handle relations with unique constraint (#7875) 2024-07-02 13:56:12 +02:00
Carlos R. L. Rodrigues
07715e6b50 chore(order): cancel return (#7881) 2024-07-02 06:52:58 -03:00
Harminder Virk
b3236ff31c Add support for native enums (#7903) 2024-07-02 15:22:09 +05:30
Harminder Virk
074e4a888e Mark keys as primary with explicit method call (#7900) 2024-07-02 13:27:21 +05:30
Carlos R. L. Rodrigues
17e6a83b59 fix(utils): joiner config from medusa project (#7896) 2024-07-01 13:48:34 -03:00
Riqwan Thamir
d58a626d0a fix: fix tabs + required fields (#7892) 2024-07-01 17:23:45 +02:00
Stevche Radevski
5c7c28709f fix: Only list price set prices when calling the price set methods (#7889)
FIXES CORE-2417
2024-07-01 14:24:14 +00:00
Stevche Radevski
9daec5d7ac chore: Migrate notification module to DML (#7835) 2024-07-01 09:17:32 +00:00
Stevche Radevski
c661180c44 feat: Completely revamp the pricing module (#7852)
* feat: Completely revamp the pricing module

* chore: Update all places to the new pricing interfaces

* fix: Remove unnecessary join to itself

* chore: Add data migration for existing users

* fix: Apply the correct index to price rule
2024-07-01 09:47:03 +02:00
Shahed Nasser
72f7500c84 chore(docs): DML API Reference (#7863)
* added dml options

* added tsdocs + configurations
2024-07-01 10:21:56 +03:00
Shahed Nasser
9ded63cc62 chore: OAS and TSDoc fixes (#7864) 2024-07-01 10:21:34 +03:00
Oli Juhl
fa6cd84049 chore: Migrate region module to use DML (#7837) 2024-06-29 13:14:52 +00:00
Kasper Fabricius Kristensen
c1740218e9 feat(dashboard,types,js-sdk,ui): Add missing Price List features (#7856)
**What**
- Adds missing features to Price List domain
- Adds `StackedFocusModal` and `StackedDrawer` components that should replace SplitView across the project.
- Add Footer to FocusModal
- Adds missing js-sdk functions and types

**Note**
The DatePickers in the PriceLists forms do not work as intended atm. The component is broken, and needs to be fixed. I am working on a fix, but choose to move that work into a separate branch, to prevent this PR from getting bigger then it already is. Will update once the fixes have been merged.
2024-06-28 14:08:23 +00:00
Carlos R. L. Rodrigues
9f3998393b fix(totals): order item totals (#7867) 2024-06-28 09:34:25 -03:00
Riqwan Thamir
789d545b9e feat(utils,types): infer keys in query builder from schema (#7861) 2024-06-27 20:38:06 +02:00
Carlos R. L. Rodrigues
7602fe8b61 chore: totals refundable_total (#7857) 2024-06-27 13:56:55 -03:00
Riqwan Thamir
91098877c2 fix(utils): always apply default indexes (#7858)
what:

- fixes default indexes not being applied always
2024-06-27 16:05:28 +00:00
Riqwan Thamir
91faa5ffdb feat(utils): DML generates foreign key indexes by default (#7855)
**what:**

- adds default indexes on foreign keys when belongs to relationship is present

RESOLVES CORE-2404
2024-06-27 14:45:27 +00:00
Riqwan Thamir
3f16b011fa feat(utils,types): DML Index can generate where SQL from a query builder (#7849)
what:

- introduces a simple query builder
- uses the query builder to tranform an object in where to SQL when applying indexes

```
Examples:
  { where: { column: null } } -> column IS NULL
  { where: { column: { $ne: null } } } -> column IS NOT NULL
  { where: { boolean_column: true } } -> boolean_column IS TRUE
  { where: { column: "value", another_column: { $ne: 30 } } } -> column = "value" AND another_column != 30
```

```
const user = model
  .define("user", {
    email: model.text(),
    account: model.text(),
    organization: model.text(),
  })
  .indexes([
    {
      on: ["organization", "account"],
      where: { email: { $ne: null } },
    },
    {
      name: "IDX-email-account-special",
      on: ["organization", "account"],
      where: {
        email: { $ne: null },
        account: null,
      },
    },
```

RESOLVES CORE-2392
2024-06-27 10:24:34 +00:00
Riqwan Thamir
5ee97d0e97 feat(utils,types): DML can apply composite indexes (#7842)
**what:**

- DML can apply composite indexes
- Where clause is currently a string, QB version will come as a follow up

```
model.define("user", {
  email: model.text(),
  account: model.text(),
}).indexes([
  {
    name: "IDX-unique-name",
    unique: true,
    on: ["email", "account"],
    where: "email is NOT NULL",
  },
])
```

RESOLVES CORE-2391
2024-06-26 15:39:04 +00:00
Adrien de Peretti
68dbcda84c fix: DML Enum property (#7846)
* fix: DML Enum property

* add more tests

* fix unit tests
2024-06-26 17:01:57 +02:00
Frane Polić
8703f453be feat(dashboard): manage inventory items for variants (#7800)
* feat: manage inventory items for variants

* fix: show action only when manage inventory

* fix: translation key

* fix: labels depending on number of items

* fix: address feedback

---------

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2024-06-26 11:53:16 +02:00
Riqwan Thamir
4945c79818 feat(utils): infer primaryKeys from a DML model (#7839)
what:

- depending on other properties in a DML model, we infer primaryKeys between id properties and primaryKey-able properties. 

```
Example:
  Model 1:
    id: model.id() -> primary key
    code: model.text()

  Model 2:
    id: model.id()
    code: model.text().primaryKey() -> primary key

  Model 3:
    id: model.id()
    code: model.text().primaryKey() -> composite primary key
    name: model.text().primaryKey() -> composite primary key
```
2024-06-26 09:26:09 +00:00
Adrien de Peretti
dc307c658d feat: Add support for array properties DML (#7836) 2024-06-25 20:51:14 +02:00
Adrien de Peretti
39038ddb0a chore: various DML improvements (#7833)
* chore: various DML improvements

* Check is something through static utils

* Check is something through static utils

* allow to define a schema with table name

* restrict searchable to text only

* rm searchable modifier

* extract constructor logic into separate function
2024-06-25 18:00:39 +02:00
Carlos R. L. Rodrigues
61758f374b chore(medusa): return endpoints (#7823) 2024-06-25 13:53:18 +00:00
Carlos R. L. Rodrigues
5600e58b7f chore(orchestration): idempotent (#7771) 2024-06-25 10:34:00 -03:00
Adrien de Peretti
66d17fabde chore: rename extractor type to InferEntityType (#7829) 2024-06-25 13:43:11 +02:00
Adrien de Peretti
34c44078e7 fix: DML relation management for many to one relation ship foreign keys (#7790)
FIXES CORE-2369

cc @thetutlage 

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-06-24 18:54:54 +00:00