{
  "schemaVersion": 4,
  "id": "project_e377e663-388a-442a-b18b-48f0983f43e0",
  "name": "SaaS Multi-tenant Starter",
  "dialect": "mysql",
  "logicalModel": {
    "entities": [
      {
        "id": "entity_9bea86f6-a7e5-42e6-8a58-35e1722af867",
        "logicalName": "Tenant",
        "description": "Tenant",
        "x": 0,
        "y": 584,
        "width": 360,
        "attributes": [
          {
            "id": "attribute_b54fb6fd-1a85-43f0-ac56-d5aeb363c1b4",
            "logicalName": "Tenant Id",
            "description": "Tenant Id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_e5a01e24-4207-4fff-b9de-a486b46329de",
            "logicalName": "Tenant Name",
            "description": "Tenant Name",
            "dataType": "VARCHAR(120)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_4f9e441f-b111-406e-80ac-f874da4f41e4",
            "logicalName": "Tenant Slug",
            "description": "Tenant Slug",
            "dataType": "VARCHAR(60)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true
          },
          {
            "id": "attribute_6ac04852-910b-4e12-abca-0fd4ec9a6a7b",
            "logicalName": "Created At",
            "description": "Created At",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          }
        ]
      },
      {
        "id": "entity_23a52467-4fb2-483f-b3e1-f1fbb90f4559",
        "logicalName": "User",
        "description": "User",
        "x": 0,
        "y": 2,
        "width": 360,
        "attributes": [
          {
            "id": "attribute_31576f60-7698-46d3-b86f-62033e8e9aad",
            "logicalName": "User Id",
            "description": "User Id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_f9e332e5-fe9f-4df4-896e-bc72993ceee7",
            "logicalName": "Email",
            "description": "Email",
            "dataType": "varchar(255)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true,
            "domain": "Email"
          },
          {
            "id": "attribute_1e224249-c5c6-4194-94e3-1b854a6b0cc1",
            "logicalName": "Display Name",
            "description": "Display Name",
            "dataType": "VARCHAR(120)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_7d1448fe-d026-42ed-9252-2179461328dc",
            "logicalName": "Created At",
            "description": "Created At",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          }
        ]
      },
      {
        "id": "entity_838424dc-876d-4e52-97e0-a480b5af151f",
        "logicalName": "Membership",
        "description": "Membership",
        "x": 540,
        "y": 0,
        "width": 360,
        "attributes": [
          {
            "id": "attribute_eb240886-0484-4092-9847-a37127f1e18b",
            "logicalName": "Membership Id",
            "description": "Membership Id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_2527bdba-6524-4cd3-a871-014b5b16ee7f",
            "logicalName": "Tenant Id",
            "description": "Tenant Id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "unique": true,
            "foreignKeyRelationshipId": "relationship_7a4866f4-3964-4623-9c5d-407180c53fc0",
            "referencesEntityId": "entity_9bea86f6-a7e5-42e6-8a58-35e1722af867",
            "referencesAttributeId": "attribute_b54fb6fd-1a85-43f0-ac56-d5aeb363c1b4"
          },
          {
            "id": "attribute_d64dd851-bedb-453a-97be-9ddea811ee49",
            "logicalName": "User Id",
            "description": "User Id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "foreignKeyRelationshipId": "relationship_95bb54fa-78ab-46c5-915c-6274d0ab06b9",
            "referencesEntityId": "entity_23a52467-4fb2-483f-b3e1-f1fbb90f4559",
            "referencesAttributeId": "attribute_31576f60-7698-46d3-b86f-62033e8e9aad",
            "unique": true
          },
          {
            "id": "attribute_bdffc888-d20f-45d9-bb75-59a5cb6ac542",
            "logicalName": "Member Role",
            "description": "Member Role",
            "dataType": "VARCHAR(30)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_0098e1fa-6387-414d-b285-e3386bc63e1d",
            "logicalName": "Joined At",
            "description": "Joined At",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          }
        ]
      },
      {
        "id": "entity_d419fdf8-8a1f-4887-acbf-16c62cc708c2",
        "logicalName": "Plan",
        "description": "Plan",
        "x": 0,
        "y": 276,
        "width": 360,
        "attributes": [
          {
            "id": "attribute_27e34a02-3664-43d6-9ac0-b95c836e24e0",
            "logicalName": "Plan Id",
            "description": "Plan Id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_88491589-c725-4689-a842-9fa9c8fcf821",
            "logicalName": "Plan Code",
            "description": "Plan Code",
            "dataType": "VARCHAR(40)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true
          },
          {
            "id": "attribute_82978530-0165-42de-8809-94e3ca55d0a9",
            "logicalName": "Plan Name",
            "description": "Plan Name",
            "dataType": "VARCHAR(80)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_bf78853d-0d24-4aa0-9b1e-959cbf12ca75",
            "logicalName": "Monthly Price",
            "description": "Monthly Price",
            "dataType": "DECIMAL(10,2)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_2bd21413-606c-400e-a294-9ff6e07f925d",
            "logicalName": "Seat Limit",
            "description": "Seat Limit",
            "dataType": "INT",
            "nullable": true,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          }
        ]
      },
      {
        "id": "entity_82a154d6-047f-42a1-b1f3-c8072d7d8589",
        "logicalName": "Subscription",
        "description": "Subscription",
        "x": 540,
        "y": 567,
        "width": 360,
        "attributes": [
          {
            "id": "attribute_709c9a20-badc-4e6a-91c6-9b07dc05556d",
            "logicalName": "Subscription Id",
            "description": "Subscription Id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_ee8a418f-b8cb-44bf-b4d0-8bdb91f66db1",
            "logicalName": "Tenant Id",
            "description": "Tenant Id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "foreignKeyRelationshipId": "relationship_2307342e-4eb3-4a27-ae49-304336346c80",
            "referencesEntityId": "entity_9bea86f6-a7e5-42e6-8a58-35e1722af867",
            "referencesAttributeId": "attribute_b54fb6fd-1a85-43f0-ac56-d5aeb363c1b4",
            "unique": false
          },
          {
            "id": "attribute_42a0a4b8-3e43-487e-90b8-46842f0520e6",
            "logicalName": "Plan Id",
            "description": "Plan Id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "foreignKeyRelationshipId": "relationship_518eccde-5fe0-46e8-9a53-bf1597140394",
            "referencesEntityId": "entity_d419fdf8-8a1f-4887-acbf-16c62cc708c2",
            "referencesAttributeId": "attribute_27e34a02-3664-43d6-9ac0-b95c836e24e0",
            "unique": false
          },
          {
            "id": "attribute_2524a87a-2d18-493d-a064-57607c30c916",
            "logicalName": "Subscription Status",
            "description": "Subscription Status",
            "dataType": "varchar(30)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "domain": "Status Code"
          },
          {
            "id": "attribute_d7e4062c-60b5-4fe7-a3d3-51a40c44de47",
            "logicalName": "Current Period End",
            "description": "Current Period End",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          }
        ]
      },
      {
        "id": "entity_0933adbf-200f-4b18-9ce9-3eda16c279b0",
        "logicalName": "Invoice",
        "description": "Invoice",
        "x": 1080,
        "y": 550,
        "width": 360,
        "attributes": [
          {
            "id": "attribute_e0bb0f22-c1b1-41a2-8a0d-13f335c62113",
            "logicalName": "Invoice Id",
            "description": "Invoice Id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_1d0ce4f0-f15e-47ad-987e-b42c163c30f5",
            "logicalName": "Subscription Id",
            "description": "Subscription Id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "foreignKeyRelationshipId": "relationship_3e6f0584-a4eb-4dc9-bf82-ca8eb571c052",
            "referencesEntityId": "entity_82a154d6-047f-42a1-b1f3-c8072d7d8589",
            "referencesAttributeId": "attribute_709c9a20-badc-4e6a-91c6-9b07dc05556d",
            "unique": false
          },
          {
            "id": "attribute_8dd8a952-46e3-46cc-9302-d7cd7f266953",
            "logicalName": "Invoice Number",
            "description": "Invoice Number",
            "dataType": "VARCHAR(40)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true
          },
          {
            "id": "attribute_a0282638-ce58-42fb-9a01-d279e2b92add",
            "logicalName": "Invoice Amount",
            "description": "Invoice Amount",
            "dataType": "decimal(12,2)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "domain": "Money"
          },
          {
            "id": "attribute_eef30694-199a-49ef-9c4a-98a73a966502",
            "logicalName": "Issued At",
            "description": "Issued At",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          },
          {
            "id": "attribute_0f2efb5b-d74d-4289-99a8-10aa80b8f3f5",
            "logicalName": "Paid At",
            "description": "Paid At",
            "dataType": "TIMESTAMP",
            "nullable": true,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false
          }
        ]
      }
    ],
    "relationships": [
      {
        "id": "relationship_7a4866f4-3964-4623-9c5d-407180c53fc0",
        "sourceEntityId": "entity_9bea86f6-a7e5-42e6-8a58-35e1722af867",
        "targetEntityId": "entity_838424dc-876d-4e52-97e0-a480b5af151f",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying",
        "onDelete": "cascade",
        "constraintName": "fk_memberships_tenant"
      },
      {
        "id": "relationship_95bb54fa-78ab-46c5-915c-6274d0ab06b9",
        "sourceEntityId": "entity_23a52467-4fb2-483f-b3e1-f1fbb90f4559",
        "targetEntityId": "entity_838424dc-876d-4e52-97e0-a480b5af151f",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying",
        "onDelete": "cascade",
        "constraintName": "fk_memberships_user"
      },
      {
        "id": "relationship_2307342e-4eb3-4a27-ae49-304336346c80",
        "sourceEntityId": "entity_9bea86f6-a7e5-42e6-8a58-35e1722af867",
        "targetEntityId": "entity_82a154d6-047f-42a1-b1f3-c8072d7d8589",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying",
        "onDelete": "cascade",
        "constraintName": "fk_subscriptions_tenant"
      },
      {
        "id": "relationship_518eccde-5fe0-46e8-9a53-bf1597140394",
        "sourceEntityId": "entity_d419fdf8-8a1f-4887-acbf-16c62cc708c2",
        "targetEntityId": "entity_82a154d6-047f-42a1-b1f3-c8072d7d8589",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying",
        "onDelete": "restrict",
        "constraintName": "fk_subscriptions_plan"
      },
      {
        "id": "relationship_3e6f0584-a4eb-4dc9-bf82-ca8eb571c052",
        "sourceEntityId": "entity_82a154d6-047f-42a1-b1f3-c8072d7d8589",
        "targetEntityId": "entity_0933adbf-200f-4b18-9ce9-3eda16c279b0",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying",
        "onDelete": "restrict",
        "constraintName": "fk_invoices_subscription"
      }
    ]
  },
  "physicalModel": {
    "tables": [
      {
        "id": "table_72edd9c1-07b6-485e-ad03-2f1507dffbac",
        "logicalEntityId": "entity_9bea86f6-a7e5-42e6-8a58-35e1722af867",
        "physicalName": "tenants",
        "comment": "Tenant",
        "x": 0,
        "y": 584,
        "width": 360,
        "columns": [
          {
            "id": "column_d72a66a2-a02f-45e3-a9cc-bf4c22f443a1",
            "logicalAttributeId": "attribute_b54fb6fd-1a85-43f0-ac56-d5aeb363c1b4",
            "physicalName": "tenant_id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": true,
            "defaultValue": "",
            "comment": "Tenant Id",
            "manualOverride": true
          },
          {
            "id": "column_4f8b803d-ca02-4b87-9ee8-00641a91f879",
            "logicalAttributeId": "attribute_e5a01e24-4207-4fff-b9de-a486b46329de",
            "physicalName": "tenant_name",
            "dataType": "VARCHAR(120)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Tenant Name",
            "manualOverride": true
          },
          {
            "id": "column_ac9a1175-6e3a-45b1-9768-6c3fd1261f7f",
            "logicalAttributeId": "attribute_4f9e441f-b111-406e-80ac-f874da4f41e4",
            "physicalName": "tenant_slug",
            "dataType": "VARCHAR(60)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Tenant Slug",
            "manualOverride": true
          },
          {
            "id": "column_99cef081-bd24-46f3-92d7-5f60e2617166",
            "logicalAttributeId": "attribute_6ac04852-910b-4e12-abca-0fd4ec9a6a7b",
            "physicalName": "created_at",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Created At",
            "manualOverride": true
          }
        ],
        "indexes": [],
        "manualOverride": true
      },
      {
        "id": "table_322ad6c5-ae66-4989-b936-099b6e5109d9",
        "logicalEntityId": "entity_23a52467-4fb2-483f-b3e1-f1fbb90f4559",
        "physicalName": "users",
        "comment": "User",
        "x": 0,
        "y": 2,
        "width": 360,
        "columns": [
          {
            "id": "column_f7759fac-c55e-4859-bf18-a1673f5bab93",
            "logicalAttributeId": "attribute_31576f60-7698-46d3-b86f-62033e8e9aad",
            "physicalName": "user_id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": true,
            "defaultValue": "",
            "comment": "User Id",
            "manualOverride": true
          },
          {
            "id": "column_2c6ae8af-9040-48f0-ace4-a9295f587d9d",
            "logicalAttributeId": "attribute_f9e332e5-fe9f-4df4-896e-bc72993ceee7",
            "physicalName": "email",
            "dataType": "varchar(255)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Email",
            "manualOverride": true
          },
          {
            "id": "column_b1d3de07-d0a6-4a94-9c99-b087a233d840",
            "logicalAttributeId": "attribute_1e224249-c5c6-4194-94e3-1b854a6b0cc1",
            "physicalName": "display_name",
            "dataType": "VARCHAR(120)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Display Name",
            "manualOverride": true
          },
          {
            "id": "column_d20e2291-3caf-4480-a940-f49155059f04",
            "logicalAttributeId": "attribute_7d1448fe-d026-42ed-9252-2179461328dc",
            "physicalName": "created_at",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Created At",
            "manualOverride": true
          }
        ],
        "indexes": [],
        "manualOverride": true
      },
      {
        "id": "table_2f3a0dec-0278-446d-ba7a-301082f091eb",
        "logicalEntityId": "entity_838424dc-876d-4e52-97e0-a480b5af151f",
        "physicalName": "memberships",
        "comment": "Membership",
        "x": 540,
        "y": 0,
        "width": 360,
        "columns": [
          {
            "id": "column_f728b789-888d-454d-b396-bb19bd554fef",
            "logicalAttributeId": "attribute_eb240886-0484-4092-9847-a37127f1e18b",
            "physicalName": "membership_id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": true,
            "defaultValue": "",
            "comment": "Membership Id",
            "manualOverride": true
          },
          {
            "id": "column_a20327ed-4e5e-4501-881b-5663df1c3308",
            "logicalAttributeId": "attribute_2527bdba-6524-4cd3-a871-014b5b16ee7f",
            "physicalName": "tenant_id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "unique": true,
            "indexed": true,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Tenant Id",
            "manualOverride": true,
            "foreignKeyRelationshipId": "relationship_7a4866f4-3964-4623-9c5d-407180c53fc0",
            "referencesTableId": "table_72edd9c1-07b6-485e-ad03-2f1507dffbac",
            "referencesColumnId": "column_d72a66a2-a02f-45e3-a9cc-bf4c22f443a1"
          },
          {
            "id": "column_a589c1e3-6098-44be-930d-2273d59cf19a",
            "logicalAttributeId": "attribute_d64dd851-bedb-453a-97be-9ddea811ee49",
            "physicalName": "user_id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "unique": true,
            "indexed": true,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "User Id",
            "manualOverride": true,
            "foreignKeyRelationshipId": "relationship_95bb54fa-78ab-46c5-915c-6274d0ab06b9",
            "referencesTableId": "table_322ad6c5-ae66-4989-b936-099b6e5109d9",
            "referencesColumnId": "column_f7759fac-c55e-4859-bf18-a1673f5bab93"
          },
          {
            "id": "column_b157fa04-6466-4576-83dc-dbc0ff14b097",
            "logicalAttributeId": "attribute_bdffc888-d20f-45d9-bb75-59a5cb6ac542",
            "physicalName": "member_role",
            "dataType": "VARCHAR(30)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Member Role",
            "manualOverride": true
          },
          {
            "id": "column_0b55cb38-d4c2-4b68-8116-2db9c71b2441",
            "logicalAttributeId": "attribute_0098e1fa-6387-414d-b285-e3386bc63e1d",
            "physicalName": "joined_at",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Joined At",
            "manualOverride": true
          }
        ],
        "indexes": [
          {
            "id": "index_74134146-a583-4b5b-b5c8-fa1a3b878d82",
            "name": "uk_memberships_tenant_user",
            "unique": true,
            "columnIds": [
              "column_a20327ed-4e5e-4501-881b-5663df1c3308",
              "column_a589c1e3-6098-44be-930d-2273d59cf19a"
            ]
          }
        ],
        "manualOverride": true
      },
      {
        "id": "table_ca11a9ea-6291-430a-9c7d-f573cd92fb15",
        "logicalEntityId": "entity_d419fdf8-8a1f-4887-acbf-16c62cc708c2",
        "physicalName": "plans",
        "comment": "Plan",
        "x": 0,
        "y": 276,
        "width": 360,
        "columns": [
          {
            "id": "column_7bed7aae-f5aa-457b-8cd7-9796bda92fe4",
            "logicalAttributeId": "attribute_27e34a02-3664-43d6-9ac0-b95c836e24e0",
            "physicalName": "plan_id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": true,
            "defaultValue": "",
            "comment": "Plan Id",
            "manualOverride": true
          },
          {
            "id": "column_13a5914f-6dde-45d3-9593-0c49faef0ac8",
            "logicalAttributeId": "attribute_88491589-c725-4689-a842-9fa9c8fcf821",
            "physicalName": "plan_code",
            "dataType": "VARCHAR(40)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Plan Code",
            "manualOverride": true
          },
          {
            "id": "column_9464e321-ecae-45f0-a09e-3f3c2965369f",
            "logicalAttributeId": "attribute_82978530-0165-42de-8809-94e3ca55d0a9",
            "physicalName": "plan_name",
            "dataType": "VARCHAR(80)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Plan Name",
            "manualOverride": true
          },
          {
            "id": "column_54a43420-fd7f-4dcd-9936-0f0fab5302bd",
            "logicalAttributeId": "attribute_bf78853d-0d24-4aa0-9b1e-959cbf12ca75",
            "physicalName": "monthly_price",
            "dataType": "DECIMAL(10,2)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Monthly Price",
            "manualOverride": true
          },
          {
            "id": "column_c6f0d7d5-08c4-4331-b6b2-80854295bded",
            "logicalAttributeId": "attribute_2bd21413-606c-400e-a294-9ff6e07f925d",
            "physicalName": "seat_limit",
            "dataType": "INT",
            "nullable": true,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Seat Limit",
            "manualOverride": true
          }
        ],
        "indexes": [],
        "manualOverride": true
      },
      {
        "id": "table_81cc9d65-a159-4c4c-b17d-e76a8392f307",
        "logicalEntityId": "entity_82a154d6-047f-42a1-b1f3-c8072d7d8589",
        "physicalName": "subscriptions",
        "comment": "Subscription",
        "x": 540,
        "y": 567,
        "width": 360,
        "columns": [
          {
            "id": "column_6eb0dd59-9809-47af-8e08-448281d345c0",
            "logicalAttributeId": "attribute_709c9a20-badc-4e6a-91c6-9b07dc05556d",
            "physicalName": "subscription_id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": true,
            "defaultValue": "",
            "comment": "Subscription Id",
            "manualOverride": true
          },
          {
            "id": "column_c60aa7a8-8072-418b-bdcf-d566af1a0285",
            "logicalAttributeId": "attribute_ee8a418f-b8cb-44bf-b4d0-8bdb91f66db1",
            "physicalName": "tenant_id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "unique": false,
            "indexed": true,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Tenant Id",
            "manualOverride": true,
            "foreignKeyRelationshipId": "relationship_2307342e-4eb3-4a27-ae49-304336346c80",
            "referencesTableId": "table_72edd9c1-07b6-485e-ad03-2f1507dffbac",
            "referencesColumnId": "column_d72a66a2-a02f-45e3-a9cc-bf4c22f443a1"
          },
          {
            "id": "column_8205bc4b-2797-4392-b087-4376eb737c67",
            "logicalAttributeId": "attribute_42a0a4b8-3e43-487e-90b8-46842f0520e6",
            "physicalName": "plan_id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "unique": false,
            "indexed": true,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Plan Id",
            "manualOverride": true,
            "foreignKeyRelationshipId": "relationship_518eccde-5fe0-46e8-9a53-bf1597140394",
            "referencesTableId": "table_ca11a9ea-6291-430a-9c7d-f573cd92fb15",
            "referencesColumnId": "column_7bed7aae-f5aa-457b-8cd7-9796bda92fe4"
          },
          {
            "id": "column_3da67df4-5595-4fb6-95e6-1df4566f0c74",
            "logicalAttributeId": "attribute_2524a87a-2d18-493d-a064-57607c30c916",
            "physicalName": "subscription_status",
            "dataType": "varchar(30)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Subscription Status",
            "manualOverride": true
          },
          {
            "id": "column_5dbe546e-8304-4ab7-929c-64f39813b79e",
            "logicalAttributeId": "attribute_d7e4062c-60b5-4fe7-a3d3-51a40c44de47",
            "physicalName": "current_period_end",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Current Period End",
            "manualOverride": true
          }
        ],
        "indexes": [
          {
            "id": "index_7b768f91-7d94-43ff-8143-903d24627021",
            "name": "idx_subscriptions_tenant",
            "unique": false,
            "columnIds": [
              "column_c60aa7a8-8072-418b-bdcf-d566af1a0285"
            ]
          }
        ],
        "manualOverride": true
      },
      {
        "id": "table_55b373ee-c314-4c44-adf3-03873319eba6",
        "logicalEntityId": "entity_0933adbf-200f-4b18-9ce9-3eda16c279b0",
        "physicalName": "invoices",
        "comment": "Invoice",
        "x": 1080,
        "y": 550,
        "width": 360,
        "columns": [
          {
            "id": "column_310e3160-7b5a-4426-b84f-0a29e275e081",
            "logicalAttributeId": "attribute_e0bb0f22-c1b1-41a2-8a0d-13f335c62113",
            "physicalName": "invoice_id",
            "dataType": "BIGINT",
            "nullable": true,
            "primaryKey": true,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": true,
            "defaultValue": "",
            "comment": "Invoice Id",
            "manualOverride": true
          },
          {
            "id": "column_e0d36aeb-ef2f-4b5a-89e1-f7b95bca6244",
            "logicalAttributeId": "attribute_1d0ce4f0-f15e-47ad-987e-b42c163c30f5",
            "physicalName": "subscription_id",
            "dataType": "BIGINT",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": true,
            "unique": false,
            "indexed": true,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Subscription Id",
            "manualOverride": true,
            "foreignKeyRelationshipId": "relationship_3e6f0584-a4eb-4dc9-bf82-ca8eb571c052",
            "referencesTableId": "table_81cc9d65-a159-4c4c-b17d-e76a8392f307",
            "referencesColumnId": "column_6eb0dd59-9809-47af-8e08-448281d345c0"
          },
          {
            "id": "column_dde31bff-44b8-4869-8b38-e32f612c57ef",
            "logicalAttributeId": "attribute_8dd8a952-46e3-46cc-9302-d7cd7f266953",
            "physicalName": "invoice_number",
            "dataType": "VARCHAR(40)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": true,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Invoice Number",
            "manualOverride": true
          },
          {
            "id": "column_1d91ff02-a6f6-40a6-a8cc-4583e031b0ed",
            "logicalAttributeId": "attribute_a0282638-ce58-42fb-9a01-d279e2b92add",
            "physicalName": "invoice_amount",
            "dataType": "decimal(12,2)",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Invoice Amount",
            "manualOverride": true
          },
          {
            "id": "column_7d67f0ae-7d1d-4a49-823d-8c835331aae5",
            "logicalAttributeId": "attribute_eef30694-199a-49ef-9c4a-98a73a966502",
            "physicalName": "issued_at",
            "dataType": "TIMESTAMP",
            "nullable": false,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Issued At",
            "manualOverride": true
          },
          {
            "id": "column_cec5f0e5-c30a-4eb4-bcf5-f349eceb66c7",
            "logicalAttributeId": "attribute_0f2efb5b-d74d-4289-99a8-10aa80b8f3f5",
            "physicalName": "paid_at",
            "dataType": "TIMESTAMP",
            "nullable": true,
            "primaryKey": false,
            "foreignKey": false,
            "unique": false,
            "indexed": false,
            "autoIncrement": false,
            "defaultValue": "",
            "comment": "Paid At",
            "manualOverride": true
          }
        ],
        "indexes": [
          {
            "id": "index_79da9543-1836-4c28-b1ee-44b624cfce8a",
            "name": "idx_invoices_subscription",
            "unique": false,
            "columnIds": [
              "column_e0d36aeb-ef2f-4b5a-89e1-f7b95bca6244"
            ]
          }
        ],
        "manualOverride": true
      }
    ],
    "relationships": [
      {
        "id": "physicalRelationship_e022ef01-d611-44df-a95b-2cc0db3cbc8d",
        "logicalRelationshipId": "relationship_7a4866f4-3964-4623-9c5d-407180c53fc0",
        "sourceTableId": "table_72edd9c1-07b6-485e-ad03-2f1507dffbac",
        "targetTableId": "table_2f3a0dec-0278-446d-ba7a-301082f091eb",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying"
      },
      {
        "id": "physicalRelationship_bf7304a1-0435-444b-a50e-26f93e3c67bb",
        "logicalRelationshipId": "relationship_95bb54fa-78ab-46c5-915c-6274d0ab06b9",
        "sourceTableId": "table_322ad6c5-ae66-4989-b936-099b6e5109d9",
        "targetTableId": "table_2f3a0dec-0278-446d-ba7a-301082f091eb",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying"
      },
      {
        "id": "physicalRelationship_a2ac0e32-e5be-44c6-9b00-a6eb6f456e65",
        "logicalRelationshipId": "relationship_2307342e-4eb3-4a27-ae49-304336346c80",
        "sourceTableId": "table_72edd9c1-07b6-485e-ad03-2f1507dffbac",
        "targetTableId": "table_81cc9d65-a159-4c4c-b17d-e76a8392f307",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying"
      },
      {
        "id": "physicalRelationship_cec9786b-e4cc-4fd3-b782-832eb0be8a4c",
        "logicalRelationshipId": "relationship_518eccde-5fe0-46e8-9a53-bf1597140394",
        "sourceTableId": "table_ca11a9ea-6291-430a-9c7d-f573cd92fb15",
        "targetTableId": "table_81cc9d65-a159-4c4c-b17d-e76a8392f307",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying"
      },
      {
        "id": "physicalRelationship_fbaa92df-e342-4858-ba46-ee7bfff02c99",
        "logicalRelationshipId": "relationship_3e6f0584-a4eb-4dc9-bf82-ca8eb571c052",
        "sourceTableId": "table_81cc9d65-a159-4c4c-b17d-e76a8392f307",
        "targetTableId": "table_55b373ee-c314-4c44-adf3-03873319eba6",
        "cardinality": "1:N",
        "sourceEnd": "one",
        "targetEnd": "zeroOrMany",
        "relationshipType": "nonIdentifying"
      }
    ]
  },
  "wordDictionary": {
    "entries": [
      {
        "id": "word_7ec87376-420d-4e9e-905a-e7ab280cb7f9",
        "logicalWord": "Amount",
        "physicalWord": "AMOUNT",
        "abbreviation": "",
        "englishName": "",
        "description": "Monetary value",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_03e6e2f2-a4ce-47d3-82d0-0ce4a6032281",
        "logicalWord": "At",
        "physicalWord": "AT",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_e71b9060-07a3-490f-86ee-94be77976c10",
        "logicalWord": "Code",
        "physicalWord": "CODE",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_c7a2a796-1a1f-43bd-874b-b832df562eb5",
        "logicalWord": "Created",
        "physicalWord": "CREATED",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_9e5bae5e-a2a7-49b5-b134-a44afc7d21f2",
        "logicalWord": "Current",
        "physicalWord": "CURRENT",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_6d7b8e4d-4224-4c47-8048-02ca9b3d3fe1",
        "logicalWord": "Display",
        "physicalWord": "DISPLAY",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_9949b69f-5713-43c2-b6f7-af63b01acc60",
        "logicalWord": "Email",
        "physicalWord": "EMAIL",
        "abbreviation": "",
        "englishName": "",
        "description": "Email address",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_7333383b-e59d-4dd6-b9f9-21109a6cffaa",
        "logicalWord": "End",
        "physicalWord": "END",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_dc26fc82-7329-486f-b105-922ada6f3268",
        "logicalWord": "Id",
        "physicalWord": "ID",
        "abbreviation": "",
        "englishName": "",
        "description": "Unique key for a record",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_3142572e-ef1f-4188-bf1a-dff57425f7bd",
        "logicalWord": "Invoice",
        "physicalWord": "INVOICE",
        "abbreviation": "",
        "englishName": "",
        "description": "A billing document",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_071802a1-6a9a-4936-a2b7-35decb39bffa",
        "logicalWord": "Issued",
        "physicalWord": "ISSUED",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_543208cd-0d7c-413b-b52f-241fd77585c1",
        "logicalWord": "Joined",
        "physicalWord": "JOINED",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_9f9bbeb0-6472-456d-a402-b2045ee6c304",
        "logicalWord": "Limit",
        "physicalWord": "LIMIT",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_5ad09ac5-c45c-4935-a677-ed024a35456f",
        "logicalWord": "Member",
        "physicalWord": "MEMBER",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_e54a5156-1126-4aa2-b6b5-5edbc248ca40",
        "logicalWord": "Membership",
        "physicalWord": "MEMBERSHIP",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_4fdb175c-ec87-49c4-9eea-6ae2488e6f84",
        "logicalWord": "Monthly",
        "physicalWord": "MONTHLY",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_5e09ea31-525b-487d-be1a-dda4f6430623",
        "logicalWord": "Name",
        "physicalWord": "NAME",
        "abbreviation": "",
        "englishName": "",
        "description": "Human-readable label",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_b65daf19-a216-4f3c-a92c-e582e4c0cf90",
        "logicalWord": "Number",
        "physicalWord": "NUMBER",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_44e9698a-88ed-4a36-8fbc-494f26b480dc",
        "logicalWord": "Paid",
        "physicalWord": "PAID",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_4b00e75c-f325-4c63-abe7-64bad675b5ec",
        "logicalWord": "Period",
        "physicalWord": "PERIOD",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_f915bb9d-44eb-4d0c-a4ec-d6df32ba255e",
        "logicalWord": "Plan",
        "physicalWord": "PLAN",
        "abbreviation": "",
        "englishName": "",
        "description": "A billable subscription tier",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_72fb4994-9265-44f4-8ff0-126bcd4ec4dc",
        "logicalWord": "Price",
        "physicalWord": "PRICE",
        "abbreviation": "",
        "englishName": "",
        "description": "Selling price of an item",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_cc1515fd-f6ca-45da-9b6b-48ea46272368",
        "logicalWord": "Role",
        "physicalWord": "ROLE",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_35b505ea-5974-418e-9988-6bf70bec8dd8",
        "logicalWord": "Seat",
        "physicalWord": "SEAT",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_8615c8b0-7324-4dd7-ad4a-9be8c7898e33",
        "logicalWord": "Slug",
        "physicalWord": "SLUG",
        "abbreviation": "",
        "englishName": "",
        "description": "",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_3193b705-a127-4005-ba06-f3e11c942f10",
        "logicalWord": "Status",
        "physicalWord": "STATUS",
        "abbreviation": "",
        "englishName": "",
        "description": "Lifecycle state of a record",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_fd3c1617-5f91-4a80-b3a1-4323d10beb5a",
        "logicalWord": "Subscription",
        "physicalWord": "SUBSCRIPTION",
        "abbreviation": "",
        "englishName": "",
        "description": "An active plan for a tenant",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_5058a809-535c-41c9-bf4f-25f7126fa8b8",
        "logicalWord": "Tenant",
        "physicalWord": "TENANT",
        "abbreviation": "",
        "englishName": "",
        "description": "An isolated customer organization",
        "enabled": true,
        "synonyms": []
      },
      {
        "id": "word_ea18a906-54ff-408e-a26b-05d7c1e3d2f7",
        "logicalWord": "User",
        "physicalWord": "USER",
        "abbreviation": "",
        "englishName": "",
        "description": "An account holder",
        "enabled": true,
        "synonyms": []
      }
    ]
  },
  "domains": [
    {
      "id": "domain_d91b0fe4-cd3e-4ec9-b74e-2c4b4857d2da",
      "name": "Email",
      "dataType": "varchar(255)",
      "description": "Email address"
    },
    {
      "id": "domain_b53b11ff-4846-490c-9fd9-5321601a827d",
      "name": "Money",
      "dataType": "decimal(12,2)",
      "description": "Monetary value"
    },
    {
      "id": "domain_db61d04b-b15f-48a0-93f0-d8d7dca37f23",
      "name": "Status Code",
      "dataType": "varchar(30)",
      "description": "Lifecycle status value"
    }
  ],
  "subjectAreas": [],
  "entityReferences": [],
  "notes": [],
  "namingRules": {
    "separator": "_",
    "casing": "lower",
    "unknownWordMode": "warn"
  },
  "viewport": {
    "x": 0,
    "y": 0,
    "zoom": 1
  },
  "updatedAt": "2026-07-19T09:05:12.961Z"
}