@ysgroup/contracts 0.1.35 → 0.1.37

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 +360 -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.37",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/index.ts CHANGED
@@ -4,14 +4,16 @@
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" | "position_templates" | "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";
14
15
  export type OwnerType = "Product" | "LegalPerson" | "NaturalPerson";
16
+ export type PositionTemplateKind = "Position" | "Workstation";
15
17
  export type RecordScopeMode = "user_app" | "global" | "explicit" | "derived" | "app_owned";
16
18
  export type Sensitivity = "public" | "restricted" | "credential";
17
19
  export type ServerType = "td" | "md";
@@ -74,6 +76,30 @@ export const ENUM_META = {
74
76
  "sort": 2
75
77
  }
76
78
  },
79
+ "OrgUnitKind": {
80
+ "Department": {
81
+ "name": "部门",
82
+ "parent_kind": "",
83
+ "sort": 0
84
+ },
85
+ "Position": {
86
+ "name": "岗位",
87
+ "parent_kind": "Department",
88
+ "sort": 1
89
+ }
90
+ },
91
+ "PositionTemplateKind": {
92
+ "Position": {
93
+ "name": "标准岗位",
94
+ "parent_kind": "",
95
+ "sort": 0
96
+ },
97
+ "Workstation": {
98
+ "name": "工位",
99
+ "parent_kind": "Position",
100
+ "sort": 1
101
+ }
102
+ },
77
103
  "ExchangeType": {
78
104
  "SH": {
79
105
  "name": "上交所",
@@ -395,6 +421,14 @@ export const ENUM_META = {
395
421
  "label": "任职关系表",
396
422
  "sort": 150
397
423
  },
424
+ "org_units": {
425
+ "label": "组织单元表",
426
+ "sort": 155
427
+ },
428
+ "position_templates": {
429
+ "label": "标准岗位工位表",
430
+ "sort": 156
431
+ },
398
432
  "brokers": {
399
433
  "label": "开户公司表",
400
434
  "sort": 160
@@ -837,6 +871,31 @@ export interface CompanyEmployee {
837
871
  "employee_id": string; /** 自然人ID(owners) */
838
872
  }
839
873
 
874
+ export interface OrgUnit {
875
+ "_id"?: string; /** 主键 */
876
+ "created_at"?: number; /** 创建时间 */
877
+ "updated_at"?: number; /** 更新时间 */
878
+ "deleted_at"?: null | number; /** 软删除时间 */
879
+ "company_id": string; /** 所属公司ID */
880
+ "parent_id"?: string; /** 上级单元ID */
881
+ "kind": OrgUnitKind; /** 层级 */
882
+ "name": string; /** 名称 */
883
+ "sort"?: number; /** 排序 */
884
+ "memo"?: string; /** 备注 */
885
+ }
886
+
887
+ export interface PositionTemplate {
888
+ "_id"?: string; /** 主键 */
889
+ "created_at"?: number; /** 创建时间 */
890
+ "updated_at"?: number; /** 更新时间 */
891
+ "deleted_at"?: null | number; /** 软删除时间 */
892
+ "parent_id"?: string; /** 上级标准岗位ID */
893
+ "kind": PositionTemplateKind; /** 层级 */
894
+ "name": string; /** 名称 */
895
+ "sort"?: number; /** 排序 */
896
+ "memo"?: string; /** 备注 */
897
+ }
898
+
840
899
  export interface App {
841
900
  "_id"?: string; /** 主键 */
842
901
  "created_at"?: number; /** 创建时间 */
@@ -949,6 +1008,8 @@ export const TABLES = {
949
1008
  "owner_strategy": "OwnerStrategy",
950
1009
  "project_owner": "ProjectOwner",
951
1010
  "company_employees": "CompanyEmployee",
1011
+ "org_units": "OrgUnit",
1012
+ "position_templates": "PositionTemplate",
952
1013
  "apps": "App",
953
1014
  "app_configs": "AppConfig",
954
1015
  "file_metas": "FileMeta",
@@ -1053,6 +1114,18 @@ export const AUTHORIZATION_TABLE_META = {
1053
1114
  "scope_mode": "derived",
1054
1115
  "description": "法人和员工主体均获授权后下发"
1055
1116
  },
1117
+ "org_units": {
1118
+ "name": "组织单元表",
1119
+ "category": "组织",
1120
+ "scope_mode": "global",
1121
+ "description": "授权后提供全部存活记录"
1122
+ },
1123
+ "position_templates": {
1124
+ "name": "标准岗位工位表",
1125
+ "category": "组织",
1126
+ "scope_mode": "global",
1127
+ "description": "授权后提供全部存活记录"
1128
+ },
1056
1129
  "brokers": {
1057
1130
  "name": "开户公司表",
1058
1131
  "category": "参考数据",
@@ -2885,6 +2958,200 @@ export const AUTHORIZATION_FIELD_CATALOG = {
2885
2958
  "blocked_reason": ""
2886
2959
  }
2887
2960
  ],
2961
+ "org_units": [
2962
+ {
2963
+ "key": "_id",
2964
+ "title": "主键",
2965
+ "kind": "original",
2966
+ "type": "<class 'str'>",
2967
+ "sensitivity": "public",
2968
+ "selectable": true,
2969
+ "system_required": true,
2970
+ "blocked_reason": ""
2971
+ },
2972
+ {
2973
+ "key": "created_at",
2974
+ "title": "创建时间",
2975
+ "kind": "original",
2976
+ "type": "<class 'float'>",
2977
+ "sensitivity": "public",
2978
+ "selectable": true,
2979
+ "system_required": false,
2980
+ "blocked_reason": ""
2981
+ },
2982
+ {
2983
+ "key": "updated_at",
2984
+ "title": "更新时间",
2985
+ "kind": "original",
2986
+ "type": "<class 'float'>",
2987
+ "sensitivity": "public",
2988
+ "selectable": true,
2989
+ "system_required": false,
2990
+ "blocked_reason": ""
2991
+ },
2992
+ {
2993
+ "key": "deleted_at",
2994
+ "title": "软删除时间",
2995
+ "kind": "original",
2996
+ "type": "float | None",
2997
+ "sensitivity": "public",
2998
+ "selectable": false,
2999
+ "system_required": false,
3000
+ "blocked_reason": "系统安全字段,禁止进入同步流"
3001
+ },
3002
+ {
3003
+ "key": "company_id",
3004
+ "title": "所属公司ID",
3005
+ "kind": "original",
3006
+ "type": "<class 'str'>",
3007
+ "sensitivity": "public",
3008
+ "selectable": true,
3009
+ "system_required": false,
3010
+ "blocked_reason": ""
3011
+ },
3012
+ {
3013
+ "key": "parent_id",
3014
+ "title": "上级单元ID",
3015
+ "kind": "original",
3016
+ "type": "<class 'str'>",
3017
+ "sensitivity": "public",
3018
+ "selectable": true,
3019
+ "system_required": false,
3020
+ "blocked_reason": ""
3021
+ },
3022
+ {
3023
+ "key": "kind",
3024
+ "title": "层级",
3025
+ "kind": "original",
3026
+ "type": "<enum 'OrgUnitKind'>",
3027
+ "sensitivity": "public",
3028
+ "selectable": true,
3029
+ "system_required": false,
3030
+ "blocked_reason": ""
3031
+ },
3032
+ {
3033
+ "key": "name",
3034
+ "title": "名称",
3035
+ "kind": "original",
3036
+ "type": "<class 'str'>",
3037
+ "sensitivity": "public",
3038
+ "selectable": true,
3039
+ "system_required": false,
3040
+ "blocked_reason": ""
3041
+ },
3042
+ {
3043
+ "key": "sort",
3044
+ "title": "排序",
3045
+ "kind": "original",
3046
+ "type": "<class 'int'>",
3047
+ "sensitivity": "public",
3048
+ "selectable": true,
3049
+ "system_required": false,
3050
+ "blocked_reason": ""
3051
+ },
3052
+ {
3053
+ "key": "memo",
3054
+ "title": "备注",
3055
+ "kind": "original",
3056
+ "type": "<class 'str'>",
3057
+ "sensitivity": "public",
3058
+ "selectable": true,
3059
+ "system_required": false,
3060
+ "blocked_reason": ""
3061
+ }
3062
+ ],
3063
+ "position_templates": [
3064
+ {
3065
+ "key": "_id",
3066
+ "title": "主键",
3067
+ "kind": "original",
3068
+ "type": "<class 'str'>",
3069
+ "sensitivity": "public",
3070
+ "selectable": true,
3071
+ "system_required": true,
3072
+ "blocked_reason": ""
3073
+ },
3074
+ {
3075
+ "key": "created_at",
3076
+ "title": "创建时间",
3077
+ "kind": "original",
3078
+ "type": "<class 'float'>",
3079
+ "sensitivity": "public",
3080
+ "selectable": true,
3081
+ "system_required": false,
3082
+ "blocked_reason": ""
3083
+ },
3084
+ {
3085
+ "key": "updated_at",
3086
+ "title": "更新时间",
3087
+ "kind": "original",
3088
+ "type": "<class 'float'>",
3089
+ "sensitivity": "public",
3090
+ "selectable": true,
3091
+ "system_required": false,
3092
+ "blocked_reason": ""
3093
+ },
3094
+ {
3095
+ "key": "deleted_at",
3096
+ "title": "软删除时间",
3097
+ "kind": "original",
3098
+ "type": "float | None",
3099
+ "sensitivity": "public",
3100
+ "selectable": false,
3101
+ "system_required": false,
3102
+ "blocked_reason": "系统安全字段,禁止进入同步流"
3103
+ },
3104
+ {
3105
+ "key": "parent_id",
3106
+ "title": "上级标准岗位ID",
3107
+ "kind": "original",
3108
+ "type": "<class 'str'>",
3109
+ "sensitivity": "public",
3110
+ "selectable": true,
3111
+ "system_required": false,
3112
+ "blocked_reason": ""
3113
+ },
3114
+ {
3115
+ "key": "kind",
3116
+ "title": "层级",
3117
+ "kind": "original",
3118
+ "type": "<enum 'PositionTemplateKind'>",
3119
+ "sensitivity": "public",
3120
+ "selectable": true,
3121
+ "system_required": false,
3122
+ "blocked_reason": ""
3123
+ },
3124
+ {
3125
+ "key": "name",
3126
+ "title": "名称",
3127
+ "kind": "original",
3128
+ "type": "<class 'str'>",
3129
+ "sensitivity": "public",
3130
+ "selectable": true,
3131
+ "system_required": false,
3132
+ "blocked_reason": ""
3133
+ },
3134
+ {
3135
+ "key": "sort",
3136
+ "title": "排序",
3137
+ "kind": "original",
3138
+ "type": "<class 'int'>",
3139
+ "sensitivity": "public",
3140
+ "selectable": true,
3141
+ "system_required": false,
3142
+ "blocked_reason": ""
3143
+ },
3144
+ {
3145
+ "key": "memo",
3146
+ "title": "备注",
3147
+ "kind": "original",
3148
+ "type": "<class 'str'>",
3149
+ "sensitivity": "public",
3150
+ "selectable": true,
3151
+ "system_required": false,
3152
+ "blocked_reason": ""
3153
+ }
3154
+ ],
2888
3155
  "brokers": [
2889
3156
  {
2890
3157
  "key": "_id",
@@ -4966,6 +5233,98 @@ export const FIELD_SPECS = {
4966
5233
  "sensitivity": "public"
4967
5234
  }
4968
5235
  ],
5236
+ "org_units": [
5237
+ {
5238
+ "key": "company_id",
5239
+ "title": "所属公司ID",
5240
+ "widget": "text",
5241
+ "enum": null,
5242
+ "required": true,
5243
+ "sensitivity": "public"
5244
+ },
5245
+ {
5246
+ "key": "parent_id",
5247
+ "title": "上级单元ID",
5248
+ "widget": "text",
5249
+ "enum": null,
5250
+ "required": false,
5251
+ "sensitivity": "public"
5252
+ },
5253
+ {
5254
+ "key": "kind",
5255
+ "title": "层级",
5256
+ "widget": "enum",
5257
+ "enum": "OrgUnitKind",
5258
+ "required": true,
5259
+ "sensitivity": "public"
5260
+ },
5261
+ {
5262
+ "key": "name",
5263
+ "title": "名称",
5264
+ "widget": "text",
5265
+ "enum": null,
5266
+ "required": true,
5267
+ "sensitivity": "public"
5268
+ },
5269
+ {
5270
+ "key": "sort",
5271
+ "title": "排序",
5272
+ "widget": "number",
5273
+ "enum": null,
5274
+ "required": false,
5275
+ "sensitivity": "public"
5276
+ },
5277
+ {
5278
+ "key": "memo",
5279
+ "title": "备注",
5280
+ "widget": "text",
5281
+ "enum": null,
5282
+ "required": false,
5283
+ "sensitivity": "public"
5284
+ }
5285
+ ],
5286
+ "position_templates": [
5287
+ {
5288
+ "key": "parent_id",
5289
+ "title": "上级标准岗位ID",
5290
+ "widget": "text",
5291
+ "enum": null,
5292
+ "required": false,
5293
+ "sensitivity": "public"
5294
+ },
5295
+ {
5296
+ "key": "kind",
5297
+ "title": "层级",
5298
+ "widget": "enum",
5299
+ "enum": "PositionTemplateKind",
5300
+ "required": true,
5301
+ "sensitivity": "public"
5302
+ },
5303
+ {
5304
+ "key": "name",
5305
+ "title": "名称",
5306
+ "widget": "text",
5307
+ "enum": null,
5308
+ "required": true,
5309
+ "sensitivity": "public"
5310
+ },
5311
+ {
5312
+ "key": "sort",
5313
+ "title": "排序",
5314
+ "widget": "number",
5315
+ "enum": null,
5316
+ "required": false,
5317
+ "sensitivity": "public"
5318
+ },
5319
+ {
5320
+ "key": "memo",
5321
+ "title": "备注",
5322
+ "widget": "text",
5323
+ "enum": null,
5324
+ "required": false,
5325
+ "sensitivity": "public"
5326
+ }
5327
+ ],
4969
5328
  "apps": [
4970
5329
  {
4971
5330
  "key": "name",