foundry-rs 0.6.1

Configuration-driven REST backend library for Rust with PostgreSQL — define schemas, tables, and APIs in JSON, get a production-grade REST service.
Documentation
[
  { "id": "col_organizations_id", "table_id": "tbl_organizations", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_organizations_name", "table_id": "tbl_organizations", "name": "name", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_organizations_slug", "table_id": "tbl_organizations", "name": "slug", "type": "varchar(100)", "nullable": false, "default": null, "comment": null },
  { "id": "col_organizations_created_at", "table_id": "tbl_organizations", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },
  { "id": "col_organizations_updated_at", "table_id": "tbl_organizations", "name": "updated_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_users_id", "table_id": "tbl_users", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_users_organization_id", "table_id": "tbl_users", "name": "organization_id", "type": "uuid", "nullable": false, "default": null, "comment": "References organizations.id" },
  { "id": "col_users_email", "table_id": "tbl_users", "name": "email", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_users_first_name", "table_id": "tbl_users", "name": "first_name", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_users_last_name", "table_id": "tbl_users", "name": "last_name", "type": "varchar(255)", "nullable": true, "default": null, "comment": null },
  { "id": "col_users_created_at", "table_id": "tbl_users", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },
  { "id": "col_users_updated_at", "table_id": "tbl_users", "name": "updated_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_customers_id", "table_id": "tbl_customers", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_customers_organization_id", "table_id": "tbl_customers", "name": "organization_id", "type": "uuid", "nullable": false, "default": null, "comment": "References organizations.id" },
  { "id": "col_customers_email", "table_id": "tbl_customers", "name": "email", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_customers_first_name", "table_id": "tbl_customers", "name": "first_name", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_customers_last_name", "table_id": "tbl_customers", "name": "last_name", "type": "varchar(255)", "nullable": true, "default": null, "comment": null },
  { "id": "col_customers_created_at", "table_id": "tbl_customers", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },
  { "id": "col_customers_updated_at", "table_id": "tbl_customers", "name": "updated_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_addresses_id", "table_id": "tbl_addresses", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_addresses_customer_id", "table_id": "tbl_addresses", "name": "customer_id", "type": "uuid", "nullable": false, "default": null, "comment": "References customers.id" },
  { "id": "col_addresses_kind", "table_id": "tbl_addresses", "name": "kind", "type": "ecommerce.address_kind", "nullable": false, "default": "'shipping'", "comment": null },
  { "id": "col_addresses_street", "table_id": "tbl_addresses", "name": "street", "type": "text", "nullable": false, "default": null, "comment": null },
  { "id": "col_addresses_city", "table_id": "tbl_addresses", "name": "city", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_addresses_state", "table_id": "tbl_addresses", "name": "state", "type": "varchar(100)", "nullable": true, "default": null, "comment": null },
  { "id": "col_addresses_postal_code", "table_id": "tbl_addresses", "name": "postal_code", "type": "varchar(20)", "nullable": false, "default": null, "comment": null },
  { "id": "col_addresses_country", "table_id": "tbl_addresses", "name": "country", "type": "varchar(2)", "nullable": false, "default": null, "comment": "ISO 3166-1 alpha-2" },

  { "id": "col_warehouses_id", "table_id": "tbl_warehouses", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_warehouses_organization_id", "table_id": "tbl_warehouses", "name": "organization_id", "type": "uuid", "nullable": false, "default": null, "comment": "References organizations.id" },
  { "id": "col_warehouses_name", "table_id": "tbl_warehouses", "name": "name", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_warehouses_created_at", "table_id": "tbl_warehouses", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_product_categories_id", "table_id": "tbl_product_categories", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_product_categories_organization_id", "table_id": "tbl_product_categories", "name": "organization_id", "type": "uuid", "nullable": false, "default": null, "comment": "References organizations.id" },
  { "id": "col_product_categories_parent_id", "table_id": "tbl_product_categories", "name": "parent_id", "type": "uuid", "nullable": true, "default": null, "comment": "Self-reference for hierarchy" },
  { "id": "col_product_categories_name", "table_id": "tbl_product_categories", "name": "name", "type": "varchar(255)", "nullable": false, "default": null, "comment": null },
  { "id": "col_product_categories_slug", "table_id": "tbl_product_categories", "name": "slug", "type": "varchar(100)", "nullable": false, "default": null, "comment": null },
  { "id": "col_product_categories_created_at", "table_id": "tbl_product_categories", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_products_id", "table_id": "tbl_products", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_products_organization_id", "table_id": "tbl_products", "name": "organization_id", "type": "uuid", "nullable": false, "default": null, "comment": "References organizations.id" },
  { "id": "col_products_sku", "table_id": "tbl_products", "name": "sku", "type": "varchar(100)", "nullable": false, "default": null, "comment": null },
  { "id": "col_products_name", "table_id": "tbl_products", "name": "name", "type": "varchar(500)", "nullable": false, "default": null, "comment": null },
  { "id": "col_products_description", "table_id": "tbl_products", "name": "description", "type": "text", "nullable": true, "default": null, "comment": null },
  { "id": "col_products_status", "table_id": "tbl_products", "name": "status", "type": "ecommerce.product_status", "nullable": false, "default": "'draft'", "comment": null },
  { "id": "col_products_price", "table_id": "tbl_products", "name": "price", "type": "numeric(12,2)", "nullable": false, "default": null, "comment": null },
  { "id": "col_products_created_at", "table_id": "tbl_products", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },
  { "id": "col_products_updated_at", "table_id": "tbl_products", "name": "updated_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_product_category_mappings_product_id", "table_id": "tbl_product_category_mappings", "name": "product_id", "type": "uuid", "nullable": false, "default": null, "comment": "References products.id" },
  { "id": "col_product_category_mappings_category_id", "table_id": "tbl_product_category_mappings", "name": "category_id", "type": "uuid", "nullable": false, "default": null, "comment": "References product_categories.id" },

  { "id": "col_orders_id", "table_id": "tbl_orders", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_orders_organization_id", "table_id": "tbl_orders", "name": "organization_id", "type": "uuid", "nullable": false, "default": null, "comment": "References organizations.id" },
  { "id": "col_orders_customer_id", "table_id": "tbl_orders", "name": "customer_id", "type": "uuid", "nullable": false, "default": null, "comment": "References customers.id" },
  { "id": "col_orders_shipping_address_id", "table_id": "tbl_orders", "name": "shipping_address_id", "type": "uuid", "nullable": true, "default": null, "comment": "References addresses.id" },
  { "id": "col_orders_billing_address_id", "table_id": "tbl_orders", "name": "billing_address_id", "type": "uuid", "nullable": true, "default": null, "comment": "References addresses.id" },
  { "id": "col_orders_status", "table_id": "tbl_orders", "name": "status", "type": "ecommerce.order_status", "nullable": false, "default": "'draft'", "comment": null },
  { "id": "col_orders_total_amount", "table_id": "tbl_orders", "name": "total_amount", "type": "numeric(14,2)", "nullable": false, "default": "0", "comment": null },
  { "id": "col_orders_created_at", "table_id": "tbl_orders", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },
  { "id": "col_orders_updated_at", "table_id": "tbl_orders", "name": "updated_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_order_items_id", "table_id": "tbl_order_items", "name": "id", "type": "bigserial", "nullable": false, "default": null, "comment": null },
  { "id": "col_order_items_order_id", "table_id": "tbl_order_items", "name": "order_id", "type": "uuid", "nullable": false, "default": null, "comment": "References orders.id" },
  { "id": "col_order_items_product_id", "table_id": "tbl_order_items", "name": "product_id", "type": "uuid", "nullable": false, "default": null, "comment": "References products.id" },
  { "id": "col_order_items_quantity", "table_id": "tbl_order_items", "name": "quantity", "type": "integer", "nullable": false, "default": null, "comment": null },
  { "id": "col_order_items_unit_price", "table_id": "tbl_order_items", "name": "unit_price", "type": "numeric(12,2)", "nullable": false, "default": null, "comment": null },
  { "id": "col_order_items_total_price", "table_id": "tbl_order_items", "name": "total_price", "type": "numeric(12,2)", "nullable": false, "default": null, "comment": null },

  { "id": "col_payments_id", "table_id": "tbl_payments", "name": "id", "type": "uuid", "nullable": false, "default": { "expression": "gen_random_uuid()" }, "comment": null },
  { "id": "col_payments_order_id", "table_id": "tbl_payments", "name": "order_id", "type": "uuid", "nullable": false, "default": null, "comment": "References orders.id" },
  { "id": "col_payments_amount", "table_id": "tbl_payments", "name": "amount", "type": "numeric(14,2)", "nullable": false, "default": null, "comment": null },
  { "id": "col_payments_status", "table_id": "tbl_payments", "name": "status", "type": "ecommerce.payment_status", "nullable": false, "default": "'pending'", "comment": null },
  { "id": "col_payments_method", "table_id": "tbl_payments", "name": "method", "type": "varchar(50)", "nullable": false, "default": null, "comment": "e.g. card, bank_transfer" },
  { "id": "col_payments_reference", "table_id": "tbl_payments", "name": "reference", "type": "varchar(255)", "nullable": true, "default": null, "comment": "External payment reference" },
  { "id": "col_payments_created_at", "table_id": "tbl_payments", "name": "created_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null },

  { "id": "col_inventory_id", "table_id": "tbl_inventory", "name": "id", "type": "bigserial", "nullable": false, "default": null, "comment": null },
  { "id": "col_inventory_product_id", "table_id": "tbl_inventory", "name": "product_id", "type": "uuid", "nullable": false, "default": null, "comment": "References products.id" },
  { "id": "col_inventory_warehouse_id", "table_id": "tbl_inventory", "name": "warehouse_id", "type": "uuid", "nullable": false, "default": null, "comment": "References warehouses.id" },
  { "id": "col_inventory_quantity", "table_id": "tbl_inventory", "name": "quantity", "type": "integer", "nullable": false, "default": "0", "comment": null },
  { "id": "col_inventory_reserved_quantity", "table_id": "tbl_inventory", "name": "reserved_quantity", "type": "integer", "nullable": false, "default": "0", "comment": null },
  { "id": "col_inventory_updated_at", "table_id": "tbl_inventory", "name": "updated_at", "type": "timestamptz", "nullable": false, "default": { "expression": "NOW()" }, "comment": null }
]