PaddleHQ / paddle-node-sdk

Node.js SDK for working with the Paddle API in server-side apps.
https://developer.paddle.com/
Apache License 2.0
28 stars 5 forks source link

[Feature]: Add updatedAt to Product and ProductNotification #12

Closed mw10013 closed 4 months ago

mw10013 commented 4 months ago

Tell us about your feature request

Add updatedAt to Product and ProductNotification to align with api and webhooks. Product and ProductNotification seems to have createdAt but not updatedAt. API documents updated_at for Product object and list/create/get/update. Webhooks documents updated_at for created, imported, and updated product event.

https://github.com/PaddleHQ/paddle-node-sdk/blob/2fb1bb5b09cfcee2c902081cb444d5acd166b45d/src/entities/product/product.ts#L11-L22

https://developer.paddle.com/api-reference/products/get-product

{
  "data": {
    "id": "pro_01h7zcgmdc6tmwtjehp3sh7azf",
    "name": "ChatApp Education",
    "tax_category": "standard",
    "type": "standard",
    "description": "Spend more time engaging with students with ChataApp Education. Includes features from our Pro plan, plus tools to help educators track student progress.",
    "image_url": "https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png",
    "custom_data": {
      "features": {
        "crm": false,
        "data_retention": true,
        "reports": true
      }
    },
    "status": "active",
    "import_meta": null,
    "created_at": "2024-01-16T14:38:08.3Z",
    "updated_at": "2024-01-16T14:38:08.3Z"
  },
  "meta": {
    "request_id": "69ed6193-483b-410a-bcd7-b2b873bf8a6f"
  }
}

https://github.com/PaddleHQ/paddle-node-sdk/blob/2fb1bb5b09cfcee2c902081cb444d5acd166b45d/src/notifications/entities/product/product-notification.ts#L12-L22

https://developer.paddle.com/webhooks/products/product-created https://developer.paddle.com/webhooks/products/product-imported https://developer.paddle.com/webhooks/products/product-updated

{
  "event_id": "evt_01h7zcr13xte50ncas1jkgpbfk",
  "event_type": "product.updated",
  "occurred_at": "2024-01-25T11:49:43.241Z",
  "notification_id": "ntf_01h7zcr1683yvnvxf9mn8k7vcw",
  "data": {
    "id": "pro_01h7zcgmdc6tmwtjehp3sh7azf",
    "name": "ChatApp for Schools",
    "tax_category": "standard",
    "type": "standard",
    "description": "Spend more time engaging with students with ChataApp Education. Includes features from our Pro plan, plus tools to help educators track student progress.",
    "image_url": "https://paddle-sandbox.s3.amazonaws.com/user/10889/2nmP8MQSret0aWeDemRw_icon1.png",
    "custom_data": {
      "features": {
        "crm": false,
        "data_retention": true,
        "reports": true
      }
    },
    "status": "archived",
    "import_meta": null,
    "created_at": "2024-01-16T14:38:08.3Z",
    "updated_at": "2024-01-25T11:49:43.241Z"
  }
}

What problem are you looking to solve?

Synchronize and reconcile application database with Paddle.

Additional context

No response

How important is this suggestion to you?

Important

vijayasingam-paddle commented 4 months ago

Hi @mw10013, Thank you for raising a detailed report.

We are aware of this difference in Product entity between our API/docs and SDK and we have a ticket to get it updated. We are at the final leg of this change and it should be added to the SDK soon.

Thank you.