Commit Graph

155 Commits

Author SHA1 Message Date
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
8e4e6b043d Merge branch 'feat/payment-module-models' into feat/payment-module-interfaces 2024-01-18 16:01:51 +01:00
Oli Juhl
b132ff7669 feat(cart): Add line items in cart-creation (#6114) 2024-01-18 14:39:40 +01:00
Oli Juhl
7f7cb2a263 feat(cart): Shipping methods (#6101) 2024-01-18 12:16:15 +01:00
fPolic
81544088d3 fix: change type 2024-01-18 10:52:14 +01: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
fPolic
57b88968a7 fix: update DTO 2024-01-17 10:59:59 +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
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
1cc888df80 feat: Sessions API update 2024-01-16 09:56:54 +01:00
Riqwan Thamir
e28fa7fbdf feat(utils): add campaign + promotion create / update (#6077)
* chore: add campaign + promotion operations

* chore: update type

* chore: added validation for campaign_id and campaign

* chore: added update promotions for campaigns

* chore: update campaign on promotion

* chore: fix lint

* chore: add test to remove promotions
2024-01-16 09:37:57 +01:00
fPolic
66ec3d0931 wip: session methods 2024-01-15 18:40:05 +01:00
fPolic
fbd3fedb68 wip: service 2024-01-15 17:15:49 +01:00
fPolic
56752039cf wip: interface and types 2024-01-15 15:18:02 +01:00
Riqwan Thamir
fade8ea7bf feat(utils,types): campaigns and campaign budgets + services CRUD (#6063)
* chore: added item/shipping adjustments for order/items/shipping_methods

* chore: add validation for order type and target rules

* chore: add comment for applied promotions

* chore: add shipping method and item adjustments

* chore: include applied promotions to items/shipping_method for each case

* chore: handle case for items across and order to consider existing applications

* chore: handle case for applied promo values to shipping => across

* chore: added changeset

* chore: update return of function

* chore: campaigns and campaign budgets + services CRUD

* Apply suggestions from code review

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* chore: minor refactor

* chore: added single/bulk interfaces

* Apply suggestions from code review

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* chore: use DAL date entity

* chore: align nullable

* Update packages/promotion/src/models/promotion-rule.ts

* chore: fix types

* chore: review changes

* Update packages/promotion/src/utils/compute-actions/shipping-methods.ts

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2024-01-12 14:14:34 +01:00
Riqwan Thamir
b782d3bcb7 feat(utils,types): added item/shipping adjustments for order/items/shipping_methods (#6050)
what:

- adds compute actions for the following cases:
  - items => each & across
  - shipping_method => each & across
  - order
- adds a remove compute actions when code is no longer present in adjustments array

RESOLVES CORE-1625
RESOLVES CORE-1626
RESOLVES CORE-1627
RESOLVES CORE-1628
RESOLVES CORE-1585
2024-01-12 13:00:06 +00:00
Oli Juhl
192bc336cc feat(cart): Partial module service implementation (#6012)
Awaiting #6000 #6008  

**What**
- CRUD for Address in Cart Module service
- Tests for CRUD Carts + Address

**Not**
- Line items, shipping methods, tax lines, adjustment lines
2024-01-12 10:30:57 +00:00
Frane Polić
8472460f53 feat: Payment module package setup (#6059) 2024-01-11 16:41:40 +01:00
Oli Juhl
ce81cade88 feat(cart): Cart + Address services (#6055)
Duplicate of #6008, but I messed up my git history big time :'(

**What**
- CartService and CartRepository + tests
- AddressService and AddressRepository + tests
- CartModuleService skeleton. Full implementation + tests will be added in a separate PR
2024-01-11 14:40:13 +00:00
Oli Juhl
ef5024980d feat(cart): Public-facing DTOs + (partial) module interface (#6000) 2024-01-10 13:27:58 +01:00
Shahed Nasser
13f12e1953 docs: documentation updates for v1.20 (#6031)
* docs: documentation updates for v1.20

* fix stripe upgrade guide

* fixed vale error

* fix eslint errors

* change stripe environment variables to options
2024-01-09 19:07:24 +01:00
github-actions[bot]
47272bf2b9 chore: Version Packages (#5880) 2024-01-09 18:41:35 +01:00
Philip Korsholm
f065581736 Feat(authentication): Load auth providers (#6023)
* initial providers loader implementation

* registerAdd providers

* remove comment

* remove comment
2024-01-09 10:02:02 +01:00
Philip Korsholm
479a8b82a9 feat(authentication, types): Create authentication entities and services (#5979)
* create authentication entities

* ensure hashes are not returned

* re-add integration test argument

* update filterableprops

* update type

* pr feedback

* update serialization

* move finding existing entities and validation to service layer

* update types

* update models

* update user model

* pr feedback

* fix build

* pr feedback

* update integration test fixtures

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-01-08 09:50:12 +01:00
Riqwan Thamir
dc46ee1189 feat(types): promotion delete / update / retrieve / add/remove-rules (#5988) 2024-01-05 16:17:22 +01:00
Philip Korsholm
3550750975 feat(pricing, types, utils): Soft delete pricing entities (#5858) 2024-01-04 09:02:49 +01:00
Riqwan Thamir
42cc8ae3f8 feat(types,utils): added promotion create with rules and application target rules (#5957)
* feat(types,utils): added promotion create with rules

* chore: add rules to promotion and application method

* chore: use common code for rule and values

* chore: address pr reviews

* chore: fix test
2024-01-03 09:54:48 +01:00
Oli Juhl
925feea04a feat(cart): Add cart module package (#5982)
* feat: Add CartModule foundation

* remove migration

* fix ts issue

* Create hot-dingos-pay.md
2024-01-02 15:59:23 +01:00
Riqwan Thamir
890e76a5c5 feat(types,utils): add promotions create with application method (#5945)
What:

- Promotions can be created with its bare attributes
- Promotions one to one relationship with ApplicationMethod can be created with its attributes + validation

RESOLVES CORE-1592
RESOLVES CORE-1595
2023-12-21 11:04:50 +00:00
Philip Korsholm
c1c470e6b8 fix(medusa, pricing, types): pass dates as Date-objects rather than strings to the pricing module (#5768)
* init

* remove date string validator;

* add transformOptionalDate transformer to api

* move type conversion to the datalayer

* fix final module integration test

* update arrow-function

* make string optional

* move work to utils

* make check for value exists

* move util back to pricng

* change utils

* refactor get-iso-string

* fix build

* flip transform condition

* add null check for isDate

* feat(pricing): Separate Pricing Module internal types from `@medusajs/types` (#5777)

* create types for pricing repositories

* create RepositoryTypes input

* add service types

* use models for repository types

* fix build

* update types to match interface types

* add aliases

* types instead of moduletypes

* move repository to types for pricing module

* add changeset

* fix merge error

* fix conflict

* fix build

* re-add validation of dates in updatePriceLists_
2023-12-21 08:29:41 +01:00
Philip Korsholm
6d1e3cc028 feat(types,module-sdk): setup authentication module skeleton (#5943)
**What**
- add authentication module skeleton
2023-12-21 06:56:20 +00:00
Riqwan Thamir
3f6d79961d feat(types,modules-sdk): basic module setup for promotions (#5920)
RESOLVES CORE-1580
2023-12-20 12:21:13 +00:00
github-actions[bot]
7f5e638f61 chore: Version Packages (#5754)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-14 15:27:39 +01:00
Riqwan Thamir
07107f3565 feat(orchestration,core-flows,medusa,product,types,utils): product import/export uses workflows (#5811) 2023-12-12 12:09:25 +00:00
Riqwan Thamir
079f0da83f feat(core-flows,pricing,medusa,pricing,types,utils): Price List Prices can have their own rules (#5752)
**What**
- Add price-rules for prices in price-lists
- make rules object optional when creating prices

**Why**
- more price granularity

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2023-12-12 08:20:21 +00:00
Adrien de Peretti
85cda7ce37 feat(medusa, core-workflows, product): slightly improve create cart workflow (#5725) 2023-12-07 17:05:23 +01:00
Adrien de Peretti
946db51a9b chore(): Add engines to all package.json if needed (#5812) 2023-12-07 17:03:50 +01:00
Shahed Nasser
f802e2460f docs: TSDoc + reference of fulfillment service (#5761) 2023-11-29 11:58:08 +00:00
github-actions[bot]
cdd42dbdcd chore(docs): Generated References (#5743)
Generated the following references:
- `entities`
- `inventory`
- `js-client`
- `pricing`
- `product`
- `services`
- `stock-location`
- `workflows`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-27 18:58:52 +00:00
github-actions[bot]
935e9f0561 chore: Version Packages (#5673)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-27 16:43:51 +00:00
Philip Korsholm
18afe0b9ad Fix(medusa, inventory, stock-location, types, utils): Modules sdk build query (#5713)
* remove defaults

* take 2

* works now

* add changeset

* pricing module and pricing service list take null updates

* update handlers

* update product module service with take:null where relevant

* no spread

* note to self:default offset should be 0, not 15
2023-11-27 10:17:42 +00:00
Philip Korsholm
0df1c7d427 fix(pricing, types): update calculatePrices return type to match actual type (#5709)
* initial type fix

* add changeset

* update changeset

* update tsdocs

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-11-24 17:12:34 +00:00
Riqwan Thamir
fc1ef29ed9 fix(medusa,pricing,types): rules only gets updated/deleted upon passing an explicit object (#5711) 2023-11-24 13:54:23 +00:00
Philip Korsholm
a39ce125cc fix(product, types, workflows): Update product variant workflow (#5668)
**What**
- Fix issues with update-variant workflow: 
  - other variants than the updated variant are no longer removed 
  - options are updated properly


Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
2023-11-23 14:35:01 +00:00
Riqwan Thamir
6025c702f3 fix(pricing,types): remove is_dynamic from model + types (#5664)
what:

Removing this until we introduce dynamic pricing. 

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-22 19:28:48 +00:00
Philip Korsholm
dc5750dd66 feat(medusa,types,workflows,utils,product): PricingModule Integration of PriceLists into Core (#5536) 2023-11-21 17:42:37 +00:00
Shahed Nasser
fd27bc0daa chore: update tsdocs of pricing module (#5648)
* chore: update tsdocs of pricing module

* Update money-amount.ts

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2023-11-21 11:26:07 +00:00
github-actions[bot]
f4085dbede chore: Version Packages (#5622)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-21 08:46:09 +00:00