feat: kot add service #69

Merged
realaravinth merged 5 commits from kot-add-service into master 2024-07-23 20:48:48 +05:30
6 changed files with 142 additions and 0 deletions
Showing only changes of commit 6e0364c1ee - Show all commits

View file

@ -0,0 +1,18 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO cqrs_ordering_kot_query (\n version,\n order_id,\n kot_id,\n created_time,\n deleted\n ) VALUES (\n $1, $2, $3, $4, $5\n );",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8",
"Uuid",
"Uuid",
"Timestamptz",
"Bool"
]
},
"nullable": []
},
"hash": "1804fe2c946337fb2d10683b273bc00c8291b5ca0624f6a8fcb1d701d6b383c5"
}

View file

@ -0,0 +1,18 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE\n cqrs_ordering_kot_query\n SET\n version = $1,\n order_id = $2,\n kot_id = $3,\n created_time = $4,\n deleted = $5;",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8",
"Uuid",
"Uuid",
"Timestamptz",
"Bool"
]
},
"nullable": []
},
"hash": "4b7100e5c7442066dbb4ea7c9733e038af635766f0be61a86ca7084b34a2109d"
}

View file

@ -0,0 +1,28 @@
{
"db_name": "PostgreSQL",
"query": "SELECT \n kot_id, version\n FROM\n cqrs_ordering_kot_query\n WHERE\n kot_id = $1;",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "kot_id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "version",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false
]
},
"hash": "5db3c3d1ff503d25d3f8fc529a95fac6c716e1f575eb59d7a3a149d06760741b"
}

View file

@ -0,0 +1,40 @@
{
"db_name": "PostgreSQL",
"query": "SELECT \n order_id,\n kot_id,\n created_time,\n deleted\n FROM\n cqrs_ordering_kot_query\n WHERE\n kot_id = $1;",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "order_id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "kot_id",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "created_time",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "deleted",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false,
false,
false
]
},
"hash": "ad00213731142dc3853945e02662a93b1c75304f8fad8922a6d62b5e06bd2490"
}

View file

@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT EXISTS (\n SELECT 1\n FROM cqrs_ordering_kot_query\n WHERE\n kot_id = $1\n );",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists",
"type_info": "Bool"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
null
]
},
"hash": "ff85b5343820fb3c30eb5e1efbfe1e4d3a9b9a14c070846c8adb1ca0eaee1f37"
}

View file

@ -0,0 +1,16 @@
-- SPDX-FileCopyrightText: 2024 Aravinth Manivannan <realaravinth@batsense.net>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
CREATE TABLE IF NOT EXISTS cqrs_ordering_kot_query
(
version bigint CHECK (version >= 0) NOT NULL,
created_time timestamp with time zone DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
order_id UUID NOT NULL,
kot_id UUID NOT NULL UNIQUE,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (kot_id)
);