feat(core-flows,framework,medusa): list shipping options pass in cart as pricing context (#10374)

* feat(core-flows,framework,medusa): list shipping options pass in cart as pricing context

* chore: add test for shipping options returning free shipping
This commit is contained in:
Riqwan Thamir
2024-12-01 20:59:26 +01:00
committed by GitHub
parent eacd691951
commit 11bd556133
12 changed files with 284 additions and 156 deletions
+6 -10
View File
@@ -90,16 +90,12 @@ export type GlobalMiddlewareDescriptor = {
config?: MiddlewaresConfig
}
export interface MedusaRequest<Body = unknown>
extends Request<
{
[key: string]: string
},
any,
Body
> {
export interface MedusaRequest<
Body = unknown,
QueryFields = Record<string, unknown>
> extends Request<{ [key: string]: string }, any, Body> {
validatedBody: Body
validatedQuery: RequestQueryFields & Record<string, unknown>
validatedQuery: RequestQueryFields & QueryFields
/**
* TODO: shouldn't this correspond to returnable fields instead of allowed fields? also it is used by the cleanResponseData util
*/
@@ -122,7 +118,7 @@ export interface MedusaRequest<Body = unknown>
/**
* An object containing the fields that are filterable e.g `{ id: Any<String> }`
*/
filterableFields: Record<string, unknown>
filterableFields: QueryFields
includes?: Record<string, boolean>
/**