ADD - support CityMarkt offer negotiation

This commit is contained in:
smx.pusha
2026-08-06 13:16:49 +02:00
parent bfe09814d8
commit e4e94e51a7
13 changed files with 742 additions and 16 deletions
+30
View File
@@ -394,6 +394,11 @@ local schema = {
{ name = "listing_id", type = "CHAR(36) NOT NULL", characterSet = "ascii", collation = "ascii_bin" },
{ name = "seller_account_id", type = "BIGINT UNSIGNED NOT NULL" },
{ name = "buyer_account_id", type = "BIGINT UNSIGNED NOT NULL" },
{ name = "offer_id", type = "BIGINT UNSIGNED NULL" },
{ name = "offer_amount", type = "BIGINT UNSIGNED NULL" },
{ name = "offer_proposer_account_id", type = "BIGINT UNSIGNED NULL" },
{ name = "offer_status", type = "ENUM('pending', 'accepted', 'rejected') NULL" },
{ name = "offer_revision", type = "INT UNSIGNED NOT NULL DEFAULT 0" },
{ name = "created_at", type = "DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP" },
{ name = "updated_at", type = "DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" },
},
@@ -433,6 +438,31 @@ local schema = {
},
tableOptions = "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
},
{
name = "sky_phone_marketplace_offers",
columns = {
{ name = "id", type = "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT" },
{ name = "inquiry_id", type = "CHAR(36) NOT NULL", characterSet = "ascii", collation = "ascii_bin" },
{ name = "proposer_account_id", type = "BIGINT UNSIGNED NOT NULL" },
{ name = "amount", type = "BIGINT UNSIGNED NOT NULL" },
{ name = "status", type = "ENUM('pending', 'accepted', 'rejected', 'countered') NOT NULL DEFAULT 'pending'" },
{ name = "read_at", type = "DATETIME NULL" },
{ name = "response_read_at", type = "DATETIME NULL" },
{ name = "created_at", type = "DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP" },
{ name = "updated_at", type = "DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" },
},
primaryKey = "id",
indexes = {
{ name = "idx_sky_phone_marketplace_offers", columns = "(`inquiry_id`, `id`)" },
{ name = "idx_sky_phone_marketplace_offer_unread", columns = "(`inquiry_id`, `read_at`, `proposer_account_id`)" },
{ name = "idx_sky_phone_marketplace_offer_response_unread", columns = "(`inquiry_id`, `response_read_at`, `proposer_account_id`)" },
},
foreignKeys = {
{ column = "inquiry_id", references = "`sky_phone_marketplace_inquiries` (`id`) ON DELETE CASCADE" },
{ column = "proposer_account_id", references = "`sky_phone_accounts` (`id`) ON DELETE CASCADE" },
},
tableOptions = "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
},
{
name = "sky_phone_marketplace_blocks",
columns = {