JSPM

@tsc_tech/medusa-plugin-amc

0.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q51172F
  • License MIT

A starter for Medusa plugins.

Package Exports

  • @tsc_tech/medusa-plugin-amc/admin/components/AmcDetail/index
  • @tsc_tech/medusa-plugin-amc/admin/components/DataTable/index
  • @tsc_tech/medusa-plugin-amc/admin/components/ErrorMessage/index
  • @tsc_tech/medusa-plugin-amc/admin/components/TableRowActions
  • @tsc_tech/medusa-plugin-amc/admin/components/VariantPricingForm/index
  • @tsc_tech/medusa-plugin-amc/admin/components/VariantTable/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/Required/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/keybound-form/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/keybound-form/keybound-form
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-focus-modal/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-focus-modal/route-focus-modal
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-modal-form/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-modal-form/route-modal-form
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-modal-provider/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-modal-provider/route-modal-context
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-modal-provider/route-provider
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/route-modal-provider/use-route-modal
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/stacked-modal-provider/index
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/stacked-modal-provider/stacked-modal-context
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/stacked-modal-provider/stacked-modal-provider
  • @tsc_tech/medusa-plugin-amc/admin/components/common/modals/stacked-modal-provider/use-stacked-modal
  • @tsc_tech/medusa-plugin-amc/admin/components/widgetComponents/CreateFocusModal/index
  • @tsc_tech/medusa-plugin-amc/admin/components/widgetComponents/EditFocusModal/index
  • @tsc_tech/medusa-plugin-amc/admin/components/widgetComponents/FocusModalComponent/index
  • @tsc_tech/medusa-plugin-amc/admin/hooks/use-query-params
  • @tsc_tech/medusa-plugin-amc/admin/hooks/use-state-aware-to
  • @tsc_tech/medusa-plugin-amc/admin/hooks/use-variant-price-grid
  • @tsc_tech/medusa-plugin-amc/admin/hooks/use-variant-table-query
  • @tsc_tech/medusa-plugin-amc/admin/lib/const
  • @tsc_tech/medusa-plugin-amc/admin/lib/sdk
  • @tsc_tech/medusa-plugin-amc/admin/routes/amc/create/page
  • @tsc_tech/medusa-plugin-amc/admin/routes/amc/edit/page
  • @tsc_tech/medusa-plugin-amc/admin/routes/amc/page
  • @tsc_tech/medusa-plugin-amc/admin/types/data-grid-types
  • @tsc_tech/medusa-plugin-amc/admin/types/types
  • @tsc_tech/medusa-plugin-amc/admin/vite-env.d
  • @tsc_tech/medusa-plugin-amc/admin/widgets/product-amc
  • @tsc_tech/medusa-plugin-amc/admin/widgets/product-widget
  • @tsc_tech/medusa-plugin-amc/api/admin/amc/[id]/route
  • @tsc_tech/medusa-plugin-amc/api/admin/amc/route
  • @tsc_tech/medusa-plugin-amc/api/admin/plugin/route
  • @tsc_tech/medusa-plugin-amc/api/middlewares
  • @tsc_tech/medusa-plugin-amc/api/store/add-amc-to-cart-line-item/middleware
  • @tsc_tech/medusa-plugin-amc/api/store/add-amc-to-cart-line-item/route
  • @tsc_tech/medusa-plugin-amc/api/store/add-amc-to-cart-line-item/validator
  • @tsc_tech/medusa-plugin-amc/api/store/amc/[variantId]/route
  • @tsc_tech/medusa-plugin-amc/api/store/amc/route
  • @tsc_tech/medusa-plugin-amc/api/store/customer-warranties/route
  • @tsc_tech/medusa-plugin-amc/api/store/plugin/route
  • @tsc_tech/medusa-plugin-amc/links/amc-price
  • @tsc_tech/medusa-plugin-amc/links/amc-product
  • @tsc_tech/medusa-plugin-amc/links/customer-warrenty
  • @tsc_tech/medusa-plugin-amc/links/product-warrenty
  • @tsc_tech/medusa-plugin-amc/modules/amc
  • @tsc_tech/medusa-plugin-amc/modules/warranty
  • @tsc_tech/medusa-plugin-amc/package.json
  • @tsc_tech/medusa-plugin-amc/subscribers/order-place
  • @tsc_tech/medusa-plugin-amc/subscribers/product-variant-created
  • @tsc_tech/medusa-plugin-amc/subscribers/product-variant-deleted
  • @tsc_tech/medusa-plugin-amc/subscribers/product-variant-updated
  • @tsc_tech/medusa-plugin-amc/workflows/ update-amc-price/update-amc-price
  • @tsc_tech/medusa-plugin-amc/workflows/add-amc-line-item/add-amc-line-item
  • @tsc_tech/medusa-plugin-amc/workflows/create-amc/create-amc
  • @tsc_tech/medusa-plugin-amc/workflows/hooks/complete-cart

Readme

🛠️ Medusa Annual Maintenance Contract (AMC) Plugin 🛠️

🏭 Transform your product maintenance into a seamless service experience 🔧

Medusa AMC Plugin is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

🚀 Boost Revenue | 🤝 Enhance Customer Loyalty | ⚡ Automate Maintenance | 📈 Scale Services


✨ Features

🎯 Core Capabilities

  • 📝 Create & manage maintenance contracts
  • 🔄 Automated contract lifecycle management
  • 💳 Flexible pricing & billing
  • 📊 Comprehensive reporting
  • 🔔 Smart notifications system

🚀 For Your Business

  • 📈 Increase recurring revenue
  • 🤝 Improve customer retention
  • ⚡ Automate maintenance scheduling
  • 📱 Enhanced customer experience

💪 For Your Customers

  • 🛡️ Guaranteed maintenance support
  • ⏰ Priority service response
  • 💰 Predictable maintenance costs
  • 🎯 Customized service plans

🚀 Quick Start

📦 Installation

npm install @tsc_tech/medusa-plugin-amc
# or
yarn add @tsc_tech/medusa-plugin-amc

⚙️ Configuration

// medusa-config.js
module.exports = {
  plugins: [
    // ... other plugins
    {
      resolve: "@tsc_tech/medusa-plugin-amc",
      options: {
        // plugin options (if any)
      },
    },
  ],
};

🔥 Initialize

npx medusa db:migrate

💡 Key Features Explained

1. 📋 Contract Management

  • Create customized AMC plans
  • Set flexible durations
  • Track contract status

2. 🛒 Storefront Integration

AMC API Endpoints

  1. List All AMCs
# Using curl
curl -X GET "http://localhost:9000/store/amc?limit=50&offset=0" \
-H "Content-Type: application/json"

# Direct endpoint
GET /store/amc

Query Parameters:

  • limit: Number of items to return (default: 50)
  • offset: Number of items to skip (default: 0)

Response:

{
  "amc": [...],
  "count": number,
  "limit": number,
  "offset": number
}
  1. Get AMC by Variant ID
# Using curl
curl -X GET "http://localhost:9000/store/amc/variant_123" \
-H "Content-Type: application/json"

# Direct endpoint
GET /store/amc/{variantId}

Response:

{
  "amc": [...],
  "count": number,
  "limit": number,
  "offset": number
}
  1. Add AMC to Cart Line Item
# Using curl
curl -X POST "http://localhost:9000/store/add-amc-to-cart-line-item" \
-H "Content-Type: application/json" \
-d '{
  "cart_id": "cart_123",
  "variant_id": "variant_456",
  "amc_id": "amc_789",
  "order_line_item_id": "ordli_101",
  "quantity": 1
}'

# Direct endpoint
POST /store/add-amc-to-cart-line-item

Request Body:

{
  "cart_id": "cart_123",
  "variant_id": "variant_456",
  "amc_id": "amc_789",
  "order_line_item_id": "ordli_101",
  "quantity": 1
}
  1. Get Customer Warranties
# Using curl
curl --location 'http://localhost:9010/store/customer-warranties?variant_id=variant_01JQ950S0REDQXND3CKZ3TF7S0&order_line_item_id=ordli_01JQEAND0D686JR9VH8JRZN6Z6' \
--header 'x-publishable-api-key: <your_publishable_api_key>' \
--header 'Authorization: Bearer <your_token>'

Query Parameters:

  • variant_id: The ID of the product variant.
  • order_line_item_id: The ID of the order line item.

Headers:

  • x-publishable-api-key: Your publishable API key.
  • Authorization: Bearer token for authentication.

Response:

[
  {
    "customer_id": "cus_01234567890",
    "variant_id": "variant_01234567890",
    "order_line_item_id": "ordli_01234567890",
    "start_date": "2025-03-28T12:12:09.704Z",
    "end_date": "2025-04-27T12:12:09.704Z",
    "isWarrantyAvailable": true,
    "details": [
      {
        "start_date": "2025-03-28T12:12:09.704Z",
        "end_date": "2025-04-27T12:12:09.704Z",
        "id": "warranty_01234567890",
        "duration_days": 30,
        "order_id": "order_01234567890",
        "product_id": "prod_01234567890",
        "amc_id": "",
        "created_at": "2025-03-28T12:12:09.704Z",
        "updated_at": "2025-03-28T12:12:09.704Z",
        "deleted_at": null
      },
      {
        "start_date": "2025-04-27T12:12:09.704Z",
        "end_date": "2026-04-27T12:12:09.704Z",
        "id": "warranty_09876543210",
        "duration_days": 365,
        "order_id": "order_09876543210",
        "product_id": "prod_01234567890",
        "amc_id": "amc_01234567890",
        "created_at": "2025-03-28T12:12:56.027Z",
        "updated_at": "2025-03-28T12:12:56.027Z",
        "deleted_at": null
      }
    ]
  }
]