@pcreative/commerce-contract 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pcreative/commerce-contract",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Contrato de datos de commerce: los tipos que consume un tema y los adaptadores que los resuelven. Sin dependencias ni SDK del backend.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -367,6 +367,8 @@ export function createCommerce({
367
367
  price: money(o.precio ?? 0, moneda, true),
368
368
  priceCalculated: Boolean(o.esCalculada),
369
369
  description: o.datos?.description ?? null,
370
+ deliveryTime: o.plazo ?? null,
371
+ pickup: Boolean(o.recogida),
370
372
  }))
371
373
  },
372
374
  async listShippingGroups(cartId) {
package/src/index.d.ts CHANGED
@@ -282,6 +282,10 @@ export interface ShippingOption {
282
282
  /** El backend calcula el precio al elegirla (envío por peso, por ejemplo). */
283
283
  priceCalculated?: boolean
284
284
  description?: string | null
285
+ /** Plazo de entrega tal y como lo escribió la tienda: "24-48 h". */
286
+ deliveryTime?: string | null
287
+ /** El cliente recoge el pedido: no hay porte ni reparto. */
288
+ pickup?: boolean
285
289
  }
286
290
 
287
291
  export interface PaymentMethod {