You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A clear and concise description of what the bug is.
Bug / error : <html>TS2345: Argument of type 'Repository<Order> & { target: EntityTarget<Order> & typeof Order; manager: EntityManager; queryRunner?: QueryRunner; findWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...>): Promise<...>; findOneWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...' is not assignable to parameter of type 'Repository<any> & Repository<ObjectLiteral>'.<br/>Type 'Repository<Order> & { target: EntityTarget<Order> & typeof Order; manager: EntityManager; queryRunner?: QueryRunner; findWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...>): Promise<...>; findOneWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...' is missing the following properties from type 'Repository<any>': sum, average, minimum, maximum
I'm also somewhat desperately trying to do exactly the same thing - attach a store ID to an order during the cart completion process. With this code I get a stack overflow:
Hey @NitishGameChanges - I just saw this in the "marketplace" article on the MedusaJS blog under 'Next Steps':
Associate an order to a store: This requires listening to the
order.created
event in a subscriber. The implementation can include creating child orders of an order if in your use case you support have products from multiple stores in one product. In this case, you’d also need to extend the order entity to create a parent-child relation. You can learn more about subscribers in the documentation.
I think the supported approach for that kind of multi-tenancy with orders is going to be the subscriber. Trying that next.
Bug report
Describe the bug
The issue with Override createFromCart of OrderService.
Code - `async createFromCart(cartOrId: string | Cart): Promise<Order | never> {
return await this.atomicPhase_(async (manager) => {
let order = await super.withTransaction(manager).createFromCart(cartOrId);
A clear and concise description of what the bug is.
Bug / error :
<html>TS2345: Argument of type 'Repository<Order> & { target: EntityTarget<Order> & typeof Order; manager: EntityManager; queryRunner?: QueryRunner; findWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...>): Promise<...>; findOneWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...' is not assignable to parameter of type 'Repository<any> & Repository<ObjectLiteral>'.<br/>Type 'Repository<Order> & { target: EntityTarget<Order> & typeof Order; manager: EntityManager; queryRunner?: QueryRunner; findWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...>): Promise<...>; findOneWithRelations(relations?: FindOptionsRelations<...>, optionsWithoutRelations?: Omit<...' is missing the following properties from type 'Repository<any>': sum, average, minimum, maximum
System information
Medusa version (including plugins):
Node.js version: v16.19.0
Database: Postgres
Operating system: MacOS
Browser (if relevant):
Steps to reproduce the behavior
Expected behavior
I want line
const orderRepo = manager.withRepository(this.container.orderRepository)
to work.Screenshots
If applicable, add screenshots to help explain your problem
Code snippets
If applicable, add code samples to help explain your problem
Additional context
Add any other context about the problem here
The text was updated successfully, but these errors were encountered: