diff --git a/contracts/create_order.yaml b/contracts/create_order.yaml new file mode 100644 index 0000000..2c14cc3 --- /dev/null +++ b/contracts/create_order.yaml @@ -0,0 +1,13 @@ +id: a82ddfa5-c7a6-4179-bf30-2d50e6e57bad +dataAssetResourceName: typescript://git@github.com:gabledata/tutorial:typescript:segment:Create order +doc: "PLACEHOLDER: Add documentation" +name: Create order +namespace: typescript +owner: suzanne@gable.ai +schema: + - name: orderId + type: string + doc: "PLACEHOLDER: Add documentation" + - name: numOfProducts + type: string + doc: "PLACEHOLDER: Add documentation" diff --git a/contracts/order_created.yaml b/contracts/order_created.yaml new file mode 100644 index 0000000..03b12d9 --- /dev/null +++ b/contracts/order_created.yaml @@ -0,0 +1,30 @@ +id: a1e6540d-bf91-423a-8b4e-a2cafc497782 +dataAssetResourceName: protobuf://git@github.com:gabledata/tutorial/event_schemas/OrderCreated.proto:tutorial.OrderCreated +doc: "PLACEHOLDER: Add documentation" +name: OrderCreated +namespace: tutorial +owner: eng@gable.ai +schema: + - name: order_id + type: string + bytes: 2147483648 + doc: "PLACEHOLDER: Add documentation" + - name: user_id + type: string + bytes: 2147483648 + doc: "PLACEHOLDER: Add documentation" + - name: total_amount + type: float + bits: 32 + doc: "PLACEHOLDER: Add documentation" + - name: created_at + type: int + logical: Timestamp + unit: nanosecond + timezone: UTC + bits: 64 + doc: "PLACEHOLDER: Add documentation" + - name: total_items + type: int + bits: 32 + doc: "PLACEHOLDER: Add documentation" diff --git a/typescript/server/order.ts b/typescript/server/order.ts index 682bb4f..ad92c72 100644 --- a/typescript/server/order.ts +++ b/typescript/server/order.ts @@ -13,7 +13,7 @@ app.post('/createorder', (req, res) => { analytics.track({ userId: req.body.userId, event: 'Create order', - properties: { orderId: '99482', numOfProducts: '5' } + properties: { orderId: '99482', numOfProducts: 123 } }) res.sendStatus(201) });