@open-mercato/core 0.4.5-develop-da65148ceb → 0.4.5-develop-a4c86906a0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ import { Migration } from "@mikro-orm/migrations";
2
+ class Migration20260226155449 extends Migration {
3
+ async up() {
4
+ this.addSql(`create table "customer_pipelines" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "name" text not null, "is_default" boolean not null default false, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "customer_pipelines_pkey" primary key ("id"));`);
5
+ this.addSql(`create index "customer_pipelines_org_tenant_idx" on "customer_pipelines" ("organization_id", "tenant_id");`);
6
+ this.addSql(`create table "customer_pipeline_stages" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "pipeline_id" uuid not null, "name" text not null, "position" int not null default 0, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "customer_pipeline_stages_pkey" primary key ("id"));`);
7
+ this.addSql(`create index "customer_pipeline_stages_org_tenant_idx" on "customer_pipeline_stages" ("organization_id", "tenant_id");`);
8
+ this.addSql(`create index "customer_pipeline_stages_pipeline_position_idx" on "customer_pipeline_stages" ("pipeline_id", "position");`);
9
+ this.addSql(`alter table "customer_deals" add column "pipeline_id" uuid null, add column "pipeline_stage_id" uuid null;`);
10
+ }
11
+ async down() {
12
+ this.addSql(`alter table "customer_deals" drop column "pipeline_id", drop column "pipeline_stage_id";`);
13
+ }
14
+ }
15
+ export {
16
+ Migration20260226155449
17
+ };
18
+ //# sourceMappingURL=Migration20260226155449.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/modules/customers/migrations/Migration20260226155449.ts"],
4
+ "sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260226155449 extends Migration {\n\n override async up(): Promise<void> {\n this.addSql(`create table \"customer_pipelines\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"name\" text not null, \"is_default\" boolean not null default false, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, constraint \"customer_pipelines_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_pipelines_org_tenant_idx\" on \"customer_pipelines\" (\"organization_id\", \"tenant_id\");`);\n\n this.addSql(`create table \"customer_pipeline_stages\" (\"id\" uuid not null default gen_random_uuid(), \"organization_id\" uuid not null, \"tenant_id\" uuid not null, \"pipeline_id\" uuid not null, \"name\" text not null, \"position\" int not null default 0, \"created_at\" timestamptz not null, \"updated_at\" timestamptz not null, constraint \"customer_pipeline_stages_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_pipeline_stages_org_tenant_idx\" on \"customer_pipeline_stages\" (\"organization_id\", \"tenant_id\");`);\n this.addSql(`create index \"customer_pipeline_stages_pipeline_position_idx\" on \"customer_pipeline_stages\" (\"pipeline_id\", \"position\");`);\n\n this.addSql(`alter table \"customer_deals\" add column \"pipeline_id\" uuid null, add column \"pipeline_stage_id\" uuid null;`);\n }\n\n override async down(): Promise<void> {\n this.addSql(`alter table \"customer_deals\" drop column \"pipeline_id\", drop column \"pipeline_stage_id\";`);\n }\n\n}\n"],
5
+ "mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,gCAAgC,UAAU;AAAA,EAErD,MAAe,KAAoB;AACjC,SAAK,OAAO,iVAAiV;AAC7V,SAAK,OAAO,4GAA4G;AAExH,SAAK,OAAO,gXAAgX;AAC5X,SAAK,OAAO,wHAAwH;AACpI,SAAK,OAAO,0HAA0H;AAEtI,SAAK,OAAO,4GAA4G;AAAA,EAC1H;AAAA,EAEA,MAAe,OAAsB;AACnC,SAAK,OAAO,0FAA0F;AAAA,EACxG;AAEF;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/core",
3
- "version": "0.4.5-develop-da65148ceb",
3
+ "version": "0.4.5-develop-a4c86906a0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -207,7 +207,7 @@
207
207
  }
208
208
  },
209
209
  "dependencies": {
210
- "@open-mercato/shared": "0.4.5-develop-da65148ceb",
210
+ "@open-mercato/shared": "0.4.5-develop-a4c86906a0",
211
211
  "@types/semver": "^7.5.8",
212
212
  "@xyflow/react": "^12.6.0",
213
213
  "ai": "^6.0.0",
@@ -71,6 +71,24 @@
71
71
  "nullable": true,
72
72
  "mappedType": "text"
73
73
  },
74
+ "pipeline_id": {
75
+ "name": "pipeline_id",
76
+ "type": "uuid",
77
+ "unsigned": false,
78
+ "autoincrement": false,
79
+ "primary": false,
80
+ "nullable": true,
81
+ "mappedType": "uuid"
82
+ },
83
+ "pipeline_stage_id": {
84
+ "name": "pipeline_stage_id",
85
+ "type": "uuid",
86
+ "unsigned": false,
87
+ "autoincrement": false,
88
+ "primary": false,
89
+ "nullable": true,
90
+ "mappedType": "uuid"
91
+ },
74
92
  "value_amount": {
75
93
  "name": "value_amount",
76
94
  "type": "numeric(14,2)",
@@ -707,7 +725,6 @@
707
725
  "id"
708
726
  ],
709
727
  "referencedTableName": "public.customer_deals",
710
- "createForeignKeyConstraint": true,
711
728
  "updateRule": "cascade"
712
729
  },
713
730
  "customer_deal_people_person_entity_id_foreign": {
@@ -720,7 +737,6 @@
720
737
  "id"
721
738
  ],
722
739
  "referencedTableName": "public.customer_entities",
723
- "createForeignKeyConstraint": true,
724
740
  "updateRule": "cascade"
725
741
  }
726
742
  },
@@ -824,7 +840,6 @@
824
840
  "id"
825
841
  ],
826
842
  "referencedTableName": "public.customer_deals",
827
- "createForeignKeyConstraint": true,
828
843
  "updateRule": "cascade"
829
844
  },
830
845
  "customer_deal_companies_company_entity_id_foreign": {
@@ -837,7 +852,6 @@
837
852
  "id"
838
853
  ],
839
854
  "referencedTableName": "public.customer_entities",
840
- "createForeignKeyConstraint": true,
841
855
  "updateRule": "cascade"
842
856
  }
843
857
  },
@@ -1024,7 +1038,6 @@
1024
1038
  "id"
1025
1039
  ],
1026
1040
  "referencedTableName": "public.customer_entities",
1027
- "createForeignKeyConstraint": true,
1028
1041
  "updateRule": "cascade"
1029
1042
  }
1030
1043
  },
@@ -1192,7 +1205,6 @@
1192
1205
  "id"
1193
1206
  ],
1194
1207
  "referencedTableName": "public.customer_entities",
1195
- "createForeignKeyConstraint": true,
1196
1208
  "updateRule": "cascade"
1197
1209
  },
1198
1210
  "customer_comments_deal_id_foreign": {
@@ -1205,7 +1217,6 @@
1205
1217
  "id"
1206
1218
  ],
1207
1219
  "referencedTableName": "public.customer_deals",
1208
- "createForeignKeyConstraint": true,
1209
1220
  "deleteRule": "set null",
1210
1221
  "updateRule": "cascade"
1211
1222
  }
@@ -1435,7 +1446,6 @@
1435
1446
  "id"
1436
1447
  ],
1437
1448
  "referencedTableName": "public.customer_entities",
1438
- "createForeignKeyConstraint": true,
1439
1449
  "updateRule": "cascade"
1440
1450
  }
1441
1451
  },
@@ -1633,7 +1643,6 @@
1633
1643
  "id"
1634
1644
  ],
1635
1645
  "referencedTableName": "public.customer_entities",
1636
- "createForeignKeyConstraint": true,
1637
1646
  "updateRule": "cascade"
1638
1647
  },
1639
1648
  "customer_activities_deal_id_foreign": {
@@ -1646,7 +1655,6 @@
1646
1655
  "id"
1647
1656
  ],
1648
1657
  "referencedTableName": "public.customer_deals",
1649
- "createForeignKeyConstraint": true,
1650
1658
  "deleteRule": "set null",
1651
1659
  "updateRule": "cascade"
1652
1660
  }
@@ -1859,7 +1867,6 @@
1859
1867
  "id"
1860
1868
  ],
1861
1869
  "referencedTableName": "public.customer_entities",
1862
- "createForeignKeyConstraint": true,
1863
1870
  "updateRule": "cascade"
1864
1871
  },
1865
1872
  "customer_people_company_entity_id_foreign": {
@@ -1872,13 +1879,230 @@
1872
1879
  "id"
1873
1880
  ],
1874
1881
  "referencedTableName": "public.customer_entities",
1875
- "createForeignKeyConstraint": true,
1876
1882
  "deleteRule": "set null",
1877
1883
  "updateRule": "cascade"
1878
1884
  }
1879
1885
  },
1880
1886
  "nativeEnums": {}
1881
1887
  },
1888
+ {
1889
+ "columns": {
1890
+ "id": {
1891
+ "name": "id",
1892
+ "type": "uuid",
1893
+ "unsigned": false,
1894
+ "autoincrement": false,
1895
+ "primary": false,
1896
+ "nullable": false,
1897
+ "default": "gen_random_uuid()",
1898
+ "mappedType": "uuid"
1899
+ },
1900
+ "organization_id": {
1901
+ "name": "organization_id",
1902
+ "type": "uuid",
1903
+ "unsigned": false,
1904
+ "autoincrement": false,
1905
+ "primary": false,
1906
+ "nullable": false,
1907
+ "mappedType": "uuid"
1908
+ },
1909
+ "tenant_id": {
1910
+ "name": "tenant_id",
1911
+ "type": "uuid",
1912
+ "unsigned": false,
1913
+ "autoincrement": false,
1914
+ "primary": false,
1915
+ "nullable": false,
1916
+ "mappedType": "uuid"
1917
+ },
1918
+ "name": {
1919
+ "name": "name",
1920
+ "type": "text",
1921
+ "unsigned": false,
1922
+ "autoincrement": false,
1923
+ "primary": false,
1924
+ "nullable": false,
1925
+ "mappedType": "text"
1926
+ },
1927
+ "is_default": {
1928
+ "name": "is_default",
1929
+ "type": "boolean",
1930
+ "unsigned": false,
1931
+ "autoincrement": false,
1932
+ "primary": false,
1933
+ "nullable": false,
1934
+ "default": "false",
1935
+ "mappedType": "boolean"
1936
+ },
1937
+ "created_at": {
1938
+ "name": "created_at",
1939
+ "type": "timestamptz",
1940
+ "unsigned": false,
1941
+ "autoincrement": false,
1942
+ "primary": false,
1943
+ "nullable": false,
1944
+ "length": 6,
1945
+ "mappedType": "datetime"
1946
+ },
1947
+ "updated_at": {
1948
+ "name": "updated_at",
1949
+ "type": "timestamptz",
1950
+ "unsigned": false,
1951
+ "autoincrement": false,
1952
+ "primary": false,
1953
+ "nullable": false,
1954
+ "length": 6,
1955
+ "mappedType": "datetime"
1956
+ }
1957
+ },
1958
+ "name": "customer_pipelines",
1959
+ "schema": "public",
1960
+ "indexes": [
1961
+ {
1962
+ "keyName": "customer_pipelines_org_tenant_idx",
1963
+ "columnNames": [
1964
+ "organization_id",
1965
+ "tenant_id"
1966
+ ],
1967
+ "composite": true,
1968
+ "constraint": false,
1969
+ "primary": false,
1970
+ "unique": false
1971
+ },
1972
+ {
1973
+ "keyName": "customer_pipelines_pkey",
1974
+ "columnNames": [
1975
+ "id"
1976
+ ],
1977
+ "composite": false,
1978
+ "constraint": true,
1979
+ "primary": true,
1980
+ "unique": true
1981
+ }
1982
+ ],
1983
+ "checks": [],
1984
+ "foreignKeys": {},
1985
+ "nativeEnums": {}
1986
+ },
1987
+ {
1988
+ "columns": {
1989
+ "id": {
1990
+ "name": "id",
1991
+ "type": "uuid",
1992
+ "unsigned": false,
1993
+ "autoincrement": false,
1994
+ "primary": false,
1995
+ "nullable": false,
1996
+ "default": "gen_random_uuid()",
1997
+ "mappedType": "uuid"
1998
+ },
1999
+ "organization_id": {
2000
+ "name": "organization_id",
2001
+ "type": "uuid",
2002
+ "unsigned": false,
2003
+ "autoincrement": false,
2004
+ "primary": false,
2005
+ "nullable": false,
2006
+ "mappedType": "uuid"
2007
+ },
2008
+ "tenant_id": {
2009
+ "name": "tenant_id",
2010
+ "type": "uuid",
2011
+ "unsigned": false,
2012
+ "autoincrement": false,
2013
+ "primary": false,
2014
+ "nullable": false,
2015
+ "mappedType": "uuid"
2016
+ },
2017
+ "pipeline_id": {
2018
+ "name": "pipeline_id",
2019
+ "type": "uuid",
2020
+ "unsigned": false,
2021
+ "autoincrement": false,
2022
+ "primary": false,
2023
+ "nullable": false,
2024
+ "mappedType": "uuid"
2025
+ },
2026
+ "name": {
2027
+ "name": "name",
2028
+ "type": "text",
2029
+ "unsigned": false,
2030
+ "autoincrement": false,
2031
+ "primary": false,
2032
+ "nullable": false,
2033
+ "mappedType": "text"
2034
+ },
2035
+ "position": {
2036
+ "name": "position",
2037
+ "type": "int",
2038
+ "unsigned": false,
2039
+ "autoincrement": false,
2040
+ "primary": false,
2041
+ "nullable": false,
2042
+ "default": "0",
2043
+ "mappedType": "integer"
2044
+ },
2045
+ "created_at": {
2046
+ "name": "created_at",
2047
+ "type": "timestamptz",
2048
+ "unsigned": false,
2049
+ "autoincrement": false,
2050
+ "primary": false,
2051
+ "nullable": false,
2052
+ "length": 6,
2053
+ "mappedType": "datetime"
2054
+ },
2055
+ "updated_at": {
2056
+ "name": "updated_at",
2057
+ "type": "timestamptz",
2058
+ "unsigned": false,
2059
+ "autoincrement": false,
2060
+ "primary": false,
2061
+ "nullable": false,
2062
+ "length": 6,
2063
+ "mappedType": "datetime"
2064
+ }
2065
+ },
2066
+ "name": "customer_pipeline_stages",
2067
+ "schema": "public",
2068
+ "indexes": [
2069
+ {
2070
+ "keyName": "customer_pipeline_stages_org_tenant_idx",
2071
+ "columnNames": [
2072
+ "organization_id",
2073
+ "tenant_id"
2074
+ ],
2075
+ "composite": true,
2076
+ "constraint": false,
2077
+ "primary": false,
2078
+ "unique": false
2079
+ },
2080
+ {
2081
+ "keyName": "customer_pipeline_stages_pipeline_position_idx",
2082
+ "columnNames": [
2083
+ "pipeline_id",
2084
+ "position"
2085
+ ],
2086
+ "composite": true,
2087
+ "constraint": false,
2088
+ "primary": false,
2089
+ "unique": false
2090
+ },
2091
+ {
2092
+ "keyName": "customer_pipeline_stages_pkey",
2093
+ "columnNames": [
2094
+ "id"
2095
+ ],
2096
+ "composite": false,
2097
+ "constraint": true,
2098
+ "primary": true,
2099
+ "unique": true
2100
+ }
2101
+ ],
2102
+ "checks": [],
2103
+ "foreignKeys": {},
2104
+ "nativeEnums": {}
2105
+ },
1882
2106
  {
1883
2107
  "columns": {
1884
2108
  "id": {
@@ -2203,7 +2427,6 @@
2203
2427
  "id"
2204
2428
  ],
2205
2429
  "referencedTableName": "public.customer_tags",
2206
- "createForeignKeyConstraint": true,
2207
2430
  "updateRule": "cascade"
2208
2431
  },
2209
2432
  "customer_tag_assignments_entity_id_foreign": {
@@ -2216,7 +2439,6 @@
2216
2439
  "id"
2217
2440
  ],
2218
2441
  "referencedTableName": "public.customer_entities",
2219
- "createForeignKeyConstraint": true,
2220
2442
  "updateRule": "cascade"
2221
2443
  }
2222
2444
  },
@@ -2359,7 +2581,6 @@
2359
2581
  "id"
2360
2582
  ],
2361
2583
  "referencedTableName": "public.customer_entities",
2362
- "createForeignKeyConstraint": true,
2363
2584
  "updateRule": "cascade"
2364
2585
  }
2365
2586
  },
@@ -0,0 +1,20 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+
3
+ export class Migration20260226155449 extends Migration {
4
+
5
+ override async up(): Promise<void> {
6
+ this.addSql(`create table "customer_pipelines" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "name" text not null, "is_default" boolean not null default false, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "customer_pipelines_pkey" primary key ("id"));`);
7
+ this.addSql(`create index "customer_pipelines_org_tenant_idx" on "customer_pipelines" ("organization_id", "tenant_id");`);
8
+
9
+ this.addSql(`create table "customer_pipeline_stages" ("id" uuid not null default gen_random_uuid(), "organization_id" uuid not null, "tenant_id" uuid not null, "pipeline_id" uuid not null, "name" text not null, "position" int not null default 0, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "customer_pipeline_stages_pkey" primary key ("id"));`);
10
+ this.addSql(`create index "customer_pipeline_stages_org_tenant_idx" on "customer_pipeline_stages" ("organization_id", "tenant_id");`);
11
+ this.addSql(`create index "customer_pipeline_stages_pipeline_position_idx" on "customer_pipeline_stages" ("pipeline_id", "position");`);
12
+
13
+ this.addSql(`alter table "customer_deals" add column "pipeline_id" uuid null, add column "pipeline_stage_id" uuid null;`);
14
+ }
15
+
16
+ override async down(): Promise<void> {
17
+ this.addSql(`alter table "customer_deals" drop column "pipeline_id", drop column "pipeline_stage_id";`);
18
+ }
19
+
20
+ }