@ysgroup/contracts 0.1.35 → 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 +195 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ysgroup/contracts",
3
- "version": "0.1.35",
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
@@ -837,6 +859,19 @@ export interface CompanyEmployee {
837
859
  "employee_id": string; /** 自然人ID(owners) */
838
860
  }
839
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
+
840
875
  export interface App {
841
876
  "_id"?: string; /** 主键 */
842
877
  "created_at"?: number; /** 创建时间 */
@@ -949,6 +984,7 @@ export const TABLES = {
949
984
  "owner_strategy": "OwnerStrategy",
950
985
  "project_owner": "ProjectOwner",
951
986
  "company_employees": "CompanyEmployee",
987
+ "org_units": "OrgUnit",
952
988
  "apps": "App",
953
989
  "app_configs": "AppConfig",
954
990
  "file_metas": "FileMeta",
@@ -1053,6 +1089,12 @@ export const AUTHORIZATION_TABLE_META = {
1053
1089
  "scope_mode": "derived",
1054
1090
  "description": "法人和员工主体均获授权后下发"
1055
1091
  },
1092
+ "org_units": {
1093
+ "name": "组织单元表",
1094
+ "category": "组织",
1095
+ "scope_mode": "global",
1096
+ "description": "授权后提供全部存活记录"
1097
+ },
1056
1098
  "brokers": {
1057
1099
  "name": "开户公司表",
1058
1100
  "category": "参考数据",
@@ -2885,6 +2927,108 @@ export const AUTHORIZATION_FIELD_CATALOG = {
2885
2927
  "blocked_reason": ""
2886
2928
  }
2887
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
+ ],
2888
3032
  "brokers": [
2889
3033
  {
2890
3034
  "key": "_id",
@@ -4966,6 +5110,56 @@ export const FIELD_SPECS = {
4966
5110
  "sensitivity": "public"
4967
5111
  }
4968
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
+ ],
4969
5163
  "apps": [
4970
5164
  {
4971
5165
  "key": "name",