@ysgroup/contracts 0.1.34 → 0.1.36

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +233 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ysgroup/contracts",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/index.ts CHANGED
@@ -4,13 +4,14 @@
4
4
  export type AccountType = "STOCK" | "FUTURES" | "CREDIT" | "STOCK_OPTION" | "GOLD" | "INCOME_SWAP" | "FUTURES_OPTION" | "HUGANGTONG" | "NEW3BOARD" | "SHENGANGTONG";
5
5
  export type AppKind = "service" | "link";
6
6
  export type AppStatus = "enabled" | "disabled" | "maintenance";
7
- export type AuthorizationTable = "users" | "teams" | "owners" | "accounts" | "exchange_accounts" | "mount_exchange_accounts" | "bank_cards" | "banks" | "cnaps" | "custodians" | "strategies" | "projects" | "project_owner" | "owner_strategy" | "account_strategy" | "company_employees" | "brokers" | "broker_branches" | "servers" | "trading_counters" | "trading_nodes" | "trading_seats" | "counter_suppliers" | "server_rooms" | "file_metas" | "app_configs";
7
+ export type AuthorizationTable = "users" | "teams" | "owners" | "accounts" | "exchange_accounts" | "mount_exchange_accounts" | "bank_cards" | "banks" | "cnaps" | "custodians" | "strategies" | "projects" | "project_owner" | "owner_strategy" | "account_strategy" | "company_employees" | "org_units" | "brokers" | "broker_branches" | "servers" | "trading_counters" | "trading_nodes" | "trading_seats" | "counter_suppliers" | "server_rooms" | "file_metas" | "app_configs";
8
8
  export type ChangeOp = "upsert" | "delete";
9
9
  export type CounterTier = "low_latency_95" | "low_latency_85" | "low_latency_98" | "apex_99";
10
10
  export type ExchangeBusinessPlatform = "1" | "2" | "3" | "4" | "5" | "6" | "MTP" | "ATP" | "DTP" | "XBTP" | "ITP" | "FISP" | "IITP";
11
11
  export type ExchangeType = "SH" | "SZ" | "SHFE" | "CFFEX" | "CZCE" | "DCE" | "GFEX" | "INE" | "SGE";
12
12
  export type FieldGroupStatus = "draft" | "published" | "archived";
13
13
  export type GatewayMode = "db" | "flow";
14
+ export type OrgUnitKind = "Department" | "Position" | "Workstation";
14
15
  export type OwnerType = "Product" | "LegalPerson" | "NaturalPerson";
15
16
  export type RecordScopeMode = "user_app" | "global" | "explicit" | "derived" | "app_owned";
16
17
  export type Sensitivity = "public" | "restricted" | "credential";
@@ -74,6 +75,23 @@ export const ENUM_META = {
74
75
  "sort": 2
75
76
  }
76
77
  },
78
+ "OrgUnitKind": {
79
+ "Department": {
80
+ "name": "部门",
81
+ "parent_kind": "",
82
+ "sort": 0
83
+ },
84
+ "Position": {
85
+ "name": "岗位",
86
+ "parent_kind": "Department",
87
+ "sort": 1
88
+ },
89
+ "Workstation": {
90
+ "name": "工位",
91
+ "parent_kind": "Position",
92
+ "sort": 2
93
+ }
94
+ },
77
95
  "ExchangeType": {
78
96
  "SH": {
79
97
  "name": "上交所",
@@ -395,6 +413,10 @@ export const ENUM_META = {
395
413
  "label": "任职关系表",
396
414
  "sort": 150
397
415
  },
416
+ "org_units": {
417
+ "label": "组织单元表",
418
+ "sort": 155
419
+ },
398
420
  "brokers": {
399
421
  "label": "开户公司表",
400
422
  "sort": 160
@@ -683,6 +705,7 @@ export interface Strategy {
683
705
  "deleted_at"?: null | number; /** 软删除时间 */
684
706
  "name": string; /** 名称 */
685
707
  "memo"?: string; /** 备注 */
708
+ "project_id"?: string; /** 所属项目 */
686
709
  }
687
710
 
688
711
  export interface Project {
@@ -692,6 +715,7 @@ export interface Project {
692
715
  "deleted_at"?: null | number; /** 软删除时间 */
693
716
  "name": string; /** 名称 */
694
717
  "memo"?: string; /** 备注 */
718
+ "parent_id"?: string; /** 父项目 */
695
719
  }
696
720
 
697
721
  export interface Broker {
@@ -835,6 +859,19 @@ export interface CompanyEmployee {
835
859
  "employee_id": string; /** 自然人ID(owners) */
836
860
  }
837
861
 
862
+ export interface OrgUnit {
863
+ "_id"?: string; /** 主键 */
864
+ "created_at"?: number; /** 创建时间 */
865
+ "updated_at"?: number; /** 更新时间 */
866
+ "deleted_at"?: null | number; /** 软删除时间 */
867
+ "company_id": string; /** 所属公司ID */
868
+ "parent_id"?: string; /** 上级单元ID */
869
+ "kind": OrgUnitKind; /** 层级 */
870
+ "name": string; /** 名称 */
871
+ "sort"?: number; /** 排序 */
872
+ "memo"?: string; /** 备注 */
873
+ }
874
+
838
875
  export interface App {
839
876
  "_id"?: string; /** 主键 */
840
877
  "created_at"?: number; /** 创建时间 */
@@ -947,6 +984,7 @@ export const TABLES = {
947
984
  "owner_strategy": "OwnerStrategy",
948
985
  "project_owner": "ProjectOwner",
949
986
  "company_employees": "CompanyEmployee",
987
+ "org_units": "OrgUnit",
950
988
  "apps": "App",
951
989
  "app_configs": "AppConfig",
952
990
  "file_metas": "FileMeta",
@@ -1051,6 +1089,12 @@ export const AUTHORIZATION_TABLE_META = {
1051
1089
  "scope_mode": "derived",
1052
1090
  "description": "法人和员工主体均获授权后下发"
1053
1091
  },
1092
+ "org_units": {
1093
+ "name": "组织单元表",
1094
+ "category": "组织",
1095
+ "scope_mode": "global",
1096
+ "description": "授权后提供全部存活记录"
1097
+ },
1054
1098
  "brokers": {
1055
1099
  "name": "开户公司表",
1056
1100
  "category": "参考数据",
@@ -2551,6 +2595,16 @@ export const AUTHORIZATION_FIELD_CATALOG = {
2551
2595
  "selectable": true,
2552
2596
  "system_required": false,
2553
2597
  "blocked_reason": ""
2598
+ },
2599
+ {
2600
+ "key": "project_id",
2601
+ "title": "所属项目",
2602
+ "kind": "original",
2603
+ "type": "<class 'str'>",
2604
+ "sensitivity": "public",
2605
+ "selectable": true,
2606
+ "system_required": false,
2607
+ "blocked_reason": ""
2554
2608
  }
2555
2609
  ],
2556
2610
  "projects": [
@@ -2613,6 +2667,16 @@ export const AUTHORIZATION_FIELD_CATALOG = {
2613
2667
  "selectable": true,
2614
2668
  "system_required": false,
2615
2669
  "blocked_reason": ""
2670
+ },
2671
+ {
2672
+ "key": "parent_id",
2673
+ "title": "父项目",
2674
+ "kind": "original",
2675
+ "type": "<class 'str'>",
2676
+ "sensitivity": "public",
2677
+ "selectable": true,
2678
+ "system_required": false,
2679
+ "blocked_reason": ""
2616
2680
  }
2617
2681
  ],
2618
2682
  "project_owner": [
@@ -2863,6 +2927,108 @@ export const AUTHORIZATION_FIELD_CATALOG = {
2863
2927
  "blocked_reason": ""
2864
2928
  }
2865
2929
  ],
2930
+ "org_units": [
2931
+ {
2932
+ "key": "_id",
2933
+ "title": "主键",
2934
+ "kind": "original",
2935
+ "type": "<class 'str'>",
2936
+ "sensitivity": "public",
2937
+ "selectable": true,
2938
+ "system_required": true,
2939
+ "blocked_reason": ""
2940
+ },
2941
+ {
2942
+ "key": "created_at",
2943
+ "title": "创建时间",
2944
+ "kind": "original",
2945
+ "type": "<class 'float'>",
2946
+ "sensitivity": "public",
2947
+ "selectable": true,
2948
+ "system_required": false,
2949
+ "blocked_reason": ""
2950
+ },
2951
+ {
2952
+ "key": "updated_at",
2953
+ "title": "更新时间",
2954
+ "kind": "original",
2955
+ "type": "<class 'float'>",
2956
+ "sensitivity": "public",
2957
+ "selectable": true,
2958
+ "system_required": false,
2959
+ "blocked_reason": ""
2960
+ },
2961
+ {
2962
+ "key": "deleted_at",
2963
+ "title": "软删除时间",
2964
+ "kind": "original",
2965
+ "type": "float | None",
2966
+ "sensitivity": "public",
2967
+ "selectable": false,
2968
+ "system_required": false,
2969
+ "blocked_reason": "系统安全字段,禁止进入同步流"
2970
+ },
2971
+ {
2972
+ "key": "company_id",
2973
+ "title": "所属公司ID",
2974
+ "kind": "original",
2975
+ "type": "<class 'str'>",
2976
+ "sensitivity": "public",
2977
+ "selectable": true,
2978
+ "system_required": false,
2979
+ "blocked_reason": ""
2980
+ },
2981
+ {
2982
+ "key": "parent_id",
2983
+ "title": "上级单元ID",
2984
+ "kind": "original",
2985
+ "type": "<class 'str'>",
2986
+ "sensitivity": "public",
2987
+ "selectable": true,
2988
+ "system_required": false,
2989
+ "blocked_reason": ""
2990
+ },
2991
+ {
2992
+ "key": "kind",
2993
+ "title": "层级",
2994
+ "kind": "original",
2995
+ "type": "<enum 'OrgUnitKind'>",
2996
+ "sensitivity": "public",
2997
+ "selectable": true,
2998
+ "system_required": false,
2999
+ "blocked_reason": ""
3000
+ },
3001
+ {
3002
+ "key": "name",
3003
+ "title": "名称",
3004
+ "kind": "original",
3005
+ "type": "<class 'str'>",
3006
+ "sensitivity": "public",
3007
+ "selectable": true,
3008
+ "system_required": false,
3009
+ "blocked_reason": ""
3010
+ },
3011
+ {
3012
+ "key": "sort",
3013
+ "title": "排序",
3014
+ "kind": "original",
3015
+ "type": "<class 'int'>",
3016
+ "sensitivity": "public",
3017
+ "selectable": true,
3018
+ "system_required": false,
3019
+ "blocked_reason": ""
3020
+ },
3021
+ {
3022
+ "key": "memo",
3023
+ "title": "备注",
3024
+ "kind": "original",
3025
+ "type": "<class 'str'>",
3026
+ "sensitivity": "public",
3027
+ "selectable": true,
3028
+ "system_required": false,
3029
+ "blocked_reason": ""
3030
+ }
3031
+ ],
2866
3032
  "brokers": [
2867
3033
  {
2868
3034
  "key": "_id",
@@ -4482,6 +4648,14 @@ export const FIELD_SPECS = {
4482
4648
  "enum": null,
4483
4649
  "required": false,
4484
4650
  "sensitivity": "public"
4651
+ },
4652
+ {
4653
+ "key": "project_id",
4654
+ "title": "所属项目",
4655
+ "widget": "text",
4656
+ "enum": null,
4657
+ "required": false,
4658
+ "sensitivity": "public"
4485
4659
  }
4486
4660
  ],
4487
4661
  "projects": [
@@ -4500,6 +4674,14 @@ export const FIELD_SPECS = {
4500
4674
  "enum": null,
4501
4675
  "required": false,
4502
4676
  "sensitivity": "public"
4677
+ },
4678
+ {
4679
+ "key": "parent_id",
4680
+ "title": "父项目",
4681
+ "widget": "text",
4682
+ "enum": null,
4683
+ "required": false,
4684
+ "sensitivity": "public"
4503
4685
  }
4504
4686
  ],
4505
4687
  "brokers": [
@@ -4928,6 +5110,56 @@ export const FIELD_SPECS = {
4928
5110
  "sensitivity": "public"
4929
5111
  }
4930
5112
  ],
5113
+ "org_units": [
5114
+ {
5115
+ "key": "company_id",
5116
+ "title": "所属公司ID",
5117
+ "widget": "text",
5118
+ "enum": null,
5119
+ "required": true,
5120
+ "sensitivity": "public"
5121
+ },
5122
+ {
5123
+ "key": "parent_id",
5124
+ "title": "上级单元ID",
5125
+ "widget": "text",
5126
+ "enum": null,
5127
+ "required": false,
5128
+ "sensitivity": "public"
5129
+ },
5130
+ {
5131
+ "key": "kind",
5132
+ "title": "层级",
5133
+ "widget": "enum",
5134
+ "enum": "OrgUnitKind",
5135
+ "required": true,
5136
+ "sensitivity": "public"
5137
+ },
5138
+ {
5139
+ "key": "name",
5140
+ "title": "名称",
5141
+ "widget": "text",
5142
+ "enum": null,
5143
+ "required": true,
5144
+ "sensitivity": "public"
5145
+ },
5146
+ {
5147
+ "key": "sort",
5148
+ "title": "排序",
5149
+ "widget": "number",
5150
+ "enum": null,
5151
+ "required": false,
5152
+ "sensitivity": "public"
5153
+ },
5154
+ {
5155
+ "key": "memo",
5156
+ "title": "备注",
5157
+ "widget": "text",
5158
+ "enum": null,
5159
+ "required": false,
5160
+ "sensitivity": "public"
5161
+ }
5162
+ ],
4931
5163
  "apps": [
4932
5164
  {
4933
5165
  "key": "name",