feat: Line Items API Routes (#6478)

**What**
- `POST /store/carts/:id/line-items`
- `POST /store/carts/:id/line-items/:id`
- `DELETE /store/carts/:id/line-items/:id`

**Outstanding**
- Integration tests
- Module integrations: Payment, Fulfillment, Promotions

Depends on #6475 and #6449.
This commit is contained in:
Oli Juhl
2024-02-27 12:47:00 +00:00
committed by GitHub
parent f5c2256286
commit 3ee0f599c1
30 changed files with 937 additions and 208 deletions
@@ -658,6 +658,15 @@
"nullable": false,
"mappedType": "json"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
@@ -798,6 +807,15 @@
"nullable": false,
"mappedType": "decimal"
},
"raw_amount": {
"name": "raw_amount",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "json"
},
"provider_id": {
"name": "provider_id",
"type": "text",
@@ -807,6 +825,15 @@
"nullable": true,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
@@ -957,6 +984,15 @@
"nullable": true,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
@@ -1283,6 +1319,15 @@
"nullable": false,
"mappedType": "decimal"
},
"raw_amount": {
"name": "raw_amount",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "json"
},
"provider_id": {
"name": "provider_id",
"type": "text",
@@ -1323,6 +1368,15 @@
"nullable": false,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"promotion_id": {
"name": "promotion_id",
"type": "text",
@@ -1436,6 +1490,15 @@
"nullable": true,
"mappedType": "text"
},
"metadata": {
"name": "metadata",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
@@ -1534,4 +1597,4 @@
"foreignKeys": {}
}
]
}
}
@@ -85,6 +85,7 @@ export class Migration20240222170223 extends Migration {
"raw_compare_at_unit_price" JSONB NULL,
"unit_price" NUMERIC NOT NULL,
"raw_unit_price" JSONB NOT NULL,
"metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
@@ -106,7 +107,9 @@ export class Migration20240222170223 extends Migration {
"promotion_id" TEXT NULL,
"code" TEXT NULL,
"amount" NUMERIC NOT NULL,
"raw_amount" JSONB NOT NULL,
"provider_id" TEXT NULL,
"metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
@@ -125,6 +128,7 @@ export class Migration20240222170223 extends Migration {
"code" TEXT NOT NULL,
"rate" NUMERIC NOT NULL,
"provider_id" TEXT NULL,
"metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
@@ -162,7 +166,9 @@ export class Migration20240222170223 extends Migration {
"promotion_id" TEXT NULL,
"code" TEXT NULL,
"amount" NUMERIC NOT NULL,
"raw_amount" JSONB NOT NULL,
"provider_id" TEXT NULL,
"metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,
@@ -180,6 +186,7 @@ export class Migration20240222170223 extends Migration {
"code" TEXT NOT NULL,
"rate" NUMERIC NOT NULL,
"provider_id" TEXT NULL,
"metadata" JSONB NULL,
"created_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"updated_at" TIMESTAMPTZ NOT NULL DEFAULT NOW(),
"deleted_at" TIMESTAMPTZ NULL,